blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 3 264 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 5 140 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 905
values | visit_date timestamp[us]date 2015-08-09 11:21:18 2023-09-06 10:45:07 | revision_date timestamp[us]date 1997-09-14 05:04:47 2023-09-17 19:19:19 | committer_date timestamp[us]date 1997-09-14 05:04:47 2023-09-06 06:22:19 | github_id int64 3.89k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22
values | gha_event_created_at timestamp[us]date 2012-06-07 00:51:45 2023-09-14 21:58:39 ⌀ | gha_created_at timestamp[us]date 2008-03-27 23:40:48 2023-08-21 23:17:38 ⌀ | gha_language stringclasses 141
values | src_encoding stringclasses 34
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 3 10.4M | extension stringclasses 115
values | content stringlengths 3 10.4M | authors listlengths 1 1 | author_id stringlengths 0 158 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
692a0196cb9b8190dd1d12a2606ebe4a2c8b9bec | 4b6ddd02f72402e53f5b4f90075e30a1cac696e0 | /parser.h | c36945ff9ce0266c68b7b569f5541e023fe625cb | [] | no_license | KL775/ChessPersonas | abcb01ab1f515b22898b59f85c49af8bf21b45f2 | 0a1fbc67aeb17a9190a1e12cabd1d3f2f1c5b754 | refs/heads/master | 2021-01-13T11:58:32.806458 | 2017-02-01T23:15:06 | 2017-02-01T23:15:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 910 | h | //
// file: parser.h
// Chess Persona Modeling
//
// info: file PgnParser Class Signature
//
#ifndef parser_h
#define parser_h
#include <unordered_map>
#include <string>
#include <fstream>
#include <sstream>
#include <deque>
namespace InfoProcess {
//Class to Parse PGN Files
class PgnParser{
public:
PgnParser(const std::string& filename); // constructor
std::string getInfo(const std::string& key); // method info about the event
std::deque<std::string> whiteMoveset(); // method the white moveset
std::deque<std::string> blackMoveset(); // method the white moveset
private:
std::unordered_map<std::string, std::string>eventInfo; // container to store event info
std::deque<std::string>whiteMoveSet, blackMoveSet; // containers to store move sets
};
}
#endif /* parser_h */
| [
"msk610@nyu.edu"
] | msk610@nyu.edu |
7ab86cdcbcac14fbb387637bc41247e992ccb8fe | 2eb4b5d4b1ad61f654551d041d154d2059b66d38 | /ReciboLuz.cpp | f92b147c05ea152ffa7d15bea41d80284378a124 | [] | no_license | L3onet/ReciboLuz | 9181341e60fe294243831beebab1180c05db649e | e2f8cc8dbaf5e05af216753eb75b9704fce5abe0 | refs/heads/master | 2020-09-05T13:36:09.082153 | 2019-11-12T06:44:43 | 2019-11-12T06:44:43 | 220,121,333 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,036 | cpp | //
// Created by Leonel Gonzalez Vidales on 23/10/19.
//
#include <iostream>
#include "ReciboLuz.h"
using namespace std;
using std::cout;
using std::endl;
// Nombre de la clase
/*
* En C++, las clases se escriben en diferentes archivos, un archivo por
* cada clase definida en el diagrama de clases
*/
int ReciboLuz::calcularConsumo(int lecturaAnterior, int lecturaActual) {
consumokw = lecturaActual - lecturaAnterior;
if (consumokw == 0){
consumokw = 10;
}
return consumokw;
}
float ReciboLuz::calcularCostoConsumo(float costoKw, int consumoPeriodo) {
float costoConsumo = 0;
costoConsumo = costoKw * consumoPeriodo;
return costoConsumo;
}
float ReciboLuz::calcularTotalPeriodo(float costoConsumo, int consumoPeriodo) {
if (consumoPeriodo < 500)
totalapagar = costoConsumo * 1.22;
if (consumoPeriodo >= 500 & consumoPeriodo < 900)
totalapagar = costoConsumo * 1.18;
if (consumoPeriodo >= 900)
totalapagar = costoConsumo * 1.12;
return totalapagar;
}
| [
"leonelgv@gmail.com"
] | leonelgv@gmail.com |
9787b7bd7b9f4f722b1bfa81df6bec1d3d8e32f0 | a0e137c02ab909e41d711a83b0512ee9fb6c9313 | /Examenes/Proyecto I Unidad/Codigo/startShip.cpp | afa18fdb78b119472940c5093b79aa754b834a6f | [
"MIT"
] | permissive | allanlopez07/cpp | de60bc83a33c44dab3c241c4456fb7f391f6fd86 | b2a7d8a65204aea50050a84e043ce65403c4855f | refs/heads/main | 2023-03-05T05:07:49.263581 | 2021-02-21T23:15:16 | 2021-02-21T23:15:16 | 336,648,310 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,564 | cpp | #include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <windows.h>
#include <list>
using namespace std;
#define UP 72
#define LEFT 75
#define RIGHT 77
#define DOWN 80
void gotoxy(int x, int y)
{
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
COORD dwPos;
dwPos.X = x; // Starts from 0
dwPos.Y = y; // Starts from 0
SetConsoleCursorPosition(hCon, dwPos);
}
void HideCursor()
{
HANDLE hCon = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cci;
cci.dwSize = 1;
cci.bVisible = FALSE;
SetConsoleCursorInfo(hCon, &cci);
}
void DrawWhiteSpace(int a_x, int a_y, int b_x, int b_y)
{
for (int i = a_x; i < b_x; i++)
{
for (int j = a_y; j < b_y; j++)
{
gotoxy(i, j);
printf(" ");
}
}
}
void DrawWindowFrame(int a_x, int a_y, int b_x, int b_y)
{
DrawWhiteSpace(a_x, a_y, b_x, b_y);
for (int i = a_x; i < b_x; i++)
{
gotoxy(i, a_y);
printf("%c", 205);
gotoxy(i, b_y);
printf("%c", 205);
}
for (int i = a_y; i < b_y; i++)
{
gotoxy(a_x, i);
printf("%c", 186);
gotoxy(b_x, i);
printf("%c", 186);
}
gotoxy(a_x, a_y);
printf("%c", 201);
gotoxy(b_x, a_y);
printf("%c", 187);
gotoxy(a_x, b_y);
printf("%c", 200);
gotoxy(b_x, b_y);
printf("%c", 188);
}
void DrawGameLimits()
{
DrawWindowFrame(1, 2, 79, 23);
gotoxy(2, 1);
printf("HP:");
gotoxy(16, 1);
printf("ENERGY:");
gotoxy(50, 1);
printf("SCORE:");
}
void WelcomeMessage()
{
int x = 13;
int y = 6;
gotoxy(x, y);
printf(" _____ _____ _ _ ");
gotoxy(x, y + 1);
printf("| __|___ ___ ___ ___ | __| |_ ___ ___| |_ ___ ___ ");
gotoxy(x, y + 2);
printf("|__ | . | .'| _| -_| |__ | | . | . | _| -_| _|");
gotoxy(x, y + 3);
printf("|_____| _|__,|___|___| |_____|_|_|___|___|_| |___|_| ");
gotoxy(x, y + 4);
printf(" |_|");
gotoxy(x, y + 6);
printf(" Presione cualquier tecla para empezar");
}
void GameOverDefeatMessage()
{
int a_x = 30;
int a_y = 11;
int b_x = a_x + 23;
int b_y = a_y + 4;
DrawWindowFrame(a_x, a_y, b_x, b_y);
gotoxy(a_x + 1, a_y + 2);
printf(" PERDISTE!!!");
}
void GameOverVictoryMessage()
{
int a_x = 30;
int a_y = 11;
int b_x = a_x + 23;
int b_y = a_y + 4;
DrawWindowFrame(a_x, a_y, b_x, b_y);
gotoxy(a_x + 1, a_y + 2);
printf(" VICTORIA!!!");
}
void SpecialMessage()
{
DrawWhiteSpace(1, 1, 80, 24);
gotoxy(30, 11);
printf("Gracias por jugar! :3");
}
class SpaceShip
{
private:
int x;
int y;
int hp;
int energy; // energia points
bool imDead;
public:
int X() { return x; }
int Y() { return y; }
int HP() { return hp; }
bool isDead()
{
DrawSpaceShipInfo();
return imDead;
}
SpaceShip(int _x, int _y)
{
x = _x;
y = _y;
hp = 3;
energy = 5;
imDead = false;
}
void DrawSpaceShipInfo()
{
gotoxy(5, 1);
printf(" ");
for (int i = 0; i < hp; i++)
{
gotoxy(5 + i, 1);
printf("%c", 3);
}
gotoxy(23, 1);
printf(" ");
for (int i = 0; i < energy; i++)
{
gotoxy(23 + i, 1);
printf("%c", 222);
}
}
void Draw()
{
gotoxy(x, y);
printf(" %c ", 30);
gotoxy(x, y + 1);
printf(" %c ", 4);
gotoxy(x, y + 2);
printf("%c%c%c%c%c", 17, 30, 223, 30, 16);
}
void Erase()
{
gotoxy(x, y);
printf(" ");
gotoxy(x, y + 1);
printf(" ");
gotoxy(x, y + 2);
printf(" ");
}
void Damage()
{
energy--;
if (energy == 0)
{
Explosion();
}
else
{
Erase();
gotoxy(x, y);
printf(" * ");
gotoxy(x, y + 1);
printf(" * ");
gotoxy(x, y + 2);
printf("*****");
Sleep(100);
}
}
void Explosion()
{
hp--;
Erase();
gotoxy(x, y);
printf(" * ");
gotoxy(x, y + 1);
printf(" * ");
gotoxy(x, y + 2);
printf("*****");
Sleep(100);
Erase();
gotoxy(x, y);
printf(" * * ");
gotoxy(x, y + 1);
printf("* * *");
gotoxy(x, y + 2);
printf(" * * ");
Sleep(100);
Erase();
gotoxy(x, y);
printf("* *");
gotoxy(x, y + 1);
printf(" * * ");
gotoxy(x, y + 2);
printf("* * *");
Sleep(100);
if (hp > 0)
{
energy = 5;
}
else
{
imDead = true;
}
}
void Move()
{
if (kbhit())
{
Erase();
char key = getch();
switch (key)
{
case LEFT:
if (x > 2)
x -= 1;
break;
case RIGHT:
if (x + 4 < 77)
x += 1;
break;
case UP:
if (y > 3)
y -= 1;
break;
case DOWN:
if (y + 2 < 22)
y += 1;
break;
}
}
Draw();
}
};
class Asteroid
{
private:
int x;
int y;
public:
int X() { return x; }
int Y() { return y; }
Asteroid(int _x, int _y)
{
x = _x;
y = _y;
}
void Draw()
{
gotoxy(x, y);
printf("*");
}
void Collision(SpaceShip &ss)
{
if (((x >= ss.X()) && (x <= ss.X() + 5)) && ((y >= ss.Y()) && (y <= ss.Y() + 2)))
{
ss.Damage();
gotoxy(x, y);
printf(" ");
x = rand() % 74 + 3;
y = 4;
}
else
{
gotoxy(x, y);
printf(" ");
y++;
if (y > 22)
{
x = rand() % 74 + 3;
y = 4;
}
Draw();
}
}
};
class Bullet
{
private:
int x;
int y;
public:
int X() { return x; }
int Y() { return y; }
Bullet(int _x, int _y)
{
x = _x;
y = _y;
}
bool isOut()
{
if (y <= 3)
{
gotoxy(x, y);
printf(" ");
return true;
}
else
{
return false;
}
}
void Move()
{
gotoxy(x, y);
printf(" ");
y--;
gotoxy(x, y);
printf(".");
}
};
int starShip()
{
HideCursor();
WelcomeMessage();
getch();
DrawGameLimits();
list<Bullet *> Bullets;
list<Bullet *>::iterator bullet;
list<Asteroid *> Asteroids;
list<Asteroid *>::iterator asteroid;
for (int i = 0; i < 10; i++)
{
Asteroids.push_back(new Asteroid(rand() % 78 + 1, rand() % 4 + 3));
}
SpaceShip ss = SpaceShip(40, 20);
int score = 0;
while (!ss.isDead() && score != 100)
{
if (kbhit())
{
char key = getch();
if (key == ' ')
{
Bullets.push_back(new Bullet(ss.X() + 2, ss.Y() - 1));
}
}
for (bullet = Bullets.begin(); bullet != Bullets.end(); bullet++)
{
(*bullet)->Move();
if ((*bullet)->isOut())
{
delete (*bullet);
bullet = Bullets.erase(bullet);
}
}
for (asteroid = Asteroids.begin(); asteroid != Asteroids.end(); asteroid++)
{
(*asteroid)->Collision(ss);
}
for (asteroid = Asteroids.begin(); asteroid != Asteroids.end(); asteroid++)
{
for (bullet = Bullets.begin(); bullet != Bullets.end(); bullet++)
{
int astX = (*asteroid)->X();
int astY = (*asteroid)->Y();
int bulX = (*bullet)->X();
int bulY = (*bullet)->Y();
if ((astX == bulX) && ((astY == bulY) || (astY + 1 == bulY)))
{
gotoxy(bulX, bulY);
printf(" ");
gotoxy(astX, astY);
printf("X");
printf(" ");
delete (*bullet);
bullet = Bullets.erase(bullet);
delete (*asteroid);
asteroid = Asteroids.erase(asteroid);
Asteroids.push_back(new Asteroid(rand() % 78 + 1, rand() % 4 + 3));
score += 10;
}
}
}
ss.Move();
gotoxy(56, 1);
printf("%d", score);
Sleep(30);
}
if (!ss.isDead())
{
GameOverVictoryMessage();
}
else
{
GameOverDefeatMessage();
}
Sleep(5000);
SpecialMessage();
Sleep(5000);
return 0;
} | [
"allanlopezxd28@gmail.com"
] | allanlopezxd28@gmail.com |
83ce207e4cd062128f511d497733807ed1d87d25 | f23c8df7d0e570b286764e3bf16d4da0981f995d | /source/cure/ShaderState.h | e70b4d7684504e9e6fe49061a63ec782e85b48ea | [
"MIT"
] | permissive | mhourousha/cuRE | 7d48be4b282348c4e5200c511b7101028f897f85 | ccba6a29bba4445300cbb630befe57e31f0d80cb | refs/heads/master | 2022-01-26T13:05:31.782134 | 2018-10-04T21:56:06 | 2018-10-04T21:56:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 537 | h |
#ifndef INCLUDED_CURE_SHADER_STATE
#define INCLUDED_CURE_SHADER_STATE
#pragma once
#include <Camera.h>
#include <CUDA/module.h>
namespace cuRE
{
class PipelineModule;
class ShaderState
{
private:
CUdeviceptr camera;
public:
ShaderState(const ShaderState&) = delete;
ShaderState& operator =(const ShaderState&) = delete;
ShaderState(const PipelineModule& module);
void setCamera(const Camera::UniformBuffer& buffer);
};
}
#endif // INCLUDED_GLRENDERER_SHADER_STATE
| [
"michael.kenzel@gmail.com"
] | michael.kenzel@gmail.com |
ad63bddd94628027434e2ff79909c1bccad39cb1 | fb55b1973869bf67eb24948e836da31918196860 | /Open_Gl/lib/UI/uiglCircle.h | 66676fadf98f417ee4ac93bb0ec64c3db26d6bf4 | [] | no_license | gagikpog/Translate | e90257dd12266eaad4b1498881532f04dabff165 | 99afb20d32e0c5cf54faf67deb42fb485f199eb6 | refs/heads/master | 2020-04-07T05:14:13.945537 | 2018-11-25T10:31:07 | 2018-11-25T10:31:07 | 124,562,494 | 0 | 0 | null | 2018-03-11T08:45:06 | 2018-03-09T16:03:18 | C++ | WINDOWS-1251 | C++ | false | false | 853 | h | #ifndef UIGLCIRCLE_H
#define UIGLCIRCLE_H
#include "../uigl.h"
#include "../uiglIForms.h"
namespace UIGL {
//окружность
class uiglCircle :public UiglIForms
{
public:
uiglCircle();
uiglCircle(std::string name) :uiglCircle() { Name = name; }
~uiglCircle() {}
UiglEvent MouseFunc(int button, int state, int ax, int ay);
UiglEvent PassiveMotionFunc(int ax, int ay);
UiglEvent MotionFunc(float ax, float ay);
UiglEvent MouseWheelFunc(int button, int state, int ax, int ay);
UiglEvent KeyboardFunc(unsigned char key, int ax, int ay);
UiglEvent SpecialFunc(int key, int ax, int ay);
UiglEvent KeyboardUpFunc(unsigned char key, int ax, int ay);
UiglEvent SpecialUpFunc(int key, int ax, int ay);
void Init();
void Update();
//радиус
float R;
protected:
private:
uiglSize Size;
};
}
#endif // !UIGLCIRCLE_H | [
"gagikpog@gmail.com"
] | gagikpog@gmail.com |
854a11925ea245a11efbedc6f0e7eb55dfe364d1 | 1d490d73c1f5d3405c0312e918cbaa3a8a6e6b23 | /m_murray_RomanNumeral/roman.cpp | ecb367c4f13043b0a795285f5c9cbf837472ccef | [] | no_license | IdivideBy0/m_murray_RomanNumeral | ef44db393203d1d7f24742aab3db59e3eb97127c | ec4fd129960616ba48a2efb7f0e916f3ab99629f | refs/heads/master | 2020-05-20T06:56:06.194881 | 2019-05-07T16:32:14 | 2019-05-07T16:32:14 | 185,440,277 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,289 | cpp | #include <iostream>
#include <string>
#include "roman.h"
using namespace std;
RomanType::RomanType()
{
}
RomanType::RomanType(string)
{
romanStr = "";
}
RomanType::RomanType(int)
{
arabicInt = 0;
}
RomanType::~RomanType()
{
}
void RomanType::setRomanString(string instr)
{
//romanStr = ""; //initialize string
romanStr = instr;
}
void RomanType::setArabic(int userint)
{
//arabicInt = 0; //initialize to zero
arabicInt = userint;
}
string RomanType::getRomanString() const
{
return romanStr;
}
int RomanType::getArabic() const
{
return arabicInt;
}
void RomanType::printRoman()
{
cout << romanStr << endl;
}
void RomanType::printArabic()
{
cout << arabicInt << endl;
}
void RomanType::convertRoman(string romStr)
{
int strLen = romStr.length();
int previous = 0;
int sum = 0;
int romIndex = 0;
bool invalid = false;
while((romIndex < strLen) && (invalid == false))
{
switch(romStr[romIndex])
{
case 'M':
sum = sum + 1000;
if(previous < 1000)
{
sum = sum - 2 * previous;
}
previous = 1000;
break;
case 'D':
sum = sum + 500;
if(previous < 500)
{
sum = sum - 2 * previous;
}
previous = 500;
break;
case 'C':
sum = sum + 100;
if(previous < 100)
{
sum = sum - 2 * previous;
}
previous = 100;
break;
case 'L':
sum = sum + 50;
if(previous < 50)
{
sum = sum - 2 * previous;
}
previous = 50;
break;
case 'X':
sum = sum + 10;
if(previous < 10)
{
sum = sum - 2 * previous;
}
previous = 10;
break;
case 'V':
sum = sum + 5;
if(previous < 5)
{
sum = sum - 2 * previous;
}
previous = 5;
break;
case 'I':
sum = sum + 1;
if(previous < 1)
{
sum = sum - 2 * previous;
}
previous = 1;
break;
default:
cout << "Non Roman numeral detected -->" << romStr[romIndex] << endl;
invalid = true;
sum = 0;
}
romIndex++;
}
arabicInt = sum;
}
void RomanType::convertArabic(int myint)
{
// create a paralled lookup array
int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
string numerals[] = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" };
string temp = "";
for(int i = 0; i < 13; i++) // loop through the values in our array
{
while(myint >= values[i])
{
myint = myint - values[i]; // subtract from the number it found
temp = temp + numerals[i]; // concatenate and build Roman numeral
}
}
romanStr = temp;
}
bool RomanType::isRoman(string mystr)
{
// variables needed for our loop
int strLen = mystr.length();
bool isRoman = false;
int temp = 0;
// loop through each character and test for an Arabic character
for(int i = 0; i < strLen; i++)
{
temp = static_cast<int>(mystr[i]);
if (temp == static_cast<int>('0') || temp == static_cast<int>('1') || temp == static_cast<int>('2') || temp == static_cast<int>('3')
|| temp == static_cast<int>('4') || temp == static_cast<int>('5') ||
temp == static_cast<int>('6') || temp == static_cast<int>('7') || temp == static_cast<int>('8') || temp == static_cast<int>('9'))
{
isRoman = false;
}
else
{
isRoman = true;
break;
}
}
return isRoman;
} | [
"num1stratplayer@yahoo.com"
] | num1stratplayer@yahoo.com |
2084798cb1f60f508a764e8edb80b4275957a328 | b93b18b2b6187aff49684d4a9e0aa92fd2ebeeff | /UnitTests/TestDetourNoTDx64.cpp | 10870ad5a31cca2d4e01bd169a85dc93c0762be1 | [
"MIT"
] | permissive | kalinowskitomasz/PolyHook_2_0 | 5d4916f8a7f379c33dc8ffc0fadc638d64081ff4 | 5af5f63349b07b69fbecf832d17baf9cb57a6e1e | refs/heads/master | 2020-04-01T01:12:29.258587 | 2019-01-22T18:25:27 | 2019-01-22T18:25:27 | 152,730,047 | 2 | 0 | MIT | 2019-03-20T07:38:58 | 2018-10-12T09:51:15 | C++ | UTF-8 | C++ | false | false | 8,322 | cpp | #include <Catch.hpp>
#include "headers/Detour/ILCallback.hpp"
#pragma warning( disable : 4244)
#include "headers/tests/TestEffectTracker.hpp"
/**These tests can spontaneously fail if the compiler desides to optimize away
the handler or inline the function. NOINLINE attempts to fix the latter, the former
is out of our control but typically returning volatile things, volatile locals, and a
printf inside the body can mitigate this significantly. Do serious checking in debug
or releasewithdebinfo mode (relwithdebinfo optimizes sliiiightly less)**/
EffectTracker effectsNTD64;
typedef int(*Func)(void);
TEST_CASE("Minimal Example", "[AsmJit]") {
asmjit::JitRuntime rt; // Runtime specialized for JIT code execution.
asmjit::CodeHolder code; // Holds code and relocation information.
code.init(rt.codeInfo()); // Initialize to the same arch as JIT runtime.
asmjit::x86::Assembler a(&code); // Create and attach X86Assembler to `code`.
a.mov(asmjit::x86::eax, 1); // Move one to 'eax' register.
a.ret(); // Return from function.
// ----> X86Assembler is no longer needed from here and can be destroyed <----
Func fn;
asmjit::Error err = rt.add(&fn, &code); // Add the generated code to the runtime.
if (err) {
REQUIRE(false);
}
int result = fn(); // Execute the generated code.
REQUIRE(result == 1);
// All classes use RAII, all resources will be released before `main()` returns,
// the generated function can be, however, released explicitly if you intend to
// reuse or keep the runtime alive, which you should in a production-ready code.
rt.release(fn);
}
#include "headers/Detour/X64Detour.hpp"
#include "headers/CapstoneDisassembler.hpp"
NOINLINE void hookMeInt(int a) {
volatile int var = 1;
int var2 = var + a;
printf("%d %d %I64X\n", var, var2, (uint64_t)_ReturnAddress());
}
NOINLINE void hookMeFloat(float a) {
float ans = 1.0f;
ans += a;
printf("%f %f\n", ans, a);
}
NOINLINE void hookMeIntFloatDouble(int a, float b, double c) {
volatile float ans = 0.0f;
ans += (float)a;
ans += c;
ans += b;
printf("%d %f %f %f\n", a, b, c, ans);
}
NOINLINE void myCallback(const PLH::ILCallback::Parameters* p, const uint8_t count, const PLH::ILCallback::ReturnValue* retVal) {
printf("Argument Count: %d\n", count);
for (int i = 0; i < count; i++) {
printf("Arg: %d asInt:%d asFloat:%f asDouble:%f\n", i, *(int*)p->getArgPtr(i), *(float*)p->getArgPtr(i), *(double*)p->getArgPtr(i));
// one of the args must be pretty l33t
float fArg = *(float*)p->getArgPtr(i);
double dArg = *(double*)p->getArgPtr(i);
if (*(int*)p->getArgPtr(i) == 1337 || (fArg > 1336.0f && fArg < 1338.0f) || (dArg > 1336.0 && dArg < 1338.0)) {
effectsNTD64.PeakEffect().trigger();
}
}
}
TEST_CASE("Minimal ILCallback", "[AsmJit][ILCallback]") {
PLH::ILCallback callback;
SECTION("Integer argument") {
asmjit::FuncSignatureT<void, int> sig;
sig.setCallConv(asmjit::CallConv::kIdX86Win64);
uint64_t JIT = callback.getJitFunc(sig, &myCallback);
REQUIRE(JIT != 0);
PLH::CapstoneDisassembler dis(PLH::Mode::x64);
PLH::x64Detour detour((char*)&hookMeInt, (char*)JIT, callback.getTrampolineHolder(), dis);
REQUIRE(detour.hook() == true);
effectsNTD64.PushEffect();
hookMeInt(1337);
REQUIRE(effectsNTD64.PopEffect().didExecute());
REQUIRE(detour.unHook());
}
SECTION("Floating argument") {
uint64_t JIT = callback.getJitFunc("void", {"float"}, &myCallback);
REQUIRE(JIT != 0);
PLH::CapstoneDisassembler dis(PLH::Mode::x64);
PLH::x64Detour detour((char*)&hookMeFloat, (char*)JIT, callback.getTrampolineHolder(), dis);
REQUIRE(detour.hook() == true);
effectsNTD64.PushEffect();
hookMeFloat(1337.1337f);
REQUIRE(effectsNTD64.PopEffect().didExecute());
REQUIRE(detour.unHook());
}
SECTION("Int, float, double arguments, string parsing types") {
uint64_t JIT = callback.getJitFunc("void", { "int", "float", "double" }, &myCallback);
REQUIRE(JIT != 0);
PLH::CapstoneDisassembler dis(PLH::Mode::x64);
PLH::x64Detour detour((char*)&hookMeIntFloatDouble, (char*)JIT, callback.getTrampolineHolder(), dis);
REQUIRE(detour.hook() == true);
effectsNTD64.PushEffect();
hookMeIntFloatDouble(1337, 1337.1337f, 1337.1337);
REQUIRE(effectsNTD64.PopEffect().didExecute());
REQUIRE(detour.unHook());
}
}
NOINLINE void rw(int a, float b, double c, int type) {
volatile float ans = 0.0f;
ans += (float)a;
ans += c;
ans += b;
if (a == 5 && (b > 4.0f && b < 6.0f) && (c > 4.0 && c < 6.0)) {
effectsNTD64.PeakEffect().trigger();
}
printf("%d %f %f %f\n", a, b, c, ans);
}
NOINLINE float rw_float(int a, float b, double c, int type) {
volatile float ans = 0.0f;
ans += (float)a;
ans += c;
ans += b;
if (a == 5 && (b > 4.0f && b < 6.0f) && (c > 4.0 && c < 6.0)) {
effectsNTD64.PeakEffect().trigger();
}
printf("%d %f %f %f\n", a, b, c, ans);
return ans;
}
NOINLINE double rw_double(int a, float b, double c, int type) {
volatile float ans = 0.0f;
ans += (float)a;
ans += c;
ans += b;
if (a == 5 && (b > 4.0f && b < 6.0f) && (c > 4.0 && c < 6.0)) {
effectsNTD64.PeakEffect().trigger();
}
printf("%d %f %f %f\n", a, b, c, ans);
return c;
}
NOINLINE int rw_int(int a, float b, double c, int type) {
volatile float ans = 0.0f;
ans += (float)a;
ans += c;
ans += b;
if (a == 5 && (b > 4.0f && b < 6.0f) && (c > 4.0 && c < 6.0)) {
effectsNTD64.PeakEffect().trigger();
}
printf("%d %f %f %f\n", a, b, c, ans);
return a;
}
NOINLINE void mySecondCallback(const PLH::ILCallback::Parameters* p, const uint8_t count, const PLH::ILCallback::ReturnValue* retVal) {
printf("Argument Count: %d\n", count);
for (int i = 0; i < count; i++) {
printf("Arg: %d asInt:%d asFloat:%f asDouble:%f\n", i, *(int*)p->getArgPtr(i), *(float*)p->getArgPtr(i), *(double*)p->getArgPtr(i));
// re-write to 5 iff it's l33t
float fArg = *(float*)p->getArgPtr(i);
double dArg = *(double*)p->getArgPtr(i);
if (*(int*)p->getArgPtr(i) == 1337) {
*(int*)p->getArgPtr(i) = 5;
}
else if ((fArg > 1336.0f && fArg < 1338.0f)) {
*(float*)p->getArgPtr(i) = 5.0f;
}
else if (dArg > 1336.0 && dArg < 1338.0) {
*(double*)p->getArgPtr(i) = 5.0;
}
}
// little hack, use 4th param to test different return types
switch (*(int*)p->getArgPtr(3)) {
case 0:
*(int*)retVal->getRetPtr() = 1337;
break;
case 1:
*(float*)retVal->getRetPtr() = 1337.0f;
break;
case 2:
*(double*)retVal->getRetPtr() = 1337.0;
break;
default:
printf("Unknown Mode, NOT modifying ret val!\n");
}
}
TEST_CASE("ILCallback Argument re-writing", "[ILCallback]") {
PLH::ILCallback callback;
SECTION("Int, float, double arguments host") {
uint64_t JIT = callback.getJitFunc("void", { "int", "float", "double", "int" }, &mySecondCallback);
REQUIRE(JIT != 0);
PLH::CapstoneDisassembler dis(PLH::Mode::x64);
PLH::x64Detour detour((char*)&rw, (char*)JIT, callback.getTrampolineHolder(), dis);
REQUIRE(detour.hook() == true);
effectsNTD64.PushEffect();
rw(1337, 1337.1337f, 1337.1337, 0);
REQUIRE(effectsNTD64.PopEffect().didExecute());
REQUIRE(detour.unHook());
}
SECTION("Int, float, double arguments, float ret, host") {
uint64_t JIT = callback.getJitFunc("float", { "int", "float", "double", "int" }, &mySecondCallback);
REQUIRE(JIT != 0);
PLH::CapstoneDisassembler dis(PLH::Mode::x64);
PLH::x64Detour detour((char*)&rw_float, (char*)JIT, callback.getTrampolineHolder(), dis);
REQUIRE(detour.hook() == true);
effectsNTD64.PushEffect();
float f = rw_float(1337, 1337.1337f, 1337.1337, 1);
REQUIRE(f == Approx(1337.0f));
REQUIRE(effectsNTD64.PopEffect().didExecute());
REQUIRE(detour.unHook());
}
SECTION("Int, float, double arguments, double ret, host") {
uint64_t JIT = callback.getJitFunc("double", { "int", "float", "double", "int" }, &mySecondCallback);
REQUIRE(JIT != 0);
PLH::CapstoneDisassembler dis(PLH::Mode::x64);
PLH::x64Detour detour((char*)&rw_double, (char*)JIT, callback.getTrampolineHolder(), dis);
REQUIRE(detour.hook() == true);
effectsNTD64.PushEffect();
double d = rw_double(1337, 1337.1337f, 1337.1337, 2);
REQUIRE(d == Approx(1337.0));
REQUIRE(effectsNTD64.PopEffect().didExecute());
REQUIRE(detour.unHook());
}
} | [
"stevemk14ebr@gmail.com"
] | stevemk14ebr@gmail.com |
0e96341a28d3b71c15f83314a4a1dfb2c0d7c257 | bdaf5fe9382a5fbb86fd0f38365d50afff9c8187 | /assignment-5/renderable.hpp | f16fe782f4c54dbb93a82f3b6028b4dcf8f448ff | [] | no_license | ahmedtd/csce-441 | ea5895af4802b73d7b48ef2f069d0b26cdfa46ed | b0e7f14df75ec5db3871f3b1d692b1fe5bbebeca | refs/heads/master | 2020-03-30T05:15:27.496293 | 2012-05-25T08:30:37 | 2012-05-25T08:30:37 | 3,214,545 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 720 | hpp |
#ifndef RENDERABLE
#define RENDERABLE
#include <set>
using std::set;
#include <armadillo>
using arma::vec;
using arma::fvec;
#include "ray.hpp"
#include "light.hpp"
class renderable;
struct intersection
{
double paramval;
ray generating_ray;
renderable const *target;
vec surfnorm;
vec surfpos;
bool operator<(const intersection &rop) const;
};
class renderable
{
public:
virtual set<intersection> intersect(const ray &viewer) const = 0;
// virtual fvec propogate(const ray &viewer,
// const intersection &info,
// const set<light*> &lights,
// const set<renderable*> &renderables) = 0;
};
#endif
| [
"ahmed.taahir@gmail.com"
] | ahmed.taahir@gmail.com |
699de1403b12c114ce4147b42c932aa1352616c0 | 5ace97f6bf2aeb661b4c544e1cc183684afe8413 | /euler/581/main.cpp | 7d25a35f551f1943e6b9f98f8e0a8f689c01354c | [] | no_license | crazymerlyn/code | 1aada845b70486ef45408ff67bd722d910c58dd6 | 3deed9c8a1393c160866f33d5efc6dd3d1a4c469 | refs/heads/master | 2022-07-26T21:13:23.588366 | 2022-06-11T15:35:13 | 2022-06-11T15:35:13 | 97,077,698 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 709 | cpp | #include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
using namespace std;
int main() {
long limit = 1109496723126l;
vector<long> primes = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47};
set<long> heap(primes.begin(), primes.end());
long last = 1;
long res = 0;
while (heap.size()) {
long n = *heap.begin();
if (n == last + 1) {
res += last;
}
heap.erase(heap.begin());
for (auto p: primes) {
if (n * p > limit) break;
if (heap.find(n * p) == heap.end()) {
heap.insert(n * p);
}
}
last = n;
}
cout << res << endl;
}
| [
"crazy.d.merlyn@gmail.com"
] | crazy.d.merlyn@gmail.com |
c506f1c146c76fc29366bc0ee66efbcdc0954f91 | 24bbb38a2fae7182c54d2e994c5a9ef0be7e0d20 | /2014省赛模板/New folder/2013工管5班英语听力/2013210127李茜/双百/动态规划/区域/加分.cpp | e02fedbe1725a4f13694a5d93d1da0486d22a1be | [] | no_license | pentium3/2014-ICPC-Regional | 7bf0719fed7393d6f7f096c1a023a11ebb72c206 | 561583f8f71f7e323cf884ad4164fbd30aa6cbe6 | refs/heads/master | 2020-06-03T20:33:47.876601 | 2015-01-13T10:16:01 | 2015-01-13T10:16:01 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,023 | cpp | #include "iostream"
#include "fstream"
#include "cstring"
using namespace std;
int f[31][31];
int m[31][31];
int node[31];
void print(int i,int j)
{
cout<<m[i][j]<<" ";
if(i<=m[i][j]-1) print(i,m[i][j]-1);
if(m[i][j]+1<=j) print(m[i][j]+1,j);
}
int main()
{
#define fin cin
ifstream fin("in.txt");
int n;
while(cin>>n)
{
for(int i=1;i<=n;i++)
cin>>node[i];
for(int i=1;i<=n;i++)
{
f[i][i]=node[i];
m[i][i]=i;
f[i][i+1]=node[i]+node[i+1];
m[i][i+1]=i;
}
for(int i=n;i>=1;i--)
{
for(int j=1;j<=n;j++)
{
int MAX=0;
if(i==j+1||j==i+1||i==j) continue;
for(int k=i;k<=j;k++)
{
if((f[i][k-1]*f[k+1][j]+node[k])>MAX)
{
MAX=f[i][k-1]*f[k+1][j]+node[k];
m[i][j]=k;
}
}
f[i][j]=MAX;
}
}
cout<<f[1][n]<<endl;
print(1,n);
}
return 0;
}
| [
"i@hxdl.org"
] | i@hxdl.org |
ef9d7291d8389582f2281d0ff7e955fcc42a7def | 30bb7010f727eb519522a7ad686ab55e88fa1b4f | /snmp_v2.cpp | cdd6faf6d5fc4a4f5941ee56d81c042a8d310275 | [] | no_license | mvasanthk/Net-SNMP-Examples | 37f493c85a0a1d1540b2dfa90478db68262a28ac | c0931e5a31d381cdba953f932a7d069145bf5add | refs/heads/master | 2023-03-19T09:26:10.222357 | 2018-06-11T20:26:39 | 2018-06-11T20:26:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,924 | cpp | #include <net-snmp/net-snmp-config.h>
#include <net-snmp/net-snmp-includes.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string.h>
#include <stdio.h>
//#include <math.h>
using namespace std;
int counter=0;
int con[7]; //ポーリングしてきた数値の数
int snmp(){
struct snmp_session session;
struct snmp_session *sess_handle;
struct snmp_pdu *pdu;
struct snmp_pdu *response;
struct variable_list *vars;
oid id_oid[MAX_OID_LEN];
oid serial_oid[MAX_OID_LEN];
size_t id_len = MAX_OID_LEN;
size_t serial_len = MAX_OID_LEN;
int status;
ifstream ifs("oids.txt");
int fscounter = 0;
char str[32];
char oids[3][32];
if (ifs.fail())
{
cerr << "error" << endl;
return -1;
}
while (ifs.getline(str, 32 - 1))
{
strcpy(oids[fscounter], str);
fscounter = fscounter + 1;
}
//////////////////////////////////
init_snmp("SNMP");
snmp_sess_init( &session );
session.version = SNMP_VERSION_2c;
session.community = (u_char *)"public";
session.community_len = strlen((const char *)session.community);
session.peername = (char *)"127.0.0.1"; //自身のMIBへアクセス
sess_handle = snmp_open(&session);
pdu = snmp_pdu_create(SNMP_MSG_GETNEXT); //ポーリングする方法を指定
for (int i = 0; i < sizeof(oids)/sizeof(oids[0]); i++ ){
read_objid(oids[i], id_oid, &id_len);
snmp_add_null_var(pdu, id_oid, id_len);
}
status = snmp_synch_response(sess_handle, pdu, &response);
for(vars = response->variables; vars; vars = vars->next_variable){
con[counter] = *(vars->val.integer);
counter = counter + 1;
}
snmp_free_pdu(response);
snmp_close(sess_handle);
return (0);
}
int main() {
snmp();
sleep(3);
snmp();
float in = (con[3] - con[0]) * 8 * 100 / con[2];
float out = (con[4] - con[1]) * 8 * 100 /con[2];
cout << "InOctet = " << in << "% 使用中"<< endl;
cout << "OutOctet = " << out << "% 使用中" << endl;
}
| [
"iriteria@yahoo.co.jp"
] | iriteria@yahoo.co.jp |
c263e5b045b09e16f2aa4e65f9cf97ad7246e43c | 5c1e458be61eb44f8062054ba13c405a419f8cb1 | /uuv_gazebo_plugins/uuv_gazebo_ros_plugins/include/uuv_gazebo_ros_plugins/ArmsauvROSPlugin.hh | b599dfbc237803ce7269bc342fefb43ac4bae5ee | [] | no_license | hust-arms/uuv_simulator_arms | abe553e11db7fcfde0967ea46ae4220325e84036 | 724e6d2d7acf360914b7bd10c255ebdf0aa9fd56 | refs/heads/master | 2023-04-29T16:00:37.960040 | 2021-05-16T14:29:34 | 2021-05-16T14:29:34 | 327,250,650 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,685 | hh | // Copyright (c) 2016 The UUV Simulator Authors.
// All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/// \file ArmsauvROSPlugin.hh Publishes the underwater object's
/// Gazebo topics and parameters into ROS standards
#ifndef __ARMSAUV_ROS_PLUGIN_HH__
#define __ARMSAUV_ROS_PLUGIN_HH__
#include <string>
#include <uuv_gazebo_plugins/ArmsauvPlugin.hh>
#include <boost/scoped_ptr.hpp>
#include <gazebo/gazebo.hh>
#include <gazebo/common/Plugin.hh>
#include <ros/ros.h>
#include <geometry_msgs/WrenchStamped.h>
#include <geometry_msgs/Vector3.h>
#include <std_msgs/Bool.h>
#include <visualization_msgs/Marker.h>
#include <uuv_gazebo_ros_plugins_msgs/FloatStamped.h>
#include <uuv_gazebo_ros_plugins_msgs/SetUseGlobalCurrentVel.h>
#include <uuv_gazebo_ros_plugins_msgs/UnderwaterObjectModel.h>
#include <uuv_gazebo_ros_plugins_msgs/GetModelProperties.h>
#include <uuv_gazebo_ros_plugins_msgs/SetFloat.h>
#include <uuv_gazebo_ros_plugins_msgs/GetFloat.h>
#include <geometry_msgs/TransformStamped.h>
#include <tf2_ros/transform_broadcaster.h>
#include <tf2/LinearMath/Quaternion.h>
#include <map>
namespace uuv_simulator_ros
{
class ArmsauvROSPlugin : public gazebo::ArmsauvPlugin
{
/// \brief Constructor
public: ArmsauvROSPlugin();
/// \brief Destructor
public: virtual ~ArmsauvROSPlugin();
/// \brief Load module and read parameters from SDF.
public: void Load(gazebo::physics::ModelPtr _parent, sdf::ElementPtr _sdf);
/// \brief Initialize Module.
public: virtual void Init();
/// \brief Reset Module.
public: virtual void Reset();
/// \brief Update the simulation state.
/// \param[in] _info Information used in the update event.
public: virtual void Update(const gazebo::common::UpdateInfo &_info);
/// \brief Update the local current velocity, this data will be used only
/// if the useGlobalCurrent flag is set to false.
public: void UpdateLocalCurrentVelocity(
const geometry_msgs::Vector3::ConstPtr &_msg);
/// \brief Update the back rudder angle
public: void UpdateBackRudderAngle(const uuv_gazebo_ros_plugins_msgs::FloatStamped::ConstPtr& _msg);
/// \brief Update the vertical rudder angle
public: void UpdateVertRudderAngle(const uuv_gazebo_ros_plugins_msgs::FloatStamped::ConstPtr& _msg);
/// \brief Update the front rudder angle
public: void UpdateFrontRudderAngle(const uuv_gazebo_ros_plugins_msgs::FloatStamped::ConstPtr& _msg);
/// \brief Update the speed of rotor
public: void UpdateRotorSpeed(const uuv_gazebo_ros_plugins_msgs::FloatStamped::ConstPtr& _msg);
/// \brief Set flag to use the global current velocity topic input
public: bool SetUseGlobalCurrentVel(
uuv_gazebo_ros_plugins_msgs::SetUseGlobalCurrentVel::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetUseGlobalCurrentVel::Response& _res);
/// \brief Return the model properties, along with parameters from the
/// hydrodynamic and hydrostatic models
public: bool GetModelProperties(
uuv_gazebo_ros_plugins_msgs::GetModelProperties::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetModelProperties::Response& _res);
/// \brief Set the scaling factor for the added-mass matrix
public: bool SetScalingAddedMass(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return current scaling factor for the added-mass matrix
public: bool GetScalingAddedMass(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set a scaling factor for the overall damping matrix
public: bool SetScalingDamping(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return the scaling factor for the overall damping matrix
public: bool GetScalingDamping(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set scaling factor for the model's volume used for buoyancy
/// force computation
public: bool SetScalingVolume(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Get scaling factor for the model's volume used for buoyancy
/// force computation
public: bool GetScalingVolume(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set new fluid density (this will alter the value for the
/// buoyancy force)
public: bool SetFluidDensity(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Get current value for the fluid density
public: bool GetFluidDensity(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set offset factor for the model's volume (this will alter the
/// value for the buoyancy force)
public: bool SetOffsetVolume(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return the offset factor for the model's volume
public: bool GetOffsetVolume(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set the offset factor for the added-mass matrix
public: bool SetOffsetAddedMass(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return the offset factor for the added-mass matrix
public: bool GetOffsetAddedMass(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set the offset factor for the linear damping matrix
public: bool SetOffsetLinearDamping(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return the offset factor for the linear damping matrix
public: bool GetOffsetLinearDamping(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set the offset factor for the linear forward speed damping
/// matrix
public: bool SetOffsetLinearForwardSpeedDamping(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return the offset factor for the linear forward speed damping
/// matrix
public: bool GetOffsetLinearForwardSpeedDamping(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Set the offset factor for the nonlinear damping
/// matrix
public: bool SetOffsetNonLinearDamping(
uuv_gazebo_ros_plugins_msgs::SetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::SetFloat::Response& _res);
/// \brief Return the offset factor for the nonlinear damping
/// matrix
public: bool GetOffsetNonLinearDamping(
uuv_gazebo_ros_plugins_msgs::GetFloat::Request& _req,
uuv_gazebo_ros_plugins_msgs::GetFloat::Response& _res);
/// \brief Publish restoring force
/// \param[in] _link Pointer to the link where the force information will
/// be extracted from
protected: virtual void PublishRestoringForce(
gazebo::physics::LinkPtr _link);
/// \brief Publish hydrodynamic wrenches
/// \param[in] _link Pointer to the link where the force information will
/// be extracted from
protected: virtual void PublishHydrodynamicWrenches(
gazebo::physics::LinkPtr _link);
/// \brief Returns the wrench message for debugging topics
/// \param[in] _force Force vector
/// \param[in] _torque Torque vector
/// \param[in] _output Stamped wrench message to be updated
protected: virtual void GenWrenchMsg(
ignition::math::Vector3d _force, ignition::math::Vector3d _torque,
geometry_msgs::WrenchStamped &_output);
/// \brief Sets the topics used for publishing the intermediate data during
/// the simulation
/// \param[in] _link Pointer to the link
/// \param[in] _hydro Pointer to the hydrodynamic model
protected: virtual void InitDebug(gazebo::physics::LinkPtr _link,
gazebo::ArmsauvHydrodynamicModelPtr _hydro);
/// \brief Publishes the current velocity marker
protected: virtual void PublishCurrentVelocityMarker();
/// \brief Publishes the state of the vehicle (is submerged)
protected: virtual void PublishIsSubmerged();
/// \brief Pointer to this ROS node's handle.
private: boost::scoped_ptr<ros::NodeHandle> rosNode;
/// \brief Subscriber to locally calculated current velocity
private: ros::Subscriber subLocalCurVel;
/// \brief Subscriber to front rudder angle
private: ros::Subscriber subFrontRudderAng;
/// \brief Subscriber to back rudder angle
private: ros::Subscriber subBackRudderAng;
/// \brief Subscriber to vertical rudder angle
private: ros::Subscriber subVertRudderAng;
/// \brief Subscriber to speed of rotor
private: ros::Subscriber subRotorSpeed;
/// \brief Front rudder angle
private: double frontRudderAng;
/// \brief Back rudder angle
private: double backRudderAng;
/// \brief Vertical rudder angle
private: double vertRudderAng;
/// \brief Speed of rotor
private: double rpm;
/// \brief Publisher for current actual thrust.
private: std::map<std::string, ros::Publisher> rosHydroPub;
/// \brief Map of services
private: std::map<std::string, ros::ServiceServer> services;
private: geometry_msgs::TransformStamped nedTransform;
private: tf2_ros::TransformBroadcaster tfBroadcaster;
};
}
#endif // __UNDERWATER_OBJECT_ROS_PLUGIN_HH__
| [
"wangzhao9562@gmail.com"
] | wangzhao9562@gmail.com |
a565fb0909a9d27a12981b2119e963491f2e508a | 6b2a8dd202fdce77c971c412717e305e1caaac51 | /solutions_5738606668808192_1/C++/pps789/2016QC_CoinJam.cpp | 450ec9ac815b1c9b0fee6b0c24d774a971a229ff | [] | no_license | alexandraback/datacollection | 0bc67a9ace00abbc843f4912562f3a064992e0e9 | 076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf | refs/heads/master | 2021-01-24T18:27:24.417992 | 2017-05-23T09:23:38 | 2017-05-23T09:23:38 | 84,313,442 | 2 | 4 | null | null | null | null | UTF-8 | C++ | false | false | 603 | cpp | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
freopen("large.txt", "r", stdin);
freopen("lout.txt", "w", stdout);
int T, N, J; cin >> T >> N >> J;
cout << "Case #1:" << endl;
for (int i = 0; i < J; i++){
unsigned ans = (1u << (N - 1)) + 1;
for (int j = 0; j < (N / 2 - 1); j++){
if (i&(1 << j)){
int L = j + 1;
int R = (N - 1) - L;
ans |= (1 << L);
ans |= (1 << R);
}
}
for (int i = 0; i < N; i++) if (ans&(1 << i)) cout << 1; else cout << 0;
for (int i = 2; i <= 10; i++) cout << ' '<< i + 1;
cout << endl;
}
} | [
"alexandra1.back@gmail.com"
] | alexandra1.back@gmail.com |
95d45e9c8ae06e5c8f2b57653e61aacb0b8ccd6b | 6ea448698dd7f1f31bf35b296a770e3f468e5114 | /MNKnowledgeBrainTeaser/20210705_fibonacci/fibonacci.cpp | 09cb24e5b8c4e2b4a4087fd215f226399b3f5f42 | [] | no_license | bobeff/playground | fc74f57fad483f9f1250fca674923ef03ab23ed2 | 67a68458ffd2a4d269583228f9a15ba9c9e578a1 | refs/heads/master | 2022-01-02T14:54:39.050255 | 2021-12-19T16:08:53 | 2021-12-19T16:08:53 | 3,799,772 | 20 | 10 | null | null | null | null | UTF-8 | C++ | false | false | 1,535 | cpp | #include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
constexpr uint16_t MAX_NUMBER_LENGTH = 10000;
constexpr uint32_t LAST_9_DIGITS_REPEAT_CYCLE = 1'500'000'000;
constexpr uint32_t LAST_9_DIGITS_DIVIDER = 1'000'000'000;
uint64_t mod(const string& n)
{
uint64_t result = 0;
for (size_t i = 0; i < n.length(); ++i)
{
uint8_t digit = n[i] - '0';
result = result * 10 + digit;
result %= LAST_9_DIGITS_REPEAT_CYCLE;
}
return result;
}
void multiply(uint64_t f[2][2], uint64_t m[2][2])
{
uint64_t x = (f[0][0] * m[0][0] + f[0][1] * m[1][0]) % LAST_9_DIGITS_DIVIDER;
uint64_t y = (f[0][0] * m[0][1] + f[0][1] * m[1][1]) % LAST_9_DIGITS_DIVIDER;
uint64_t z = (f[1][0] * m[0][0] + f[1][1] * m[1][0]) % LAST_9_DIGITS_DIVIDER;
uint64_t w = (f[1][0] * m[0][1] + f[1][1] * m[1][1]) % LAST_9_DIGITS_DIVIDER;
f[0][0] = x;
f[0][1] = y;
f[1][0] = z;
f[1][1] = w;
}
void power(uint64_t f[2][2], uint32_t n)
{
uint64_t result[2][2] = { { 1, 1 }, { 1, 0 } };
while (n > 0)
{
if (n % 2 == 1)
{
multiply(result, f);
}
multiply(f, f);
n >>= 1;
}
memcpy(f, result, sizeof(result));
}
uint64_t fibonacci(uint32_t n)
{
if (n == 0) return 0;
if (n == 1) return 1;
uint64_t f[2][2] = { {1, 1}, {1, 0} };
power(f, n - 2);
return f[0][0];
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
string n;
n.reserve(MAX_NUMBER_LENGTH);
cin >> n;
cout << setw(9) << setfill('0') << fibonacci(mod(n)) << "\n";
return 0;
}
| [
"bobeff@protonmail.ch"
] | bobeff@protonmail.ch |
9c3389fbfa4eac9aabf0c5bc9366e9ef88aeb1e4 | 1af49694004c6fbc31deada5618dae37255ce978 | /chrome/browser/ui/views/crostini/crostini_update_component_view.cc | 7565812f00f97e4cdf1863d0722b9f41a223531a | [
"BSD-3-Clause"
] | permissive | sadrulhc/chromium | 59682b173a00269ed036eee5ebfa317ba3a770cc | a4b950c23db47a0fdd63549cccf9ac8acd8e2c41 | refs/heads/master | 2023-02-02T07:59:20.295144 | 2020-12-01T21:32:32 | 2020-12-01T21:32:32 | 317,678,056 | 3 | 0 | BSD-3-Clause | 2020-12-01T21:56:26 | 2020-12-01T21:56:25 | null | UTF-8 | C++ | false | false | 3,048 | cc | // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/ui/views/crostini/crostini_update_component_view.h"
#include "base/metrics/histogram_functions.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/chromeos/crostini/crostini_features.h"
#include "chrome/browser/chromeos/crostini/crostini_manager.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/browser/ui/views/chrome_layout_provider.h"
#include "chrome/grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/chromeos/devicetype_utils.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/border.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/layout/layout_provider.h"
namespace {
CrostiniUpdateComponentView* g_crostini_upgrade_view = nullptr;
constexpr char kCrostiniUpgradeSourceHistogram[] = "Crostini.UpgradeSource";
} // namespace
void crostini::ShowCrostiniUpdateComponentView(
Profile* profile,
crostini::CrostiniUISurface ui_surface) {
base::UmaHistogramEnumeration(kCrostiniUpgradeSourceHistogram, ui_surface,
crostini::CrostiniUISurface::kCount);
return CrostiniUpdateComponentView::Show(profile);
}
void CrostiniUpdateComponentView::Show(Profile* profile) {
if (!crostini::CrostiniFeatures::Get()->IsAllowedNow(profile)) {
return;
}
if (!g_crostini_upgrade_view) {
g_crostini_upgrade_view = new CrostiniUpdateComponentView;
CreateDialogWidget(g_crostini_upgrade_view, nullptr, nullptr);
}
g_crostini_upgrade_view->GetWidget()->Show();
}
// static
CrostiniUpdateComponentView*
CrostiniUpdateComponentView::GetActiveViewForTesting() {
return g_crostini_upgrade_view;
}
CrostiniUpdateComponentView::CrostiniUpdateComponentView() {
SetButtons(ui::DIALOG_BUTTON_OK);
SetShowCloseButton(false);
SetTitle(IDS_CROSTINI_TERMINA_UPDATE_REQUIRED);
set_fixed_width(ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_STANDALONE_BUBBLE_PREFERRED_WIDTH));
views::LayoutProvider* provider = views::LayoutProvider::Get();
SetLayoutManager(std::make_unique<views::BoxLayout>(
views::BoxLayout::Orientation::kVertical,
provider->GetInsetsMetric(views::InsetsMetric::INSETS_DIALOG),
provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL)));
const base::string16 message =
l10n_util::GetStringUTF16(IDS_CROSTINI_TERMINA_UPDATE_OFFLINE);
views::Label* message_label = new views::Label(message);
message_label->SetMultiLine(true);
message_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
AddChildView(message_label);
chrome::RecordDialogCreation(chrome::DialogIdentifier::CROSTINI_UPGRADE);
}
CrostiniUpdateComponentView::~CrostiniUpdateComponentView() {
g_crostini_upgrade_view = nullptr;
}
| [
"commit-bot@chromium.org"
] | commit-bot@chromium.org |
e970dd1b786f73034b068f8b8111115ece24241e | 82cc4bbc5697680e3de0cd9383b58e2e422008af | /core/naomi/djinni-output-temp/jni/NativeLoadType.hpp | 2557c18900870a0764c2f9ffb713e7ab1a2ff9ba | [] | no_license | 4brunu/Kitchen | 712cd4e6a954f9de6d35279c14f8c9e92170a2c9 | 378a2e87c38a698ff4654443ed459e14d5833ab5 | refs/heads/master | 2020-12-30T16:14:57.341504 | 2016-11-09T13:53:30 | 2016-11-09T13:53:30 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 832 | hpp | // AUTOGENERATED FILE - DO NOT MODIFY!
// This file generated by Djinni from chef.djinni
#pragma once
#include "djinni_support.hpp"
#include "load_type.hpp"
namespace djinni_generated {
class NativeLoadType final : ::djinni::JniEnum {
public:
using CppType = ::naomi_gen::load_type;
using JniType = jobject;
using Boxed = NativeLoadType;
static CppType toCpp(JNIEnv* jniEnv, JniType j) { return static_cast<CppType>(::djinni::JniClass<NativeLoadType>::get().ordinal(jniEnv, j)); }
static ::djinni::LocalRef<JniType> fromCpp(JNIEnv* jniEnv, CppType c) { return ::djinni::JniClass<NativeLoadType>::get().create(jniEnv, static_cast<jint>(c)); }
private:
NativeLoadType() : JniEnum("com/siliconbear/kitchen/LoadType") {}
friend ::djinni::JniClass<NativeLoadType>;
};
} // namespace djinni_generated
| [
"constantine@siliconbear.com"
] | constantine@siliconbear.com |
00da55d7fdff95f6dc14b776357651597fc9ff03 | 9f520bcbde8a70e14d5870fd9a88c0989a8fcd61 | /pitzDaily/819/U | 18f97b2e8741b8624eba7ab4de3dfa84a561bae6 | [] | no_license | asAmrita/adjoinShapOptimization | 6d47c89fb14d090941da706bd7c39004f515cfea | 079cbec87529be37f81cca3ea8b28c50b9ceb8c5 | refs/heads/master | 2020-08-06T21:32:45.429939 | 2019-10-06T09:58:20 | 2019-10-06T09:58:20 | 213,144,901 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 251,285 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1806 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "819";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 -1 0 0 0 0];
internalField nonuniform List<vector>
6400
(
(-0.000120798052856 -0.000156882108698 0)
(-0.00031781417235 -0.000112981439758 0)
(-0.000459418220603 -8.70867839644e-05 0)
(-0.000607300212551 -7.43154954842e-05 0)
(-0.000716406293417 -4.77233917418e-05 0)
(-0.000796329663958 -2.80012912891e-05 0)
(-0.000843686520045 -2.03005840319e-05 0)
(-0.000883840000094 -2.9419614125e-05 0)
(-0.000971844091205 -3.96354548104e-05 0)
(-0.00105703790213 -3.70659366479e-05 0)
(-0.00110134824921 -3.30650606098e-05 0)
(-0.0011769000859 -3.36424793369e-05 0)
(-0.00124499775553 -2.97401268949e-05 0)
(-0.00129976225897 -2.4035394592e-05 0)
(-0.0013415253471 -2.14760669161e-05 0)
(-0.00138408495594 -2.36566087403e-05 0)
(-0.00143430978678 -2.40759797701e-05 0)
(-0.00147804303474 -2.08497692054e-05 0)
(-0.00151186551708 -1.67526214453e-05 0)
(-0.00154468032853 -1.52181596519e-05 0)
(-0.00158506093383 -1.9300362048e-05 0)
(-0.00163133192624 -2.32521726551e-05 0)
(-0.00167780339706 -2.32872478564e-05 0)
(-0.00171902458752 -2.16682254457e-05 0)
(-0.00175676110008 -1.93891124866e-05 0)
(-0.00179243045668 -1.70343554332e-05 0)
(-0.00182695799108 -1.56361742556e-05 0)
(-0.00185791385687 -1.39744958352e-05 0)
(-0.0018838157593 -1.1928846399e-05 0)
(-0.00190525036971 -1.03135245754e-05 0)
(-0.00192273973055 -9.64485603177e-06 0)
(-0.00194012733905 -8.64806840009e-06 0)
(-0.00195732952826 -7.13123213596e-06 0)
(-0.00197153535469 -6.78771598215e-06 0)
(-0.00198471370452 -6.52131439477e-06 0)
(-0.00200068078288 -6.025228188e-06 0)
(-0.00201301921423 -5.84858139229e-06 0)
(-0.00201730378548 -4.931573534e-06 0)
(-0.00202691530434 -3.23825926797e-06 0)
(-0.00203901996616 -1.79470795126e-06 0)
(-0.00204331706158 -1.7973458586e-06 0)
(-0.00203862721365 -6.43047282603e-07 0)
(-0.00203152180824 3.01780845403e-06 0)
(-0.00202341074184 5.75042074589e-06 0)
(-0.00201177837126 7.29513822776e-06 0)
(-0.00199661070365 9.03668227458e-06 0)
(-0.00197754198058 1.09803505624e-05 0)
(-0.00195385021592 1.33517088766e-05 0)
(-0.00192547550669 1.57514078304e-05 0)
(-0.00189212197018 1.69133298807e-05 0)
(-0.00185551907555 1.67936467333e-05 0)
(-0.00181906602425 1.89038433958e-05 0)
(-0.00177563962446 2.53063332989e-05 0)
(-0.00172629024401 2.99804265403e-05 0)
(-0.00166323460536 3.44083872462e-05 0)
(-0.00158135509698 4.03740797246e-05 0)
(-0.00149530274821 4.18174685256e-05 0)
(-0.00141647747592 4.23766788886e-05 0)
(-0.00133271058536 4.77837603392e-05 0)
(-0.00122435008829 5.28109034456e-05 0)
(-0.00111127068801 5.50259224588e-05 0)
(-0.000992754956756 6.53758928881e-05 0)
(-0.000883622186089 8.78734128721e-05 0)
(-0.000700164208248 0.000100014486951 0)
(-0.000467938135312 7.74227605754e-05 0)
(-0.000327153134583 5.45544484887e-05 0)
(-0.000240373227138 4.50195244994e-05 0)
(-0.000167764629827 3.98558539968e-05 0)
(-9.65331044586e-05 3.70188278817e-05 0)
(-2.52592638598e-05 3.37331412653e-05 0)
(3.91897823886e-05 2.84950091838e-05 0)
(8.83272832755e-05 2.06609297512e-05 0)
(0.000117064816895 1.18672478479e-05 0)
(0.000138065287486 2.55438920251e-06 0)
(0.000125871680459 -3.19703598594e-06 0)
(0.00012758611232 -6.84321352501e-06 0)
(9.32673585593e-05 -5.77736638023e-06 0)
(0.00010461291623 -1.21578281746e-05 0)
(4.706893492e-05 -1.05019442544e-05 0)
(3.58086258923e-05 -2.10884523376e-05 0)
(-4.66187062789e-05 -0.000224898521232 0)
(-0.00019635702027 -0.000246508607495 0)
(-0.000339549853919 -0.000216625453651 0)
(-0.000434089981834 -0.00017334881777 0)
(-0.000613184608111 -0.000166214411281 0)
(-0.000765264286635 -0.000117037525303 0)
(-0.000854187284687 -7.71934649471e-05 0)
(-0.000917141820382 -9.37380941996e-05 0)
(-0.000983681082969 -0.000115191898173 0)
(-0.0010564233878 -0.000111424934222 0)
(-0.00112453432279 -0.000102418067598 0)
(-0.00118667274168 -9.66978049534e-05 0)
(-0.00124403580502 -8.50241550832e-05 0)
(-0.00129484749695 -7.1677181569e-05 0)
(-0.00134319864988 -6.55041120704e-05 0)
(-0.00138869995517 -7.39472115372e-05 0)
(-0.0014346103532 -7.65488945174e-05 0)
(-0.00147374805642 -5.85483100922e-05 0)
(-0.00148601317524 -4.51325207888e-05 0)
(-0.00152587002043 -4.66254899769e-05 0)
(-0.00157596811301 -5.98495955781e-05 0)
(-0.00162702501748 -7.33545893549e-05 0)
(-0.00167934134284 -7.2753854002e-05 0)
(-0.00172320047847 -6.36898871205e-05 0)
(-0.00175346528884 -5.66745106617e-05 0)
(-0.0017927423541 -5.23640403877e-05 0)
(-0.00182898828971 -4.73678508954e-05 0)
(-0.00185832808207 -4.14294452093e-05 0)
(-0.00188348189913 -3.57474946091e-05 0)
(-0.00190575367757 -3.11939675485e-05 0)
(-0.00192451284204 -2.84213424481e-05 0)
(-0.00193785169077 -2.51520988292e-05 0)
(-0.0019550340355 -2.05232184972e-05 0)
(-0.00196864868755 -2.00793945846e-05 0)
(-0.00198026549081 -2.0853780303e-05 0)
(-0.00200066704597 -1.81729909558e-05 0)
(-0.00201090659206 -1.6986740941e-05 0)
(-0.00201514843048 -1.60378545866e-05 0)
(-0.00202763548831 -1.22335928313e-05 0)
(-0.00204521977037 -6.35871952064e-06 0)
(-0.0020505629316 1.24002725101e-06 0)
(-0.00202355204889 7.97089106096e-06 0)
(-0.00200482798847 1.22985196745e-05 0)
(-0.00199988369702 1.56283485756e-05 0)
(-0.00199042199286 1.93521991855e-05 0)
(-0.00197909783359 2.40829586549e-05 0)
(-0.00196480766617 2.99558108836e-05 0)
(-0.0019444084515 3.66818966224e-05 0)
(-0.00192197739156 4.39314157202e-05 0)
(-0.00189368704237 5.09013684114e-05 0)
(-0.00185445794038 5.67330454212e-05 0)
(-0.00180001358608 6.22587816837e-05 0)
(-0.00174884724601 6.97098807444e-05 0)
(-0.00172568667386 8.33713678412e-05 0)
(-0.00165769417521 0.000100861969848 0)
(-0.00158265884083 0.000114791053597 0)
(-0.00151684557954 0.000122229545982 0)
(-0.00143602135113 0.000129859903097 0)
(-0.0013425918348 0.000144386945144 0)
(-0.00124177260785 0.000161649683173 0)
(-0.00112753688874 0.00017943808201 0)
(-0.000973833931658 0.000202295056187 0)
(-0.000861966439138 0.000261636610076 0)
(-0.00067741630619 0.000299832773903 0)
(-0.000467512561948 0.000251730537239 0)
(-0.000307352375032 0.000170227777209 0)
(-0.000212255361636 0.000125933481145 0)
(-0.000147182889764 0.000114950778768 0)
(-7.74308859117e-05 0.000109879413615 0)
(-9.51011286624e-06 0.000103662844278 0)
(5.25604313039e-05 8.64504003104e-05 0)
(9.85970633984e-05 5.97521007544e-05 0)
(0.000122743921814 3.28245438087e-05 0)
(0.000145852765166 1.1761590511e-05 0)
(0.000150764948012 -5.59723812446e-06 0)
(0.000146586067763 -1.81311543561e-05 0)
(0.00013239482441 -2.4481838737e-05 0)
(0.00011263019311 -3.74875906673e-05 0)
(7.24266919108e-05 -4.83878317672e-05 0)
(3.4598193345e-05 -8.60978029871e-05 0)
(-6.69567310364e-05 -0.000387418401335 0)
(-0.000186856942294 -0.000411510398262 0)
(-0.000290652370308 -0.000374184988781 -8.38338858234e-29)
(-0.00047540056895 -0.000365215237188 7.6300852296e-29)
(-0.000641829524824 -0.00034949403839 6.60029482059e-29)
(-0.000752894334201 -0.000278361052148 -5.97326599858e-29)
(-0.000834802679586 -0.000154669319542 5.93810374196e-29)
(-0.000900723964889 -0.000158374199668 -5.68105949611e-29)
(-0.000969269614882 -0.000188355250992 0)
(-0.00104611321383 -0.00018795880976 0)
(-0.00112020449015 -0.000173522830633 0)
(-0.00118540790729 -0.000156090159634 0)
(-0.00124297036092 -0.000136566050582 0)
(-0.00129272057347 -0.000121635000781 0)
(-0.00134289068447 -0.000113371778443 0)
(-0.0013895230966 -0.000102974685328 0)
(-0.00133205917669 -8.31708957561e-05 0)
(-0.00131845805466 -7.06446082951e-05 0)
(-0.00136445091721 -8.04351262819e-05 0)
(-0.00144472700724 -0.000108807930918 0)
(-0.00157301150891 -0.000131881526235 0)
(-0.00164058416904 -0.000131607314858 0)
(-0.0016731189235 -0.000119139149771 0)
(-0.00171681665611 -0.000105618512594 0)
(-0.00176027303685 -9.55179757181e-05 0)
(-0.00179542457181 -8.76190402996e-05 0)
(-0.00182745895946 -7.82135264353e-05 0)
(-0.00185721114596 -6.84148953468e-05 0)
(-0.00188301394555 -5.95735751908e-05 0)
(-0.0019046963354 -5.23753756826e-05 -1.00033901381e-28)
(-0.00192511216144 -4.61558601632e-05 9.65040624087e-29)
(-0.00193479174609 -4.05439236043e-05 0)
(-0.00195090554141 -3.45783718514e-05 0)
(-0.00197335860247 -3.05991580156e-05 0)
(-0.00197040331102 -3.36137266724e-05 0)
(-0.00199150739847 -3.39748123717e-05 0)
(-0.00201589811709 -2.84429327469e-05 0)
(-0.00201174654042 -2.61923588659e-05 0)
(-0.00202526872431 -2.41836818539e-05 0)
(-0.00204388735434 -1.38474260153e-05 0)
(-0.00204997925118 4.02483301461e-06 0)
(-0.00204423943308 1.78297650131e-05 0)
(-0.00203564414316 2.25823224173e-05 0)
(-0.00202674121266 2.59628774449e-05 0)
(-0.00201483890835 3.18462543895e-05 0)
(-0.00199920734931 3.95784909233e-05 0)
(-0.0019799055732 4.9100807624e-05 0)
(-0.00195678614416 5.97022993751e-05 0)
(-0.00192985024947 7.13421181198e-05 0)
(-0.00189857605574 8.45246569984e-05 0)
(-0.00186220580281 9.80672765019e-05 0)
(-0.00182074608329 0.000109068227241 0)
(-0.00177476774647 0.000118627065551 0)
(-0.00171782883968 0.000137824525726 0)
(-0.00164977683253 0.000162991758589 0)
(-0.00158726540857 0.000182741381142 0)
(-0.00151590827013 0.000199641478572 0)
(-0.00143041490322 0.000219593283555 0)
(-0.00133329365832 0.000244044272871 0)
(-0.00122480367402 0.000273379662786 0)
(-0.00109935535625 0.000310620130125 0)
(-0.000964677445305 0.000365026408048 0)
(-0.000816235312271 0.000453177696632 0)
(-0.000614337428576 0.000482002703335 0)
(-0.000402476387131 0.000377165375944 0)
(-0.000277758536888 0.000279698309758 0)
(-0.000191719191228 0.000223502540584 0)
(-0.00011348242694 0.000191962487812 0)
(-4.50192826234e-05 0.000176938952617 0)
(1.830925961e-05 0.000160888601965 0)
(7.4629842707e-05 0.000131956500213 0)
(0.000119743063664 9.47914218295e-05 0)
(0.000157653170384 6.14825329934e-05 0)
(0.000179540693229 2.61011006287e-05 0)
(0.00017746257793 -8.52386195902e-06 0)
(0.000163840550052 -3.10413834312e-05 0)
(0.000143448493156 -4.58962417993e-05 0)
(0.00011835198814 -7.28410528622e-05 0)
(8.52044956611e-05 -0.000117342376614 0)
(2.28687615487e-05 -0.000125052316086 0)
(-6.61184358288e-05 -0.000565109984165 0)
(-9.64528967409e-05 -0.000399064299595 0)
(-0.000237453936128 -0.000556525467347 0)
(-0.000407647151089 -0.000539927910658 0)
(-0.000565712786619 -0.000457540884687 0)
(-0.000361936298482 -0.000195750540047 0)
(-0.000460795326003 -0.000194719905571 0)
(-0.000793705367433 -0.000312061322478 0)
(-0.000925661898555 -0.000308771950273 0)
(-0.00102286505745 -0.000277518876797 0)
(-0.0011091633128 -0.000251051579774 0)
(-0.00118199117764 -0.000221729566198 0)
(-0.00124389328567 -0.000191981439418 0)
(-0.00128894283932 -0.000156089843756 0)
(-0.00126488575394 -0.000114393576153 0)
(-0.00123490297688 -8.74256022887e-05 0)
(-0.00124653462319 -8.66205492416e-05 0)
(-0.00131369358598 -0.000119849812788 0)
(-0.00143934381243 -0.000169055232091 0)
(-0.00154323296937 -0.000205130462297 0)
(-0.00158783546039 -0.000204000841072 0)
(-0.00163343006138 -0.000183132605417 0)
(-0.00168036118183 -0.000163942785076 0)
(-0.00172180126606 -0.000148597315853 0)
(-0.00175932929295 -0.00013423714019 0)
(-0.00179348577992 -0.000120843511313 0)
(-0.00182488945129 -0.00010832149558 0)
(-0.00185648565548 -9.576494935e-05 0)
(-0.0018808381277 -8.36640396086e-05 0)
(-0.00190616754999 -7.31393702251e-05 0)
(-0.00191941617824 -6.40509635161e-05 0)
(-0.00193965098226 -5.49736436433e-05 0)
(-0.00194224823107 -4.59067815941e-05 0)
(-0.0019614992371 -4.3762434762e-05 0)
(-0.00198904643881 -4.70418457643e-05 0)
(-0.00198924251504 -4.95289268423e-05 0)
(-0.00201240446985 -4.55289383585e-05 0)
(-0.00203363387049 -3.94456421103e-05 0)
(-0.00204156028643 -3.32981740323e-05 0)
(-0.00204674644394 -1.89520579332e-05 0)
(-0.00204912157508 1.75300855466e-06 0)
(-0.00204618304473 1.91691629721e-05 0)
(-0.00203964275497 2.94817100877e-05 0)
(-0.00203064483969 3.72719183906e-05 0)
(-0.00201832061186 4.64493746e-05 0)
(-0.00200234184098 5.76452838256e-05 8.33086401081e-29)
(-0.001982705555 7.06228596107e-05 -8.36404557142e-29)
(-0.00195929216317 8.50017230701e-05 0)
(-0.00193197212429 0.000100743715778 0)
(-0.00190037071368 0.000117789964335 0)
(-0.001863867934 0.000135222001367 0)
(-0.00182174813944 0.000152461080913 0)
(-0.00177322836148 0.000172338116472 0)
(-0.00171679309728 0.000198346288714 0)
(-0.00165380724153 0.000226088291453 0)
(-0.00158604198837 0.000252694505355 0)
(-0.00150941981208 0.000281476585261 0)
(-0.00141976199517 0.000314237439333 1.53129924428e-28)
(-0.00131599821162 0.000352355477212 -1.75872984029e-28)
(-0.00119637859951 0.00039830949586 0)
(-0.00105797344006 0.000456591695797 0)
(-0.000902882327929 0.000536023822851 0)
(-0.00073305624534 0.000621688641457 0)
(-0.000567902767878 0.000646385613953 0)
(-0.000407540500985 0.000558857390091 0)
(-0.000244779171769 0.000389631108818 0)
(-0.000145338499032 0.000300439833122 0)
(-6.87994441837e-05 0.000263463326543 0)
(-1.76625559186e-06 0.000241493237339 0)
(5.9988394577e-05 0.000223313441205 0)
(0.000120185916028 0.000191130723753 0)
(0.000172455122225 0.000144308691252 0)
(0.000200339878833 8.59018885068e-05 0)
(0.000192300004475 2.51575981021e-05 0)
(0.000182415587396 -1.91801760384e-05 0)
(0.000168689595488 -5.29019732759e-05 0)
(0.000138877773555 -7.91748035823e-05 0)
(8.62767814229e-05 -9.15307485683e-05 0)
(6.42989637456e-05 -0.000139902072034 0)
(2.20678539944e-05 -0.000172743650717 0)
(-1.22479169379e-05 -0.000581350878482 0)
(-5.51803786701e-05 -0.000484589679991 0)
(-0.000210958874501 -0.000717307315431 0)
(-0.000351113760092 -0.000661743893329 0)
(-0.000407372695743 -0.000459898745766 0)
(-0.000339283257116 -0.000265281419022 0)
(-0.000556365406146 -0.000404734865334 0)
(-0.000776015242271 -0.000506455616866 0)
(-0.000876578908076 -0.000441115710284 0)
(-0.000989367926475 -0.000380789488946 0)
(-0.00108545665809 -0.000342991075092 0)
(-0.0011676285073 -0.00029772987044 0)
(-0.00119876383463 -0.000220688153188 0)
(-0.00114856516406 -0.000141260224045 0)
(-0.00117536432301 -0.000112232827604 0)
(-0.00123762100546 -0.000123624039986 0)
(-0.00133104431477 -0.000166051358674 0)
(-0.00143318960311 -0.000221364801377 0)
(-0.00150347942187 -0.00025491587523 0)
(-0.00153712932634 -0.000255526879996 0)
(-0.00158396841249 -0.000246595414982 0)
(-0.00163574002031 -0.000231433853113 0)
(-0.00168002124521 -0.000210399733249 0)
(-0.00172098627802 -0.000189208191473 0)
(-0.00175787724323 -0.000170347695745 0)
(-0.00179084603072 -0.000154278972971 0)
(-0.00182524217499 -0.000138813279685 0)
(-0.0018508811051 -0.00012325033626 0)
(-0.00188290514299 -0.000107832895426 0)
(-0.00189730712272 -9.30281088029e-05 0)
(-0.0019245162149 -8.04889304404e-05 -9.6196259984e-29)
(-0.00191728254753 -6.9089496319e-05 9.19762279162e-29)
(-0.00194918675665 -6.28591944198e-05 0)
(-0.0019779538739 -6.01118602875e-05 0)
(-0.00198358895287 -6.31274495671e-05 0)
(-0.00201111458877 -6.72456913583e-05 0)
(-0.00202744945544 -6.44978561541e-05 0)
(-0.00203857542652 -5.31242451845e-05 0)
(-0.00204564769792 -3.84267259235e-05 0)
(-0.0020498895432 -2.02517329074e-05 0)
(-0.00205171528686 1.20933918885e-06 0)
(-0.00204989269967 2.08859008949e-05 0)
(-0.00204437292191 3.57349618366e-05 0)
(-0.0020354686194 4.81117306957e-05 0)
(-0.00202294275367 6.11078521642e-05 0)
(-0.00200671916248 7.58525797641e-05 0)
(-0.00198678890834 9.23966665386e-05 0)
(-0.00196303005218 0.000110551374405 0)
(-0.00193523669867 0.000130291684951 0)
(-0.00190304294107 0.000151570989164 0)
(-0.00186585493513 0.000174076061682 0)
(-0.0018228432269 0.000198071606894 0)
(-0.00177311009611 0.00022533059644 0)
(-0.00171602143243 0.00025694870932 0)
(-0.00165221122584 0.000291085125946 0)
(-0.00158133439709 0.000327574495117 0)
(-0.00149951476588 0.0003689056136 0)
(-0.00140246210671 0.000416950718755 0)
(-0.00128730784656 0.000473553865014 0)
(-0.00115146156966 0.000541532351154 0)
(-0.000994370330529 0.000622836236315 0)
(-0.000823919925403 0.000710343513004 0)
(-0.000654946641334 0.000772690468977 0)
(-0.000514621830886 0.000793752055821 0)
(-0.000372376782741 0.000719545016065 0)
(-0.000221779314744 0.000536497826738 0)
(-0.000109362581927 0.000410583366121 0)
(-2.06153823479e-05 0.000343704360791 0)
(5.09300918381e-05 0.000305403113858 0)
(0.00011541483417 0.00028111410251 0)
(0.00018138067664 0.000248841117161 0)
(0.000224303703017 0.000177606010528 0)
(0.000218706004844 8.43993321856e-05 0)
(0.000212950307537 1.6512383752e-05 0)
(0.000204307932091 -3.67073697916e-05 0)
(0.000182244406824 -8.51600209221e-05 0)
(0.000135789627094 -0.00011390087528 0)
(9.14289026244e-05 -0.000130692014014 0)
(6.32476198794e-05 -0.000188387743797 0)
(1.79915382886e-05 -0.000207028075254 0)
(-2.66544250468e-06 -0.000552164794246 0)
(-6.27901558622e-05 -0.000586014229832 0)
(-0.000209329850387 -0.000822766829263 0)
(-0.00030299619291 -0.000708231901443 0)
(-0.000249507900785 -0.000378478414776 0)
(-0.000343021835774 -0.000381899800934 0)
(-0.000648528933567 -0.00062509943354 0)
(-0.000741339199983 -0.000620580559509 0)
(-0.000839682525712 -0.000553240527261 0)
(-0.000949378018316 -0.000491643463052 0)
(-0.00105213334176 -0.000422223896753 0)
(-0.00103254057805 -0.000307689953713 0)
(-0.000976717383521 -0.000193636831802 0)
(-0.00104499660094 -0.000164066088191 0)
(-0.0011285987233 -0.000180464178704 0)
(-0.00126051702216 -0.000228230405289 0)
(-0.00137757376753 -0.000273595130123 0)
(-0.00145304596674 -0.000293185097468 0)
(-0.00147950413511 -0.000291729717439 0)
(-0.0015323363463 -0.000297672051758 0)
(-0.00158929553306 -0.000296860143917 0)
(-0.00163503108634 -0.000278957429304 0)
(-0.0016777405242 -0.000254410179872 0)
(-0.00171740673704 -0.000230005683788 0)
(-0.00175814796864 -0.000207528789074 0)
(-0.00179130674706 -0.000185830658785 0)
(-0.00181279887877 -0.000168414981721 0)
(-0.0018549261096 -0.000151639978588 0)
(-0.00186562961067 -0.000130709402206 0)
(-0.00190534379809 -0.000110823956112 0)
(-0.00189031493965 -9.28791925518e-05 0)
(-0.00193176472782 -8.73376350326e-05 0)
(-0.00192354914479 -8.29588173813e-05 0)
(-0.0019694076899 -8.35494806543e-05 0)
(-0.00200689292986 -8.69645872429e-05 0)
(-0.00202384182409 -8.74017182068e-05 0)
(-0.0020349170363 -7.75215216258e-05 0)
(-0.00204377882454 -6.17413058959e-05 0)
(-0.00205023989769 -4.32978225295e-05 0)
(-0.00205441211258 -2.23544468849e-05 0)
(-0.00205616237908 6.23370643266e-07 0)
(-0.00205478652363 2.26824956041e-05 0)
(-0.0020498145051 4.16590947572e-05 0)
(-0.00204108507987 5.86194490082e-05 0)
(-0.00202852472928 7.57447070915e-05 0)
(-0.00201214306354 9.42701998226e-05 0)
(-0.0019919450579 0.000114533868154 0)
(-0.00196777434033 0.0001365617152 0)
(-0.00193935544473 0.000160423308489 0)
(-0.00190631226229 0.000186216991697 0)
(-0.0018680870761 0.000214067245074 0)
(-0.00182390819084 0.000244536676889 0)
(-0.00177298825973 0.000278712593964 0)
(-0.00171480512828 0.000317105874208 0)
(-0.00164897523535 0.000359611471731 0)
(-0.00157356825365 0.000407799229997 0)
(-0.00148420325572 0.000464542918256 0)
(-0.00137617941312 0.000532041845709 0)
(-0.0012462002318 0.00061167992813 0)
(-0.00109305419886 0.000702577103883 0)
(-0.000922244368001 0.000797334242725 0)
(-0.000747842113853 0.000872737892213 0)
(-0.000574498061442 0.000898533669907 0)
(-0.000454938269382 0.000948683022744 0)
(-0.000299714225316 0.000842404823008 0)
(-0.000166019252537 0.000645616756414 0)
(-6.11795681763e-05 0.000511302076203 0)
(3.50556402725e-05 0.00042659623031 0)
(0.000115028829174 0.000372011746824 0)
(0.000189754646126 0.00034851769029 0)
(0.000251552774452 0.000298021447548 0)
(0.000255827511053 0.000181787861523 0)
(0.00024815272258 8.2007486319e-05 0)
(0.000252199975369 8.74643269645e-06 0)
(0.000236821337628 -6.12491465095e-05 0)
(0.000205565298095 -0.000126835036555 0)
(0.000145118131788 -0.000151740015826 0)
(0.000100861241075 -0.000170935244579 0)
(6.75859612651e-05 -0.000231369357988 0)
(2.02472405677e-05 -0.00024343099827 0)
(-2.22101682967e-05 -0.000602252025417 0)
(-0.000124566939021 -0.000748680419099 0)
(-0.000260411125407 -0.000901737127318 0)
(-0.000311972175669 -0.000849119518589 0)
(-0.000241397591235 -0.00048056213651 0)
(-0.000466179000871 -0.000645453504547 0)
(-0.000648107534475 -0.000755322105673 0)
(-0.000715614293694 -0.000709635559439 0)
(-0.000810012571944 -0.000646872746916 0)
(-0.000884332021224 -0.000582641436583 0)
(-0.00102068728469 -0.00048339601995 2.70397068034e-28)
(-0.000868444629591 -0.000271455791027 -1.81086835356e-28)
(-0.00096749296538 -0.000237397822956 0)
(-0.00102958052016 -0.000245829363906 0)
(-0.00116254013286 -0.000297127922814 0)
(-0.00130114611912 -0.000355161581636 0)
(-0.00138594941977 -0.000361430325519 0)
(-0.00140340329782 -0.000334633138028 0)
(-0.00146779861859 -0.00033922381334 0)
(-0.00153883442304 -0.000353884848506 0)
(-0.00158487261966 -0.000346560049907 0)
(-0.00163187133593 -0.000324728218947 0)
(-0.00167672221023 -0.000298334520199 0)
(-0.00171820008898 -0.000270135621168 0)
(-0.00175059910788 -0.000241415175953 0)
(-0.00177753412097 -0.000214956646111 0)
(-0.00181961852739 -0.000196210766827 0)
(-0.00182242644302 -0.000177832990877 0)
(-0.00187647123668 -0.00015450617663 0)
(-0.00185844687005 -0.00012217636944 0)
(-0.00191036758523 -0.000111184162413 0)
(-0.00190236467807 -0.000108515767897 9.13620242645e-29)
(-0.00194855378829 -0.000109033860934 -9.14264451179e-29)
(-0.00197828190868 -0.000115457427142 0)
(-0.00201726309951 -0.000115458899468 0)
(-0.00203242872232 -0.000104131120618 0)
(-0.00204146364317 -8.79360522608e-05 0)
(-0.00204941691736 -6.91247206806e-05 0)
(-0.00205597802813 -4.81102701974e-05 0)
(-0.0020603519997 -2.48728929179e-05 0)
(-0.00206213102579 1.29611953255e-08 0)
(-0.00206094925837 2.46462049918e-05 0)
(-0.00205626360354 4.74822646838e-05 0)
(-0.0020476998792 6.88893536267e-05 0)
(-0.00203516149695 9.02985583579e-05 0)
(-0.00201867018929 0.000112840240847 0)
(-0.00199818323527 0.000137050621128 0)
(-0.00197347706893 0.000163166345102 0)
(-0.00194422895768 0.000191391330041 0)
(-0.0019100796658 0.00022198627613 0)
(-0.00187054227339 0.000255344567243 0)
(-0.00182494402666 0.000292147648672 0)
(-0.00177253582544 0.000333294900598 0)
(-0.00171248328566 0.000379661916887 0)
(-0.0016433182183 0.000432715316082 0)
(-0.0015618187037 0.000495434848354 0)
(-0.00146297533581 0.000571153447496 0)
(-0.00134210892835 0.00066136476713 0)
(-0.00119767583229 0.000764018140446 0)
(-0.00103377331621 0.00087181957538 0)
(-0.000859656452329 0.00096868331541 0)
(-0.000688335651151 0.00103321039342 0)
(-0.000531773067059 0.00107179640954 0)
(-0.000397163214367 0.00107669567385 0)
(-0.00025278026744 0.000970891587665 0)
(-0.000100375422847 0.000743878162861 0)
(9.02825986469e-06 0.000621215938267 0)
(0.000111828495305 0.000532971247545 0)
(0.000200420745053 0.000464531221936 0)
(0.000271822719177 0.000410083686212 0)
(0.000301086273621 0.000310911685856 0)
(0.000290163893377 0.000182182465928 0)
(0.000301914564286 8.77805185974e-05 0)
(0.000305837116438 -9.95554850774e-07 0)
(0.000285610432558 -9.65776136929e-05 0)
(0.000231258760437 -0.000170744366107 0)
(0.000172220932015 -0.000206193963557 0)
(0.000110781503843 -0.000218219188442 0)
(7.06266746641e-05 -0.000273360225662 0)
(2.34627091994e-05 -0.000290938453948 0)
(-4.24617940199e-05 -0.000701271399896 0)
(-0.000167424814675 -0.000895737053866 0)
(-0.000285627443935 -0.000950709484204 0)
(-0.000215650403156 -0.00062997695327 0)
(-0.000255477335223 -0.000596246318921 0)
(-0.000515408570795 -0.000853906635906 0)
(-0.000605669082241 -0.000844582527364 0)
(-0.000693594513364 -0.000798220422181 0)
(-0.000764124730048 -0.000722646283439 0)
(-0.000860861449739 -0.000651180707474 0)
(-0.000761861559928 -0.000417405802509 0)
(-0.000857967116653 -0.000325471678079 0)
(-0.000948980125944 -0.000315767953663 0)
(-0.00103032729033 -0.000347314227685 0)
(-0.00121078470754 -0.000430376960616 0)
(-0.00131090789192 -0.000449516990687 0)
(-0.00132054129196 -0.000404309281146 0)
(-0.00138316976187 -0.00038942933948 0)
(-0.00147380129729 -0.000407894596696 0)
(-0.00153411467786 -0.000410490313019 0)
(-0.00157894997931 -0.000393901367819 0)
(-0.00162339461425 -0.000369783840774 0)
(-0.00167094749593 -0.000343737947444 0)
(-0.00171255286026 -0.000312017203862 0)
(-0.00175631090756 -0.000273971353744 0)
(-0.00176887963596 -0.000246422629652 0)
(-0.00182298548091 -0.000223560022251 0)
(-0.00183344710864 -0.000197445357829 0)
(-0.00183337807657 -0.0001714467138 0)
(-0.00186608053551 -0.000150518361231 0)
(-0.00192824259117 -0.000138574332418 0)
(-0.00192661497616 -0.0001288074248 0)
(-0.00194382846869 -0.000140274478775 0)
(-0.00200370887129 -0.000148729169976 0)
(-0.00202396559238 -0.000139456509535 0)
(-0.00203762287789 -0.000119257425809 0)
(-0.00204801096852 -9.79585884899e-05 0)
(-0.00205621041842 -7.64029035863e-05 0)
(-0.00206289357798 -5.31951121671e-05 0)
(-0.00206751904526 -2.77680915083e-05 0)
(-0.00206945323696 -6.66967265619e-07 0)
(-0.00206837213277 2.67303366489e-05 0)
(-0.00206385369126 5.32838156125e-05 0)
(-0.00205545302898 7.9008986616e-05 0)
(-0.00204297597359 0.000104789937308 8.11030709336e-29)
(-0.0020263839017 0.000131578913452 -8.07673149451e-29)
(-0.0020055427844 0.000160029822502 0)
(-0.00198014546432 0.00019054801319 0)
(-0.00194984085635 0.000223451112143 0)
(-0.00191431045192 0.000259119948834 0)
(-0.00187314889934 0.00029813001852 0)
(-0.00182576609539 0.000341345187446 0)
(-0.00177135298608 0.00038996378296 0)
(-0.0017085960567 0.000445751552939 0)
(-0.00163502199183 0.000511644301608 0)
(-0.00154644216205 0.000591681226361 0)
(-0.00143767232048 0.000688927254526 0)
(-0.00130536194405 0.000802310649567 0)
(-0.00115168175265 0.000924504488496 0)
(-0.000983792841406 0.00104356194932 0)
(-0.000808505951434 0.0011424491322 0)
(-0.000635830116227 0.00120151863655 0)
(-0.000478326924556 0.00121874985313 0)
(-0.000343052994458 0.00119448280848 0)
(-0.000229779657233 0.00115528254507 0)
(-5.09846393649e-05 0.000887917076688 0)
(9.28332961914e-05 0.000728025727981 0)
(0.000203558526539 0.000628480287304 0)
(0.00028510541929 0.000531333154602 0)
(0.000335613297324 0.000436208891242 0)
(0.000342648997138 0.000311706893382 0)
(0.000344589669787 0.000195129507341 0)
(0.000371268719577 0.00010130236232 0)
(0.000379202609351 -1.24343970144e-05 0)
(0.000349783233854 -0.000143621201981 0)
(0.000273136314694 -0.000231517486282 0)
(0.000202644984082 -0.000276687216574 0)
(0.000122680967529 -0.000284970153262 0)
(6.66169569238e-05 -0.000319688844401 0)
(2.17348564343e-05 -0.000343022617762 0)
(-5.69684068146e-05 -0.000821626287246 0)
(-0.000184607144242 -0.00101279338902 0)
(-0.000250213027242 -0.000995491515736 0)
(-0.000210040543194 -0.000691903463309 0)
(-0.000332197559857 -0.000770672328116 0)
(-0.000519473994084 -0.000962549937199 0)
(-0.000569915416315 -0.000929034557148 0)
(-0.000674010306427 -0.000882972577749 0)
(-0.000685242239432 -0.000753709047432 0)
(-0.000865010288225 -0.000734811661228 0)
(-0.00074174275902 -0.000465950647507 0)
(-0.000859615271244 -0.000414214271052 0)
(-0.000939815085744 -0.000410125460731 0)
(-0.00108033117761 -0.000480667371174 0)
(-0.00121842562809 -0.000547427356304 0)
(-0.00129629030966 -0.000518292307415 0)
(-0.0013069016751 -0.000456790914205 0)
(-0.00138667514681 -0.000461306140366 0)
(-0.00146554911952 -0.000476053311671 0)
(-0.00152364178871 -0.000466374443282 0)
(-0.00157566580143 -0.000442592137775 0)
(-0.00161821998127 -0.000413133681929 0)
(-0.00166363094588 -0.000384856324481 0)
(-0.00169091317196 -0.000352114975428 0)
(-0.00172226148241 -0.000305108827779 0)
(-0.00178256602723 -0.000275321857217 0)
(-0.00176298821533 -0.000249867430278 0)
(-0.00185350499999 -0.000223940514897 0)
(-0.00183090277998 -0.000197204665878 0)
(-0.00190448768695 -0.000185829594232 0)
(-0.00188609816045 -0.000164124337699 0)
(-0.00195800128048 -0.000160022075383 0)
(-0.00198811636838 -0.000171607944444 9.45292970956e-29)
(-0.0020111568603 -0.000175687224328 -9.35104433744e-29)
(-0.0020293047789 -0.000158124395081 0)
(-0.00204368010624 -0.000133474730148 0)
(-0.00205528682826 -0.00010865969691 0)
(-0.00206414278648 -8.42036580842e-05 0)
(-0.00207099067507 -5.86406540223e-05 0)
(-0.00207577669094 -3.0994181078e-05 0)
(-0.00207794606235 -1.48767467009e-06 0)
(-0.00207705509555 2.884099285e-05 0)
(-0.00207269163732 5.90619877665e-05 0)
(-0.00206445204894 8.90168995564e-05 0)
(-0.00205208352749 0.000119247682005 0)
(-0.00203539597477 0.000150537597014 0)
(-0.0020141135528 0.000183585201384 0)
(-0.00198785636578 0.000218902217145 0)
(-0.00195626058738 0.000256868813469 0)
(-0.00191903994406 0.000297928760635 0)
(-0.00187586988695 0.00034281866797 0)
(-0.0018262396389 0.000392738631639 0)
(-0.00176925703215 0.000449557305245 0)
(-0.00170315426482 0.000516184714486 0)
(-0.00162473453485 0.000596800156636 0)
(-0.00152937736233 0.000695835238779 0)
(-0.00141243038062 0.000815033549318 0)
(-0.00127253750737 0.000950149455969 0)
(-0.00111470867966 0.00108954078649 0)
(-0.000945530832187 0.00121968671393 0)
(-0.000765517138667 0.00132523126186 0)
(-0.000582516426847 0.00137413033746 0)
(-0.000414543603943 0.00136954237808 0)
(-0.000268534893404 0.001326420689 0)
(-0.000156249669278 0.00125573390825 0)
(-1.64440305545e-05 0.00111254654091 0)
(0.00016517594267 0.000828753164613 0)
(0.000304883321659 0.000724457192976 0)
(0.000376649254975 0.000594849969085 0)
(0.000398799278919 0.000449039488939 0)
(0.000394279700819 0.000315252732991 0)
(0.000412169166267 0.000220255907975 0)
(0.000453746875751 0.000128910006261 0)
(0.000478610525053 -1.9685920963e-05 0)
(0.000434492863635 -0.000207004719012 0)
(0.000330370424665 -0.000325643071956 0)
(0.000221249007261 -0.000369475773793 0)
(0.000124434086505 -0.000372600270248 0)
(5.48020949608e-05 -0.000376232051673 0)
(1.44200483221e-05 -0.000381383863982 0)
(-6.69057255799e-05 -0.000963119839018 0)
(-0.000200627470782 -0.00110460211945 0)
(-0.000235297952491 -0.00101397210507 0)
(-0.000215919091838 -0.000757357787253 0)
(-0.000405556326368 -0.000995643211905 0)
(-0.000480992299995 -0.00101202579046 0)
(-0.000539953155672 -0.00100508746472 0)
(-0.0006315015058 -0.000958734880309 0)
(-0.000609033313666 -0.00076499146508 0)
(-0.000765233791842 -0.000742496728957 0)
(-0.000718283138766 -0.000521516780881 0)
(-0.000848487527578 -0.000506872375599 0)
(-0.000927958491437 -0.000517337595028 0)
(-0.00110099367186 -0.000609459473621 0)
(-0.00120394678581 -0.000636322674847 0)
(-0.00121102256768 -0.000555295189222 0)
(-0.00128502994299 -0.000519645860612 0)
(-0.00138033242608 -0.000536569651687 0)
(-0.00144992597861 -0.000541918344889 0)
(-0.00150606507927 -0.000524685820059 0)
(-0.00156685222095 -0.000496691926071 0)
(-0.00161636719427 -0.000459329470447 0)
(-0.00167040529226 -0.000420371315938 0)
(-0.00169218018826 -0.000384306040993 0)
(-0.00168470455089 -0.000344099601638 0)
(-0.00179787115256 -0.000308669362752 0)
(-0.00177477546485 -0.000274215012226 0)
(-0.00179473093842 -0.000247937806497 0)
(-0.00183222270494 -0.000227866860639 0)
(-0.00185733014216 -0.000218988395562 0)
(-0.00192648126399 -0.000204954467649 0)
(-0.00194565164573 -0.000198847700993 0)
(-0.00200271513512 -0.000201805239901 0)
(-0.00202121370652 -0.000195541620926 0)
(-0.00203597445042 -0.000174591916886 0)
(-0.00205096622786 -0.000147613774318 0)
(-0.00206358530559 -0.000119995521098 0)
(-0.00207322515448 -9.26041429198e-05 0)
(-0.00208036754832 -6.44640007458e-05 0)
(-0.00208522169054 -3.45090889841e-05 0)
(-0.00208755670929 -2.51642937957e-06 0)
(-0.00208693080018 3.08462571349e-05 0)
(-0.00208282189808 6.4750764733e-05 0)
(-0.00207479602809 9.89102073757e-05 0)
(-0.0020625702787 0.000133679330043 0)
(-0.00204582541024 0.000169749610919 0)
(-0.00202407249184 0.000207824228077 0)
(-0.00199680796019 0.000248431448303 0)
(-0.00196367506499 0.000291938155996 0)
(-0.00192443157709 0.000338799572317 0)
(-0.00187882796236 0.000389915329985 0)
(-0.00182646993898 0.000446954928042 0)
(-0.00176646301898 0.00051267082838 0)
(-0.00169678080256 0.000591108122307 0)
(-0.00161395708299 0.000687160832242 0)
(-0.0015136706379 0.000804793914675 0)
(-0.00139244289835 0.000944736015341 0)
(-0.00124972782381 0.00110346459112 0)
(-0.00108932041808 0.00126210033295 0)
(-0.000920113660762 0.00139955569032 0)
(-0.000733699770363 0.00151864166573 0)
(-0.00053125411804 0.00156246358909 0)
(-0.000337529075465 0.0015436782128 0)
(-0.000162876646563 0.00147677931291 0)
(-1.98449166474e-05 0.00137182759154 0)
(9.90420283012e-05 0.00126280865744 0)
(0.000265865414204 0.0011349396049 0)
(0.000364299750506 0.000751361147965 0)
(0.000456737086416 0.00060959353352 0)
(0.000463622480781 0.000446276602686 0)
(0.000452060340945 0.000318815819476 0)
(0.000470399005825 0.000254707454669 0)
(0.00054247471516 0.000191337858864 0)
(0.000621515485757 -3.51018050682e-06 0)
(0.000567212648421 -0.00030759711679 0)
(0.00039418398984 -0.000479691433829 0)
(0.000216135645021 -0.000500274068455 0)
(9.8957384262e-05 -0.000459547097153 0)
(3.32202608334e-05 -0.000423931119679 0)
(4.79433805196e-06 -0.000393681373913 0)
(-6.33155788625e-05 -0.00109878352443 0)
(-0.000190579445141 -0.00118466003414 0)
(-0.000202892397643 -0.000936961002477 0)
(-0.00025305615404 -0.000876476451038 0)
(-0.000412695841113 -0.00112542014089 0)
(-0.000432324106968 -0.00107952449485 0)
(-0.000516983405986 -0.00108026174913 0)
(-0.000566089477702 -0.000999021830968 0)
(-0.00063398390196 -0.000893969034997 0)
(-0.000662411453316 -0.000723023194801 0)
(-0.000719548647151 -0.000613957787277 0)
(-0.000836775409249 -0.000611505640347 0)
(-0.000915187604218 -0.000628431038655 0)
(-0.00109489981034 -0.000727783437908 0)
(-0.00119048597687 -0.000711762318618 0)
(-0.00117990124013 -0.00060984985609 0)
(-0.00127197917618 -0.000597800883594 0)
(-0.00136364511558 -0.000613500827013 0)
(-0.00143077399404 -0.000606939902596 0)
(-0.00148659834574 -0.000583928810958 0)
(-0.00154251088031 -0.00055384121458 0)
(-0.00160384965158 -0.000517680003525 0)
(-0.00167010629001 -0.000461911756927 0)
(-0.00171578217542 -0.000408563020147 0)
(-0.00168914716159 -0.000375884596996 0)
(-0.00171842264392 -0.000334108017785 0)
(-0.00181056354284 -0.000304755207265 0)
(-0.0017940961995 -0.000284094249326 0)
(-0.00189166780644 -0.000266741486086 0)
(-0.00186260102529 -0.000246630474904 0)
(-0.00188806903806 -0.000239718626354 0)
(-0.00195171871551 -0.000241818996366 0)
(-0.00200719930153 -0.000239677025637 0)
(-0.00202734468637 -0.000217598480157 0)
(-0.00204334411716 -0.000190600128414 0)
(-0.0020591457643 -0.00016175805981 0)
(-0.00207266798607 -0.000131901451433 0)
(-0.0020832251266 -0.000101661662318 0)
(-0.00209100783628 -7.07095514935e-05 0)
(-0.00209599267429 -3.82667666963e-05 0)
(-0.00209835326906 -3.77067293513e-06 0)
(-0.00209799656376 3.26301670307e-05 0)
(-0.00209425609076 7.02464632406e-05 0)
(-0.00208655182758 0.000108636428686 0)
(-0.00207455871361 0.000148049679949 0)
(-0.00205782366534 0.00018919345531 0)
(-0.00203563336406 0.000232790291338 0)
(-0.00200731868261 0.000279297779799 0)
(-0.00197247714029 0.000328956131757 0)
(-0.00193090367535 0.000382156385823 0)
(-0.00188247034852 0.000439940883005 0)
(-0.00182699077059 0.000504502644373 0)
(-0.00176370999196 0.000579506239167 0)
(-0.00169060772364 0.000669794207095 0)
(-0.0016045795489 0.00078001535728 0)
(-0.00150298026509 0.000913236574163 0)
(-0.00138460133917 0.00107429976211 0)
(-0.00124136027176 0.00126810225531 0)
(-0.0010718424326 0.00144077490256 0)
(-0.000915140186035 0.0015608059777 0)
(-0.000728076955507 0.00172968225427 0)
(-0.000487011953159 0.00178968916277 0)
(-0.000245778031471 0.00176685457347 0)
(-2.43155122383e-05 0.00167819703474 0)
(0.000162995479574 0.00154382700354 0)
(0.000307878859102 0.00138359803923 0)
(0.000402582406086 0.00120906963891 0)
(0.000552847809415 0.00103645461226 0)
(0.000531332542115 0.000619602130476 0)
(0.000527788675371 0.000411498932621 0)
(0.000491364084905 0.000296459372103 0)
(0.000479584947296 0.000298143888792 0)
(0.000617333418191 0.0003500433013 0)
(0.000851765697797 0.000102755738688 0)
(0.000804149138669 -0.000507236157606 0)
(0.000461211251077 -0.00076322593679 0)
(0.000163403862263 -0.00068213106537 0)
(3.64079721957e-05 -0.000531262585885 0)
(-5.52764129271e-06 -0.000460060188896 0)
(-1.12177187142e-05 -0.000390855533542 0)
(-4.89259179118e-05 -0.00121085746105 0)
(-0.000142852402451 -0.00125510091726 0)
(-0.000189552213823 -0.000989142337802 0)
(-0.000294793520234 -0.000989842583747 0)
(-0.000360932074732 -0.00108616188445 0)
(-0.00039736418696 -0.00114403860102 0)
(-0.000503942586754 -0.0011594754032 0)
(-0.000521147368806 -0.00102787314184 0)
(-0.000643318237483 -0.00101853787994 0)
(-0.000644747101399 -0.000776706426928 0)
(-0.000727730727577 -0.000704820204731 0)
(-0.000827779856898 -0.000712718105112 0)
(-0.000913097499513 -0.000744406313189 0)
(-0.00107077129498 -0.000835939095424 0)
(-0.00115679238121 -0.000786598110727 0)
(-0.00115250785142 -0.000669697625372 0)
(-0.00125869120576 -0.000678320768108 0)
(-0.0013426831697 -0.000689563441932 0)
(-0.00140882987279 -0.000671848178292 0)
(-0.00146921028398 -0.000643196209327 0)
(-0.00152134286417 -0.000612193895572 0)
(-0.00158429698823 -0.000580251566604 0)
(-0.00161232929385 -0.00050980427751 0)
(-0.00172334062524 -0.000442171603286 0)
(-0.00171892525013 -0.000396643308793 0)
(-0.0017117570539 -0.000377008550988 0)
(-0.00182945025687 -0.000349092288111 0)
(-0.00179366820996 -0.000312355555629 0)
(-0.00182415604759 -0.000295848215216 0)
(-0.00190626003169 -0.000282890621621 0)
(-0.00192582408267 -0.000281403357658 0)
(-0.00198487064818 -0.000286877513116 0)
(-0.00200671387153 -0.000271480824384 0)
(-0.00203080814458 -0.000240589467064 0)
(-0.00205069971538 -0.000208564579463 0)
(-0.00206765589442 -0.000176863400994 0)
(-0.00208218027138 -0.000144569628735 0)
(-0.0020937651305 -0.000111605335714 0)
(-0.00210270228247 -7.76521582051e-05 0)
(-0.00210833817254 -4.23125646267e-05 0)
(-0.0021106147482 -5.15860220292e-06 0)
(-0.00211022272063 3.41689658425e-05 0)
(-0.00210692518586 7.54162648673e-05 0)
(-0.00209976399151 0.000118072249241 0)
(-0.00208816221505 0.000162252041515 0)
(-0.00207157916171 0.000208759092018 0)
(-0.00204910840435 0.000258413052106 0)
(-0.00201985889091 0.000311549538615 0)
(-0.00198329720341 0.000368133339919 0)
(-0.00193923880052 0.000428350083326 0)
(-0.00188776686184 0.000493309847049 0)
(-0.00182897305522 0.000565677880374 0)
(-0.00176230382472 0.00064981491852 0)
(-0.00168603512981 0.00075064304486 0)
(-0.00159844010494 0.000871207289106 0)
(-0.00150263337597 0.00101483121368 0)
(-0.00139850200199 0.00120231960998 0)
(-0.0012439473969 0.00146360019615 0)
(-0.00104950450365 0.00163543796853 0)
(-0.000954424122711 0.00169723819222 0)
(-0.000776612318118 0.00206297678735 0)
(-0.000456898664273 0.0021177239897 0)
(-0.000145390332734 0.00203942972377 0)
(0.000130396158555 0.0018771556529 0)
(0.000357583482914 0.00165973989967 0)
(0.000542982067418 0.00141939023808 0)
(0.000628620660582 0.00113844907569 0)
(0.000749726952462 0.000935336769129 0)
(0.000733635399819 0.000572502494268 0)
(0.000634530261879 0.000326075659145 0)
(0.000483268152572 0.000149154372647 0)
(0.00036271135185 0.000262035940507 0)
(0.000617117915774 0.000692059103381 0)
(0.00128332233467 0.000381562542768 0)
(0.00126964217126 -0.000836623954897 0)
(0.00050671099425 -0.00123625464911 0)
(-6.5795335865e-06 -0.00090219245192 0)
(-9.41100500195e-05 -0.000544962516504 0)
(-7.93087753263e-05 -0.000486147662194 0)
(-4.78883600214e-05 -0.000347050851014 0)
(-3.67206006317e-05 -0.00129036375762 0)
(-9.60280563159e-05 -0.00131432098898 0)
(-0.000181816614166 -0.0010766418294 0)
(-0.000302020477518 -0.00108066364755 0)
(-0.000332348370395 -0.00108849931617 0)
(-0.000401936685482 -0.00122282854442 0)
(-0.000500194874039 -0.00123366853743 0)
(-0.000470974521681 -0.000996496644581 0)
(-0.000646109242723 -0.0011201033955 0)
(-0.000624806011414 -0.000826053825366 0)
(-0.000725747570775 -0.000786355963524 0)
(-0.000816065945475 -0.000806188317458 0)
(-0.000901850757918 -0.000850237921833 0)
(-0.00104660066168 -0.00092832476899 0)
(-0.00103678818135 -0.000797258607217 0)
(-0.00110622382214 -0.00073654638488 0)
(-0.00123483901737 -0.000768975706728 0)
(-0.00131548470183 -0.000767137611 0)
(-0.00138320333348 -0.000738021568815 0)
(-0.00144785830355 -0.000702688601845 0)
(-0.00150523973835 -0.000669093470969 0)
(-0.00157587409063 -0.000638530726324 0)
(-0.0015681241025 -0.000558361783133 0)
(-0.00162382693993 -0.000474441440483 0)
(-0.00175035189448 -0.000439104399271 0)
(-0.00171309942347 -0.000410347012439 0)
(-0.00175306937763 -0.000369147757912 0)
(-0.00182193850884 -0.000341367584323 0)
(-0.00182518402861 -0.000336541850197 0)
(-0.00186034113426 -0.000324769710521 0)
(-0.00191238999152 -0.000324793533352 0)
(-0.00198794125023 -0.000326931505067 0)
(-0.00201182392917 -0.00029925250793 0)
(-0.00203572149751 -0.000264088906703 0)
(-0.00205805860328 -0.000228591484277 -8.98085474551e-29)
(-0.0020767277294 -0.000193574053531 8.74938149809e-29)
(-0.00209271311959 -0.000158244132337 0)
(-0.00210495329246 -0.000122381053734 0)
(-0.00211451812951 -8.55607332381e-05 0)
(-0.00212156383629 -4.7090425635e-05 0)
(-0.00212460414009 -6.79004214615e-06 0)
(-0.0021241164023 3.55760268751e-05 0)
(-0.00212091030692 8.02554544329e-05 0)
(-0.00211436396778 0.000127056291756 0)
(-0.0021034426278 0.000176060037222 0)
(-0.00208730842993 0.000228181901833 0)
(-0.00206489517657 0.000284437659058 0)
(-0.00203506436593 0.000345027793525 0)
(-0.00199706037055 0.000409457304177 0)
(-0.00195071094032 0.000477501019168 0)
(-0.00189636936622 0.000550167600331 0)
(-0.00183436350075 0.000630454844886 0)
(-0.00176424496829 0.000723012119186 0)
(-0.00168452220106 0.000832045807221 0)
(-0.00159672493647 0.000957131142886 0)
(-0.00151998504979 0.00110486332603 0)
(-0.00145029642895 0.00133970404221 0)
(-0.00124675775755 0.0017229444974 0)
(-0.00100829506231 0.00171305321514 0)
(-0.00116431806365 0.00113465702487 0)
(-0.000947350647222 0.000982525750292 0)
(-0.000240192175386 0.000981645028187 0)
(0.000340359106944 0.000974562399387 0)
(0.000867595366302 0.000913433125386 0)
(0.00138163857013 0.000843220314485 0)
(0.00192645854641 0.000757831857712 0)
(0.00229904002742 0.000616703861087 0)
(0.00327467156708 0.000493294162048 0)
(0.00292394266666 0.000101001466707 0)
(0.0011970323694 3.71252746996e-05 0)
(0.000677249480028 0.000157837589662 0)
(7.59919047137e-05 0.000557393495198 0)
(0.00105579591665 0.00168916295142 0)
(0.0026077952649 0.00217525352958 0)
(0.00250781081372 -0.00243600224818 0)
(0.000524265268602 -0.00286610162503 0)
(-0.000413697764739 -0.00135511780007 0)
(-0.000307767012263 -0.000437461784277 0)
(-0.000171714426527 -0.000507331237851 0)
(-0.000125778004712 -0.000191344041566 0)
(-3.98190712652e-05 -0.00136766870398 0)
(-0.000111831040445 -0.00137606323521 0)
(-0.000199012947836 -0.00135808900643 0)
(-0.000253845327587 -0.00115649263938 0)
(-0.000321361874457 -0.00116684432185 0)
(-0.000412619841495 -0.00130440107575 0)
(-0.000496282450345 -0.0013010084593 0)
(-0.000485987685857 -0.00106914798274 0)
(-0.000663030677059 -0.00120294823428 0)
(-0.00061247297655 -0.000883192809361 0)
(-0.000723635487245 -0.000868065215406 0)
(-0.000807853521017 -0.00089389342159 0)
(-0.000891913869932 -0.000942592708073 0)
(-0.00103191997206 -0.00100874727175 0)
(-0.00100091782683 -0.000849560405284 0)
(-0.00110038071261 -0.000828286258122 0)
(-0.00121502077919 -0.000859428620083 0)
(-0.0012900369818 -0.000844028789317 0)
(-0.00135844879516 -0.000806077464915 0)
(-0.00142237744079 -0.000763623219021 0)
(-0.00148629221753 -0.000725866981462 0)
(-0.00156798501512 -0.000687838717688 0)
(-0.00155224874231 -0.000602005217645 0)
(-0.00160242703713 -0.000541232770925 0)
(-0.00175314380142 -0.000492939104353 0)
(-0.00172014652318 -0.000434705427081 0)
(-0.00174292885067 -0.000417122808519 0)
(-0.00186057807469 -0.000389711602562 0)
(-0.00184559134705 -0.00035794270493 0)
(-0.00187895853011 -0.00036962584383 0)
(-0.00195912731589 -0.000384760751513 0)
(-0.00198448092602 -0.000365396329865 0)
(-0.00201364665213 -0.00032778398646 0)
(-0.00204102038088 -0.00028884160603 0)
(-0.00206574191591 -0.000250275058884 0)
(-0.00208555277428 -0.000211827116681 0)
(-0.00210297440401 -0.000173329483308 0)
(-0.00211760376894 -0.000134235150571 0)
(-0.00212775398907 -9.42787931057e-05 0)
(-0.00213508906227 -5.28042488671e-05 0)
(-0.00213939286236 -9.16109716818e-06 0)
(-0.00213967223228 3.6670473545e-05 0)
(-0.00213663727755 8.48498797139e-05 0)
(-0.00213050983201 0.000135554806019 0)
(-0.00212040648414 0.000189182310378 0)
(-0.00210516272114 0.000246969624832 0)
(-0.00208344473127 0.000310286275129 0)
(-0.00205379367775 0.000379247485648 0)
(-0.00201502476359 0.000452595012304 0)
(-0.00196702912644 0.00052927190888 0)
(-0.00191071062228 0.00061012815238 0)
(-0.00184610543085 0.000698332332686 0)
(-0.00177252792181 0.000798237043111 0)
(-0.00168741228531 0.000912559764526 0)
(-0.00160234772872 0.00103553555422 0)
(-0.00158461866342 0.00115277206343 0)
(-0.00161920983208 0.00116415640769 0)
(-0.00138024820591 0.000939892795622 0)
(-0.000182301785147 0.000873107179905 0)
(0.00101174930441 0.00136519402296 0)
(0.0153912863496 0.00706231507832 0)
(0.0249931573805 0.00678538768623 0)
(0.035607094256 0.00622973551839 0)
(0.0462913980949 0.00567068233317 0)
(0.0562133093201 0.00506627152299 0)
(0.0650137018926 0.00435156640001 0)
(0.0723934707554 0.00352826609371 0)
(0.0781564036577 0.0021450414583 0)
(0.0822719351518 -1.02321671799e-05 0)
(0.0838007435655 -0.00216433037233 0)
(0.0826169012133 -0.00351837496432 0)
(0.0760874366278 -0.00537087652063 0)
(0.069390495015 -0.00989450728602 0)
(0.019067432455 -0.004370060543 0)
(0.00610888854499 -0.00182459948673 0)
(1.22902815501e-05 -0.000832057215349 0)
(-0.00194240644953 0.000435831826472 0)
(-0.00077494242199 0.000990481482718 0)
(-0.000270240692757 -0.000941405295393 0)
(-0.000307230347343 0.0001041056729 0)
(-4.24709899781e-05 -0.00144628377991 0)
(-0.000138557583285 -0.00144397930251 0)
(-0.000157595086856 -0.00122385042373 0)
(-0.000203256063636 -0.00123569031909 0)
(-0.000300755940411 -0.00125108281513 0)
(-0.000412214514863 -0.00138518294935 0)
(-0.000491991617223 -0.00135917018378 0)
(-0.000512986264129 -0.00115072064544 0)
(-0.000669433708146 -0.00127294432796 0)
(-0.00060213771326 -0.000948693351959 0)
(-0.000721249177161 -0.000953106685946 0)
(-0.000804147030654 -0.000980528339391 0)
(-0.000891034159672 -0.00103075948395 0)
(-0.00102205111678 -0.00107971846138 0)
(-0.00100314649287 -0.000917024968788 0)
(-0.00110909363685 -0.000915602532466 0)
(-0.00120530812784 -0.000940602875173 0)
(-0.00127310853583 -0.000917215192466 0)
(-0.00133939516147 -0.000874225616773 0)
(-0.0014034591588 -0.0008278951381 0)
(-0.00146672483783 -0.000784475734654 0)
(-0.00155115215415 -0.000739384431143 0)
(-0.00157362538566 -0.000661865952619 0)
(-0.00159130758217 -0.000595035596618 0)
(-0.00165934064991 -0.000519872170516 0)
(-0.00175918976387 -0.000480548753099 0)
(-0.00173921538497 -0.000461067811876 0)
(-0.00177437718682 -0.000430062698545 0)
(-0.00190463362862 -0.000418787518886 0)
(-0.00193979807246 -0.000421537167764 0)
(-0.00196699948844 -0.000419137448728 0)
(-0.00199269520951 -0.000393410965356 0)
(-0.00202064034157 -0.000356355226082 0)
(-0.00204840643616 -0.000315157163164 0)
(-0.00207333908242 -0.000273204346066 0)
(-0.00209536779249 -0.000231647272712 -8.59114244779e-29)
(-0.00211398668665 -0.00019000012579 8.37224505677e-29)
(-0.00212950437905 -0.000147543480129 0)
(-0.00214213583597 -0.000104058952625 0)
(-0.0021501892727 -5.92993823265e-05 0)
(-0.00215493931343 -1.24414283798e-05 0)
(-0.00215628830826 3.70120095441e-05 0)
(-0.00215405438207 8.90340521308e-05 0)
(-0.00214846624611 0.000143594626775 0)
(-0.0021391232766 0.000201322296583 0)
(-0.00212526195233 0.000264356626745 0)
(-0.00210526309648 0.00033508514066 0)
(-0.00207678909656 0.000413433692248 0)
(-0.0020384020131 0.000496611704853 0)
(-0.00199048728986 0.000582569313786 0)
(-0.0019338994878 0.000672050582334 0)
(-0.00186805693735 0.000768161385929 0)
(-0.00179098211566 0.000875175969913 0)
(-0.00169637656207 0.00100399205888 0)
(-0.00160025579158 0.00111318861794 0)
(-0.00151264531937 0.000822990473123 0)
(-0.00117136066342 0.000628572906049 1.17749746763e-28)
(0.00404614670973 0.00459940872633 -2.44703756501e-27)
(0.0164763894684 0.00828422124824 0)
(0.0282028584206 0.0149869706981 0)
(0.0389975236362 0.0184845124072 0)
(0.0490567943027 0.019501148071 0)
(0.0594549946895 0.0192950606536 0)
(0.0698850598601 0.0184109350353 0)
(0.0797752169279 0.0169722293005 0)
(0.0887558591502 0.0149958172193 0)
(0.0965572308856 0.012462769088 0)
(0.10295127492 0.00927436156588 0)
(0.107791772772 0.00537486324918 0)
(0.110728848503 0.000871640674052 0)
(0.111465727789 -0.00460306655514 0)
(0.109757730662 -0.0122356517257 0)
(0.108733107061 -0.0237454507428 0)
(0.102991847357 -0.0346368880941 0)
(0.0951120464303 -0.0302010403676 0)
(0.0775669569213 -0.0215339497769 0)
(0.0559879294964 -0.0162159668895 0)
(0.00406200842673 -0.00101822839778 0)
(0.000708549010755 0.000604777674295 0)
(-0.00109198342053 0.00153840460318 0)
(-3.9240472506e-05 -0.00152831562264 0)
(-0.000128303378488 -0.00152275798312 0)
(-0.000147762240548 -0.00127219170231 0)
(-0.00019573410211 -0.00132629879506 -1.81455766329e-29)
(-0.000297613181038 -0.00136432032067 1.86192985825e-29)
(-0.000407470080088 -0.00146189840019 0)
(-0.000472859061848 -0.00141413658633 0)
(-0.000528844253594 -0.00124288995679 0)
(-0.000604423044678 -0.00119881129333 0)
(-0.000604712256087 -0.0010249519854 0)
(-0.000718505057381 -0.00104458174846 0)
(-0.000803145089428 -0.0010693147115 0)
(-0.000897605913296 -0.00112139226555 0)
(-0.0010166836937 -0.00114773285198 0)
(-0.00100443550376 -0.000986561699772 0)
(-0.00111570936708 -0.000998158255253 0)
(-0.00119866679377 -0.00101368724971 0)
(-0.00126253783421 -0.000985451058731 0)
(-0.00132642073254 -0.000940948073372 0)
(-0.00138970562403 -0.000892545122961 0)
(-0.00145179944216 -0.000845386507644 0)
(-0.00152759104369 -0.000794580427782 0)
(-0.00158744611137 -0.00072236607736 0)
(-0.00159427475316 -0.000640655958665 0)
(-0.00163442126214 -0.000576764730308 0)
(-0.00179701494043 -0.000540826961406 0)
(-0.00175796669552 -0.000489018229767 0)
(-0.00177735708192 -0.000484111296726 0)
(-0.00182806274482 -0.000471132735133 0)
(-0.00192149152937 -0.000468444469435 0)
(-0.00196544478191 -0.000455674251013 0)
(-0.0019971348162 -0.000424031030845 0)
(-0.0020268929016 -0.000384668069989 0)
(-0.00205490293919 -0.000341762043421 0)
(-0.0020832365111 -0.000297663942931 0)
(-0.00210598141575 -0.000252793004406 0)
(-0.002126258406 -0.000207957086972 0)
(-0.00214270381779 -0.000162250567451 0)
(-0.00215650623162 -0.000115274765745 0)
(-0.00216636580588 -6.68093783815e-05 0)
(-0.00217184176863 -1.65564975428e-05 0)
(-0.0021738944313 3.63168098552e-05 0)
(-0.00217295928662 9.23445179626e-05 0)
(-0.00216857956001 0.000151120949243 0)
(-0.00216004620232 0.000212617996424 0)
(-0.00214710674222 0.000279807808272 0)
(-0.00212927780865 0.000357214173717 0)
(-0.00210398704749 0.000445352946056 0)
(-0.00206934970981 0.000539653467882 0)
(-0.00202373210232 0.000635904853611 0)
(-0.00196834649205 0.000733600731595 0)
(-0.00190490720246 0.000836604567569 0)
(-0.00183344938028 0.000953913883037 0)
(-0.00171712114318 0.00104562272304 0)
(-0.00146343891751 0.000618266640921 0)
(-0.00114124485289 0.000803645958036 0)
(0.0108362854173 0.00942535732397 0)
(0.0235709877407 0.0169894988891 0)
(0.0362514549012 0.0223926570265 0)
(0.0486457803534 0.0263171480665 0)
(0.0603145327151 0.0289445945507 0)
(0.0713409999634 0.0298215968694 0)
(0.0821285636028 0.029339718663 0)
(0.0926265633113 0.0278920011265 0)
(0.102548166652 0.0256407122421 0)
(0.111631861514 0.0226339291348 0)
(0.119666819268 0.0188689379082 0)
(0.126471198976 0.0142941169659 0)
(0.131887302476 0.00883456839726 0)
(0.135813713503 0.00244709502237 0)
(0.137898491645 -0.00505510539454 0)
(0.138513543188 -0.0140444040131 0)
(0.13829933945 -0.0247891943152 0)
(0.136346386776 -0.0333549876163 0)
(0.13020944194 -0.0367120959702 0)
(0.117047004156 -0.0390365843753 0)
(0.0987157391211 -0.0426119509126 0)
(0.0719387929195 -0.0442001269596 0)
(0.0436478208519 -0.0240169545989 0)
(0.000132682572058 0.00108286403702 0)
(-3.5964190085e-05 -0.00160575804663 0)
(-0.000125509065449 -0.00160065288191 0)
(-0.000138611254245 -0.00126210391575 0)
(-0.000195485876233 -0.00141744973499 0)
(-0.000304829121457 -0.00148994118734 0)
(-0.000402536079771 -0.00153349666426 0)
(-0.000455103405274 -0.00147170260519 0)
(-0.000531582265575 -0.00134641912261 0)
(-0.000601577915839 -0.00123603580225 0)
(-0.000623856552938 -0.00109691231952 0)
(-0.000725103708828 -0.00113327542889 0)
(-0.000805195596518 -0.00115890788497 0)
(-0.000905928647051 -0.00121282544965 0)
(-0.00100802520116 -0.00121257106011 0)
(-0.000997885070511 -0.00105709566676 0)
(-0.00111376305323 -0.00107976191371 0)
(-0.00118948993717 -0.00108415437354 0)
(-0.00125343731416 -0.00105096169815 0)
(-0.00131601850235 -0.00100582751795 0)
(-0.00137803944958 -0.000956016478502 0)
(-0.00143980093382 -0.00090686098278 0)
(-0.00151006396413 -0.000855037861279 0)
(-0.00158272045897 -0.000784033890481 0)
(-0.00159537159515 -0.000691433235712 0)
(-0.00162459301523 -0.00063034569247 0)
(-0.00170556119834 -0.000569392009776 0)
(-0.00179412576079 -0.000530185447886 0)
(-0.00179876882946 -0.000519531371606 0)
(-0.00184202283167 -0.000526432335978 0)
(-0.00192945278399 -0.000531650970228 0)
(-0.00195695178765 -0.000498639195129 0)
(-0.00199390580644 -0.000457803037094 0)
(-0.00202589229142 -0.000414723963124 0)
(-0.00205927754287 -0.00037100110105 0)
(-0.00208946113449 -0.000324329468944 0)
(-0.00211701370687 -0.000275993855076 0)
(-0.00213821568096 -0.000227309099152 8.19568903565e-29)
(-0.00215691485071 -0.000178355567236 -7.98197639464e-29)
(-0.00217180811841 -0.000127796951572 0)
(-0.002183119152 -7.56849365782e-05 0)
(-0.00219028355176 -2.18446313315e-05 0)
(-0.00219324609061 3.47034998752e-05 0)
(-0.0021924526387 9.48605241441e-05 0)
(-0.00218933131788 0.000158088908762 0)
(-0.0021818289941 0.000222501992989 0)
(-0.00217026088111 0.000291792973875 0)
(-0.0021561356046 0.000375873980512 0)
(-0.00213697722674 0.000476148324282 0)
(-0.00210829297977 0.000581587254909 0)
(-0.00206631184063 0.000688052725739 0)
(-0.00201417941486 0.00079131722807 0)
(-0.00196210630334 0.000901546799561 0)
(-0.0018573388348 0.000947005525832 0)
(-0.00143662118486 0.00045263579519 0)
(-0.000865184021738 0.002247608471 0)
(0.0160078681978 0.0149622601408 0)
(0.0295132180776 0.0235532108249 0)
(0.0429396927754 0.0301444442451 0)
(0.0560858495343 0.0350682929486 0)
(0.0688052880141 0.0384950947439 0)
(0.0809733505422 0.0405444310737 0)
(0.0925941169331 0.0410862629171 0)
(0.103774976887 0.0402739200096 0)
(0.114498337752 0.0383370359569 0)
(0.124620345973 0.0354108781086 0)
(0.133971241879 0.0315470582067 0)
(0.142393744399 0.0267476405275 0)
(0.149741397565 0.0209774261227 0)
(0.155867342912 0.014178980314 0)
(0.160704736903 0.00629157072678 0)
(0.163812752041 -0.0027786785171 0)
(0.165566931637 -0.0130504189798 0)
(0.165807122283 -0.0244795497774 0)
(0.164146504387 -0.0357486601544 0)
(0.158978074571 -0.0458946113899 0)
(0.147814680847 -0.0555633587747 0)
(0.129646512608 -0.0650879808916 0)
(0.101910917921 -0.0710592162103 0)
(0.0640253626326 -0.066613053001 0)
(0.0189850723808 -0.0647481569288 0)
(-3.08597316061e-05 -0.00167645890145 0)
(-0.000107447255588 -0.0016733366693 0)
(-0.000127149547712 -0.00125264547075 0)
(-0.000215260746238 -0.00150262781275 0)
(-0.000321134443388 -0.00159239784544 0)
(-0.000404986413973 -0.00160037646083 0)
(-0.000446661492669 -0.00151614560585 0)
(-0.000550465538151 -0.00148074670577 0)
(-0.000599183829905 -0.0012730899605 0)
(-0.000638376923351 -0.0011638933208 0)
(-0.000731201914232 -0.0012163080274 0)
(-0.000803931145462 -0.00124646948341 0)
(-0.000909755949205 -0.00129975260979 0)
(-0.000964898787187 -0.00123969429726 0)
(-0.000990340912723 -0.00113456203465 -1.31338983366e-28)
(-0.00110099041166 -0.00116136445705 1.37541665561e-28)
(-0.00117444065567 -0.00115406507554 0)
(-0.00123903185045 -0.00111519640658 0)
(-0.00130454078578 -0.00107071250954 0)
(-0.00136564613733 -0.00101895364773 0)
(-0.00142756841774 -0.000967970185717 0)
(-0.00149402976966 -0.000915589436735 0)
(-0.00157081240625 -0.000844772013386 0)
(-0.0015901977046 -0.000741608306906 0)
(-0.00162618009119 -0.000679179817298 0)
(-0.00167288459381 -0.000632349573257 0)
(-0.0018335134122 -0.000613926423686 0)
(-0.00184897628696 -0.000577537887256 0)
(-0.00190004860388 -0.000580877901398 0)
(-0.001932979278 -0.000570037541176 0)
(-0.00196089103865 -0.000536757949515 0)
(-0.00199185838607 -0.000493198629199 0)
(-0.00202709394226 -0.000448099091555 0)
(-0.00206224031349 -0.000403751857244 0)
(-0.00209556837171 -0.000353854458233 0)
(-0.00212240760551 -0.000300942031679 0)
(-0.00214956592482 -0.000249471714322 0)
(-0.00217047736875 -0.000196750729427 0)
(-0.00218783010647 -0.000142173353635 0)
(-0.00220152895814 -8.58582533066e-05 0)
(-0.0022090538446 -2.80565102863e-05 0)
(-0.00221284298903 3.19126472558e-05 7.22868005521e-29)
(-0.00221337652284 9.555969235e-05 -7.04194450381e-29)
(-0.00221308357904 0.000164010363398 0)
(-0.0022079965804 0.000236123154041 0)
(-0.00218426541199 0.000310476789787 0)
(-0.00214895611739 0.000391867891028 0)
(-0.00213227924687 0.000488812609699 0)
(-0.00213822687482 0.000607845787618 0)
(-0.00210779534414 0.000735671826145 0)
(-0.00206566810072 0.000845854704007 0)
(-0.00195362724488 0.000898365703865 0)
(-0.0015755335881 0.000363071777258 0)
(0.00120963798021 0.00396392297207 0)
(0.0192612931758 0.0188217431804 0)
(0.033944271389 0.0292407845306 0)
(0.0480673447244 0.037358626511 0)
(0.0619114274014 0.0436006674377 0)
(0.0754037663506 0.0481611300576 0)
(0.0884526151131 0.0511459650624 0)
(0.100993392769 0.0526445243949 0)
(0.113008638447 0.0526928690825 0)
(0.124520060709 0.0513923919712 0)
(0.135513632775 0.0488816497043 0)
(0.145914570615 0.0452609727408 0)
(0.155619083749 0.0405751467595 0)
(0.164518689942 0.0348241891546 0)
(0.172504090921 0.027972095876 0)
(0.179458305675 0.0199552144688 0)
(0.185288633812 0.010685296413 0)
(0.189752002348 0.000123549710071 0)
(0.192669344997 -0.0117325718067 0)
(0.193954864099 -0.0249606011543 0)
(0.1929990316 -0.039256242682 0)
(0.188553227474 -0.0542747389278 0)
(0.178573421441 -0.0703339519888 0)
(0.160962996425 -0.087923688425 0)
(0.131923934225 -0.106390767783 0)
(0.0901610280519 -0.125161165052 0)
(0.00325329982619 -0.0149845907319 0)
(-2.6829102416e-05 -0.00173793263869 0)
(-8.78447161386e-05 -0.00173467569676 0)
(-0.000127192095651 -0.00133278530197 0)
(-0.000245933381813 -0.00163349508516 0)
(-0.000334128334701 -0.00167677362197 0)
(-0.000407549078532 -0.00166677174586 0)
(-0.0004451493134 -0.00155869132261 0)
(-0.00055684001131 -0.00158203002048 0)
(-0.000587633736879 -0.00131849261874 0)
(-0.000641652863677 -0.00122567320353 0)
(-0.000732210212344 -0.00129310435403 0)
(-0.000797394126135 -0.00132781487991 0)
(-0.000907145297111 -0.00138365116144 0)
(-0.000918083524287 -0.00125212126523 0)
(-0.00098863092697 -0.00121157422399 0)
(-0.00108743534001 -0.00124086411118 0)
(-0.00115972493816 -0.00122454133513 0)
(-0.00121379940964 -0.00117051248612 0)
(-0.00129019649079 -0.00113547684772 0)
(-0.00135097980914 -0.00108196522119 0)
(-0.00141418442389 -0.00102909828484 0)
(-0.00147949858214 -0.000976948269157 0)
(-0.00155566335305 -0.000904711683108 0)
(-0.0015807696188 -0.000794910648024 0)
(-0.00162596030699 -0.00073132706191 0)
(-0.00165035171704 -0.000688608385588 0)
(-0.00173575313683 -0.000657677512742 0)
(-0.0017945940876 -0.000621867603162 0)
(-0.00184860740387 -0.000615146849779 0)
(-0.00192235688443 -0.00061112855463 0)
(-0.0019579018655 -0.000573876117773 0)
(-0.00198101374219 -0.000527886859831 0)
(-0.00202889521979 -0.000486550387369 0)
(-0.00206510765302 -0.000439210009143 0)
(-0.00209288539027 -0.000384043581871 0)
(-0.00213010884291 -0.000329559364746 0)
(-0.00215862098691 -0.000274743961804 0)
(-0.00218221936836 -0.000217800436719 7.76422191305e-29)
(-0.00220194049379 -0.000159103443193 -7.55196177039e-29)
(-0.0022184100974 -9.83708778776e-05 0)
(-0.00223050421324 -3.60193245176e-05 0)
(-0.00223555712291 2.81942214788e-05 0)
(-0.00223558357823 9.71045867502e-05 0)
(-0.0022274156985 0.000174457900554 0)
(-0.00220971792574 0.000256979280322 0)
(-0.00217944103677 0.000332607408813 0)
(-0.00215788309741 0.000404385270824 0)
(-0.00216542182196 0.000493114175978 0)
(-0.00216747340503 0.000617494941226 0)
(-0.00213539534853 0.000787795382475 0)
(-0.00203940938069 0.000877684269708 0)
(-0.00157405907199 0.000282851278669 0)
(0.00134236017083 0.00524037618149 0)
(0.0205036675703 0.0218647803528 0)
(0.0362773279159 0.0339680668819 0)
(0.0513760504399 0.0438432354976 0)
(0.0660028087804 0.0516144209953 0)
(0.0802210685366 0.0574807303197 0)
(0.0940067766376 0.0616017311275 0)
(0.107314045435 0.0640978112117 0)
(0.120110798943 0.0650723162627 0)
(0.132388084062 0.0646083576082 0)
(0.144153143993 0.0627966530529 0)
(0.155400914699 0.0597345025267 0)
(0.166097542028 0.0554955021229 0)
(0.176188267931 0.0501129925907 0)
(0.185608837007 0.0435800315919 0)
(0.194288556611 0.0358531483034 0)
(0.202147555076 0.0268567209366 0)
(0.209083677103 0.0164858924308 0)
(0.215066111186 0.00466451369996 0)
(0.21947509472 -0.00877929366031 0)
(0.222449428957 -0.0239729262334 0)
(0.223288482541 -0.0411148020603 0)
(0.220987272629 -0.0604781695376 0)
(0.213997677434 -0.0828085079874 0)
(0.200388641569 -0.109236050541 0)
(0.177258408395 -0.140590293567 0)
(0.141298692429 -0.177042280739 0)
(0.083814138746 -0.174227530657 0)
(-2.57866890554e-05 -0.00179444213164 0)
(-8.18609290604e-05 -0.00178943149666 0)
(-0.000135698516772 -0.001421762454 0)
(-0.000263273390805 -0.00174497987061 0)
(-0.000329174599723 -0.00174555878279 0)
(-0.000395855449725 -0.0017337138667 0)
(-0.000440407023639 -0.00160741594498 0)
(-0.000553718527175 -0.00165780524941 0)
(-0.000574792583748 -0.00137706301382 0)
(-0.000639712542127 -0.00128946069312 0)
(-0.000732128590545 -0.00136738737406 0)
(-0.000793766831467 -0.00140350024016 0)
(-0.000901588841189 -0.00146135906725 0)
(-0.000921920171122 -0.00132204379078 0)
(-0.000995517581471 -0.0012865053361 0)
(-0.00108538079815 -0.00131629544932 0)
(-0.00115245449747 -0.001294630218 0)
(-0.00120276025369 -0.00123440288124 0)
(-0.00127698997107 -0.00119927011904 0)
(-0.00133638232974 -0.00114374081597 0)
(-0.00139825366291 -0.00108866270501 0)
(-0.00146719614523 -0.00104062485898 0)
(-0.00153736185181 -0.000964339333431 0)
(-0.00156898449743 -0.000850225683237 0)
(-0.00162681608283 -0.000782635195336 0)
(-0.00164803162177 -0.000733693001887 0)
(-0.00171380679657 -0.000712713189875 0)
(-0.00179139209046 -0.000695352087096 0)
(-0.00188315296795 -0.000689894058498 0)
(-0.00190734515002 -0.000655705604376 0)
(-0.00194934799689 -0.000610110084063 0)
(-0.00197541518057 -0.000562017371447 0)
(-0.00201134114673 -0.000519597206301 0)
(-0.00204872932747 -0.000474089446688 0)
(-0.00208752156758 -0.000421745240947 0)
(-0.00213388664829 -0.000363988784901 0)
(-0.00216652508635 -0.000303084733468 0)
(-0.00219261539028 -0.000241162593602 0)
(-0.00221489049651 -0.000178639170095 0)
(-0.00223345324603 -0.000114129122298 0)
(-0.00224902844043 -4.65780304101e-05 7.12348131705e-29)
(-0.00225644538617 2.45482899077e-05 -6.89655641322e-29)
(-0.00225341924487 0.000103975255679 0)
(-0.00223251274115 0.000192175903645 0)
(-0.00221568222914 0.000276358939026 0)
(-0.00221419588944 0.000346602501394 0)
(-0.00220889317115 0.000408129787962 0)
(-0.00221841889659 0.000495745709596 0)
(-0.00221424841081 0.000645635500038 0)
(-0.00211808690017 0.000882649979761 0)
(-0.00154206955763 0.000268669198857 0)
(-0.000544764591533 0.00475801389344 0)
(0.020483264943 0.0241980565289 0)
(0.0369351424947 0.0380458523978 0)
(0.0528553090808 0.0495453590051 0)
(0.0683053013208 0.0589117231601 0)
(0.0832635824007 0.0662317366992 0)
(0.0977331847322 0.0716357807628 0)
(0.11170599848 0.0752665839797 0)
(0.125167968198 0.0772535587487 0)
(0.138113760841 0.0777108737624 0)
(0.150550964038 0.0767372607571 0)
(0.162495214098 0.0744224106153 0)
(0.173957785856 0.0708460656826 0)
(0.184936454538 0.0660649281763 0)
(0.195416174583 0.0601015752865 0)
(0.205373404961 0.0529406816687 0)
(0.214777225582 0.0445283849213 0)
(0.223585910785 0.0347715417718 0)
(0.231727609373 0.0235361975075 0)
(0.239207528548 0.0106376163662 0)
(0.245433322457 -0.00418798143157 0)
(0.250729334478 -0.0210230647696 0)
(0.25449668756 -0.0404878770777 0)
(0.255994890517 -0.0633446926491 0)
(0.254140449799 -0.0908652457616 0)
(0.247187822579 -0.125143202307 0)
(0.231719046338 -0.169391554937 0)
(0.19638237157 -0.230440196739 0)
(0.134481567198 -0.31651744265 0)
(-2.60497582507e-05 -0.00184919123048 0)
(-8.2702224669e-05 -0.00184323428329 0)
(-0.000149609358713 -0.00153738355409 0)
(-0.00027119504647 -0.00183060694773 0)
(-0.000316541905779 -0.00180462270475 0)
(-0.000374968706539 -0.00179962593496 0)
(-0.000442229250167 -0.00170933375726 0)
(-0.000535781791495 -0.00171365993525 0)
(-0.000561154685736 -0.00144891700572 0)
(-0.000636301947317 -0.00135676131808 0)
(-0.000732058912617 -0.00144064367096 0)
(-0.000791946894096 -0.00147689348653 0)
(-0.000897027365401 -0.00153381780617 0)
(-0.000923241307977 -0.00138836874443 0)
(-0.00099906261238 -0.00135719672846 0)
(-0.0010851007473 -0.00138548988548 0)
(-0.00114943559857 -0.00136077646485 0)
(-0.00119510764436 -0.00129641480583 0)
(-0.00126764208197 -0.00126371744713 0)
(-0.00132357375091 -0.00120425127897 0)
(-0.00137866735019 -0.00114398048436 0)
(-0.0014524003526 -0.00110319810381 0)
(-0.00151294355694 -0.00102326025049 0)
(-0.00155233105756 -0.000909169574371 0)
(-0.00161955039082 -0.000836893986786 0)
(-0.00164321222001 -0.000780988493351 0)
(-0.00170896713835 -0.000769517899699 0)
(-0.00178436114703 -0.000768975039798 0)
(-0.00188032327019 -0.000752033687393 0)
(-0.00191430065253 -0.000698439053408 0)
(-0.00193768568024 -0.000645541193014 0)
(-0.00198510689711 -0.000605524193358 0)
(-0.00202705981782 -0.000561798715219 0)
(-0.00206171909789 -0.000511355905858 0)
(-0.00207908321739 -0.000458436035707 0)
(-0.00212758563829 -0.000402070588528 0)
(-0.00216690719257 -0.000336246411599 0)
(-0.00220099895926 -0.000269223979691 0)
(-0.0022280485373 -0.0002010255128 0)
(-0.00224797758903 -0.000131867950251 0)
(-0.00226493528467 -5.94408457167e-05 0)
(-0.00227704415424 2.22158878854e-05 0)
(-0.00226105285605 0.000117023708763 0)
(-0.00223486692935 0.000210641025627 0)
(-0.00223311486812 0.000288447340621 0)
(-0.0022284298672 0.000351428663848 0)
(-0.00221715784732 0.000415122918761 0)
(-0.00219302492267 0.000505801260421 0)
(-0.00216752478143 0.000542427642699 0)
(-0.00168707163902 0.000382314481425 0)
(-0.00405925908642 0.00341974389254 0)
(0.0195384627607 0.0253417239416 0)
(0.0363405498709 0.0409727001563 0)
(0.052803841789 0.0542912913541 0)
(0.0689302409347 0.0653469609124 0)
(0.0845828247347 0.0742296379096 0)
(0.0997051775566 0.0810476381115 0)
(0.114285202267 0.0859364003421 0)
(0.128324239987 0.089043207258 0)
(0.141830712605 0.0905077841163 0)
(0.15482214679 0.0904548724127 0)
(0.16732518645 0.0889922456944 0)
(0.179372005583 0.0862110791621 0)
(0.190994084429 0.082184067253 0)
(0.20221725392 0.0769588376418 0)
(0.21306099132 0.0705508987246 0)
(0.223540288113 0.0629391190439 0)
(0.233666967776 0.0540625197975 0)
(0.243449188093 0.0438160066865 0)
(0.252888653933 0.032043453601 0)
(0.261986395972 0.0185149995468 0)
(0.270828007447 0.00301691039715 0)
(0.2787624293 -0.0149050454658 0)
(0.286177626418 -0.0357962021539 0)
(0.292718735896 -0.0607080375561 0)
(0.298178278362 -0.0911857416705 0)
(0.302515303109 -0.129806638675 0)
(0.306841395067 -0.180909293284 0)
(0.315676102189 -0.252565790908 0)
(0.340564129787 -0.355664878002 0)
(-2.56957105236e-05 -0.00190304995458 0)
(-8.66179900721e-05 -0.00190149437443 0)
(-0.000164757693575 -0.0016519075869 0)
(-0.000272999113826 -0.0018973447036 0)
(-0.000298828957833 -0.00184958214156 0)
(-0.000354662289098 -0.00186317432321 0)
(-0.000436226662734 -0.0018097331606 0)
(-0.000497748417578 -0.00174028771436 0)
(-0.000552509824232 -0.0015569249955 0)
(-0.000632630276659 -0.00143565436214 0)
(-0.000729901466121 -0.00151245798585 0)
(-0.000788525983198 -0.00154862832294 0)
(-0.000889561607974 -0.00160434616133 0)
(-0.000917854067231 -0.00145704355246 0)
(-0.000997180914802 -0.0014283502211 0)
(-0.00108130193006 -0.00145151363348 0)
(-0.0011451535968 -0.00142276633592 0)
(-0.001182832612 -0.00135429515473 0)
(-0.00125760063277 -0.00132874687017 0)
(-0.00131068022503 -0.00126318543918 0)
(-0.00135425031182 -0.00119329672913 0)
(-0.00143323137683 -0.0011616633511 0)
(-0.00148831714093 -0.00108376688897 0)
(-0.00153102876207 -0.000971428733853 0)
(-0.00160500346675 -0.000895299674313 0)
(-0.00163994616812 -0.000836563143732 0)
(-0.00169929657638 -0.000824743575893 0)
(-0.00177532260106 -0.00083367010823 0)
(-0.0018171487597 -0.000797329348793 0)
(-0.00189973445676 -0.000747849414482 0)
(-0.00193197729683 -0.000684990020477 0)
(-0.00196210395195 -0.000636995699771 0)
(-0.00198434817861 -0.000593885825899 0)
(-0.00205667479323 -0.000552918624853 0)
(-0.0020935645797 -0.000497855637285 0)
(-0.00211953264918 -0.000438184419313 0)
(-0.00216575678933 -0.000373160854639 0)
(-0.00219999451037 -0.000301807835948 0)
(-0.00223448945807 -0.000228452758915 0)
(-0.00226232227261 -0.000153065713057 6.95302799408e-29)
(-0.00228348118731 -7.20528484839e-05 -6.72085040846e-29)
(-0.00228268627041 2.59181234438e-05 0)
(-0.00225147538027 0.000132082638051 0)
(-0.00224512735627 0.000225100706554 0)
(-0.00224686106741 0.000306346247761 0)
(-0.00221856835878 0.000387410313854 0)
(-0.00214030392445 0.000479341105896 0)
(-0.00195362618817 0.000528564215435 0)
(-0.00187397257251 0.000419894760315 0)
(-0.00160252705879 -0.000210069412402 0)
(0.017264117369 0.0231818482145 0)
(0.0345886491223 0.0417760618155 0)
(0.0514209349424 0.0575576136634 0)
(0.0680534213477 0.0706535330764 0)
(0.0843039309563 0.0812940382978 0)
(0.10002507103 0.0896630925714 0)
(0.115165853511 0.0959285025312 0)
(0.129720853709 0.100257858518 0)
(0.143705375891 0.102815363733 0)
(0.15714761773 0.103753168058 0)
(0.170085834098 0.103205941782 0)
(0.182566103385 0.101288470541 0)
(0.194639392433 0.0980945029521 0)
(0.20635808958 0.0936948654187 0)
(0.217773466327 0.0881336786065 0)
(0.228935386132 0.0814238369054 0)
(0.239893877871 0.073543018215 0)
(0.250701271913 0.0644298119491 0)
(0.261414048004 0.0539785396943 0)
(0.272094819184 0.0420311389863 0)
(0.282803100477 0.0283634206114 0)
(0.293762789542 0.0126704174484 0)
(0.30456156562 -0.00563687618683 0)
(0.315926881657 -0.0266968355399 0)
(0.327962032018 -0.051632493046 0)
(0.341181600823 -0.0818299244766 0)
(0.356853889596 -0.119209519937 0)
(0.377710994276 -0.166507653512 0)
(0.407127950773 -0.227198379147 0)
(0.465968591014 -0.297108548099 0)
(-2.47182648578e-05 -0.00194906387332 0)
(-8.8807564457e-05 -0.00196488070962 0)
(-0.000176137282879 -0.0017622029687 0)
(-0.000263306001207 -0.00192685074565 0)
(-0.000279908159417 -0.00186949649201 0)
(-0.00034126330635 -0.00192354570912 0)
(-0.00041905216746 -0.00188572609765 0)
(-0.00045616898244 -0.00173875834403 0)
(-0.000548916005753 -0.00165785342962 0)
(-0.000628858137275 -0.0015119906166 0)
(-0.000724904401618 -0.00158034923448 0)
(-0.000782639151005 -0.00161819138566 0)
(-0.000878705653029 -0.00167228051843 0)
(-0.000907889279319 -0.00152687514042 0)
(-0.000988982841232 -0.00150117569122 0)
(-0.00107322083889 -0.00151714149633 0)
(-0.00112742920623 -0.00147311925216 0)
(-0.00116224737229 -0.00140709439751 -1.08834959402e-28)
(-0.00124445390901 -0.00139494166879 1.11620846334e-28)
(-0.00129479037897 -0.00131953881278 0)
(-0.00132640299598 -0.00123632724958 0)
(-0.0014105262624 -0.00121421857196 0)
(-0.0014745763655 -0.00114627934485 0)
(-0.0015090230081 -0.00103347962828 0)
(-0.00158679326246 -0.000956309372726 0)
(-0.00163669048673 -0.000896687207244 0)
(-0.00168652987824 -0.000876032854531 0)
(-0.00177616937385 -0.000890921107167 0)
(-0.00179203268606 -0.000850188328522 0)
(-0.00186685708776 -0.00080023856074 0)
(-0.00191200856732 -0.0007287263625 0)
(-0.0019863142809 -0.000683696605309 0)
(-0.0020063733541 -0.00064005631101 0)
(-0.00202531937064 -0.000590982559994 0)
(-0.00208193323584 -0.000539564819877 0)
(-0.00212251216426 -0.000478638114537 0)
(-0.00216364461762 -0.000411102611633 0)
(-0.00220324159172 -0.000337161818164 0)
(-0.00223621242015 -0.000260077345644 0)
(-0.00227082780701 -0.000177827822338 0)
(-0.00229141191676 -7.91379458608e-05 0)
(-0.00226544957534 3.63371831957e-05 0)
(-0.00224817445175 0.000143839354121 0)
(-0.00225305554717 0.000239110041689 0)
(-0.00224021271448 0.000344298455877 0)
(-0.00217625317023 0.000467828838605 0)
(-0.00200610118168 0.000532471774721 0)
(-0.00196185151666 0.000436031023363 0)
(-0.00200671457404 -9.49890867645e-06 0)
(0.0106091656858 0.0188957714202 0)
(0.0303514198787 0.0405800226221 0)
(0.0483560605739 0.0591926816095 0)
(0.0656662831573 0.0746222058287 0)
(0.0825046138943 0.0872350241479 0)
(0.09879233694 0.0973177994723 0)
(0.114460673392 0.105087470292 0)
(0.129491461896 0.110743503763 0)
(0.14389908316 0.114478008252 0)
(0.157717801491 0.11647178434 0)
(0.170995525406 0.116888961575 0)
(0.183790003563 0.115873172135 0)
(0.196165997718 0.11354541148 0)
(0.20819288503 0.110002805377 0)
(0.219942683015 0.105317262851 0)
(0.231489056314 0.0995333446266 0)
(0.242907912578 0.0926655554322 0)
(0.254279619215 0.0846954762449 0)
(0.265692499381 0.0755685137655 0)
(0.277247588547 0.0651894134276 0)
(0.2890654372 0.0534152676954 0)
(0.301297376233 0.0400448667472 0)
(0.314135874707 0.0247910931241 0)
(0.328085232013 0.00740992211773 0)
(0.342707533198 -0.012931171875 0)
(0.359331245918 -0.0362596436016 0)
(0.378592411011 -0.0636679352281 0)
(0.401897920106 -0.0961455468378 0)
(0.431970067328 -0.134493692012 0)
(0.469648200472 -0.179206035315 0)
(0.543061157255 -0.225567242862 0)
(-2.73573723652e-05 -0.00198713873012 0)
(-9.16240808582e-05 -0.00203135531607 0)
(-0.000173400590888 -0.00186473565175 0)
(-0.000245307512583 -0.00191887378091 0)
(-0.000284483979882 -0.00191596005892 -1.34584106067e-29)
(-0.000347148506591 -0.00197797738205 1.41343821647e-29)
(-0.000418031549906 -0.00196310929592 0)
(-0.000454262639837 -0.00179524354067 0)
(-0.000574529308247 -0.00182649712176 0)
(-0.000621446489503 -0.00159368209091 0)
(-0.00071706115606 -0.00164374952843 0)
(-0.000775609407209 -0.00168562866173 0)
(-0.000866373648877 -0.0017371625503 0)
(-0.000896455947936 -0.00159631820733 0)
(-0.0009759994114 -0.00157398071266 0)
(-0.00106215605434 -0.00158478929391 0)
(-0.00108963790115 -0.00149476638628 0)
(-0.00114418486519 -0.00145522641424 0)
(-0.00123598504009 -0.00146085525086 0)
(-0.00127719465183 -0.00137001797338 0)
(-0.00131507471417 -0.00128694108231 0)
(-0.00139645740211 -0.00126263440802 0)
(-0.00148829270933 -0.00121807985538 -1.08285124236e-28)
(-0.00151155677283 -0.00109315971642 0)
(-0.00157832347748 -0.00101445534013 0)
(-0.00163761837298 -0.00095670590883 0)
(-0.00168140848392 -0.000928150767593 0)
(-0.00177563924691 -0.000941449002175 0)
(-0.0017925132234 -0.000900543080052 0)
(-0.00184553791994 -0.000850991562124 0)
(-0.00189087343697 -0.000785761131745 0)
(-0.00197802126542 -0.000731950743428 0)
(-0.00200892129746 -0.000671832971204 0)
(-0.00204070450226 -0.000629893111374 0)
(-0.00206635768521 -0.000579512247476 0)
(-0.00210696413251 -0.000520446979928 0)
(-0.00215348808438 -0.000452962072571 0)
(-0.00220091353325 -0.000376095428823 0)
(-0.00224149870771 -0.000294114234283 0)
(-0.0022754427885 -0.000198656729179 0)
(-0.00226930644675 -7.69968094593e-05 0)
(-0.00224488929846 4.72482598509e-05 0)
(-0.00224234652013 0.000153517507468 0)
(-0.00224127181272 0.000260518026493 0)
(-0.00221077736036 0.000401186656522 0)
(-0.00209167534561 0.000525287919352 0)
(-0.0020314943286 0.000407920922685 0)
(-0.00235230967106 0.000167706552243 0)
(0.000144606952379 0.0130684438756 0)
(0.0244258620621 0.0382346194708 0)
(0.0435317653736 0.0591893476663 0)
(0.0617210034235 0.0770402961286 0)
(0.0792423785147 0.091839427995 0)
(0.0961026004394 0.10382924328 0)
(0.112282991218 0.113259503774 0)
(0.127767406712 0.120363848267 0)
(0.142565852848 0.125367552428 0)
(0.156714204677 0.128484534696 0)
(0.170266758225 0.129911643098 0)
(0.183290453745 0.129824451891 0)
(0.19586099004 0.128374697391 0)
(0.208060084327 0.125688958697 0)
(0.219973597889 0.121868064326 0)
(0.231690522192 0.116986621565 0)
(0.243303048876 0.111092231358 0)
(0.254908017717 0.104204327932 0)
(0.266609881129 0.0963127474945 0)
(0.278525229216 0.0873759405127 0)
(0.290789148093 0.0773185046943 0)
(0.30356421666 0.0660276792692 0)
(0.317053843754 0.053348697605 0)
(0.331520476931 0.0390800804045 0)
(0.347350608927 0.0229623724098 0)
(0.3650954789 0.00470421083301 0)
(0.384917628681 -0.0163823853718 0)
(0.408350033591 -0.0399177273956 0)
(0.436426613395 -0.0664520922727 0)
(0.471371589546 -0.0960824719399 0)
(0.512810241501 -0.128128617835 0)
(0.588187116042 -0.159789185919 0)
(-3.35035016748e-05 -0.002051845324 0)
(-9.65288066155e-05 -0.00209490717926 0)
(-0.000160211083805 -0.0019568430563 0)
(-0.000238536710796 -0.00198574623006 0)
(-0.000303275202006 -0.00198335638352 0)
(-0.000361123428125 -0.00202711740414 0)
(-0.000429177430279 -0.00202782250858 0)
(-0.000467560596435 -0.00184669837025 0)
(-0.000569632682119 -0.00189711455711 0)
(-0.000606122964247 -0.00167525497037 0)
(-0.000703881632387 -0.00170948806598 0)
(-0.000767450182393 -0.00175303752917 0)
(-0.000854309944438 -0.00179960654612 0)
(-0.000886843748274 -0.00166526380597 0)
(-0.000966088459909 -0.0016450601868 0)
(-0.00105151810074 -0.00165198564279 0)
(-0.00108809399086 -0.00155967726084 0)
(-0.00115158863823 -0.00152193152768 0)
(-0.00124353301578 -0.0015265398532 0)
(-0.00127096548765 -0.00141705002806 0)
(-0.00133535213984 -0.00135502159993 0)
(-0.00142856398751 -0.00133411425978 0)
(-0.00149433526071 -0.0012702747072 1.04077587888e-28)
(-0.00158779815331 -0.00119349047732 0)
(-0.00160144188652 -0.00106802476698 0)
(-0.00166362322198 -0.00100904749058 0)
(-0.00169482665794 -0.000976579933406 0)
(-0.00178321749536 -0.000986712028011 0)
(-0.00180006724914 -0.000944237123551 0)
(-0.00184524179529 -0.000897911170754 0)
(-0.00188230736037 -0.000838892771468 0)
(-0.00193725231545 -0.000778116442026 0)
(-0.00201712211669 -0.000723234324257 0)
(-0.00204994307823 -0.000666256687939 0)
(-0.00207310207567 -0.000612221625996 0)
(-0.00209913499611 -0.000558186345126 0)
(-0.00213832180838 -0.000496355805302 0)
(-0.0021857588063 -0.00041922124301 0)
(-0.00223989606181 -0.000327644754173 0)
(-0.00225441475186 -0.000208160909436 0)
(-0.0022370502156 -7.06761128928e-05 0)
(-0.00222903923862 5.40780087759e-05 0)
(-0.00223663878328 0.000163920396037 0)
(-0.00223796871012 0.000287456162845 0)
(-0.00217230606285 0.000408562176524 0)
(-0.00208795367042 0.000352296404222 0)
(-0.00295282605679 8.08246845521e-05 0)
(-0.00210885028324 0.000104063878764 0)
(0.0194599138198 0.0326453794575 0)
(0.0381492964317 0.0569188398261 0)
(0.0565728750697 0.0775417870063 0)
(0.0746391352728 0.0948187258703 0)
(0.0920646878593 0.108977364622 0)
(0.108750503768 0.120273508538 0)
(0.124676840435 0.128980889083 0)
(0.139850322253 0.135367819393 0)
(0.154303743934 0.139688296856 0)
(0.168093635324 0.142177175186 0)
(0.181293293856 0.143046061329 0)
(0.193987008046 0.142480640829 0)
(0.206266220069 0.140639458977 0)
(0.218227046622 0.137653735263 0)
(0.229968898472 0.133627767421 0)
(0.241594163963 0.128639517484 0)
(0.253209032859 0.122741083902 0)
(0.264925598032 0.115958958028 0)
(0.276865365061 0.108294096306 0)
(0.289164318366 0.0997218396406 0)
(0.30197985557 0.0901916944041 0)
(0.315500218536 0.0796271090634 0)
(0.32995745838 0.0679257355178 0)
(0.345645290706 0.05496150578 0)
(0.362941931656 0.0405890973356 0)
(0.382384893287 0.024689945308 0)
(0.40470392673 0.00716115062687 0)
(0.430335247329 -0.0127134031999 0)
(0.460925789726 -0.0338596532728 0)
(0.498051659276 -0.0558617348062 0)
(0.540748487933 -0.0776967472656 0)
(0.612490357024 -0.0980942229418 0)
(-3.4656245443e-05 -0.00213562737557 0)
(-9.42636495075e-05 -0.0021493409094 0)
(-0.000143976224969 -0.00203042233145 0)
(-0.000231980796188 -0.00206286921052 0)
(-0.000312088407429 -0.00204476891784 0)
(-0.000366128932558 -0.00207450778026 0)
(-0.000432990053934 -0.00208915016813 0)
(-0.000470791912391 -0.00189821583491 0)
(-0.000561674871019 -0.00193723347559 0)
(-0.000605023841267 -0.00176009137284 0)
(-0.000694442970677 -0.00177627646776 0)
(-0.000761016419679 -0.00182119494781 0)
(-0.000843269082138 -0.00186020542849 0)
(-0.000878537893904 -0.00173441534554 0)
(-0.000958821609387 -0.00171611313994 0)
(-0.00104193891961 -0.00171646575377 0)
(-0.0010910836527 -0.00162989800597 0)
(-0.00116145563578 -0.00159085971553 0)
(-0.00125661053319 -0.00159180799208 0)
(-0.00128642541161 -0.00148466277102 0)
(-0.00139914691022 -0.0014701923144 0)
(-0.00145644215008 -0.0014061156024 0)
(-0.00151861069377 -0.00133488032577 0)
(-0.00158841044547 -0.00124787996391 0)
(-0.00166409285364 -0.00115819255885 0)
(-0.00173686071654 -0.00108819551761 0)
(-0.00173602433676 -0.00102128552487 0)
(-0.00180085597267 -0.00102299021741 0)
(-0.00182779278 -0.000989383013461 0)
(-0.00185901873507 -0.000938115454077 0)
(-0.00189144935546 -0.000880359843258 0)
(-0.00191882790415 -0.000823385576946 0)
(-0.00198695278779 -0.000770298508804 0)
(-0.002038196751 -0.000709038830333 0)
(-0.00207879884472 -0.000650142949778 0)
(-0.002110001962 -0.000593839784147 0)
(-0.00213579487031 -0.000534926276133 0)
(-0.00217221894178 -0.000459703988459 0)
(-0.00222266158327 -0.000354817574799 0)
(-0.00222277723936 -0.00021324620112 0)
(-0.00221767287456 -7.08230347035e-05 0)
(-0.00222771490316 5.08189487116e-05 0)
(-0.00225924045474 0.000158744406832 0)
(-0.00226585088394 0.000241791690878 0)
(-0.00229924829428 0.000306553593328 0)
(-0.0028341047491 0.000357183356617 0)
(-0.00181996259037 -0.000391394393251 0)
(0.00919383535852 0.0231026040407 0)
(0.0309629616951 0.051576700795 0)
(0.0502377805459 0.0757752649107 0)
(0.0687659658623 0.0959126454993 0)
(0.0867267145463 0.112522290882 0)
(0.103938225395 0.125932170442 0)
(0.120322231614 0.136441301507 0)
(0.135876022397 0.144359781952 0)
(0.150631454804 0.149988895947 0)
(0.164645651302 0.153608339483 0)
(0.177995908212 0.15547127845 0)
(0.190773334342 0.155801733406 0)
(0.203077545947 0.154793420459 0)
(0.215013123724 0.152609917714 0)
(0.226687522236 0.149385737356 0)
(0.238210192369 0.145227879093 0)
(0.249692833477 0.140217543625 0)
(0.261250767792 0.134411798623 0)
(0.273005479748 0.127845124313 0)
(0.285088395982 0.120530885356 0)
(0.297646027359 0.112462854403 0)
(0.310846695046 0.103617001058 0)
(0.324889219474 0.0939539441979 0)
(0.340014116632 0.0834228191499 0)
(0.356517913316 0.0719678981374 0)
(0.374771254781 0.0595400827753 0)
(0.395240137585 0.0461151109101 0)
(0.418511326754 0.0317647556484 0)
(0.44547207493 0.0168957155417 0)
(0.476715215098 0.00113602629334 0)
(0.513579380054 -0.0149227585297 0)
(0.555487368064 -0.0295359479902 0)
(0.622603923072 -0.0415670384622 0)
(-3.16288492365e-05 -0.0022054141166 0)
(-8.65420409173e-05 -0.00220371111324 0)
(-0.000135526004736 -0.00209524846952 0)
(-0.000229525911162 -0.00220856515587 0)
(-0.00030075703007 -0.00211105203917 0)
(-0.000361395698351 -0.00213182657502 0)
(-0.000428696800772 -0.00215033932515 0)
(-0.00047204256018 -0.00197230320525 0)
(-0.000567578512306 -0.00200904709219 0)
(-0.000612079906118 -0.00183918398946 0)
(-0.000690872206238 -0.00183917344199 0)
(-0.000757351581577 -0.00188877971558 0)
(-0.000832277789086 -0.00191751434434 0)
(-0.000870196815402 -0.00180371516696 0)
(-0.000951115321741 -0.00178744285747 0)
(-0.00102924139875 -0.0017800674282 0)
(-0.00108927902793 -0.00170611560214 0)
(-0.00116225599423 -0.00166116021652 0)
(-0.00125887750638 -0.00165887025861 0)
(-0.00129018241354 -0.00155244334056 0)
(-0.00140080127632 -0.00153847655327 0)
(-0.00144113892447 -0.00145819552986 0)
(-0.00151487161973 -0.00139963150949 0)
(-0.00157356734035 -0.00131131687718 0)
(-0.00162127218177 -0.00120125049866 0)
(-0.00169551923506 -0.00112016980273 0)
(-0.00176059397726 -0.00106893173657 0)
(-0.00181052194591 -0.00105693874392 0)
(-0.00185266485231 -0.00103151301249 0)
(-0.00187467606072 -0.00097342199762 0)
(-0.00191362997976 -0.000914680880258 0)
(-0.00193977181506 -0.000859763590105 0)
(-0.00196767910275 -0.000804460952757 0)
(-0.00202312495647 -0.000751108442114 0)
(-0.00204589138783 -0.000684324869414 0)
(-0.00209810626992 -0.00062932335038 0)
(-0.00213215438611 -0.000570505424676 0)
(-0.00216380796846 -0.000493480615803 0)
(-0.00219644249146 -0.000375672182518 0)
(-0.00219852363476 -0.000223512941568 0)
(-0.0022110880367 -8.41476954382e-05 0)
(-0.00223884270212 2.40076394956e-05 0)
(-0.0022954108776 0.000107394918835 0)
(-0.00242100706936 0.000157967712354 0)
(-0.00242119896241 -6.0464986269e-05 0)
(-0.0024759583812 -0.00042155357253 0)
(-0.00483352449457 0.00762692735801 0)
(0.0227619654428 0.043642508978 0)
(0.0424298250922 0.0711961972937 0)
(0.0616353903881 0.0946972614943 0)
(0.0801783685487 0.114172976932 0)
(0.0979206775511 0.130004486069 0)
(0.114786169296 0.142564667522 0)
(0.130745587168 0.152209122361 0)
(0.145820260902 0.159288424735 0)
(0.160066929651 0.164134329796 0)
(0.173566035432 0.167048982565 0)
(0.186414282992 0.168300755477 0)
(0.19871854332 0.168123135786 0)
(0.21059110909 0.166715221685 0)
(0.22214659165 0.164243382736 0)
(0.23350029675 0.160843657906 0)
(0.244767853855 0.156624503258 0)
(0.256065960353 0.151669620429 0)
(0.267514166342 0.146040718069 0)
(0.279237670395 0.139780176654 0)
(0.291371134351 0.132913699323 0)
(0.304063563175 0.125453134359 0)
(0.317484341832 0.117399773959 0)
(0.331830563183 0.108748617245 0)
(0.347335779102 0.0994943786298 0)
(0.364280194365 0.0896404615543 0)
(0.383002028514 0.0792126870109 0)
(0.403909221847 0.0682804494391 0)
(0.427489542596 0.0569878610504 0)
(0.454286783971 0.0456011868708 0)
(0.484949304685 0.0347075193982 0)
(0.520393817709 0.0252401197846 0)
(0.559814296077 0.0180804408719 0)
(0.620251705521 0.0143337677476 0)
(-3.49207409407e-05 -0.00226479912561 0)
(-8.20797756859e-05 -0.00226097251018 0)
(-0.000134405327906 -0.00217313861489 0)
(-0.000219800416737 -0.00227543388556 0)
(-0.000278228918639 -0.00218164094282 0)
(-0.000348970530899 -0.00219911992791 0)
(-0.000419543272928 -0.00221178979855 0)
(-0.00047224537328 -0.00205463002886 0)
(-0.000564988132454 -0.00207439721753 0)
(-0.00061527260209 -0.00191668210109 0)
(-0.000687908189853 -0.00189627823361 0)
(-0.000754188966069 -0.0019542852555 0)
(-0.000819552857009 -0.00196906743985 0)
(-0.00086347190412 -0.00187257026722 0)
(-0.000944004360708 -0.00185795030539 0)
(-0.00101432639537 -0.00184227720198 0)
(-0.00108539637384 -0.00178468219265 0)
(-0.00115765270068 -0.00173098251429 0)
(-0.0012516413228 -0.00172539386128 0)
(-0.00128437998503 -0.00162279413775 0)
(-0.00137991877708 -0.00159917874483 0)
(-0.00141597580259 -0.00150584260688 0)
(-0.00147663628322 -0.00143773661248 0)
(-0.00157933585552 -0.00139108947723 0)
(-0.0016256504935 -0.0012781879136 0)
(-0.00169610915264 -0.00118562092894 0)
(-0.00174473096712 -0.001104343004 0)
(-0.00183399744708 -0.0010985728468 0)
(-0.00187868885383 -0.00107599600751 0)
(-0.0018919986525 -0.00100883904404 0)
(-0.00193363599395 -0.000949989528624 0)
(-0.00198641407281 -0.000899645193367 0)
(-0.00201099899949 -0.000840794730024 0)
(-0.00204368765903 -0.000782293660129 0)
(-0.00205671859679 -0.000720378100424 0)
(-0.00209232820809 -0.000665398350453 0)
(-0.0021247450975 -0.000604494014911 0)
(-0.00215574209232 -0.000523068320049 0)
(-0.00217152403901 -0.000394845639166 0)
(-0.00217860392643 -0.000241041847598 0)
(-0.0022055886715 -0.000110270743536 0)
(-0.00225247473539 -3.39733091396e-05 4.79838920559e-29)
(-0.00235544133126 -1.0567746231e-05 0)
(-0.00235819729045 -1.69325114339e-05 0)
(-0.00292973010172 -7.06071691871e-05 0)
(-0.00161701191653 -0.000947229375975 0)
(0.0122823480377 0.0306596462276 0)
(0.0338077889238 0.0630874143273 0)
(0.0534449261924 0.0906283578644 0)
(0.0724727897826 0.113494101122 0)
(0.0907690043382 0.132184614228 0)
(0.108143324825 0.147127475467 0)
(0.124540999844 0.158751134465 0)
(0.139968442375 0.167470434378 0)
(0.154474909347 0.173677003809 0)
(0.16814152089 0.177730253214 0)
(0.181069881281 0.17995088513 0)
(0.193373718829 0.180618652061 0)
(0.205172899354 0.179972997007 0)
(0.216589206696 0.178215311688 0)
(0.227743778877 0.175512161342 0)
(0.238756016522 0.171999029777 0)
(0.249743725895 0.167784238053 0)
(0.260824305993 0.162952812331 0)
(0.272116846224 0.157570199565 0)
(0.283745045664 0.151685842828 0)
(0.295840900139 0.145336731885 0)
(0.308549127481 0.138551142236 0)
(0.32203230595 0.131352882037 0)
(0.336476667731 0.123766507322 0)
(0.35209838401 0.115824168056 0)
(0.369149953988 0.107575026235 0)
(0.38792589601 0.0990985312935 0)
(0.408766323636 0.090523247417 0)
(0.432055637863 0.0820532325005 0)
(0.458214045456 0.0740047191678 0)
(0.487667217088 0.0668251992458 0)
(0.520933200425 0.061226076533 0)
(0.55680606953 0.0582234726896 0)
(0.609600182038 0.0591374666734 0)
(-3.62155704085e-05 -0.00232487770158 0)
(-8.31493198398e-05 -0.00224729466052 0)
(-0.000139909515158 -0.00225893432964 0)
(-0.000213670200253 -0.00232320120589 0)
(-0.000267527441554 -0.00224769507992 0)
(-0.00033801278385 -0.00226861246675 0)
(-0.000408338178294 -0.00227435629222 0)
(-0.000467523292019 -0.00213649378762 0)
(-0.000551881799961 -0.00213521357229 0)
(-0.000615654398125 -0.00200490244094 0)
(-0.000682663048405 -0.0019471322258 0)
(-0.0007500229543 -0.0020162012939 0)
(-0.000808030439797 -0.00202078121565 0)
(-0.000864137759829 -0.00194799092138 0)
(-0.000941652229413 -0.00192615550151 0)
(-0.00100608575588 -0.00190960889404 0)
(-0.00109223947302 -0.00188115234596 0)
(-0.00115149018414 -0.00179863821399 0)
(-0.00123852054064 -0.001785546367 0)
(-0.00127979338962 -0.00169424007531 0)
(-0.00135614909642 -0.00164830496978 0)
(-0.00141855813594 -0.00158102293012 0)
(-0.00149148050162 -0.00151374668269 0)
(-0.00156677248418 -0.00144022607498 0)
(-0.00167525213382 -0.00137755519206 0)
(-0.00175398346339 -0.00127979260212 0)
(-0.00176964396734 -0.00116299002059 0)
(-0.00190714656813 -0.00116603137199 0)
(-0.00191541789719 -0.00111301990277 0)
(-0.00193185401837 -0.00104828763926 0)
(-0.0019531670766 -0.000985729196367 0)
(-0.00200202955093 -0.000930473373225 0)
(-0.00202718164374 -0.000863033303937 0)
(-0.00208319538106 -0.000807340363949 0)
(-0.00209058597981 -0.0007420132546 0)
(-0.00210329816954 -0.000687186439089 0)
(-0.00212797641085 -0.000631380667888 0)
(-0.00215012932397 -0.000549641155236 0)
(-0.00215027311745 -0.000415641440675 0)
(-0.00216550521991 -0.00026633262625 0)
(-0.00219756086396 -0.000157769646291 0)
(-0.00232121739686 -0.000100978241293 -4.89602295155e-29)
(-0.00235886925942 -5.40618405221e-05 0)
(-0.00227389009334 -0.000278448167166 0)
(-0.00216392637976 -0.000778927538718 0)
(-0.00420205443889 0.00865875609447 0)
(0.0238681805025 0.0511130173471 0)
(0.0440177883631 0.0832023250343 0)
(0.0636176737884 0.110046571663 0)
(0.082500663832 0.132089351614 0)
(0.100432530437 0.14983650081 0)
(0.117318933982 0.163774120102 0)
(0.133147673141 0.174386603232 0)
(0.147958658901 0.182138224593 0)
(0.16183028676 0.187456447903 1.02233015137e-28)
(0.174867488692 0.190724005889 -9.77007982882e-29)
(0.187190756953 0.192275557591 0)
(0.198927948034 0.192397836752 0)
(0.210208658464 0.191332311071 0)
(0.221160608317 0.189279280605 0)
(0.231907722065 0.186402692843 0)
(0.242569641938 0.182835213501 0)
(0.253262400464 0.178683243318 0)
(0.264100016498 0.174031701472 0)
(0.275196833611 0.168948519305 0)
(0.286670468587 0.163488896381 0)
(0.298645274971 0.15769946183 0)
(0.311256242727 0.151622559019 0)
(0.324653234969 0.145300939683 0)
(0.339005385533 0.138783230405 0)
(0.354505319812 0.132130635107 0)
(0.371372586704 0.125425467631 0)
(0.389855242335 0.118782249052 0)
(0.410227990359 0.11236223214 0)
(0.432783767566 0.106392115781 0)
(0.457818729721 0.101187954425 0)
(0.485577150285 0.0971805679581 0)
(0.516393297836 0.0949671729102 0)
(0.548841621482 0.0952599095536 0)
(0.595757636426 0.0989087864233 0)
(-3.13151284555e-05 -0.00239049064868 0)
(-8.96140135053e-05 -0.00231114446196 0)
(-0.000151486961092 -0.00232571498955 0)
(-0.00021542264607 -0.00237635764524 0)
(-0.0002693848222 -0.00230861328942 0)
(-0.000333055418863 -0.00233249861347 0)
(-0.000398785187805 -0.0023372888867 0)
(-0.000460786421332 -0.0022167772432 0)
(-0.000533839329603 -0.00219291061304 0)
(-0.000613225073758 -0.00210182414309 0)
(-0.000677215751662 -0.00199596235668 0)
(-0.000745950200176 -0.00207114457487 0)
(-0.000800943903727 -0.00208420446809 0)
(-0.000867143800129 -0.00202342489266 0)
(-0.000943718197751 -0.00198806310305 0)
(-0.0010056126258 -0.00197781988954 0)
(-0.0010955541292 -0.00197271157871 0)
(-0.00114242116417 -0.00186653595058 0)
(-0.00121889323901 -0.00183481136534 0)
(-0.00127568458734 -0.00176693861218 0)
(-0.0013560141991 -0.00171911521632 0)
(-0.00142183584562 -0.00165530725084 7.80795334982e-29)
(-0.00153780464403 -0.00162977404196 -8.0586152575e-29)
(-0.00160181038069 -0.00154600477185 0)
(-0.00169821662258 -0.00146693629151 0)
(-0.0017522769955 -0.00133761856894 0)
(-0.00179922441418 -0.00122895335032 0)
(-0.0019036947555 -0.00118911827266 0)
(-0.00198201807948 -0.00115606072291 0)
(-0.00199092679911 -0.00108355826087 0)
(-0.00200251996169 -0.00101416915503 0)
(-0.00203109221611 -0.000959059590628 0)
(-0.00207004480473 -0.000901077187877 0)
(-0.00211561870041 -0.000833931933326 0)
(-0.00214988185498 -0.000757863961601 0)
(-0.00213814335007 -0.000690387436651 0)
(-0.00214859553053 -0.000641097725772 0)
(-0.0021478519421 -0.00056800145049 0)
(-0.0021302642501 -0.000436637037827 0)
(-0.00213864167111 -0.000300327138335 0)
(-0.00222421234871 -0.000250670915098 0)
(-0.00240042503629 -0.000238467185597 0)
(-0.00238462387321 -0.000157751193595 0)
(-0.00294606441355 -0.000101299558082 0)
(-0.00149568625545 -0.00112415627377 0)
(0.0104708425248 0.0336039017177 0)
(0.0335140352705 0.0712748064234 0)
(0.0537849523748 0.103105586004 2.27738032345e-28)
(0.0731663938065 0.129202833401 0)
(0.0916775672173 0.150303252825 0)
(0.109111158172 0.166993570079 0)
(0.125404646222 0.179838340827 0)
(0.140580522567 0.189386172689 0)
(0.15471148382 0.196147327974 0)
(0.167903740221 0.200579863961 0)
(0.180283892011 0.203084630291 0)
(0.191988326391 0.204005059603 0)
(0.203155552179 0.203630045993 0)
(0.213921182292 0.202198867424 0)
(0.224415048673 0.199907192835 0)
(0.234760026762 0.196913472158 0)
(0.245072213939 0.193345262815 0)
(0.255462139401 0.189305224064 0)
(0.266036730799 0.184876651446 0)
(0.276901824107 0.180128547401 0)
(0.288165063845 0.175120326402 0)
(0.299939088312 0.169906326116 0)
(0.312344913031 0.164540337283 0)
(0.325515395036 0.159080380102 0)
(0.339598561484 0.153593956843 0)
(0.354760399195 0.148164012488 0)
(0.371186417815 0.142895842096 0)
(0.389080873186 0.13792517594 0)
(0.408662155637 0.13342763297 0)
(0.430151334397 0.129629457553 0)
(0.453756172557 0.126819487207 0)
(0.479609902725 0.125358357925 0)
(0.507944672533 0.125695879588 0)
(0.537224911164 0.128332796291 0)
(0.579163455177 0.133750760992 0)
(-2.95965623507e-05 -0.00245348149159 0)
(-9.16755762002e-05 -0.0023791267926 0)
(-0.000155087840034 -0.00238801372341 0)
(-0.000219925332469 -0.00243798731988 0)
(-0.000274830373076 -0.00236640148278 0)
(-0.000331061346566 -0.00238849649435 0)
(-0.000391403183087 -0.00239907576591 0)
(-0.000456037039315 -0.00229328484375 0)
(-0.000518646670854 -0.00224696045706 0)
(-0.000612855561839 -0.00221333665369 0)
(-0.000672963355135 -0.00205267327506 0)
(-0.000744346998867 -0.00211873016463 0)
(-0.000794844219387 -0.00214967264154 0)
(-0.000876839900255 -0.00211991543004 0)
(-0.000943677614127 -0.00204459605939 0)
(-0.00100644014208 -0.00204066313052 0)
(-0.00109072095466 -0.00204733640981 0)
(-0.00112971602059 -0.00193323880181 0)
(-0.00120803629519 -0.00190062979369 0)
(-0.00127103734088 -0.00184091882279 0)
(-0.00134981739406 -0.00179186676498 0)
(-0.00142133671331 -0.00173429979034 0)
(-0.00150256066799 -0.00167558213902 0)
(-0.00157330933869 -0.00160197511889 0)
(-0.00165889707609 -0.00152805906718 0)
(-0.00177765648688 -0.00144973810426 0)
(-0.00183349084853 -0.00132346783877 0)
(-0.00193324856862 -0.0012577770994 0)
(-0.00208116424904 -0.00122326614791 0)
(-0.00208448802163 -0.00112346650872 0)
(-0.0021212075158 -0.00105375301186 0)
(-0.00212355617258 -0.000985451978748 0)
(-0.00214343275708 -0.00092365812398 0)
(-0.00214879680777 -0.000848239146571 0)
(-0.00220511119042 -0.000772683266015 0)
(-0.00221879053161 -0.000686487662591 0)
(-0.00220788752835 -0.00062303966158 0)
(-0.00216761143433 -0.000565859124696 0)
(-0.00210184880994 -0.000454226933785 0)
(-0.00210649333384 -0.000330865733731 0)
(-0.00222639929576 -0.000322917622916 0)
(-0.00224362829929 -0.000374390926016 0)
(-0.00231013905182 -0.000593216810749 0)
(-0.00231939274431 -0.00096502683487 0)
(-0.00688794890421 0.00358574015828 0)
(0.0226405422176 0.0549446149224 0)
(0.0427125130767 0.0918901405691 0)
(0.0627070554894 0.122866843695 -1.93033627087e-28)
(0.0818805494654 0.148032131403 0)
(0.099924447127 0.168037069147 1.33301862272e-28)
(0.116756459778 0.18355682205 0)
(0.132373818861 0.195238028667 0)
(0.146835435898 0.203687675256 0)
(0.160245690333 0.209455142978 0)
(0.172736430276 0.213022361936 0)
(0.184452956646 0.214802019449 0)
(0.195543966392 0.215140548637 0)
(0.206154705682 0.214323894926 0)
(0.216422811384 0.212584828115 0)
(0.2264763128 0.210110874128 0)
(0.23643329119 0.207052212382 0)
(0.246402760979 0.203529133163 0)
(0.256486400262 0.199638840156 0)
(0.266780825838 0.19546153499 0)
(0.277380186508 0.191065848043 0)
(0.288378930228 0.186513776128 0)
(0.299874668964 0.18186533825 0)
(0.311971095506 0.177183158233 0)
(0.324780875105 0.172537133643 0)
(0.338428324303 0.168009271841 0)
(0.353051490612 0.163698684524 0)
(0.368802967894 0.159726642526 0)
(0.385848383729 0.1562414907 0)
(0.404361249063 0.153423113201 0)
(0.424511253288 0.151486359922 0)
(0.446450172312 0.150683022865 0)
(0.470249009539 0.151298981548 0)
(0.496097802241 0.153655113342 0)
(0.522442080597 0.158071639944 0)
(0.560044524514 0.164730995613 0)
(-2.83333348888e-05 -0.00251133314643 0)
(-8.85372640491e-05 -0.00244499484904 0)
(-0.000155259005214 -0.00244570301594 0)
(-0.000224637428517 -0.002500752398 0)
(-0.00027640630953 -0.00242126006128 0)
(-0.000326135749556 -0.00243420972986 0)
(-0.000382221523539 -0.00245926661955 1.11936315897e-29)
(-0.000454851695789 -0.00236611435221 -1.07388411311e-29)
(-0.000518180602625 -0.0022994523394 0)
(-0.000614604812582 -0.00234368180205 0)
(-0.000660205527876 -0.00212238241095 0)
(-0.000741554239659 -0.00216424728221 0)
(-0.000792583299693 -0.00221133533748 0)
(-0.000888254152599 -0.00223946151456 0)
(-0.000929940352498 -0.00210190891133 0)
(-0.00100174907251 -0.00210242045657 0)
(-0.00108026338629 -0.00211185627778 0)
(-0.0011162532479 -0.00199831152795 0)
(-0.00119712067488 -0.00197134785729 0)
(-0.00127468215491 -0.0019252420417 0)
(-0.00133971853436 -0.00185883513411 0)
(-0.00144237232027 -0.00184747324781 0)
(-0.00148290082298 -0.00174910139086 0)
(-0.0015561142064 -0.00168065211291 0)
(-0.00164136159331 -0.00161669867431 0)
(-0.00174040721517 -0.00153569432011 0)
(-0.00184492272368 -0.00144021207691 0)
(-0.00193137812521 -0.00135361446098 0)
(-0.00211551884304 -0.00130481524982 0)
(-0.00220534585344 -0.00119716972247 0)
(-0.00223915583004 -0.00109743184959 0)
(-0.00228970662401 -0.00102460668054 0)
(-0.00228990571398 -0.000947168431737 0)
(-0.00230953717021 -0.000874710243415 0)
(-0.00228507344056 -0.000776546563488 0)
(-0.00232685771259 -0.000678717080196 0)
(-0.00232324197562 -0.000574296664327 0)
(-0.00228458347003 -0.000519707209298 0)
(-0.00203549020221 -0.000441380264348 0)
(-0.00209114368524 -0.000387147688448 0)
(-0.0023021756226 -0.000367847371071 0)
(-0.00218572055315 -0.000255480136149 0)
(-0.00190116386313 -0.00068757529863 0)
(-0.00155477555569 -0.00127171464307 0)
(0.00531203134972 0.0305641753241 0)
(0.0309057990586 0.075100530394 0)
(0.0514234889625 0.112185408587 0)
(0.071030447248 0.142306834861 0)
(0.0897367386646 0.166383062951 0)
(0.107196046169 0.185171640195 -1.22295565504e-28)
(0.123343729091 0.199437909588 0)
(0.138223099492 0.209910523119 1.01011332309e-28)
(0.1519313276 0.217251021889 0)
(0.164602560922 0.222041381991 0)
(0.176390861416 0.224780244061 0)
(0.187456390213 0.22588532994 0)
(0.197956030259 0.225699996837 0)
(0.208037551246 0.224502062243 0)
(0.217836532918 0.222513572619 0)
(0.227475399839 0.219910617622 0)
(0.237063981562 0.216832606169 0)
(0.246701095243 0.213390669056 0)
(0.256476736836 0.209675048671 0)
(0.266474559609 0.205761498177 0)
(0.276774424689 0.201716847982 0)
(0.287454923369 0.197603989015 0)
(0.298595870124 0.193486544797 0)
(0.310280814187 0.189433446106 0)
(0.322599587099 0.185523495769 0)
(0.335650782554 0.181849846358 0)
(0.34954385577 0.178524139437 0)
(0.36440025836 0.175679889195 0)
(0.380352643744 0.173474526643 0)
(0.397541028259 0.17208938087 0)
(0.416102983352 0.17172662986 0)
(0.43616342676 0.172602575865 0)
(0.457771860573 0.174934677946 0)
(0.481122942944 0.17892966782 0)
(0.504702310177 0.184752037851 0)
(0.538426103185 0.192339001348 0)
(-2.77285542547e-05 -0.00256684936626 0)
(-8.69688797109e-05 -0.00250978147267 0)
(-0.000159783337304 -0.00252464231029 0)
(-0.000226198706886 -0.00256045563068 0)
(-0.000268621432495 -0.00247403879748 0)
(-0.000316744827904 -0.00247580484918 0)
(-0.000371211792882 -0.0025194406043 0)
(-0.000451627070765 -0.00246495128078 0)
(-0.000515701900526 -0.00234255149578 0)
(-0.000592893468114 -0.00238938720119 0)
(-0.00064410846745 -0.00220759449356 0)
(-0.00073178627262 -0.0022132334203 0)
(-0.000789674113768 -0.0022711853672 0)
(-0.000870238462256 -0.00230746655543 0)
(-0.000903871879059 -0.00216461513585 0)
(-0.000986624860923 -0.00216694501802 0)
(-0.00105892739825 -0.00216792993327 0)
(-0.00110192187954 -0.00206481760756 0)
(-0.00118324545891 -0.00204099336018 0)
(-0.00128180762831 -0.00203348229435 0)
(-0.00131984172583 -0.00192296184356 0)
(-0.00141312381822 -0.00190273413243 0)
(-0.00145792707347 -0.00181813977548 0)
(-0.00154188447784 -0.00176494711448 0)
(-0.0016217090502 -0.00170649853973 0)
(-0.00170425403389 -0.00163469402218 0)
(-0.00180743631502 -0.00155542761714 0)
(-0.00190766621651 -0.00147654556832 0)
(-0.00200655653802 -0.00138815827991 0)
(-0.00225827213523 -0.0013352201714 0)
(-0.00232442344486 -0.00118475820944 0)
(-0.00240535348074 -0.00107586297807 0)
(-0.00241970257698 -0.000968850741667 0)
(-0.00248857408932 -0.00089988348642 0)
(-0.00250041896078 -0.000799458411742 0)
(-0.00250247407112 -0.000674245800038 0)
(-0.0024993171669 -0.000518828284155 0)
(-0.00258308105584 -0.000393547935016 0)
(-0.00209035990074 -0.000350716278342 0)
(-0.00208541528622 -0.000454844250802 0)
(-0.00228077319992 -0.000548744383126 0)
(-0.00225881822759 -0.000533706827678 0)
(-0.00414461313684 -0.000528362373666 0)
(-0.0014276501382 -0.000849245973145 0)
(0.0166262605988 0.0503938786099 0)
(0.0387660038536 0.0954681296378 0)
(0.0591886110629 0.132179692604 0)
(0.0785287215002 0.161339468917 0)
(0.0966754610927 0.184171669817 0)
(0.113459257351 0.201628433995 0)
(0.128863286526 0.214577395265 0)
(0.1429683059 0.223818571091 -9.59127394979e-29)
(0.155907654019 0.230059707797 8.94621493101e-29)
(0.167843098494 0.233907449357 0)
(0.178947266958 0.235869181035 0)
(0.189390886988 0.236360356164 0)
(0.199334587076 0.235715016975 0)
(0.208924362907 0.234197793257 0)
(0.218289795306 0.232016098271 0)
(0.227544234606 0.229331692321 0)
(0.236786282529 0.226271128567 0)
(0.246102019574 0.222934845957 0)
(0.255567538812 0.219404870647 0)
(0.265251466244 0.21575126199 0)
(0.275217291981 0.212037590264 0)
(0.285525498297 0.20832582267 0)
(0.296235610348 0.204680978787 0)
(0.307408362751 0.201175784498 0)
(0.319108137911 0.197895333704 0)
(0.331405691388 0.194941511006 0)
(0.344380957673 0.192436679425 0)
(0.358125472818 0.190525912261 0)
(0.372743587441 0.18937682528 0)
(0.388351570947 0.189175880415 0)
(0.405071632077 0.190119732046 0)
(0.423027286427 0.192400496198 0)
(0.44228256648 0.196183154448 0)
(0.463079218957 0.201578484725 0)
(0.483993552358 0.208614866243 0)
(0.514218440304 0.216998109563 0)
(-2.74113085567e-05 -0.00262435488685 0)
(-9.56797358747e-05 -0.00257629419331 0)
(-0.000171476399223 -0.002613468357 0)
(-0.000215553915507 -0.0026110902737 0)
(-0.000250018900321 -0.00252599339341 0)
(-0.000306087422778 -0.00253301467552 0)
(-0.000362132898367 -0.0025777788925 0)
(-0.000436366961998 -0.00256703093502 0)
(-0.000498641666328 -0.00240623523068 0)
(-0.000569663320704 -0.00242985317058 0)
(-0.000637747768333 -0.00231941979459 0)
(-0.000715607714519 -0.00226281165358 0)
(-0.000778719888689 -0.00232865286598 0)
(-0.000838125198819 -0.00235067275208 0)
(-0.000879726497135 -0.00223513101204 0)
(-0.000965111792944 -0.00223195752216 0)
(-0.00102704818693 -0.00221335685949 0)
(-0.00108799103796 -0.00214053685104 0)
(-0.00116700759977 -0.00210698411393 0)
(-0.00125019927922 -0.00209515706174 0)
(-0.00128923620592 -0.00199043708975 0)
(-0.00137270520809 -0.00195644088048 0)
(-0.00143004558687 -0.00189146220529 0)
(-0.00152427137057 -0.00185380213115 -6.6186177844e-29)
(-0.00157583272758 -0.00177367014257 6.39443580833e-29)
(-0.00166085833685 -0.00172041676595 0)
(-0.0017408176255 -0.00165065850104 0)
(-0.00183248787352 -0.00157971563427 0)
(-0.00189654016479 -0.001491859982 0)
(-0.00204590525633 -0.00142715741057 0)
(-0.00231212441177 -0.00135491138372 0)
(-0.00239112803641 -0.00117366929725 0)
(-0.00257025857465 -0.00107416097068 0)
(-0.00261007594291 -0.000946255243519 0)
(-0.00270636182589 -0.000841316363558 0)
(-0.00279519607794 -0.000716562395665 0)
(-0.0028646906313 -0.000533703294549 0)
(-0.00298718390694 -0.000258217310185 0)
(-0.00295643929788 -0.000153797722759 0)
(-0.00207583708993 -0.00028321184695 0)
(-0.00191363432206 -0.00064980829105 0)
(-0.00199117312176 -0.00105029691653 0)
(-0.00194304042179 -0.00107397431301 0)
(-0.00345907967915 0.0132933342706 0)
(0.0252405255535 0.0723862021803 0)
(0.0459691101885 0.11643066702 0)
(0.06609128593 0.151956167481 0)
(0.0850960861849 0.179883454181 0)
(0.102647552611 0.201325842593 0)
(0.118706158033 0.217354703107 0)
(0.133331086345 0.228941188197 0)
(0.14664764728 0.236948159758 0)
(0.158823684686 0.242118589493 -8.61395315072e-29)
(0.170045373219 0.245073839009 0)
(0.180499728818 0.246321139484 -7.82547255973e-29)
(0.190363384323 0.246266044035 0)
(0.199796118804 0.245227117368 0)
(0.208937974364 0.24345110265 0)
(0.217908949315 0.241127388876 0)
(0.226810384962 0.238401076919 0)
(0.235727320236 0.235384294578 0)
(0.244731237294 0.232165652783 0)
(0.253882752373 0.22881793014 0)
(0.263233953557 0.225404270364 0)
(0.272830282818 0.221983357941 0)
(0.282712085043 0.218614125271 0)
(0.292916132888 0.215360472401 0)
(0.303477510796 0.212296245085 0)
(0.31443217529 0.209510382513 0)
(0.325820330818 0.20711179964 0)
(0.337690527119 0.205233268072 0)
(0.350104170307 0.204033304883 0)
(0.363139834662 0.203694807936 0)
(0.37689683498 0.204418901007 0)
(0.391495194424 0.206411868837 0)
(0.407078829644 0.209863156229 0)
(0.42376142323 0.214912366783 0)
(0.441876019081 0.221599185695 0)
(0.46014994814 0.229840217403 0)
(0.48722318404 0.239078696452 0)
(-2.91835213024e-05 -0.00268398910234 0)
(-0.000107278865116 -0.00267953931259 0)
(-0.000168866238408 -0.00266657670339 0)
(-0.000191233609168 -0.00261822087705 0)
(-0.000232706457719 -0.00257859735486 0)
(-0.000296120500945 -0.00259166297658 0)
(-0.000352854703608 -0.00262993603179 0)
(-0.000413407926275 -0.00263327946563 8.48919461359e-29)
(-0.00047949507657 -0.00249748800098 0)
(-0.000544151424943 -0.00247668825213 0)
(-0.000626398554305 -0.00242785675641 0)
(-0.000695544959266 -0.00231254145314 0)
(-0.000762905897905 -0.00237898292273 0)
(-0.000808109475776 -0.00239249478955 0)
(-0.000868356380131 -0.00231355721475 0)
(-0.000947379005474 -0.00229026148058 0)
(-0.0010065380929 -0.00227927469759 0)
(-0.00107674468705 -0.00221846233251 0)
(-0.00114800363139 -0.00216556988863 0)
(-0.00121305248023 -0.00213951743667 0)
(-0.00126482043034 -0.00206146219228 0)
(-0.00134055573297 -0.00201919159295 0)
(-0.00140768645752 -0.00196658242118 0)
(-0.00147754731145 -0.00190718056836 0)
(-0.00153576229443 -0.00184527343869 0)
(-0.00163033312292 -0.00181816833415 0)
(-0.0016776503902 -0.00173420780399 0)
(-0.00175288170074 -0.00167271250816 0)
(-0.00182900243262 -0.00161027022284 0)
(-0.00186816166921 -0.0015135549692 0)
(-0.00202979945053 -0.00146266114002 0)
(-0.00231434860099 -0.00141264774878 0)
(-0.00249628235838 -0.00125565426907 0)
(-0.00272753323539 -0.00113644833666 0)
(-0.00293246069099 -0.00103018326474 0)
(-0.00315206592533 -0.000915913512439 0)
(-0.00341612788818 -0.000758729356878 0)
(-0.00368339146282 -0.00044249752308 0)
(-0.00437792901288 0.000111771472579 0)
(-0.00355566432018 0.00115006869113 0)
(-0.00171484541516 -0.000413733290437 0)
(-0.00164738347051 -0.00127019988667 0)
(-0.00156866756357 -0.00163974401415 0)
(0.0038385730388 0.0381682873091 0)
(0.0315108170893 0.0935721035772 0)
(0.0525920749648 0.137142469927 0)
(0.0723253723128 0.171396373094 0)
(0.0907918589023 0.197869678775 0)
(0.10767206346 0.217783727827 0)
(0.122964494636 0.232311421291 0)
(0.136789996264 0.242513191049 0)
(0.149320614158 0.249304034102 0)
(0.160755630167 0.25345014969 0)
(0.171300577043 0.255576438111 0)
(0.181151580906 0.256180530471 7.63802040599e-29)
(0.190486076298 0.255650510908 7.280514203e-29)
(0.199458397824 0.254283746368 0)
(0.208198786243 0.252305049295 0)
(0.216814639307 0.249883121771 0)
(0.225393054525 0.247144762529 0)
(0.234003919371 0.24418666384 0)
(0.242702973047 0.241084839004 0)
(0.251534402027 0.237901914846 0)
(0.260532711584 0.234692766819 0)
(0.269723884944 0.231509206721 0)
(0.279126150894 0.22840451367 0)
(0.288750909796 0.22543843224 0)
(0.298604418264 0.222682876932 0)
(0.308690695043 0.220228110351 0)
(0.319015869268 0.218188744517 0)
(0.329593959519 0.216708616226 0)
(0.34045396164 0.215963363729 0)
(0.351647969697 0.216159250089 0)
(0.363260491143 0.217526371045 0)
(0.375416590641 0.220303284845 0)
(0.388296403624 0.224710078936 0)
(0.402097981391 0.2309047041 0)
(0.417291251168 0.238902467457 0)
(0.432856049098 0.248563849978 0)
(0.457096030904 0.258969520524 0)
(-2.90806869118e-05 -0.0027419117799 0)
(-8.97017217588e-05 -0.00274661061146 0)
(-0.000142782968052 -0.00262912633524 0)
(-0.000186707689583 -0.00263244158782 0)
(-0.000231362928906 -0.00263370452252 0)
(-0.000289518360091 -0.00265060027858 0)
(-0.000339209744383 -0.00267499300297 0)
(-0.000391976746906 -0.00268808302685 -8.39987208557e-29)
(-0.000461205274541 -0.00258049747293 0)
(-0.000521884154212 -0.00251720202092 0)
(-0.000613379538845 -0.00255865653189 -7.84092657179e-29)
(-0.000674608838296 -0.00238230648257 0)
(-0.000750210349495 -0.00241993829694 0)
(-0.000792589469282 -0.00245469571624 0)
(-0.000872277305688 -0.00241816972744 0)
(-0.000936289315281 -0.00233983033364 0)
(-0.000998813305065 -0.00234496832754 0)
(-0.00108394008007 -0.00233818628988 0)
(-0.00112348884061 -0.00222041818343 0)
(-0.00119347474375 -0.00219955065082 0)
(-0.00125508005052 -0.00213549467377 0)
(-0.00131431750543 -0.00207421794271 0)
(-0.00140144423442 -0.0020655033096 0)
(-0.00142583131145 -0.00195862935045 0)
(-0.00149888152807 -0.00191243088034 0)
(-0.0015509872335 -0.0018536764564 0)
(-0.00160782301379 -0.0017947451901 0)
(-0.00167484945765 -0.00174438571554 0)
(-0.00173639896308 -0.0016884951053 0)
(-0.00179722501165 -0.0016357227593 0)
(-0.00183574673096 -0.0015604928082 0)
(-0.00197653137501 -0.00152000192728 0)
(-0.00217684372103 -0.00146791500428 0)
(-0.00244375525892 -0.00140379160433 0)
(-0.00269894621381 -0.00132015961883 0)
(-0.00298587868863 -0.00125053351823 0)
(-0.0033043796941 -0.00118363099993 0)
(-0.00371945033187 -0.00112287681559 0)
(-0.00514091379414 -0.00101814672262 0)
(-0.00390816786297 -0.000483451172167 0)
(-0.0158134492637 0.00282998678507 0)
(-0.00195387278483 -0.00124457371346 0)
(-0.00163814247454 -0.00152000989531 0)
(0.0126810364265 0.0608777364666 0)
(0.0372028340913 0.114874327019 0)
(0.0584104856734 0.157551397432 0)
(0.0778343434657 0.190386128788 0)
(0.0956579514857 0.215220293755 0)
(0.111786599191 0.233488632857 0)
(0.126277415222 0.24646934241 0)
(0.139297912017 0.255291236628 0)
(0.151060678308 0.260906278456 0)
(0.161791115211 0.264091103076 0)
(0.171707950014 0.265462838847 0)
(0.181010438068 0.265500289468 0)
(0.189871561578 0.264567101552 -7.14784801884e-29)
(0.198435911982 0.262934570449 6.82514225539e-29)
(0.20682067227 0.260802466761 0)
(0.215118377643 0.258317030253 0)
(0.223400458886 0.255585858605 0)
(0.231720846161 0.25268973122 0)
(0.240119079662 0.249691565259 0)
(0.248622501882 0.246642904129 0)
(0.257247333216 0.243588671557 0)
(0.26599881246 0.24057123799 0)
(0.274870998435 0.237634893954 0)
(0.283847077824 0.234831492631 0)
(0.292900986335 0.232227421462 0)
(0.302000872602 0.229911438755 0)
(0.31111459686 0.228002479586 0)
(0.320217255405 0.22665635006 0)
(0.329300809269 0.226070154852 0)
(0.33838604735 0.226483091668 0)
(0.347538242439 0.228171634591 0)
(0.356884929249 0.231435325926 0)
(0.366646429828 0.236569486864 0)
(0.37712989695 0.243811996128 0)
(0.388973761033 0.253242127173 0)
(0.401612507406 0.264785647895 0)
(0.423206508385 0.277028761278 0)
(-2.6765603128e-05 -0.00279782385307 0)
(-7.0884459025e-05 -0.00278948854547 0)
(-0.000131965093335 -0.00276684787736 0)
(-0.000190512294865 -0.002688060169 0)
(-0.000230173952367 -0.00269165797196 0)
(-0.000274981689275 -0.00270586291609 0)
(-0.000316995846292 -0.00271250324166 0)
(-0.000366983711531 -0.00274302896143 0)
(-0.00043949839912 -0.00265609570465 0)
(-0.000509504900877 -0.00256903439709 0)
(-0.00058360508208 -0.0026156414291 7.7921895598e-29)
(-0.000657664172489 -0.00248738775582 0)
(-0.000737957539074 -0.00245411426735 0)
(-0.000789223966407 -0.002511228659 0)
(-0.000871674064331 -0.0025407255447 -7.41742853705e-29)
(-0.000913486989053 -0.00239668105041 0)
(-0.000989876813808 -0.00240052584663 0)
(-0.00105772054112 -0.00239719172432 0)
(-0.00109919049646 -0.00228420198053 0)
(-0.00117487190985 -0.0022590676126 0)
(-0.00125599721259 -0.00224185042032 0)
(-0.00127955724319 -0.00211804768446 0)
(-0.00135336998976 -0.00209722370222 0)
(-0.00138663181928 -0.00202036925853 0)
(-0.00145951563298 -0.00197928080315 0)
(-0.00149124679791 -0.00190194911831 0)
(-0.00155340650657 -0.00185482834548 0)
(-0.0016040916724 -0.00180242475751 0)
(-0.00165336046655 -0.00174718271986 0)
(-0.00170247789903 -0.00169932583903 0)
(-0.00175206671297 -0.00166596192764 0)
(-0.00176343578573 -0.00159340078971 0)
(-0.00183093573646 -0.00154584786363 0)
(-0.0019293080464 -0.00149471176549 0)
(-0.00204249147391 -0.00142816956667 0)
(-0.00216857338166 -0.00137367720549 0)
(-0.00231089633651 -0.0013652238678 0)
(-0.00244974591269 -0.00144000719992 0)
(-0.00260636325924 -0.0015732996973 0)
(-0.00233385721166 -0.00192450185179 0)
(-0.00151700700478 -0.00123162613076 0)
(-0.0175725151609 -0.000371351529215 0)
(-0.00672214190749 0.0114985023299 0)
(0.0223855751242 0.0844867357095 0)
(0.0430360533054 0.136383993372 0)
(0.0636607893222 0.177502308342 0)
(0.0826229809949 0.208739718576 0)
(0.0997203712821 0.23182973214 0)
(0.115033236812 0.248388797348 0)
(0.128698166096 0.259812827845 0)
(0.140922831035 0.267288150408 0)
(0.151950346891 0.27178904484 0)
(0.162024457239 0.274089770536 0)
(0.171370157701 0.27478894294 0)
(0.180183703992 0.274338175287 0)
(0.188628657628 0.273070780165 0)
(0.196836194682 0.271228274299 -6.72779567148e-29)
(0.204908005514 0.26898339227 0)
(0.212920383267 0.266459086768 6.24302254714e-29)
(0.220928513645 0.263743569416 0)
(0.228970306595 0.260901665195 0)
(0.237069244718 0.257982818938 0)
(0.245235826022 0.255026340428 0)
(0.25346748773 0.252064973916 0)
(0.261747445606 0.249128301439 0)
(0.270043418778 0.246247437002 0)
(0.278307417423 0.243461845667 0)
(0.286477533404 0.240828209552 0)
(0.294482157441 0.238430497431 0)
(0.302246578648 0.236390073262 0)
(0.309701804131 0.234874809028 0)
(0.316795850389 0.234106479701 0)
(0.323508481805 0.234365826235 0)
(0.329872631974 0.235993914142 0)
(0.336002082875 0.239385896935 0)
(0.34214454289 0.244971623513 0)
(0.348711414983 0.253155059543 0)
(0.356497879989 0.264220268267 0)
(0.365715456744 0.278290843878 0)
(0.384209081639 0.293518061326 0)
(-2.7076395199e-05 -0.00285371248923 0)
(-8.07182464101e-05 -0.00284039049402 0)
(-0.000132704588765 -0.00283623615352 0)
(-0.000170917381898 -0.00274797704266 0)
(-0.000205304002901 -0.00273247492662 0)
(-0.000246527132159 -0.00275214086879 0)
(-0.000290970864768 -0.00275648890172 0)
(-0.00034188188589 -0.00279912197785 0)
(-0.000417029505953 -0.00276066724239 0)
(-0.000493224204492 -0.00263632999265 0)
(-0.00055408812786 -0.00265895468218 0)
(-0.000639721206593 -0.00260859216424 0)
(-0.000717714442018 -0.0024884282648 0)
(-0.000786213738573 -0.00255457728842 0)
(-0.000830633492148 -0.0025690871539 7.26031030044e-29)
(-0.0008883102352 -0.00246823394481 0)
(-0.000968466117115 -0.00244768427592 0)
(-0.00102023481498 -0.00243621949797 -6.75709128274e-29)
(-0.00108041481482 -0.00235636874191 0)
(-0.00115040463433 -0.00230419576924 0)
(-0.00121475208552 -0.00227765839563 0)
(-0.00124812711662 -0.0021765119557 0)
(-0.00131015653304 -0.00213696096682 0)
(-0.00135713269304 -0.00207715226593 0)
(-0.00140290685856 -0.00201040371531 0)
(-0.00145345870115 -0.00195641755955 0)
(-0.00150050225802 -0.0019013470953 0)
(-0.00153551990126 -0.00183995137304 0)
(-0.0015846004263 -0.00179320110634 0)
(-0.00161868216393 -0.00173847069069 0)
(-0.00166571090932 -0.00170696146238 0)
(-0.0016708729463 -0.00165021854108 0)
(-0.00168906328821 -0.00160265246058 0)
(-0.00168207145442 -0.00152425447705 0)
(-0.00172005569597 -0.00147409015719 0)
(-0.00174896865496 -0.00142265569135 0)
(-0.00178375237798 -0.00140757724652 0)
(-0.00176410441438 -0.0014252511261 0)
(-0.0016841078858 -0.00149633110387 0)
(-0.00152677599308 -0.00165856983758 0)
(-0.00133853901476 -0.00180724985897 0)
(-0.00110024027406 -0.00162029478048 0)
(0.00460912903139 0.0346016612589 0)
(0.0287632593498 0.10469955408 0)
(0.0487878515667 0.157054124135 0)
(0.0684654914956 0.196813043784 0)
(0.0866809854009 0.226343363898 0)
(0.102977391024 0.247625140814 0)
(0.117444767015 0.262455584228 0)
(0.130282959715 0.27234663814 0)
(0.141738521423 0.278533570267 0)
(0.152077066718 0.281999399446 0)
(0.161552516297 0.283503376486 0)
(0.17038921667 0.283615601788 0)
(0.178774768191 0.282753331604 0)
(0.186859095531 0.281215022517 0)
(0.194757210166 0.279210055573 0)
(0.202553848785 0.276883309225 0)
(0.210308599417 0.274334530101 -6.1755400555e-29)
(0.218060615184 0.271632961049 0)
(0.225832357335 0.268827715771 0)
(0.233631851658 0.265954332121 0)
(0.241453013779 0.26303831503 0)
(0.249274062749 0.260097265316 0)
(0.257054839869 0.257143732381 0)
(0.264734498235 0.254190629412 0)
(0.272231072537 0.251259935969 0)
(0.279443834177 0.248394082243 0)
(0.286258458251 0.245668559753 0)
(0.292554393699 0.243204289688 0)
(0.298213819434 0.241179001364 0)
(0.303132355406 0.239837933993 0)
(0.307233246396 0.239505182417 0)
(0.310490604038 0.240597061045 0)
(0.312964605205 0.243637645789 0)
(0.314887581354 0.249271585732 0)
(0.31672169637 0.258234195101 0)
(0.319418188098 0.271308554729 0)
(0.324247392206 0.288936634917 0)
(0.337284009619 0.309324729304 0)
(-2.55696308648e-05 -0.00290676800977 0)
(-8.41767930458e-05 -0.00289680496744 0)
(-0.000125635788869 -0.00284835009933 0)
(-0.00014241274774 -0.00276105925739 0)
(-0.000175662459896 -0.00275708484396 0)
(-0.000223259896394 -0.00279422298866 0)
(-0.000271333619443 -0.00280835106493 0)
(-0.000322039495994 -0.00285301932166 0)
(-0.000388872207797 -0.00285037215586 0)
(-0.000470225181386 -0.00273010761739 0)
(-0.000534194817285 -0.00269434277213 0)
(-0.000619566843387 -0.00276138614727 0)
(-0.000692919213861 -0.00258298740151 0)
(-0.00077092719495 -0.00258504345721 0)
(-0.000807398259611 -0.00262399941627 0)
(-0.000884364594198 -0.00259041246993 0)
(-0.000943942805582 -0.00249204226275 0)
(-0.00100609057686 -0.00249448102578 6.70664559579e-29)
(-0.00108143908634 -0.00247344267717 0)
(-0.00112154874243 -0.00235563823724 0)
(-0.00118452609892 -0.00232286869001 0)
(-0.00123061600306 -0.0022393215759 0)
(-0.00127804199987 -0.00217242950844 0)
(-0.00134799196963 -0.0021555132861 0)
(-0.00136231176406 -0.00205368925937 0)
(-0.00143321378736 -0.00202321645549 0)
(-0.00144347987416 -0.00192585493488 0)
(-0.00149456291559 -0.00188518584621 0)
(-0.00153614127552 -0.00183817100172 0)
(-0.00156316011872 -0.00177317218818 0)
(-0.00159952766108 -0.00172448832833 0)
(-0.00162912168916 -0.00167870063592 0)
(-0.00165665499438 -0.00163742251482 0)
(-0.00166962756423 -0.00158256326369 0)
(-0.00168377451828 -0.00152655672952 0)
(-0.001694615217 -0.00147081349101 0)
(-0.00167587551342 -0.00141254801189 0)
(-0.00159089443084 -0.00136385046048 0)
(-0.00143008935691 -0.001381113176 0)
(-0.00114068519189 -0.00148914537949 0)
(-0.00105190654472 -0.0019002970154 0)
(-0.0011488442341 -0.00215316585889 0)
(0.0041440650606 0.0562887294861 0)
(0.0324250787395 0.126240868525 0)
(0.0533311331374 0.1775879828 0)
(0.0724953186903 0.215604519601 0)
(0.089954263876 0.243203493385 0)
(0.105431943533 0.262591434843 0)
(0.119059161966 0.275691483154 0)
(0.131094842277 0.284096769927 0)
(0.141824575567 0.28907245034 0)
(0.151531250136 0.291594619791 0)
(0.160471728783 0.292394734984 6.99675891791e-29)
(0.168863319577 0.292005218756 -6.8751858254e-29)
(0.176880123961 0.290803212174 0)
(0.184655237015 0.289049341776 0)
(0.192285830583 0.286919900013 0)
(0.199839226936 0.284532201646 0)
(0.207358691411 0.281963636619 0)
(0.214868216346 0.279265328841 -5.7111941283e-29)
(0.222375862055 0.276471028574 0)
(0.229875091327 0.273601682469 0)
(0.237343596521 0.270666804588 0)
(0.244739867323 0.267665010376 0)
(0.251998897215 0.264586681848 0)
(0.259029129046 0.261420910824 0)
(0.265712415989 0.258166975707 0)
(0.271907588014 0.254848762895 0)
(0.277456864541 0.251529743829 0)
(0.282193541548 0.248326654535 0)
(0.285949439047 0.245421549636 0)
(0.288561491292 0.243073906412 0)
(0.289878743689 0.241636777453 0)
(0.289775273302 0.241583255915 0)
(0.288175102707 0.243554280147 0)
(0.285153980443 0.248439080813 0)
(0.281003164616 0.25749553761 0)
(0.276889966239 0.272552973718 0)
(0.275155607804 0.295375245643 0)
(0.278040697705 0.326595909322 0)
(-1.87420250834e-05 -0.00295236583748 0)
(-6.14863391002e-05 -0.00295006521478 0)
(-9.31882407993e-05 -0.00284116759947 0)
(-0.000124554829823 -0.00275357337633 0)
(-0.000173269664084 -0.00280465877215 0)
(-0.000215743845764 -0.0028386666388 0)
(-0.000258211128296 -0.00285738413921 0)
(-0.000299814586287 -0.00289732869565 0)
(-0.000350975832732 -0.00291512944843 0)
(-0.000432032815047 -0.0028157148302 0)
(-0.000516488214545 -0.00274696381439 0)
(-0.000572644494722 -0.00277548513852 0)
(-0.000661005997017 -0.00271394646243 0)
(-0.000739179012149 -0.00259226533595 0)
(-0.000802725682499 -0.00266883505709 0)
(-0.000862013906749 -0.00268010959644 0)
(-0.000916331675651 -0.00254549839661 0)
(-0.000996221628488 -0.00253928111788 0)
(-0.00105081971549 -0.00251725539786 0)
(-0.00109616875858 -0.00240858899479 0)
(-0.00116157072252 -0.00236302965855 0)
(-0.00122500433274 -0.00232394528718 0)
(-0.00125020477569 -0.00221151050806 0)
(-0.00130441536752 -0.00217420479152 0)
(-0.0013327560633 -0.00209423941752 0)
(-0.00138177649846 -0.00203746935405 0)
(-0.00141767548532 -0.00197468875412 5.01958359042e-29)
(-0.00146517164662 -0.00193046357749 -4.86031596198e-29)
(-0.00149392102797 -0.00186761007498 0)
(-0.00153872907369 -0.00182006527662 0)
(-0.00157888875726 -0.00176995810706 0)
(-0.0016211962364 -0.00172209966407 0)
(-0.00166387919198 -0.00167558454553 0)
(-0.0017006004514 -0.00162007960167 0)
(-0.00173809300155 -0.00156373865885 0)
(-0.00177311094521 -0.0014970569184 0)
(-0.00179844521735 -0.0014129676334 0)
(-0.00176716239846 -0.00129630728989 0)
(-0.00166066942714 -0.00119021731898 0)
(-0.000861429166065 -0.00082754937216 0)
(-0.000694329092478 -0.00160410586085 0)
(-0.00146589286537 -0.00180595117339 0)
(0.0104685741282 0.0805934198568 0)
(0.0361241455348 0.14773579322 0)
(0.0572381624645 0.197642120624 0)
(0.0758955867975 0.233731973413 0)
(0.0925309327814 0.259264946112 0)
(0.107148540281 0.27671200007 0)
(0.11994059973 0.288109372785 0)
(0.131208304111 0.295100880892 0)
(0.141265433328 0.298959335108 0)
(0.150403710779 0.300637884965 0)
(0.158875207201 0.300828552112 0)
(0.166884179798 0.300018586115 0)
(0.174587293314 0.298541084065 0)
(0.182098746531 0.296617565221 0)
(0.189497288287 0.294391644487 0)
(0.196833284675 0.2919543235 0)
(0.204134756049 0.289362052717 0)
(0.211411885216 0.286648921528 5.66647402537e-29)
(0.218659674479 0.283833583677 5.3868611138e-29)
(0.225858033198 0.280921271816 0)
(0.232968710489 0.277902530612 0)
(0.23992973126 0.274752192279 0)
(0.24664960101 0.271432603638 0)
(0.253004147268 0.267903312263 0)
(0.258837869897 0.264136397112 0)
(0.263969686013 0.26013426487 0)
(0.26820112528 0.255946253106 0)
(0.271324164941 0.251681735262 0)
(0.273126039136 0.247519768382 0)
(0.273389004003 0.243717938649 0)
(0.271884100278 0.240625933811 0)
(0.268358601759 0.238712827742 0)
(0.26251491844 0.238627220811 0)
(0.25402673071 0.241318759922 0)
(0.242428333736 0.248318190885 0)
(0.228305077797 0.262274274112 0)
(0.213077934316 0.287794678044 0)
(0.199707141101 0.336306302829 0)
(-1.24877773457e-05 -0.00298548518424 0)
(-3.83366667327e-05 -0.0029859362618 0)
(-5.37986230002e-05 -0.0028949780706 0)
(-0.000112456592301 -0.00282689150891 0)
(-0.000183177111198 -0.00284236181697 0)
(-0.000211011299326 -0.00287429649622 0)
(-0.0002418670068 -0.00289789016841 0)
(-0.000271245378706 -0.00292543112407 0)
(-0.000310918589662 -0.00296981805839 0)
(-0.000390689673923 -0.00292981127887 0)
(-0.000486909749665 -0.00283756672617 0)
(-0.000549503128902 -0.00281224788671 0)
(-0.000634255826401 -0.00287955854801 0)
(-0.000709529541219 -0.00269468831125 0)
(-0.000790793232046 -0.00269269491587 0)
(-0.00083645698139 -0.00273112277171 0)
(-0.000909494125999 -0.00267573429327 0)
(-0.000974535621567 -0.00258403271203 0)
(-0.00103227011056 -0.00256804859174 0)
(-0.00109676428422 -0.00251614786164 0)
(-0.00113802513906 -0.002401233552 5.90505093212e-29)
(-0.0011980800528 -0.00236136006318 0)
(-0.001229424911 -0.00225854347474 0)
(-0.00127353327793 -0.00219411930504 0)
(-0.00133782541824 -0.00217605153436 0)
(-0.00135264072499 -0.00207568761083 0)
(-0.00139944689076 -0.00202071976292 0)
(-0.00142726425637 -0.00195614219365 0)
(-0.00147095244529 -0.00191455592393 0)
(-0.00151708218693 -0.00187155364807 0)
(-0.00155065336521 -0.00180904068668 0)
(-0.00160647469287 -0.00176934021814 0)
(-0.00165954483741 -0.00172370687969 0)
(-0.00171610018797 -0.00167437241979 0)
(-0.00179223742079 -0.00163251739127 0)
(-0.00186630845811 -0.00156944955593 0)
(-0.00198215761095 -0.00149981446185 0)
(-0.00208840011403 -0.00138339885097 0)
(-0.00257866159437 -0.00121329147927 0)
(-0.00130784861704 -0.000280834440907 0)
(-0.0123326025383 -0.00824365362225 0)
(-0.00846777858834 0.0043033573792 0)
(0.0210477721963 0.103993669642 0)
(0.04067612236 0.168953773099 0)
(0.0608382944994 0.216912220557 0)
(0.0787431944745 0.250977917958 0)
(0.0944598010572 0.274430188791 0)
(0.108178691555 0.289964295093 0)
(0.120149780051 0.299730450586 0)
(0.130696332399 0.30540676616 0)
(0.140143585848 0.308256169629 0)
(0.148781460308 0.309195623781 0)
(0.156849833676 0.308868749705 0)
(0.164535021075 0.307712585797 0)
(0.171973634763 0.306014371725 0)
(0.179260180688 0.303956916562 0)
(0.186455455602 0.30165274684 0)
(0.193594101654 0.299168512192 0)
(0.200690474654 0.296541466065 0)
(0.207742582256 0.293789779778 -5.39778047834e-29)
(0.214733826322 0.29091701823 -5.35351640252e-29)
(0.221631510707 0.287910950622 0)
(0.228381454011 0.28473921313 0)
(0.234900089307 0.281347085372 0)
(0.241067561194 0.277662581667 0)
(0.246725524561 0.273610588981 0)
(0.251681278214 0.26913328538 0)
(0.255716924131 0.264211400839 0)
(0.258600114338 0.258881218637 0)
(0.260092379167 0.253244713819 0)
(0.259951535057 0.247473273785 0)
(0.257925246685 0.241808016226 0)
(0.253733071066 0.236561581633 0)
(0.247030201198 0.232127767938 0)
(0.237340962142 0.229012552002 0)
(0.223950233854 0.227898701766 0)
(0.205491596335 0.229839760857 0)
(0.180147433312 0.236535913747 0)
(0.138582437007 0.252189345432 0)
(0.0819042438064 0.288732146381 0)
(-1.25085847317e-05 -0.00300639009883 0)
(-4.29791038486e-05 -0.0030105425245 0)
(-5.84922933842e-05 -0.00291427970033 0)
(-9.80658909407e-05 -0.00301243803524 0)
(-0.000153624536123 -0.00289728831721 0)
(-0.00018949227247 -0.00289966410303 0)
(-0.000215303171905 -0.00292846182549 0)
(-0.000239983649851 -0.00294906687143 0)
(-0.000274456982768 -0.00302333454364 0)
(-0.000336528366443 -0.00302588204986 0)
(-0.000431576444778 -0.00293254681974 0)
(-0.000524703142471 -0.0028666884184 0)
(-0.000584708642817 -0.002886266693 0)
(-0.000666917206504 -0.00285059340681 0)
(-0.000750600538179 -0.00271918240948 0)
(-0.000825456387181 -0.0027705824941 0)
(-0.00087900035966 -0.00276225651125 0)
(-0.000942609010202 -0.00262467692612 0)
(-0.0010199956576 -0.00259268023994 0)
(-0.00107600562409 -0.00257021946441 0)
(-0.00111624706267 -0.00243650464231 -5.90956684168e-29)
(-0.00118037151509 -0.00238257560347 0)
(-0.00123816926213 -0.00234074420631 0)
(-0.00126798089401 -0.00224224266602 0)
(-0.00130641320935 -0.00218525175868 0)
(-0.00133338954926 -0.00211406281158 0)
(-0.00136407826024 -0.00204482607553 0)
(-0.00140368878151 -0.00199919641888 0)
(-0.00143459838667 -0.0019478291425 0)
(-0.00147095212427 -0.00190085432779 0)
(-0.00151950794258 -0.00186052470237 0)
(-0.00157553891145 -0.00182727967421 0)
(-0.00162634263485 -0.00178380707669 0)
(-0.00168915190826 -0.00174477393103 0)
(-0.00176520495791 -0.00170860926706 0)
(-0.0018611953457 -0.00167578363228 0)
(-0.00197075096325 -0.00162777998796 0)
(-0.00212227612523 -0.00158136645284 0)
(-0.00256844612109 -0.00147082260916 0)
(-0.00148717459908 -0.00146802629605 0)
(-0.00915624128041 -0.0191278767628 0)
(0.00656970021896 0.0301747983396 0)
(0.0267313927054 0.122404666476 0)
(0.0452485531434 0.188584145265 0)
(0.0640446041206 0.235104052365 0)
(0.0809142737909 0.267217263915 0)
(0.0956856924326 0.288658699698 0)
(0.108532840809 0.302364711605 0)
(0.119734389854 0.310602981304 0)
(0.129627307648 0.31507888915 0)
(0.138537853027 0.317033118439 0)
(0.146746253003 0.317336065489 0)
(0.154475075554 0.316576514566 0)
(0.161889844312 0.315138570037 0)
(0.169106186069 0.313263690824 0)
(0.176199414204 0.311097733537 0)
(0.183213754398 0.308724559686 0)
(0.190169920749 0.306188823341 -5.55896577601e-29)
(0.197070470672 0.303510395431 0)
(0.203902961927 0.300692492583 5.36527810055e-29)
(0.210640602512 0.29772317259 0)
(0.217238804139 0.294570166626 0)
(0.22362699924 0.291173131786 0)
(0.229698325573 0.287441094838 0)
(0.235302376849 0.283261437992 0)
(0.240245469379 0.278520710728 0)
(0.244299247345 0.273131388465 0)
(0.247214543288 0.267056308465 0)
(0.248735402017 0.260324445725 0)
(0.248608437936 0.253035707993 0)
(0.246583948682 0.245356040014 0)
(0.242406310248 0.237506155384 0)
(0.235791618074 0.229747188626 0)
(0.226384549162 0.222365142847 0)
(0.213691062923 0.215656289836 0)
(0.196957223666 0.209894871801 0)
(0.17486310111 0.205315058414 0)
(0.145724457049 0.201691425483 0)
(0.102733028755 0.198615193453 0)
(0.0546782322056 0.18725723237 0)
(-1.3011678769e-05 -0.00302831591317 0)
(-4.70267589485e-05 -0.00303956754247 0)
(-8.61133243624e-05 -0.00289799349932 0)
(-8.9527547141e-05 -0.00297366569035 0)
(-0.000108563581779 -0.00293308019507 0)
(-0.000162241510968 -0.00292635525165 0)
(-0.000184469764506 -0.00295378317383 0)
(-0.00020795324259 -0.00298435126343 0)
(-0.000231067272433 -0.00306026159271 0)
(-0.00026804438386 -0.00309475701685 0)
(-0.000355982915902 -0.00305566224142 0)
(-0.000465101195923 -0.00297224278822 0)
(-0.000542096149027 -0.00291034661781 0)
(-0.000613099269834 -0.00293538923063 0)
(-0.000716165957032 -0.00286227787493 0)
(-0.000803432350072 -0.00277855763579 0)
(-0.000865488388392 -0.00281646498978 0)
(-0.000959490983295 -0.00281341101561 0)
(-0.00100655906322 -0.00263104699516 0)
(-0.00107548257439 -0.00261808923228 0)
(-0.00114776108389 -0.00257355362714 0)
(-0.0011778856226 -0.00242527032373 0)
(-0.00123460542922 -0.00237804460271 0)
(-0.00125624159577 -0.00228029630167 0)
(-0.00128674079396 -0.00221100315847 0)
(-0.00132165583758 -0.00216020319806 0)
(-0.00134069283567 -0.00208351963441 0)
(-0.00137273000625 -0.00203385505362 0)
(-0.00139038201251 -0.00197619984888 0)
(-0.00143584623082 -0.00195155983429 0)
(-0.00147430094169 -0.00191391313296 0)
(-0.00150582366904 -0.00186715589275 0)
(-0.0015479385347 -0.00183118429005 0)
(-0.00160764908329 -0.00180838303569 0)
(-0.00167505985597 -0.00178446748622 0)
(-0.00174429062477 -0.00175178520524 0)
(-0.00181887385952 -0.00172511117476 0)
(-0.00191843386274 -0.00172225569153 0)
(-0.00196823587638 -0.0016772890933 0)
(-0.00177247079493 -0.0020553786951 0)
(-0.00128805264227 -0.00397866302284 0)
(0.00653005251323 0.045594521475 0)
(0.029511184504 0.142428433094 0)
(0.0480372946827 0.207721255621 0)
(0.0661629992563 0.252505638988 0)
(0.0822058872148 0.282580952146 0)
(0.0961529869222 0.302033944351 0)
(0.108227876639 0.313991029723 0)
(0.118749393885 0.320807140203 0)
(0.128073653628 0.324197273368 0)
(0.13652658088 0.325365669858 0)
(0.144375424121 0.325126258574 0)
(0.151823117657 0.324007981935 0)
(0.159013636378 0.322340950439 0)
(0.1660422411 0.320322300264 0)
(0.172966612254 0.318063595744 0)
(0.179816418293 0.315622891863 5.55965455292e-29)
(0.186600543697 0.313025286171 5.52286230937e-29)
(0.193311679714 0.310274931814 0)
(0.199928579376 0.30736075275 0)
(0.206415471041 0.304254296999 0)
(0.212716186819 0.300899633088 0)
(0.21874264036 0.297202055518 0)
(0.224362213269 0.293026808923 0)
(0.229391377036 0.288214875476 0)
(0.233600362066 0.28261309285 0)
(0.236728021009 0.276108242893 0)
(0.238501408463 0.268653757723 0)
(0.238653370172 0.260282236089 0)
(0.236933091084 0.251102776196 0)
(0.233106767035 0.241286078482 0)
(0.226947633299 0.231041404921 0)
(0.218215157619 0.220587512648 0)
(0.206616700063 0.210117042006 0)
(0.191764532759 0.199748517602 0)
(0.173071611971 0.18943715021 0)
(0.149613925748 0.178878786106 0)
(0.120302355869 0.166786616038 0)
(0.0808916033104 0.151195389201 0)
(0.0410082188299 0.122855710614 0)
(-8.1465213823e-06 -0.00305999074683 0)
(-2.60260565478e-05 -0.00308028744929 0)
(-8.8609866505e-05 -0.00294898960278 0)
(-0.000104938082403 -0.00290359110774 0)
(-9.97791140471e-05 -0.0030218485085 0)
(-0.000133701852858 -0.00295354446302 0)
(-0.000148592363095 -0.00297362363559 0)
(-0.000164738572898 -0.00301048739186 0)
(-0.000176444771453 -0.00306388453719 0)
(-0.000200079043207 -0.00314803748359 0)
(-0.000263908939354 -0.00316617831017 0)
(-0.000371495582555 -0.00307561027663 0)
(-0.000491557267513 -0.00301232993782 0)
(-0.000566564318285 -0.00297037413247 0)
(-0.000666825844005 -0.00302895892583 0)
(-0.000765425498657 -0.00285662771547 0)
(-0.000865996832539 -0.00282693979448 0)
(-0.000943459423073 -0.00286233474561 0)
(-0.000997466782364 -0.0027069807342 0)
(-0.00108015146982 -0.00264958452877 0)
(-0.00114414831911 -0.00261363936017 0)
(-0.00116937290782 -0.00246785327385 0)
(-0.00121853933625 -0.00239539739371 0)
(-0.00124675308811 -0.00231633303597 0)
(-0.00127018990054 -0.00223800203396 0)
(-0.00128501788518 -0.00216294767147 0)
(-0.00131193588315 -0.00211286947951 0)
(-0.00131850082996 -0.00203927486845 0)
(-0.00135175122589 -0.00201402384945 0)
(-0.00138254212303 -0.00199107099549 0)
(-0.00138521480488 -0.00192834992721 0)
(-0.00141205839374 -0.00189837105802 0)
(-0.00144508390003 -0.00187826848266 0)
(-0.00149468111897 -0.00187058146587 0)
(-0.00153912778219 -0.00184680453248 0)
(-0.00160050146504 -0.0018309626655 0)
(-0.00166001014484 -0.00180590007798 0)
(-0.0017264576465 -0.00178784267875 0)
(-0.00166940207199 -0.00167572848248 0)
(-0.000874466287773 -0.00147906501863 0)
(-0.0023490911366 -0.00504037184094 0)
(0.000677305957158 0.069685286201 0)
(0.0302282544197 0.163056096618 0)
(0.0494008568936 0.226593940466 0)
(0.0672530605465 0.26932206192 0)
(0.0826733361363 0.297225915797 0)
(0.0959254105336 0.314676197622 0)
(0.107336600315 0.324945297828 0)
(0.117275176035 0.330435894073 0)
(0.126117882302 0.332846378148 0)
(0.134189383403 0.333327727366 0)
(0.141742258654 0.332627749005 0)
(0.148959067268 0.33121174055 0)
(0.155962873786 0.329356055002 0)
(0.162830242104 0.327215913555 -5.70747586301e-29)
(0.169603428069 0.324871732737 0)
(0.176299849372 0.322358705915 -5.52400026674e-29)
(0.182918698672 0.319684644991 0)
(0.189444605853 0.316839338499 0)
(0.195848949347 0.313797674585 0)
(0.202087888143 0.310512942309 0)
(0.20809342793 0.30690060577 0)
(0.21375794932 0.302823715345 0)
(0.218919718187 0.29809556547 0)
(0.223359144567 0.292506146236 0)
(0.226810132349 0.285864341785 0)
(0.228982828418 0.278039652753 0)
(0.229589349362 0.268989348349 0)
(0.228364479146 0.258765195962 0)
(0.225076828446 0.247501478279 0)
(0.219529044625 0.23538985938 0)
(0.211548981744 0.222646416709 0)
(0.200973042856 0.20947241625 0)
(0.187618129183 0.196008112415 0)
(0.1712731811 0.182264550742 0)
(0.151596678603 0.168016980284 0)
(0.128185449529 0.152708490926 0)
(0.100630409258 0.134266441121 0)
(0.0662719450007 0.11004610446 0)
(0.0328764614944 0.0730782776388 0)
(-2.69306306551e-06 -0.0030859151891 0)
(-1.24122221333e-05 -0.00311814511374 0)
(-7.58841791828e-05 -0.00311885889964 0)
(-0.000121911780148 -0.00291446065632 0)
(-9.9842698859e-05 -0.0030898175887 0)
(-7.98020824556e-05 -0.00299678258031 0)
(-9.42076028725e-05 -0.00298587894323 0)
(-0.000102992255133 -0.00302708484726 0)
(-0.00011605735461 -0.00306901369373 0)
(-0.000134089649663 -0.00318605081013 0)
(-0.000174679863763 -0.00322554114539 0)
(-0.000270278205454 -0.0032603447634 0)
(-0.000394615743191 -0.00313527149848 0)
(-0.00051900520318 -0.00305461718844 0)
(-0.000613875094829 -0.00307998060647 0)
(-0.000744499003423 -0.00309874751231 0)
(-0.000855151717083 -0.00291645458415 0)
(-0.000945381001928 -0.00289257615791 0)
(-0.00102291613699 -0.00285295346127 0)
(-0.00108348468584 -0.00269819656471 0)
(-0.00114598089534 -0.00263142346216 0)
(-0.00118738395545 -0.00254165050339 0)
(-0.00121187238192 -0.00241872625794 0)
(-0.00123915121212 -0.0023346195354 0)
(-0.00125118488279 -0.00225305283771 0)
(-0.00126495101139 -0.00218479269295 0)
(-0.00127064701886 -0.0021163862219 0)
(-0.00128371966552 -0.00206958868435 0)
(-0.00129637308883 -0.00203668595978 0)
(-0.0012878484081 -0.00198695269535 4.21850044879e-29)
(-0.00128863146016 -0.00195334525001 -3.98238934801e-29)
(-0.00129716779603 -0.00193200952851 0)
(-0.00130847069127 -0.00191558926225 0)
(-0.00132602156903 -0.00190284777105 0)
(-0.00135102675429 -0.00188882626082 0)
(-0.00139198637161 -0.00187582639219 0)
(-0.00146086871698 -0.00187572396854 0)
(-0.00158002232223 -0.00184848056432 0)
(-0.00185421269506 -0.00171136436091 0)
(-0.00134226180262 -0.00179808414634 0)
(-0.00919221415909 -0.0207549336189 0)
(0.00840053943786 0.0923092483741 0)
(0.0317331404698 0.183301745741 0)
(0.0501511251857 0.244993945522 0)
(0.0676394461907 0.285567238421 0)
(0.0824948497222 0.311236977957 0)
(0.0951299792193 0.326684322845 0)
(0.105965439233 0.335323696692 0)
(0.115408294004 0.339578275787 0)
(0.123848128425 0.341104947818 0)
(0.131604841039 0.340985323493 -6.19639718504e-29)
(0.138914941445 0.339892874534 6.11576543556e-29)
(0.145940786496 0.33822694927 0)
(0.152786014952 0.336211510199 5.70075398523e-29)
(0.159510723739 0.333962883939 5.66805892234e-29)
(0.166144197072 0.331533631765 0)
(0.172693888393 0.328938855172 0)
(0.179151257047 0.326171016105 0)
(0.185494402291 0.323206484494 0)
(0.191688451795 0.32000590075 0)
(0.19768202049 0.316501615513 0)
(0.203394329582 0.31257390975 0)
(0.208695144536 0.308034048221 0)
(0.213389294778 0.302634897421 0)
(0.21721796603 0.296112814855 0)
(0.219879211845 0.288244389602 0)
(0.221059776146 0.278894899516 0)
(0.220466556133 0.268042882338 0)
(0.217849070292 0.255777998833 0)
(0.213009798292 0.242278059195 0)
(0.205802863421 0.227774236031 0)
(0.196126415188 0.212511169269 0)
(0.183909453897 0.196703973315 0)
(0.16909735855 0.180492694326 0)
(0.151677468408 0.163862950465 0)
(0.13153593913 0.146567844968 0)
(0.108861082226 0.12803389249 0)
(0.0837591453587 0.105102256836 0)
(0.0534716399847 0.075193254194 0)
(0.0237608901339 0.0347953368598 0)
(5.142437123e-06 -0.00308228122677 0)
(-3.52797655412e-06 -0.00313624962139 0)
(-3.00879439212e-05 -0.00316738741783 0)
(-8.03293164547e-05 -0.00291971034027 0)
(-8.86993048674e-05 -0.00289697745991 -1.10072701376e-29)
(-5.94450394709e-05 -0.00298654766965 -1.56192965848e-33)
(-4.76596095125e-05 -0.00298979407966 1.14317979307e-29)
(-3.53639240407e-05 -0.00303901055032 0)
(-4.81503264317e-05 -0.00309822693242 0)
(-5.95794898328e-05 -0.00319295010552 0)
(-8.81548377739e-05 -0.00329217213378 0)
(-0.000151302752288 -0.00331219413031 0)
(-0.000268491666189 -0.00328561744101 0)
(-0.000431920391304 -0.00320807337311 0)
(-0.000573694787832 -0.00314268500713 0)
(-0.000709450434031 -0.00320114734868 0)
(-0.000839051599453 -0.00308582253997 0)
(-0.000954430561903 -0.00295623298141 0)
(-0.00103686212162 -0.00289159058437 0)
(-0.00111842519944 -0.00283275508456 0)
(-0.00115504193053 -0.00265053875451 0)
(-0.00120153278012 -0.0025529940425 0)
(-0.00123162218851 -0.00246679829237 0)
(-0.00123349809046 -0.00234356536894 0)
(-0.0012435385067 -0.00226222408216 0)
(-0.00124627966676 -0.00219630081556 0)
(-0.00123664777626 -0.00212870221342 0)
(-0.00122881212549 -0.00208002532667 0)
(-0.00119668496267 -0.00201388684264 0)
(-0.00117334354888 -0.00197620641345 0)
(-0.00114760041377 -0.00193475862442 0)
(-0.001128238771 -0.00190485626254 0)
(-0.00112214509396 -0.0019009677781 0)
(-0.00111643121558 -0.00189797548828 0)
(-0.00112012856556 -0.00189775161128 0)
(-0.00114578519507 -0.0019119297416 0)
(-0.0011620488364 -0.00190341140359 0)
(-0.00127652161045 -0.00199573019297 0)
(-0.00159858406022 -0.00220432494157 0)
(-0.00183593433375 -0.00252652963652 0)
(-0.00113560607135 -0.00299490995259 0)
(0.00872421496779 0.109188243254 0)
(0.032708554881 0.203291643838 0)
(0.0503455785302 0.263095598769 0)
(0.0673926589113 0.301333083497 0)
(0.0817820720381 0.324704747357 0)
(0.0938923169441 0.33815165465 0)
(0.104231248908 0.345214114963 0)
(0.113251806596 0.348312915689 0)
(0.121353259622 0.349039980679 0)
(0.128847874135 0.348392315883 0)
(0.135955348809 0.346962266055 0)
(0.142818673756 0.345082288573 0)
(0.149523957523 0.342926184926 -5.66100886858e-29)
(0.156117178054 0.340574714892 0)
(0.162616989829 0.338055775392 0)
(0.169022895094 0.33536680727 0)
(0.175320242777 0.332486442274 0)
(0.181481763766 0.329378134986 0)
(0.187467105075 0.325987563732 0)
(0.193217424009 0.322222304553 0)
(0.198637338991 0.31791886498 0)
(0.203569696609 0.312825430962 0)
(0.207780657306 0.306626185849 0)
(0.210969098291 0.299004095297 0)
(0.212798762629 0.289713705611 0)
(0.212939633202 0.27863371476 0)
(0.211103764413 0.265784578469 0)
(0.207067385905 0.251313914485 0)
(0.200678271986 0.235460896986 0)
(0.191850842226 0.218512643943 0)
(0.180558215261 0.200760086959 0)
(0.166817824714 0.182457760425 0)
(0.150693532517 0.163791546113 0)
(0.13234104798 0.144804368545 0)
(0.111802791959 0.125449225649 0)
(0.0900456160735 0.105384370975 0)
(0.0669134562165 0.0792369672312 0)
(0.0364133213965 0.0451799045278 0)
(0.000172228751269 -0.000185584156686 0)
(2.22957885943e-05 -0.00304642052835 0)
(3.54085488824e-05 -0.00313851078366 0)
(4.33367004959e-05 -0.00312309774847 0)
(-3.59645514803e-06 -0.00299558258169 0)
(-8.89695452306e-05 -0.00293027159722 0)
(-9.55317128805e-05 -0.00297467750259 0)
(-3.03801657012e-05 -0.00295808924136 0)
(2.42056838907e-05 -0.0030350179509 0)
(2.91650244907e-05 -0.0031168841926 0)
(1.70305884122e-05 -0.00318069959199 0)
(8.89617531622e-06 -0.00333817046296 0)
(-4.15886391726e-05 -0.00337116131696 0)
(-0.000139784815064 -0.00345517573866 0)
(-0.000295834033213 -0.0033687804039 0)
(-0.000512842449641 -0.0033270888009 0)
(-0.000679991656744 -0.0032646175489 0)
(-0.00083569543753 -0.00325565362427 0)
(-0.000958836269025 -0.00305943823918 0)
(-0.00108126832981 -0.00295740961902 0)
(-0.00114761885435 -0.00285198691714 0)
(-0.00121241509855 -0.00276882147548 0)
(-0.0012224561317 -0.0025651528882 0)
(-0.00124606784295 -0.00245889609468 0)
(-0.00124338427778 -0.00235561299093 0)
(-0.00123694922037 -0.00226415404496 0)
(-0.00120662245482 -0.00217008796459 0)
(-0.00117752448663 -0.00210785240902 0)
(-0.0011221665363 -0.00202072966276 0)
(-0.00108458885478 -0.0019759932043 0)
(-0.0010345401033 -0.00191866347599 0)
(-0.00100584147052 -0.00190022625701 3.67144970467e-29)
(-0.000977649176411 -0.00188993176096 -3.42800897774e-29)
(-0.000949366670678 -0.00188826650874 0)
(-0.000918826394268 -0.00188710878481 0)
(-0.000906989651518 -0.00190629991067 0)
(-0.000893610956865 -0.00191911108225 0)
(-0.000902741702306 -0.0019746185704 0)
(-0.00103208316769 -0.00222611471595 0)
(-0.00126570902591 -0.00254567080629 0)
(-0.0014820759278 -0.00296614055358 0)
(-0.00150493899785 -0.00421837589543 0)
(0.00281023895311 0.129868128614 0)
(0.0320352861007 0.223903658039 0)
(0.0500287098262 0.281241022533 0)
(0.0667273119404 0.316791508386 0)
(0.0807186203258 0.33772661326 0)
(0.092370549764 0.349154558226 0)
(0.102266235332 0.354683911317 0)
(0.110913085395 0.356698781097 0)
(0.118719556416 0.356700631411 -5.99019171456e-29)
(0.125987178025 0.355586906053 0)
(0.132917646885 0.353863304182 0)
(0.139635259193 0.351795700529 0)
(0.146210317052 0.349510665537 0)
(0.152676720667 0.347056856812 0)
(0.159044442259 0.344440477669 0)
(0.16530659825 0.341643346339 0)
(0.171443629954 0.338631367223 0)
(0.177423651252 0.335355151264 0)
(0.183201238747 0.331744181218 0)
(0.188709707231 0.327675972821 0)
(0.193836241245 0.322932235293 0)
(0.198391134066 0.31718507165 0)
(0.202095912489 0.310042745026 0)
(0.204604588625 0.301139031389 0)
(0.205549632142 0.290221874149 0)
(0.204592434995 0.277205325743 0)
(0.201461231726 0.262174546679 0)
(0.195970246102 0.245354915972 0)
(0.188021712449 0.22706219191 0)
(0.177595109963 0.207650595557 0)
(0.164736543996 0.187464331821 0)
(0.149532761185 0.166801750515 0)
(0.132122621349 0.145898244465 0)
(0.11269728474 0.124859751563 0)
(0.0913018710939 0.104023510853 0)
(0.0700008609002 0.0836002707683 0)
(0.046102127848 0.053828038495 0)
(0.000780395353661 0.00102046216595 0)
(-0.000322302588322 -0.00102181025732 0)
(4.90349584957e-05 -0.00298483712982 0)
(0.000106819907029 -0.00313356362367 0)
(0.000107999702492 -0.00308559194362 0)
(6.48457880578e-05 -0.00312711184141 0)
(-4.25700369781e-05 -0.00299994207177 0)
(-9.28805509025e-05 -0.0028721966731 0)
(-3.36528733036e-05 -0.00280754374521 0)
(4.52843223387e-05 -0.00296655740682 0)
(8.49292065406e-05 -0.00310788505595 0)
(8.94065797872e-05 -0.00320521183832 0)
(9.20956881771e-05 -0.00331177429617 0)
(6.34370819235e-05 -0.00350249479977 0)
(-1.70739133182e-05 -0.00351118149273 0)
(-0.00016064010895 -0.00366631865586 0)
(-0.000384818845327 -0.00360559119376 0)
(-0.000638798152492 -0.00344869828877 0)
(-0.000843107716704 -0.00334987793617 0)
(-0.00101367471875 -0.00329083687607 0)
(-0.00112672275328 -0.00305126165708 0)
(-0.00122148912852 -0.00290449648544 0)
(-0.00125557512234 -0.00275150902423 0)
(-0.0012893625603 -0.00264313778944 0)
(-0.00126428630503 -0.00244092436921 0)
(-0.00125947690401 -0.00234030457457 0)
(-0.00121783489856 -0.00223373133437 0)
(-0.00115691174221 -0.00212356655994 0)
(-0.00109244913703 -0.0020344166126 0)
(-0.00103894556248 -0.00197496680322 0)
(-0.000982693864395 -0.00192061196301 0)
(-0.00093790093797 -0.00189610356005 0)
(-0.000891538937482 -0.00188439497942 0)
(-0.000833714434163 -0.00186070076635 0)
(-0.000777391123628 -0.00184303194588 0)
(-0.000733578117213 -0.00185475749611 0)
(-0.000696448121491 -0.00188369060817 0)
(-0.000649640642677 -0.00189470837796 0)
(-0.000649264262523 -0.00203916381952 0)
(-0.000704783848086 -0.00235292203643 0)
(-0.000860409792869 -0.002809651154 0)
(-0.00117543763264 -0.00335747023175 0)
(-0.00128790127889 -0.00415275230281 0)
(0.0016979668547 0.150640276588 0)
(0.0312160449577 0.244627599295 0)
(0.049786819721 0.299378005853 0)
(0.0660603030734 0.33196033732 0)
(0.0795702649565 0.350314555167 0)
(0.0907456194739 0.359710954028 0)
(0.100203916147 0.363759873639 0)
(0.108492982647 0.364765670094 5.97524542921e-29)
(0.116023681844 0.364113975448 1.17587525448e-28)
(0.123081114158 0.362590154267 -5.76050435268e-29)
(0.12984623776 0.360610131935 0)
(0.136424482847 0.358375172161 0)
(0.142871485005 0.355968344009 0)
(0.149210546714 0.353409806018 0)
(0.155444371934 0.350686825312 0)
(0.161560741583 0.34776727447 0)
(0.167535966538 0.344605070994 0)
(0.173333889901 0.341137659166 0)
(0.178904099959 0.337276558555 0)
(0.184171194434 0.332862103263 0)
(0.189000916327 0.327607289798 0)
(0.193163988579 0.321093668223 0)
(0.196330924293 0.312848457939 0)
(0.198109393258 0.302465582526 0)
(0.198105545025 0.289707420081 0)
(0.195981977402 0.274549076548 0)
(0.191494695114 0.257164300553 0)
(0.184506694749 0.23787484925 0)
(0.174982724631 0.217085442775 0)
(0.162971952109 0.195224472296 0)
(0.148595536804 0.172687669782 0)
(0.131999486518 0.149803505105 0)
(0.113370926049 0.126807727479 0)
(0.0927655912936 0.103660677755 0)
(0.0699324358645 0.0806821615275 0)
(0.0474143045058 0.0582609249628 0)
(0.00210449318446 0.00323167802867 0)
(-0.00018170651117 -0.000159671106715 0)
(-3.44810286081e-05 -0.000727315047553 0)
(7.57198829301e-05 -0.00287589360389 0)
(0.000173926713444 -0.00311724431278 0)
(0.000170650890848 -0.00316532484756 0)
(0.000138993514811 -0.00318432254743 0)
(7.42145479771e-05 -0.00316724527906 1.05647660757e-28)
(-7.00301289598e-06 -0.0029175360468 0)
(-3.15039324923e-05 -0.00271490045298 0)
(2.17510636255e-05 -0.00289928312407 0)
(0.000108009322759 -0.00306156554682 0)
(0.000156987664963 -0.00319810505742 0)
(0.000172740478333 -0.00330797389944 0)
(0.000195416499034 -0.00353260934396 0)
(0.00012641080798 -0.00358486340452 0)
(-2.30529160793e-05 -0.00377266402267 0)
(-0.000248773082858 -0.00382349701549 0)
(-0.00056356696805 -0.00390147192269 0)
(-0.000827810362941 -0.00353983548814 0)
(-0.00106411665118 -0.00337355738601 0)
(-0.00123227775433 -0.00324633927429 0)
(-0.00130215116072 -0.00296618243198 0)
(-0.00135348993514 -0.0027755346492 0)
(-0.00134140836989 -0.00259907749353 0)
(-0.00133106006534 -0.00247527863515 0)
(-0.00126034163403 -0.00228948601079 0)
(-0.0011904921183 -0.0021616418043 0)
(-0.00110909817863 -0.00205836180587 0)
(-0.00103842810652 -0.00198498069652 0)
(-0.000973133219752 -0.00193051731279 0)
(-0.000900790467746 -0.0018784141949 0)
(-0.000831774806797 -0.00185127096812 0)
(-0.000744824409545 -0.00179732234266 0)
(-0.000679072312056 -0.00178284914509 0)
(-0.000620725918848 -0.00178916645832 0)
(-0.000564627283162 -0.00181221766085 0)
(-0.00049406910831 -0.00182927463498 0)
(-0.000418285042799 -0.00187617314662 0)
(-0.000348718258981 -0.00201826362667 0)
(-0.000261559251666 -0.00234810382131 0)
(-0.000261173944834 -0.00293550823816 0)
(0.000239998069693 -0.00300454725386 0)
(-0.00125880053996 -0.00287259068537 0)
(0.00347342824865 0.175312784213 0)
(0.0308028538295 0.265116216297 0)
(0.0500093008137 0.317141079312 0)
(0.06572592101 0.346652868618 0)
(0.0785653763301 0.362368150382 0)
(0.0891667847047 0.36977155935 0)
(0.098149980316 0.37242620716 0)
(0.106069790299 0.372514895281 -5.90894546276e-29)
(0.113324116351 0.371286756719 0)
(0.120173352174 0.36940805953 0)
(0.12677378173 0.367205757808 0)
(0.133211046777 0.364820693258 0)
(0.139526678768 0.36229711644 0)
(0.145734304415 0.359630480071 0)
(0.151830271153 0.356791713637 0)
(0.157797598939 0.353736125985 0)
(0.16360888556 0.350406099547 0)
(0.169223687115 0.346725232475 0)
(0.174586421199 0.34258475173 0)
(0.179611590738 0.337778344273 0)
(0.184138130926 0.331933033338 0)
(0.18788881817 0.324524409035 0)
(0.190476814526 0.314997037414 0)
(0.191463657856 0.302920618512 0)
(0.190436370023 0.288098682908 0)
(0.187070065642 0.270595955857 0)
(0.181160238789 0.250698516475 0)
(0.17262834804 0.228841121985 0)
(0.161507935407 0.205527650067 0)
(0.14792259174 0.181268277443 0)
(0.132077032167 0.156512725458 0)
(0.114186283331 0.131626884546 0)
(0.0945763178647 0.106823129643 0)
(0.0734218367414 0.0815784641052 0)
(0.0503302644056 0.0556928296088 0)
(0.018743908719 0.0292120865032 0)
(0.000264534998317 -6.96390894331e-06 0)
(0.00122608592898 -0.000785953928688 0)
(0.00023364595478 -0.000968997266864 0)
(8.72253889608e-05 -0.00271190462526 0)
(0.000214380879914 -0.00308583867772 0)
(0.000234664968238 -0.00317727988791 1.20057257199e-28)
(0.000224497446037 -0.00320894717804 0)
(0.000198402505743 -0.00320508238694 -1.17085266936e-28)
(0.000122635243266 -0.00303718425336 0)
(1.52972678886e-05 -0.0028279055953 0)
(1.70172476814e-05 -0.00280526636032 0)
(0.000124478642634 -0.00298649775331 0)
(0.000217934050243 -0.00314363268311 0)
(0.000281052213139 -0.00329987478267 0)
(0.0003226391305 -0.00343679966742 0)
(0.000343697269635 -0.00383461453429 0)
(0.000166397107168 -0.00388039226222 0)
(-7.340776599e-05 -0.00420656312296 0)
(-0.000382581129503 -0.00396107856072 0)
(-0.000833435534878 -0.00399269417903 0)
(-0.00116710943384 -0.00354535260135 0)
(-0.00135817986678 -0.00327563844316 0)
(-0.00146630894323 -0.00309456442103 0)
(-0.00146361128613 -0.00278405734155 0)
(-0.00143046704204 -0.00255560249567 0)
(-0.00136011433855 -0.0023726667274 0)
(-0.00126929348902 -0.00222974437599 0)
(-0.0011569416114 -0.0020743877537 0)
(-0.00105977362457 -0.00197087983514 0)
(-0.000981674348148 -0.00192206523667 0)
(-0.000879845824373 -0.00184154654114 0)
(-0.000789130229421 -0.00179711191638 0)
(-0.000685435208626 -0.00173150581731 0)
(-0.000618272168005 -0.00172809851756 0)
(-0.000554176214841 -0.00173392464687 0)
(-0.000482424138132 -0.00173869377717 0)
(-0.000400304416142 -0.00174216572058 0)
(-0.000305631905276 -0.00174677122773 0)
(-0.000188649646497 -0.00176517715219 0)
(-6.6789813355e-05 -0.0019102447296 0)
(0.000213697309479 -0.00215441578041 0)
(-0.000205789526194 -0.00289640282426 0)
(-0.00121399314408 -0.00304060931559 0)
(-0.028150450232 -0.0225512002783 0)
(0.0149087815972 0.201603047058 0)
(0.0325668786993 0.285310534103 0)
(0.0508793715372 0.334033632271 0)
(0.0658313413148 0.360536453741 6.61161904846e-29)
(0.0778101999232 0.373713298608 0)
(0.0877108383437 0.379249163491 0)
(0.0961612397804 0.380643375371 0)
(0.103688083537 0.379930868759 0)
(0.110655611858 0.378212853359 0)
(0.11729039499 0.376036704994 0)
(0.123720330321 0.373645798764 0)
(0.130010359771 0.371127055703 0)
(0.13618826047 0.368491474871 0)
(0.142258551632 0.365713745892 0)
(0.148211789243 0.362750920888 0)
(0.154026441701 0.359546881618 0)
(0.159671565094 0.356032700633 0)
(0.165102110332 0.352117114712 0)
(0.170256965185 0.347668116769 0)
(0.175038636057 0.342420275576 0)
(0.17925231869 0.33589362667 0)
(0.18256323053 0.327442359423 0)
(0.184521493 0.316431980689 0)
(0.184645050914 0.302430910592 0)
(0.182511470472 0.285315880853 0)
(0.177820996898 0.265271297721 0)
(0.170419886976 0.24271737374 0)
(0.160295499384 0.218214527269 0)
(0.147551759685 0.192371619204 0)
(0.132384744887 0.16578825016 0)
(0.115079600451 0.138982219858 0)
(0.0959130698815 0.112431902319 0)
(0.0754839367032 0.0864014550286 0)
(0.0540844848586 0.0594059106934 0)
(0.0302184494778 0.0311979177024 0)
(0.000230255015337 -0.000591563442459 0)
(0.000215726388181 -0.00229114968003 0)
(0.000455858635863 -0.00158634742549 0)
(0.00013828282182 -0.00143214387389 0)
(7.07259503859e-05 -0.00250496771947 0)
(0.000216491786933 -0.00301160632305 0)
(0.000285905074943 -0.00315563100645 -1.31140977783e-28)
(0.000314947596171 -0.00323090334258 0)
(0.000322767906658 -0.0032359698795 0)
(0.00028386140277 -0.00313326634538 0)
(0.000133273307729 -0.00287887225093 0)
(3.89041975759e-05 -0.00270632292976 0)
(0.000120143230734 -0.00287145710814 0)
(0.000261258005484 -0.00304532347426 0)
(0.000388365768254 -0.00321965956108 0)
(0.000487135218763 -0.00343746356477 0)
(0.00053436440298 -0.00370123055809 0)
(0.000497700269514 -0.00437463180651 0)
(0.000231847734263 -0.00429479644291 0)
(-0.000166093753852 -0.00467668472352 0)
(-0.000873465207763 -0.0042044748115 0)
(-0.00149138712163 -0.00401085923413 0)
(-0.00155237247291 -0.00335932075739 0)
(-0.00166401472904 -0.00304700571473 0)
(-0.00163360622197 -0.00274995309238 0)
(-0.00157563460419 -0.00255622681815 0)
(-0.00138313372435 -0.00224853004408 0)
(-0.00125136836455 -0.00209012684553 0)
(-0.00111424416057 -0.00196523609978 0)
(-0.00100124496832 -0.00187599140286 0)
(-0.000885775940374 -0.00180143995677 0)
(-0.000770620957345 -0.00173781714939 0)
(-0.000656546659152 -0.0016672106355 0)
(-0.000583753356634 -0.00166646945641 0)
(-0.000515380533763 -0.00167881581596 0)
(-0.000425117777562 -0.00165284653778 0)
(-0.000334950522237 -0.00164277229765 0)
(-0.000238301553363 -0.0016347279441 0)
(-0.000134932407776 -0.00162602394045 0)
(-1.43995676168e-05 -0.00161667777552 0)
(0.000108164860322 -0.00173393103909 0)
(0.00072174865542 -0.00177269855786 0)
(-0.00138943805491 -0.00485620491808 0)
(-0.0420345965179 -0.0343155971005 0)
(-0.0174067167563 0.0289173295363 0)
(0.019410486947 0.220406566997 0)
(0.0365171581204 0.303768261339 0)
(0.0525933679205 0.349650389946 0)
(0.0662762081694 0.373340409392 -6.41228338805e-29)
(0.0772465887275 0.38419907593 0)
(0.086364511477 0.388069084127 0)
(0.0942417257858 0.388376243778 0)
(0.101358140981 0.38699698171 0)
(0.10802948495 0.384882734801 0)
(0.114442255967 0.382468367715 0)
(0.120694146749 0.379922687769 0)
(0.126829357508 0.37728684218 0)
(0.132862483285 0.374544637015 0)
(0.138789400688 0.371653915579 0)
(0.144595282896 0.368560132826 0)
(0.150254019069 0.365196647891 0)
(0.155731180863 0.361483257747 0)
(0.160976550029 0.357312480782 0)
(0.165923051996 0.352525444533 0)
(0.170458726312 0.346781274804 0)
(0.174346290779 0.339467963443 0)
(0.177182796228 0.329804194293 0)
(0.178451018372 0.317087160623 0)
(0.177630819174 0.300915089771 0)
(0.174302678269 0.281274606368 0)
(0.168205867423 0.258499800689 0)
(0.159248335531 0.233162907268 0)
(0.147488890412 0.205955737927 0)
(0.13309790788 0.177587149232 0)
(0.116327015912 0.148739832448 0)
(0.0974956055459 0.11999014937 0)
(0.0768914282596 0.092030704303 0)
(0.0556402736678 0.0653479818577 0)
(0.0335034525025 0.0365986994539 0)
(0.000417816563574 -0.000148414646843 0)
(-0.000141788499643 -0.00149427621222 0)
(6.85549605898e-05 -0.00176464256882 0)
(0.000171192830856 -0.00168757119371 0)
(6.58382143342e-05 -0.00164889059131 0)
(4.76772375156e-05 -0.00239036000415 0)
(0.000192273121411 -0.00287650519319 0)
(0.000317119819032 -0.00310738224789 0)
(0.000382361626886 -0.00318706949698 0)
(0.000447494031257 -0.0032458648684 0)
(0.000434412913099 -0.00319050435811 0)
(0.000361049941998 -0.00326064786646 0)
(0.000153346223962 -0.00274910480734 0)
(0.000100758358394 -0.002702819395 0)
(0.000251018046141 -0.00288140650278 0)
(0.000456499935049 -0.00305674627656 0)
(0.000677101130795 -0.00330318308559 0)
(0.000818826963593 -0.00371304476689 0)
(0.000976135277959 -0.00425041129309 0)
(0.00058735922242 -0.00437092387676 0)
(-0.00012543922625 -0.00510505550902 0)
(-0.0013596436922 -0.00542756194626 0)
(-0.00176854431914 -0.00412045185804 0)
(-0.00196483594747 -0.00356901677219 0)
(-0.00204937646404 -0.0032607451393 0)
(-0.00178522382016 -0.00259179278663 0)
(-0.00162758609911 -0.00232364815481 0)
(-0.00140629518578 -0.00210250750029 0)
(-0.00121269248889 -0.0019343828995 0)
(-0.00105705538726 -0.00182794931829 0)
(-0.000922056862229 -0.00175531441544 0)
(-0.000784579510266 -0.00167653058425 0)
(-0.000659710519708 -0.00160998119052 0)
(-0.000572819963939 -0.00160145461997 0)
(-0.000496184577094 -0.00161495990073 0)
(-0.000390870511214 -0.00157100882821 0)
(-0.000292833730804 -0.00155640303345 0)
(-0.00019579024445 -0.00154802743576 0)
(-9.72266476698e-05 -0.00153859881187 0)
(-7.7796217548e-07 -0.00152980822718 0)
(8.38024179664e-05 -0.00151833441407 0)
(9.56009612978e-05 -0.00161179880291 0)
(0.000707585343438 -0.00168189023379 0)
(-0.0143241139848 -0.0499372814551 0)
(-0.0426337600162 -0.0291481099459 0)
(-0.00460269187599 0.0756743006771 0)
(0.0217508657514 0.239700582036 -1.02225981733e-28)
(0.0397089012163 0.320932739367 0)
(0.0543775568597 0.364031145553 0)
(0.0667925516654 0.385020486159 0)
(0.0767363271589 0.393774907713 0)
(0.0850623392955 0.396202551351 0)
(0.0923615588168 0.395611315679 0)
(0.0990661406751 0.393705943132 0)
(0.105439228802 0.391290271566 0)
(0.111625806086 0.388696337461 0)
(0.117693909551 0.386029200558 0)
(0.12366804968 0.38329300452 0)
(0.129550613606 0.380450396513 0)
(0.135329349945 0.377446044237 0)
(0.140984454054 0.374215834534 0)
(0.146485075008 0.37068326262 0)
(0.151793371169 0.366756704476 0)
(0.156853179128 0.362310728181 0)
(0.161591071195 0.357155167311 0)
(0.165877494266 0.350852447871 0)
(0.169421852958 0.342629335904 0)
(0.171741787351 0.331558133782 0)
(0.172250597614 0.316887717504 0)
(0.170399056122 0.298285915657 0)
(0.165785716021 0.275889790661 0)
(0.158204210665 0.250212076996 0)
(0.147635814024 0.22199045216 0)
(0.134217717999 0.192046399941 0)
(0.118184900412 0.161170304039 0)
(0.0998278384989 0.130097201415 0)
(0.0794275461104 0.0993511298494 0)
(0.0571373492011 0.0697240994169 0)
(0.034610787203 0.0418387255348 0)
(0.000847253380271 0.000934265528372 0)
(-0.000141629365948 -0.00098914823528 0)
(-3.60215383501e-05 -0.00137743931159 0)
(2.18951526017e-05 -0.00165181820976 0)
(5.09425117251e-05 -0.00171531471043 0)
(2.07442379866e-05 -0.00170626529901 0)
(5.45163840697e-05 -0.00231010264127 0)
(0.000190300463674 -0.00268896879714 0)
(0.000327451531918 -0.00301560665172 0)
(0.000418173270803 -0.00309473602072 0)
(0.000529546298972 -0.00315214315838 0)
(0.000627230539076 -0.0032607607034 0)
(0.00054816760157 -0.00311720739779 0)
(0.000374471000046 -0.00319620399584 0)
(0.000130034809212 -0.00261812659384 0)
(0.000163646551782 -0.00267575627419 0)
(0.00045420613349 -0.00278925172561 0)
(0.000825451379846 -0.00300416525403 0)
(0.00118389124773 -0.00354302985681 0)
(0.00126196829711 -0.00397702128877 0)
(0.0015942229888 -0.00605948442395 0)
(-0.000535058036569 -0.00516364341753 0)
(-0.00265016026843 -0.00829283865123 0)
(-0.00178521264889 -0.00358051080382 0)
(-0.00255520616509 -0.00368714652316 0)
(-0.00221553843727 -0.00285655081244 0)
(-0.00203194245716 -0.00248093786594 0)
(-0.00163682732644 -0.0020521332578 0)
(-0.00137365853814 -0.00186273589085 0)
(-0.00114790681307 -0.00174431085748 0)
(-0.000985044187925 -0.00168449496589 0)
(-0.000821354879969 -0.00159900225353 0)
(-0.000687902821527 -0.00155241383238 0)
(-0.000576344725488 -0.00152427878348 0)
(-0.000486713730851 -0.0015326788862 0)
(-0.000373122032289 -0.00148874325847 0)
(-0.000269567435434 -0.00147264806628 0)
(-0.000170734251967 -0.0014565938974 0)
(-7.25420621471e-05 -0.00144541302329 0)
(2.72008668507e-05 -0.00143529398272 0)
(0.000124260143046 -0.0014321269831 0)
(0.000211250914953 -0.00145621576285 0)
(0.000245228034102 -0.00157126081944 0)
(0.000684850484447 -0.00191991609633 0)
(-0.00546895384132 -0.0675866187197 0)
(-0.0307780908017 -0.0254727539926 0)
(0.00581324547858 0.111982331765 0)
(0.0240265218627 0.258549814038 9.45841209034e-29)
(0.0423302358665 0.337141007257 0)
(0.0560112486434 0.377264742044 0)
(0.0672477799373 0.395605376477 0)
(0.076184024445 0.402447227834 0)
(0.0837392637554 0.40365511699 5.34282177447e-29)
(0.0904790258485 0.402355066185 -5.28277056052e-29)
(0.0967850469888 0.400061816391 0)
(0.102866770852 0.397435793045 0)
(0.108828743552 0.394717886253 0)
(0.114711398696 0.391960949201 0)
(0.120521397203 0.389140795858 0)
(0.126250259323 0.386204541511 0)
(0.131878234778 0.383086937061 0)
(0.137381051859 0.37971601526 0)
(0.142722894675 0.376005795496 0)
(0.147862710697 0.371852900443 0)
(0.152737404431 0.367111785538 0)
(0.157266977597 0.361555628991 0)
(0.161300362267 0.354622610504 0)
(0.164480380974 0.34534518247 0)
(0.166233868418 0.332644030361 0)
(0.165905426329 0.315750950977 0)
(0.162929340995 0.29445184909 0)
(0.156939713572 0.26907750532 0)
(0.147800844887 0.240346939594 0)
(0.135580062632 0.209174536166 0)
(0.120503447217 0.176508777277 0)
(0.102878160593 0.143200130241 0)
(0.083059944294 0.110000573256 0)
(0.0613845605306 0.0771754157784 0)
(0.0378166592959 0.0455254703749 0)
(0.00899452684083 0.0150983430476 0)
(-5.44539439461e-05 -0.000787016131661 0)
(0.000509378858624 -0.00119157797191 0)
(0.000117603329976 -0.00143663220393 0)
(3.69029115771e-05 -0.0016320635183 0)
(1.63703118933e-05 -0.00172435435039 0)
(5.20524540533e-06 -0.00173196894374 0)
(9.16699622493e-05 -0.00216858315119 0)
(0.000232849554717 -0.00256752334153 0)
(0.00031328720843 -0.00289555695332 0)
(0.000409537993054 -0.00298766957004 0)
(0.000568987380321 -0.00297298603595 0)
(0.000814584163452 -0.00311998250936 0)
(0.000952239251772 -0.00342578275845 0)
(0.000498084161533 -0.00321412345891 0)
(0.000162467908464 -0.00302763896159 0)
(8.66419785925e-05 -0.00236592407725 0)
(0.00031836100399 -0.00240844406779 0)
(0.000836245460013 -0.0025343748894 0)
(0.00143401318891 -0.00344267841801 0)
(0.00138823941305 -0.00366751150962 0)
(0.00079436752626 -0.00615039136591 0)
(-0.00269122424814 -0.0114788545954 0)
(-0.00192686703542 -0.00420908338829 0)
(-0.00516116580171 -0.00771677240149 0)
(-0.00248299989104 -0.00287034247296 0)
(-0.003070778141 -0.00309645598069 0)
(-0.00195145182297 -0.00192520516148 0)
(-0.00159409504486 -0.00169562503622 0)
(-0.00128733375428 -0.00160024189828 0)
(-0.00106493908619 -0.00155684890701 0)
(-0.000878741589016 -0.00151438019954 0)
(-0.000720114059838 -0.00146923192689 0)
(-0.000583665620365 -0.00142385245617 0)
(-0.000479557449579 -0.00143152322937 0)
(-0.000362532230184 -0.00139835179444 0)
(-0.000258993064365 -0.00138870795865 0)
(-0.000162066353889 -0.00136875279908 0)
(-6.87064690115e-05 -0.00136201625404 0)
(2.75848822951e-05 -0.00135093389851 0)
(0.000129976819333 -0.00133791427596 0)
(0.000244538317314 -0.00133476990666 2.4288187548e-29)
(0.000389349615504 -0.00134233524002 -2.27314916519e-29)
(0.000566106588806 -0.00140661709353 0)
(0.00065053161262 -0.00188481322949 2.36453162363e-29)
(0.000914719593664 -0.0790654334757 0)
(-0.0181214949042 -0.0360455767349 0)
(0.0142832267687 0.138265985347 0)
(0.027699600182 0.276595500596 0)
(0.045063898918 0.352256731804 0)
(0.0575341462839 0.389258810357 0)
(0.0675629176403 0.405073276979 0)
(0.0755044594968 0.410231011224 0)
(0.0823265128159 0.410452511583 0)
(0.0885442408975 0.408630976069 0)
(0.0944795365676 0.406080680407 0)
(0.100286976165 0.403327874062 0)
(0.106033203573 0.400536178968 0)
(0.111734210383 0.397718031226 0)
(0.117381285826 0.394829055278 0)
(0.122956777387 0.391805797663 0)
(0.128434227822 0.388575824056 0)
(0.133785597929 0.38506065509 0)
(0.138969853318 0.381164920765 0)
(0.143943170772 0.376772949825 0)
(0.148634286155 0.371716422028 0)
(0.152956744911 0.365725408653 0)
(0.156733045586 0.358078325579 0)
(0.159523376427 0.347577003368 0)
(0.160652920558 0.332993855658 0)
(0.159401980006 0.313587702559 0)
(0.155204319712 0.28931859929 0)
(0.147748043067 0.260754482559 0)
(0.136982873584 0.228844866982 0)
(0.123072299369 0.194691327004 0)
(0.106341895551 0.159376459551 0)
(0.0871863568963 0.123810000712 0)
(0.0660642819951 0.088778111016 0)
(0.0433057240197 0.0540040877675 0)
(0.0179099320192 0.0207399285977 0)
(-0.000174063482173 -0.000956706724251 0)
(0.000123259038376 -0.00171177087077 0)
(0.000141857388572 -0.00149266703151 0)
(3.74769105092e-05 -0.00156256007972 0)
(-5.28508869077e-06 -0.0016585330645 0)
(-8.1379650026e-06 -0.00171593958899 0)
(-1.35089693506e-06 -0.00171073608766 0)
(0.000125637233844 -0.00193294922901 0)
(0.000312451604289 -0.00251368370915 0)
(0.000276050011476 -0.00283376643007 0)
(0.000302608853746 -0.00285510777265 0)
(0.000535904907759 -0.002699932434 0)
(0.000932735281344 -0.00275196037729 0)
(0.00158117230959 -0.00334884815533 0)
(0.000860036826916 -0.00352277198971 0)
(-8.05425520683e-05 -0.0029033789118 0)
(8.75898209914e-05 -0.00264291829277 0)
(0.000190480374567 -0.00182690823251 0)
(0.000734710196421 -0.00169809988313 0)
(0.00089341218857 -0.00200112911356 0)
(-0.000290311887004 -0.00527735158741 0)
(-0.00286395737123 -0.0106400926466 0)
(-0.00477381051438 -0.0116057711029 0)
(-0.00599671087113 -0.00829482957992 0)
(-0.00444593119208 -0.00466645678616 0)
(-0.00609203640821 -0.0049787017535 0)
(-0.00197023429855 -0.00141959952705 0)
(-0.00191573285237 -0.00137029573772 0)
(-0.00139985795857 -0.0013154328471 0)
(-0.00114341457396 -0.00134418156237 0)
(-0.00092516975469 -0.00135693615562 0)
(-0.000739940771381 -0.00134323815917 0)
(-0.000586695480099 -0.00131624133054 0)
(-0.000468703637836 -0.00131881076415 0)
(-0.000352726642828 -0.00129963195654 0)
(-0.000251489664671 -0.00130208107928 0)
(-0.000159194338834 -0.00129113761477 0)
(-7.39253806788e-05 -0.00128752379741 0)
(1.02895348911e-05 -0.00127163224959 0)
(9.63583442022e-05 -0.00125441493733 0)
(0.000193153494928 -0.0012297184418 0)
(0.000319379893202 -0.00119963716357 0)
(0.000508827669605 -0.00114145288116 2.33173437315e-29)
(0.000653616211072 -0.00113670303574 0)
(0.000666865210158 -0.00203659954405 -5.03076571845e-29)
(0.000569401519612 -0.0839471094021 0)
(-0.0067905645567 -0.0366327072512 0)
(0.0194428198503 0.151488884806 0)
(0.0319039060705 0.292924169148 0)
(0.0477116040805 0.365996404385 0)
(0.0587283061177 0.39992552345 0)
(0.0675634650672 0.413435769481 0)
(0.0745799494163 0.41717896202 -5.12360732647e-29)
(0.0807452533208 0.416650917064 5.06432893322e-29)
(0.0865030500263 0.414483375335 0)
(0.0921114327907 0.411792386466 0)
(0.0976724362069 0.40898452593 0)
(0.103219500215 0.406161253513 0)
(0.10874851997 0.403305821864 0)
(0.114238504105 0.400360809417 0)
(0.119664665051 0.397256265775 0)
(0.124994814199 0.393914681526 0)
(0.130198080656 0.390251977903 0)
(0.135227927292 0.386163147993 0)
(0.140038532834 0.381519445495 0)
(0.144548891427 0.376126534059 0)
(0.14866673031 0.369663661484 0)
(0.152181917471 0.361203935669 0)
(0.154552824537 0.349280407278 0)
(0.154993686473 0.332532695656 0)
(0.152729444597 0.31030494997 0)
(0.147212833507 0.282793341086 0)
(0.138204792711 0.250842794964 0)
(0.125750473138 0.215648036024 0)
(0.110107323818 0.178496440387 0)
(0.0916944199583 0.14060148803 0)
(0.0710021152468 0.102932836394 0)
(0.0486196764007 0.0665472661216 0)
(0.0244711797479 0.0303438722251 0)
(-0.000143736995256 -0.000770679580117 0)
(-0.000122885161084 -0.0014517997495 0)
(-2.48360252339e-05 -0.00153537498143 0)
(-2.35802031067e-06 -0.00154634613608 0)
(-3.17865806894e-05 -0.00160403331037 0)
(-4.03434408205e-05 -0.00166408048619 0)
(-2.6469093702e-05 -0.00170218053674 0)
(-7.60231550381e-06 -0.00172422358123 0)
(0.000134909862939 -0.00161029221653 0)
(0.000402110230384 -0.00253117800224 0)
(0.000208301214154 -0.00310074549734 0)
(2.34710811158e-05 -0.00265954811163 0)
(0.000344962028304 -0.00231159959278 0)
(0.000926693321615 -0.00211065339254 0)
(0.00130187464959 -0.00239027351337 0)
(0.00404709800963 -0.00746954513151 0)
(0.000490620456016 -0.0022174442872 0)
(0.000102341767717 -0.00191602481185 0)
(2.62242545852e-05 -0.00140134656377 0)
(3.70363727845e-05 -0.00100438265923 0)
(1.28627223359e-05 -0.00694706682788 0)
(-0.00377246122148 -0.00892039445518 0)
(-0.00594530137353 -0.0114809400487 0)
(-0.00671904393555 -0.0110048200372 0)
(-0.00704076003679 -0.00765839669365 0)
(-0.00627599642281 -0.00534258296131 0)
(-0.00151642609984 -0.000720695693622 0)
(-0.00173561127401 -0.000627687324952 0)
(-0.00133054877438 -0.000883088745751 0)
(-0.00112670075015 -0.00103330161256 0)
(-0.000917428626303 -0.00112026323454 0)
(-0.000727301995336 -0.00115595737318 0)
(-0.000574901646483 -0.00118547783574 0)
(-0.000445822089072 -0.00119682103641 0)
(-0.000332431895435 -0.0011914235873 0)
(-0.00023628844575 -0.00120686375462 0)
(-0.000148348904291 -0.00120819833671 0)
(-7.11825451761e-05 -0.00121519878682 0)
(-2.39158206537e-07 -0.00120254740265 0)
(6.61238557725e-05 -0.00119786274236 0)
(0.000132331525967 -0.00118003110161 0)
(0.00020897584662 -0.00113726030851 0)
(0.000311115879154 -0.00106079645175 0)
(0.000475699673439 -0.000927808096418 -2.4605130622e-29)
(0.000398275811355 -0.000754166365604 0)
(0.00170403268907 -0.0064051198903 0)
(-0.00143492815075 -0.0867028961327 0)
(0.000174629515981 -0.00204396689305 0)
(0.0219396476399 0.167641958034 0)
(0.0345069636844 0.308747642399 0)
(0.0494663452198 0.378597791983 0)
(0.05924276253 0.409407775651 0)
(0.0670584504185 0.420819029607 0)
(0.0733000366953 0.423404342795 0)
(0.0789271248342 0.422340757743 0)
(0.0843091268128 0.419976733475 0)
(0.0896474205173 0.417239431023 0)
(0.0949986864458 0.414432479377 0)
(0.100369776294 0.411609662034 0)
(0.105741649355 0.408734798116 0)
(0.111084536921 0.405743173076 0)
(0.116368800378 0.402561361424 0)
(0.121557648029 0.399108210671 0)
(0.126618552135 0.395294477219 0)
(0.131499119985 0.391004912568 0)
(0.136152721824 0.386096633983 0)
(0.140486560229 0.380345395875 0)
(0.144403938403 0.373370441694 0)
(0.147654209925 0.363981480992 0)
(0.149571209721 0.350405020738 0)
(0.149251628759 0.331179573189 0)
(0.145879362317 0.305808195162 0)
(0.138949857035 0.274789871235 0)
(0.128318410695 0.239282146499 0)
(0.114135843498 0.200730774539 0)
(0.0967472177083 0.160583721025 0)
(0.0766345635092 0.120095262638 0)
(0.0542389428999 0.0800735082579 0)
(0.0299838429929 0.0422926768428 0)
(0.000306818430264 0.000254667671572 0)
(-0.000247468689883 -0.00115299506555 0)
(-9.92896012095e-05 -0.00135380567116 0)
(-7.6465710564e-05 -0.00149322898383 0)
(-7.04406440064e-05 -0.00155903134247 0)
(-7.52151502431e-05 -0.00161421812002 0)
(-6.35162547268e-05 -0.00165891901896 0)
(-4.15473129279e-05 -0.00168644278308 2.64362100458e-29)
(-1.53653745816e-05 -0.00169670618839 0)
(0.00022477164723 -0.00120790174588 0)
(0.000591026349203 -0.00182965057376 0)
(-0.00017492788389 -0.00260237133009 0)
(-0.00073174918629 -0.00234671842712 0)
(-5.36890832219e-05 -0.00177022754287 0)
(0.000601069424044 -0.00139094282981 0)
(0.000712823556124 -0.00107667717873 0)
(0.00409707664282 -0.00717941905261 0)
(0.00365579680254 -0.00756448227527 0)
(0.00130903326559 -0.00468674970634 0)
(0.00181622511018 -0.00339259147548 0)
(-8.29611937512e-05 -0.000617946211431 0)
(-0.00335416803619 -0.00713390190348 0)
(-0.0064415951004 -0.0111318657926 0)
(-0.00750301870037 -0.0119803880145 0)
(-0.00736597568115 -0.010336410522 0)
(-0.00578886600636 -0.00627659060584 0)
(-0.000968789946536 -0.000477596715169 0)
(-0.00111854023646 -0.000228535348764 0)
(-0.000977515668225 -0.000465378238783 0)
(-0.000938084286381 -0.000694228520132 0)
(-0.000793189711761 -0.000833440371539 0)
(-0.000658489058082 -0.000934497304172 0)
(-0.000523989154574 -0.00100444975282 0)
(-0.000404637254975 -0.00105390528977 0)
(-0.000296461503161 -0.00107679272447 0)
(-0.000205392583761 -0.00110746726485 0)
(-0.000121911152158 -0.00111533193783 0)
(-5.07974048685e-05 -0.00113897023559 0)
(1.08810961422e-05 -0.00114452756823 0)
(6.30882044885e-05 -0.00115401476551 0)
(0.000105742530981 -0.00114562299612 0)
(0.000143264170097 -0.00112814071581 0)
(0.00018082609793 -0.00107140366119 0)
(0.000218068520435 -0.000979212105031 0)
(0.000256182249565 -0.000843154853441 0)
(0.000202236846927 -0.000575723027151 0)
(0.000307888015608 -0.00117090793001 0)
(0.00961195423494 -0.0857806773977 0)
(0.000570098315047 -0.00155002239062 0)
(0.0211313189588 0.184882840145 0)
(0.0353710842964 0.324358173887 0)
(0.0501267791684 0.390291860899 0)
(0.058968260684 0.417908395121 0)
(0.0659720646941 0.427398409191 0)
(0.0716092137694 0.429050901261 0)
(0.0768325146725 0.427631113694 0)
(0.081932921503 0.425187520886 0)
(0.0870646300126 0.422472660038 0)
(0.092248108013 0.419704790801 0)
(0.0974708138613 0.416903013788 0)
(0.102704073869 0.414019566675 0)
(0.107912969549 0.410986663603 0)
(0.113065401986 0.407729331948 0)
(0.11812120091 0.404163521722 0)
(0.123047562419 0.400194744785 0)
(0.127785754573 0.395696544115 0)
(0.132290024935 0.39051051312 0)
(0.136453068296 0.384377889504 0)
(0.140176212545 0.376847036511 0)
(0.143158181676 0.366390537606 0)
(0.144581545966 0.35089427242 0)
(0.143422705109 0.328847710457 0)
(0.138844090559 0.300001457011 0)
(0.130410309697 0.265226628673 0)
(0.118093859987 0.226026742235 0)
(0.102170391578 0.184111608591 0)
(0.0831172851576 0.141078468699 0)
(0.0615486437024 0.098103494801 0)
(0.0375037316236 0.0553411800627 0)
(0.00736024442688 0.0153002461555 0)
(-0.000227632853187 -0.000963636641029 0)
(0.00020074350615 -0.00125223128511 0)
(-2.21436151902e-05 -0.001387744381 0)
(-7.04226267563e-05 -0.00149867129529 0)
(-8.78843335555e-05 -0.00156770966669 0)
(-9.00895336246e-05 -0.00160241193753 0)
(-7.05015683338e-05 -0.00162991031432 0)
(-4.44014201105e-05 -0.00166075971496 -2.40142938641e-29)
(-1.76082993806e-05 -0.00166643715788 0)
(0.000116515848812 -0.000660289647006 0)
(0.000562382142176 -0.00261308493062 0)
(-0.00176445052009 -0.00649215665671 0)
(-0.000763043234813 -0.00188615210066 0)
(-0.000283215913282 -0.00114306199094 0)
(0.000192328598839 -0.00084991205853 0)
(0.000310277891844 -0.000512502001713 0)
(0.000797823855242 -0.0015961784575 0)
(0.0041216892053 -0.00773835985353 0)
(0.000489250085654 -0.00116272330591 0)
(0.000364847389785 -0.00127507362367 0)
(-0.00356915510506 -0.00676763829152 0)
(-0.00683040519874 -0.0109295310295 0)
(-0.00789619840124 -0.0119398086698 0)
(-0.00832086337608 -0.0124083536842 0)
(-0.00660021719713 -0.0091439673612 0)
(-0.000681143925754 -0.000827205035681 0)
(-0.000501371395739 -0.000231802947745 0)
(-0.00058229435318 -0.000298832337029 0)
(-0.000636556475723 -0.000456486229829 0)
(-0.000591210092873 -0.000600205489286 0)
(-0.000532132788957 -0.00073587315696 0)
(-0.000433142716179 -0.000819729914137 0)
(-0.000335576359095 -0.000890532868421 0)
(-0.000243639161964 -0.000955313735685 0)
(-0.000156394659827 -0.000993280628473 0)
(-7.82299549397e-05 -0.00101646295928 0)
(-1.05328153241e-05 -0.00105115023798 0)
(4.66871908807e-05 -0.00107417890556 0)
(9.25815297481e-05 -0.00110148823897 3.21000817476e-29)
(0.000124749313338 -0.0011083443936 0)
(0.000144685056415 -0.00112347252879 0)
(0.000151370365236 -0.00111168168202 0)
(0.00014004745249 -0.00105254166811 0)
(0.000118288685783 -0.000974340126123 0)
(0.000109048503529 -0.000803372002976 0)
(0.000262461965128 -0.000513037665728 0)
(-0.000197571878314 -0.000468365728266 -2.74272237503e-29)
(0.014079454441 -0.0776755487768 2.93804448402e-28)
(0.00102159687142 -0.000240570341086 0)
(0.0246321642832 0.20055466604 0)
(0.0361400716742 0.339196862133 0)
(0.0499616118519 0.400976200237 0)
(0.0579327355494 0.425527964354 0)
(0.0642932885579 0.433333675797 0)
(0.0694894622563 0.434266700002 0)
(0.0744458081097 0.432637260032 0)
(0.0793619793444 0.430197458402 0)
(0.0843526901937 0.427547203858 0)
(0.0894121454625 0.424838107065 0)
(0.094515863824 0.422065984008 0)
(0.0996307677841 0.419177368911 0)
(0.104720412893 0.416104084203 0)
(0.10975263015 0.412770449606 0)
(0.114685137566 0.409089588654 0)
(0.119486377193 0.404961143656 0)
(0.124090588964 0.400246137891 0)
(0.128455153325 0.394768876318 0)
(0.132454641695 0.388230731123 0)
(0.135992304813 0.380096361514 0)
(0.138703236817 0.368408131296 0)
(0.139587659886 0.350685573509 0)
(0.137504446125 0.3254456298 0)
(0.131619221134 0.29278810379 0)
(0.121591116368 0.254022616959 0)
(0.1075220187 0.211021376434 0)
(0.0898170352888 0.165765707493 0)
(0.0691489199854 0.120020392772 0)
(0.0463367099731 0.0750627847513 0)
(0.0203218416898 0.0303273745163 0)
(-0.0003277585984 -0.000954071888521 0)
(-4.60123664339e-05 -0.00162609436093 0)
(3.87156856896e-06 -0.00142323602698 0)
(-4.95409560898e-05 -0.00146008163929 0)
(-7.49692690467e-05 -0.00151901090374 0)
(-8.13796695439e-05 -0.00156480167768 -2.04713666829e-29)
(-7.85291460406e-05 -0.00158517653688 0)
(-6.11372276352e-05 -0.00157481347733 0)
(-3.4910715206e-05 -0.0016252023155 0)
(-1.0543125831e-05 -0.00159894126821 0)
(1.94436790741e-05 -0.000226192166262 0)
(9.50719115611e-05 -0.00474596825424 0)
(-0.00174421896159 -0.00638400081675 0)
(-0.000466112921173 -0.00096727575263 0)
(-0.000157696781718 -0.000564463381893 0)
(0.000120243990423 -0.00051568380661 0)
(0.0003415376977 -0.000423698568423 0)
(0.000260870514251 -0.000700426434607 -4.13224375581e-29)
(0.00326509329122 -0.00771076602985 2.46284421276e-28)
(0.00230361514739 -0.00645480479334 0)
(-0.00143430175975 -0.00666426993702 0)
(-0.00558040401787 -0.00983634002093 0)
(-0.00820271316956 -0.012310481085 0)
(-0.00855511841933 -0.0119913897243 0)
(-0.00745076570083 -0.0104084356271 0)
(-0.0010010161954 -0.00178668821106 0)
(-0.000184347796039 -0.00039494446707 0)
(-0.000303047097782 -0.000336271458338 0)
(-0.000333249401195 -0.000355979080438 0)
(-0.000360616062272 -0.000451862306245 0)
(-0.00035338694458 -0.000572141141931 0)
(-0.000301076763912 -0.000656374697794 0)
(-0.000235488739317 -0.000729967475997 0)
(-0.000165370181852 -0.000805480998498 0)
(-9.18708826865e-05 -0.000868570779664 0)
(-2.02716916883e-05 -0.000910793642049 0)
(4.51792889251e-05 -0.000957275753448 0)
(0.0001012678013 -0.000987109416069 0)
(0.000147894450296 -0.00103280397041 0)
(0.000180775461165 -0.00106490239671 -3.15218901081e-29)
(0.000200609734424 -0.00110162941916 0)
(0.000198688720387 -0.00112361686481 0)
(0.00016809968547 -0.00112723074082 0)
(9.82703441439e-05 -0.00111630266767 0)
(-1.56804540646e-05 -0.00104839333001 0)
(-0.000164030980957 -0.000845340133261 0)
(-0.000220489615436 -0.000421913804063 0)
(-0.000721760829258 0.000443642708787 0)
(0.0144878842962 -0.0649728140757 0)
(0.0013619547353 0.00018645810465 0)
(0.0257935409297 0.215749998023 0)
(0.0360467837845 0.353160109179 0)
(0.048764314914 0.410635057186 0)
(0.056024212684 0.43240429577 0)
(0.0619887410439 0.438813343827 0)
(0.0669374268506 0.439216662335 0)
(0.071771394054 0.437481715976 0)
(0.0766018208958 0.43509096425 0)
(0.0815156143068 0.432519275983 0)
(0.0864929884522 0.429869717189 0)
(0.0915058335391 0.427123855307 0)
(0.0965219436014 0.424226145563 0)
(0.101506916207 0.421109067911 0)
(0.106430776677 0.41769596613 0)
(0.111250370268 0.413896543029 0)
(0.11593693848 0.409603374179 0)
(0.12041672058 0.404663356015 0)
(0.124653111731 0.398881305362 0)
(0.128497768054 0.391912669241 0)
(0.131861696874 0.383123361296 0)
(0.134299656842 0.37000863072 0)
(0.134593865074 0.349710874721 0)
(0.131496391576 0.320879689129 0)
(0.124207046481 0.284076630121 0)
(0.112506045186 0.241109713888 0)
(0.0966335526162 0.194220325654 0)
(0.0771007221999 0.14560682108 0)
(0.0546180620993 0.0970683279544 0)
(0.0297750839289 0.0501695235329 0)
(0.000184077555798 0.000274608884747 0)
(-0.000321658467064 -0.00129755213309 0)
(-8.34807818838e-05 -0.00141315886538 0)
(-4.12571290113e-05 -0.00143092605295 0)
(-5.51871725277e-05 -0.0014780237107 0)
(-6.41792382055e-05 -0.00152389328021 -1.88432978957e-29)
(-6.19157869926e-05 -0.00155872597511 1.94617143533e-29)
(-5.36460629233e-05 -0.00158178201846 0)
(-4.32937760792e-05 -0.00156107659575 0)
(-2.31184930198e-05 -0.00159177314392 0)
(-3.58657022937e-06 -0.00160625236757 0)
(-1.10718909058e-06 -0.000153082016732 0)
(-0.000316906665328 -0.0051477195664 0)
(-0.00113930893113 -0.00584067148441 0)
(-6.66789270869e-05 -0.000301915325476 0)
(-2.32036472067e-05 -0.000272254155819 0)
(0.000114644626056 -0.000313611152656 0)
(0.000227977372761 -0.000290522251008 0)
(4.95425858468e-05 -0.000263282314168 0)
(0.00195915388281 -0.00658582302159 0)
(0.00263996608173 -0.00860563212099 0)
(-0.00228761876135 -0.0103105488887 0)
(-0.00630218057083 -0.0130874354468 0)
(-0.0090131544232 -0.0144951586258 0)
(-0.00825079571008 -0.012575316703 0)
(-0.00434737604561 -0.00727381847469 0)
(-1.35592058847e-06 -0.000547183734967 0)
(-0.000200019837019 -0.000344294443172 0)
(-0.000157314222498 -0.000340074288133 0)
(-0.00016395346989 -0.000365859647898 0)
(-0.000181561550979 -0.000465560935513 0)
(-0.000157288624757 -0.000535645536118 0)
(-0.000119453297997 -0.000606986524506 0)
(-7.22441273275e-05 -0.000671466957282 0)
(-1.59143188254e-05 -0.000738588276867 0)
(4.66650436675e-05 -0.000804241498361 0)
(0.000108855028239 -0.000852069255341 4.20824824955e-29)
(0.000165769201522 -0.000891479504123 0)
(0.000217355315619 -0.000946056651892 0)
(0.000256434806282 -0.00099338676564 0)
(0.000287674994992 -0.00105027434454 0)
(0.000297683159126 -0.00108973999494 0)
(0.000281881949666 -0.0011485143898 0)
(0.00021584041911 -0.00120245916749 0)
(8.56685087529e-05 -0.0012531682388 0)
(-0.000140981173316 -0.00125930299594 0)
(-0.000516231911398 -0.00115696371342 0)
(-0.00110255379513 -0.000698952333868 0)
(-0.00129787601282 0.000604652509139 0)
(0.0121816707397 -0.0495210439852 0)
(0.00156045812364 0.000347760842081 0)
(0.0235551918846 0.229715330597 -9.82152255917e-29)
(0.0344240994061 0.366365652296 6.17753085887e-29)
(0.0462896179658 0.419567575199 0)
(0.053156976047 0.438846507621 0)
(0.0590628522067 0.444100285331 0)
(0.0639895963395 0.444092358062 0)
(0.0688459250645 0.442292217477 0)
(0.0736819073842 0.439950098191 0)
(0.0785746619328 0.437441140344 0)
(0.0835048579399 0.434833376854 0)
(0.0884497292586 0.432099290165 0)
(0.0933830572531 0.429182145139 0)
(0.0982757662676 0.426014363373 0)
(0.10310197481 0.422516928079 0)
(0.107818749481 0.418594893843 0)
(0.112401544231 0.414131998358 0)
(0.116767273862 0.408959198348 0)
(0.120888878683 0.402859117664 0)
(0.124588814189 0.395434610641 0)
(0.127794167351 0.385935275807 0)
(0.129957872058 0.371163243317 0)
(0.129603575598 0.347896687154 0)
(0.125397375239 0.315055705581 0)
(0.116609814592 0.273785144181 0)
(0.103173475631 0.226444724761 0)
(0.085507918838 0.175624585572 0)
(0.0642956400529 0.123674550045 0)
(0.0400639467537 0.0724218365395 0)
(0.00975682589529 0.0237724673363 0)
(-0.000296861268079 -0.000911757874617 0)
(0.000200490010064 -0.00130396248914 0)
(7.98969834653e-06 -0.00140036101257 0)
(-2.27548947596e-05 -0.00144576980424 -1.71126125445e-29)
(-4.31764142091e-05 -0.0014895396749 0)
(-4.96187447569e-05 -0.00152611632075 1.82125377631e-29)
(-4.63672419899e-05 -0.00155448141989 0)
(-3.70567075247e-05 -0.00157583823642 0)
(-2.8865899265e-05 -0.00156946220468 0)
(-1.85196675888e-05 -0.00158374495052 0)
(-5.13619531952e-06 -0.0016067006693 0)
(-0.000109855989451 -0.000237859602978 0)
(-0.0014632955366 -0.00539709424525 0)
(-0.000706329250717 -0.00516933821448 0)
(6.06944335317e-05 -9.76057278955e-05 0)
(6.72927755318e-05 -0.000172019775587 0)
(0.00012405108241 -0.000234566378551 0)
(0.000147286100924 -0.000273952500353 0)
(-1.77277051955e-05 -0.000326191496555 0)
(0.000346662803035 -0.00171785833162 0)
(0.00295068228609 -0.0105711253297 0)
(-0.00183622687076 -0.0137180302102 0)
(-0.00461662962905 -0.0155188027476 0)
(-0.00656713077785 -0.0144330943198 0)
(-0.00163458992419 -0.00222430755743 0)
(-0.000398490975006 -0.00107560003457 0)
(0.000299311034828 -0.000368340882931 0)
(-9.69905368667e-06 -0.000366856099336 0)
(-3.36447822963e-05 -0.000361520653842 0)
(-4.60550537961e-05 -0.000390755971592 0)
(-3.87160537218e-05 -0.000441527575143 0)
(-1.2725088646e-05 -0.000495139129576 0)
(2.33822432488e-05 -0.00056990673647 0)
(6.61477671846e-05 -0.000622824199986 0)
(0.000116294146031 -0.000682097935123 0)
(0.000174047724614 -0.000740707744067 0)
(0.000232159387296 -0.00078925109273 -4.11284126516e-29)
(0.000288704417684 -0.000844995078279 0)
(0.000335210356698 -0.000894913098458 0)
(0.000382502661536 -0.000966099526156 0)
(0.000413272631842 -0.00101812560859 0)
(0.000421832055894 -0.00108474002133 0)
(0.000400718989813 -0.00118892749039 0)
(0.000326427195075 -0.00131249275578 0)
(0.000162674831784 -0.00145294871788 0)
(-0.000155862782793 -0.00165688846597 0)
(-0.000741702537407 -0.00185459000978 0)
(-0.00213051246084 -0.00192148855113 0)
(-0.00214728683972 -0.00174261731748 0)
(0.00782398718967 -0.0350446552433 0)
(0.00180427072847 -0.0017325806696 0)
(0.0173304349344 0.242605142788 0)
(0.0307935777151 0.379477553633 0)
(0.0425283434748 0.428425417795 0)
(0.0494285573294 0.44532323741 0)
(0.0556308486422 0.449504606537 0)
(0.0607542746411 0.449087670139 0)
(0.0657522645395 0.447183956245 0)
(0.070660844587 0.444842110264 0)
(0.0755695307481 0.442352522741 0)
(0.0804735871244 0.439753461201 0)
(0.0853636903145 0.437008376783 0)
(0.0902237488446 0.434057265513 0)
(0.0950325138307 0.430830063167 0)
(0.0997693581156 0.427243020605 0)
(0.104392364692 0.423194799988 0)
(0.108882244933 0.418558016015 0)
(0.113144891576 0.41314581096 0)
(0.117166942106 0.406715314463 0)
(0.120733538678 0.39880969649 0)
(0.12379926987 0.388541733167 0)
(0.125687648378 0.371838870317 0)
(0.124617844659 0.345163007514 0)
(0.119202766039 0.307878687495 0)
(0.108823589615 0.261841138239 0)
(0.0935993763886 0.209999893678 0)
(0.0741585186053 0.155231197238 0)
(0.05119754401 0.100029368248 0)
(0.0247427586944 0.0467388634354 0)
(-0.000133983505902 -0.00033756979961 0)
(-0.000190250365192 -0.00169471831616 0)
(1.12779228441e-05 -0.00143494332869 0)
(-9.0394537436e-06 -0.00144943600134 0)
(-2.40091012097e-05 -0.00146944365616 1.67845398221e-29)
(-3.63687928345e-05 -0.00149966333386 1.67596989526e-29)
(-4.04937545358e-05 -0.00152679181902 0)
(-3.79629863072e-05 -0.00154889504614 0)
(-3.0351619259e-05 -0.00156577326317 0)
(-2.24836303564e-05 -0.00155953002838 0)
(-1.71055571592e-05 -0.00157460623914 0)
(-7.21363162224e-06 -0.0015942648189 0)
(-0.00116010076494 -0.00254074527887 0)
(-0.00213226781025 -0.0056819980309 0)
(-0.000641991476694 -0.0042372388645 0)
(0.000121267810056 -0.000105566780842 0)
(0.000149132376367 -0.000140691080032 0)
(0.000163464461086 -0.00019603276209 0)
(0.000198989607283 -0.00026637684815 0)
(0.000245362624008 -0.000399898588935 0)
(0.000234283789265 -0.00121027857169 0)
(0.00212787105361 -0.0125802680502 0)
(-0.00136256867765 -0.016349668125 0)
(-0.00290146790072 -0.0171668466889 0)
(-0.00415810258233 -0.0147457457693 0)
(-0.00089817167698 -0.00734161430016 0)
(-0.000160672344298 -0.000897808847897 0)
(-0.000201461493025 -0.000555171018479 0)
(-1.39313328865e-05 -0.000352823338967 0)
(2.82489870622e-05 -0.000360481063548 0)
(5.20077682378e-05 -0.000383234003461 0)
(7.56392415774e-05 -0.000430538365719 0)
(0.000102743904979 -0.000473202073774 0)
(0.000139928284928 -0.000524271964288 0)
(0.000185548094115 -0.000577354989569 -5.44955030802e-29)
(0.000235523574908 -0.000628742229934 0)
(0.000292759641228 -0.000683058418378 0)
(0.000352191219863 -0.000735131325336 0)
(0.000407049882768 -0.000785854708619 0)
(0.000467410543817 -0.000857079671535 0)
(0.000514540994025 -0.000910483204021 0)
(0.000551202673987 -0.000977606901666 0)
(0.00057943298374 -0.00109153683936 0)
(0.000572454074167 -0.00122269507101 0)
(0.000526884617627 -0.0014035764274 0)
(0.000410236521706 -0.00166564675399 0)
(0.000164536240212 -0.00202802302125 0)
(-0.000297973628706 -0.00250957006051 0)
(-0.0012195531161 -0.00322289853436 0)
(-0.00303647130175 -0.0044351185182 0)
(0.000510570670525 -0.00822736071684 0)
(0.00264472027061 -0.00525496134301 0)
(0.00643220489551 0.257062799548 0)
(0.024978430134 0.393161258655 0)
(0.0379299841845 0.437933261903 0)
(0.0452616303051 0.452315068557 0)
(0.0519759278013 0.455291641697 0)
(0.057427610935 0.45434244434 0)
(0.0626218736627 0.452227007597 0)
(0.0676240018584 0.449800780349 0)
(0.072554529695 0.447269747189 0)
(0.0774328990977 0.444638545082 0)
(0.082267898931 0.441856779311 0)
(0.0870554356725 0.438856710902 0)
(0.09178314133 0.435562163271 0)
(0.096435664483 0.431881691786 0)
(0.100972479304 0.427705556923 0)
(0.105379987046 0.422892600836 0)
(0.109551066948 0.417236412264 0)
(0.113490738047 0.410464611957 0)
(0.11693659695 0.40205345804 0)
(0.119885933765 0.390954878087 0)
(0.121497558812 0.371996524465 0)
(0.119634015787 0.341421385303 0)
(0.112901786311 0.299251353321 0)
(0.100839641595 0.248179608876 0)
(0.0838065676102 0.191754873595 0)
(0.0626375456392 0.133032967692 0)
(0.0376067286114 0.074828987823 0)
(0.00731649995576 0.0203527340183 0)
(-0.000295162990621 -0.00106302504422 0)
(0.000132807691841 -0.0013941447024 0)
(4.07404034688e-05 -0.0014266065603 0)
(2.58640558104e-06 -0.00145966251929 0)
(-1.90662184125e-05 -0.00148150263785 0)
(-3.14219305886e-05 -0.00150491324335 -1.63387255399e-29)
(-3.56526177485e-05 -0.00152542075917 0)
(-3.41442670091e-05 -0.00154225284924 -1.63866230059e-29)
(-2.72814496996e-05 -0.00155453474559 0)
(-2.0611853422e-05 -0.00155190767529 0)
(-1.73956263918e-05 -0.00156710600098 0)
(-7.85219415719e-06 -0.00157331970872 0)
(-0.000824412434866 -0.00357935456794 0)
(-0.00222337051436 -0.00560103028845 0)
(-1.12782033652e-06 -0.000479411553473 0)
(0.000188609848296 -0.000149181262657 0)
(0.000178589234833 -0.000143616881461 0)
(0.000198843046623 -0.00017402885549 0)
(0.000226747787663 -0.000215047965663 0)
(0.000302305599928 -0.000294433213057 0)
(0.0002155257112 -0.000641819274509 0)
(0.00141622131537 -0.0136426766838 0)
(-0.00100432243377 -0.0180196050644 0)
(-0.00176606409008 -0.0180379542192 0)
(-0.00260397828535 -0.0139300142627 0)
(-9.67322617596e-05 -0.000904238110834 0)
(-0.00061048399136 -0.00220043203149 0)
(8.66948970252e-06 -0.000248976505606 0)
(5.41352628093e-05 -0.000282083429708 0)
(0.000102782841472 -0.000318759962977 0)
(0.000136644860943 -0.000352539938249 0)
(0.000169770602425 -0.000396125833427 0)
(0.000201767734949 -0.00043606639391 0)
(0.00024245480331 -0.000484529134071 0)
(0.000289449703977 -0.000528108628251 5.36157358899e-29)
(0.000343119391049 -0.000574287316893 0)
(0.000403588549879 -0.000624007107474 0)
(0.000462570316152 -0.000670461112954 0)
(0.000529965041827 -0.000732085139399 0)
(0.000590218753631 -0.000785113667016 0)
(0.000650250740567 -0.000850882716597 0)
(0.000711135329889 -0.000946282229918 0)
(0.000758497059551 -0.00106216293676 0)
(0.000798310076701 -0.00122264746852 0)
(0.000808763515581 -0.001434022187 0)
(0.000783659843509 -0.00173493012449 0)
(0.000725988485066 -0.00222267934722 0)
(0.000588989341597 -0.00294218928009 0)
(0.00034781857201 -0.00407247406748 0)
(-0.00018890736216 -0.00599697289954 0)
(0.000856716833181 -0.00989104250237 0)
(-0.00014321825279 -0.00558346945254 0)
(-0.000808848970791 0.272981882696 0)
(0.01848055525 0.407636506772 0)
(0.0333613238153 0.448482290754 0)
(0.0413388836355 0.46006642844 0)
(0.0485234369671 0.461550362177 0)
(0.0542687988732 0.459872917267 0)
(0.0596133376957 0.457411048833 0)
(0.0646675499834 0.454809137652 0)
(0.0695872695428 0.452177260339 0)
(0.0744165811813 0.449477165198 0)
(0.079181244439 0.446637565602 0)
(0.0838876722085 0.443577845566 0)
(0.0885315366582 0.440211943508 0)
(0.0931014341071 0.436437829322 0)
(0.0975582123825 0.432135447715 0)
(0.101893580244 0.427147079341 0)
(0.105985362959 0.421245375807 0)
(0.109861991163 0.414123575851 0)
(0.11320101007 0.405184110363 0)
(0.116062224464 0.393189752556 0)
(0.117395012801 0.371589951132 0)
(0.114644967989 0.336573893882 0)
(0.106475162698 0.28907329917 0)
(0.0926419784788 0.232734486533 0)
(0.0738007616304 0.171676885939 0)
(0.0508064357236 0.109066332022 0)
(0.0231072562141 0.04859287306 0)
(-0.000162594950834 -0.000446441782626 0)
(-0.000133152937618 -0.00153079678521 0)
(-1.52152930661e-05 -0.00145499727595 0)
(-1.14010944913e-05 -0.00146484275058 0)
(-1.87169329073e-05 -0.00147792524595 0)
(-2.73244448614e-05 -0.00149300820707 0)
(-3.38984564182e-05 -0.00150884922729 0)
(-3.58880145961e-05 -0.00152346048464 0)
(-3.43899291339e-05 -0.00153515189119 1.61188919147e-29)
(-2.83208959617e-05 -0.00154286949498 0)
(-2.19464416318e-05 -0.00154719589101 -1.59795605594e-29)
(-1.78872832573e-05 -0.00155928379232 0)
(-7.73462349044e-06 -0.00155748920326 0)
(-2.09873892564e-05 -0.00427129145244 0)
(-0.000236861140988 -0.00608184551539 0)
(8.88225907295e-05 -0.000379369972059 0)
(6.34063400535e-05 -7.46742649629e-05 0)
(0.000179176348088 -0.000105774347458 0)
(0.000223117386872 -0.00014263731115 0)
(0.000255731608864 -0.00018169611721 0)
(0.00030249916671 -0.000220137290687 0)
(0.00017874137863 -0.000395098590131 0)
(0.000942308804636 -0.0141580143628 0)
(-0.000701187035205 -0.0190076748576 0)
(-0.00105914008548 -0.0185686109774 0)
(-0.00175966869319 -0.0136892044631 0)
(-0.000651093585106 -0.0033977134577 0)
(5.94978884665e-05 -0.000177880532167 0)
(0.000134258583099 -0.000172812515975 0)
(0.000156329566821 -0.000252768257981 0)
(0.000179904981612 -0.000280817709379 0)
(0.000208754537843 -0.000314764746238 0)
(0.000247613025618 -0.000361791133506 7.34670240601e-29)
(0.000288619315657 -0.000404617099284 0)
(0.000332567939877 -0.000440399509473 0)
(0.000379448781671 -0.000472405888794 0)
(0.000441177560305 -0.000517327473385 0)
(0.000501440376867 -0.000558116343086 0)
(0.000569906968147 -0.000606358200126 0)
(0.000641027541765 -0.000657983295903 0)
(0.000715989649188 -0.000717945508985 0)
(0.000792442789109 -0.000787995443239 0)
(0.000870373064347 -0.000877587199797 0)
(0.000958257233011 -0.00100238997757 0)
(0.00103303557827 -0.00115418373052 0)
(0.00111984223002 -0.0013851754578 0)
(0.00122975286034 -0.0017369629122 0)
(0.0013612815755 -0.00222048598526 0)
(0.00156722716235 -0.00293370531999 0)
(0.0018901384131 -0.00403286595396 0)
(0.00276230285287 -0.00606919770294 0)
(-1.18788179256e-05 -0.0072300626877 0)
(-0.0475819398186 -0.00664505680912 0)
(0.000962918800556 0.298983166403 0)
(0.0136168991834 0.423760707368 0)
(0.0298297090537 0.459859799179 0)
(0.0383812825201 0.468330129098 0)
(0.045716997525 0.468081691963 0)
(0.0515246463847 0.465531137866 0)
(0.0568645414385 0.462632337512 0)
(0.0618694434143 0.459796606776 0)
(0.0667114106884 0.45702803251 0)
(0.0714480954811 0.454238915072 0)
(0.0761149160321 0.451332213319 0)
(0.0807240767314 0.44821094897 0)
(0.0852767908922 0.444776498531 0)
(0.0897631317672 0.440914145163 0)
(0.0941451762433 0.436492034531 0)
(0.0984186277109 0.431333190949 0)
(0.102444617088 0.425188465812 0)
(0.106279987269 0.417710785054 0)
(0.109527509135 0.408222737004 0)
(0.112334838718 0.395264330634 0)
(0.113385700257 0.370563650079 0)
(0.109638178988 0.330513920611 0)
(0.0998994885945 0.277246950579 0)
(0.0842212253906 0.215438918378 0)
(0.0635402250436 0.149714280641 0)
(0.0383125022622 0.0834343035284 0)
(0.00746939110473 0.0219350186421 0)
(-0.000345020165492 -0.00127561884559 0)
(9.09966888609e-05 -0.00144435556209 0)
(-8.9153759825e-06 -0.00145935704055 0)
(-2.67725297615e-05 -0.00147316205115 0)
(-3.4479525042e-05 -0.0014840189252 0)
(-3.92989464769e-05 -0.00150008660254 0)
(-4.1936156113e-05 -0.00151205775298 0)
(-4.12827360696e-05 -0.00152335347951 0)
(-3.79136558033e-05 -0.00153224249 0)
(-3.28614217311e-05 -0.00153194562267 0)
(-2.74213717198e-05 -0.00153895203337 1.60958681813e-29)
(-2.07609623218e-05 -0.00155334528528 0)
(-8.34508924203e-06 -0.00154398744995 0)
(0.000278314705472 -0.00417617644061 0)
(0.000632786099953 -0.00556192951696 0)
(0.000969423479036 -0.00152138345167 0)
(0.000126771451758 1.82370240428e-05 0)
(0.000243596433853 -5.95083689804e-05 0)
(0.000261101071035 -0.000111544660235 0)
(0.000281278703479 -0.00015315669823 0)
(0.000309611315397 -0.000191913173838 0)
(0.000173042310183 -0.000347597829889 0)
(0.000658082872044 -0.0144301265305 0)
(-0.000413622790873 -0.0196059896441 0)
(-0.000558001013682 -0.0189539248608 0)
(-0.0013326879111 -0.0134408134363 0)
(8.30673011369e-05 -0.00062617841414 0)
(0.000234701794879 -0.000265245024559 0)
(0.000225840369825 -0.000212422409001 0)
(0.00021580305732 -0.00021085566296 0)
(0.000247560375401 -0.000250969495079 0)
(0.000288132858062 -0.000298696474088 0)
(0.000313100935618 -0.00032242105419 -7.10863682739e-29)
(0.000351525782514 -0.000350578291988 0)
(0.000404745359107 -0.00038622989834 0)
(0.000466676086361 -0.000423771369494 0)
(0.000523928113747 -0.000454159965344 0)
(0.000587084817319 -0.000486848836499 0)
(0.000669621484611 -0.000535151260897 0)
(0.000748707952425 -0.000583920443008 0)
(0.000829088390213 -0.000633317680883 0)
(0.000921589998827 -0.000698518586172 0)
(0.00103105863238 -0.000790334053886 0)
(0.00113734083742 -0.000895784602754 0)
(0.00123715982609 -0.00103036346772 0)
(0.00141766197662 -0.00126720170605 0)
(0.00161903781631 -0.00155505704977 0)
(0.00192276670561 -0.00194089713171 0)
(0.00240152999337 -0.00246571108664 0)
(0.00348390460595 -0.00317368615555 0)
(0.00289480361511 -0.00449129111642 0)
(0.000602868169547 -0.0577840052045 0)
(-0.0348791022893 0.0150641783217 0)
(0.0060149329244 0.326473346593 0)
(0.0143645736476 0.439157692723 0)
(0.0288522301552 0.470879216615 0)
(0.0368970022555 0.476353301059 0)
(0.0437935561432 0.474439701343 0)
(0.0493125799695 0.471049232753 0)
(0.0544348722575 0.467725442762 0)
(0.0592598432756 0.464658944964 0)
(0.0639409921196 0.461755608294 0)
(0.0685318614394 0.458881637473 0)
(0.0730672596817 0.455914898045 0)
(0.0775591065033 0.452741789559 0)
(0.082011027671 0.449250311105 0)
(0.0864115910704 0.445312185177 0)
(0.0907242978915 0.440782852572 0)
(0.0949465756533 0.435463647969 0)
(0.098922288576 0.429083298893 0)
(0.102741015951 0.421247140457 0)
(0.105914234443 0.411193340361 0)
(0.10870876611 0.39719842772 0)
(0.109471179276 0.368847076961 0)
(0.104588866847 0.323119532058 0)
(0.0931457546582 0.263673536337 0)
(0.0755796460029 0.196246930738 0)
(0.0528641379719 0.125943961465 0)
(0.0246429432725 0.0563619210424 0)
(-0.000195444745914 -0.000406718410004 0)
(-0.000225553852644 -0.00162432637183 0)
(-5.4404905994e-05 -0.00148825414089 0)
(-5.49843147751e-05 -0.00148577439317 0)
(-5.68274812836e-05 -0.00148142544949 0)
(-5.85475676122e-05 -0.00149166683622 0)
(-5.91579439169e-05 -0.00150489965569 0)
(-5.87797742232e-05 -0.00151466460061 0)
(-5.56032966165e-05 -0.00152406023018 0)
(-4.94608068401e-05 -0.00153260930884 0)
(-4.24641755923e-05 -0.00153989789377 0)
(-3.34473417315e-05 -0.0015421669448 0)
(-2.11360243694e-05 -0.00154730552403 0)
(-7.17328433422e-06 -0.00152815264697 0)
(0.000230769823562 -0.00360411769862 0)
(0.0008257164373 -0.0047934316086 0)
(0.000904196095159 -0.00206714305056 0)
(0.00016341156866 1.97367017187e-06 0)
(0.000300330821512 -4.88438652095e-05 0)
(0.000296894381713 -9.6442119627e-05 0)
(0.00030632359881 -0.000136985089748 0)
(0.000311484712616 -0.000183466491727 0)
(0.000189719903408 -0.000447706001639 0)
(0.000489241465176 -0.0145321037679 0)
(-0.000125166791986 -0.0199302908796 0)
(-5.11042008276e-05 -0.0192665518444 0)
(-0.000489147832686 -0.0135969963387 0)
(0.000234107628387 -0.000529987971495 0)
(0.000255980150367 -0.000207133695681 0)
(0.000313437240083 -0.000210687724569 0)
(0.000303741837589 -0.000214699656751 0)
(0.000310519667831 -0.000227130982252 0)
(0.000342988252707 -0.000259026490978 0)
(0.00036730962676 -0.000281207940745 0)
(0.000427173945633 -0.000318762958062 0)
(0.000471126168109 -0.000336207695633 0)
(0.000522401660603 -0.000355264407209 0)
(0.000586617755075 -0.000381672857363 0)
(0.000674555863146 -0.000418696213528 0)
(0.000748865648675 -0.000451643609051 0)
(0.000831773181398 -0.000491356095823 0)
(0.000935685478003 -0.000541565096642 0)
(0.00104237586549 -0.000598256100237 0)
(0.00115826184499 -0.000667758167404 0)
(0.00127882870991 -0.000757308427367 0)
(0.00143687621633 -0.000889930299129 0)
(0.00164548474229 -0.00106621906919 0)
(0.00190343835768 -0.00127732378798 0)
(0.00227188476422 -0.00152262775483 0)
(0.00279979438087 -0.0017858786117 0)
(0.00387971102221 -0.00200112171637 0)
(0.00268730968052 -0.00203617055177 0)
(0.00840594176881 -0.0738438725499 0)
(-0.00929162311259 -0.0435894063386 0)
(0.0122552065393 0.343442639855 0)
(0.0187614103565 0.451802823411 0)
(0.0300800557646 0.480276345224 0)
(0.0366454850174 0.483367228651 0)
(0.0426157640066 0.480177793811 0)
(0.0475594790708 0.476162646908 0)
(0.0522823811557 0.472526690667 0)
(0.056811438936 0.469291686963 0)
(0.061255584693 0.466292272813 0)
(0.065650439177 0.463361591189 0)
(0.0700219091002 0.460358325527 0)
(0.0743766768764 0.457155038892 0)
(0.0787182699461 0.453627304021 0)
(0.0830310335578 0.449633634854 0)
(0.0872809288645 0.445016336071 0)
(0.0914639105292 0.439552979575 0)
(0.0954079526894 0.432950228768 0)
(0.0992381167883 0.424756881069 0)
(0.102357577381 0.414123892044 0)
(0.10518952855 0.399013748595 0)
(0.105650953305 0.366348272299 0)
(0.0994574008904 0.314235288801 0)
(0.0861558595341 0.248191000652 0)
(0.0666311511563 0.175021942878 0)
(0.0415170595839 0.100727314615 0)
(0.00968988094899 0.0292088830001 0)
(-0.000456677689874 -0.00120494527269 0)
(-2.47097063052e-06 -0.00145602444345 0)
(-7.59928181966e-05 -0.00147017245199 0)
(-8.64657968076e-05 -0.00148164613343 0)
(-9.02726535679e-05 -0.00148514849855 0)
(-9.0802979284e-05 -0.00148880652594 0)
(-8.930445679e-05 -0.0015055054976 0)
(-8.54707305141e-05 -0.00151304816499 0)
(-7.8828618506e-05 -0.00151909986376 0)
(-6.91875880575e-05 -0.00152377384129 0)
(-5.65534693541e-05 -0.00152671759057 0)
(-3.95262175848e-05 -0.00152444772662 0)
(-1.96786951671e-05 -0.00153240518005 0)
(-4.66611254466e-06 -0.00151617191988 0)
(7.02874729946e-05 -0.00310865859668 0)
(0.000813214625114 -0.00412917581223 0)
(0.000905675822936 -0.00274900710356 0)
(0.000186271979677 -3.17053078379e-05 0)
(0.000337245397778 -5.11342137079e-05 0)
(0.000327183678237 -9.06051270256e-05 0)
(0.00033420726234 -0.00012633448798 0)
(0.000343725585387 -0.000178941820145 0)
(0.000147829462712 -0.00035007489534 0)
(0.000170625672888 -0.0144582027084 0)
(0.000129541056681 -0.019985059211 0)
(0.000355168845891 -0.0194093697465 0)
(0.000197304666942 -0.0135861612213 0)
(0.000285532153276 -0.000250565094104 -3.46058338752e-28)
(0.000349798361557 -0.000142716724803 0)
(0.000386622942626 -0.000189358089854 0)
(0.000407228908488 -0.000224778863387 0)
(0.000392515583713 -0.000226655318343 0)
(0.000390438905239 -0.000229662419376 0)
(0.000427652971656 -0.000250462647742 0)
(0.00046868414672 -0.000265183073831 0)
(0.000513657378539 -0.000276547292875 0)
(0.00056977758779 -0.000289553720359 0)
(0.000661715173992 -0.000314166331214 0)
(0.000732428974583 -0.000333008698906 0)
(0.000814164129551 -0.000364601472601 0)
(0.000916228197182 -0.000400234077338 0)
(0.00101971592235 -0.000432868767552 0)
(0.00113161842275 -0.000475716333521 0)
(0.00127416832923 -0.000537623378845 0)
(0.00139838487365 -0.000605750217389 0)
(0.00158500144559 -0.00071072299687 0)
(0.00180512323061 -0.000834544258819 0)
(0.0020754304787 -0.000968134712899 0)
(0.00243128407839 -0.00109475153897 0)
(0.00287994364745 -0.0011755255949 0)
(0.00368781193251 -0.00112703830351 0)
(0.00214833195833 -0.000751680580641 0)
(0.00822855151104 -0.0719257281036 0)
(8.51775815739e-05 -0.000852455094031 0)
(0.0174882512791 0.351294037479 0)
(0.023433783554 0.461621081886 0)
(0.032090181663 0.487644804843 0)
(0.0369533451225 0.489038706896 0)
(0.0418309156787 0.485060299334 0)
(0.0460733222223 0.480709214792 0)
(0.0502963139346 0.476923541943 0)
(0.0544548022352 0.473616411114 0)
(0.0586076257602 0.47058372629 0)
(0.062768014172 0.467641938925 0)
(0.0669493482196 0.464638744535 0)
(0.0711507111846 0.46143725892 0)
(0.0753743915109 0.457902643023 0)
(0.0795986624617 0.453881458446 0)
(0.0837941589074 0.449202649752 0)
(0.0879512988278 0.443618435048 0)
(0.0918865362564 0.436813617211 0)
(0.0957604669365 0.428269726934 0)
(0.0988530284998 0.417049770915 0)
(0.101786222128 0.400739149593 0)
(0.101933311706 0.362958630223 0)
(0.0942288470596 0.303678958318 0)
(0.0789018122637 0.23055162013 0)
(0.0570007051436 0.151319141553 0)
(0.028410989015 0.0735336862746 0)
(-0.000105059112715 6.10862983195e-05 0)
(-0.000519837732176 -0.00170301893423 0)
(-0.000183555872436 -0.00148790777191 0)
(-0.000157973144218 -0.00148681001489 0)
(-0.000144600890597 -0.00148541555425 0)
(-0.000139165153262 -0.00148448099604 0)
(-0.00013610940318 -0.00148855114726 0)
(-0.000131280372039 -0.0015010359358 0)
(-0.00012138185097 -0.00150600941817 0)
(-0.000108697426456 -0.00150881761802 0)
(-9.30501817088e-05 -0.00151035973873 0)
(-7.34150723327e-05 -0.00150843507761 0)
(-5.06731351331e-05 -0.00150187852954 0)
(-2.72566655814e-05 -0.00151012445622 0)
(-7.515108148e-06 -0.00151502469062 0)
(-0.00025388185412 -0.00311343277221 0)
(0.000789079225259 -0.00369806044275 0)
(0.00120228635706 -0.0037911335875 0)
(0.000222166793046 -8.61517676262e-05 0)
(0.000367928303962 -6.27075161835e-05 0)
(0.000355119169707 -8.63218338563e-05 0)
(0.000372210769664 -9.41409981419e-05 0)
(0.000317386093127 -0.000115514156345 0)
(0.000486050521073 -0.00208802990536 0)
(0.000247124134815 -0.0141732305455 0)
(0.000440718143871 -0.0197981874923 0)
(0.000705634542419 -0.019402394713 0)
(0.000679285281925 -0.0136406261589 0)
(0.000352420479156 -0.000242082164306 3.26355959386e-28)
(0.000412347981539 -0.000105230095864 0)
(0.000445997719097 -0.000164480039813 0)
(0.000470445450559 -0.000212312925077 0)
(0.000484711041278 -0.000240550556337 0)
(0.000471059310874 -0.000233288821526 0)
(0.000470876610165 -0.000217543355887 0)
(0.000509053602165 -0.000217557066447 0)
(0.000558396445962 -0.000219533552118 0)
(0.000633104731009 -0.000224757014326 0)
(0.000709600469347 -0.000232935375702 0)
(0.000777268287861 -0.000248156546439 0)
(0.000870858132711 -0.000270960608046 0)
(0.000984608366659 -0.000296170331544 0)
(0.0010940191728 -0.000320841602623 0)
(0.00121695682299 -0.000353906948663 0)
(0.00134883424337 -0.000391426358246 0)
(0.00147176877471 -0.000437209894914 0)
(0.00168545936508 -0.000517799320233 0)
(0.00190293005798 -0.000595939500627 0)
(0.00216364341208 -0.000669706479606 0)
(0.0024792845199 -0.000720566062629 0)
(0.00283212784395 -0.000715387857247 0)
(0.00341058166125 -0.000602440226917 0)
(0.00180335578107 -0.000309823697666 0)
(0.012690123729 -0.0670734147032 0)
(0.000397375365388 -0.000755811407585 0)
(0.0202809300583 0.363733558289 0)
(0.0266072675231 0.469881508895 0)
(0.0337687332391 0.49329805366 0)
(0.037234305253 0.493437300529 0)
(0.0410981834324 0.489067203248 0)
(0.044646826769 0.484640979962 0)
(0.0483458937586 0.48086554568 0)
(0.0521026258091 0.477589322809 0)
(0.0559349821803 0.474595264576 0)
(0.0598370874539 0.471696967716 0)
(0.0638104863525 0.468738704996 0)
(0.0678469575292 0.465578614549 0)
(0.0719478405619 0.46207374577 0)
(0.0760846738703 0.458060456123 0)
(0.0802361939964 0.453354005376 0)
(0.0843824058548 0.447680366738 0)
(0.0883366640532 0.440702601938 0)
(0.0922911576243 0.431822971843 0)
(0.0953933065346 0.420018631101 0)
(0.0985078399098 0.402420967122 0)
(0.0983315663672 0.358565143427 0)
(0.0889297060378 0.29126634526 0)
(0.0715390706916 0.210567017057 0)
(0.0468698670764 0.125187399899 0)
(0.0115871472145 0.0451952407888 0)
(-0.000493216486152 -0.00105512305148 0)
(3.7631053012e-05 -0.00142047227009 0)
(-0.000141976230537 -0.00144513669917 0)
(-0.000187310615211 -0.0014759121227 0)
(-0.000199196524554 -0.00147693787452 0)
(-0.000199507187506 -0.00148154978089 0)
(-0.000193653158188 -0.0014858885407 0)
(-0.000182729954229 -0.00148990181439 0)
(-0.000165416111844 -0.00149130016409 0)
(-0.000145081562892 -0.0014911073713 0)
(-0.000122026586451 -0.00149058134148 0)
(-9.38571157925e-05 -0.00148526905584 0)
(-6.57946524106e-05 -0.00147981957425 0)
(-4.08480260575e-05 -0.00148607948735 0)
(-1.39173728738e-05 -0.00148725225255 0)
(-0.000533410057 -0.00325171828519 0)
(9.03959332191e-05 -0.000468652210084 0)
(0.00150351664448 -0.00440248825577 0)
(0.000243018162736 -0.000157044463614 0)
(0.000367183496838 -9.14112764391e-05 0)
(0.000345541389818 -9.64749771573e-05 0)
(0.000318699954327 -8.48944000243e-05 0)
(0.000216683711331 -2.23354296985e-05 0)
(8.239038644e-05 -0.000286969169968 0)
(0.000348940790681 -0.0136727718673 0)
(0.000790964543695 -0.0194477743318 0)
(0.00108322110882 -0.0193532755277 0)
(0.00107740304207 -0.0139108282852 0)
(0.000382732101984 -0.000276539271335 0)
(0.000493433939884 -8.846365486e-05 0)
(0.000519490342303 -0.000156643530913 0)
(0.000525075022272 -0.000205567896872 0)
(0.000523750478417 -0.000228718113728 0)
(0.00053412284314 -0.000230670312185 0)
(0.000557228231333 -0.000214232005607 0)
(0.00056891516272 -0.000184016373083 0)
(0.000608341185117 -0.000161690319762 0)
(0.000678705743037 -0.000151794570172 0)
(0.000748955071504 -0.000154774043242 0)
(0.000825008593386 -0.000164153699085 0)
(0.000923168345567 -0.000175681224262 0)
(0.0010300892782 -0.000188096228706 0)
(0.00113735928121 -0.000200139749368 0)
(0.00125971080029 -0.000218080010943 0)
(0.0014191634239 -0.000245817383802 0)
(0.00153464239296 -0.000273649500397 0)
(0.00174770442404 -0.000321785852801 0)
(0.00195703991568 -0.000363975337908 0)
(0.00220006024794 -0.000396518310805 0)
(0.00247697712034 -0.000405449710785 0)
(0.00276181950205 -0.000368972577376 0)
(0.0032395796144 -0.000260640045441 0)
(0.00156704095695 -7.95691009527e-05 0)
(0.0148803368908 -0.0597189677759 0)
(0.000636928153262 -0.000210267046899 0)
(0.0229861065701 0.376018866988 0)
(0.0286328939278 0.477202800588 0)
(0.0347504542512 0.497658302783 0)
(0.037175165917 0.496781842641 0)
(0.0401877355773 0.492292141629 0)
(0.0431144494465 0.487984973581 0)
(0.0463129974423 0.484349928342 0)
(0.0496687629623 0.481196575204 0)
(0.0531722322784 0.478310736228 0)
(0.0568052158136 0.475512230078 0)
(0.0605606640984 0.472647419726 0)
(0.06442526795 0.469573102459 0)
(0.068400748148 0.466140301038 0)
(0.0724525565069 0.46217706224 0)
(0.0765718702652 0.457484262518 0)
(0.0807226412503 0.451761654355 0)
(0.0847282839798 0.444650066987 0)
(0.0888027522823 0.43546016987 0)
(0.0919616773755 0.423090236926 0)
(0.0953536534197 0.404130227044 0)
(0.0948559479784 0.353063815876 0)
(0.083542752936 0.276832076574 0)
(0.0637849268148 0.188086754266 0)
(0.0355408251136 0.0967133635113 0)
(0.00320854269649 0.0144815855509 0)
(-0.000491253222078 -0.00216894695237 0)
(-0.00021015505028 -0.00159761636936 0)
(-0.00026870606238 -0.0015278790149 0)
(-0.000283549501407 -0.00149663634852 0)
(-0.000286582923735 -0.00148640456946 0)
(-0.000278940201112 -0.00146947881367 0)
(-0.000266415154013 -0.00147322037937 0)
(-0.000243924808734 -0.00146881009826 0)
(-0.000216827605725 -0.00146605965628 0)
(-0.000186755378312 -0.00146276572627 0)
(-0.000154033310301 -0.00145777343414 0)
(-0.000117834238059 -0.00144422745821 0)
(-8.55518377895e-05 -0.00145061493319 0)
(-5.57090177182e-05 -0.00145685615 0)
(-2.02064761067e-05 -0.00145634516191 0)
(0.000450072923887 -0.00341832198361 0)
(8.6972725806e-05 -0.000400495520331 0)
(0.000913212169853 -0.00506262931312 0)
(0.000222657523595 -0.000177418778662 0)
(0.000385385696024 -0.000106174056634 0)
(0.000400683984075 -9.44245541933e-05 0)
(0.000452230317487 -7.86019499376e-05 0)
(0.000544632754285 -0.000130831698639 0)
(0.000508371012204 -0.00223569574809 0)
(0.000466201848916 -0.0131429358822 0)
(0.00120669022304 -0.0189582626855 0)
(0.00156620587799 -0.0193013559185 0)
(0.00153151043325 -0.0144353148269 0)
(0.000554528211772 -0.00054977084643 0)
(0.000545681750219 -0.000108399807869 0)
(0.000570810881981 -0.00014852699654 0)
(0.00058447586793 -0.000201453398066 0)
(0.000581338241566 -0.00022896662514 0)
(0.000575158694044 -0.000218734712 0)
(0.000582947223209 -0.000186051277471 0)
(0.000620695654013 -0.000148605737185 0)
(0.000676317130442 -0.000113258984549 0)
(0.000733001669974 -9.15514630321e-05 0)
(0.000783296319055 -8.32930311077e-05 0)
(0.00085693077002 -8.02556066354e-05 0)
(0.000944402033438 -7.6509637152e-05 0)
(0.00106796354253 -7.61385288185e-05 0)
(0.00118440709573 -7.85061772505e-05 0)
(0.0013150897049 -8.41428853247e-05 0)
(0.00144925110889 -9.60714100131e-05 0)
(0.00156357463225 -0.000111884544465 0)
(0.00177768272184 -0.000130367656236 0)
(0.00197766750421 -0.000143193617512 0)
(0.00220511980665 -0.000148117231938 0)
(0.00245174158186 -0.000136344948999 0)
(0.0026872885545 -9.42629299622e-05 0)
(0.00308300288285 -5.03470925309e-06 0)
(0.0014204772072 0.000146344550506 0)
(0.0157639241119 -0.0505384731275 0)
(0.000784694187609 -2.16692518963e-05 0)
(0.0246825437692 0.38917854471 0)
(0.0298240280719 0.483847700183 0)
(0.0349998382947 0.501016933622 0)
(0.0366401220892 0.499286723402 0)
(0.0389655691516 0.494860357646 0)
(0.0413612907293 0.490802506515 0)
(0.0441045100476 0.487401673498 0)
(0.047078481919 0.484444514825 0)
(0.0502581605034 0.481727717266 0)
(0.0536201923152 0.479082056205 0)
(0.0571531001974 0.476359325329 0)
(0.0608417469703 0.473417529692 0)
(0.0646900873545 0.470103397006 0)
(0.0686595353684 0.466238487537 0)
(0.0727584288884 0.461608094652 0)
(0.0769286463018 0.45588683367 0)
(0.0810217873986 0.448690851401 0)
(0.0852543600192 0.439226454268 0)
(0.0885223581611 0.426324480104 0)
(0.0922900612377 0.405939560953 0)
(0.0914947308352 0.346320903232 0)
(0.078076889582 0.260277139787 0)
(0.0555658832981 0.163399852469 0)
(0.0225787049287 0.0664447650142 0)
(-0.000425402984543 -0.000957842305096 0)
(-0.000223794084326 -0.00175072337165 0)
(-0.000270024681424 -0.00164899075234 0)
(-0.000355408631931 -0.00154851696372 0)
(-0.000388481060854 -0.00149955998683 0)
(-0.000389540984111 -0.00147551697756 0)
(-0.000376632456293 -0.00146022894503 0)
(-0.000352292194906 -0.00144547274498 0)
(-0.000317390654835 -0.0014356833513 0)
(-0.000277467368854 -0.00142939513365 0)
(-0.000234813323806 -0.00142359801612 0)
(-0.000190023948928 -0.00141597042715 0)
(-0.000146892378261 -0.00140661686605 0)
(-0.000108361670107 -0.00141450352289 0)
(-7.00048519187e-05 -0.00141751988957 0)
(-2.5488918213e-05 -0.00140274420741 0)
(0.00134415194627 -0.00310344302286 0)
(0.000266669743679 -0.000517980754201 0)
(0.000595959596233 -0.00512009280758 0)
(0.000231924243016 -0.000151812033228 0)
(0.000477070199325 -9.2558910109e-05 0)
(0.000516730832379 -5.45605359675e-05 0)
(0.0005799836455 2.62341359881e-05 0)
(0.000449419185921 2.19746838252e-05 0)
(0.000644733074497 -0.00230396753924 0)
(0.000769392064116 -0.0122952166925 0)
(0.00179338607522 -0.0182791232408 0)
(0.00225954848939 -0.0192270014643 0)
(0.00236748440869 -0.0152330977632 0)
(0.000507752827188 -0.000793759856905 0)
(0.000606646991666 -0.000104078266505 0)
(0.00070778124601 -0.00014766049395 0)
(0.000727985148915 -0.000222379633539 0)
(0.00070216745688 -0.000271111156372 0)
(0.000641620365222 -0.000251689870137 0)
(0.000591062645344 -0.000174293618397 0)
(0.00062050334915 -9.64964403475e-05 0)
(0.000682876471646 -4.70859778289e-05 0)
(0.000756919607425 -2.54365730988e-05 0)
(0.000826711911883 -1.42168707704e-05 0)
(0.000903713053442 -4.20029249489e-07 0)
(0.00100123404836 1.92247515679e-05 0)
(0.00110706929765 3.4765691846e-05 0)
(0.00120319104617 4.10749922143e-05 0)
(0.00132315692328 4.40658263928e-05 0)
(0.00144338198111 4.42707552444e-05 0)
(0.00156918678394 4.85793174572e-05 0)
(0.0017790694934 5.83995728525e-05 0)
(0.00197478778652 6.89439545609e-05 0)
(0.00219320953572 8.29142778969e-05 0)
(0.00242312517647 0.000101892313575 0)
(0.00263049891983 0.000130742828996 0)
(0.00296663091815 0.000178080729818 0)
(0.00135573704588 0.000262582552745 0)
(0.0160094766397 -0.040213044151 0)
(0.000862456264818 0.00013219018886 0)
(0.0254892240682 0.402648902201 0)
(0.0302326306329 0.489816617117 0)
(0.034530983501 0.503566426261 0)
(0.0355818039058 0.501133407088 0)
(0.0373634218433 0.496893231545 0)
(0.0393159180378 0.493163395028 0)
(0.0416538148631 0.490057297805 0)
(0.044272303127 0.487349906733 0)
(0.0471396912312 0.484851640646 0)
(0.0502333526253 0.482405891628 0)
(0.0535414082888 0.479871589791 0)
(0.0570504554158 0.477109610812 0)
(0.0607686216221 0.473963938719 0)
(0.0646568470149 0.470251339314 0)
(0.0687450742475 0.465740028022 0)
(0.0729480461344 0.46008194398 0)
(0.0771694419859 0.452862689873 0)
(0.0815972577538 0.443170783917 0)
(0.0850318744791 0.429778872068 0)
(0.0892537294663 0.407886810599 0)
(0.0881322384876 0.33799915945 0)
(0.0721561285917 0.241179570606 0)
(0.0462558284112 0.136896269277 0)
(0.0108688073992 0.0367975605182 0)
(-0.000729157306201 -0.00199024000576 0)
(-0.000262490975818 -0.0019228634671 0)
(-0.000412165412077 -0.0017590080685 0)
(-0.000487429621415 -0.00162048073826 0)
(-0.000521605415745 -0.00151590878519 0)
(-0.000517978885144 -0.00146045327513 0)
(-0.00049592726101 -0.00143325431911 0)
(-0.000456443475346 -0.00140768592589 0)
(-0.000407645262093 -0.00139011208733 0)
(-0.000352111011007 -0.00138039721991 0)
(-0.000293406483033 -0.00137396209341 0)
(-0.000234470265768 -0.00136459916454 0)
(-0.000181532092665 -0.00136339977437 0)
(-0.000131826279637 -0.00136769469435 0)
(-8.27378556705e-05 -0.00137350620292 0)
(-2.88943158421e-05 -0.00134775680321 0)
(0.000201687018329 -0.000448132791561 0)
(0.00149121439839 -0.00226860733485 0)
(0.0005993153416 -0.00508121283876 0)
(0.000192813648658 -0.000115474169967 0)
(0.000385484331523 -3.13031068159e-05 0)
(0.000441462261637 7.83778717302e-06 0)
(0.000524365336279 6.2515213082e-05 0)
(0.000398296137932 4.89499316413e-05 1.03869959237e-28)
(0.000789496454488 -0.00219549762673 -5.25809232831e-28)
(0.00124093382203 -0.0112639527457 0)
(0.00256484869258 -0.0173589248803 0)
(0.00328899448597 -0.0189574316002 0)
(0.00435778779395 -0.0159898408718 0)
(0.000927398446409 -0.00141146721253 0)
(0.000466249488228 0.000129597030071 0)
(0.000780553128682 -6.16045885827e-05 0)
(0.000823883690003 -0.000223394252272 0)
(0.000776770199485 -0.000324010769183 0)
(0.000681636460378 -0.000316679091241 0)
(0.000619628235198 -0.000196649448892 0)
(0.000636382546522 -4.84185789698e-05 0)
(0.000698013935503 2.31628851815e-05 0)
(0.00077363393367 5.0051846199e-05 0)
(0.000846725039407 6.53098652129e-05 0)
(0.000935221009329 8.61436728459e-05 0)
(0.00102873852665 0.000112366796822 0)
(0.00111937697025 0.000132210287052 0)
(0.0012117312389 0.000144479282399 0)
(0.00131093554791 0.000158598928381 0)
(0.00143221339819 0.000179930114022 0)
(0.00154752411301 0.000208547642591 0)
(0.00175730721042 0.000245593226886 0)
(0.00195315566339 0.000277704474178 0)
(0.00217217527035 0.000308449523024 0)
(0.00240391281318 0.000329508575835 0)
(0.00261107291305 0.000333857536615 0)
(0.00292536617325 0.000317750602394 0)
(0.00137330990321 0.000288490856211 0)
(0.0159121465847 -0.0294302641703 0)
(0.000878106826978 0.000251303667742 0)
(0.0255289480686 0.416206674206 0)
(0.0299214268795 0.495097509691 0)
(0.0334001203798 0.505452154949 0)
(0.0340079961591 0.502467495625 0)
(0.0353583107271 0.498492541821 0)
(0.03694053503 0.495131087137 0)
(0.0389175712342 0.492353749293 0)
(0.041206028768 0.489932204312 0)
(0.0437733075062 0.487690469186 0)
(0.0466013982251 0.485484472552 0)
(0.049681303451 0.48318111598 0)
(0.0530046686677 0.480645388666 0)
(0.0565855653289 0.477720297316 0)
(0.0603895950736 0.474219484177 0)
(0.0644715898234 0.469892956744 0)
(0.0687171758744 0.464374219635 0)
(0.0731123660623 0.457208488107 0)
(0.0777758498763 0.44735734673 0)
(0.0814677419864 0.433543095006 0)
(0.0862634639847 0.410048635495 0)
(0.0847856563274 0.327598702705 0)
(0.0651506079765 0.218392368478 0)
(0.0340873060927 0.106288294596 0)
(-4.07777068206e-05 0.000502069759439 0)
(-0.000789385329536 -0.00205627045792 0)
(-0.000494143246838 -0.00196583057941 0)
(-0.000572489923896 -0.0018414521402 0)
(-0.00064564493994 -0.00168233285983 0)
(-0.000671798422216 -0.00151282241295 0)
(-0.000680320499351 -0.00144892272186 0)
(-0.000639611944872 -0.00139435066904 0)
(-0.000584097833971 -0.00135623301893 1.54917202202e-30)
(-0.000517797415882 -0.00132978856155 0)
(-0.000442872619451 -0.00131317878197 0)
(-0.000365238733583 -0.00130436174329 0)
(-0.00029137460043 -0.00129933207029 0)
(-0.000224800514516 -0.00130619769964 0)
(-0.000160888031792 -0.00131302857632 0)
(-9.80425356465e-05 -0.00132012599828 0)
(-3.22950110355e-05 -0.00128860666769 0)
(-6.88480026001e-06 -0.000167494572444 0)
(0.000791064103277 -0.0028025537592 0)
(0.00103775450542 -0.00531259523065 3.41679611986e-28)
(0.000167985824653 -0.000163803087347 0)
(0.000275959945749 2.28348070321e-05 0)
(0.000418895009563 8.61830833044e-05 0)
(0.000447225432972 0.000117684775695 0)
(0.000328363468727 0.000124883251605 0)
(0.000992059281017 -0.00200085104563 0)
(0.00183692924027 -0.0100294658533 0)
(0.00339880832566 -0.0161227222476 0)
(0.00445165081825 -0.0182344647621 0)
(0.00554577162732 -0.0161905503358 0)
(0.00382181463682 -0.00694553432317 0)
(0.000655925420589 0.000150779600029 0)
(0.00109209770991 -9.63299242155e-08 0)
(0.00107179017725 -0.000270272491083 0)
(0.000972792866287 -0.000446228212184 0)
(0.000794701074916 -0.000421286594517 0)
(0.000615607374688 -0.000221246829444 0)
(0.000624405706377 2.5268082059e-05 0)
(0.00072216311132 0.00010794200709 0)
(0.000804581125566 0.000127028329803 0)
(0.000873993705671 0.000139335591186 0)
(0.000935957433293 0.000161812820572 0)
(0.00102404355597 0.000195399261228 0)
(0.00110097420449 0.000221002075091 0)
(0.00119418638044 0.000243040974963 0)
(0.00130067883846 0.000270261781154 0)
(0.00141403212676 0.000308227534074 0)
(0.00151602796229 0.000361029133161 0)
(0.00170949630122 0.000429444988205 0)
(0.00191192759324 0.000488889704327 0)
(0.00214140317502 0.000543497591231 0)
(0.0023977160646 0.000573121382113 0)
(0.00264224912957 0.000553906875339 0)
(0.00299311708012 0.000459335078414 0)
(0.00147976920466 0.000256911150092 0)
(0.0156019995697 -0.0187770566072 0)
(0.000838693660401 0.000332442922617 0)
(0.0249230606468 0.429605809617 0)
(0.0289634748307 0.499656650206 0)
(0.0316892701333 0.506780432824 0)
(0.0319579979545 0.503396312302 0)
(0.0329545451693 0.499734663577 0)
(0.0342200213803 0.496756341325 0)
(0.035870390351 0.494322582246 0)
(0.03784886999 0.492208562237 0)
(0.0401250868296 0.490250570983 0)
(0.0426873722843 0.488316320105 0)
(0.0455318711732 0.486281297394 0)
(0.0486579317169 0.48401593344 0)
(0.0520870925881 0.481364713145 0)
(0.055796172193 0.478140186786 0)
(0.0598661217016 0.474074743531 0)
(0.0641572027337 0.468789543543 0)
(0.0687706569214 0.461774610986 0)
(0.0737026373634 0.451865824415 0)
(0.077783056223 0.437747951542 0)
(0.0833973092051 0.412624613223 0)
(0.0819032517895 0.314918417051 3.07901031194e-30)
(0.0577534549461 0.19209112049 0)
(0.0165944935436 0.0720518726499 0)
(-0.000622990969786 -0.00147504075552 0)
(0.000115011786971 -0.00222517927806 0)
(-0.000478471365516 -0.00213311815475 0)
(-0.0006956686118 -0.00196150971576 0)
(-0.000817185036326 -0.00175572078578 0)
(-0.000864925111996 -0.00154981116207 0)
(-0.000859426890383 -0.00140848533274 0)
(-0.000811877698989 -0.00133799736718 0)
(-0.000736078250545 -0.00128656873839 -1.55859652096e-30)
(-0.0006482807827 -0.00124861098722 0)
(-0.000553320526596 -0.00122475102067 0)
(-0.000460706437799 -0.00122717117618 -1.97835756774e-30)
(-0.000366233602829 -0.00123042023471 0)
(-0.000277149924405 -0.00123768890013 0)
(-0.000195906744703 -0.00124374481519 0)
(-0.000117018198255 -0.00124905819224 0)
(-3.65232847926e-05 -0.00121888496202 0)
(-2.27953703099e-05 -9.24069560129e-05 0)
(0.000135725931762 -0.000717806367029 0)
(0.00192430943186 -0.00523472724982 -3.27699774412e-28)
(0.000481394676034 -0.000638935702243 0)
(0.000294022580383 0.000118969614907 0)
(0.000364475096879 0.00010866433924 0)
(0.000320607210548 8.43906593896e-05 0)
(0.000205046966801 5.94063450845e-05 0)
(0.000118901023468 -0.000194683293374 0)
(0.00223998087759 -0.00840354212492 0)
(0.00404509024552 -0.0145770685356 -1.46109033773e-28)
(0.00531716826767 -0.0171823502631 0)
(0.00614753782137 -0.0160515520702 0)
(0.00474417063734 -0.00964351405862 0)
(0.000931600814538 -0.00042360580247 0)
(0.00129627065775 -2.44773403112e-06 0)
(0.00134571188937 -0.000339490232338 0)
(0.00122153789983 -0.00061787826753 0)
(0.00125701712505 -0.000760477447711 0)
(0.000927454350701 -0.000275806687593 0)
(0.000660316702205 0.000157012253672 0)
(0.000733097879808 0.000183440420504 0)
(0.00081820503226 0.000192826228967 0)
(0.000892640585732 0.000200128401136 0)
(0.000954302532419 0.00022376334057 0)
(0.00101449094301 0.000266493217543 0)
(0.00108316033984 0.00030530240916 0)
(0.00116653369316 0.000338291031486 0)
(0.00125700764073 0.000370446389552 -3.34252984128e-30)
(0.00135855880957 0.000421904558988 0)
(0.00147646069209 0.000509103146355 0)
(0.00162187699086 0.000604270049273 0)
(0.00183908339973 0.000707215861992 0)
(0.00208793944731 0.000804146374385 0)
(0.00239349917973 0.000865604267309 0)
(0.00272485924073 0.000846691922691 0)
(0.00321037082351 0.000676632635752 0)
(0.00169585802785 0.00017368356862 0)
(0.0151913459391 -0.00913337392659 0)
(0.000748122834361 0.000354703214418 0)
(0.0238179297309 0.442568041893 0)
(0.0274441455246 0.50344686184 0)
(0.0294880639738 0.507636259334 0)
(0.0294822675132 0.504002239287 0)
(0.0301690845099 0.500676502304 0)
(0.0311530703248 0.498077580427 0)
(0.0325004313628 0.495987626229 0)
(0.0341817451834 0.494190652239 0)
(0.036170600833 0.492533528494 0)
(0.0384615720669 0.490894682019 0)
(0.0410570377303 0.48915884655 0)
(0.0439656351548 0.487203641261 0)
(0.0472175233173 0.484878450851 0)
(0.0508078909924 0.481997659541 0)
(0.0548425017114 0.478280452191 0)
(0.059170203986 0.473344127969 0)
(0.0640375810246 0.466605504625 0)
(0.0692486916423 0.456789254626 0)
(0.0738549564071 0.442529629202 0)
(0.080473569585 0.415766359389 0)
(0.0790629171169 0.299534900456 -3.23931772286e-30)
(0.0494677517153 0.163051145165 0)
(0.0104130632264 0.0384846804885 0)
(-0.000818646674956 -0.00331443483653 0)
(-0.000398726201079 -0.00275443418568 0)
(-0.000758116183709 -0.00242812482477 0)
(-0.00094986320298 -0.00212169277076 0)
(-0.00105744051218 -0.00183471227695 0)
(-0.00109696911331 -0.0015744200223 0)
(-0.00105291820284 -0.00134940837269 0)
(-0.00101169317266 -0.00125927905459 0)
(-0.000913713098118 -0.00119291043753 0)
(-0.00080330693549 -0.00114918225184 0)
(-0.000685834064005 -0.00112174557302 0)
(-0.000567477692984 -0.0011130073994 2.06425900259e-30)
(-0.000449931451881 -0.00111730314004 0)
(-0.000338479187204 -0.00113876742016 0)
(-0.000238363179013 -0.00116048775338 0)
(-0.000141125244692 -0.00115457263376 0)
(-4.45881673466e-05 -0.00113773763154 0)
(1.76900570992e-05 -0.000101322546123 0)
(1.79328876217e-05 -0.000318256850654 0)
(0.00133272124725 -0.00487957295347 3.54048207761e-28)
(0.000917626787743 -0.00228624205231 0)
(0.000207126627485 4.26375191945e-05 0)
(0.000274179482257 3.47442077466e-05 0)
(0.000200434791989 1.77933966432e-05 0)
(0.0001933710404 4.75202917357e-06 0)
(3.59784660026e-05 -0.000105500749691 0)
(0.00204755794885 -0.00677506346941 0)
(0.0046941533822 -0.0130021662386 1.52411614369e-28)
(0.00616531405054 -0.0161163237743 0)
(0.00692766488529 -0.0161607487531 0)
(0.00696324486664 -0.0122793149208 0)
(0.00150862502677 -0.000993612281974 0)
(0.00131280395679 0.000317678536221 0)
(0.00151860324316 -0.000454655122739 0)
(0.00117702348666 -0.000695557695167 0)
(0.00136037215555 -0.000665083248289 0)
(0.00511279892839 -0.00164955792442 0)
(0.000868944924433 -1.53768252922e-05 2.15315035319e-28)
(0.000790809367842 0.000264040083129 -1.12495379626e-28)
(0.000886563480494 0.00028164930579 0)
(0.00096001605072 0.000256478282934 -8.46395049183e-30)
(0.000981002535365 0.000254049658826 0)
(0.0010011013219 0.000314928086345 0)
(0.00105212977426 0.000377584041523 0)
(0.00112908703211 0.00042459443845 0)
(0.00121543156973 0.000459192669217 3.53489655233e-30)
(0.00130431995686 0.00052027046624 0)
(0.00139584889506 0.000630857960298 0)
(0.00147877216896 0.000752918054553 0)
(0.00171198195855 0.000938960019 0)
(0.00198300865718 0.00110216638564 0)
(0.0023551512211 0.00124182964375 0)
(0.00283118896766 0.0012958957359 0)
(0.00366051211602 0.0011324001153 0)
(0.00208809961834 0.00019989498709 0)
(0.0157469394441 0.0017471278377 0)
(0.000641796562467 0.000277270005194 0)
(0.0223922920348 0.454866983502 0)
(0.025432144833 0.506492211954 0)
(0.0268671475218 0.508132453237 0)
(0.0266342241616 0.504363554912 0)
(0.0270299430021 0.501359025907 0)
(0.0277504650692 0.499117651913 0)
(0.0288077121425 0.497360973682 0)
(0.0301962620662 0.495881490988 0)
(0.031894835276 0.494533768348 0)
(0.0339025201313 0.493205553601 0)
(0.0362274870194 0.491791777041 0)
(0.0388877312883 0.490179763073 0)
(0.0419225440375 0.48822819909 0)
(0.0453512660522 0.485757313178 0)
(0.0492998712634 0.48248218527 0)
(0.0536329643046 0.478026322701 0)
(0.0587639053432 0.471723287707 0)
(0.0642487023126 0.462237723209 0)
(0.0695996230029 0.448094176375 0)
(0.0773712815253 0.419673122629 0)
(0.0755859526182 0.280205501361 0)
(0.0379096492874 0.128114472041 0)
(-1.14649243358e-05 0.000128679642286 0)
(-0.000776012822163 -0.00332835468577 0)
(-0.000802198734355 -0.00304121347125 0)
(-0.00111131157263 -0.00266342866674 0)
(-0.00128909390494 -0.00225725797316 9.28042152569e-31)
(-0.00136448701951 -0.00188774238841 0)
(-0.00136932591512 -0.00156995929516 0)
(-0.00129372009429 -0.00129965224932 0)
(-0.0012286301985 -0.00115844249491 0)
(-0.00111485216633 -0.00107547516167 0)
(-0.000980637015659 -0.00102531615748 0)
(-0.000838186730808 -0.000995601651984 0)
(-0.000695957673039 -0.000989498529942 0)
(-0.000553461215691 -0.00099622014163 0)
(-0.000414407646116 -0.00101362641081 0)
(-0.000295667672794 -0.00106136031259 0)
(-0.000176043625305 -0.00104483696814 0)
(-6.10363281108e-05 -0.00104167680735 0)
(1.80477749435e-05 -6.59903287323e-05 0)
(-1.70284560079e-05 -8.55800767377e-05 0)
(0.000492215208427 -0.00420366439916 -4.08358003824e-28)
(0.000496023258818 -0.00249416855735 0)
(0.000152806791006 -2.87543165084e-05 0)
(0.000230356067594 -1.8678412231e-05 0)
(0.000190052074981 -1.78709155195e-05 0)
(0.000148853241001 -2.47968061453e-05 0)
(1.44038219654e-05 -4.47239250842e-05 0)
(0.000303862233834 -0.000908258392946 0)
(0.00513457805473 -0.0106121690545 0)
(0.00685119242431 -0.0146788832665 0)
(0.00788901991122 -0.016009033317 0)
(0.00789529199016 -0.0141350294463 0)
(0.00672961609171 -0.00904358613481 0)
(0.0016507902097 -0.000729836118575 0)
(0.00191690527953 -0.000959878572327 0)
(0.00148132602395 -0.000515136188169 -2.26268537342e-28)
(0.00825693194903 0.00262006619098 1.92306820527e-27)
(0.00995461752924 -0.00118166829064 0)
(0.0105877376234 -0.00518151638302 0)
(0.0018648929511 -0.000479862211063 -2.31068814596e-28)
(0.00103930195998 0.000244491840532 1.01415364468e-28)
(0.00110913731482 0.000255757226004 9.8927649275e-30)
(0.00104518863541 0.000216944685971 0)
(0.000981329557045 0.000330776652403 0)
(0.00101270996737 0.000442903186124 0)
(0.00109574020804 0.000519368587365 0)
(0.00120014026345 0.000541300433267 0)
(0.00125949980407 0.000569909574482 0)
(0.00128637497353 0.000702232597504 0)
(0.00132646491487 0.00088122471922 0)
(0.0014898075256 0.00113928655118 0)
(0.0017850522468 0.00144083149684 0)
(0.00219973679846 0.00171848450665 0)
(0.00283401503002 0.002021326865 0)
(0.00430472042376 0.00227631908866 0)
(0.00281265984875 0.00256769057585 0)
(0.02093733469 0.00979379014865 0)
(0.000764487280791 -0.00130229107424 0)
(0.0208347888489 0.46678084865 0)
(0.0229962093082 0.508997038433 0)
(0.0239185724035 0.508371007378 -4.26815227293e-30)
(0.0235022686534 0.504504618733 0)
(0.0235888666909 0.501775630533 0)
(0.0240341164268 0.499867909238 0)
(0.0247994282862 0.498437049741 0)
(0.0258912255506 0.497274369193 0)
(0.0272908132334 0.496239162704 0)
(0.028997466334 0.49522847547 0)
(0.0310225716743 0.494149878218 0)
(0.0333918402013 0.492904568496 0)
(0.0361536011029 0.491366457353 0)
(0.0393540792402 0.489367476335 0)
(0.0431322022295 0.486630817153 0)
(0.047402895844 0.482790310258 0)
(0.05273076055 0.477099482101 0)
(0.0584113035112 0.468267378931 0)
(0.0648449489916 0.454657875563 0)
(0.0742274280993 0.425008330727 0)
(0.0724645907307 0.257213745983 0)
(0.0222247911997 0.0879535566439 0)
(-0.000695725832596 -0.00307080162891 0)
(0.000282495823833 -0.00413572178185 0)
(-0.00106503069283 -0.00357345676887 0)
(-0.00154206752273 -0.00294032403746 0)
(-0.0017255437805 -0.00236466782391 -9.27647880809e-31)
(-0.0017447392005 -0.00189236261635 0)
(-0.00168526845175 -0.00151732420793 9.72033000918e-31)
(-0.00156926679553 -0.00122322446976 0)
(-0.00144069221504 -0.00102733539263 0)
(-0.00131705317633 -0.000930148464506 0)
(-0.00116226173876 -0.000875191474779 0)
(-0.000998702506724 -0.000842577138743 0)
(-0.000838803826073 -0.000837575083701 0)
(-0.000675570819298 -0.000851255605441 0)
(-0.000509229552094 -0.000873457034561 0)
(-0.000367861319665 -0.000929825075894 0)
(-0.00022472853006 -0.000933200139958 0)
(-7.8249112624e-05 -0.000914371773797 0)
(1.73289515706e-06 -2.97846179259e-05 0)
(-2.71427084368e-05 -4.83759063843e-05 0)
(-0.000115391058514 -0.00381221703594 4.41571828026e-28)
(0.000323471283963 -0.0028951600194 0)
(0.000141097558922 -6.36631929158e-05 0)
(0.000225670503524 -5.93159414455e-05 0)
(0.000178215137666 -5.22234112643e-05 0)
(0.000161966749889 -5.15377412006e-05 0)
(0.000210813206823 -6.5249825049e-05 0)
(3.74172918666e-05 -0.00026410799499 0)
(0.00376402670443 -0.00835314699088 0)
(0.0072753754053 -0.0128892091653 0)
(0.00880561181546 -0.0156329605297 0)
(0.00945733837758 -0.0162608786285 0)
(0.00253283595454 -0.00256767962743 0)
(0.00180776145316 -0.0013276853249 0)
(0.00151722179538 -0.00059484888357 0)
(0.00901720676204 0.00593666370931 0)
(0.0130636731489 0.0088553358703 0)
(0.0151951773805 0.00305413186558 0)
(0.0156265415037 -0.00498055036078 0)
(0.0135876513462 -0.00831553954114 0)
(0.00218374547871 -0.000757092677299 0)
(0.00178702960861 0.000250425102511 0)
(0.00135684256939 -0.000200160641363 0)
(0.000968879758202 0.000233624701511 0)
(0.000952918158442 0.000484667480818 0)
(0.00105926197386 0.000688969821999 0)
(0.00125073429577 0.000654490542874 0)
(0.00129312460788 0.000533787369199 0)
(0.00117977904095 0.000686185832807 0)
(0.00111115272738 0.000927803334665 0)
(0.00122550157537 0.00130935905044 0)
(0.00140406286249 0.00165683372703 0)
(0.00177468581354 0.00218723336723 0)
(0.00227368944388 0.00277809059675 0)
(0.00312325168056 0.00359444865137 -2.18761535457e-30)
(0.00422506904028 0.00512216039194 0)
(0.00434753787736 0.00349475634816 0)
(0.00110639226107 -8.87847977122e-06 0)
(0.0193859670873 0.47952489151 0)
(0.0205886023842 0.51082888552 0)
(0.0208956149388 0.508104621436 4.29326064271e-30)
(0.0202033555633 0.504251824789 0)
(0.0198884784462 0.501832985323 0)
(0.0200100189586 0.500286849356 0)
(0.0204735485742 0.499200707437 0)
(0.0212652869041 0.49836108572 0)
(0.0223578498137 0.497636941532 0)
(0.0237436617441 0.496939911574 0)
(0.0254330119959 0.496195655824 0)
(0.0274561888154 0.495325759284 0)
(0.0298697116069 0.494227995043 0)
(0.0327465043824 0.492757235709 0)
(0.0362360679141 0.490663208698 0)
(0.0403412760803 0.487590385142 0)
(0.0456965475306 0.482727554722 0)
(0.0513521447121 0.474888647982 0)
(0.0589843517324 0.462059979748 0)
(0.0698633403518 0.431695070113 0)
(0.0690990097482 0.229969319097 0)
(0.0205554842415 0.0506921489444 0)
(-0.00111263188504 -0.00733972619781 0)
(-0.000780044356251 -0.00571323957588 0)
(-0.00199811038586 -0.00427840261242 0)
(-0.00231995940678 -0.00317936946336 0)
(-0.002337030725 -0.00237772076182 0)
(-0.00221183274721 -0.00180217677252 0)
(-0.00203859061347 -0.00138700285948 -9.71860099775e-31)
(-0.00185268223988 -0.00108570924095 0)
(-0.00163152596463 -0.000859092560416 0)
(-0.00150454218552 -0.000762385923753 1.32520573295e-30)
(-0.0013318384002 -0.000706863401358 0)
(-0.00115853289169 -0.000675933746867 0)
(-0.000975792018608 -0.000663170791669 0)
(-0.000804367122632 -0.000680268711418 0)
(-0.000629097722278 -0.000723099338259 0)
(-0.000455277222339 -0.000789854804166 0)
(-0.000252358851555 -0.000786822468403 0)
(-7.08034583213e-05 -0.000718200406803 0)
(1.64810643061e-05 -6.95225771866e-05 0)
(-0.00010115062222 -0.000360516273529 0)
(4.91990177819e-06 -0.00345018522945 -4.59034621306e-28)
(0.000494535294875 -0.0018737029581 0)
(0.000140677627364 -9.58274863783e-05 0)
(0.00019740865966 -0.000125631021224 0)
(0.000136543733536 -9.16759813898e-05 0)
(0.000112378067079 -6.39073424773e-05 0)
(9.71999566598e-05 -4.29249109143e-05 0)
(-1.52510179468e-05 1.11810583719e-05 0)
(0.000243639328669 -0.00055473330643 0)
(0.00780635751275 -0.0103861165617 0)
(0.0110858485718 -0.0144599659843 0)
(0.013976336275 -0.0168910793085 0)
(0.0190998148052 -0.0148067751736 0)
(0.00242252341283 -0.00121699467191 0)
(0.0142246407724 0.00535895544639 0)
(0.0157471718483 0.00966050116834 0)
(0.0151097593403 0.0107170767048 0)
(0.00233727095078 -0.000144456295928 0)
(0.0120448495882 -0.00752776218871 0)
(0.0134677180411 -0.0108340368043 0)
(0.014268681441 -0.0111115434337 0)
(0.00233256626091 -0.000896026513053 0)
(0.00142096882035 -0.000137078193094 0)
(0.000712085401727 0.000378880882686 0)
(0.000743851269844 0.000564233390266 0)
(0.00109166873253 0.000586555067107 0)
(0.00145008710327 0.000906445001034 0)
(0.00161437527916 0.00026843106035 0)
(0.00115811285621 0.000468325088886 0)
(0.000882620721067 0.000918186990893 0)
(0.00084947290511 0.00147913750871 0)
(0.000951966267842 0.0020357049541 0)
(0.00107818278165 0.00243698376585 0)
(0.00142766266174 0.00341404979991 0)
(0.00196134711819 0.00469402062275 2.18805108716e-30)
(0.00291128319014 0.00648513407946 0)
(0.00572474345553 0.00868062293552 0)
(0.00396497769015 0.00528866635446 0)
(0.0222036054986 0.488653885583 0)
(0.0195198114944 0.510727909077 0)
(0.0179101755032 0.506645725565 0)
(0.0166192471535 0.503304577553 0)
(0.0158331291334 0.501441160051 0)
(0.0156198543431 0.500364282854 0)
(0.0158043406591 0.499662549906 0)
(0.0163155284675 0.499148117689 0)
(0.0171049541713 0.498718812903 0)
(0.018153753338 0.498311667157 0)
(0.0194676789108 0.497877144455 0)
(0.0210770846422 0.497363798165 0)
(0.0230423145401 0.496702890501 0)
(0.0254564596661 0.495790025366 0)
(0.0284843294357 0.494434088516 0)
(0.0322557077965 0.492325227426 0)
(0.0373979321695 0.488682468242 0)
(0.0429493362931 0.482391772636 0)
(0.0519621870479 0.47042557582 0)
(0.0630093000984 0.439066485242 0)
(0.0607457904008 0.191931447642 0)
(0.00189445446286 -0.00247746161169 0)
(-0.0010820213289 -0.0110201900385 0)
(-0.00296614466867 -0.00711138955427 0)
(-0.0035989199711 -0.00465525474868 0)
(-0.00344278582326 -0.0031260853817 0)
(-0.00310277482631 -0.00216426743713 0)
(-0.00273548028371 -0.00154914266994 0)
(-0.00240179510023 -0.00114274396656 0)
(-0.00212053930573 -0.000865592775952 0)
(-0.00180736709118 -0.000656532922773 0)
(-0.00166899788237 -0.000576360800097 -1.29329210217e-30)
(-0.00147656006643 -0.000525779207753 0)
(-0.00129209239643 -0.000494941824363 0)
(-0.00110386314571 -0.000485719437992 0)
(-0.000911109478118 -0.000494375218687 0)
(-0.000711556660149 -0.000519061936543 0)
(-0.000501063096524 -0.000556768889296 0)
(-0.000253226863645 -0.000546176476053 0)
(-7.2138724309e-05 -0.000576335442755 0)
(-5.96960147793e-07 -4.08421820239e-06 0)
(0.000102761417431 -0.000479584176879 0)
(0.000935057645771 -0.0030272710145 -4.74609587916e-28)
(0.00248797427287 -0.00323801183783 0)
(0.000243712231993 -0.000151465242023 0)
(0.000200621561586 -6.43133245268e-05 0)
(9.80119766102e-05 -4.38267969598e-05 0)
(9.22420969359e-05 -3.17544161117e-05 0)
(9.55096114926e-05 -2.73443665618e-05 0)
(0.000103667872327 -3.16249625254e-05 0)
(0.0001240987963 -0.000145587502797 0)
(0.000874924536298 -0.000836153476269 0)
(0.0107370924969 -0.00936563957295 0)
(0.0165984911906 -0.0121516922465 0)
(0.0238177325804 -0.011925635468 0)
(0.0266787815109 -0.00636762128642 0)
(0.026970934398 -0.00135875673655 0)
(0.0209859427745 0.0016581308105 0)
(0.00256451545791 9.71100374945e-05 0)
(0.00211660733397 -7.28174880419e-05 0)
(0.00941611002095 -0.00179138573097 0)
(0.0142217345551 -0.00526025841783 0)
(0.0212286189122 -0.00846356742169 0)
(0.0257649045639 -0.00895580788847 0)
(0.0286423194566 -0.00510128418577 0)
(0.0321349751578 -0.00305402555935 0)
(0.0156604932023 -0.00103502025993 0)
(0.0254105362908 -0.00279936622688 0)
(0.003880516323 -0.000166452735961 0)
(0.00305950448053 0.000182861879616 0)
(0.00134232576311 0.000541595979231 0)
(0.000349177176164 0.000668093778456 0)
(0.000252368565027 0.00111243331671 0)
(0.000189281425509 0.00128793255558 0)
(0.000216062712952 0.00172400842155 0)
(0.000211338984251 0.0019757510496 0)
(0.000296621654592 0.00280035603658 0)
(0.000570525247685 0.00405864004161 0)
(0.00646459733736 0.00615271044675 0)
(0.00705054669261 0.0100110445035 0)
(0.0231351473865 0.494028584044 0)
(0.0181120605613 0.507519591428 0)
(0.0141474438596 0.503817061174 0)
(0.0122156186538 0.501761092492 0)
(0.0111647489421 0.500749537591 0)
(0.0107685559934 0.500215813851 0)
(0.0107736114109 0.499889592027 0)
(0.0110599952357 0.499660106988 0)
(0.0115665572024 0.499473185859 0)
(0.0122691047157 0.49929778677 0)
(0.0131691070092 0.499110653751 0)
(0.0142912694743 0.498887892171 0)
(0.0156882331808 0.498596875969 0)
(0.0174508760899 0.49818533565 0)
(0.0197418704867 0.497551751734 0)
(0.0227965212457 0.496508882533 0)
(0.0272273723212 0.494534317021 0)
(0.0328095248597 0.490752101358 0)
(0.0441596115513 0.481407306377 0)
(0.0547272064059 0.453528003862 0)
(0.0426561742085 0.161457063209 0)
(0.00123094056397 -0.00775603913061 0)
(-0.00117185393248 -0.00738582605031 0)
(-0.00715132656665 -0.00808553852069 0)
(-0.005983676485 -0.00411929852499 0)
(-0.00481121704704 -0.00249571991623 0)
(-0.00391408339033 -0.00159275638707 0)
(-0.00323339018206 -0.00107887565625 0)
(-0.00272215288759 -0.000765267557118 0)
(-0.00233936825778 -0.000561543633624 0)
(-0.00196984855061 -0.000416767979171 0)
(-0.00178952566868 -0.000360079368742 0)
(-0.00157047033214 -0.000324321870255 0)
(-0.00136996377799 -0.000298937077049 0)
(-0.00117595267631 -0.000287375311206 0)
(-0.000973978570066 -0.000289787896152 0)
(-0.000769720340011 -0.000305150156422 0)
(-0.000563441004429 -0.000331106531115 0)
(-0.00032324293588 -0.000344435381474 0)
(-0.000120478376438 -0.000437432697809 0)
(-2.6213179775e-05 1.97945824182e-05 0)
(3.27941710058e-05 3.18245739075e-06 0)
(0.000358675679949 -0.000234454069579 7.35955645746e-29)
(0.00380209746875 -0.00184803443905 0)
(0.00519864593856 -0.00186169903437 0)
(0.00623604887255 -0.00085430896521 0)
(0.00644870498557 -0.00038454509645 0)
(0.00645267832452 -0.000183646021707 0)
(0.00647700775498 -0.000103464546465 0)
(0.00652932804636 -7.56422378992e-05 0)
(0.00661077583666 -0.00015512868773 0)
(0.00633518584394 -0.000378494925411 0)
(0.0093599209536 -0.00226063255792 0)
(0.0155228343518 -0.00407090501645 0)
(0.0229040542885 -0.0040377261723 0)
(0.0280936616559 -0.00184116089123 0)
(0.030432645478 -0.000429060117905 0)
(0.0316340605461 -0.00122886823198 0)
(0.0325718118189 -0.00299876605488 0)
(0.0342691984135 -0.000402026793825 0)
(0.03340599947 0.000604367046723 0)
(0.0327553687579 0.000768462716845 0)
(0.0349215024838 3.45427074833e-05 0)
(0.0385837539087 -4.69185672137e-05 0)
(0.0414702664383 0.00045606097659 0)
(0.044356474042 -0.000643991902026 0)
(0.047203360578 -0.00211051706692 0)
(0.052250385706 -0.00402558034696 0)
(0.0577258410832 -0.00898014020065 0)
(0.0644158794637 -0.00681688924818 0)
(0.0669232690139 -0.00413141850782 0)
(0.0669140136947 -0.0015270821829 0)
(0.0656411559492 0.000671559058843 0)
(0.0638090638675 0.00228628896828 0)
(0.0614812615599 0.00361791670747 0)
(0.058479147184 0.00508531034633 0)
(0.0544342163893 0.00727551245692 0)
(0.0478610063802 0.011634673944 0)
(0.0438914269594 0.0241448390351 0)
(0.0050395638213 0.00679686928748 0)
(0.0178917353524 0.494342513727 0)
(0.0127409744692 0.502490125396 0)
(0.00822918263066 0.501050507856 0)
(0.00651934332043 0.500448307279 0)
(0.00576735281187 0.500184910197 0)
(0.00548105317123 0.500054809969 0)
(0.00544726752093 0.499978359221 0)
(0.00557485265286 0.499925733917 0)
(0.0058226563249 0.499883353381 0)
(0.00617481627969 0.499843764296 0)
(0.00663133005612 0.499801512088 0)
(0.00720589054018 0.499751011859 0)
(0.00792869810817 0.499684527279 0)
(0.00885475879007 0.49958928118 0)
(0.0100861136802 0.499439337653 0)
(0.0118095790089 0.499182496266 0)
(0.0144778615199 0.498657716907 0)
(0.0188286127008 0.497535323554 0)
(0.0297453201639 0.493956232192 0)
(0.0370740556672 0.482463512044 0)
(0.0165712121149 0.183249029022 0)
(-0.0102773238474 -0.00553298418378 0)
(-0.0542989500689 -0.0265964322074 0)
(-0.00624545363738 -0.00422599018799 0)
(-0.00918293822731 -0.00176269985408 0)
(-0.00596253842847 -0.000997397608127 0)
(-0.00451413168255 -0.000600436521718 0)
(-0.00355852546523 -0.000391838599548 0)
(-0.00291545715145 -0.00027097924798 0)
(-0.00246603374901 -0.000194995850496 0)
(-0.00205882238822 -0.000141355538317 0)
(-0.00187708108796 -0.000122723553345 0)
(-0.00164232948383 -0.000111105378591 0)
(-0.00143047919505 -0.000101019782183 0)
(-0.00123870054086 -9.55768978351e-05 0)
(-0.00104881921947 -9.73536609652e-05 0)
(-0.000852562788739 -0.000105506538106 0)
(-0.000645739397514 -0.000114568879068 0)
(-0.000392353128183 -0.000113690551995 0)
(-0.000194140109933 -0.000177996873267 0)
)
;
boundaryField
{
frontAndBack
{
type empty;
}
upperWall
{
type noSlip;
}
lowerWall
{
type noSlip;
}
inlet
{
type fixedValue;
value uniform (0 0.5 0);
}
outlet
{
type inletOutlet;
inletValue uniform (0 0 0);
value nonuniform List<vector>
20
(
(0.340564129787 -0.355664878002 0)
(0.465968591014 -0.297108548099 0)
(0.543061157255 -0.225567242862 0)
(0.588187116042 -0.159789185919 0)
(0.612490357024 -0.0980942229418 0)
(0.622603923072 -0.0415670384622 0)
(0.620251705521 0.0143337677476 0)
(0.609600182038 0.0591374666734 0)
(0.595757636426 0.0989087864233 0)
(0.579163455177 0.133750760992 0)
(0.560044524514 0.164730995613 0)
(0.538426103185 0.192339001348 0)
(0.514218440304 0.216998109563 0)
(0.48722318404 0.239078696452 0)
(0.457096030904 0.258969520524 0)
(0.423206508385 0.277028761278 0)
(0.384209081639 0.293518061326 0)
(0.337284009619 0.309324729304 0)
(0.278040697705 0.326595909322 0)
(0.199707141101 0.336306302829 0)
)
;
}
}
// ************************************************************************* //
| [
"as998@snu.edu.in"
] | as998@snu.edu.in | |
331e8c77a45ed73de17eb0b601fc88647795afdd | a54972e797d29f6f10613d02dde19d0c5137e010 | /test/todo/Integrationtest_Serialize_testSuite.cpp | c5ad8983a3d28a75ae32620aeb647aa0b3d38cbc | [
"BSD-3-Clause"
] | permissive | antonelloceravola/ToolBOSCore | a60528235756070b069cda7c093297b5157f783a | e513b1dd434d49939565e17db6da0a40ee67c5ac | refs/heads/master | 2023-06-01T04:41:03.322966 | 2023-05-23T09:22:26 | 2023-05-23T09:22:26 | 238,461,182 | 0 | 0 | BSD-3-Clause | 2020-02-05T13:50:00 | 2020-02-05T13:49:59 | null | UTF-8 | C++ | false | false | 13,876 | cpp | /*
* Automated testing of Serialize and serialization features.
*
* Copyright (C)
* Honda Research Institute Europe GmbH
* Carl-Legien-Str. 30
* 63073 Offenbach/Main
* Germany
*
* UNPUBLISHED PROPRIETARY MATERIAL.
* ALL RIGHTS RESERVED.
*
*/
/* main's argc/argv are unused */
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <DynamicLoader.h>
#include <Serialize.h>
#include <IOChannel.h>
#include <ArgvParser.h>
/***************
* CPP Defines *
***************/
#define TESTSUITE_PARAM_MAXLEN 256
#ifdef _WINDOWS_
#define SHARED_LIBRARY_EXT ".dll"
#else
#define SHARED_LIBRARY_EXT ".so"
#endif
/**************
* Data types *
**************/
static ArgvParserOptionDescriptor optionDescriptors[] =
{
{ 'h', "help", ARGVPARSER_NO_PARAMETER, NULL,
"display this help" },
{ 'l', "library", ARGVPARSER_PARAMETER_REQUIRED, "library ",
"Library to test serialization." },
{ 'i', "init", ARGVPARSER_PARAMETER_REQUIRED, "libraryInitString ",
"initString to initialize library" },
{ 'c', "channel", ARGVPARSER_PARAMETER_REQUIRED, "channelInitString ",
"initString to initialize IOChannel" },
{ 'f', "serialize-format", ARGVPARSER_PARAMETER_REQUIRED, "format",
"Serialization format" },
{ 'o', "options", ARGVPARSER_PARAMETER_REQUIRED, "options",
"Serialization options" },
{ 0, NULL, 0, NULL, NULL }
};
typedef struct testSuite_args
{
char *library;
char *libraryInitString;
char *channelInitString;
char *format;
char *opts;
} testSuite_args;
typedef void *(testSuiteNewFunc)( void );
typedef int (testSuiteInitFromStringFunc)( void *, char * );
typedef void (testSuiteSerializeFunc)( void *, const char *, Serialize * );
typedef void (testSuiteClearFunc)( void * );
typedef void (testSuiteDeleteFunc)( void * );
typedef struct testSuite_functions
{
testSuiteNewFunc *newFunc;
/**< Pointer to a _new() function */
testSuiteInitFromStringFunc *initFromStringFunc;
/**< Pointer to a _initFromString() function */
testSuiteSerializeFunc *serializeFunc;
/**< Pointer to a _serialize() function */
testSuiteClearFunc *clearFunc;
/**< Pointer to a _clear() function */
testSuiteDeleteFunc *deleteFunc; /**< Pointer to a _delete() function */
} testSuite_functions;
enum
{
OPT_HELP, /* Index: 0 */
OPT_LIBRARY, /* Index: 1 */
OPT_INIT, /* Index: 2 */
OPT_CHANNEL, /* Index: 3 */
OPT_FORMAT, /* Index: 4 */
OPT_OPTIONS /* Index: 5 */
};
/**************
* Prototypes *
**************/
static int testSuite_parseArgs( ArgvParser argvParser, int argc, char *argv[], testSuite_args args );
static void usage( ArgvParser *argvParser );
static bool testSuite_loadFunctions( DynamicLoader *dl, const char *library, testSuite_functions *functions );
/**********************
* Private functions *
**********************/
static void usage( ArgvParser *argvParser )
{
ANY_LOG( 0,
"Usage: ./testSuite -l [library] -i [libraryInitString] -c [channelInitString] -f [format] -o [options]\n",
ANY_LOG_INFO );
ANY_LOG( 0, "Valid options:\n", ANY_LOG_INFO );
ArgvParser_displayOptionHelp( argvParser, 2 );
}
/* Return Values:
*
* -1: Failure
* 0: OK
* 1: Help was called
*/
static int testSuite_parseArgs( ArgvParser argvParser, int argc, char *argv[], testSuite_args args )
{
const char *argument = NULL;
int retVal = 0;
if( ArgvParser_initAndSetup( &argvParser,
argc,
argv,
optionDescriptors ) != 0 )
{
ANY_LOG( 0, "Error while initializing ArgvParser.", ANY_LOG_ERROR );
return false;
}
do
{
int optIdx = 0;
const char *parameter = NULL;
optIdx = ArgvParser_getCurrentArgument( &argvParser,
NULL,
NULL,
¶meter );
switch( optIdx )
{
case ARGVPARSER_NO_OPTION:
if( argument == NULL )
{
argument = parameter;
}
else
{
ANY_LOG( 0, "Too many arguments: %s\n\n", ANY_LOG_INFO, parameter );
usage( &argvParser );
retVal = -1;
}
break;
case OPT_HELP:
usage( &argvParser );
retVal = 1;
break;
case OPT_LIBRARY:
Any_strncpy( args.library, parameter, TESTSUITE_PARAM_MAXLEN );
break;
case OPT_INIT:
Any_strncpy( args.libraryInitString, parameter, TESTSUITE_PARAM_MAXLEN );
break;
case OPT_CHANNEL:
Any_strncpy( args.channelInitString, parameter, TESTSUITE_PARAM_MAXLEN );
break;
case OPT_FORMAT:
Any_strncpy( args.format, parameter, TESTSUITE_PARAM_MAXLEN );
break;
case OPT_OPTIONS:
Any_strncpy( args.opts, parameter, TESTSUITE_PARAM_MAXLEN );
break;
default:
{
ANY_LOG( 0, "Unknown argument: %s\n\n", ANY_LOG_ERROR, parameter );
usage( &argvParser );
retVal = -1;
}
break;
} // end Switch
} while( ArgvParser_advance( &argvParser ) && ( retVal != -1 || retVal != 1 ));
if( ArgvParser_hasErrorOccurred( &argvParser ))
{
ANY_LOG( 0, "Error in command line: %s\n\n", ANY_LOG_ERROR,
ArgvParser_getErrorMessage( &argvParser ));
usage( &argvParser );
retVal = -1;
}
return retVal;
}
static bool testSuite_loadFunctions( DynamicLoader *dl, const char *library, testSuite_functions *functions )
{
bool retVal = false;
ANY_REQUIRE( dl );
functions->newFunc = (testSuiteNewFunc *)DynamicLoader_getSymbolByClassAndMethodName( dl, library, "new" );
if( functions->newFunc == (testSuiteNewFunc *)NULL )
{
ANY_LOG( 0, "Unable to retrieve the New function pointer.", ANY_LOG_ERROR );
return retVal;
}
functions->initFromStringFunc = (testSuiteInitFromStringFunc *)DynamicLoader_getSymbolByClassAndMethodName( dl,
library,
"initFromString" );
if( functions->initFromStringFunc == (testSuiteInitFromStringFunc *)NULL )
{
ANY_LOG( 0, "Unable to retrieve the initFromString function pointer.", ANY_LOG_ERROR );
return retVal;
}
functions->serializeFunc = (testSuiteSerializeFunc *)DynamicLoader_getSymbolByClassAndMethodName( dl, library,
"serialize" );
if( functions->serializeFunc == (testSuiteSerializeFunc *)NULL )
{
ANY_LOG( 0, "Unable to retrieve the Serialize function pointer.", ANY_LOG_ERROR );
return retVal;
}
functions->clearFunc = (testSuiteClearFunc *)DynamicLoader_getSymbolByClassAndMethodName( dl, library, "clear" );
if( functions->clearFunc == (testSuiteClearFunc *)NULL )
{
ANY_LOG( 0, "Unable to retrieve the Clear function pointer.", ANY_LOG_ERROR );
return retVal;
}
functions->deleteFunc = (testSuiteDeleteFunc *)DynamicLoader_getSymbolByClassAndMethodName( dl, library, "delete" );
if( functions->deleteFunc == (testSuiteDeleteFunc *)NULL )
{
ANY_LOG( 0, "Unable to retrieve the Delete function pointer.", ANY_LOG_ERROR );
return retVal;
}
retVal = true;
return retVal;
}
/********
* Main *
********/
int main( int argc, char *argv[] )
{
ArgvParser argvParser;
int parseRetVal;
DynamicLoader *dl = NULL;
IOChannel *channel = (IOChannel *)NULL;
Serialize *serializer = (Serialize *)NULL;
char *libraryToLoad = (char *)NULL;
testSuite_args args;
testSuite_functions functions;
void *typeInstanceWriter = (void *)NULL;
void *typeInstanceReader = (void *)NULL;
char *verbose = (char *)NULL;
verbose = getenv((char *)"VERBOSE" );
if( verbose != NULL && Any_strcmp( verbose, (char *)"TRUE" ) == 0 )
{
Any_setDebugLevel( 10 );
}
else
{
Any_setDebugLevel( 1 );
}
args.library = (char *)ANY_BALLOC( TESTSUITE_PARAM_MAXLEN * sizeof( char ));
args.libraryInitString = (char *)ANY_BALLOC( TESTSUITE_PARAM_MAXLEN * sizeof( char ));
args.channelInitString = (char *)ANY_BALLOC( TESTSUITE_PARAM_MAXLEN * sizeof( char ));
args.format = (char *)ANY_BALLOC( TESTSUITE_PARAM_MAXLEN * sizeof( char ));
args.opts = (char *)ANY_BALLOC( TESTSUITE_PARAM_MAXLEN * sizeof( char ));
libraryToLoad = (char *)ANY_BALLOC( TESTSUITE_PARAM_MAXLEN * sizeof( char ));
ANY_REQUIRE( args.library );
ANY_REQUIRE( args.libraryInitString );
ANY_REQUIRE( args.channelInitString );
ANY_REQUIRE( args.format );
ANY_REQUIRE( args.opts );
ANY_REQUIRE( libraryToLoad );
memset( args.library, 0x00, TESTSUITE_PARAM_MAXLEN );
memset( args.libraryInitString, 0x00, TESTSUITE_PARAM_MAXLEN );
memset( args.channelInitString, 0x00, TESTSUITE_PARAM_MAXLEN );
memset( args.format, 0x00, TESTSUITE_PARAM_MAXLEN );
memset( args.opts, 0x00, TESTSUITE_PARAM_MAXLEN );
/************************
* Parsing of arguments *
************************/
parseRetVal = testSuite_parseArgs( argvParser, argc, argv, args );
/* ensure strings are properly null-terminated after _parseArgs() */
args.library[ TESTSUITE_PARAM_MAXLEN - 1 ] = '\0';
args.libraryInitString[ TESTSUITE_PARAM_MAXLEN - 1 ] = '\0';
args.channelInitString[ TESTSUITE_PARAM_MAXLEN - 1 ] = '\0';
args.format[ TESTSUITE_PARAM_MAXLEN - 1 ] = '\0';
args.opts[ TESTSUITE_PARAM_MAXLEN - 1 ] = '\0';
if( parseRetVal == -1 )
{
ANY_LOG( 0, "An error occurred while parsing arguments from command line.", ANY_LOG_INFO );
goto exitLabel;
}
else if( parseRetVal == 1 )
{
goto exitLabel;
}
ANY_REQUIRE_MSG( Any_strlen( args.library ) > 0, "You need to specify which library to load." );
ANY_REQUIRE_MSG( Any_strlen( args.channelInitString ) > 0, "You need to specify the IOChannel initString." );
ANY_REQUIRE_MSG( Any_strlen( args.format ) > 0, "You need to specify the Serialize format." );
/*******************
* Initializations *
*******************/
/* IOChannel */
channel = IOChannel_new();
ANY_REQUIRE( channel );
IOChannel_init( channel );
if( !IOChannel_openFromString( channel, args.channelInitString ))
{
ANY_LOG( 0, "Unable to open IOChannel", ANY_LOG_ERROR );
goto clearLabel;
}
/* Serialize */
serializer = Serialize_new();
ANY_REQUIRE( serializer );
Serialize_init( serializer, channel, SERIALIZE_STREAMMODE_NORMAL );
Serialize_setMode( serializer, SERIALIZE_MODE_WRITE );
Serialize_setFormat( serializer, args.format, args.opts );
/* Dynamic Loader */
dl = DynamicLoader_new();
ANY_REQUIRE_MSG( dl, "Unable to allocate memory for a new DynamicLoader instance" );
/* Get requested library and its symbols */
Any_snprintf( libraryToLoad, TESTSUITE_PARAM_MAXLEN, "lib%s"
SHARED_LIBRARY_EXT, args.library );
if( DynamicLoader_init( dl, libraryToLoad ) != 0 )
{
ANY_LOG( 0, "Error loading library %s: %s", ANY_LOG_ERROR, args.library, DynamicLoader_getError( dl ));
goto clearLabel;
}
if( !testSuite_loadFunctions( dl, args.library, &functions ))
{
ANY_LOG( 0, "Error loading functions.", ANY_LOG_ERROR );
goto clearLabel;
}
/* Create object and serialize it to stream */
typeInstanceWriter = functions.newFunc();
ANY_REQUIRE( typeInstanceWriter );
functions.initFromStringFunc( typeInstanceWriter, args.libraryInitString );
functions.serializeFunc( typeInstanceWriter, "test", serializer );
functions.clearFunc( typeInstanceWriter );
functions.deleteFunc( typeInstanceWriter );
/* Read back what we wrote */
IOChannel_rewind( channel );
Serialize_setMode( serializer, SERIALIZE_MODE_READ );
typeInstanceReader = functions.newFunc();
ANY_REQUIRE( typeInstanceReader );
functions.initFromStringFunc( typeInstanceReader, args.libraryInitString );
functions.serializeFunc( typeInstanceReader, "test", serializer );
functions.clearFunc( typeInstanceReader );
functions.deleteFunc( typeInstanceReader );
/********
* Exit *
********/
clearLabel:
DynamicLoader_clear( dl );
DynamicLoader_delete( dl );
IOChannel_close( channel );
IOChannel_clear( channel );
IOChannel_delete( channel );
Serialize_clear( serializer );
Serialize_delete( serializer );
exitLabel:
ANY_FREE( libraryToLoad );
ANY_FREE( args.library );
ANY_FREE( args.libraryInitString );
ANY_FREE( args.channelInitString );
ANY_FREE( args.format );
ANY_FREE( args.opts );
return EXIT_SUCCESS;
}
/* EOF */
| [
"marcus.stein@honda-ri.de"
] | marcus.stein@honda-ri.de |
9d70d0ab5e6d30f7911b88dc686f629f819e32a3 | 1cc3a3155feac0d400392d825121b31ffe5d5c3d | /Plugins/RadiantUI/Source/RadiantUI/Public/RadiantWebViewHUDElement.h | ad4ca35f015328900efd0f09092f728b2cf899b0 | [
"MIT"
] | permissive | rybzhw/RadiantUI | 2b2216f83b147868cf888ab3d9e5abb980ef5577 | 5444f990e5ed4a39572842d3364d3ff15ac7d656 | refs/heads/master | 2020-08-01T13:43:26.486993 | 2019-09-27T10:18:16 | 2019-09-27T10:18:16 | 211,013,572 | 1 | 0 | null | 2019-09-26T06:14:29 | 2019-09-26T06:14:28 | null | UTF-8 | C++ | false | false | 5,439 | h | // Copyright 2014 Joseph Riedel, Inc. All Rights Reserved.
// See LICENSE for licensing terms.
#pragma once
#include "SlateCore.h"
#include "SCompoundWidget.h"
#include "RadiantWebView.h"
#include "RadiantJavaScriptFunctionCallTargetInterface.h"
#include "RadiantWebViewHUDElement.generated.h"
class ARadiantWebViewHUD;
class URadiantWebViewHUDElement;
struct CefRuntimeMouseEvent;
class SRadiantWebViewHUDElement : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SRadiantWebViewHUDElement)
{}
SLATE_ARGUMENT(TWeakObjectPtr<ARadiantWebViewHUD>, HUDOwner)
SLATE_ARGUMENT(TWeakObjectPtr<URadiantWebViewHUDElement>, HUDElement)
SLATE_END_ARGS()
void Construct(const FArguments& InArgs);
virtual void Tick(const FGeometry& AllottedGeometry, const double InCurrentTime, const float InDeltaTime) override;
virtual FReply OnMouseButtonDown(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual FReply OnMouseButtonUp(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual FReply OnMouseMove(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual FReply OnMouseWheel(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
virtual FReply OnMouseButtonDoubleClick(const FGeometry& InMyGeometry, const FPointerEvent& InMouseEvent) override;
virtual FCursorReply OnCursorQuery(const FGeometry& MyGeometry, const FPointerEvent& CursorEvent) const override;
virtual FReply OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyboardEvent) override;
virtual FReply OnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& InKeyboardEvent) override;
virtual FReply OnKeyChar(const FGeometry& MyGeometry, const FCharacterEvent& InCharacterEvent) override;
virtual bool SupportsKeyboardFocus() const override;
virtual FReply OnFocusReceived(const FGeometry& MyGeometry, const FFocusEvent& InFocusEvent);
virtual void OnFocusLost(const FFocusEvent& InFocusEvent);
//virtual bool OnHitTest(const FGeometry& MyGeometry, FVector2D InAbsoluteCursorPosition) override;
private:
friend class ARadiantWebViewHUD;
void GetMouseState(const FGeometry& InGeometry, const FPointerEvent& InPointerEvent, CefRuntimeMouseEvent &OutMouseEvent);
FVector2D AbsoluteToLocal(const FGeometry& MyGeometry, const FVector2D AbsolutePosition);
FVector2D ScreenPosition;
FVector2D ScreenSize;
bool MouseCaptured;
TWeakObjectPtr<ARadiantWebViewHUD> HUDOwner;
TWeakObjectPtr<URadiantWebViewHUDElement> HUDElement;
};
UENUM(BlueprintType)
namespace ERadiantHUDElementInputMode
{
enum Type
{
NoInput,
MouseOnly,
MouseAndKeyboard
};
}
UCLASS(abstract, DefaultToInstanced, Blueprintable)
class RADIANTUI_API URadiantWebViewHUDElement : public UObject, public IRadiantJavaScriptFunctionCallTargetInterface
{
GENERATED_BODY()
public:
URadiantWebViewHUDElement(const FObjectInitializer& ObjectInitializer);
TSharedPtr<FRadiantWebView> WebView;
UPROPERTY(EditDefaultsOnly, Category = "WebView")
FRadiantWebViewDefaultSettings DefaultSettings;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "HUD|Element")
uint32 bVisible:1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HUD|Element")
uint32 bMouseThumbNavigate:1;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "HUD|Element")
TEnumAsByte<ERadiantHUDElementInputMode::Type> InputMode;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "HUD|Element")
FVector2D ViewportResolutionFactor;
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "HUD|Element")
uint32 bAutoMatchViewportResolution:1;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HUD|Element")
FVector2D Position;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "HUD|Element")
FVector2D Size;
UFUNCTION(BlueprintCallable, Category = "HUD|Element")
void SetVisible(bool IsVisible);
UFUNCTION(BlueprintCallable, Category = "HUD|Element")
void SetInputMode(TEnumAsByte<ERadiantHUDElementInputMode::Type> InInputMode);
UFUNCTION(BlueprintCallable, Category = "WebView")
bool CanNavigateForward();
UFUNCTION(BlueprintCallable, Category = "WebView")
bool CanNavigateBackward();
UFUNCTION(BlueprintCallable, Category = "WebView")
void NavigateForward();
UFUNCTION(BlueprintCallable, Category = "WebView")
void NavigateBackward();
UFUNCTION(BlueprintCallable, Category = "WebView")
void LoadURL(const FString& URL);
UFUNCTION(BlueprintCallable, Category = "WebView")
FString GetURL();
UFUNCTION(BlueprintCallable, Category = "WebView")
void SetRefreshRate(float FramesPerSecond);
UFUNCTION(BlueprintCallable, Category = "WebView")
float GetRefreshRate();
UFUNCTION(BlueprintCallable, BlueprintPure, Category = JavaScript)
TScriptInterface<IRadiantJavaScriptFunctionCallTargetInterface> GetJavaScriptCallContext();
//void ForceFocus(APlayerController *Owner);
virtual void CallJavaScriptFunction(const FString& HookName, UObject* Parameters) override;
// Begin UObject Interface
virtual void PostInitProperties() override;
virtual void Serialize(FArchive& Ar) override;
virtual UWorld* GetWorld() const override;
// End UObject Interface
private:
UWorld* World;
void SetSlateVisibility();
void OnExecuteJSHook(const FString& HookName, ICefRuntimeVariantList* Arguments);
friend class ARadiantWebViewHUD;
TSharedPtr<class SWeakWidget> Container;
TSharedPtr<SRadiantWebViewHUDElement> SWidget;
}; | [
"raffael.holz@scuderia-mensa.de"
] | raffael.holz@scuderia-mensa.de |
142b980d56c2fa0e9f209c6289a0a8a639f99a42 | ffa427f7667d7fc05c4e872966cbb272242d3c19 | /agc/agc016/agc016-b.cpp | 4955a7b262abc298878f69ad81ed0fe5acd6c77a | [] | no_license | kubonits/atcoder | 10fb6c9477c9b5ff7f963224a2c851aaf10b4b65 | 5aa001aab4aaabdac2de8c1abd624e3d1c08d3e3 | refs/heads/master | 2022-10-02T06:42:32.535800 | 2022-08-29T15:44:55 | 2022-08-29T15:44:55 | 160,827,483 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 636 | cpp | #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
int n,a[100000],mina,maxa,cnt=0;
scanf("%d",&n);
mina=n;
maxa=0;
for(int i=0;i<n;i++){
scanf("%d",&a[i]);
mina=min(mina,a[i]);
maxa=max(maxa,a[i]);
}
if(mina+1<maxa){
printf("No\n");
return 0;
}
for(int i=0;i<n;i++){
if(a[i]==mina&&mina!=maxa){
cnt++;
}
}
if(mina==maxa&&(mina==n-1||n>=mina*2)){
printf("Yes\n");
return 0;
}
if(cnt>=maxa||n-cnt<2*(maxa-cnt)){
printf("No\n");
return 0;
}
printf("Yes\n");
} | [
"kouhei.08.10.09.s@gmail.com"
] | kouhei.08.10.09.s@gmail.com |
4925a2db73bff4269a59a9789ebe083936cea02b | e2bf5d20fe26632da3214bc623e7c82afe50d63a | /ModernCocoaFarmer/Source/Stats/Modifier.cpp | c468f7e954c86bf2fa44fdbf34f5e06e40c6f73a | [] | no_license | AlanWills/ModernCocoaFarmer | ae0d8be36960c1dfe557c59bdf23912a4b3cb37a | d04beb8e6b8d538a4cc468958a80f86803d49a5d | refs/heads/master | 2021-07-11T23:42:08.358865 | 2020-07-21T21:30:49 | 2020-07-21T21:30:49 | 81,137,087 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 642 | cpp | #include "Stats/Modifier.h"
#include "UtilityHeaders/ScriptableObjectHeaders.h"
namespace MCF::Stats
{
REGISTER_SCRIPTABLE_OBJECT(Modifier);
//------------------------------------------------------------------------------------------------
const char* const Modifier::AMOUNT_FIELD_NAME = "amount";
const char* const Modifier::CHANGE_TYPE_FIELD_NAME = "change_type";
//------------------------------------------------------------------------------------------------
Modifier::Modifier() :
m_amount(createValueField<float>(AMOUNT_FIELD_NAME)),
m_changeType(createValueField<ChangeType>(CHANGE_TYPE_FIELD_NAME))
{
}
} | [
"alawills@googlemail.com"
] | alawills@googlemail.com |
54c5cb624a42f1c2b1d1ec134112f41e08eabcfb | 661efb9238a4682354c7b5400ca9bcc86740667d | /HartreeFockApp/GaussianOrbital.h | 04a7f714f6af6a03905325a95eccb5287b5b3882 | [
"Apache-2.0"
] | permissive | piotrfutymski/Hartree-Fock-App-Windows | 340fc380c69129183df2206e3c2ba646fd464b0b | 35c4882c71e8aca14e66595961ff2a09084edb7b | refs/heads/master | 2022-12-08T20:21:20.904678 | 2020-08-25T09:57:24 | 2020-08-25T09:57:24 | 266,883,840 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,772 | h | #pragma once
#include "Orbital.h"
#include "Nucleons.h"
#include "Boys.h"
#include <map>
class GaussianOrbital : public Orbital
{
public:
GaussianOrbital(const Position & R, double a) :R0{ R}, alfa{a}
{
this->recalculateNormalizationParam();
}
void setalfa(double a);
Position getR();
double getalfa();
double getNormalizationParam();
// Integrals
double calculateOverlapIntegral(const GaussianOrbital & right) const;
//
double calculateNucleonIntegral(const GaussianOrbital & right, const std::vector<Nucleon> & nucleons)const;
double calculateNucleonIntegral(const GaussianOrbital & right, const std::vector<Nucleon> & nucleons, double S)const;
double calculateHIntegral(const GaussianOrbital & right, const std::vector<Nucleon> & nucleons)const;
double calculateHIntegral(const GaussianOrbital & right, const std::vector<Nucleon> & nucleons, double S)const;
double calculateKineticIntegral(const GaussianOrbital & right)const;
double calculateKineticIntegral(const GaussianOrbital & right, double S)const;
//
static double calulateTwoElectronIntegral(const GaussianOrbital &a, const GaussianOrbital &b, const GaussianOrbital &c, const GaussianOrbital &d);
static double calulateTwoElectronIntegral(const GaussianOrbital &a, const GaussianOrbital &b, const GaussianOrbital &c, const GaussianOrbital &d, double Spq, double Srs);
private:
Position R0;
double alfa;
double normalizationParam;
private:
void recalculateNormalizationParam();
//Culomb
double calculateCulombIntegral(const GaussianOrbital& right, const Position& p)const;
double calculateCulombIntegral(const GaussianOrbital& right, const Position& p, double S)const;
public:
// Inherited via Orbital
virtual std::complex<double> F_X(const Position &) override;
};
| [
"piotr.futymski@wp.pl"
] | piotr.futymski@wp.pl |
c8d3ae25d22c8893ea719594827de499af8e703e | 37e6184aa942daabe086ce7a4ef2088d8f6609a6 | /src/daemon/daemonizer/windows_service_runner.h | 8039f5e446560baf991f5770de32b8fa16d80440 | [] | no_license | Liberty-Chain/LibertyChain | a3c06ee002d353fcb4f2f1fae595ca6803eaaded | 6092125d4a9ce5b15d8216a239ba2d370a9cd85a | refs/heads/master | 2023-06-21T05:20:16.907006 | 2021-08-12T09:28:53 | 2021-08-12T09:28:53 | 394,551,819 | 3 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 5,257 | h | // The Liberty Project
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are
// permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of
// conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list
// of conditions and the following disclaimer in the documentation and/or other
// materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be
// used to endorse or promote products derived from this software without specific
// prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#ifdef WIN32
#undef UNICODE
#undef _UNICODE
#include "daemonizer/windows_service.h"
#include <memory>
#include <string>
#include <vector>
#include <windows.h>
namespace windows {
namespace
{
std::vector<char> vecstring(std::string const & str)
{
std::vector<char> result{str.begin(), str.end()};
result.push_back('\0');
return result;
}
}
template <typename T_handler>
class t_service_runner final
{
private:
SERVICE_STATUS_HANDLE m_status_handle{nullptr};
SERVICE_STATUS m_status{};
boost::mutex m_lock{};
std::string m_name;
T_handler m_handler;
static std::unique_ptr<t_service_runner<T_handler>> sp_instance;
public:
t_service_runner(
std::string name
, T_handler handler
)
: m_name{std::move(name)}
, m_handler{std::move(handler)}
{
m_status.dwServiceType = SERVICE_WIN32;
m_status.dwCurrentState = SERVICE_STOPPED;
m_status.dwControlsAccepted = 0;
m_status.dwWin32ExitCode = NO_ERROR;
m_status.dwServiceSpecificExitCode = NO_ERROR;
m_status.dwCheckPoint = 0;
m_status.dwWaitHint = 0;
}
t_service_runner & operator=(t_service_runner && other)
{
if (this != &other)
{
m_status_handle = std::move(other.m_status_handle);
m_status = std::move(other.m_status);
m_name = std::move(other.m_name);
m_handler = std::move(other.m_handler);
}
return *this;
}
static void run(
std::string name
, T_handler handler
)
{
sp_instance.reset(new t_service_runner<T_handler>{
std::move(name)
, std::move(handler)
});
sp_instance->run_();
}
private:
void run_()
{
SERVICE_TABLE_ENTRY table[] =
{
{ vecstring(m_name).data(), &service_main }
, { 0, 0 }
};
StartServiceCtrlDispatcher(table);
}
void report_status(DWORD status)
{
m_status.dwCurrentState = status;
if (status == SERVICE_RUNNING)
{
m_status.dwControlsAccepted = SERVICE_ACCEPT_STOP | SERVICE_ACCEPT_SHUTDOWN;
}
else if(status == SERVICE_STOP_PENDING)
{
m_status.dwControlsAccepted = 0;
}
SetServiceStatus(m_status_handle, &m_status);
}
static void WINAPI service_main(DWORD argc, LPSTR * argv)
{
sp_instance->service_main_(argc, argv);
}
void service_main_(DWORD argc, LPSTR * argv)
{
m_status_handle = RegisterServiceCtrlHandler(m_name.c_str(), &on_state_change_request);
if (m_status_handle == nullptr) return;
report_status(SERVICE_START_PENDING);
report_status(SERVICE_RUNNING);
m_handler.run();
on_state_change_request_(SERVICE_CONTROL_STOP);
// Ensure that the service is uninstalled
uninstall_service(m_name);
}
static void WINAPI on_state_change_request(DWORD control_code)
{
sp_instance->on_state_change_request_(control_code);
}
void on_state_change_request_(DWORD control_code)
{
switch (control_code)
{
case SERVICE_CONTROL_INTERROGATE:
break;
case SERVICE_CONTROL_SHUTDOWN:
case SERVICE_CONTROL_STOP:
report_status(SERVICE_STOP_PENDING);
m_handler.stop();
report_status(SERVICE_STOPPED);
break;
case SERVICE_CONTROL_PAUSE:
break;
case SERVICE_CONTROL_CONTINUE:
break;
default:
break;
}
}
};
template <typename T_handler>
std::unique_ptr<t_service_runner<T_handler>> t_service_runner<T_handler>::sp_instance;
}
#endif
| [
"420338901@qq.com"
] | 420338901@qq.com |
843325f64e71caf81d7c6fccdf528bbb3f70fb6b | 4bf2523f9a57ef0728630d05ce2d38b05686547d | /Compo/Dev_Ex/ExpressPrinting System/Packages/dxPSdxLCLnkC10.cpp | 03a1bffee1495b095d44ff0d337ab348a673c19a | [] | no_license | zeroptr/ceda_tic | 980bee99b829f99575586b5110985ba90f8f56aa | 72586d6a10a5426a889d45ad37479c1bf6f3fb49 | refs/heads/main | 2023-03-17T16:36:58.586885 | 2021-03-07T20:30:34 | 2021-03-07T20:30:34 | 345,381,196 | 0 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 948 | cpp | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
USEPACKAGE("dxCoreC10.bpi");
USEPACKAGE("rtl.bpi");
USEPACKAGE("vcl.bpi");
USEPACKAGE("designide.bpi");
USEPACKAGE("dxPSCoreC10.bpi");
USERES("dxPSdxLCLnkC10.res");
USEPACKAGE("dxPSLnksC10.bpi");
USEPACKAGE("cxLibraryC10.bpi");
USEPACKAGE("cxDataC10.bpi");
USEPACKAGE("cxEditorsC10.bpi");
USEPACKAGE("dxLayoutControlC10.bpi");
USEUNIT("dxPSdxLCLnk.pas");
USEUNIT("dxPSdxLCLnkReg.pas");
//---------------------------------------------------------------------------
#pragma package(smart_init)
//---------------------------------------------------------------------------
// Package source.
//---------------------------------------------------------------------------
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void*)
{
return 1;
}
//---------------------------------------------------------------------------
| [
"53816327+zeroptr@users.noreply.github.com"
] | 53816327+zeroptr@users.noreply.github.com |
0c094388834875b7bb477abfb205c425ab09d30e | 7ab3757bde602ebe0b2f9e49d7e1d5f672ee150a | /easydb/src/easydb/PackParticle2D.h | b5827ada6b6fa610026fee599ff061d53d6569d1 | [
"MIT"
] | permissive | brucelevis/easyeditor | 310dc05084b06de48067acd7ef5d6882fd5b7bba | d0bb660a491c7d990b0dae5b6fa4188d793444d9 | refs/heads/master | 2021-01-16T18:36:37.012604 | 2016-08-11T11:25:20 | 2016-08-11T11:25:20 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 567 | h | #ifndef _EASYDB_PACK_PARTICLE2D_H_
#define _EASYDB_PACK_PARTICLE2D_H_
#include "ICommand.h"
namespace edb
{
class PackParticle2D : public ICommand
{
public:
PackParticle2D() {}
//
// interface ICommand
//
virtual std::string Command() const;
virtual std::string Description() const;
virtual std::string Usage() const;
virtual int Run(int argc, char *argv[]);
static ICommand* Create() { return new PackParticle2D(); }
private:
void Trigger(const std::string& dir, const std::string& out);
}; // PackParticle2D
}
#endif // _EASYDB_PACK_PARTICLE2D_H_ | [
"zhuguang@ejoy.com"
] | zhuguang@ejoy.com |
61263a98e2bec3a76485eb6d3c5b341343c75215 | 914a8f1121b0ff2ffb13dbda1cd2c4abd1d51f3f | /port_versions/ports_two_way_inf(pingpong)/my_ping_pong.model/associations.cpp | f6dcb35a3175051d56e195d1bb10a3ce58e064c8 | [] | no_license | nagyandras95/Egyetem | 053a4d26b8262dbf4c57afb8e686953615690dff | 249b429b4bf227217fd03a7a176dfdb48b813d9c | refs/heads/master | 2020-08-12T10:15:44.025377 | 2019-10-16T09:16:24 | 2019-10-16T09:16:24 | 53,161,364 | 0 | 0 | null | 2016-10-30T12:03:52 | 2016-03-04T19:47:45 | JavaScript | UTF-8 | C++ | false | false | 1,059 | cpp | #include "associations.hpp"
#include "Player.hpp"
#include "Table.hpp"
#include "PingPongMatch.hpp"
#include "Judge.hpp"
template<>
void Table::link<TableComposite, typename TableComposite::player>(
Player* object) {
TableComposite_player.addAssoc(object);
}
template<>
void Table::unlink<TableComposite, typename TableComposite::player>(
Player* object) {
TableComposite_player.removeAssoc(object);
}
template<>
void PingPongMatch::link<MatchJudgeComposite,
typename MatchJudgeComposite::judge>(Judge* object) {
MatchJudgeComposite_judge.addAssoc(object);
}
template<>
void PingPongMatch::unlink<MatchJudgeComposite,
typename MatchJudgeComposite::judge>(Judge* object) {
MatchJudgeComposite_judge.removeAssoc(object);
}
template<>
void PingPongMatch::link<MatchTableComposite,
typename MatchTableComposite::table>(Table* object) {
MatchTableComposite_table.addAssoc(object);
}
template<>
void PingPongMatch::unlink<MatchTableComposite,
typename MatchTableComposite::table>(Table* object) {
MatchTableComposite_table.removeAssoc(object);
}
| [
"nagyandras95@inf.elte.hu"
] | nagyandras95@inf.elte.hu |
9118f098a0016a0d29f5177e42afc5e1836a2b47 | d3a4f1389f5cdd64cb61ea76d63fe4b051843e6f | /ch10/Ex_10_27.cpp | eb2dcd22067ed71e26d3d0a43ea149a4e826278b | [] | no_license | SeA-xiAoD/Cpp_Primer_Homework | 3562f61b8518ab51f36a9d202c0c0dffd8b088ec | dfa13331fb44062ea967d176270731b5a921afca | refs/heads/master | 2021-04-06T01:36:15.725887 | 2018-06-04T13:29:34 | 2018-06-04T13:29:34 | 124,748,094 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 311 | cpp | #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main()
{
vector<int> vi{1, 1, 2, 2, 3, 4, 5, 5, 6, 7, 7, 8 ,9 ,10 ,10};
vector<int> v;
unique_copy(vi.begin(), vi.end(), back_inserter(v));
for(int i : v)
{
cout << i << endl;
}
return 0;
} | [
"1002811562@qq.com"
] | 1002811562@qq.com |
18b16d53f1639388b07334cc34093e39b8b43eb0 | cef9338553909b1e2a38972f1cfddc4278c19d51 | /test/balance.cpp | 800b1639f7030d16e3d996d53048b2d29f1b6224 | [
"BSD-3-Clause"
] | permissive | SCOREC/EnGPar | da43bdc77c1d66a05e01ca407713ce46d12a2a42 | 86e5fa5131528652e32e33409024cfb9cdadd8b0 | refs/heads/master | 2023-07-09T12:59:28.294923 | 2023-06-29T01:51:27 | 2023-06-29T01:51:27 | 42,109,237 | 5 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 1,545 | cpp | #include <engpar_support.h>
#include <engpar.h>
#include <engpar_input.h>
#include <binGraph.h>
#include <cstring>
#include "buildGraphs.h"
#include <engpar_diffusive_input.h>
#include <engpar_metrics.h>
bool cmpebin(char* str) {
return strlen(str)>4&&strcmp(str+strlen(str)-5,".ebin")==0;
}
int main(int argc, char* argv[]) {
MPI_Init(&argc,&argv);
EnGPar_Initialize();
EnGPar_Open_Log();
if (argc < 3 || argc > 5) {
if (!PCU_Comm_Self()) {
printf("Usage: %s <graph.ebin> <tolerance> [verbosity] [save_prefix]\n", argv[0]);
printf("Usage: %s <bgd_prefix> <tolerance> [verbosity] [save_prefix]\n", argv[0]);
}
EnGPar_Finalize();
MPI_Finalize();
assert(false);
}
agi::Ngraph* g=NULL;
if (cmpebin(argv[1]))
g= agi::createBinGraph(argv[1]);
else {
g = agi::createEmptyGraph();
g->loadFromFile(argv[1]);
}
double tol = atof(argv[2]);
//Evaluate the new partition
engpar::evaluatePartition(g);
double step_factor = 0.1;
engpar::DiffusiveInput* input = engpar::createDiffusiveInput(g,step_factor);
for (agi::etype t = 0; t < g->numEdgeTypes(); ++t)
input->addPriority(t,tol);
input->addPriority(-1,tol);
int verbosity = 1;
if (argc > 3)
verbosity = atoi(argv[3]);
//Create the balancer
engpar::balance(input,verbosity);
if (argc > 4) {
g->saveToFile(argv[4]);
}
//Evaluate the new partition
engpar::evaluatePartition(g);
//Destroy graph
agi::destroyGraph(g);
EnGPar_Finalize();
MPI_Finalize();
return 0;
}
| [
"diamog@rpi.edu"
] | diamog@rpi.edu |
6f496faabd0bb2d3ee0a213637fa9c37f6d2e449 | 2eea367122c49a4cf625c7088895e09244ffc621 | /hw5/sort2.cpp | 7fa47a45279cb5c112ce6e35761b52f097a71d6b | [] | no_license | rachelBonanno/comp15 | a13bfaad3d8e4fd1f4d9c0da6b43746db69bdfa1 | d3661be065d989085698842dce47ef8cb053b763 | refs/heads/master | 2023-03-20T16:37:57.451816 | 2017-06-15T22:02:25 | 2017-06-15T22:02:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,356 | cpp | //
// InsertionSort.cpp
// Sorts integers using the InsertionSort algorithm
#include "sort2.h"
using namespace std;
InsertionSort::InsertionSort() { //constructor
sortArray.length = 0;
sortArray.arr = NULL;
}
InsertionSort::~InsertionSort() { //destructor
delete [] sortArray.arr;
}
void InsertionSort::readList() { //read in list (from Selection Sort readList)
int currentCapacity = 10;
sortArray.arr = new int[currentCapacity];
while (cin >> sortArray.arr[sortArray.length]) {
++sortArray.length;
if (sortArray.length==currentCapacity) {
int *temp = new int[currentCapacity*2];
for (int i=0;i<currentCapacity;i++) {
temp[i] = sortArray.arr[i];
}
delete [] sortArray.arr;
sortArray.arr = temp;
currentCapacity *= 2;
}
}
}
void InsertionSort::sort() {
//nest for and while loop compares previous element to current element
//swaps if necessary
for (int i=1; i<sortArray.length; i++) {
int j = i;
while(sortArray.arr[j-1] > sortArray.arr[j]) {
int temp = sortArray.arr[j-1];
sortArray.arr[j-1] = sortArray.arr[j];
sortArray.arr[j] = temp;
j = j-1;
}
}
}
void InsertionSort::printArray() {
// prints out the integers in sorted order
for (int i = 0; i<sortArray.length; i++) {
std::cout << sortArray.arr[i] << std::endl;
}
}
| [
"erika.marmol@tufts.edu"
] | erika.marmol@tufts.edu |
40eb7bbef660a0f4352d8bb0b62f8e1bd041833b | da3d7300d904ed7ecf2380b8791a6650f8a33446 | /src/pointers/include/swapping.hpp | 5b03389f041c9b8942ad026cc5f267344eb9159f | [
"MIT"
] | permissive | basegpu/cpp-snippets | ae9a3128465f78ee72e9811395262afc11542d58 | bdfd38c0c8ca0db34f263466c5b5e9f3cd904337 | refs/heads/master | 2020-07-29T02:33:21.874772 | 2019-12-19T21:18:37 | 2019-12-19T21:18:37 | 209,633,588 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 426 | hpp | #pragma once
#include <algorithm>
namespace pointers
{
typedef struct Data
{
Data() : T_(nullptr), Tplus1_(nullptr) {}
Data(int* T, int* Tp1) : T_(T), Tplus1_(Tp1) {}
int* GetTplus1()
{
return this->Tplus1_;
}
void Swap()
{
std::swap(this->T_, this->Tplus1_);
}
private:
int* T_;
int* Tplus1_;
} Data;
}
| [
"sapeter@ethz.ch"
] | sapeter@ethz.ch |
4370ba30445673791bd41fe3de0d4455f407bb25 | 9d684073707de7b6c1eff7c2f36ef53dd137655d | /qcom-caf/apq8084/display/libhdmi/hdmi.cpp | 79db5366228941378c7f9d5394e8a12e992e78c0 | [] | no_license | segfault2k/stuff | a8f1e5f4a9b023ba3c20b25e28b618dd0d7177b2 | 591a8cd382791c970fc75a41428be76bef98e375 | refs/heads/master | 2023-06-27T21:14:22.355725 | 2021-08-04T22:33:55 | 2021-08-04T22:33:55 | 382,970,191 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 28,322 | cpp | /*
* Copyright (C) 2010 The Android Open Source Project
* Copyright (C) 2012-2015, The Linux Foundation. All rights reserved.
*
* Not a Contribution, Apache license notifications and license are
* retained for attribution purposes only.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define DEBUG 0
#include <fcntl.h>
#include <linux/msm_mdp.h>
#include <video/msm_hdmi_modes.h>
#include <linux/fb.h>
#include <sys/ioctl.h>
#include <cutils/properties.h>
#include "hwc_utils.h"
#include "hdmi.h"
#include "overlayUtils.h"
#include "overlay.h"
#include "mdp_version.h"
#include "qd_utils.h"
using namespace android;
using namespace qdutils;
namespace qhwc {
#define UNKNOWN_STRING "unknown"
#define SPD_NAME_LENGTH 16
/* The array gEDIDData contains a list of modes currently
* supported by HDMI and display, and modes that are not
* supported i.e. interlaced modes.
* In order to add support for a new mode, the mode must be
* appended to the end of the array.
*
* Each new entry must contain the following:
* -Mode: a video format defined in msm_hdmi_modes.h
* -Width: x resolution for the mode
* -Height: y resolution for the mode
* -FPS: the frame rate for the mode
* -Mode Order: the priority for the new mode that is used when determining
* the best mode when the HDMI display is connected.
*/
EDIDData gEDIDData [] = {
EDIDData(HDMI_VFRMT_1440x480i60_4_3, 1440, 480, 60, 1),
EDIDData(HDMI_VFRMT_1440x480i60_16_9, 1440, 480, 60, 2),
EDIDData(HDMI_VFRMT_1440x576i50_4_3, 1440, 576, 50, 3),
EDIDData(HDMI_VFRMT_1440x576i50_16_9, 1440, 576, 50, 4),
EDIDData(HDMI_VFRMT_1920x1080i60_16_9, 1920, 1080, 60, 5),
EDIDData(HDMI_VFRMT_640x480p60_4_3, 640, 480, 60, 6),
EDIDData(HDMI_VFRMT_720x480p60_4_3, 720, 480, 60, 7),
EDIDData(HDMI_VFRMT_720x480p60_16_9, 720, 480, 60, 8),
EDIDData(HDMI_VFRMT_720x576p50_4_3, 720, 576, 50, 9),
EDIDData(HDMI_VFRMT_720x576p50_16_9, 720, 576, 50, 10),
EDIDData(HDMI_VFRMT_800x600p60_4_3, 800, 600, 60, 11),
EDIDData(HDMI_VFRMT_848x480p60_16_9, 848, 480, 60, 12),
EDIDData(HDMI_VFRMT_1024x768p60_4_3, 1024, 768, 60, 13),
EDIDData(HDMI_VFRMT_1280x1024p60_5_4, 1280, 1024, 60, 14),
EDIDData(HDMI_VFRMT_1280x720p50_16_9, 1280, 720, 50, 15),
EDIDData(HDMI_VFRMT_1280x720p60_16_9, 1280, 720, 60, 16),
EDIDData(HDMI_VFRMT_1280x800p60_16_10, 1280, 800, 60, 17),
EDIDData(HDMI_VFRMT_1280x960p60_4_3, 1280, 960, 60, 18),
EDIDData(HDMI_VFRMT_1360x768p60_16_9, 1360, 768, 60, 19),
EDIDData(HDMI_VFRMT_1366x768p60_16_10, 1366, 768, 60, 20),
EDIDData(HDMI_VFRMT_1440x900p60_16_10, 1440, 900, 60, 21),
EDIDData(HDMI_VFRMT_1400x1050p60_4_3, 1400, 1050, 60, 22),
EDIDData(HDMI_VFRMT_1680x1050p60_16_10, 1680, 1050, 60, 23),
EDIDData(HDMI_VFRMT_1600x1200p60_4_3, 1600, 1200, 60, 24),
EDIDData(HDMI_VFRMT_1920x1080p24_16_9, 1920, 1080, 24, 25),
EDIDData(HDMI_VFRMT_1920x1080p25_16_9, 1920, 1080, 25, 26),
EDIDData(HDMI_VFRMT_1920x1080p30_16_9, 1920, 1080, 30, 27),
EDIDData(HDMI_VFRMT_1920x1080p50_16_9, 1920, 1080, 50, 28),
EDIDData(HDMI_VFRMT_1920x1080p60_16_9, 1920, 1080, 60, 29),
EDIDData(HDMI_VFRMT_1920x1200p60_16_10, 1920, 1200, 60, 30),
EDIDData(HDMI_VFRMT_2560x1600p60_16_9, 2560, 1600, 60, 31),
EDIDData(HDMI_VFRMT_3840x2160p24_16_9, 3840, 2160, 24, 32),
EDIDData(HDMI_VFRMT_3840x2160p25_16_9, 3840, 2160, 25, 33),
EDIDData(HDMI_VFRMT_3840x2160p30_16_9, 3840, 2160, 30, 34),
EDIDData(HDMI_VFRMT_4096x2160p24_16_9, 4096, 2160, 24, 35),
};
// Number of modes in gEDIDData
const int gEDIDCount = (sizeof(gEDIDData)/sizeof(gEDIDData)[0]);
int HDMIDisplay::configure() {
if(!openFrameBuffer()) {
ALOGE("%s: Failed to open FB: %d", __FUNCTION__, mFbNum);
return -1;
}
readCEUnderscanInfo();
readResolution();
/* Used for changing the resolution
* getUserConfig will get the preferred
* config index set thru adb shell */
mActiveConfig = getUserConfig();
if (mActiveConfig == -1) {
//Get the best mode and set
mActiveConfig = getBestConfig();
}
// Read the system property to determine if downscale feature is enabled.
char value[PROPERTY_VALUE_MAX];
mMDPDownscaleEnabled = false;
if(property_get("sys.hwc.mdp_downscale_enabled", value, "false")
&& !strcmp(value, "true")) {
mMDPDownscaleEnabled = true;
}
// Set the mode corresponding to the active index
mCurrentMode = mEDIDModes[mActiveConfig];
setAttributes();
// set system property
property_set("hw.hdmiON", "1");
// XXX: A debug property can be used to enable resolution change for
// testing purposes: debug.hwc.enable_resolution_change
mEnableResolutionChange = false;
if(property_get("debug.hwc.enable_resolution_change", value, "false")
&& !strcmp(value, "true")) {
mEnableResolutionChange = true;
}
return 0;
}
void HDMIDisplay::getAttributes(uint32_t& width, uint32_t& height) {
uint32_t fps = 0;
getAttrForMode(width, height, fps);
}
int HDMIDisplay::teardown() {
closeFrameBuffer();
resetInfo();
// unset system property
property_set("hw.hdmiON", "0");
return 0;
}
HDMIDisplay::HDMIDisplay():mFd(-1),
mCurrentMode(-1), mModeCount(0), mPrimaryWidth(0), mPrimaryHeight(0),
mUnderscanSupported(false), mMDPDownscaleEnabled(false)
{
memset(&mVInfo, 0, sizeof(mVInfo));
mDisplayId = HWC_DISPLAY_EXTERNAL;
// Update the display if HDMI is connected as primary
if (isHDMIPrimaryDisplay()) {
mDisplayId = HWC_DISPLAY_PRIMARY;
}
mFbNum = overlay::Overlay::getInstance()->getFbForDpy(mDisplayId);
// Disable HPD at start if HDMI is external, it will be enabled later
// when the display powers on
// This helps for framework reboot or adb shell stop/start
if (mDisplayId) {
writeHPDOption(0);
}
// for HDMI - retreive all the modes supported by the driver
if(mFbNum != -1) {
supported_video_mode_lut =
new msm_hdmi_mode_timing_info[HDMI_VFRMT_MAX];
// Populate the mode table for supported modes
MSM_HDMI_MODES_INIT_TIMINGS(supported_video_mode_lut);
MSM_HDMI_MODES_SET_SUPP_TIMINGS(supported_video_mode_lut,
MSM_HDMI_MODES_ALL);
// Update the Source Product Information
// Vendor Name
setSPDInfo("vendor_name", "ro.product.manufacturer");
// Product Description
setSPDInfo("product_description", "ro.product.name");
}
ALOGD_IF(DEBUG, "%s mDisplayId(%d) mFbNum(%d)",
__FUNCTION__, mDisplayId, mFbNum);
}
/* gets the product manufacturer and product name and writes it
* to the sysfs node, so that the driver can get that information
* Used to show QCOM 8974 instead of Input 1 for example
*/
void HDMIDisplay::setSPDInfo(const char* node, const char* property) {
char info[PROPERTY_VALUE_MAX];
ssize_t err = -1;
int spdFile = openDeviceNode(node, O_RDWR);
if (spdFile >= 0) {
memset(info, 0, sizeof(info));
property_get(property, info, UNKNOWN_STRING);
ALOGD_IF(DEBUG, "In %s: %s = %s",
__FUNCTION__, property, info);
if (strncmp(info, UNKNOWN_STRING, SPD_NAME_LENGTH)) {
err = write(spdFile, info, strlen(info));
if (err <= 0) {
ALOGE("%s: file write failed for '%s'"
"err no = %d", __FUNCTION__, node, errno);
}
} else {
ALOGD_IF(DEBUG, "%s: property_get failed for SPD %s",
__FUNCTION__, node);
}
close(spdFile);
}
}
void HDMIDisplay::setHPD(uint32_t value) {
ALOGD_IF(DEBUG,"HPD enabled=%d", value);
writeHPDOption(value);
}
void HDMIDisplay::setActionSafeDimension(int w, int h) {
ALOGD_IF(DEBUG,"ActionSafe w=%d h=%d", w, h);
char actionsafeWidth[PROPERTY_VALUE_MAX];
char actionsafeHeight[PROPERTY_VALUE_MAX];
snprintf(actionsafeWidth, sizeof(actionsafeWidth), "%d", w);
property_set("persist.sys.actionsafe.width", actionsafeWidth);
snprintf(actionsafeHeight, sizeof(actionsafeHeight), "%d", h);
property_set("persist.sys.actionsafe.height", actionsafeHeight);
}
int HDMIDisplay::getModeCount() const {
ALOGD_IF(DEBUG,"HPD mModeCount=%d", mModeCount);
return mModeCount;
}
void HDMIDisplay::readCEUnderscanInfo()
{
int hdmiScanInfoFile = -1;
ssize_t len = -1;
char scanInfo[17];
char *ce_info_str = NULL;
char *save_ptr;
const char token[] = ", \n";
int ce_info = -1;
memset(scanInfo, 0, sizeof(scanInfo));
hdmiScanInfoFile = openDeviceNode("scan_info", O_RDONLY);
if (hdmiScanInfoFile < 0) {
return;
} else {
len = read(hdmiScanInfoFile, scanInfo, sizeof(scanInfo)-1);
ALOGD("%s: Scan Info string: %s length = %zu",
__FUNCTION__, scanInfo, len);
if (len <= 0) {
close(hdmiScanInfoFile);
ALOGE("%s: Scan Info file empty", __FUNCTION__);
return;
}
scanInfo[len] = '\0'; /* null terminate the string */
close(hdmiScanInfoFile);
}
/*
* The scan_info contains the three fields
* PT - preferred video format
* IT - video format
* CE video format - containing the underscan support information
*/
/* PT */
ce_info_str = strtok_r(scanInfo, token, &save_ptr);
if (ce_info_str) {
/* IT */
ce_info_str = strtok_r(NULL, token, &save_ptr);
if (ce_info_str) {
/* CE */
ce_info_str = strtok_r(NULL, token, &save_ptr);
if (ce_info_str)
ce_info = atoi(ce_info_str);
}
}
if (ce_info_str) {
// ce_info contains the underscan information
if (ce_info == HDMI_SCAN_ALWAYS_UNDERSCANED ||
ce_info == HDMI_SCAN_BOTH_SUPPORTED)
// if TV supported underscan, then driver will always underscan
// hence no need to apply action safe rectangle
mUnderscanSupported = true;
} else {
ALOGE("%s: scan_info string error", __FUNCTION__);
}
// Store underscan support info in a system property
const char* prop = (mUnderscanSupported) ? "1" : "0";
property_set("hw.underscan_supported", prop);
return;
}
HDMIDisplay::~HDMIDisplay()
{
delete [] supported_video_mode_lut;
closeFrameBuffer();
}
/*
* sets the fb_var_screeninfo from the hdmi_mode_timing_info
*/
void setDisplayTiming(struct fb_var_screeninfo &info,
const msm_hdmi_mode_timing_info* mode)
{
info.reserved[0] = 0;
info.reserved[1] = 0;
info.reserved[2] = 0;
#ifndef FB_METADATA_VIDEO_INFO_CODE_SUPPORT
info.reserved[3] = (info.reserved[3] & 0xFFFF) |
(mode->video_format << 16);
#endif
info.xoffset = 0;
info.yoffset = 0;
info.xres = mode->active_h;
info.yres = mode->active_v;
info.pixclock = (mode->pixel_freq)*1000;
info.vmode = mode->interlaced ?
FB_VMODE_INTERLACED : FB_VMODE_NONINTERLACED;
info.right_margin = mode->front_porch_h;
info.hsync_len = mode->pulse_width_h;
info.left_margin = mode->back_porch_h;
info.lower_margin = mode->front_porch_v;
info.vsync_len = mode->pulse_width_v;
info.upper_margin = mode->back_porch_v;
// Set the sync polarity based on the current mode
if (!mode->active_low_h)
info.sync |= FB_SYNC_HOR_HIGH_ACT;
else
info.sync &= ~FB_SYNC_HOR_HIGH_ACT;
if (!mode->active_low_v)
info.sync |= FB_SYNC_VERT_HIGH_ACT;
else
info.sync &= ~FB_SYNC_VERT_HIGH_ACT;
}
int HDMIDisplay::parseResolution(char* edidStr)
{
char delim = ',';
int count = 0;
char *start, *end;
// EDIDs are string delimited by ','
// Ex: 16,4,5,3,32,34,1
// Parse this string to get mode(int)
start = (char*) edidStr;
end = &delim;
int edid_data;
while(*end == delim) {
edid_data = (int) strtol(start, &end, 10);
if(!isInterlacedMode(edid_data)) {
mEDIDModes[count] = edid_data;
count++;
}
start = end+1;
}
ALOGD_IF(DEBUG, "In %s: count = %d", __FUNCTION__, count);
for (int i = 0; i < count; i++)
ALOGD_IF(DEBUG, "Mode[%d] = %d", i, mEDIDModes[i]);
return count;
}
bool HDMIDisplay::readResolution()
{
ssize_t len = -1;
char edidStr[128] = {'\0'};
int hdmiEDIDFile = openDeviceNode("edid_modes", O_RDONLY);
if (hdmiEDIDFile < 0) {
return false;
} else {
len = read(hdmiEDIDFile, edidStr, sizeof(edidStr)-1);
ALOGD_IF(DEBUG, "%s: EDID string: %s length = %zu",
__FUNCTION__, edidStr, len);
if (len <= 0) {
ALOGE("%s: edid_modes file empty", __FUNCTION__);
edidStr[0] = '\0';
}
else {
while (len > 1 && isspace(edidStr[len-1])) {
--len;
}
edidStr[len] = '\0';
}
close(hdmiEDIDFile);
}
if(len > 0) {
// Get EDID modes from the EDID strings
mModeCount = parseResolution(edidStr);
ALOGD_IF(DEBUG, "%s: mModeCount = %d", __FUNCTION__,
mModeCount);
}
return (len > 0);
}
bool HDMIDisplay::openFrameBuffer()
{
if (mFd == -1) {
char strDevPath[MAX_SYSFS_FILE_PATH];
snprintf(strDevPath, MAX_SYSFS_FILE_PATH, "/dev/graphics/fb%d", mFbNum);
mFd = open(strDevPath, O_RDWR);
if (mFd < 0)
ALOGE("%s: %s is not available", __FUNCTION__, strDevPath);
}
return (mFd > 0);
}
bool HDMIDisplay::closeFrameBuffer()
{
int ret = 0;
if(mFd >= 0) {
ret = close(mFd);
mFd = -1;
}
return (ret == 0);
}
// clears the vinfo, edid, best modes
void HDMIDisplay::resetInfo()
{
memset(&mVInfo, 0, sizeof(mVInfo));
memset(mEDIDModes, 0, sizeof(mEDIDModes));
mModeCount = 0;
mCurrentMode = -1;
mUnderscanSupported = false;
mXres = 0;
mYres = 0;
mVsyncPeriod = 0;
mMDPScalingMode = false;
// Reset the underscan supported system property
const char* prop = "0";
property_set("hw.underscan_supported", prop);
}
int HDMIDisplay::getModeOrder(int mode)
{
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
if (gEDIDData[dataIndex].mMode == mode) {
return gEDIDData[dataIndex].mModeOrder;
}
}
ALOGE("%s Mode not found: %d", __FUNCTION__, mode);
return -1;
}
/// Returns the index of the user mode set(if any) using adb shell
int HDMIDisplay::getUserConfig() {
/* Based on the property set the resolution */
char property_value[PROPERTY_VALUE_MAX];
property_get("hw.hdmi.resolution", property_value, "-1");
int mode = atoi(property_value);
// We dont support interlaced modes
if(isValidMode(mode) && !isInterlacedMode(mode)) {
ALOGD_IF(DEBUG, "%s: setting the HDMI mode = %d", __FUNCTION__, mode);
return getModeIndex(mode);
}
return -1;
}
// Get the index of the best mode for the current HD TV
int HDMIDisplay::getBestConfig() {
int bestOrder = 0;
int bestMode = HDMI_VFRMT_640x480p60_4_3;
int bestModeIndex = -1;
// for all the edid read, get the best mode
for(int i = 0; i < mModeCount; i++) {
int mode = mEDIDModes[i];
int order = getModeOrder(mode);
if (order > bestOrder) {
bestOrder = order;
bestMode = mode;
bestModeIndex = i;
}
}
// If we fail to read from EDID when HDMI is connected, then
// mModeCount will be 0 and bestModeIndex will be invalid.
// In this case, we populate the mEDIDModes structure with
// a default mode at index 0.
if (bestModeIndex == -1) {
bestModeIndex = 0;
mModeCount = 1;
mEDIDModes[bestModeIndex] = bestMode;
}
return bestModeIndex;
}
inline bool HDMIDisplay::isValidMode(int ID)
{
bool valid = false;
for (int i = 0; i < mModeCount; i++) {
if(ID == mEDIDModes[i]) {
valid = true;
break;
}
}
return valid;
}
// returns true if the mode(ID) is interlaced mode format
bool HDMIDisplay::isInterlacedMode(int ID) {
bool interlaced = false;
switch(ID) {
case HDMI_VFRMT_1440x480i60_4_3:
case HDMI_VFRMT_1440x480i60_16_9:
case HDMI_VFRMT_1440x576i50_4_3:
case HDMI_VFRMT_1440x576i50_16_9:
case HDMI_VFRMT_1920x1080i60_16_9:
interlaced = true;
break;
default:
interlaced = false;
break;
}
return interlaced;
}
// Does a put_vscreen info on the HDMI interface which will update
// the configuration (resolution, timing info) to match mCurrentMode
void HDMIDisplay::activateDisplay()
{
int ret = 0;
ret = ioctl(mFd, FBIOGET_VSCREENINFO, &mVInfo);
if(ret < 0) {
ALOGD("In %s: FBIOGET_VSCREENINFO failed Err Str = %s", __FUNCTION__,
strerror(errno));
}
ALOGD_IF(DEBUG, "%s: GET Info<ID=%d %dx%d (%d,%d,%d),"
"(%d,%d,%d) %dMHz>", __FUNCTION__,
mVInfo.reserved[3], mVInfo.xres, mVInfo.yres,
mVInfo.right_margin, mVInfo.hsync_len, mVInfo.left_margin,
mVInfo.lower_margin, mVInfo.vsync_len, mVInfo.upper_margin,
mVInfo.pixclock/1000/1000);
const struct msm_hdmi_mode_timing_info *mode =
&supported_video_mode_lut[0];
for (unsigned int i = 0; i < HDMI_VFRMT_MAX; ++i) {
const struct msm_hdmi_mode_timing_info *cur =
&supported_video_mode_lut[i];
if (cur->video_format == (uint32_t)mCurrentMode) {
mode = cur;
break;
}
}
setDisplayTiming(mVInfo, mode);
ALOGD_IF(DEBUG, "%s: SET Info<ID=%d => Info<ID=%d %dx %d"
"(%d,%d,%d), (%d,%d,%d) %dMHz>", __FUNCTION__, mCurrentMode,
mode->video_format, mVInfo.xres, mVInfo.yres,
mVInfo.right_margin, mVInfo.hsync_len, mVInfo.left_margin,
mVInfo.lower_margin, mVInfo.vsync_len, mVInfo.upper_margin,
mVInfo.pixclock/1000/1000);
#ifdef FB_METADATA_VIDEO_INFO_CODE_SUPPORT
struct msmfb_metadata metadata;
memset(&metadata, 0 , sizeof(metadata));
metadata.op = metadata_op_vic;
metadata.data.video_info_code = mode->video_format;
if (ioctl(mFd, MSMFB_METADATA_SET, &metadata) == -1) {
ALOGD("In %s: MSMFB_METADATA_SET failed Err Str = %s",
__FUNCTION__, strerror(errno));
}
#endif
mVInfo.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_ALL | FB_ACTIVATE_FORCE;
ret = ioctl(mFd, FBIOPUT_VSCREENINFO, &mVInfo);
if(ret < 0) {
ALOGD("In %s: FBIOPUT_VSCREENINFO failed Err Str = %s",
__FUNCTION__, strerror(errno));
}
}
bool HDMIDisplay::writeHPDOption(int userOption) const
{
bool ret = true;
if(mFbNum != -1) {
int hdmiHPDFile = openDeviceNode("hpd", O_RDWR);
if (hdmiHPDFile >= 0) {
ssize_t err = -1;
ALOGD_IF(DEBUG, "%s: option = %d",
__FUNCTION__, userOption);
if(userOption)
err = write(hdmiHPDFile, "1", 2);
else
err = write(hdmiHPDFile, "0" , 2);
if (err <= 0) {
ALOGE("%s: file write failed 'hpd'", __FUNCTION__);
ret = false;
}
close(hdmiHPDFile);
}
}
return ret;
}
void HDMIDisplay::setAttributes() {
uint32_t fps = 0;
// Always set dpyAttr res to mVInfo res
getAttrForMode(mXres, mYres, fps);
mMDPScalingMode = false;
if (!qdutils::MDPVersion::getInstance().is8x26() && mMDPDownscaleEnabled) {
// if primary resolution is more than the hdmi resolution
// configure dpy attr to primary resolution and set MDP
// scaling mode
// Restrict this upto 1080p resolution max, if target does not
// support source split feature.
uint32_t primaryArea = mPrimaryWidth * mPrimaryHeight;
if(((primaryArea) > (mXres * mYres)) &&
(((primaryArea) <= SUPPORTED_DOWNSCALE_AREA) ||
qdutils::MDPVersion::getInstance().isSrcSplit())) {
// tmpW and tmpH will hold the primary dimensions before we
// update the aspect ratio if necessary.
int tmpW = mPrimaryWidth;
int tmpH = mPrimaryHeight;
// HDMI is always in landscape, so always assign the higher
// dimension to hdmi's xres
if(mPrimaryHeight > mPrimaryWidth) {
tmpW = mPrimaryHeight;
tmpH = mPrimaryWidth;
}
// The aspect ratios of the external and primary displays
// can be different. As a result, directly assigning primary
// resolution could lead to an incorrect final image.
// We get around this by calculating a new resolution by
// keeping aspect ratio intact.
hwc_rect r = {0, 0, 0, 0};
qdutils::getAspectRatioPosition(tmpW, tmpH, mXres, mYres, r);
uint32_t newExtW = r.right - r.left;
uint32_t newExtH = r.bottom - r.top;
uint32_t alignedExtW;
uint32_t alignedExtH;
// On 8994 and below targets MDP supports only 4X downscaling,
// Restricting selected external resolution to be exactly 4X
// greater resolution than actual external resolution
uint32_t maxMDPDownScale =
qdutils::MDPVersion::getInstance().getMaxMDPDownscale();
if((mXres * mYres * maxMDPDownScale) < (newExtW * newExtH)) {
float upScaleFactor = (float)maxMDPDownScale / 2.0f;
newExtW = (int)((float)mXres * upScaleFactor);
newExtH = (int)((float)mYres * upScaleFactor);
}
// Align it down so that the new aligned resolution does not
// exceed the maxMDPDownscale factor
alignedExtW = overlay::utils::aligndown(newExtW, 4);
alignedExtH = overlay::utils::aligndown(newExtH, 4);
mXres = alignedExtW;
mYres = alignedExtH;
// Set External Display MDP Downscale mode indicator
mMDPScalingMode = true;
}
}
ALOGD_IF(DEBUG_MDPDOWNSCALE, "Selected external resolution [%d X %d] "
"maxMDPDownScale %d mMDPScalingMode %d srcSplitEnabled %d "
"MDPDownscale feature %d",
mXres, mYres,
qdutils::MDPVersion::getInstance().getMaxMDPDownscale(),
mMDPScalingMode, qdutils::MDPVersion::getInstance().isSrcSplit(),
mMDPDownscaleEnabled);
mVsyncPeriod = (int) 1000000000l / fps;
ALOGD_IF(DEBUG, "%s xres=%d, yres=%d", __FUNCTION__, mXres, mYres);
}
void HDMIDisplay::getAttrForMode(uint32_t& width, uint32_t& height,
uint32_t& fps) {
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
if (gEDIDData[dataIndex].mMode == mCurrentMode) {
width = gEDIDData[dataIndex].mWidth;
height = gEDIDData[dataIndex].mHeight;
fps = gEDIDData[dataIndex].mFps;
return;
}
}
ALOGE("%s Unable to get attributes for %d", __FUNCTION__, mCurrentMode);
}
/* returns the fd related to the node specified*/
int HDMIDisplay::openDeviceNode(const char* node, int fileMode) const {
char sysFsFilePath[MAX_SYSFS_FILE_PATH];
memset(sysFsFilePath, 0, sizeof(sysFsFilePath));
snprintf(sysFsFilePath , sizeof(sysFsFilePath),
"/sys/devices/virtual/graphics/fb%d/%s",
mFbNum, node);
int fd = open(sysFsFilePath, fileMode, 0);
if (fd < 0) {
ALOGE("%s: file '%s' not found : ret = %d err str: %s",
__FUNCTION__, sysFsFilePath, fd, strerror(errno));
}
return fd;
}
bool HDMIDisplay::isHDMIPrimaryDisplay() {
int hdmiNode = qdutils::getHDMINode();
return (hdmiNode == HWC_DISPLAY_PRIMARY);
}
int HDMIDisplay::getConnectedState() {
int ret = -1;
int mFbNum = qdutils::getHDMINode();
int connectedNode = openDeviceNode("connected", O_RDONLY);
if(connectedNode >= 0) {
char opStr[4];
ssize_t bytesRead = read(connectedNode, opStr, sizeof(opStr) - 1);
if(bytesRead > 0) {
opStr[bytesRead] = '\0';
ret = atoi(opStr);
ALOGD_IF(DEBUG, "%s: Read %d from connected", __FUNCTION__, ret);
} else if(bytesRead == 0) {
ALOGE("%s: HDMI connected node empty", __FUNCTION__);
} else {
ALOGE("%s: Read from HDMI connected node failed with error %s",
__FUNCTION__, strerror(errno));
}
close(connectedNode);
} else {
ALOGD("%s: /sys/class/graphics/fb%d/connected could not be opened : %s",
__FUNCTION__, mFbNum, strerror(errno));
}
return ret;
}
void HDMIDisplay::setPrimaryAttributes(uint32_t primaryWidth,
uint32_t primaryHeight) {
mPrimaryHeight = primaryHeight;
mPrimaryWidth = primaryWidth;
}
int HDMIDisplay::setActiveConfig(int newConfig) {
if(newConfig < 0 || newConfig > mModeCount) {
ALOGE("%s Invalid configuration %d", __FUNCTION__, newConfig);
return -EINVAL;
}
// XXX: Currently, we only support a change in frame rate.
// We need to validate the new config before proceeding.
if (!isValidConfigChange(newConfig)) {
ALOGE("%s Invalid configuration %d", __FUNCTION__, newConfig);
return -EINVAL;
}
mCurrentMode = mEDIDModes[newConfig];
mActiveConfig = newConfig;
activateDisplay();
ALOGD("%s config(%d) mode(%d)", __FUNCTION__, mActiveConfig, mCurrentMode);
return 0;
}
// returns false if the xres or yres of the new config do
// not match the current config
bool HDMIDisplay::isValidConfigChange(int newConfig) {
uint32_t width = 0, height = 0, refresh = 0;
getAttrForConfig(newConfig, width, height, refresh);
return ((mXres == width) && (mYres == height)) || mEnableResolutionChange;
}
int HDMIDisplay::getModeIndex(int mode) {
int modeIndex = -1;
for(int i = 0; i < mModeCount; i++) {
if(mode == mEDIDModes[i]) {
modeIndex = i;
break;
}
}
return modeIndex;
}
int HDMIDisplay::getAttrForConfig(int config, uint32_t& xres,
uint32_t& yres, uint32_t& refresh) const {
if(config < 0 || config > mModeCount) {
ALOGE("%s Invalid configuration %d", __FUNCTION__, config);
return -EINVAL;
}
int mode = mEDIDModes[config];
uint32_t fps = 0;
// Retrieve the mode attributes from gEDIDData
for (int dataIndex = 0; dataIndex < gEDIDCount; dataIndex++) {
if (gEDIDData[dataIndex].mMode == mode) {
xres = gEDIDData[dataIndex].mWidth;
yres = gEDIDData[dataIndex].mHeight;
fps = gEDIDData[dataIndex].mFps;
}
}
refresh = (uint32_t) 1000000000l / fps;
ALOGD_IF(DEBUG, "%s xres(%d) yres(%d) fps(%d) refresh(%d)", __FUNCTION__,
xres, yres, fps, refresh);
return 0;
}
int HDMIDisplay::getDisplayConfigs(uint32_t* configs,
size_t* numConfigs) const {
if (*numConfigs <= 0) {
ALOGE("%s Invalid number of configs (%d)", __FUNCTION__, *numConfigs);
return -EINVAL;
}
*numConfigs = mModeCount;
for (int configIndex = 0; configIndex < mModeCount; configIndex++) {
configs[configIndex] = (uint32_t)configIndex;
}
return 0;
}
};
| [
"sebastian.sariego.benitez@gmail.com"
] | sebastian.sariego.benitez@gmail.com |
6bb8043b15870c428223995f369a120715fccbce | 45c6e5e140019ea417b06fe5c082ad309eaab0ce | /Imaging/include/DeBayerTransform.h | cf97eebebae465ec3331d4e4851eada891834e02 | [] | no_license | isliulin/fadvs | 532220b54d17eab90717a8cd92b280417e65eeeb | 5729519bcd0651eb85b34fcbda61c50f1d70ddc4 | refs/heads/master | 2022-10-16T04:32:17.502976 | 2020-06-15T09:55:21 | 2020-06-15T09:55:21 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,579 | h |
#ifndef DEBAYERTRANSFORM_H_INC_
#define DEBAYERTRANSFORM_H_INC_
#pragma once
#include "udshl_defs.h"
namespace _DSHOWLIB_NAMESPACE
{
class IDispEventDispatcher;
struct DeBayerTransformImpl;
class GrabberPImpl;
/** The DeBayerTransform class allows you to control the automatic debayering process of IC Imaging Control.
*/
class _UDSHL_EXP_API DeBayerTransform
{
friend GrabberPImpl;
public:
~DeBayerTransform();
/** Checks whether the image data is currently debayered by IC Imaging Control. */
bool isActive() const;
enum tStartPattern
{
eBG = 0,
eGB,
eGR,
eRG,
};
/** Sets the pattern which determines how the algorithm interprets the pixels of the raw image data.
* It has to match the pattern of the first two pixels of the first line.
*/
void setStartPattern( tStartPattern pat );
/** Returns the currently selected start pattern. */
tStartPattern getStartPattern() const;
enum tDeBayerMode
{
eNearestColor, ///< Simplest and fastest algorithm, but lesser output image quality.
eBilinear, ///< Algorithm with both acceptable speed and image quality.
eEdgeSensing, ///< This algorithm creates the best image quality, but is rather slow.
};
/** Selects the algorithm for the debayering of the image data. */
void setDeBayerMode( tDeBayerMode mode );
/** Returns the currently active debayering algorithm. */
tDeBayerMode getDeBayerMode() const;
private:
DeBayerTransform( IDispEventDispatcher& disp );
DeBayerTransformImpl* m_pImpl;
};
};
#endif // DEBAYERTRANSFORM_H_INC_
| [
"qdh8087@gmail.com"
] | qdh8087@gmail.com |
e7fa44f7911cc9d0b298ee33499196f4d81580ae | f2ee22679f4015815f567c38089d396971e4c51a | /CAADialogEngine.edu/CAADegGeoCommands.m/LocalInterfaces/CAADegCreateRectangleCmd.h | d369dd26172415c7c26ade732281177d00292008 | [] | no_license | poborskii/CAADoc_SelectAgent | 72f0a162fa7a502d6763df15d65d76554e9268fe | 51e0235ef461b5ac1fd710828c29be4bb538c43c | refs/heads/master | 2022-12-06T01:19:28.965598 | 2020-08-31T02:48:11 | 2020-08-31T02:48:11 | 291,596,517 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,259 | h | #ifndef CAADegCreateRectangleCmd_h
#define CAADegCreateRectangleCmd_h
// COPYRIGHT DASSAULT SYSTEMES 1999
//===========================================================================
// Abstract of the sample:
// ----------------------
//
// Application using a new document (CAAGeometry) with its own workshop
// (CAAAfrGeometryWks) and its own commands.
//
// CAAGeometry and CAAAfrGeometryWks are described in the
// CAAApplicationFrame.edu FW, and state commands are described in this FW
//
//===========================================================================
// Abstract of the class:
// ----------------------
//
// State command which creates a rectangle from a selected plane and two
// indications.
//
// Illustrates:
//
// - Creation of a State command
// - Use of CATPathElementAgent and CATIndicationAgent
// - Use of the CATCSO (Set of Current Objects)
// - Use of the CATISO for tht temporary objects
//
// Usage:
//
// Select a plane: The plane becomes perpendicular to the camera.
// Click in the background ==> A temporary point is created.
// Move the mouse => Temporary rectangles are created successively to
// follow the mouse.
// Click in the background => The final rectangle is created and becomes
// the current selected object.
//
// Graph:
//
// Is composed of 3 states:
// * stPlaneState containing one agent
// - a CATPathElementAgent to react to plane selection
// * stGetFirstPointState containing one agent
// - a CATIndicationAgent to react to indication
// * stGetLastPointState containing one agent
// - a CATIndicationAgent to react to indication
// These states are consecutive. One transition enables to progress
// from one state to the following.
// The last transition leaves the stGetLastPointState and reaches the
// NULL state to end the command.
// Another transition loops on the stGetLastPointState state to manage
// rubber banding.
//
// +------------------+
// ! PlanePathAgent !
// +--------+---------+
// ! CreateCamera
// +--------V---------+
// ! Point1IndicAgent !
// +--------+---------+
// ! CreatePoint
// +--------V---------+<--+
// ! Point2IndicAgent ! ! UpdateRectangle
// +--------+---------+---+
// ! NewRectangle
// V
// NULL
//
//===========================================================================
// Inheritance:
// ------------
// CATStateCommand (DialogEngine Framework)
// CATCommand (System Framework)
// CATEventSubscriber (System Framework)
// CATBaseUnknown (System Framework)
//
//===========================================================================
// Main Method:
// ------------
//
// BuilGraph : Implements the state chart
// CreateCamera : Changes the viewpoint to make the selected plane and the
// screen plane coincide.
// CreatePoint : Creates a temporary point.
// UpdateRectangle: Creates temporary rectangles which follow the mouse
// NewRectangle : Creates the final rectangle.
//
//===========================================================================
//DialogEngine Framework
#include "CATStateCommand.h" // Needed to derive from CATStateCommand
//Mathematics Framework
#include "CATMathPoint.h" // Needed to manage temporary objects
#include "CATMathPlane.h" // Projection plane
//DialogEngine Framework
class CATIndicationAgent ; // Dialog agent to begin/end the rectangle
class CATPathElementAgent ; // Dialog agent to select the plane
// CAASystem.edu Framework
class CAAISysPoint ; // Needed to manage temporary objects
class CAAISysPolyline ; // Needed to manage temporary objects
// Visualization Framework
class CATISO ; // Needed to visualize temporary objects
class CAADegCreateRectangleCmd : public CATStateCommand
{
//
// In the Cnext/resources/msgcatalog you have :
// CAADegCreateRectangleCmd.CATNls
CmdDeclareResource(CAADegCreateRectangleCmd,CATStateCommand);
public :
// Manages the lifecyle of the command.
//
CAADegCreateRectangleCmd();
virtual ~CAADegCreateRectangleCmd();
// Activate
// --------
// Called when the command selector gives the focus to this command.
// Two cases can happen:
// -The command starts from the beginning.
// -The command restarts at the state that was current when a shared command
// took the focus from it.
//
// These two cases can be distinguished thanks to the notification type.
//
CATStatusChangeRC Activate( CATCommand *iCmd,CATNotification *iNotif);
// Cancel
// --------
// Called when the command selector gives the focus to an exclusive command,
// or if this command completes. In this latter case, the focus is given to
// the default command (usually Select).
// You should not take care of the command destruction. This is done
// by the dialog state command engine.
//
// If the end user selects this command again, it is recreated.
//
CATStatusChangeRC Cancel( CATCommand *iCmd,CATNotification *iNotif);
// Deactivate
// ----------
// Called when the command selector freezes this command to give
// the focus to a shared command. When the shared command completes, this
// frozen command will be reactivated from its current state.
//
CATStatusChangeRC Desactivate( CATCommand *iCmd,CATNotification *iNotif);
// BuildGraph
// -----------
// Implements the statechart.
// It is called once, even if the command is in repeat mode
//
// 1- Creates the dialog agents
// 2- Creates states
// 3- Defines transitions
//
virtual void BuildGraph() ;
// TestPoint(1&2)
// ----------
// Test indicated points
//
CATBoolean TestPoint1(void * iUsefulData);
CATBoolean TestPoint2(void * iUsefulData);
// CreateCamera
// -----------
// Retrieves the CATMathPlane from the selected plane, and sets
// the projection plane for the indicator agent. Changes the viewpoint
// to make the selected plane and the screen plane coincide.
//
CATBoolean CreateCamera (void * iUsefulData);
// CreatePoint
// -----------
// Projects the indicated point in the plane, and determines _P1
// a point of the rectangle. A temporary point is added in the
// ISO and a default recantgle to.
//
CATBoolean CreatePoint (void * iUsefulData);
// UpdateRectangle
// ---------------
// Determines a new rectangle from the mouse position.
//
CATBoolean UpdateRectangle(void * iUsefulData);
// NewRectangle
// ------------
// Creates a new rectangle ( a closed polyline ) in the document
//
CATBoolean NewRectangle (void * iUsefulData);
private :
// Copy constructor, not implemented
// Set as private to prevent from compiler automatic creation as public.
CAADegCreateRectangleCmd(const CAADegCreateRectangleCmd &iObjectToCopy);
// Assignment operator, not implemented
// Set as private to prevent from compiler automatic creation as public.
CAADegCreateRectangleCmd & operator = (const CAADegCreateRectangleCmd &iObjectToCopy);
private :
// Dialog Agent
CATIndicationAgent * _daIndicationP1 ;
CATIndicationAgent * _daIndicationP2 ;
CATPathElementAgent * _daPathEltPlane ;
// Plane for the IndicationAgent
CATMathPlane _ProjPlane ;
// Values to manage the rectangle
CATMathPoint _P1;
CATMathPoint _P2;
CATMathPoint _P3;
CATMathPoint _P4;
CAAISysPoint * _piTemporaryPoint;
CAAISysPolyline * _piTemporaryRect;
CATISO * _pISO ;
// To create elements in the document
CATBaseUnknown * _pUIActiveObject ;
CATBaseUnknown * _pContainer ;
};
#endif
| [
"poborsk_liu@613.com"
] | poborsk_liu@613.com |
1efc35984403d2b7b1ba8ab7b47d0fbf446a2853 | f8755ddf2deee6be7df2a0fa005ba336745a27a7 | /lcd_print_ultraSonic/lcd_print_ultraSonic.ino | c5cf0b94cf8cef2de197e09895f58048c3352a1a | [] | no_license | JEONGSSO/arduino | 6485225e11dcddc9e941b4b399583fc7dd84e687 | a027edc8e231561184556f0a30574492dc745500 | refs/heads/master | 2020-04-01T12:44:56.126545 | 2018-11-01T06:21:53 | 2018-11-01T06:21:53 | 149,207,416 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,065 | ino | #include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 4, 5, 6, 7);
int Trigpin = 8; //쏘는거(방아쇠)
int EchoPin = 9;
int piezo = 6;
void setup() {
lcd.begin(16, 2);
pinMode(Trigpin, OUTPUT);
pinMode(EchoPin, INPUT);
pinMode(A1, INPUT);
Serial.begin(9600);
}
void loop() {
float distance, duration;
digitalWrite(Trigpin, 1);
delayMicroseconds(10);
digitalWrite(Trigpin, 0);
duration = pulseIn(EchoPin, 1); //시간
//Serial.println ("시간 : " + (String)duration);
distance = (duration*34000)/1000000/2; //거리
lcd.setCursor(0,0);
lcd.println ("dis : " + (String)distance + "cm");
delay(500);
int value = analogRead(A1);
float volt = value * 5.0/ 1024;
float temper = (volt - 0.5)*100;
lcd.setCursor(0,1);
lcd.println ("temper : " + (String)temper + "C");
delay(500);
// lcd.setCursor(5,0);
// lcd.print("Hello");
// lcd.setCursor(4, 1);
// lcd.print("Arduino");
// delay(2000);
// lcd.clear();
// lcd.setCursor(3, 0);
// lcd.print("Thank You");
//
// delay(2000);
// lcd.clear();
}
| [
"rpsha33@naver.com"
] | rpsha33@naver.com |
417618aec93f69906e9d900566e428b2e01696d1 | 9c1971ad1e4ba01d7177a8e63fbb67203a0a03df | /problems/1632/solution.cpp | 628df54d47e71304b76ef4ad3c6a43692f32ddf4 | [] | no_license | virtyaluk/leetcode | cb5a7d0957be353125861b1b9d41606f4729248a | 2a1496e5deaf45b28647e713a82b1f5b456888fa | refs/heads/master | 2023-07-07T16:52:23.152194 | 2023-06-24T00:50:09 | 2023-06-24T00:50:09 | 166,505,868 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,851 | cpp | class disjoint_set {
public:
unordered_map<int, int> parent;
int find(int x) {
if (x == parent[x]) {
return x;
}
return parent[x] = find(parent[x]);
}
void merge(int x, int y) {
if (not parent.count(x)) {
parent[x] = x;
}
if (not parent.count(y)) {
parent[y] = y;
}
int px = find(x), py = find(y);
if (px != py) {
parent[px] = py;
}
}
};
class Solution {
public:
vector<vector<int>> matrixRankTransform(vector<vector<int>>& matrix) {
int m = size(matrix), n = size(matrix.back());
vector<int> rank(m + n);
map<int, vector<pair<int, int>>> groupByVal;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
groupByVal[matrix[i][j]].push_back({i, j});
}
}
for (const auto &[_, cells]: groupByVal) {
disjoint_set ds;
unordered_map<int, vector<int>> groups;
for (const auto &[i, j]: cells) {
ds.merge(i, j + m);
}
for (const auto& [x, _]: ds.parent) {
groups[ds.find(x)].push_back(x);
}
for (const auto& [_, group]: groups) {
int maxRank = 0;
for (const int& i: group) {
maxRank = max(maxRank, rank[i]);
}
for (const int& i: group) {
rank[i] = maxRank + 1;
}
}
for (const auto &[i, j]: cells) {
matrix[i][j] = rank[i];
}
}
return matrix;
}
}; | [
"bohdan@modern-dev.com"
] | bohdan@modern-dev.com |
e5ae19f13213fe0fe767bab4ba3e3ff550451278 | a69fd652a5491f6d2f4db0915737ea7bec0ec062 | /internal/ceres/generated/schur_eliminator_2_3_3.cc | 86352c073048c12aad4f57910da4d6bf9c24b3b5 | [
"BSD-3-Clause"
] | permissive | arnaudgelas/ceres-solver | 91e17674d70b12f27280d2db792ae37f12cfd869 | d216490ce0de14fa0450d15725af7689295bbb63 | refs/heads/master | 2021-03-13T00:08:35.939485 | 2012-08-16T02:04:50 | 2012-08-16T02:05:20 | 5,440,753 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,356 | cc | // Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2010, 2011, 2012 Google Inc. All rights reserved.
// http://code.google.com/p/ceres-solver/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// * Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
//
// Author: sameeragarwal@google.com (Sameer Agarwal)
//
// Template specialization of SchurEliminator.
//
// ========================================
// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
// THIS FILE IS AUTOGENERATED. DO NOT EDIT.
//=========================================
//
// This file is generated using generate_eliminator_specializations.py.
// Editing it manually is not recommended.
#include "ceres/schur_eliminator_impl.h"
#include "ceres/internal/eigen.h"
namespace ceres {
namespace internal {
template class SchurEliminator<2, 3, 3>;
} // namespace internal
} // namespace ceres
| [
"mierle@gmail.com"
] | mierle@gmail.com |
3ef52b6217bac111eed96a57f8c8d98c8a085c43 | 72ed9a47f523e184301ab19b75f4df8d061e422a | /cpp_src/gtests/bench/fixtures/api_tv_simple.h | 667e08fff626688c114b2bd38bef254d83ae32ab | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | cristaloleg/reindexer | 7566d5a877267b724cf9c9041efb2dde9c38a88b | ccb0a6e072b2dbe63bb48b59fe6b709ec1fac8c2 | refs/heads/master | 2020-04-15T18:27:00.339426 | 2019-01-09T08:25:02 | 2019-01-09T08:25:02 | 164,913,154 | 1 | 0 | Apache-2.0 | 2019-01-09T18:07:09 | 2019-01-09T18:06:56 | C++ | UTF-8 | C++ | false | false | 2,209 | h | #pragma once
#include <string>
#include <vector>
#include "base_fixture.h"
using std::vector;
using std::string;
class ApiTvSimple : protected BaseFixture {
public:
virtual ~ApiTvSimple() {}
ApiTvSimple(Reindexer* db, const string& name, size_t maxItems) : BaseFixture(db, name, maxItems) {
nsdef_.AddIndex("id", "hash", "int", IndexOpts().PK())
.AddIndex("genre", "tree", "int64", IndexOpts())
.AddIndex("year", "tree", "int", IndexOpts())
.AddIndex("packages", "hash", "int", IndexOpts().Array())
.AddIndex("countries", "tree", "string", IndexOpts().Array())
.AddIndex("age", "hash", "int", IndexOpts())
.AddIndex("price_id", "hash", "int", IndexOpts().Array())
.AddIndex("location", "hash", "string", IndexOpts())
.AddIndex("end_time", "hash", "int", IndexOpts())
.AddIndex("start_time", "tree", "int", IndexOpts());
}
virtual void RegisterAllCases();
virtual Error Initialize();
protected:
virtual Item MakeItem();
protected:
void WarmUpIndexes(State& state);
void GetByID(State& state);
void GetByRangeIDAndSortByHash(State& state);
void GetByRangeIDAndSortByTree(State& state);
void Query1Cond(State& state);
void Query1CondTotal(State& state);
void Query1CondCachedTotal(State& state);
void Query2Cond(State& state);
void Query2CondTotal(State& state);
void Query2CondCachedTotal(State& state);
void Query2CondLeftJoin(State& state);
void Query2CondLeftJoinTotal(State& state);
void Query2CondLeftJoinCachedTotal(State& state);
void Query2CondInnerJoin(State& state);
void Query2CondInnerJoinTotal(State& state);
void Query2CondInnerJoinCachedTotal(State& state);
void Query3Cond(State& state);
void Query3CondTotal(State& state);
void Query3CondCachedTotal(State& state);
void Query3CondKillIdsCache(State& state);
void Query3CondRestoreIdsCache(State& state);
void Query4Cond(State& state);
void Query4CondTotal(State& state);
void Query4CondCachedTotal(State& state);
void Query4CondRange(State& state);
void Query4CondRangeTotal(State& state);
void Query4CondRangeCachedTotal(State& state);
private:
vector<string> countries_;
vector<string> locations_;
vector<vector<int>> packages_;
vector<vector<int>> priceIDs_;
};
| [
"ogerasimov@gmail.com"
] | ogerasimov@gmail.com |
4b3937376666aaa2b3cea79cc69b1f47d78b7f7a | 68b783906dd119a551f858bc2485bb57cc6f1afc | /faucet/tcp/CombinedTcpAcceptor.cpp | a586897e6cafb40c370a65b522e4acfaffce51e4 | [
"ISC"
] | permissive | gmlwns5176/Faucet-Networking-Extension | 8ad4d7621de22902627f45d4f67ec7b19824f6fb | 5b35dda7891bdc2da371f0bea9c259b960e36fbb | refs/heads/master | 2021-01-17T22:30:32.393750 | 2014-01-22T15:01:16 | 2014-01-22T15:01:16 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,008 | cpp | #include "CombinedTcpAcceptor.hpp"
#include <faucet/tcp/TcpAcceptor.hpp>
using namespace boost::asio::ip;
CombinedTcpAcceptor::CombinedTcpAcceptor(uint16_t port) :
v4Acceptor_(),
v6Acceptor_(),
checkV6First_(false),
localPort_(port) {
boost::shared_ptr<tcp::acceptor> v4acceptor(new tcp::acceptor(Asio::getIoService()));
boost::shared_ptr<tcp::acceptor> v6acceptor(new tcp::acceptor(Asio::getIoService()));
boost::system::error_code ignoredError, v4Error, v6Error;
if (localPort_ == 0) {
try {
v6acceptor->open(tcp::v6());
v6acceptor->set_option(v6_only(false));
v6acceptor->bind(tcp::endpoint(tcp::v6(), localPort_));
v6acceptor->listen();
localPort_ = v6acceptor->local_endpoint().port();
} catch (boost::system::system_error &e) {
// Error -> Probably no dual stack support or no v6 support at all
v6acceptor->close(ignoredError);
}
}
try {
v4acceptor->open(tcp::v4());
v4acceptor->set_option(tcp::acceptor::reuse_address(true));
v4acceptor->bind(tcp::endpoint(tcp::v4(), localPort_));
v4acceptor->listen();
localPort_ = v4acceptor->local_endpoint().port();
} catch (boost::system::system_error &e) {
// Error -> IPv4 port is probably in use
v4Error = e.code();
v4acceptor->close(ignoredError);
}
if (!v6acceptor->is_open()) {
// We didn't create a dual stack socket earlier, try simple v6
try {
v6acceptor->open(tcp::v6());
v6acceptor->set_option(v6_only(true), ignoredError);
v6acceptor->set_option(tcp::acceptor::reuse_address(true));
v6acceptor->bind(tcp::endpoint(tcp::v6(), localPort_));
v6acceptor->listen();
localPort_ = v6acceptor->local_endpoint().port();
} catch (boost::system::system_error &e) {
v6Error = e.code();
v6acceptor->close(ignoredError);
}
}
if(v4acceptor->is_open()) {
v4Acceptor_ = TcpAcceptor::listen(v4acceptor);
} else {
v4Acceptor_ = TcpAcceptor::error(v4Error.message());
}
if(v6acceptor->is_open()) {
v6Acceptor_ = TcpAcceptor::listen(v6acceptor);
} else {
v6Acceptor_ = TcpAcceptor::error(v6Error.message());
}
}
CombinedTcpAcceptor::~CombinedTcpAcceptor() {
v4Acceptor_->close();
v6Acceptor_->close();
}
std::string CombinedTcpAcceptor::getErrorMessage() {
return "IPv4: "+v4Acceptor_->getErrorMessage()+"; IPv6: "+v6Acceptor_->getErrorMessage();
}
bool CombinedTcpAcceptor::hasError() {
return v4Acceptor_->hasError() && v6Acceptor_->hasError();
}
boost::shared_ptr<TcpSocket> CombinedTcpAcceptor::accept() {
boost::shared_ptr<TcpSocket> acceptedSocket;
if(checkV6First_) {
acceptedSocket = v6Acceptor_->accept();
if(!acceptedSocket) {
acceptedSocket = v4Acceptor_->accept();
}
} else {
acceptedSocket = v4Acceptor_->accept();
if(!acceptedSocket) {
acceptedSocket = v6Acceptor_->accept();
}
}
checkV6First_ = !checkV6First_;
return acceptedSocket;
}
uint16_t CombinedTcpAcceptor::getLocalPort() {
return localPort_;
}
| [
"smaxein@googlemail.com"
] | smaxein@googlemail.com |
5c354ce3029aed20121dfab1aa1d486dfe783915 | 189f52bf5454e724d5acc97a2fa000ea54d0e102 | /ras/floatingObject/3.6/uniform/rigidBodyMotionState | f9388c4fa6efef14b17f5e9c2b0b90a6522c5159 | [] | no_license | pyotr777/openfoam_samples | 5399721dd2ef57545ffce68215d09c49ebfe749d | 79c70ac5795decff086dd16637d2d063fde6ed0d | refs/heads/master | 2021-01-12T16:52:18.126648 | 2016-11-05T08:30:29 | 2016-11-05T08:30:29 | 71,456,654 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,068 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1606+ |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "3.6/uniform";
object rigidBodyMotionState;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
q 2 ( -0.00658187704947 0.0287793580089 );
qDot 2 ( -0.039286225449 -0.268319470109 );
qDdot 2 ( -0.218157679296 -0.59855598702 );
deltaT 0.02;
// ************************************************************************* //
| [
"peterbryz@yahoo.com"
] | peterbryz@yahoo.com | |
389ae5615dd1ea85da8d434bc51a5801222f02c8 | 20a7cc9459d3a83f9ca01e4b36171e48a9c69b56 | /src/OBSERVABLES/SingleInclusiveDistribution.cpp | 22995f99f169ed5d2f1a00a51472ec70259d3733 | [] | no_license | markmace/DiluteDenseGluons | a69465d2acd7e32792dab77bb8a6b35450c5d103 | c420a2f941584ac93a892bbd5986afba75879433 | refs/heads/master | 2022-02-10T04:55:24.868381 | 2019-07-02T21:09:09 | 2019-07-02T21:09:09 | 189,742,568 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 15,112 | cpp | // SingleInclusiveDistribution.cpp is part of the Dilute-Dense Gluon solver //
// Copyright (C) 2019 Mark Mace //
#ifndef __SINGLE_INCLUSIVE_DISTRIBUTION__CPP__
#define __SINGLE_INCLUSIVE_DISTRIBUTION__CPP__
namespace Observables{
// ENFORCE PERIODIC BOUNDARIES //
INT BoundaryIndex(INT i){
if(i<0){return i+Lattice::N[0];}
else if(i>Lattice::N[0]-1){return i-Lattice::N[0];}
else{return i;}
}
INT SIGN_V(DOUBLE i){
if(i<0){return -1;}
else{return 1;}
}
// GENERAL PURPOSE FUNCTIONS FOR CONVERTING INDICES TO MOMENTA //
DOUBLE IndexTok(INT Index){
DOUBLE karg=2.0*PI*Index/(Lattice::N[0]*Lattice::a[0]);
DOUBLE kValue=1.0/Lattice::a[0]*sin(karg*Lattice::a[0])*invfmtoGeV; // GeV //
return kValue;
}
DOUBLE IndexTokSqr(INT kXIndex,INT kYIndex){
DOUBLE kXarg=2.0*PI*kXIndex/(Lattice::N[0]*Lattice::a[0]);
DOUBLE kYarg=2.0*PI*kYIndex/(Lattice::N[1]*Lattice::a[1]);
return (pow(2.0/Lattice::a[0]*sin(kXarg*Lattice::a[0]/2.0),2)+pow(2.0/Lattice::a[0]*sin(kYarg*Lattice::a[1]/2.0),2))*invfmtoGeV*invfmtoGeV; // GeV^2 //
}
// CONSTRUCT OMEGA_S AND OMEGA_A //
void ConstructOmegas(CVectorFields *OmS,CVectorFields *OmA){
// DETERMINE DERIVATES AND OMEGAS
#pragma omp for collapse(2)
for(INT x=0;x<Lattice::N[0];x++){
for(INT y=0;y<Lattice::N[1];y++){
SU_Nc_FUNDAMENTAL_FORMAT OmegaSBuffer[SUNcGroup::MatrixSize]={SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0)};
SU_Nc_FUNDAMENTAL_FORMAT OmegaABuffer[SUNcGroup::MatrixSize]={SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0),SU_Nc_FUNDAMENTAL_FORMAT(0.0)};
COMPLEX CHECK=COMPLEX(0.0,0.0);
for(INT a=0;a<SUNcAlgebra::VectorSize;a++){
// PROJECTILE DERIVATIVES //
double dUdxProj=0.5*(ProjSolution::A->Get(BoundaryIndex(x+1),y,0,a)[0]-ProjSolution::A->Get(BoundaryIndex(x-1),y,0,a)[0])/Lattice::a[0]; // fm^-1 //
double dUdyProj=0.5*(ProjSolution::A->Get(x,BoundaryIndex(y+1),0,a)[0]-ProjSolution::A->Get(x,BoundaryIndex(y-1),0,a)[0])/Lattice::a[1]; // fm^-1 //
SU_Nc_FUNDAMENTAL_FORMAT Wx[SUNcGroup::MatrixSize];
SU_Nc_FUNDAMENTAL_FORMAT Wy[SUNcGroup::MatrixSize];
// BUFFER //
SU_Nc_FUNDAMENTAL_FORMAT Buffer[SUNcGroup::MatrixSize];
// LAMBDA BUFFER //
SU_Nc_FUNDAMENTAL_FORMAT Generator[SUNcGroup::MatrixSize];
COPY_SUNcMatrix(Generator,SUNcAlgebra::GeneratorTa[a]);
// +x U^dag t^a U //
SU_Nc_FUNDAMENTAL_FORMAT tmpPlus[SUNcGroup::MatrixSize];
COPY_SUNcMatrix(tmpPlus,TargetFields::U->Get(BoundaryIndex(x+1),y,0));
SUNcGroup::Operations::UU(Generator,tmpPlus,Buffer);
SUNcGroup::Operations::DU(TargetFields::U->Get(BoundaryIndex(x+1),y,0),Buffer,tmpPlus);
// -x U^dag t^a U //
SU_Nc_FUNDAMENTAL_FORMAT tmpMinus[SUNcGroup::MatrixSize];
COPY_SUNcMatrix(tmpMinus,TargetFields::U->Get(BoundaryIndex(x-1),y,0));
SUNcGroup::Operations::UU(Generator,tmpMinus,Buffer);
SUNcGroup::Operations::DU(TargetFields::U->Get(BoundaryIndex(x-1),y,0),Buffer,tmpMinus);
for(INT alpha=0;alpha<Nc;alpha++){
for(INT beta=0;beta<Nc;beta++){
Wx[SUNcGroup::MatrixIndex(alpha,beta)]=DOUBLE(0.5)/Lattice::a[0]*(tmpPlus[SUNcGroup::MatrixIndex(alpha,beta)]-tmpMinus[SUNcGroup::MatrixIndex(alpha,beta)]); // fm^-1 //
}
}
// +x U^dag t^a U //
COPY_SUNcMatrix(tmpPlus,TargetFields::U->Get(x,BoundaryIndex(y+1),0));
SUNcGroup::Operations::UU(Generator,tmpPlus,Buffer);
SUNcGroup::Operations::DU(TargetFields::U->Get(x,BoundaryIndex(y+1),0),Buffer,tmpPlus);
// -x U^dag t^a U //
COPY_SUNcMatrix(tmpMinus,TargetFields::U->Get(x,BoundaryIndex(y-1),0));
SUNcGroup::Operations::UU(Generator,tmpMinus,Buffer);
SUNcGroup::Operations::DU(TargetFields::U->Get(x,BoundaryIndex(y-1),0),Buffer,tmpMinus);
for(INT alpha=0;alpha<Nc;alpha++){
for(INT beta=0;beta<Nc;beta++){
Wy[SUNcGroup::MatrixIndex(alpha,beta)]=DOUBLE(0.5)/Lattice::a[0]*(tmpPlus[SUNcGroup::MatrixIndex(alpha,beta)]-tmpMinus[SUNcGroup::MatrixIndex(alpha,beta)]); // fm^-1 //
}
}
CHECK+=(OmegaSBuffer[SUNcGroup::MatrixIndex(0,0)]);
// SET OMEGA MATRICES //
for(INT alpha=0;alpha<Nc;alpha++){
for(INT beta=0;beta<Nc;beta++){
OmegaSBuffer[SUNcGroup::MatrixIndex(alpha,beta)]+=dUdxProj*Wx[SUNcGroup::MatrixIndex(alpha,beta)]+dUdyProj*Wy[SUNcGroup::MatrixIndex(alpha,beta)]; // fm^-2 //
OmegaABuffer[SUNcGroup::MatrixIndex(alpha,beta)]+=dUdxProj*Wy[SUNcGroup::MatrixIndex(alpha,beta)]-dUdyProj*Wx[SUNcGroup::MatrixIndex(alpha,beta)]; // fm^-2 //
}
}
} // END VECTORSIZE a LOOP//
COMPLEX OmegaSgenBuffer[SUNcGroup::MatrixSize];
COMPLEX OmegaAgenBuffer[SUNcGroup::MatrixSize];
SUNcGroup::Operations::GeneratorProjection(OmegaSBuffer,OmegaSgenBuffer);
SUNcGroup::Operations::GeneratorProjection(OmegaABuffer,OmegaAgenBuffer);
// SET TO VECTOR //
for(INT a=0;a<SUNcGroup::MatrixSize;a++){
OmS->Get(x,y,0,a)[0]=OmegaSgenBuffer[a];
OmA->Get(x,y,0,a)[0]=OmegaAgenBuffer[a];
}
} // END y LOOP //
} // END x LOOP //
}
void FourierTransformOmegas(CVectorFields *OmS,CVectorFields *OmA){
// INITIALIZE FOURIER TRANSFORM VARIABLES //
#pragma omp for collapse(2)
for(INT y=0;y<Lattice::N[1];y++){
for(INT x=0;x<Lattice::N[0];x++){
for(INT a=0;a<SUNcAlgebra::VectorSize;a++){
// NORMALIZATION FOR FFT BELOW -- d^2p-> a^2 //
FourierSpace::OmegaS->SetXc(x,y,a,OmS->Get(x,y,0,a)[0]*Lattice::a[0]*Lattice::a[1]); // DIMLESS //
FourierSpace::OmegaA->SetXc(x,y,a,OmA->Get(x,y,0,a)[0]*Lattice::a[0]*Lattice::a[1]); // fm^-2 //
}
}
}
// COMPLETE FOURIER TRANSFORMs //
FourierSpace::OmegaS->ExecuteXtoP();
FourierSpace::OmegaA->ExecuteXtoP();
}
COMPLEX SymmetricSingleInclusive(INT kXIndex,INT kYIndex){
COMPLEX SIloc=COMPLEX(0.0,0.0);
// SUM OVER ALEGBRA INDICES OF |OMEGA_S|^2+|OMEGA_A|^2 TO GET SINGLE INCLUSIVE//
for(INT a=0;a<SUNcAlgebra::VectorSize;a++){
SIloc+=FourierSpace::OmegaS->GetP(BoundaryIndex(Lattice::N[0]-kXIndex),BoundaryIndex(Lattice::N[1]-kYIndex),a)*FourierSpace::OmegaS->GetP(kXIndex,kYIndex,a)+FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-kXIndex),BoundaryIndex(Lattice::N[1]-kYIndex),a)*FourierSpace::OmegaA->GetP(kXIndex,kYIndex,a); // DIMLESS //
}
// RE-NORMALIZE 1/(k^2 (2\pi)^3 ) //
DOUBLE kSqr=IndexTokSqr(kXIndex,kYIndex);
SIloc*=1.0/((kSqr+1e-9)*pow(2.0*PI,3)); // GeV^-2 //
return SIloc; // GeV^-2 //
}
// COMPLETE ANTISYMMETRIC SINGLE INCLUSIVE -- BASED ON arXiv:1802.08166 EQN D5 //
COMPLEX AntiSymmetricSingleInclusive(INT kXIndex, INT kYIndex){
// CONSTANTS //
// UV CONSTANT TO REMOVE DIVERGENCE //
double UV=Lattice::a[0]*Lattice::a[1]*1e-5;
DOUBLE kXValue=IndexTok(kXIndex);
DOUBLE kYValue=IndexTok(kYIndex);
DOUBLE kSqr=IndexTokSqr(kXIndex,kYIndex);
COMPLEX Integrate=COMPLEX(0.0,0.0);
// q-INTEGRATION //
for(INT qXIndex=0;qXIndex<Lattice::N[0];qXIndex++){
for(INT qYIndex=0;qYIndex<Lattice::N[1];qYIndex++){
INT kXMinusqXIndex=BoundaryIndex(kXIndex-qXIndex);
INT kYMinusqYIndex=BoundaryIndex(kYIndex-qYIndex);
// q_x, q_y //
DOUBLE qXValue=IndexTok(qXIndex);
DOUBLE qYValue=IndexTok(qYIndex);
// q^2 //
DOUBLE qSqr=IndexTokSqr(qXIndex,qYIndex);
// (k-q)_i //
DOUBLE kXMinusqX=IndexTok(kXMinusqXIndex);
DOUBLE kYMinusqY=IndexTok(kYMinusqYIndex);
// k.(k-q) //
DOUBLE kDotkMinusq=kXValue*kXMinusqX+kYValue*kYMinusqY;
// q.(k-q) //
DOUBLE qDotkMinusq=qXValue*kXMinusqX+qYValue*kYMinusqY;
// (k-q)^2
DOUBLE kMinusqSqr=IndexTokSqr(kXMinusqXIndex,kYMinusqYIndex);
// CROSS PRODUCT ///
// CHECK THIS //
DOUBLE kCrossq=kXMinusqX*qYValue-kYMinusqY*qXValue;
COMPLEX Sum=COMPLEX(0.0,0.0);
for(INT a=0;a<SUNcAlgebra::VectorSize;a++){
for(INT b=0;b<SUNcAlgebra::VectorSize;b++){
for(INT c=0;c<SUNcAlgebra::VectorSize;c++){
if(SUNcAlgebra::StructureFunctions::f0(a,b,c)*SUNcAlgebra::StructureFunctions::f0(a,b,c)>0){
//INTEGRATION -- INHERENTLY GETTING IMAGINARY PART //
Sum+=SUNcAlgebra::StructureFunctions::f0(a,b,c)*SIGN_V(kCrossq)*1.0/((qSqr+UV)*(kMinusqSqr+UV))*(
(kSqr*FourierSpace::OmegaA->GetP(qXIndex,qYIndex,a)*FourierSpace::OmegaA->GetP(kXMinusqXIndex,kYMinusqYIndex,b)*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-kXIndex),BoundaryIndex(Lattice::N[1]-kYIndex),c)
-qDotkMinusq*FourierSpace::OmegaA->GetP(qXIndex,qYIndex,a)*FourierSpace::OmegaA->GetP(kXMinusqXIndex,kYMinusqYIndex,b)*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-kXIndex),BoundaryIndex(Lattice::N[1]-kYIndex),c)
-qDotkMinusq*FourierSpace::OmegaS->GetP(qXIndex,qYIndex,a)*FourierSpace::OmegaS->GetP(kXMinusqXIndex,kYMinusqYIndex,b)*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-kXIndex),BoundaryIndex(Lattice::N[1]-kYIndex),c)
+2.0*kDotkMinusq*FourierSpace::OmegaA->GetP(qXIndex,qYIndex,a)*FourierSpace::OmegaS->GetP(kXMinusqXIndex,kYMinusqYIndex,b)*FourierSpace::OmegaS->GetP(BoundaryIndex(Lattice::N[0]-kXIndex),BoundaryIndex(Lattice::N[1]-kYIndex),c))
-(kSqr*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-qXIndex),BoundaryIndex(Lattice::N[1]-qYIndex),a)*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-kXMinusqXIndex),BoundaryIndex(Lattice::N[1]-kYMinusqYIndex),b)
*FourierSpace::OmegaA->GetP(kXIndex,kYIndex,c)
-qDotkMinusq*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-qXIndex),BoundaryIndex(Lattice::N[1]-qYIndex),a)*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-kXMinusqXIndex),BoundaryIndex(Lattice::N[1]-kYMinusqYIndex),b)*FourierSpace::OmegaA->GetP(kXIndex,kYIndex,c)
-qDotkMinusq*FourierSpace::OmegaS->GetP(BoundaryIndex(Lattice::N[0]-qXIndex),BoundaryIndex(Lattice::N[1]-qYIndex),a)*FourierSpace::OmegaS->GetP(BoundaryIndex(Lattice::N[0]-kXMinusqXIndex),BoundaryIndex(Lattice::N[1]-kYMinusqYIndex),b)*FourierSpace::OmegaA->GetP(kXIndex,kYIndex,c)
+2.0*kDotkMinusq*FourierSpace::OmegaA->GetP(BoundaryIndex(Lattice::N[0]-qXIndex),BoundaryIndex(Lattice::N[1]-qYIndex),a)*FourierSpace::OmegaS->GetP(BoundaryIndex(Lattice::N[0]-kXMinusqXIndex),BoundaryIndex(Lattice::N[1]-kYMinusqYIndex),b)*FourierSpace::OmegaS->GetP(kXIndex,kYIndex,c))
);
}// END IF |f|>0 STATEMENT //
}// END c LOOP ///
//Integrate+=Sum;
}// END b LOOP //
}// END a LOOP //
Integrate+=Sum;
} // END qX LOOP //
} // END qY LOOP //
// CONSTANTS * [Measure ~ d^2p ][1/k^2][ Integrate~ \Omega^4/k^2 ]
return ComplexI*0.5/(std::pow(2.0*PI,3))*(invfmtoGeV/Lattice::SizeX)*(invfmtoGeV/Lattice::SizeY)*1.0/kSqr*Integrate; // GeV^-2 //
}
}
#endif
| [
"mmace1791@gmail.com"
] | mmace1791@gmail.com |
a0e6455d87c7da82b55f207c5055983fd86093b7 | 039bef237b462b9cacd0c800c621528a5dddfb9b | /URI/2238 - Divisores/2238.cpp | a31c4d1c7d8c49e0247c08323bbb86bfb83ee6d4 | [] | no_license | tarv7/MaratonaDeProgramacao | 908167725f97259cf3b3f4d0b671f710a74b2ae9 | b767e19fe680bfc969932833a73bd08bdff9616b | refs/heads/master | 2021-05-07T15:15:13.221558 | 2017-12-10T05:00:42 | 2017-12-10T05:00:42 | 109,928,340 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 510 | cpp | #include<iostream>
#include<cmath>
using namespace std;
int main(){
long long int a, b, c, d, n, menor = -1;
cin >> a >> b >> c >> d;
for(n = 1; n <= (int)sqrt(c) + 1; n++)
if((n % a == 0) && (n % b != 0) && (c % n == 0) && (d % n != 0)){
if(n < menor || menor == -1)
menor = n;
}else if(c % n == 0){
if(((c / n) % a == 0) && ((c / n) % b != 0) && (c % (c / n) == 0) && (d % (c / n) != 0))
if(n < menor || menor == -1)
menor = c / n;
}
cout << menor << endl;
return 0;
}
| [
"thallles.ramos@gmail.com"
] | thallles.ramos@gmail.com |
c012578c24d07632c3a48866e9c3b0afeaae782e | f125d550d0457a35220ed35a375c8820efd373e6 | /Userland/Applications/Browser/Browser.h | a4a4eefe1f0c4605ac6f30042dcea8876f8a3de5 | [
"BSD-2-Clause"
] | permissive | seven1m/serenity | 3c4a744fe1cc65e54c9aa62c9f97fb5df04b43bf | 447b8e808219d7f326fa6a4fd922adf7a3f86759 | refs/heads/master | 2021-06-24T19:44:42.274014 | 2021-02-07T17:25:30 | 2021-02-07T17:36:31 | 207,917,650 | 1 | 0 | BSD-2-Clause | 2019-09-11T22:28:44 | 2019-09-11T22:28:44 | null | UTF-8 | C++ | false | false | 1,475 | h | /*
* Copyright (c) 2020, the SerenityOS developers.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#include <AK/String.h>
namespace Browser {
extern String g_home_url;
}
| [
"kling@serenityos.org"
] | kling@serenityos.org |
489b033149c95d7f23ebc2891b0d740b89036c98 | cc4d101c064ecd3cc185139c02f6a0297e9b36f3 | /src/core/rainy.h | 801dbbc1a59beffd067ad418814b46d684ff3f37 | [] | no_license | infancy/rainy | f74b2ce1de03d027c14aca1800d585d6633aad27 | 4d234ce17dc7dcc4b0e2597331061155709fe52a | refs/heads/master | 2023-01-03T05:16:07.590602 | 2020-11-03T17:17:51 | 2020-11-03T17:17:51 | 92,111,879 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,422 | h | #if defined(_MSC_VER)
#define NOMINMAX
#pragma once
#endif
#ifndef RAINY_CORE_RAINY_H
#define RAINY_CORE_RAINY_H
#include"platform.h"
// Global Include Files
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <cstdint>
#include <cstring>
#include <algorithm>
#include <fstream>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
#ifdef RAINY_HAVE_MALLOC_H
#include <malloc.h> // for _alloca, memalign
#endif
#include <glog/logging.h>
// Platform-specific definitions
#include <stdint.h>
#if defined(RAINY_IN_MSVC)
#include <float.h>
#include <intrin.h>
#pragma warning(disable : 4267) // size_t -> int conversion
#pragma warning(disable : 4305) // double constant assigned to float
#pragma warning(disable : 4244) // int -> float conversion
#pragma warning(disable : 4843) // double -> float conversion
#endif
namespace rainy
{
//#define RAINY_FLOAT_AS_DOUBLE
#ifdef RAINY_FLOAT_AS_DOUBLE
using Float = double;
#else
using Float = float;
#endif
//#define RAINY_USE_EMBREE
#ifdef RAINY_USE_EMBREE
//
#endif
//the math module of pbrt
template <typename T>
class Vector2;
template <typename T>
class Vector3;
template <typename T>
class Point2;
template <typename T>
class Point3;
template <typename T>
class Normal3;
class Ray;
class RayDifferential;
template <typename T>
class Bounds2;
template <typename T>
class Bounds3;
class Transform;
struct Matrix4x4;
// Global Forward Declarations
class Spectrum;
class RNG;
class Image;
class Scene;
class Integrator;
class SamplerIntegrator;
class Interaction;
class SurfaceInteraction;
class MediumInteraction;
class Shape;
class Primitive;
class GeometricPrimitive;
class Camera;
struct CameraSample;
class ProjectiveCamera;
class Sampler;
class Filter;
class Film;
class FilmTile;
class BxDF;
class BSDF;
//class BSSRDF;
class Material;
template <typename T>
class Texture;
class Medium;
class Light;
class Visibility;
class AreaLight;
struct Distribution1D;
class Distribution2D;
//用于确定路径是从相机还是光源开始的
enum class TransportMode { Radiance, Importance };
struct Options
{
int nThreads = 0;
bool quickRender = false;
bool quiet = false;
bool cat = false, toPly = false;
std::string imageFile;
};
} //namespace rainy
#endif //RAINY_CORE_RAINY_H
| [
"326948850@qq.com"
] | 326948850@qq.com |
69531a402800d8ab6567b6a2f3cb703f1a42022d | e77f1c02c53b058445944389c9087b44beab8a3f | /ACM/NOIP/CodeVS/CodeVS_1154_能量项链.cpp | b0a0bbb63263e7962cda97d8cacd49f1cc4b5f7c | [
"MIT"
] | permissive | lyh543/Some-Codes | c71ae774c9e7442424f5620e0b9f27b603225cb8 | ad4328ea87b706d2cfd6148bd85f795c13c75d18 | refs/heads/master | 2022-05-19T23:14:54.987041 | 2022-04-06T06:28:50 | 2022-04-06T06:28:50 | 239,083,450 | 3 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 685 | cpp | //http://codevs.cn/problem/1154/
#include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
int p[100];
long long power[100][100] = {{0}};
for (int i = 0; i < n; i++)
{
cin >> p[i];
}
for (int d = 2; d <= n; d++) // d ָ right - left
{
for (int l = 0; l < n; l++)
{
int r = (l + d) % n;
long long max = 0;
for (int m = (l+1)%n; m != r; m = (m+1)%n)
{
int temp = power[l][m] + power[m][r]
+ p[l] * p[m] * p[r];
if (temp > max) max = temp;
}
power[l][r] = max;
}
}
long long maxp = 0;
for (int i = 0; i < n; i++)
maxp = power[i][i] > maxp ? power[i][i] : maxp;
cout << maxp;
}
| [
"lxl361429916@live.com"
] | lxl361429916@live.com |
6e927301052d1f4cd758383eb0207d0980e015b9 | b22fd981dee2b457f343f51c2b3eaff39c31eda9 | /Constrctors/Constructors.cpp | 49a5b38835b0695dc0770ff010f9ea15b961825a | [] | no_license | Zaidtech/Learning-Cpp | 49b93f110812f877d829ce70a142ede93e909ced | 3053bcdb9021120e6f12ca21471fc3437dcfc188 | refs/heads/master | 2023-02-15T00:34:33.596340 | 2021-01-13T18:12:28 | 2021-01-13T18:12:28 | 288,705,714 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 788 | cpp | // Types of Constructos
// 1. Default 2. Parameterized 3. Copy Constructors
#include <iostream>
using namespace std;
class Car{
int id;
string model;
public:
// constructor initialization data members..
// "this" keyword which has three main usages
// 1. To Pass current obj as a parameter to a method likr inn LinkedList L1->display();
// 2. to refer class instance variable
// 3. to declare indexers...
// IN CONTRAST THE . OPERATOR IS USED TO ACESSS THE MEMBER METHODS OF A CLASS
Car(){
this->id = 11;
this->model = "Maseraati";
}
}
// Constructors are Public
// have no return typre
// Diff. Signatures
// THE COMPILER AUTOMATICALLY MAKE TWO CONST. 1. DEFAULT 2. COPY CONSTRUCTORS
| [
"mzali@zhcet.ac.in"
] | mzali@zhcet.ac.in |
9f0c1907cfd748a3168c5d862335e50dbf22a33f | dff76925c2dccfbe2d6d2705d65b0f0b5699f618 | /assignment/unsortedtype.h | 8933184d0dd33e16fc7159ab85d0674d06a5c2d6 | [] | no_license | hridikarahman01/data-structure-and-algorithm | 03893273b2e32e9d045ec8baeda0ecedf60ba8f1 | 5e5933d180a513c970e928f2e488a98b178fc61e | refs/heads/main | 2023-04-21T00:15:09.239140 | 2021-05-10T15:53:49 | 2021-05-10T15:53:49 | 366,095,362 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 509 | h | #ifndef UNSORTEDTYPE_H_INCLUDED
#define UNSORTEDTYPE_H_INCLUDED
class list
{
struct node{
int data;
node* next;
node(int val): data(val), next(nullptr){}
};
public:
list();
list(int);
void insert(int);
int remove();
int search(int);
int size();
bool empty();
bool full();
void print();
private:
node* head;
int length;
int MAX=100;
};
#endif // UNSORTEDTYPE_H_INCLUDED
| [
"hridikarahman01@gmail.com"
] | hridikarahman01@gmail.com |
c8841e3214fa8d10b0b052345ac9cdb3624a6c0a | 442de45f27c8b764b719729dc8674c023e94939b | /Code4Life/Code4Life/Merged.cpp | 55248827fd898ca7bb3b52408bcea45d594e99f1 | [] | no_license | mororo250/CodeinGame | 4c7fa50b908c81d10a2b08b10d6a152671f28756 | e12ace251778e706bfa35b0f956abccb05b60582 | refs/heads/main | 2023-06-26T13:44:31.434321 | 2021-07-28T03:38:25 | 2021-07-28T03:38:25 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 28,759 | cpp | #include <iostream>
#include <string>
#include <vector>
#include <list>
#include <valarray>
#include <algorithm>
struct Sample
{
// Assign constructor.
Sample():cost(0, 5) {};
Sample& operator = (Sample const& lhs);
friend bool operator == (Sample const& rhs, Sample const& lhs);
friend std::ostream& operator<<(std::ostream& os, Sample const& sample);
void get_sample_info();
int sampleId;
int carriedBy;
int rank;
std::string expertiseGain;
int health;
std::valarray<int> cost;
};
Sample& Sample::operator=(Sample const& lhs)
{
sampleId = lhs.sampleId;
carriedBy = lhs.carriedBy;
rank = lhs.rank;
expertiseGain = lhs.expertiseGain;
health = lhs.health;
cost = lhs.cost;
return *this;
}
bool operator == (Sample const& rhs, Sample const& lhs)
{
if (rhs.sampleId == lhs.sampleId)
return true;
else
return false;
}
std::ostream& operator<<(std::ostream& os, Sample const& sample)
{
if (sample.health == -1)
os << "State: Undiagnosed\n";
else
os << "State: Diagnosed\n";
os << "Sample Id:" << sample.sampleId << "\n";
if (sample.carriedBy == 0)
os << "Carried by: Player1\n";
else if (sample.carriedBy == 1)
os << "Carried by: Player2\n";
else
os << "Carried by: Cloud\n";
os << "rank: " << sample.rank << "\n";
os << "expertise Gain: " << sample.expertiseGain << "\n";
os << "health: " << sample.health << "\n";
os << "costA: " << sample.cost[0] << "\n";
os << "costB: " << sample.cost[1] << "\n";
os << "costC: " << sample.cost[2] << "\n";
os << "costD: " << sample.cost[3] << "\n";
os << "costE: " << sample.cost[4] << "\n";
return os;
}
void Sample::get_sample_info()
{
std::cin >> sampleId
>> carriedBy
>> rank
>> expertiseGain
>> health
>> cost[0]
>> cost[1]
>> cost[2]
>> cost[3]
>> cost[4];
std::cin.ignore();
}
class Robot
{
public:
enum States
{
ST_IDLE = 0,
ST_COLLECTSAMPLE = 1, // Collect samples at Samples
ST_ANALYZESAMPLE = 2, // Analyze data files at the DIAGNOSIS.
ST_GATHERMOLECULES = 3, // Gather required molecules at the MOLECULES.
ST_PRODUCEMEDICINES = 4, // produce the medicines at the LABORATORY.
ST_MOVING = 5 // intermediate state.
};
Robot(std::string const& name);
// Recieves all the robot input information.
void get_robot_info();
void run();
void set_state(States new_state);
inline States get_current_state() { return m_current_state; }
friend std::ostream& operator<<(std::ostream& os, Robot const& robot);
private:
// Define the state machine state functions
void st_idle();
void st_collect_sample();
void st_analyze_sample();
void st_gather_molecule();
void st_produce_medicne();
void st_moving();
int choose_rank(); // Choose rank of the sample to be collected.
bool choose_molecule(std::valarray<int> const& needed, std::valarray<int> const& needed_total);
void update_sample_cost(); // Update sample cost with current expertise.
bool is_sample_free(Sample const& sample); // Check if updated sample cost is zero. Call it after update_sample_cost.
bool is_sample_valid(); // Check if cost is too high.
bool is_sample_valid(Sample& sample); // Override for single Sample.
int get_sample_priority(Sample const& sample); // Priority can be 0, 1 or 2.
void move_to_ready(std::list<Sample>::iterator sample_it);
void update_reserve(std::list<Sample>::iterator sample_it);
States m_current_state;
States m_next_state;
std::list<Sample> m_samples_undiagnosed; // Vector can't be a pointer because Module Diagnosis vector
std::list<Sample> m_samples_diagnosed;
std::list<Sample> m_samples_ready;
std::string m_name;
std::string m_target;
int m_eta;
int m_score;
std::valarray<int> m_storage;
std::valarray<int> m_expertise;
std::valarray<int> m_reserved;
};
#include <tuple>
#include <iostream>
class Project
{
public:
Project() = default;
Project(Project const& other) = default;
Project& operator=(Project const& other) = default;
~Project() = default;
void get_info_project();
friend std::ostream& operator<<(std::ostream& os, Project const& project);
private:
int m_a;
int m_b;
int m_c;
int m_d;
int m_e;
};
void Project::get_info_project()
{
std::cin >> m_a
>> m_b
>> m_c
>> m_d
>> m_e;
std::cin.ignore();
}
std::ostream& operator<<(std::ostream& os, Project const& project)
{
os << "Project info:\n";
os << "Needed expertise A:" << project.m_a << "\n";
os << "Needed expertise B:" << project.m_b << "\n";
os << "Needed expertise C:" << project.m_c << "\n";
os << "Needed expertise D:" << project.m_d << "\n";
os << "Needed expertise E:" << project.m_e << "\n";
return os;
}
class Module
{
public:
Module() {}
virtual ~Module() = default;
private:
};
class ModuleDiagnosis : public Module
{
private:
ModuleDiagnosis() = default;
static ModuleDiagnosis* s_module_diagnosis;
public:
ModuleDiagnosis(ModuleDiagnosis const& other) = delete;
ModuleDiagnosis& operator=(ModuleDiagnosis const& other) = delete;
void get_diagnosis_info();
inline int get_sample_count() const { return m_sample_count; }
Sample& get_max_health_sample();
void get_undiagnosed_samples(std::list<Sample>& samples, int const robot_id = 0); // Id player = 0 / other = 1
//void get_cloud_sample(); //todo cloud samples
void update_undiagnosed_samples(std::list<Sample>& samples, int const robot_id = 0);
static ModuleDiagnosis* get_instance();
private:
int m_sample_count;
std::vector<Sample> m_samples;
};
ModuleDiagnosis* ModuleDiagnosis::s_module_diagnosis = nullptr;
void ModuleDiagnosis::get_diagnosis_info()
{
std::cin >> m_sample_count;
std::cin.ignore();
m_samples.resize(m_sample_count, Sample());
for (int i = 0; i < m_sample_count; i++)
{
m_samples[i].get_sample_info();
}
}
ModuleDiagnosis* ModuleDiagnosis::get_instance()
{
if (s_module_diagnosis == nullptr)
s_module_diagnosis = new ModuleDiagnosis();
return s_module_diagnosis;
}
Sample& ModuleDiagnosis::get_max_health_sample()
{
int max_health = 0;
int i = 0;
for (i++; i < m_sample_count; i++)
{
if (m_samples[i].health > m_samples[max_health].health && m_samples[max_health].carriedBy == -1)
max_health = i;
}
if (m_samples[max_health].carriedBy != 1)
{
return m_samples[max_health];
}
}
void ModuleDiagnosis::get_undiagnosed_samples(std::list<Sample>& samples, int const robot_id)
{
if (robot_id != 0 && robot_id != 1)
{
std::cerr << "Not valid Robot id" << std::endl;
exit(EXIT_FAILURE);
}
for (Sample& sample : m_samples)
{
if (sample.carriedBy == robot_id && sample.cost[0] == -1)
{
// Check if this sample is already being carried.
if (std::find(samples.begin(), samples.end(), sample) == samples.end())
samples.push_back(sample);
}
}
}
void ModuleDiagnosis::update_undiagnosed_samples(std::list<Sample>& samples, int const robot_id)
{
if (robot_id != 0 && robot_id != 1)
{
std::cerr << "Not valid Robot id" << std::endl;
exit(EXIT_FAILURE);
}
for (Sample& sample : samples)
{
auto inter_sample = std::find(m_samples.begin(), m_samples.end(), sample);
// Check if the sample exist.
if (inter_sample != m_samples.end())
sample = *inter_sample; // Update Sample
else
{
std::cerr << "the sample: " << sample.sampleId << " Isn't available." << std::endl;
exit(EXIT_FAILURE);
}
}
}
class ModuleMolecules : public Module
{
private:
ModuleMolecules():m_available(0, 5) {};
static ModuleMolecules* s_module_molecules;
public:
ModuleMolecules(ModuleMolecules const& other) = delete;
ModuleMolecules& operator=(ModuleMolecules const& other) = delete;
void get_molecules_info();
bool enough_molecules(std::valarray<int> const& needed) const;
static ModuleMolecules* get_instance();
private:
std::valarray<int> m_available;
};
ModuleMolecules* ModuleMolecules::s_module_molecules = nullptr;
ModuleMolecules* ModuleMolecules::get_instance()
{
if (s_module_molecules == nullptr)
s_module_molecules = new ModuleMolecules();
return s_module_molecules;
}
void ModuleMolecules::get_molecules_info()
{
std::cin >> m_available[0]
>> m_available[1]
>> m_available[2]
>> m_available[3]
>> m_available[4];
std::cin.ignore();
}
bool ModuleMolecules::enough_molecules(std::valarray<int> const& needed) const
{
if ((needed <= m_available).min() == true)
{
return true;
}
else
return false;
}
class ModuleLaboratory : public Module
{
private:
ModuleLaboratory() = default;
static ModuleLaboratory* s_module_laboratory;
public:
ModuleLaboratory(ModuleLaboratory const& other) = delete;
ModuleLaboratory& operator=(ModuleLaboratory const& other) = delete;
static ModuleLaboratory* get_instance();
};
ModuleLaboratory* ModuleLaboratory::s_module_laboratory = nullptr;
ModuleLaboratory* ModuleLaboratory::get_instance()
{
if (s_module_laboratory == nullptr)
s_module_laboratory = new ModuleLaboratory();
return s_module_laboratory;
}
class ModuleSamples : public Module
{
private:
ModuleSamples() = default;
static ModuleSamples* s_module_samples;
public:
ModuleSamples(ModuleSamples const& other) = delete;
ModuleSamples& operator=(ModuleSamples const& other) = delete;
static ModuleSamples* get_instance();
};
ModuleSamples* ModuleSamples::s_module_samples = nullptr;
ModuleSamples* ModuleSamples::get_instance()
{
if (s_module_samples == nullptr)
s_module_samples = new ModuleSamples();
return s_module_samples;
}
class GameWorld
{
private:
GameWorld() = default;
static GameWorld* s_game_world;
public:
GameWorld(GameWorld const& other) = delete;
GameWorld& operator=(GameWorld const& other) = delete;
static GameWorld* get_instance();
void get_projects_info();
void update_world();
unsigned int get_round() { return m_round_number; }
unsigned int get_round_to_end() { return 200 - m_round_number + 1; }
private:
std::vector<Project> m_projects;
int m_project_count;
std::vector<Robot> m_robots = { Robot("Player1"), Robot("Player2") };
unsigned int m_round_number = 0;
};
GameWorld* GameWorld::s_game_world = nullptr;
GameWorld* GameWorld::get_instance()
{
if (s_game_world == nullptr)
s_game_world = new GameWorld();
return s_game_world;
}
void GameWorld::get_projects_info()
{
std::cin >> m_project_count;
std::cin.ignore();
m_projects.resize(m_project_count, Project());
for (int i = 0; i < m_project_count; i++)
{
m_projects[i].get_info_project();
std::cerr << m_projects[i] << std::endl;
}
}
void GameWorld::update_world()
{
for (Robot& robot : m_robots)
robot.get_robot_info();
ModuleMolecules* module_modlecules = ModuleMolecules::get_instance();
module_modlecules->get_molecules_info();
ModuleDiagnosis* module_diagnosis = ModuleDiagnosis::get_instance();
module_diagnosis->get_diagnosis_info();
m_round_number++; // Needs to go before run()
m_robots[0].run();
}
Robot::Robot(std::string const& name)
: m_name(name)
, m_current_state(ST_IDLE)
, m_next_state(ST_MOVING)
, m_storage(0, 5)
, m_expertise(0, 5)
, m_reserved(0, 5)
{
}
void Robot::get_robot_info()
{
std::cin >> m_target
>> m_eta
>> m_score
>> m_storage[0]
>> m_storage[1]
>> m_storage[2]
>> m_storage[3]
>> m_storage[4]
>> m_expertise[0]
>> m_expertise[1]
>> m_expertise[2]
>> m_expertise[3]
>> m_expertise[4];
std::cin.ignore();
}
void Robot::run()
{
switch (m_current_state)
{
case ST_IDLE:
st_idle();
break;
case ST_COLLECTSAMPLE:
st_collect_sample();
break;
case ST_ANALYZESAMPLE:
st_analyze_sample();
break;
case ST_GATHERMOLECULES:
st_gather_molecule();
break;
case ST_PRODUCEMEDICINES:
st_produce_medicne();
break;
case ST_MOVING:
st_moving();
break;
}
//std::cerr << *this << std::endl;
}
void Robot::set_state(States new_state)
{
switch (new_state)
{
case ST_COLLECTSAMPLE:
std::cout << "GOTO SAMPLES" << std::endl;
m_current_state = ST_MOVING;
m_next_state = ST_COLLECTSAMPLE;
break;
case ST_ANALYZESAMPLE:
std::cout << "GOTO DIAGNOSIS" << std::endl;
m_current_state = ST_MOVING;
m_next_state = ST_ANALYZESAMPLE;
break;
case ST_GATHERMOLECULES:
std::cout << "GOTO MOLECULES" << std::endl;
m_current_state = ST_MOVING;
m_next_state = ST_GATHERMOLECULES;
break;
case ST_PRODUCEMEDICINES:
std::cout << "GOTO LABORATORY" << std::endl;
m_current_state = ST_MOVING;
m_next_state = ST_PRODUCEMEDICINES;
break;
case ST_IDLE:
std::cerr << "Robot shouldnt go back to start" << std::endl;
exit(EXIT_FAILURE);
break;
case ST_MOVING:
std::cerr << "Moving is not a valid state to be set" << std::endl;
exit(EXIT_FAILURE);
break;
}
}
void Robot::st_idle()
{
set_state(ST_COLLECTSAMPLE);
}
void Robot::st_collect_sample()
{
constexpr int MINIMUM_ROUNDS_MOVIMENT = 3 + 4; // How many rounds are necessary walking. Samples -> Diagnosis -> Laboratory.
constexpr int MINIMUM_ROUNDS_TASKS = 3; // How many rounds are necessary doing tasks. Collect, analyse and produce Medicine
static unsigned int s_collected = 0;
int const rounds_to_end = GameWorld::get_instance()->get_round_to_end();
int const number_available_slot = 3 - (m_samples_undiagnosed.size() + m_samples_diagnosed.size() + s_collected);
int const total_rounds = MINIMUM_ROUNDS_MOVIMENT + MINIMUM_ROUNDS_TASKS +
s_collected * (MINIMUM_ROUNDS_TASKS - 1) + m_samples_diagnosed.size();
if (rounds_to_end < total_rounds || number_available_slot == 0)
{
set_state(ST_ANALYZESAMPLE);
ModuleDiagnosis::get_instance()->get_undiagnosed_samples(m_samples_undiagnosed, 0);
s_collected = 0; // Reset collected.
return;
}
else if (rounds_to_end == total_rounds) // Bet on free sample.
{
std::cout << "CONNECT " << 2 << std::endl;
s_collected = 3; // Go to diagnosis in the next round.
return;
}
else if (rounds_to_end <= (total_rounds + 5)) // Bet on free sample.
{
std::cout << "CONNECT " << 2 << std::endl;
s_collected++;
return;
}
else if (number_available_slot > 0) // Normal Rounds.
{
int rank = choose_rank();
std::cout << "CONNECT " << rank << std::endl;
s_collected++;
return;
}
else
{
std::cerr << "This shouldn't happen Problem with ST_COLLECT STATE" << std::endl;
exit(EXIT_FAILURE);
}
}
void Robot::st_analyze_sample() // remove code repetiton.
{
constexpr int MINIMUM_ROUNDS_MOVIMENT = 4; // How many rounds are necessary walking. Diagnosis -> Laboratory.
constexpr int MINIMUM_ROUNDS_TASKS = 2; // How many rounds are necessary doing tasks. Analyse and produce Medicine
int const rounds_to_end = GameWorld::get_instance()->get_round_to_end();
int total_rounds = MINIMUM_ROUNDS_MOVIMENT + m_samples_diagnosed.size() + m_samples_ready.size();
// todo check if there are any available sample in the cloud.
std::cerr << "Total Rounds:" << total_rounds << std::endl;
std::cerr << "rounds to end:" << rounds_to_end << std::endl;
if (rounds_to_end <= total_rounds + 2)
{
update_sample_cost();
total_rounds = MINIMUM_ROUNDS_MOVIMENT + m_samples_ready.size();
if (total_rounds == rounds_to_end || m_samples_undiagnosed.empty())
{
set_state(ST_PRODUCEMEDICINES); // If there are two free samples go to laboratory.
return;
}
}
if (!m_samples_undiagnosed.empty())
{
// Sample& sample = ModuleDiagnosis::get_instance()->get_max_health_sample();
Sample& sample = m_samples_undiagnosed.back();
m_samples_undiagnosed.pop_back();
std::cout << "CONNECT " << sample.sampleId << std::endl;
m_samples_diagnosed.push_back(std::move(sample));
}
else
{
update_sample_cost();
if (m_samples_ready.size() >= 2)
{
set_state(ST_PRODUCEMEDICINES); // If there are two free samples go to laboratory.
return;
}
if (is_sample_valid())
{
set_state(ST_GATHERMOLECULES);
return;
}
}
}
void Robot::st_gather_molecule()
{
constexpr int ROUNDS_MOVIMENT = 3; // How many rounds are necessary walking. Molecules -> Laboratory.
int const rounds_to_end = GameWorld::get_instance()->get_round_to_end();
// Loop is for rounds where there is just enough molecules for a sample.
// Todo remove loop.
while (true)
{
auto sample = m_samples_diagnosed.end();
std::valarray<int> needed(0, 5);
std::valarray<int> needed_total(0, 5);
for (auto [sample_it, priority, total_needed] = std::tuple{ m_samples_diagnosed.begin(), -1, 0 }; sample_it != m_samples_diagnosed.end(); sample_it++)
{
int priority_temp = get_sample_priority(*sample_it);
std::valarray<int> needed_temp = sample_it->cost - (m_storage - m_reserved);
for (int& temp : needed_temp)
temp = std::max(temp, 0);
if (ModuleMolecules::get_instance()->enough_molecules(needed_temp) &&
(m_storage.sum() + needed_temp.sum() < 10))
{
std::cerr << *this << std::endl;
std::cerr << "Priority:" << priority_temp << std::endl;
std::cerr << "Total:" << std::endl;
for (int& total : needed_total)
std::cerr << total << std::endl;
if (priority_temp > priority)
{
needed = needed_temp;
sample = sample_it;
priority = priority_temp;
}
if (priority_temp >= 1)
needed_total += needed_temp;
}
}
// Todo: Improve code to compute if its possible to gather enough molecule for another sample.
if (ROUNDS_MOVIMENT + m_samples_ready.size() == rounds_to_end || m_storage.sum() == 10)
{
if ((needed <= 0).min() == true && sample != m_samples_diagnosed.end())
{
update_reserve(sample);
}
set_state(ST_PRODUCEMEDICINES);
return;
}
if (sample == m_samples_diagnosed.end()) // There are not enough molecules.
{
if (m_samples_ready.empty()) // If there isnt enough molecules for any sample WAIT.
std::cout << "WAIT" << std::endl;
else
set_state(ST_PRODUCEMEDICINES);
}
else if (!choose_molecule(needed , needed_total))
{
update_reserve(sample);
continue; // No output so continue to next interaction.
}
break; // out of while.
}
}
void Robot::st_produce_medicne()
{
constexpr int MAXIMUM_ROUNDS_MOVIMENT = 3 + 3 + 3 + 3; // Laboratory -> Samples -> Diagnosis -> Molecules -> Laboratory.
constexpr int ROUNDS_TASKS = 3 * 2 + 4; // How many rounds are necessary doing tasks.
constexpr int NEEDED_ROUNDS = MAXIMUM_ROUNDS_MOVIMENT + ROUNDS_TASKS;
int const rounds_to_end = GameWorld::get_instance()->get_round_to_end();
if (!m_samples_ready.empty())
{
Sample& sample = m_samples_ready.front();
std::cout << "CONNECT " << sample.sampleId << std::endl;
m_reserved -= sample.cost;
m_samples_ready.pop_front();
}
else
{
// If the robot is still carring sample and there are enough molecules gather molecule.
if (m_samples_diagnosed.size() > 1 || (!m_samples_diagnosed.empty() && NEEDED_ROUNDS > rounds_to_end))
set_state(ST_GATHERMOLECULES);
else
set_state(ST_COLLECTSAMPLE);
}
}
void Robot::st_moving()
{
if (m_eta == 1)
{
m_current_state = m_next_state;
m_next_state = ST_MOVING;
}
std::cout << "WAIT" << std::endl;
}
void Robot::update_sample_cost()
{
ModuleDiagnosis::get_instance()->update_undiagnosed_samples(m_samples_diagnosed, 0);
for (Sample& sample : m_samples_diagnosed)
{
sample.cost -= m_expertise;
for (int& cost : sample.cost)
cost = std::max(cost, 0);
}
// Check if there are two free samples
auto sample_it = m_samples_diagnosed.begin();
while (sample_it != m_samples_diagnosed.end())
{
if (is_sample_free(*sample_it))
move_to_ready(sample_it++);
else
sample_it++;
}
}
bool Robot::is_sample_free(Sample const& sample)
{
if ((sample.cost == 0).min() == true)
return true;
else
return false;
}
bool Robot::is_sample_valid()
{
bool valid = true;
auto sample_it = m_samples_diagnosed.begin();
while (sample_it != m_samples_diagnosed.end())
{
if (is_sample_valid(*sample_it))
sample_it++;
else
{
std::cout << "CONNECT " << sample_it->sampleId << std::endl; // Store in the cloud.
m_samples_diagnosed.erase(sample_it++);
valid = false;
}
}
return valid;
}
bool Robot::is_sample_valid(Sample& sample)
{
int total_cost = sample.cost.sum();
if ((sample.cost > 5).max() == true || total_cost > 8)
return false;
else
return true;
}
int Robot::get_sample_priority(Sample const& sample)
{
// Priority is determined by how many other samples are allowed to be researched together with it.
bool is_sample_valid = false; // Check if sample is part of m_samples_diagnosed
int priority = 0;
for (Sample const& sample_aux : m_samples_diagnosed)
{
if (sample_aux == sample)
{
is_sample_valid = true;
continue;
}
if (((sample.cost + sample_aux.cost) > 5).max() == true)
continue;
if ((sample.cost + sample_aux.cost).sum() > 10)
continue;
priority++;
}
if (!is_sample_valid)
{
std::cerr << "This sample is not valid" << std::endl;
exit(EXIT_FAILURE);
}
return priority;
}
void Robot::move_to_ready(std::list<Sample>::iterator sample_it)
{
m_samples_ready.splice(m_samples_ready.end(), m_samples_diagnosed, sample_it); // move samples form diagnosed to ready
auto update_cost = [](int index, std::list<Sample>& samples_diagnosed)
{
for (Sample& sample : samples_diagnosed)
sample.cost[index] = std::max(--sample.cost[index], 0);
};
if (m_samples_ready.back().expertiseGain == "A")
update_cost(0, m_samples_diagnosed);
else if (m_samples_ready.back().expertiseGain == "B")
update_cost(1, m_samples_diagnosed);
else if (m_samples_ready.back().expertiseGain == "C")
update_cost(2, m_samples_diagnosed);
else if (m_samples_ready.back().expertiseGain == "D")
update_cost(3, m_samples_diagnosed);
else if (m_samples_ready.back().expertiseGain == "E")
update_cost(4, m_samples_diagnosed);
}
void Robot::update_reserve(std::list<Sample>::iterator sample_it)
{
m_reserved += sample_it->cost;
move_to_ready(sample_it); // Update vectors
}
int Robot::choose_rank()
{
int expertise_total = m_expertise.sum();
if ((expertise_total) < 9)
return 1;
else if ((expertise_total) < 15)
return 2;
else
return 3;
}
bool Robot::choose_molecule(std::valarray<int> const& needed, std::valarray<int> const& needed_total)
{
if (needed.max() == 0)
return false;
else
{
int max_value = 0;
int index_of_max = 0;
for (int i = 0; i < needed.size(); i++)
{
std::cerr << "Needed: " << needed[i] << std::endl;
std::cerr << "Needed_Total: " << needed_total[i] << std::endl;
if (needed_total.max() == 0)
{
if (needed[i] > max_value)
{
max_value = needed_total[i];
index_of_max = i;
}
}
else
{
if (needed_total[i] > max_value && (needed[i] > 0)) // choose most critical.
{
max_value = needed_total[i];
index_of_max = i;
}
}
}
if (index_of_max == 0)
std::cout << "CONNECT A" << std::endl;
else if (index_of_max == 1)
std::cout << "CONNECT B" << std::endl;
else if (index_of_max == 2)
std::cout << "CONNECT C" << std::endl;
else if (index_of_max == 3)
std::cout << "CONNECT D" << std::endl;
else if (index_of_max == 4)
std::cout << "CONNECT E" << std::endl;
return true;
}
if (needed[0] > 0)
std::cout << "CONNECT A" << std::endl;
else if (needed[1] > 0)
std::cout << "CONNECT B" << std::endl;
else if (needed[2] > 0)
std::cout << "CONNECT C" << std::endl;
else if (needed[3] > 0)
std::cout << "CONNECT D" << std::endl;
else if (needed[4] > 0)
std::cout << "CONNECT E" << std::endl;
}
std::ostream& operator<<(std::ostream& os, Robot const& robot)
{
os << "Print Robot info: "<< robot.m_name << "\n\n";
// Todo add state info.
os << "Stored Molecules: \n";
os << "Type A: " << robot.m_storage[0] << "\n";
os << "Type B: " << robot.m_storage[1] << "\n";
os << "Type C: " << robot.m_storage[2] << "\n";
os << "Type D: " << robot.m_storage[3] << "\n";
os << "Type E: " << robot.m_storage[4] << "\n\n";
os << "Reserved Molecules: \n";
os << "Type A: " << robot.m_reserved[0] << "\n";
os << "Type B: " << robot.m_reserved[1] << "\n";
os << "Type C: " << robot.m_reserved[2] << "\n";
os << "Type D: " << robot.m_reserved[3] << "\n";
os << "Type E: " << robot.m_reserved[4] << "\n\n";
os << "Expertise: \n";
os << "Type A: " << robot.m_expertise[0] << "\n";
os << "Type B: " << robot.m_expertise[1] << "\n";
os << "Type C: " << robot.m_expertise[2] << "\n";
os << "Type D: " << robot.m_expertise[3] << "\n";
os << "Type E: " << robot.m_expertise[4] << "\n\n";
os << "Diagnosed samples:\n";
for (Sample const& sample : robot.m_samples_diagnosed)
os << sample << "\n";
os << "Ready samples:\n";
for (Sample const& sample : robot.m_samples_ready)
os << sample << "\n";
return os;
}
int main()
{
// Initialize project
GameWorld::get_instance()->get_projects_info();
// game loop
while (true)
GameWorld::get_instance()->update_world();
} | [
"43460229+mororo250@users.noreply.github.com"
] | 43460229+mororo250@users.noreply.github.com |
8d4bf85085ed53c4fa8dd71801af68dfe089a360 | be4ba0d049488e27b67e1c54952d27576077e09a | /RfSensorGateway/RfSensorGateway.ino | f18d3d2e1c22a021501b076030b1592c7c20a5dd | [
"MIT"
] | permissive | johnmurphy007/homeautomation | b23a0ff5e81f7078a385470951fc54630cbcfa0e | b98b17ad9f51e11fd99e3e176738a613fea50812 | refs/heads/master | 2020-04-11T12:50:33.260475 | 2018-12-17T17:58:11 | 2018-12-17T17:58:11 | 161,794,072 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,619 | ino | #include <SPI.h> // SPI used to connect RF board to Arduino
#include <nRF24L01.h> //RF library
#include <RF24.h> //RF library
#include "printf.h"
#include <Wire.h> // I2C communications
// ******* RF INIT ********************************************************
int ce = 7; // ce = pin 7
int csn = 8; // csn = pin 8
RF24 radio(ce,csn);
// Set up RF channel (channelIdentifier). Creating 2 channel identifers in order
// to have bidirectional comms. Each channel value can be any 5 letter string.
const byte channelIdentifier[][6] = {"node1","node2"};
// ************************************************************************
int TARGET_I2C_ADDRESS = 42;
typedef struct {
int nodeID;
int sensorID;
unsigned long time;
float var1_float;
float var2_float;
} Payload;
Payload theData;
void setup()
{
while (!Serial);
Serial.begin(9600);//300,600,1200,2400,4800,9600,14400,19200,28800,38400,57600,115200
radio.begin();
radio.setAutoAck(1); // Ensure autoACK is enabled so receiver sends ack to let
//you know it got the transmitted packet payload
radio.openWritingPipe(channelIdentifier[0]);
radio.openReadingPipe(1, channelIdentifier[1]);
radio.startListening();
Serial.println("Start Print Details..."); // For debug
printf_begin(); // For debug
radio.printDetails(); // For debug
Serial.println("...End Print Details"); // For debug
Wire.begin(); //start I2C as master (no address)
}
void loop()
{
if (radio.isChipConnected()) {
Serial.println("Chip connected to SPI"); // For debug
} else {
Serial.print("Chip NOT connected to SPI"); // For debug
}
if (radio.available()) {
radio.read( &theData, sizeof(theData) );
// Spew it
Serial.print("NodeID = "); // For debug
Serial.println(theData.nodeID); // For debug
Serial.print("sensorID = "); // For debug
Serial.println(theData.sensorID); // For debug
Serial.print("var1_usl = "); // For debug
Serial.println(theData.time); // For debug
Serial.print("var2_float = "); // For debug
Serial.println(theData.var1_float); // For debug
Serial.print("var3_float = "); // For debug
Serial.println(theData.var2_float); // For debug
Serial.println("Sending data via I2C");
Wire.beginTransmission(TARGET_I2C_ADDRESS);
Wire.write((byte *) &theData, sizeof theData);
Wire.endTransmission();
Serial.println("Finished sending data to I2C");
}
}
| [
"johnmurphy007@gmail.com"
] | johnmurphy007@gmail.com |
4dc24583bca5a2f639019ba69d9816c60619e619 | 4b6343d8750b61eedcabb61b0f9459c22d6ed8d0 | /task/server.cpp | 18204b992683a45ad735b937712faf5fb70c608c | [] | no_license | zahoussem/grub_freq_aware | 571f0475c3ed4a3fb52c2bd354aa34a0364f6930 | b999f651d05f685ba974adcf91e1986374c48fde | refs/heads/master | 2021-01-14T03:09:09.961730 | 2020-06-29T13:58:05 | 2020-06-29T13:58:05 | 242,581,498 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,890 | cpp | #include "server.hpp"
namespace task
{
/**
* The Constructor of the Class server
* @param budget The budget that is allocated to the current server
* @param T The period of the server
*/
Server::Server(double budget, double T)
{
this->budget = budget;
this->T = T;
this->v = 0;
this->remaining = 0;
this->d = 0;
this->state = INACTIVE;
this->bw = budget / T;
}
/**
* The destructor of the class server
*/
Server::~Server()
{
}
/**
* Getter of state
*/
int Server::_state()
{
return this->state;
}
/**
* setter of state
* @param state The state to set
*/
void Server::_state(int state)
{
this->state = state;
}
/**
* Getter of Ts
*/
double Server::_T()
{
return this->T;
}
/**
* setter of Ts
* @param Ts The Ts to set
*/
void Server::_T(double T)
{
this->T = T;
}
/**
* Getter of d
*/
double Server::_d()
{
return this->d;
}
/**
* setter of d
* @param d The d to set
*/
void Server::_d(double d)
{
this->d = d;
}
/**
* Postpones the current server absolute deadline
*/
void Server::postpone_d()
{
this->d += this->T;
}
/**
* Getter of budget
*/
double Server::_budget(double speed)
{
return this->budget/speed;
}
/**
* setter of budget
* @param budget The budget to set
*/
void Server::_budget(double budget, double speed)
{
this->budget = budget/speed;
}
/**
* Getter of v
*/
double Server::_v()
{
return this->v;
}
/**
* setter of v
* @param v The v to set
*/
void Server::_v(double v)
{
this->v = v;
}
/**
* Computing the remaining time to finish the server budget
*/
void Server::compute_remaining()
{
// Houssam : Computes ramaining execution time
}
/**
* Updating the virtual time
*/
void Server::update_v()
{
// Houssam : Computes the virtual time!!
// Need to compute the elapsed time from the latest current
}
/**
* Getter of remaining
*/
double Server::_remaining()
{
return this->remaining;
}
/**
* setter of remaining
* @param remaining The remaining to set
*/
void Server::_remaining(double remaining)
{
this->remaining = remaining;
}
/**
* Getter of bw
*/
double Server::_bw(double speed)
{
return this->bw/speed;
}
/**
* setter of bw
* @param bw The bw to set
*/
void Server::_bw(double bw, double speed)
{
this->bw = bw/speed;
}
/**
* Arms the active contending times
* @param time The time to wait before signaling
* return false if the operation fails
*/
bool Server::arm_act_cont_timer(double time)
{
// Houssam : This function adds an event of active_contending to the event list
return 0;
}
} // namespace task
| [
"zahoussem@gmail.com"
] | zahoussem@gmail.com |
0091ece0aa0880f6f0972117f484cc1b94329878 | abd04c1989feb472c2796b31b65543b891908da4 | /Math/1929.cpp | c950fe8c1289d1f10e83d1bc30d19cd41d17858f | [] | no_license | jyto7034/Baekjoon | a1e9bbd9376014bf51d2091cde7bf6cf9558f194 | 9980fe9986ff25797bd2652182233e6c78b2ec28 | refs/heads/master | 2021-06-19T05:11:52.815883 | 2021-05-20T14:41:04 | 2021-05-20T14:41:04 | 214,875,898 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 515 | cpp | #include <iostream>
bool arry[1000001] = {
false,
true,
};
void solve()
{
int start = 0, end = 0;
std::cin >> start >> end;
for (int i = 2; i < end; i++)
for (int j = 2; i * j <= end; j++)
arry[i * j] = true;
for (int i = start; i <= end; i++)
if (arry[i] == false)
std::cout << i << "\n";
}
int main()
{
std::ios::sync_with_stdio(false);
std::cout.tie(NULL);
std::cin.tie(NULL);
solve();
return 0;
} | [
"jyto7034@naver.com"
] | jyto7034@naver.com |
1cd0882dee7189233070755ca41cb83f4bf20bbe | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/collectd/gumtree/collectd_repos_function_599_collectd-5.5.3.cpp | 5215ba1e5ee1b698c970c9286def67b56a9034e1 | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 219 | cpp | void module_register (void)
{
plugin_register_complex_config ("aggregation", agg_config);
plugin_register_read ("aggregation", agg_read);
plugin_register_write ("aggregation", agg_write, /* user_data = */ NULL);
} | [
"993273596@qq.com"
] | 993273596@qq.com |
c3a20d0d9fe6abc15d2c0abb64e64978fce783c7 | 011d057ad3a75c241340ac89de1cc071d63972e6 | /code2.cpp | 6f0ff8de53b84ee3b2ae665650d47411d2ddaab3 | [] | no_license | KavyaSharma/Codechef | 6d4ffcf7e29c42b76fab43a06981f893334e9d07 | d0bbb1438931630008058caa313efb15cb396017 | refs/heads/master | 2020-02-26T14:28:13.858999 | 2017-10-27T15:24:19 | 2017-10-27T15:24:19 | 61,947,156 | 0 | 0 | null | 2017-10-27T15:24:20 | 2016-06-25T14:36:07 | C++ | UTF-8 | C++ | false | false | 492 | cpp | #include <iostream>
#include <algorithm>
using namespace std;
unsigned comb( unsigned n, unsigned k )
{
if (k > n)
return 0;
if (k * 2 > n)
k = n-k;
if (k == 0)
return 1;
unsigned sol = n;
for( unsigned l = 2; l <= k; ++l ) {
sol *= (n-l+1);
sol /= l;
}
return sol;
}
int main() {
long long int n,k,j, sum=0;
cin>>n>>k;
for(j=0;j<=k;j=j+2)
sum=sum+comb(n,j);
sum=sum%1000000007;
cout<<sum;
return 0;
} | [
"sharma.kavya1996@gmail.com"
] | sharma.kavya1996@gmail.com |
add7b1116ac65f5d43b9d068f08bfa87d862c074 | b26f63ae7b270c488ac73f472e66277904442bca | /BeakJoon C++ Algorithm/15891.스타트링크 사무실을 파헤쳐보자.cpp | 708ee24a9d79256214bac50ea82a3e200b1723e3 | [] | no_license | SimKyuSung/Algorithm | e54b1af4e5c6f2fe801dbe3c55df92ee32e04b1d | b2b938f47d176724f0aee7e476ff2e66f7b6c0a8 | refs/heads/master | 2021-05-06T15:10:54.446332 | 2019-02-07T15:42:02 | 2019-02-07T15:42:02 | 113,537,033 | 1 | 0 | null | null | null | null | UHC | C++ | false | false | 393 | cpp | /// 15891.스타트링크 사무실을 파헤쳐보자
#include <iostream>
#define endl '\n'
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
int n, ans = 0;
cin >> n;
switch (n)
{
case 1:
ans = 65;
break;
case 2:
ans = 17;
break;
case 3:
ans = 4;
break;
case 4:
ans = 4;
break;
case 5:
ans = 64;
break;
}
cout << ans << endl;
} | [
"sks0706@gmail.com"
] | sks0706@gmail.com |
272defa28a9233356d7dcffdd213ada4b08962bc | 0eff74b05b60098333ad66cf801bdd93becc9ea4 | /second/download/git/gumtree/git_repos_function_999_git-2.2.3.cpp | 68c0066b7fb72ff159c5d98922f41c5cae28029b | [] | no_license | niuxu18/logTracker-old | 97543445ea7e414ed40bdc681239365d33418975 | f2b060f13a0295387fe02187543db124916eb446 | refs/heads/master | 2021-09-13T21:39:37.686481 | 2017-12-11T03:36:34 | 2017-12-11T03:36:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 509 | cpp | static int parse_diff_color_slot(const char *var)
{
if (!strcasecmp(var, "plain"))
return DIFF_PLAIN;
if (!strcasecmp(var, "meta"))
return DIFF_METAINFO;
if (!strcasecmp(var, "frag"))
return DIFF_FRAGINFO;
if (!strcasecmp(var, "old"))
return DIFF_FILE_OLD;
if (!strcasecmp(var, "new"))
return DIFF_FILE_NEW;
if (!strcasecmp(var, "commit"))
return DIFF_COMMIT;
if (!strcasecmp(var, "whitespace"))
return DIFF_WHITESPACE;
if (!strcasecmp(var, "func"))
return DIFF_FUNCINFO;
return -1;
} | [
"993273596@qq.com"
] | 993273596@qq.com |
b43d91feb79f17cb5d45323aaeeb2583952a8e04 | a608fd348d03014869ad3a1b22700e4798b5037c | /Baekjoon_Solving/Baekjoon_2463.cpp | e18bb4ecfd6266c00871dfe23f18b1e35008c156 | [] | no_license | Yaseungho/myCodes | 420d5f9f845327faedc2da110cd6174f430e5cec | 9a63b696ec598d90d564fe1024dec7a8084c7d74 | refs/heads/master | 2021-06-22T17:17:44.072240 | 2021-05-11T06:27:24 | 2021-05-11T06:27:24 | 214,841,009 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,087 | cpp | #include <bits/stdc++.h>
#define x first
#define y second
#define MOD (int)1e9
using namespace std;
typedef long long ll;
ll N, M, tree[100001];
vector<pair<ll, pair<ll, ll>>> edges;
set<ll> components;
ll pairsum(ll n) {
return n * (n - 1) / 2;
}
ll find(ll n) {
if (tree[n] < 0) return n;
tree[n] = find(tree[n]);
return tree[n];
}
void merge(ll a, ll b) {
a = find(a);
b = find(b);
if (a == b) return;
tree[a] += tree[b];
tree[b] = a;
}
int main() {
ios::sync_with_stdio(false);
cout.tie(0); cin.tie(0);
ll res = 0, cnt = 0;
memset(tree, -1, sizeof(tree));
cin >> N >> M;
for (int i = 0; i < M; i++) {
ll a, b, w;
cin >> a >> b >> w;
edges.push_back({ w,{a,b} });
}
sort(edges.begin(), edges.end());
reverse(edges.begin(), edges.end());
for (auto i : edges) {
cnt -= pairsum(-tree[find(i.y.x)]) + pairsum(-tree[find(i.y.y)]);
if (find(i.y.x) == find(i.y.y)) cnt += pairsum(-tree[find(i.y.x)]);
ll cost = i.x;
merge(i.y.x, i.y.y);
cnt += pairsum(-tree[find(i.y.x)]);
res = (res % MOD + (cnt * i.x) % MOD) % MOD;
}
cout << res << "\n";
} | [
"molkanglee@gmail.com"
] | molkanglee@gmail.com |
d5c91bf984a491e5ac6e040637244e00981af7fb | 554f6917c7c1d8a18535a4345f075b5f38345261 | /filter/Text/TrackingObject.cpp | 980890f302a7c11938ad560f04aa44e475cf1b0a | [] | no_license | jandernascimento/jfrobotics | 91af878698bfa6efa6e5dcb27ea6c8c1606a6f8e | 9169a7b413d999790f0536ff62686efe0bec1db0 | refs/heads/master | 2016-09-06T13:00:43.000060 | 2011-05-02T19:33:39 | 2011-05-02T19:33:39 | 32,868,813 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,556 | cpp | #include <iostream>
/*Libraries needed*/
#include "DataReader.hpp"
#include "Kalman.hpp"
int main(int argc, char* argv[]){
std::string setName(argv[1]);
DataReader dataObj(setName);
int key;
float a;
// read the first data to determine the background
dataObj.readData();//read the next laser data
dataObj.initBackground();//define the background
// Initialization of Kalman Filter
// read the second data
dataObj.readData();//read the next laser data
dataObj.printLaserData();//print the current laser data on the terminal window
//detection of motion
int threshold=2;
dataObj.detectMotion(threshold);
dataObj.printMotion();
dataObj.formObject();
float init_y;
float init_std;
float init_q;
float init_r;
Kalman y(init_y, init_std, init_q, init_r);
std::cout << "mean(I) = " << y.mean << " std(I) = " << y.std << std::endl << std::endl;
/*Displaying the dataset (each sliding window; each
frame)*/
while(dataObj.readData() == NOERROR) {
dataObj.printLaserData();//display the current laser data on the graphical window
dataObj.detectMotion(threshold);
dataObj.printMotion();
dataObj.formObject();
// prediction phase
std::cout << "action = " << a << std::endl;
y.prediction(a);
std::cout << "mean(P) = " << y.mean << " std(P) = " << y.std << std::endl;
// estimation phase
float o;
std::cout << "observation = " << o << std::endl;
y.estimation(o);
std::cout << "mean(E) = " << y.mean << " std(E) = " << y.std << std::endl << std::endl;
}
return 0;
}
| [
"jbotnascimento@f775f7fb-c228-641e-0da4-618e932950d0"
] | jbotnascimento@f775f7fb-c228-641e-0da4-618e932950d0 |
79610c396f631ad635bfaa67103fb67d44b4edbd | 7103a9f290e9a929870e11e533e5b2153c125144 | /ex05/hw_course5_new/backend/problem.cc | 3a9b3f859a252dcab242b08ab7e0a7f40950fc83 | [] | no_license | levinz97/VIO-SLAM-Course | 3a3a4e3e67ad95981114b7c0acd4234a507e65fc | e8c810de830ab8253106f91167ab5143362c1378 | refs/heads/main | 2023-06-28T18:45:16.886301 | 2021-07-28T11:20:34 | 2021-07-28T11:20:34 | 390,279,848 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 21,515 | cc | #include <iostream>
#include <fstream>
#include <eigen3/Eigen/Dense>
#include <glog/logging.h>
#include "backend/problem.h"
#include "utils/tic_toc.h"
#ifdef USE_OPENMP
#include <omp.h>
#endif
using namespace std;
// define the format you want, you only need one instance of this...
const static Eigen::IOFormat CSVFormat(Eigen::StreamPrecision, Eigen::DontAlignCols, ", ", "\n");
void writeToCSVfile(std::string name, Eigen::MatrixXd matrix) {
std::ofstream f(name.c_str());
f << matrix.format(CSVFormat);
}
namespace myslam {
namespace backend {
void Problem::LogoutVectorSize() {
// LOG(INFO) <<
// "1 problem::LogoutVectorSize verticies_:" << verticies_.size() <<
// " edges:" << edges_.size();
}
Problem::Problem(ProblemType problemType) :
problemType_(problemType) {
LogoutVectorSize();
verticies_marg_.clear();
}
Problem::~Problem() {}
bool Problem::AddVertex(std::shared_ptr<Vertex> vertex) {
if (verticies_.find(vertex->Id()) != verticies_.end()) {
// LOG(WARNING) << "Vertex " << vertex->Id() << " has been added before";
return false;
} else {
verticies_.insert(pair<unsigned long, shared_ptr<Vertex>>(vertex->Id(), vertex));
}
if (problemType_ == ProblemType::SLAM_PROBLEM) {
if (IsPoseVertex(vertex)) {
ResizePoseHessiansWhenAddingPose(vertex);
}
}
return true;
}
void Problem::AddOrderingSLAM(std::shared_ptr<myslam::backend::Vertex> v) {
if (IsPoseVertex(v)) {
v->SetOrderingId(ordering_poses_);
idx_pose_vertices_.insert(pair<ulong, std::shared_ptr<Vertex>>(v->Id(), v));
ordering_poses_ += v->LocalDimension();
} else if (IsLandmarkVertex(v)) {
v->SetOrderingId(ordering_landmarks_);
ordering_landmarks_ += v->LocalDimension();
idx_landmark_vertices_.insert(pair<ulong, std::shared_ptr<Vertex>>(v->Id(), v));
}
}
void Problem::ResizePoseHessiansWhenAddingPose(shared_ptr<Vertex> v) {
int size = H_prior_.rows() + v->LocalDimension();
H_prior_.conservativeResize(size, size);
b_prior_.conservativeResize(size);
b_prior_.tail(v->LocalDimension()).setZero();
H_prior_.rightCols(v->LocalDimension()).setZero();
H_prior_.bottomRows(v->LocalDimension()).setZero();
}
bool Problem::IsPoseVertex(std::shared_ptr<myslam::backend::Vertex> v) {
string type = v->TypeInfo();
return type == string("VertexPose");
}
bool Problem::IsLandmarkVertex(std::shared_ptr<myslam::backend::Vertex> v) {
string type = v->TypeInfo();
return type == string("VertexPointXYZ") ||
type == string("VertexInverseDepth");
}
bool Problem::AddEdge(shared_ptr<Edge> edge) {
if (edges_.find(edge->Id()) == edges_.end()) {
edges_.insert(pair<ulong, std::shared_ptr<Edge>>(edge->Id(), edge));
} else {
// LOG(WARNING) << "Edge " << edge->Id() << " has been added before!";
return false;
}
for (auto &vertex: edge->Verticies()) {
vertexToEdge_.insert(pair<ulong, shared_ptr<Edge>>(vertex->Id(), edge));
}
return true;
}
vector<shared_ptr<Edge>> Problem::GetConnectedEdges(std::shared_ptr<Vertex> vertex) {
vector<shared_ptr<Edge>> edges;
auto range = vertexToEdge_.equal_range(vertex->Id());
for (auto iter = range.first; iter != range.second; ++iter) {
// 并且这个edge还需要存在,而不是已经被remove了
if (edges_.find(iter->second->Id()) == edges_.end())
continue;
edges.emplace_back(iter->second);
}
return edges;
}
bool Problem::RemoveVertex(std::shared_ptr<Vertex> vertex) {
//check if the vertex is in map_verticies_
if (verticies_.find(vertex->Id()) == verticies_.end()) {
// LOG(WARNING) << "The vertex " << vertex->Id() << " is not in the problem!" << endl;
return false;
}
// 这里要 remove 该顶点对应的 edge.
vector<shared_ptr<Edge>> remove_edges = GetConnectedEdges(vertex);
for (size_t i = 0; i < remove_edges.size(); i++) {
RemoveEdge(remove_edges[i]);
}
if (IsPoseVertex(vertex))
idx_pose_vertices_.erase(vertex->Id());
else
idx_landmark_vertices_.erase(vertex->Id());
vertex->SetOrderingId(-1); // used to debug
verticies_.erase(vertex->Id());
vertexToEdge_.erase(vertex->Id());
return true;
}
bool Problem::RemoveEdge(std::shared_ptr<Edge> edge) {
//check if the edge is in map_edges_
if (edges_.find(edge->Id()) == edges_.end()) {
// LOG(WARNING) << "The edge " << edge->Id() << " is not in the problem!" << endl;
return false;
}
edges_.erase(edge->Id());
return true;
}
bool Problem::Solve(int iterations) {
if (edges_.size() == 0 || verticies_.size() == 0) {
std::cerr << "\nCannot solve problem without edges or verticies" << std::endl;
return false;
}
TicToc t_solve;
// 统计优化变量的维数,为构建 H 矩阵做准备
SetOrdering();
// 遍历edge, 构建 H 矩阵
MakeHessian();
// LM 初始化
ComputeLambdaInitLM();
// LM 算法迭代求解
bool stop = false;
int iter = 0;
while (!stop && (iter < iterations)) {
std::cout << "iter: " << iter << " , chi= " << currentChi_ << " , Lambda= " << currentLambda_ << std::endl;
bool oneStepSuccess = false;
int false_cnt = 0;
while (!oneStepSuccess) // 不断尝试 Lambda, 直到成功迭代一步
{
// setLambda
// AddLambdatoHessianLM();
// 第四步,解线性方程
SolveLinearSystem();
//
// RemoveLambdaHessianLM();
// 优化退出条件1: delta_x_ 很小则退出
if (delta_x_.squaredNorm() <= 1e-6 || false_cnt > 10) {
stop = true;
break;
}
// 更新状态量
UpdateStates();
// 判断当前步是否可行以及 LM 的 lambda 怎么更新
oneStepSuccess = IsGoodStepInLM();
// 后续处理,
if (oneStepSuccess) {
// 在新线性化点 构建 hessian
MakeHessian();
// TODO:: 这个判断条件可以丢掉,条件 b_max <= 1e-12 很难达到,这里的阈值条件不应该用绝对值,而是相对值
// double b_max = 0.0;
// for (int i = 0; i < b_.size(); ++i) {
// b_max = max(fabs(b_(i)), b_max);
// }
// // 优化退出条件2: 如果残差 b_max 已经很小了,那就退出
// stop = (b_max <= 1e-12);
false_cnt = 0;
} else {
false_cnt ++;
RollbackStates(); // 误差没下降,回滚
}
}
iter++;
// 优化退出条件3: currentChi_ 跟第一次的chi2相比,下降了 1e6 倍则退出
if (sqrt(currentChi_) <= stopThresholdLM_)
stop = true;
}
std::cout << "problem solve cost: " << (totalSolveCost = t_solve.toc()) << " ms" << std::endl;
std::cout << " makeHessian cost: " << t_hessian_cost_ << " ms" << std::endl;
return true;
}
void Problem::SetOrdering() {
// 每次重新计数
ordering_poses_ = 0;
ordering_generic_ = 0;
ordering_landmarks_ = 0;
int debug = 0;
// Note:: verticies_ 是 map 类型的, 顺序是按照 id 号排序的
for (auto vertex: verticies_) {
ordering_generic_ += vertex.second->LocalDimension(); // 所有的优化变量总维数
if (IsPoseVertex(vertex.second)) {
debug += vertex.second->LocalDimension();
}
if (problemType_ == ProblemType::SLAM_PROBLEM) // 如果是 slam 问题,还要分别统计 pose 和 landmark 的维数,后面会对他们进行排序
{
AddOrderingSLAM(vertex.second);
}
if (IsPoseVertex(vertex.second)) {
std::cout << vertex.second->Id() << " order: " << vertex.second->OrderingId() << std::endl;
}
}
std::cout << "\n ordered_landmark_vertices_ size : " << idx_landmark_vertices_.size() << std::endl;
if (problemType_ == ProblemType::SLAM_PROBLEM) {
// 这里要把 landmark 的 ordering 加上 pose 的数量,就保持了 landmark 在后,而 pose 在前
ulong all_pose_dimension = ordering_poses_;
for (auto landmarkVertex : idx_landmark_vertices_) {
landmarkVertex.second->SetOrderingId(
landmarkVertex.second->OrderingId() + all_pose_dimension
);
}
}
// CHECK_EQ(CheckOrdering(), true);
}
bool Problem::CheckOrdering() {
if (problemType_ == ProblemType::SLAM_PROBLEM) {
int current_ordering = 0;
for (auto v: idx_pose_vertices_) {
assert(v.second->OrderingId() == current_ordering);
current_ordering += v.second->LocalDimension();
}
for (auto v: idx_landmark_vertices_) {
assert(v.second->OrderingId() == current_ordering);
current_ordering += v.second->LocalDimension();
}
}
return true;
}
void Problem::MakeHessian() {
TicToc t_h;
// 直接构造大的 H 矩阵
ulong size = ordering_generic_;
MatXX H(MatXX::Zero(size, size));
VecX b(VecX::Zero(size));
for (auto &edge: edges_) {
edge.second->ComputeResidual();
edge.second->ComputeJacobians();
auto jacobians = edge.second->Jacobians();
auto verticies = edge.second->Verticies();
assert(jacobians.size() == verticies.size());
for (size_t i = 0; i < verticies.size(); ++i) {
auto v_i = verticies[i];
if (v_i->IsFixed()) continue; // Hessian 里不需要添加它的信息,也就是它的雅克比为 0
auto jacobian_i = jacobians[i];
ulong index_i = v_i->OrderingId();
ulong dim_i = v_i->LocalDimension();
MatXX JtW = jacobian_i.transpose() * edge.second->Information();
for (size_t j = i; j < verticies.size(); ++j) {
auto v_j = verticies[j];
if (v_j->IsFixed()) continue;
auto jacobian_j = jacobians[j];
ulong index_j = v_j->OrderingId();
ulong dim_j = v_j->LocalDimension();
assert(v_j->OrderingId() != -1);
MatXX hessian = JtW * jacobian_j;
// 所有的信息矩阵叠加起来
// TODO:: home work. 完成 H index 的填写.
H.block(index_i, index_j, dim_i, dim_j).noalias() += hessian;
if (j != i) {
// 对称的下三角
// TODO:: home work. 完成 H index 的填写.
H.block(index_j, index_i, dim_j, dim_i).noalias() += hessian.transpose();
}
}
b.segment(index_i, dim_i).noalias() -= JtW * edge.second->Residual();
}
}
Hessian_ = H;
b_ = b;
t_hessian_cost_ += t_h.toc();
// Eigen::JacobiSVD<Eigen::MatrixXd> svd(H, Eigen::ComputeThinU | Eigen::ComputeThinV);
// std::cout << svd.singularValues() <<std::endl;
if (err_prior_.rows() > 0) {
b_prior_ -= H_prior_ * delta_x_.head(ordering_poses_); // update the error_prior
}
Hessian_.topLeftCorner(ordering_poses_, ordering_poses_) += H_prior_;
b_.head(ordering_poses_) += b_prior_;
delta_x_ = VecX::Zero(size); // initial delta_x = 0_n;
}
/*
* Solve Hx = b, we can use PCG iterative method or use sparse Cholesky
*/
void Problem::SolveLinearSystem() {
if (problemType_ == ProblemType::GENERIC_PROBLEM) {
// 非 SLAM 问题直接求解
// PCG solver
MatXX H = Hessian_;
for (ulong i = 0; i < static_cast<ulong>(Hessian_.cols()); ++i) {
H(i, i) += currentLambda_;
}
// delta_x_ = PCGSolver(H, b_, H.rows() * 2);
delta_x_ = Hessian_.inverse() * b_;
} else {
// SLAM 问题采用舒尔补的计算方式
// step1: schur marginalization --> Hpp, bpp
int reserve_size = ordering_poses_;
int marg_size = ordering_landmarks_;
// TODO:: home work. 完成矩阵块取值,Hmm,Hpm,Hmp,bpp,bmm
MatXX Hmm = Hessian_.block(reserve_size, reserve_size, marg_size, marg_size);
MatXX Hpm = Hessian_.block(0, reserve_size, reserve_size, marg_size);
MatXX Hmp = Hessian_.block(reserve_size, 0, marg_size, reserve_size);
VecX bpp = b_.segment(0, reserve_size);
VecX bmm = b_.segment(reserve_size, reserve_size + marg_size);
// Hmm 是对角线矩阵,它的求逆可以直接为对角线块分别求逆,如果是逆深度,对角线块为1维的,则直接为对角线的倒数,这里可以加速
MatXX Hmm_inv(MatXX::Zero(marg_size, marg_size));
for (auto landmarkVertex : idx_landmark_vertices_) {
int idx = landmarkVertex.second->OrderingId() - reserve_size;
int size = landmarkVertex.second->LocalDimension();
Hmm_inv.block(idx, idx, size, size) = Hmm.block(idx, idx, size, size).inverse();
}
// TODO:: home work. 完成舒尔补 Hpp, bpp 代码
MatXX tempH = Hpm * Hmm_inv;
H_pp_schur_ = Hessian_.block(0, 0, reserve_size, reserve_size) - tempH * Hmp;
b_pp_schur_ = bpp - tempH * bmm; // = bpp - Hpm * Hmm_inv * bmm (here b_ already with negative sign)
// step2: solve Hpp * delta_x = bpp
VecX delta_x_pp(VecX::Zero(reserve_size));
// PCG Solver
for (ulong i = 0; i < ordering_poses_; ++i) {
H_pp_schur_(i, i) += currentLambda_;
}
int n = H_pp_schur_.rows() * 2; // 迭代次数
delta_x_pp = PCGSolver(H_pp_schur_, b_pp_schur_, n); // 哈哈,小规模问题,搞 pcg 花里胡哨
delta_x_.head(reserve_size) = delta_x_pp;
// std::cout << delta_x_pp.transpose() << std::endl;
// TODO:: home work. step3: solve landmark
VecX delta_x_ll(marg_size);
delta_x_ll = Hmm_inv * (bmm - Hmp * delta_x_pp);
delta_x_.tail(marg_size) = delta_x_ll;
}
}
void Problem::UpdateStates() {
for (auto vertex: verticies_) {
ulong idx = vertex.second->OrderingId();
ulong dim = vertex.second->LocalDimension();
VecX delta = delta_x_.segment(idx, dim);
vertex.second->Plus(delta);
}
if (err_prior_.rows() > 0) {
b_prior_ -= H_prior_ * delta_x_.head(ordering_poses_); // update the error_prior
err_prior_ = Jt_prior_inv_ * b_prior_.head(ordering_poses_ - 6);
}
}
void Problem::RollbackStates() {
for (auto vertex: verticies_) {
ulong idx = vertex.second->OrderingId();
ulong dim = vertex.second->LocalDimension();
VecX delta = delta_x_.segment(idx, dim);
vertex.second->Plus(-delta);
}
if (err_prior_.rows() > 0) {
b_prior_ += H_prior_ * delta_x_.head(ordering_poses_); // update the error_prior
err_prior_ = Jt_prior_inv_ * b_prior_.head(ordering_poses_ - 6);
}
}
/// LM
void Problem::ComputeLambdaInitLM() {
ni_ = 2.;
currentLambda_ = -1.;
currentChi_ = 0.0;
// TODO:: robust cost chi2
for (auto edge: edges_) {
currentChi_ += edge.second->Chi2();
}
if (err_prior_.rows() > 0) // marg prior residual
currentChi_ += err_prior_.norm();
stopThresholdLM_ = 1e-6 * currentChi_; // 迭代条件为 误差下降 1e-6 倍
double maxDiagonal = 0;
ulong size = Hessian_.cols();
assert(Hessian_.rows() == Hessian_.cols() && "Hessian is not square");
for (ulong i = 0; i < size; ++i) {
maxDiagonal = std::max(fabs(Hessian_(i, i)), maxDiagonal);
}
double tau = 1e-5;
currentLambda_ = tau * maxDiagonal;
}
void Problem::AddLambdatoHessianLM() {
ulong size = Hessian_.cols();
assert(Hessian_.rows() == Hessian_.cols() && "Hessian is not square");
last_Hessian_ = Hessian_;
for (ulong i = 0; i < size; ++i) {
Hessian_(i, i) += currentLambda_;
}
}
void Problem::RemoveLambdaHessianLM() {
// ulong size = Hessian_.cols();
assert(Hessian_.rows() == Hessian_.cols() && "Hessian is not square");
Hessian_ = last_Hessian_;
// TODO:: 这里不应该减去一个,数值的反复加减容易造成数值精度出问题?而应该保存叠加lambda前的值,在这里直接赋值
// for (ulong i = 0; i < size; ++i) {
// Hessian_(i, i) -= currentLambda_;
// }
}
bool Problem::IsGoodStepInLM() {
double scale = 0;
scale = delta_x_.transpose() * (currentLambda_ * delta_x_ + b_);
scale += 1e-3; // make sure it's non-zero :)
// recompute residuals after update state
// TODO:: get robustChi2() instead of Chi2()
double tempChi = 0.0;
for (auto edge: edges_) {
edge.second->ComputeResidual();
tempChi += edge.second->Chi2();
}
if (err_prior_.size() > 0)
tempChi += err_prior_.norm();
double rho = (currentChi_ - tempChi) / scale;
if (rho > 0 && isfinite(tempChi)) // last step was good, 误差在下降
{
double alpha = 1. - pow((2 * rho - 1), 3);
alpha = std::min(alpha, 2. / 3.);
double scaleFactor = (std::max)(1. / 3., alpha);
currentLambda_ *= scaleFactor;
ni_ = 2;
currentChi_ = tempChi;
return true;
} else {
currentLambda_ *= ni_;
ni_ *= 2;
return false;
}
}
/** @brief conjugate gradient with perconditioning
*
* the jacobi PCG method
*
*/
VecX Problem::PCGSolver(const MatXX &A, const VecX &b, int maxIter = -1) {
assert(A.rows() == A.cols() && "PCG solver ERROR: A is not a square matrix");
int rows = b.rows();
int n = maxIter < 0 ? rows : maxIter;
VecX x(VecX::Zero(rows));
MatXX M_inv = A.diagonal().asDiagonal().inverse();
VecX r0(b); // initial r = b - A*0 = b
VecX z0 = M_inv * r0;
VecX p(z0);
VecX w = A * p;
double r0z0 = r0.dot(z0);
double alpha = r0z0 / p.dot(w);
VecX r1 = r0 - alpha * w;
int i = 0;
double threshold = 1e-6 * r0.norm();
while (r1.norm() > threshold && i < n) {
i++;
VecX z1 = M_inv * r1;
double r1z1 = r1.dot(z1);
double belta = r1z1 / r0z0;
z0 = z1;
r0z0 = r1z1;
r0 = r1;
p = belta * p + z1;
w = A * p;
alpha = r1z1 / p.dot(w);
x += alpha * p;
r1 -= alpha * w;
}
return x;
}
/*
* marg 所有和 frame 相连的 edge: imu factor, projection factor, prior factor
*
*/
bool Problem::Marginalize(const std::shared_ptr<Vertex> frameVertex) {
return true;
}
void Problem::TestMarginalize() {
// Add marg test
int idx = 1; // marg 中间那个变量
int dim = 1; // marg 变量的维度
int reserve_size = 3; // 总共变量的维度
double delta1 = 0.1 * 0.1;
double delta2 = 0.2 * 0.2;
double delta3 = 0.3 * 0.3;
int cols = 3;
MatXX H_marg(MatXX::Zero(cols, cols));
H_marg << 1./delta1, -1./delta1, 0,
-1./delta1, 1./delta1 + 1./delta2 + 1./delta3, -1./delta3,
0., -1./delta3, 1/delta3;
std::cout << "---------- TEST Marg: before marg------------"<< std::endl;
std::cout << H_marg << std::endl;
// TODO:: home work. 将变量移动到右下角
/// 准备工作: move the marg pose to the Hmm bottown right
// 将 row i 移动矩阵最下面
Eigen::MatrixXd temp_rows = H_marg.block(idx, 0, dim, reserve_size);
Eigen::MatrixXd temp_botRows = H_marg.block(idx + dim, 0, reserve_size - idx - dim, reserve_size);
H_marg.block(idx, 0, dim, reserve_size) = temp_botRows;
H_marg.block(idx + dim, 0, reserve_size - idx - dim, reserve_size) = temp_rows;
// 将 col i 移动矩阵最右边
Eigen::MatrixXd temp_cols = H_marg.block(0, idx, reserve_size, dim);
Eigen::MatrixXd temp_rightCols = H_marg.block(0, idx + dim, reserve_size, reserve_size - idx - dim);
H_marg.block(0, idx, reserve_size, reserve_size - idx - dim) = temp_rightCols;
H_marg.block(0, reserve_size - dim, reserve_size, dim) = temp_cols;
std::cout << "---------- TEST Marg: 将变量移动到右下角------------"<< std::endl;
std::cout<< H_marg <<std::endl;
/// 开始 marg : schur
double eps = 1e-8;
int m2 = dim;
int n2 = reserve_size - dim; // 剩余变量的维度
Eigen::MatrixXd Amm = 0.5 * (H_marg.block(n2, n2, m2, m2) + H_marg.block(n2, n2, m2, m2).transpose());
Eigen::SelfAdjointEigenSolver<Eigen::MatrixXd> saes(Amm);
Eigen::MatrixXd Amm_inv = saes.eigenvectors() * Eigen::VectorXd(
(saes.eigenvalues().array() > eps).select(saes.eigenvalues().array().inverse(), 0)).asDiagonal() *
saes.eigenvectors().transpose();
// Eigen::MatrixXd Amm_inv = Amm.inverse();
// TODO:: home work. 完成舒尔补操作
Eigen::MatrixXd Arm = H_marg.block(0, n2, n2, m2);
Eigen::MatrixXd Amr = H_marg.block(n2, 0, m2, n2);
Eigen::MatrixXd Arr = H_marg.block(0, 0, n2, n2);
Eigen::MatrixXd tempB = Arm * Amm_inv;
Eigen::MatrixXd H_prior = Arr - tempB * Amr;
std::cout << "---------- TEST Marg: after marg------------"<< std::endl;
std::cout << H_prior << std::endl;
}
}
}
| [
"levinzeng97@gmail.com"
] | levinzeng97@gmail.com |
115e77b0687c7bd0738d96787d3ccdceccafc9b2 | 9ff6fe1d2d23ef94f11b359c2cd01fcfad36d282 | /lib/src/cpp/tfd/util.cc | 01f2c48e67f4f8b8846af2faa84ed6df86cb3d03 | [
"Apache-2.0"
] | permissive | khari998/tensorflow.dart | c31fab55aba1db0c24c4245ecc947d82d64a6628 | e64072212f20bd0df8bb6a7da968c25e6b3b3d8e | refs/heads/master | 2020-05-15T08:55:03.024632 | 2018-11-03T18:13:56 | 2018-11-03T18:13:56 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 9,387 | cc | //
// Created by Tobe on 4/15/18.
//
#include <cstring>
#include <iostream>
#include <string>
#include "../tensorflow_dart.h"
#include "util.h"
void *tfd::dereference_ptr(Dart_Handle handle) {
uint64_t ptr;
Dart_Handle value = Dart_GetField(handle, Dart_NewStringFromCString("_pointer"));
HandleError(Dart_IntegerToUint64(value, &ptr));
return (void *) ptr;
}
TF_Graph *tfd::dereference_graph_ptr(Dart_Handle handle) {
return (TF_Graph *) dereference_ptr(handle);
}
TF_Tensor *tfd::convert_tensor(Dart_Handle handle) {
Dart_Handle dtypeHandle = Dart_GetField(handle, Dart_NewStringFromCString("_dataType")); // int
Dart_Handle shapeHandle = Dart_GetField(handle, Dart_NewStringFromCString("_shape")); // Int64List
Dart_Handle dataHandle = Dart_GetField(handle, Dart_NewStringFromCString("_data")); // Uint8List
auto *status = TF_NewStatus();
Dart_TypedData_Type type;
int64_t dtype;
int64_t *dims;
intptr_t nDims, length;
const char *data;
// Get the dtype, easy.
HandleError(Dart_IntegerToInt64(dtypeHandle, &dtype));
// Next, read the shape.
HandleError(Dart_ListLength(shapeHandle, &length));
if (length == 0) {
dims = nullptr;
nDims = 0;
} else {
nDims = length;
HandleError(Dart_TypedDataAcquireData(shapeHandle, &type, (void **) &dims, &length));
Dart_TypedDataReleaseData(shapeHandle);
}
HandleError(Dart_TypedDataAcquireData(dataHandle, &type, (void **) &data, &length));
if (dtype == TF_STRING) length = 8 + TF_StringEncodedSize(strlen(data));
auto *tensor = TF_AllocateTensor((TF_DataType) dtype, dims, (int) nDims, (size_t) length);
if (tensor == nullptr) {
throwCoreError("Could not create a tensor.", "StateError");
} else {
// Write the data into the tensor.
auto *tensorData = TF_TensorData(tensor);
if (TF_TensorType(tensor) == TF_STRING) {
//auto ptr = (uint64_t) tensorData;
//tensorData = (void *) (ptr + 0);
//length -= 8;
memset(tensorData, 0, 8);
TF_StringEncode(data, strlen(data), 8 + (char *) tensorData, TF_StringEncodedSize(strlen(data)), status);
} else {
memcpy(tensorData, data, (size_t) length);
}
}
HandleError(Dart_TypedDataReleaseData(dataHandle));
TF_DeleteStatus(status);
return tensor;
}
Dart_Handle tfd::get_tensor_value(TF_Tensor *tensor) {
if (tensor == nullptr) return Dart_Null();
TF_DataType type = TF_TensorType(tensor);
// TODO: String list, bool list
if (type == TF_STRING) {
auto *status = TF_NewStatus();
const char *str;
size_t str_len, size = TF_TensorByteSize(tensor);
TF_StringDecode(8 + (char *) TF_TensorData(tensor), size, &str, &str_len, status);
return Dart_NewStringFromUTF8((const uint8_t *) str, str_len);
} else if (type == TF_BOOL) {
auto v = *((unsigned char *) TF_TensorData(tensor));
return Dart_NewBoolean(v == 1);
} else if (type == TF_DOUBLE) {
auto *v = ((double *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(double);
if (length == 1) {
return Dart_NewDouble(*v);
} else {
Dart_Handle list = Dart_NewList(length);
for (intptr_t i = 0; i < length; i++) {
HandleError(Dart_ListSetAt(list, i, Dart_NewDouble(v[i])));
}
return list;
}
} else if (type == TF_FLOAT) {
auto *v = ((float *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(float);
if (length == 1) {
return Dart_NewDouble((double) *v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kFloat32, v, length);
}
} else if (type == TF_INT8) {
auto *v = ((int8_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(int8_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kInt8, v, length);
}
} else if (type == TF_INT16) {
auto *v = ((int16_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(int16_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kInt16, v, length);
}
} else if (type == TF_INT32) {
auto *v = ((int32_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(int32_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kInt32, v, length);
}
} else if (type == TF_INT64) {
auto *v = ((int64_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(int64_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kInt64, v, length);
}
} else if (type == TF_UINT8) {
auto *v = ((uint8_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(uint8_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kUint8, v, length);
}
} else if (type == TF_UINT16) {
auto *v = ((uint16_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(uint16_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kUint16, v, length);
}
} else if (type == TF_UINT32) {
auto *v = ((uint32_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(uint32_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kUint32, v, length);
}
} else if (type == TF_UINT64) {
auto *v = ((uint64_t *) TF_TensorData(tensor));
intptr_t length = TF_TensorByteSize(tensor) / sizeof(uint64_t);
if (length == 1) {
return Dart_NewInteger(*v);
} else {
return Dart_NewExternalTypedData(Dart_TypedData_kUint64, v, length);
}
} else if (type == TF_RESOURCE) {
size_t size = TF_TensorByteSize(tensor);
//char msg[size];
//memset((void *) msg, 0, size);
//sprintf(msg, "Resource { size: %zu }", size);
//return Dart_NewStringFromCString(msg);
return Dart_NewExternalTypedData(Dart_TypedData_kUint8, TF_TensorData(tensor), size);
}
// TODO: Other data types
// Throw an UnsupportedError
/*Dart_Handle unsupportedErrorType = Dart_GetClass(Dart_RootLibrary(),
Dart_NewStringFromCString("UnsupportedError"));
std::string msgbuf("Unsupported Tensor type: ");
msgbuf.append(std::to_string(type));
Dart_Handle msg = Dart_NewStringFromCString(msgbuf.c_str());
Dart_Handle error = Dart_New(unsupportedErrorType, Dart_NewStringFromCString(""), 1, &msg);
Dart_ThrowException(error);*/
return Dart_Null();
}
TF_Operation *tfd::dereference_operation_ptr(Dart_Handle handle) {
return (TF_Operation *) dereference_ptr(handle);
}
TF_OperationDescription *tfd::dereference_operation_description_ptr(Dart_Handle handle) {
return (TF_OperationDescription *) dereference_ptr(handle);
}
TF_Function *tfd::dereference_function_ptr(Dart_Handle handle) {
return (TF_Function *) dereference_ptr(handle);
}
void tfd::throwCoreError(const char *msg, const char *errorType) {
Dart_Handle unsupportedErrorType = Dart_GetClass(Dart_RootLibrary(), Dart_NewStringFromCString(errorType));
Dart_Handle msgh = Dart_NewStringFromCString(msg);
Dart_Handle error = Dart_New(unsupportedErrorType, Dart_NewStringFromCString(""), 1, &msgh);
Dart_ThrowException(error);
}
TF_Output tfd::convert_output_wrapper(Dart_Handle handle, int index) {
uint64_t opPtr;
Dart_Handle opHandle = Dart_GetField(handle, Dart_NewStringFromCString("_operation"));
HandleError(Dart_IntegerToUint64(opHandle, &opPtr));
int64_t idx;
HandleError(Dart_IntegerToInt64(Dart_GetField(handle, Dart_NewStringFromCString("_index")), &idx));
auto *op = (TF_Operation *) opPtr;
//std::cout << "Op: " << op << "; index: " << index << std::endl;
return {op, (int) idx};
}
Dart_Handle tfd::getTuple2Type() {
Dart_Handle tupleLib = Dart_LookupLibrary(Dart_NewStringFromCString("package:tuple/tuple.dart"));
return Dart_GetClass(tupleLib, Dart_NewStringFromCString("Tuple2"));
}
Dart_Handle tfd::getTuple3Type() {
Dart_Handle tupleLib = Dart_LookupLibrary(Dart_NewStringFromCString("package:tuple/tuple.dart"));
return Dart_GetClass(tupleLib, Dart_NewStringFromCString("Tuple3"));
}
Dart_Handle tfd::getTuple4Type() {
Dart_Handle tupleLib = Dart_LookupLibrary(Dart_NewStringFromCString("package:tuple/tuple.dart"));
return Dart_GetClass(tupleLib, Dart_NewStringFromCString("Tuple4"));
}
| [
"thosakwe@gmail.com"
] | thosakwe@gmail.com |
db15539e59ef06c30744f81a12ad1c7f062e7076 | 29e866d407dd8a12b3e87a802efe3809913891f4 | /test/bls256_test.cpp | 2344739a60de8b0e4df601a018d4e2e3bd6b31ec | [
"BSD-3-Clause"
] | permissive | prysmaticlabs/mcl | 9eaedf666e04c844543af573f8c867e71307e1a0 | 79b3a33e21072712f00985ed2adf34b3bcf0d74e | refs/heads/master | 2020-04-02T07:36:34.316310 | 2019-01-08T16:54:17 | 2019-01-08T16:54:17 | 154,205,223 | 2 | 1 | NOASSERTION | 2019-06-19T20:43:10 | 2018-10-22T19:39:09 | Assembly | UTF-8 | C++ | false | false | 52 | cpp | #define MCLBN_FP_UNIT_SIZE 4
#include "bls_test.hpp" | [
"raul@prysmaticlabs.com"
] | raul@prysmaticlabs.com |
3d8a0e159f23865490b9488835d705fe4dea0dd0 | abc3e43233861eb10977082e862599187ff57a30 | /DP_쉬운 계단 수.cpp | 26fddde331f074dc737d43829f099a5ded24103e | [] | no_license | imgosari/acm | 45287bd6997655bb3e74d045b7d7e42ef8f1882e | 1782bf6dc5bedb612ac484eb4d28052b14508dba | refs/heads/master | 2021-01-10T09:42:49.560371 | 2016-03-06T11:50:45 | 2016-03-06T11:50:45 | 52,941,665 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 412 | cpp | #include <stdio.h>
long long dp[101][11];
#define mod 1000000000
int main()
{
int n;
long long result=0;
scanf("%d",&n);
for(int i=1;i<=9;i++)
dp[1][i]=1;
for(int i=2;i<=n;i++)
{
for(int j=0;j<=9;j++)
{
dp[i][j]=0;
if(j-1>=0) dp[i][j] += dp[i-1][j-1];
if(j+1<=9) dp[i][j] += dp[i-1][j+1];
dp[i][j] %= mod;
}
}
for(int i=0;i<=9;i++)
result += dp[n][i];
printf("%lld",result%mod);
} | [
"imgosari@naver.com"
] | imgosari@naver.com |
b446927c7a9ac1aa24e2008e5a6ffb18df5a16ff | 07fbf3ab32180d94afb1eadd1a8f8ddd657e8656 | /NWNXLib/API/Mac/API/TextLineData.cpp | 26a469b47e2e702d8d04201e22d806ef8d1cd8b5 | [
"MIT"
] | permissive | ELadner/nwnx-unified | 3b322e8722eab70c9c72a45e71013b89dbbf1e89 | 09f8e8a0c1474e8b16d4746f9cb57ca870a17ce5 | refs/heads/master | 2021-09-04T08:52:06.521478 | 2018-01-17T13:04:29 | 2018-01-17T13:04:29 | 117,771,934 | 0 | 0 | null | 2018-01-17T02:29:14 | 2018-01-17T02:29:14 | null | UTF-8 | C++ | false | false | 141 | cpp | #include "TextLineData.hpp"
#include "API/Functions.hpp"
#include "Platform/ASLR.hpp"
namespace NWNXLib {
namespace API {
}
}
| [
"liarethnwn@gmail.com"
] | liarethnwn@gmail.com |
5e8e5dbb2056114e1126541a585c48978ecf2a9d | bf249135f3144f9377d4902e992e577e216d2fac | /chapter11/urls.h | 88dad3c203b5e84333966080f39d7d42bf38ea0e | [] | no_license | suliutree/AcceleratedCPP | b332537a484c232e40ecae74f4d07556bd18f735 | f77b600afe49326de91bfec86d2fe5b9456465a9 | refs/heads/master | 2020-05-30T15:10:14.089797 | 2018-05-24T08:45:39 | 2018-05-24T08:45:39 | 39,046,815 | 0 | 0 | null | 2018-05-24T07:46:32 | 2015-07-14T01:35:22 | C++ | UTF-8 | C++ | false | false | 136 | h | #ifndef GUARD_urls_h
#define GUARD_urls_h
#include "Vec.h"
#include <string>
Vec<std::string> find_urls(const std::string& s);
#endif | [
"413474315@qq.com"
] | 413474315@qq.com |
cf768ac8fe1be030450f33a710e91a3e76254481 | 1b812fa048cc6248b11c229bc0fcde5a8ed9303c | /hw6/83371717.hw6/main.cpp | d2c8e6665aae6295daba5f7acb80892385d822e5 | [] | no_license | christineh777/ICS-45C | 337e8bb784fd5050469885e9e4e10d06f120d91a | 4f675b45fe8ccbe2eed5f97ef30751a10b39c277 | refs/heads/master | 2021-07-09T01:09:08.147483 | 2017-10-08T18:24:53 | 2017-10-08T18:24:53 | 107,040,364 | 0 | 1 | null | 2017-10-15T19:02:01 | 2017-10-15T19:02:01 | null | UTF-8 | C++ | false | false | 990 | cpp | #include "Circle.h"
#include "Rectangle.h"
#include "Square.h"
#include "Triangle.h"
#include "Picture.h"
int main()
{
Picture pic;
Triangle* tri1=new Triangle(5,5,"FirstTriangle");
Triangle* tri2=new Triangle(3,4,"SecondTriangle");
pic.add(tri1);
pic.add(tri2);
Circle* cir1=new Circle(5,"FirstCircle");
Circle* cir2=new Circle(10,"SecondCircle");
pic.add(cir1);
pic.add(cir2);
Square* squ1=new Square(5,"FirstSquare");
Square* squ2=new Square(10,"SecondSquare");
pic.add(squ1);
pic.add(squ2);
Rectangle* rec1=new Rectangle(4,8,"FirstRectangle");
Rectangle* rec2=new Rectangle(8,4,"SecondRectangle");
pic.add(rec1);
pic.add(rec2);
pic.drawAll();
cout<<"The total area of the shapes on this picture is "<<pic.totalArea()<<" square units."<<endl;
delete tri1;
delete tri2;
delete cir1;
delete cir2;
delete squ1;
delete squ2;
delete rec1;
delete rec2;
return 0;
}
| [
"changchs@uci.edu"
] | changchs@uci.edu |
86651daeac67fa158762fb84ca0fb5ae95b832ce | 32f541dd6dcb2121f21b13071678a799eb293f10 | /libraries/chain/include/graphene/chain/global_property_object.hpp | 246bc30c67afa32a299aec45d85ce497964d7fbd | [
"MIT"
] | permissive | Whitecoin-XWC/Whitecoin-core | b62de0b712ab8557ecd16dc1d0e4389c439eb3db | 8f15e0764fe60ff8d77228a2aca6bdff723439bd | refs/heads/develop | 2022-12-10T18:12:23.027195 | 2022-11-23T03:53:04 | 2022-11-23T03:53:04 | 397,646,406 | 0 | 3 | MIT | 2022-11-28T01:20:26 | 2021-08-18T15:17:39 | C++ | UTF-8 | C++ | false | false | 7,365 | hpp | /*
* Copyright (c) 2015 Cryptonomex, Inc., and contributors.
*
* The MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#pragma once
#include <fc/uint128.hpp>
#include <graphene/chain/protocol/chain_parameters.hpp>
#include <graphene/chain/protocol/types.hpp>
#include <graphene/chain/database.hpp>
#include <graphene/db/object.hpp>
#include <graphene/chain/lockbalance_object.hpp>
namespace graphene { namespace chain {
/**
* @class global_property_object
* @brief Maintains global state information (committee_member list, current fees)
* @ingroup object
* @ingroup implementation
*
* This is an implementation detail. The values here are set by committee_members to tune the blockchain parameters.
*/
class global_property_object : public graphene::db::abstract_object<global_property_object>
{
public:
static const uint8_t space_id = implementation_ids;
static const uint8_t type_id = impl_global_property_object_type;
chain_parameters parameters;
optional<chain_parameters> pending_parameters;
uint32_t next_available_vote_id = 0;
vector<wallfacer_member_id_type> active_committee_members; // updated once per maintenance interval
flat_set<miner_id_type> active_witnesses; // updated once per maintenance interval
vector<wallfacer_member_id_type> pledge_insufficient_committee_members; // updated once per maintenance interval
std::map<uint32_t, uint32_t> unorder_blocks_match;
// n.b. witness scheduling is done by witness_schedule object
};
/**
* @class dynamic_global_property_object
* @brief Maintains global state information (committee_member list, current fees)
* @ingroup object
* @ingroup implementation
*
* This is an implementation detail. The values here are calculated during normal chain operations and reflect the
* current values of global blockchain properties.
*/
class dynamic_global_property_object : public abstract_object<dynamic_global_property_object>
{
public:
static const uint8_t space_id = implementation_ids;
static const uint8_t type_id = impl_dynamic_global_property_object_type;
uint32_t head_block_number = 0;
block_id_type head_block_id;
time_point_sec time;
miner_id_type current_witness;
time_point_sec next_maintenance_time;
time_point_sec last_budget_time;
share_type miner_budget;
uint32_t accounts_registered_this_interval = 0;
optional<SecretHashType> current_random_seed;
std::map<miner_id_type,std::vector<lockbalance_object>> current_round_lockbalance_cache;
std::map<asset_id_type, price_feed> current_price_feed;
fc::flat_set<miner_id_type> round_produced_miners;
share_type contract_transfer_fee_rate = 0;
/**
* Every time a block is missed this increases by
* RECENTLY_MISSED_COUNT_INCREMENT,
* every time a block is found it decreases by
* RECENTLY_MISSED_COUNT_DECREMENT. It is
* never less than 0.
*
* If the recently_missed_count hits 2*UNDO_HISTORY then no new blocks may be pushed.
*/
uint32_t recently_missed_count = 0;
/**
* The current absolute slot number. Equal to the total
* number of slots since genesis. Also equal to the total
* number of missed slots plus head_block_number.
*/
uint64_t current_aslot = 0;
/**
* used to compute witness participation.
*/
fc::uint128_t recent_slots_filled;
/**
* dynamic_flags specifies chain state properties that can be
* expressed in one bit.
*/
uint32_t dynamic_flags = 0;
uint32_t last_irreversible_block_num = 0;
share_type bonus_distribute_limit = GRAPHENE_BONUS_DISTRIBUTE_LIMIT;
bool referendum_flag = false;
time_point_sec next_vote_time;
enum dynamic_flag_bits
{
/**
* If maintenance_flag is set, then the head block is a
* maintenance block. This means
* get_time_slot(1) - head_block_time() will have a gap
* due to maintenance duration.
*
* This flag answers the question, "Was maintenance
* performed in the last call to apply_block()?"
*/
maintenance_flag = 0x01
};
};
class lockbalance_record_object :public abstract_object<lockbalance_record_object>
{
public:
static const uint8_t space_id = implementation_ids;
static const uint8_t type_id = impl_lockbalance_record_object_type;
std::map<address, std::map<asset_id_type,share_type>> record_list;
};
}}
FC_REFLECT_DERIVED(graphene::chain::lockbalance_record_object, (graphene::db::object),(record_list))
FC_REFLECT_DERIVED( graphene::chain::dynamic_global_property_object, (graphene::db::object),
(head_block_number)
(head_block_id)
(time)
(current_witness)
(next_maintenance_time)
(last_budget_time)
(miner_budget)
(accounts_registered_this_interval)
(current_random_seed)
(recently_missed_count)
(current_aslot)
(recent_slots_filled)
(dynamic_flags)
(last_irreversible_block_num)
(current_round_lockbalance_cache)
(current_price_feed)
(round_produced_miners)
(bonus_distribute_limit)
(contract_transfer_fee_rate)
(referendum_flag)
(next_vote_time)
)
FC_REFLECT_DERIVED( graphene::chain::global_property_object, (graphene::db::object),
(parameters)
(pending_parameters)
(next_available_vote_id)
(active_committee_members)
(active_witnesses)
(unorder_blocks_match)
)
| [
"WhitecoinFounder@gmail.com"
] | WhitecoinFounder@gmail.com |
2f56cb38302f3b29061064bce8c8cb10e7088142 | 1aa22b82384ea25a20111f43ac5569762576d3a3 | /tests/singleton_tests.hpp | fc0705733986b0ad061cd13cb1d872811f9e91cc | [
"MIT"
] | permissive | zie87/neoloki-lib | 8a26144f96d11f74aaab4323b8665d7d04c9b8bf | ffa22058d872dd60f4d99bebe4c2a8aeec087424 | refs/heads/main | 2023-06-15T15:43:09.409762 | 2021-07-12T05:34:40 | 2021-07-12T06:08:48 | 384,914,999 | 0 | 0 | MIT | 2021-07-12T06:08:48 | 2021-07-11T10:06:19 | C++ | UTF-8 | C++ | false | false | 5,477 | hpp | #ifndef NEOLOKI_SINGLETONTESTS_HPP
#define NEOLOKI_SINGLETONTESTS_HPP
#include <loki/singleton.hpp>
#include "unit_test.hpp"
#define MAKE_TEST(name) \
if (test_success && name::instance().a != 99) { \
test_success = false; \
} \
++name::instance().a; \
if (test_success && name::instance().a != 100) { \
test_success = false; \
}
namespace loki {
template <int N>
struct my_class {
my_class() noexcept = default;
~my_class() {
assert(!was_destroyed);
was_destroyed = true;
}
int a = 99;
bool was_destroyed = false;
};
inline std::size_t get_longevity(my_class<3>*) { return 6; }
inline std::size_t get_longevity(my_class<7>*) { return 5; }
inline std::size_t get_longevity(my_class<11>*) { return 4; }
inline std::size_t get_longevity(my_class<15>*) { return 1; }
inline std::size_t get_longevity(my_class<19>*) { return 2; }
inline std::size_t get_longevity(my_class<23>*) { return 3; }
namespace {
using t0 = singleton_holder<my_class<0> >;
using t1 = singleton_holder<my_class<1>, create_using_new, default_lifetime, single_threaded>;
using t2 = singleton_holder<my_class<2>, create_using_new, phoenix_singleton, single_threaded>;
using t3 = singleton_holder<my_class<3>, create_using_new, singleton_with_longevity, single_threaded>;
using t4 = singleton_holder<my_class<4>, create_using_new, no_destroy, single_threaded>;
using t5 = singleton_holder<my_class<5>, create_using_new, default_lifetime, class_level_lockable>;
using t6 = singleton_holder<my_class<6>, create_using_new, phoenix_singleton, class_level_lockable>;
using t7 = singleton_holder<my_class<7>, create_using_new, singleton_with_longevity, class_level_lockable>;
using t8 = singleton_holder<my_class<8>, create_using_new, no_destroy, class_level_lockable>;
using t9 = singleton_holder<my_class<9>, create_using_malloc, default_lifetime, single_threaded>;
using t10 = singleton_holder<my_class<10>, create_using_malloc, phoenix_singleton, single_threaded>;
using t11 = singleton_holder<my_class<11>, create_using_malloc, singleton_with_longevity, single_threaded>;
using t12 = singleton_holder<my_class<12>, create_using_malloc, no_destroy, single_threaded>;
using t13 = singleton_holder<my_class<13>, create_using_malloc, default_lifetime, class_level_lockable>;
using t14 = singleton_holder<my_class<14>, create_using_malloc, phoenix_singleton, class_level_lockable>;
using t15 = singleton_holder<my_class<15>, create_using_malloc, singleton_with_longevity, class_level_lockable>;
using t16 = singleton_holder<my_class<16>, create_using_malloc, no_destroy, class_level_lockable>;
using t17 = singleton_holder<my_class<17>, create_static, default_lifetime, single_threaded>;
using t18 = singleton_holder<my_class<18>, create_static, phoenix_singleton, single_threaded>;
using t19 = singleton_holder<my_class<19>, create_static, singleton_with_longevity, single_threaded>;
using t20 = singleton_holder<my_class<20>, create_static, no_destroy, single_threaded>;
using t21 = singleton_holder<my_class<21>, create_static, default_lifetime, class_level_lockable>;
using t22 = singleton_holder<my_class<22>, create_static, phoenix_singleton, class_level_lockable>;
using t23 = singleton_holder<my_class<23>, create_static, singleton_with_longevity, class_level_lockable>;
using t24 = singleton_holder<my_class<24>, create_static, no_destroy, class_level_lockable>;
} // namespace
struct singleton_test : test {
singleton_test() : test("singleton.hpp") {}
virtual void execute(test_result& results) override {
{
bool test_success = true;
MAKE_TEST(t0);
test::assertion("default config", test_success, results);
}
{
bool test_success = true;
MAKE_TEST(t1);
MAKE_TEST(t2);
MAKE_TEST(t3);
MAKE_TEST(t4);
test::assertion("new - single threaded", test_success, results);
}
{
bool test_success = true;
MAKE_TEST(t5);
MAKE_TEST(t6);
MAKE_TEST(t7);
MAKE_TEST(t8);
test::assertion("new - class level lock", test_success, results);
}
{
bool test_success = true;
MAKE_TEST(t9);
MAKE_TEST(t10);
MAKE_TEST(t11);
MAKE_TEST(t12);
test::assertion("malloc - single threaded", test_success, results);
}
{
bool test_success = true;
MAKE_TEST(t13);
MAKE_TEST(t14);
MAKE_TEST(t15);
MAKE_TEST(t16);
test::assertion("malloc - class level lock", test_success, results);
}
{
bool test_success = true;
MAKE_TEST(t17);
MAKE_TEST(t18);
MAKE_TEST(t19);
MAKE_TEST(t20);
test::assertion("static - single threaded", test_success, results);
}
{
bool test_success = true;
MAKE_TEST(t21);
MAKE_TEST(t22);
MAKE_TEST(t23);
MAKE_TEST(t24);
test::assertion("static - class level lock", test_success, results);
}
}
} singleton_test_instance;
} // namespace loki
#endif // NEOLOKI_SINGLETONTESTS_HPP
| [
"zie.develop@gmail.com"
] | zie.develop@gmail.com |
1e53e7586b2ea404e7718d4bbf199970193f4aa7 | 579c99f71480caa5ccee8430560bf06efadcd0f6 | /C++/BAI3.cpp | 2e913e2af2869837c780ba1f120ba7ec073e5a14 | [] | no_license | 7on9/algorithm | 99988769e4180d442832c5984162ef16751fa08c | d7ba6a60b8105d9ec379689cb3854e0aa2deeadb | refs/heads/master | 2020-06-02T09:08:33.826200 | 2019-06-10T06:25:29 | 2019-06-10T06:25:29 | 191,109,595 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,532 | cpp |
#include <stdio.h>
#include <stdlib.h>
#define maxnmk 50000 //So phan tu toi da trong mang
int m,n,k,a[maxnmk+1],b[maxnmk+1],heap[maxnmk+1],nheap=0;
//Cap nhat mot gia tri vao heap
void update(int value)
{
int child=++nheap,parent;
while (child>=1)
{
parent=child/2;
if (parent==0 || heap[parent]>=value) break;
heap[child]=heap[parent];
child=parent;
}
heap[child]=value;
}
//Lay mot phan tu ra khoi heap
void pop()
{
int value=heap[nheap--], parent=1, child;
while (parent<=nheap)
{
child=parent*2;
if (child<nheap && heap[child+1]>heap[child]) child++;
if (child>nheap || heap[child]<=value) break;
heap[parent]=heap[child];
parent=child;
}
heap[parent]=value;
}
//Xuat ket qua bang de quy
void print()
{
if (nheap==0) return;
int value=heap[1];
pop();
print();
printf("%d\n",value);
}
int compare(const void *a, const void *b)
{
return (*(int *)a>*(int *)b);
}
int main()
{
//Doc dau vao
scanf("%d%d%d",&m,&n,&k);
for (int i=0;i<m;i++) scanf("%d",a+i);
for (int i=0;i<n;i++) scanf("%d",b+i);
//Sap xep hai mang tang dan
qsort(a,m,sizeof(int),compare);
qsort(b,n,sizeof(int),compare);
//Duyet va cap nhat heap, xuat ket qua
for (int i=0;i<m;i++)
for (int j=0;j<n;j++)
if (heap[1]>a[i]+b[j] || nheap<k)
{
if (nheap==k) pop();
update(a[i]+b[j]);
}
else break;
print();
return 0;
} | [
"tamdaulong207@gmail.com"
] | tamdaulong207@gmail.com |
c1d8b0d84f613aefb3be575c5178311537a0cfe0 | e05ee73f59fa33c462743b30cbc5d35263383e89 | /sparse/control/magma_smdiagdom.cpp | 31e35dc3151c23d1d1a9f40cf977de1abe980e55 | [] | no_license | bhrnjica/magma | 33c9e8a89f9bc2352f70867a48ec2dab7f94a984 | 88c8ca1a668055859a1cb9a31a204b702b688df5 | refs/heads/master | 2021-10-09T18:49:50.396412 | 2019-01-02T13:51:33 | 2019-01-02T13:51:33 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 6,020 | cpp | /*
-- MAGMA (version 2.4.0) --
Univ. of Tennessee, Knoxville
Univ. of California, Berkeley
Univ. of Colorado, Denver
@date June 2018
@generated from sparse/control/magma_zmdiagdom.cpp, normal z -> s, Mon Jun 25 18:24:27 2018
@author Hartwig Anzt
*/
#include "magmasparse_internal.h"
/***************************************************************************//**
Purpose
-------
This routine takes a CSR matrix and computes the average diagonal dominance.
For each row i, it computes the abs(d_ii)/sum_j(abs(a_ij)).
It returns max, min, and average.
Arguments
---------
@param[in]
M magma_s_matrix
System matrix.
@param[out]
*min_dd float
Smallest diagonal dominance.
@param[out]
*max_dd float
Largest diagonal dominance.
@param[out]
*avg_dd float
Average diagonal dominance.
@param[in]
queue magma_queue_t
Queue to execute in.
@ingroup magmasparse_saux
********************************************************************/
extern "C" magma_int_t
magma_smdiagdom(
magma_s_matrix M,
float *min_dd,
float *max_dd,
float *avg_dd,
magma_queue_t queue )
{
magma_int_t info = 0;
*min_dd = 0.0;
*max_dd = 0.0;
*avg_dd = 0.0;
magma_int_t count = 0;
magma_s_matrix x={Magma_CSR};
magma_s_matrix A={Magma_CSR};
CHECK( magma_smtransfer( M, &A, M.memory_location, Magma_CPU, queue ));
CHECK( magma_svinit( &x, Magma_CPU, A.num_rows, 1, 0.0, queue ) );
#pragma omp parallel for
for( magma_int_t i=0; i<A.num_rows; i++ ){
float diag = 0.0;
float offdiag = 0.0;
for( magma_int_t j=A.row[i]; j<A.row[i+1]; j++ ){
float val = MAGMA_S_ABS( A.val[j] );
if( A.col[j] == i ){
diag += val;
} else {
offdiag += val;
}
}
x.val[i] = offdiag / diag;
}
*min_dd = 1e10;
*max_dd = 0.0;
*avg_dd =0.0;
for(magma_int_t i=0; i<A.num_rows; i++ ){
if( x.val[i] < 0.0 ){
;
} else {
*min_dd = ( x.val[i] < *min_dd ) ? x.val[i] : *min_dd;
*max_dd = ( x.val[i] > *max_dd ) ? x.val[i] : *max_dd;
*avg_dd += x.val[i];
count++;
}
}
*avg_dd = *avg_dd / ( (float) count );
cleanup:
magma_smfree(&x, queue );
magma_smfree(&A, queue );
return info;
}
/***************************************************************************//**
Purpose
-------
This routine takes a CSR matrix and computes the average block-diagonal
dominance.
For each row i, it computes the abs( D_(i,:) ) / abs( A(i,:) \ D_(i,:) ).
It returns max, min, and average.
The input vector bsz contains the blocksizes.
Arguments
---------
@param[in]
M magma_s_matrix
System matrix.
@param[in]
blocksizes magma_s_matrix
Vector containing blocksizes (as DoubleComplex).
@param[out]
*min_dd float
Smallest diagonal dominance.
@param[out]
*max_dd float
Largest diagonal dominance.
@param[out]
*avg_dd float
Average diagonal dominance.
@param[in]
queue magma_queue_t
Queue to execute in.
@ingroup magmasparse_saux
********************************************************************/
extern "C" magma_int_t
magma_smbdiagdom(
magma_s_matrix M,
magma_s_matrix blocksizes,
float *min_dd,
float *max_dd,
float *avg_dd,
magma_queue_t queue )
{
magma_int_t info = 0;
magma_int_t *end=NULL, *start=NULL;
magma_int_t ii=0;
magma_int_t count = 0;
magma_int_t rowbsz = 0; //blocksize for this row
*min_dd = 0.0;
*max_dd = 0.0;
*avg_dd = 0.0;
magma_s_matrix x={Magma_CSR};
magma_s_matrix bsz={Magma_CSR};
magma_s_matrix A={Magma_CSR};
CHECK( magma_smtransfer( M, &A, M.memory_location, Magma_CPU, queue ));
CHECK( magma_smtransfer( blocksizes, &bsz, blocksizes.memory_location, Magma_CPU, queue ));
CHECK( magma_svinit( &x, Magma_CPU, A.num_rows, 1, 0.0, queue ) );
CHECK( magma_imalloc_cpu( &start, A.num_rows ));
CHECK( magma_imalloc_cpu( &end, A.num_rows ));
for( magma_int_t rowb=0; rowb<bsz.num_rows; rowb++ ){ // block of rows
rowbsz = (magma_int_t) MAGMA_S_REAL((bsz.val[rowb]));
for( magma_int_t j =0; j<rowbsz; j++){
start[ii] = ii-j;
end[ii] = ii+rowbsz-j;
//printf("%d: %d -- %d\n", ii, start[ii], end[ii]);
ii++;
}
}
#pragma omp parallel for
for(magma_int_t i=0; i<A.num_rows; i++ ){
float diag = 0.0;
float offdiag = 0.0;
for( magma_int_t j=A.row[i]; j<A.row[i+1]; j++ ){
float val = MAGMA_S_ABS( A.val[j] );
if( ((A.col[j] >= start[i]) && (A.col[j]<end[i])) ){
diag += val;
} else {
offdiag += val;
}
}
x.val[i] = offdiag / diag;
}
*min_dd = 1e10;
*max_dd = 0.0;
*avg_dd =0.0;
count = 0;
for(magma_int_t i=0; i<A.num_rows; i++ ){
if( x.val[i] < 0.0 ){
;
} else {
*min_dd = ( x.val[i] < *min_dd ) ? x.val[i] : *min_dd;
*max_dd = ( x.val[i] > *max_dd ) ? x.val[i] : *max_dd;
*avg_dd += x.val[i];
count++;
}
}
*avg_dd = *avg_dd / ( (float) count );
cleanup:
magma_smfree(&x, queue );
magma_smfree(&bsz, queue );
magma_smfree(&A, queue );
magma_free_cpu( start );
magma_free_cpu( end );
return info;
}
| [
"sinkingsugar@gmail.com"
] | sinkingsugar@gmail.com |
a8383ea34c6a1b54483f4d0782b6a4e3694e69ad | 01b61b4b576f05dbcdd3926fd27f08d8517fc545 | /node/test/addons/WrappingCppObjects/BaseObjectWrap.cc | 7c7e1f65aa8b4e9138e66ccf58e788ed75bdb5c4 | [] | no_license | Ex-Soft/test | 0877badde69ddcfc5e1ff78703a053ef2587a69e | 7c0d0e554ba91b203564da7e44f43838710ac59d | refs/heads/master | 2023-04-11T07:18:43.542556 | 2023-03-31T14:20:16 | 2023-03-31T14:20:16 | 73,572,547 | 5 | 5 | null | 2023-09-07T13:28:45 | 2016-11-12T19:06:44 | C# | UTF-8 | C++ | false | false | 3,383 | cc | #include "BaseObjectWrap.h"
v8::Persistent<v8::Function> BaseObjectWrap::constructor;
BaseObjectWrap::BaseObjectWrap(int height, int width) {
_baseObject = new BaseObject(height, width);
}
BaseObjectWrap::~BaseObjectWrap() {
if (_baseObject)
delete _baseObject;
}
void BaseObjectWrap::Init(v8::Local<v8::Object> exports) {
v8::Isolate* isolate = exports->GetIsolate();
// Prepare constructor template
v8::Local<v8::FunctionTemplate> tpl = v8::FunctionTemplate::New(isolate, New);
tpl->SetClassName(v8::String::NewFromUtf8(isolate, "BaseObjectWrap"));
tpl->InstanceTemplate()->SetInternalFieldCount(1);
// Prototype
NODE_SET_PROTOTYPE_METHOD(tpl, "height", Height);
NODE_SET_PROTOTYPE_METHOD(tpl, "width", Width);
NODE_SET_PROTOTYPE_METHOD(tpl, "ping", Ping);
NODE_SET_PROTOTYPE_METHOD(tpl, "pong", Pong);
constructor.Reset(isolate, tpl->GetFunction());
exports->Set(v8::String::NewFromUtf8(isolate, "BaseObjectWrap"), tpl->GetFunction());
}
void BaseObjectWrap::New(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
if (args.IsConstructCall()) {
// Invoked as constructor: `new MyObject(...)`
int height = args[0]->IsUndefined() ? 0 : args[0]->Int32Value();
int width = args[1]->IsUndefined() ? 0 : args[1]->Int32Value();
BaseObjectWrap* obj = new BaseObjectWrap(height, width);
obj->Wrap(args.This());
args.GetReturnValue().Set(args.This());
} else {
// Invoked as plain function `MyObject(...)`, turn into construct call.
const int argc = 2;
v8::Local<v8::Value> argv[argc] = { args[0], args[1] };
v8::Local<v8::Context> context = isolate->GetCurrentContext();
v8::Local<v8::Function> cons = v8::Local<v8::Function>::New(isolate, constructor);
v8::Local<v8::Object> result = cons->NewInstance(context, argc, argv).ToLocalChecked();
args.GetReturnValue().Set(result);
}
}
void BaseObjectWrap::Height(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
BaseObjectWrap *w = ObjectWrap::Unwrap<BaseObjectWrap>(args.Holder());
args.GetReturnValue().Set(v8::Integer::New(isolate, w->_baseObject->height()));
}
void BaseObjectWrap::Width(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
BaseObjectWrap *w = ObjectWrap::Unwrap<BaseObjectWrap>(args.Holder());
args.GetReturnValue().Set(v8::Integer::New(isolate, w->_baseObject->width()));
}
void BaseObjectWrap::Ping(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
BaseObjectWrap *w = ObjectWrap::Unwrap<BaseObjectWrap>(args.Holder());
v8::Local<v8::String> result = v8::String::NewFromUtf8(isolate, w->_baseObject->pong().c_str());
const unsigned argc = 2;
v8::Local<v8::Value> argv[argc] = { v8::String::NewFromUtf8(isolate, "ping"), result };
node::MakeCallback(args.This(), "emit", 2, argv);
args.GetReturnValue().Set(v8::Undefined(isolate));
}
void BaseObjectWrap::Pong(const v8::FunctionCallbackInfo<v8::Value>& args) {
v8::Isolate* isolate = args.GetIsolate();
BaseObjectWrap *w = ObjectWrap::Unwrap<BaseObjectWrap>(args.Holder());
args.GetReturnValue().Set(v8::String::NewFromUtf8(isolate, w->_baseObject->pong().c_str()));
}
| [
"4others2@gmail.com"
] | 4others2@gmail.com |
593ad1e46e5810aae8ac890715ff826add660e93 | 3b9b4049a8e7d38b49e07bb752780b2f1d792851 | /src/chromeos/network/device_state.cc | 264698cbbd0b9a4502d5932f804d643a35f13853 | [
"BSD-3-Clause",
"Apache-2.0"
] | permissive | webosce/chromium53 | f8e745e91363586aee9620c609aacf15b3261540 | 9171447efcf0bb393d41d1dc877c7c13c46d8e38 | refs/heads/webosce | 2020-03-26T23:08:14.416858 | 2018-08-23T08:35:17 | 2018-09-20T14:25:18 | 145,513,343 | 0 | 2 | Apache-2.0 | 2019-08-21T22:44:55 | 2018-08-21T05:52:31 | null | UTF-8 | C++ | false | false | 5,927 | cc | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromeos/network/device_state.h"
#include "base/logging.h"
#include "base/metrics/histogram.h"
#include "base/strings/stringprintf.h"
#include "chromeos/network/network_event_log.h"
#include "chromeos/network/shill_property_util.h"
#include "third_party/cros_system_api/dbus/service_constants.h"
namespace chromeos {
DeviceState::DeviceState(const std::string& path)
: ManagedState(MANAGED_TYPE_DEVICE, path),
allow_roaming_(false),
provider_requires_roaming_(false),
support_network_scan_(false),
scanning_(false),
sim_retries_left_(0),
sim_present_(true),
eap_authentication_completed_(false) {
}
DeviceState::~DeviceState() {
}
bool DeviceState::PropertyChanged(const std::string& key,
const base::Value& value) {
// All property values get stored in |properties_|.
properties_.SetWithoutPathExpansion(key, value.DeepCopy());
if (ManagedStatePropertyChanged(key, value))
return true;
if (key == shill::kAddressProperty) {
return GetStringValue(key, value, &mac_address_);
} else if (key == shill::kScanningProperty) {
return GetBooleanValue(key, value, &scanning_);
} else if (key == shill::kSupportNetworkScanProperty) {
return GetBooleanValue(key, value, &support_network_scan_);
} else if (key == shill::kCellularAllowRoamingProperty) {
return GetBooleanValue(key, value, &allow_roaming_);
} else if (key == shill::kProviderRequiresRoamingProperty) {
return GetBooleanValue(key, value, &provider_requires_roaming_);
} else if (key == shill::kHomeProviderProperty) {
return shill_property_util::GetHomeProviderFromProperty(
value, &home_provider_id_);
} else if (key == shill::kTechnologyFamilyProperty) {
return GetStringValue(key, value, &technology_family_);
} else if (key == shill::kCarrierProperty) {
return GetStringValue(key, value, &carrier_);
} else if (key == shill::kFoundNetworksProperty) {
const base::ListValue* list = nullptr;
if (!value.GetAsList(&list))
return false;
CellularScanResults parsed_results;
if (!network_util::ParseCellularScanResults(*list, &parsed_results))
return false;
scan_results_.swap(parsed_results);
return true;
} else if (key == shill::kSIMLockStatusProperty) {
const base::DictionaryValue* dict = nullptr;
if (!value.GetAsDictionary(&dict))
return false;
// Set default values for SIM properties.
sim_lock_type_.erase();
sim_retries_left_ = 0;
const base::Value* out_value = nullptr;
if (dict->GetWithoutPathExpansion(shill::kSIMLockTypeProperty,
&out_value)) {
GetStringValue(shill::kSIMLockTypeProperty, *out_value, &sim_lock_type_);
}
if (dict->GetWithoutPathExpansion(shill::kSIMLockRetriesLeftProperty,
&out_value)) {
GetUInt32Value(shill::kSIMLockRetriesLeftProperty, *out_value,
&sim_retries_left_);
}
return true;
} else if (key == shill::kMeidProperty) {
return GetStringValue(key, value, &meid_);
} else if (key == shill::kImeiProperty) {
return GetStringValue(key, value, &imei_);
} else if (key == shill::kIccidProperty) {
return GetStringValue(key, value, &iccid_);
} else if (key == shill::kMdnProperty) {
return GetStringValue(key, value, &mdn_);
} else if (key == shill::kSIMPresentProperty) {
return GetBooleanValue(key, value, &sim_present_);
} else if (key == shill::kEapAuthenticationCompletedProperty) {
return GetBooleanValue(key, value, &eap_authentication_completed_);
} else if (key == shill::kIPConfigsProperty) {
// If kIPConfigsProperty changes, clear any previous ip_configs_.
// ShillPropertyhandler will request the IPConfig objects which will trigger
// calls to IPConfigPropertiesChanged.
ip_configs_.Clear();
return false; // No actual state change.
}
return false;
}
bool DeviceState::InitialPropertiesReceived(
const base::DictionaryValue& properties) {
// Update UMA stats.
if (sim_present_) {
bool locked = !sim_lock_type_.empty();
UMA_HISTOGRAM_BOOLEAN("Cellular.SIMLocked", locked);
}
return false;
}
void DeviceState::IPConfigPropertiesChanged(
const std::string& ip_config_path,
const base::DictionaryValue& properties) {
base::DictionaryValue* ip_config = nullptr;
if (ip_configs_.GetDictionaryWithoutPathExpansion(
ip_config_path, &ip_config)) {
NET_LOG_EVENT("IPConfig Updated: " + ip_config_path, path());
ip_config->Clear();
} else {
NET_LOG_EVENT("IPConfig Added: " + ip_config_path, path());
ip_config = new base::DictionaryValue;
ip_configs_.SetWithoutPathExpansion(ip_config_path, ip_config);
}
ip_config->MergeDictionary(&properties);
}
std::string DeviceState::GetIpAddressByType(const std::string& type) const {
for (base::DictionaryValue::Iterator iter(ip_configs_); !iter.IsAtEnd();
iter.Advance()) {
const base::DictionaryValue* ip_config;
if (!iter.value().GetAsDictionary(&ip_config))
continue;
std::string ip_config_method;
if (!ip_config->GetString(shill::kMethodProperty, &ip_config_method))
continue;
if (type == ip_config_method ||
(type == shill::kTypeIPv4 && ip_config_method == shill::kTypeDHCP) ||
(type == shill::kTypeIPv6 && ip_config_method == shill::kTypeDHCP6)) {
std::string address;
if (!ip_config->GetString(shill::kAddressProperty, &address))
continue;
return address;
}
}
return std::string();
}
bool DeviceState::IsSimAbsent() const {
return technology_family_ == shill::kTechnologyFamilyGsm && !sim_present_;
}
} // namespace chromeos
| [
"changhyeok.bae@lge.com"
] | changhyeok.bae@lge.com |
1a048f9e50a17f77daa29efabde68295258bdae2 | 6d796ee865e1c79582a024bb38cc64fa15b8b8de | /version/main.cpp | de617548b5dc7d2b000bf9535e3160e327040a95 | [] | no_license | pyrokar1993/cs8Tools | 8f82a7e223f5b1529b02fe388cb81018a6cc401f | d6d2c37c404c093e9900e6d2dd1f65c520ed45e8 | refs/heads/master | 2022-11-23T16:43:30.093698 | 2020-05-16T17:07:24 | 2020-05-16T17:07:24 | 183,562,748 | 0 | 0 | null | 2019-04-26T05:27:36 | 2019-04-26T05:27:34 | null | UTF-8 | C++ | false | false | 2,831 | cpp | #include <iostream>
#include <QProcess>
#include <QStringList>
#include <QFile>
#include <QTextStream>
#include <QDate>
#include <QTime>
#include <QFileInfo>
#include <QTemporaryFile>
#include <cstdlib>
using namespace std;
static int getBuildNumber()
{
const QDate today(QDate::currentDate());
return ((today.year() - 1994) * 1000) + today.dayOfYear();
}
static int getSubversionRevision()
{
int revision = 0;
QProcess process;
process.start("svnversion", QStringList() << "." << "--no-newline");
if (process.waitForStarted() && process.waitForReadyRead())
{
const QString str(process.readAll().constData());
const int pos = str.indexOf(':');
if (pos != -1)
{
revision = atoi(str.mid(pos + 1).toLatin1().constData());
}
else
{
revision = atoi(str.toLatin1().constData());
}
process.waitForFinished();
}
return revision;
}
static QByteArray readFile(const QString& fileName)
{
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly))
{
return QByteArray();
}
return file.readAll();
}
static int writeFile(const QString& fileName, const int major, const int minor, const int revision, const int build)
{
// Create a temp file containing the version info and
// only replace the existing one if they are different
QTemporaryFile tempFile;
if (tempFile.open())
{
QTextStream out(&tempFile);
out << "#ifndef VERSION_H\r\n";
out << "#define VERSION_H\r\n\r\n";
out << "namespace Version\r\n";
out << "{\r\n";
out << "\tstatic const int MAJOR = " << major << ";\r\n";
out << "\tstatic const int MINOR = " << minor << ";\r\n";
out << "\tstatic const int REVISION = " << revision << ";\r\n";
out << "\tstatic const int BUILD = " << build << ";\r\n";
out << "}\r\n\r\n";
out << "#endif // VERSION_H\r\n";
const QString tempFileName = tempFile.fileName();
tempFile.close();
if (!QFile::exists(fileName) || readFile(fileName) != readFile(tempFileName))
{
QFile::remove(fileName);
QFile::copy(tempFileName, fileName);
}
return 0;
}
else
{
cout << "Error creating temporary file!" << endl;
return 1;
}
}
int main(int argc, char *argv[])
{
if (argc != 4)
{
cout << "Usage: version major minor filename" << endl;
return 1;
}
const int major = atoi(argv[1]);
const int minor = atoi(argv[2]);
const int revision = getSubversionRevision();
const int build = getBuildNumber();
cout << major << '.' << minor << '.' << revision << '.' << build << endl;
return writeFile(argv[3], major, minor, revision, build);
}
| [
"volker.drewer@gmail.com"
] | volker.drewer@gmail.com |
e15c88ed16e46509cfe099d258301a5c2f7ffa69 | 6234cc45b8ff946c80cfc0ae083f066053a19857 | /file.cpp | ad8979155dde2ef53eab52ad3e5a41e44b37db0d | [] | no_license | Anshuman-UCSB/CS24-Project04 | 10bdc04fe2d09a59da136ace9a847bf2b65389fd | d8c781b1443c77d8238ddf426f585a218de790fc | refs/heads/master | 2022-04-06T11:35:07.571294 | 2020-03-03T08:45:59 | 2020-03-03T08:45:59 | 242,884,613 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 384 | cpp | #include "file.h"
File::File(string name, int count){
filename = name;
this->count = count;
}
void File::addCount(){
count++;
}
File::File(){
filename = "";
count = -1;
}
bool File::hasMoreThan(int cnt) const {
return count>=cnt;
}
bool operator<(const File& f1, const File& f2){
return(f1.filename.compare(f2.filename) < 0);
}
| [
"Anshuman@ucsb.edu"
] | Anshuman@ucsb.edu |
334937585fe94de7495db0cb38865a105c4a8452 | b0dd7779c225971e71ae12c1093dc75ed9889921 | /libs/spirit/test/qi/eps.cpp | 0c412495d5fecb5793886aae021ff4915fa086be | [
"LicenseRef-scancode-warranty-disclaimer",
"BSL-1.0"
] | permissive | blackberry/Boost | 6e653cd91a7806855a162347a5aeebd2a8c055a2 | fc90c3fde129c62565c023f091eddc4a7ed9902b | refs/heads/1_48_0-gnu | 2021-01-15T14:31:33.706351 | 2013-06-25T16:02:41 | 2013-06-25T16:02:41 | 2,599,411 | 244 | 154 | BSL-1.0 | 2018-10-13T18:35:09 | 2011-10-18T14:25:18 | C++ | UTF-8 | C++ | false | false | 1,350 | cpp | /*=============================================================================
Copyright (c) 2001-2010 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#include <boost/detail/lightweight_test.hpp>
#include <boost/spirit/include/qi_auxiliary.hpp>
#include <boost/spirit/include/qi_operator.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <iostream>
#include "test.hpp"
int
main()
{
using spirit_test::test;
using boost::spirit::eps;
{
BOOST_TEST((test("", eps)));
BOOST_TEST((test("xxx", eps, false)));
BOOST_TEST((!test("", !eps))); // not predicate
}
{ // test non-lazy semantic predicate
BOOST_TEST((test("", eps(true))));
BOOST_TEST((!test("", eps(false))));
BOOST_TEST((test("", !eps(false)))); // not predicate
}
{ // test lazy semantic predicate
using boost::phoenix::val;
BOOST_TEST((test("", eps(val(true)))));
BOOST_TEST((!test("", eps(val(false)))));
BOOST_TEST((test("", !eps(val(false))))); // not predicate
}
return boost::report_errors();
}
| [
"tvaneerd@rim.com"
] | tvaneerd@rim.com |
27d04691fd3122232b8b2ea34a196d180f7ba270 | a0c8daadc766aae14c8e8246e747035e140c2baa | /speech/include/nlohmann/detail/iterators/internal_iterator.hpp | 07ab6a63d76b99b3462a7edcac22bdd777ae11a1 | [] | permissive | kenzanin/speech | 78dc2c705a1080999746858bcaa23ac86ef432df | 59a4546ecccf6f147a80c3971054169f9feacaa0 | refs/heads/main | 2023-08-25T21:12:19.563320 | 2021-10-08T07:02:05 | 2021-10-08T07:02:05 | 390,218,640 | 0 | 1 | CC0-1.0 | 2021-07-29T14:28:45 | 2021-07-28T04:57:30 | C++ | UTF-8 | C++ | false | false | 745 | hpp | #pragma once
#include <nlohmann/detail/iterators/primitive_iterator.hpp>
namespace nlohmann
{
namespace detail
{
/*!
@brief an iterator value
@note This structure could easily be a union, but MSVC currently does not allow
unions members with complex constructors, see https://github.com/nlohmann/json/pull/105.
*/
template<typename BasicJsonType> struct internal_iterator
{
/// iterator for JSON objects
typename BasicJsonType::object_t::iterator object_iterator {};
/// iterator for JSON arrays
typename BasicJsonType::array_t::iterator array_iterator {};
/// generic iterator for all other types
primitive_iterator_t primitive_iterator {};
};
} // namespace detail
} // namespace nlohmann
| [
"kenzanin@gmail.com"
] | kenzanin@gmail.com |
6b32c4015eb243b1e68bc51f8a961dcba4ad80ed | dba127f8a88db95386cbe21b221760d782cbdf67 | /CoreLib 3D/ObjectManager.cpp | 944369c273a8045cec090d498b0d19ff0ab9c84b | [] | no_license | 15831944/DirectX_Study | c1bd6fe1b8eb891bf49a5a3954234adf59abdb46 | e4832a079936dc1aa893b098375a1d228c7cc02b | refs/heads/master | 2021-10-20T09:19:15.305146 | 2019-02-27T06:30:56 | 2019-02-27T06:30:56 | null | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 12,644 | cpp | #include "ObjectManager.h"
map<ECamera, Camera*> ObjectManager::Cameras;
Camera* ObjectManager::CurCamera;
list<Light*> ObjectManager::Lights;
stack<tuple<void(*)(void*, void*), void*, void*> > ObjectManager::PostFrameEvent;
static const float g_fMaxSize = 1024.0f;
bool ObjectManager::Init() noexcept
{
// 조명 생성
Lights.emplace_back(new Light(L"Light", ELight::Point));
//PushObject(Lights.back());
// 카메라 생성
Cameras[ECamera::Main] = new Camera(L"MainCamera");
Cameras[ECamera::UI] = new Camera(L"UICamera", false);
Cameras[ECamera::Screen] = new Camera(L"Screen", false);
Cameras[ECamera::Screen]->SetOrthoWH(1.0f, 1.0f);
D3DXMatrixIdentity(&Cameras[ECamera::Screen]->m_matWorld);
Cameras[ECamera::MiniMap] = new Camera(L"MiniMap", true);
//Cameras[ECamera::MiniMap]->SetOrthoWH(700.0f, 700.0f);
Cameras[ECamera::MiniMap]->SetPosition(Vector3::Up * 300);
Cameras[ECamera::MiniMap]->SetRotation(Quaternion::Up * PI * 0.5f);
Cameras[ECamera::MiniMap]->Frame(0.0f, 0.0f);
Camera::SelectCamera = Cameras[ECamera::Main];
CurCamera = Cameras[ECamera::Main];
// RenderTarget 초기화
DxManager::GetInstance().InitRTView();
//m_RT.m_DSFormat = DXGI_FORMAT_R32_TYPELESS;
//m_RT.Create(DxManager::GetDevice(), g_fMaxSize, g_fMaxSize);
return true;
}
bool ObjectManager::Frame(const float& spf, const float& accTime) noexcept
{
Camera::SelectCamera->Frame(spf, accTime);
for (auto& iter : Lights)
{
iter->Frame(spf, accTime);
}
for (auto& outiter : m_ObjectList)
{
for (auto& initer : outiter.second)
{
initer->Frame(spf, accTime);
}
}
for (auto& iter : m_InstanceList)
{
iter->Frame(spf, accTime);
}
// 후처리 이벤트
while (!PostFrameEvent.empty())
{
auto [postEvent, param1, param2] = PostFrameEvent.top();
postEvent(param1, param2);
PostFrameEvent.pop();
}
return true;
}
bool ObjectManager::Render(ID3D11DeviceContext* pDContext) noexcept
{
Camera::SelectCamera->Render(pDContext);
Lights.front()->SetFocus(Vector3::Zero);
for (auto& iter : Lights)
{
iter->Render(pDContext);
}
////////////////////////////////////////// 깊이맵 랜더 /////////////////////////////////////////////////
CurCamera = Lights.front();
DxManager::GetInstance().m_RTDSViewShadow.ClearView(pDContext);
DxManager::GetInstance().SetViewPort(EViewPort::Main);
DxManager::GetInstance().SetDepthStencilState(EDepthS::Basic);
DxManager::GetInstance().SetRasterizerState(ERasterS::DepthBias);
// 깊이맵 랜더
for (auto& iter : m_ObjectList[EObjType::Object])
{
auto RendererLIst = (forward_list<Renderer*>*)iter->GetComponentList(EComponent::Renderer);
if (RendererLIst == nullptr)
continue;
for (auto& pRenderer : *RendererLIst)
{
if (pRenderer != nullptr)
{
pRenderer->PrevRender(pDContext);
pDContext->VSSetShader(DxManager::GetInstance().m_VShaderList["VS_DepthMap"], nullptr, 0);
pDContext->PSSetShader(nullptr, nullptr, 0);
pRenderer->PostRender(pDContext);
}
}
}
for (auto& iter : m_ObjectList[EObjType::Map])
{
auto RendererLIst = (forward_list<Renderer*>*)iter->GetComponentList(EComponent::Renderer);
if (RendererLIst == nullptr)
continue;
for (auto& pRenderer : *RendererLIst)
{
if (pRenderer != nullptr)
{
pRenderer->PrevRender(pDContext);
pDContext->VSSetShader(DxManager::GetInstance().m_VShaderList["VS_DepthMap"], nullptr, 0);
pDContext->PSSetShader(nullptr, nullptr, 0);
//pDContext->PSSetShader(DxManager::GetInstance().m_PShaderList["PS_DepthMap"], nullptr, 0);
pRenderer->PostRender(pDContext);
}
}
}
DxManager::GetInstance().SetDepthStencilState(EDepthS::Current);
DxManager::GetInstance().SetRasterizerState(ERasterS::Current);
DxManager::GetInstance().SetViewPort(EViewPort::Main);
DxManager::GetInstance().m_RTDSView.Setting(pDContext);
CurCamera = Cameras[ECamera::Main];
// ================================================ 쉐도우(+) 랜더 ============================================================
DxManager::GetInstance().SetSamplerState(1, ESamTextureS::Clamp, ESamFilterS::Linear);
DxManager::GetInstance().SetSamplerState(2, ESamTextureS::Border, ESamFilterS::CompLinearPoint, 0, D3D11_COMPARISON_LESS);
//DxManager::GetInstance().SetRasterizerState(ERasterS::CullBack);
// 깊이맵 쉐도우
for (auto&[type, objects] : m_ObjectList)
{
if (type == EObjType::Object || type == EObjType::Map)
{
for (auto& iter : objects)
{
pDContext->PSSetShaderResources(4, 1, &DxManager::GetInstance().m_RTDSViewShadow.m_pTexSRViews[0]);
iter->Render(pDContext);
}
}
}
//DxManager::GetInstance().SetDepthStencilState(EDepthS::Current);
//DxManager::GetInstance().SetRasterizerState(ERasterS::Current);
DxManager::GetInstance().SetSamplerState(1, ESamTextureS::Current, ESamFilterS::Current);
DxManager::GetInstance().SetSamplerState(2, ESamTextureS::Current, ESamFilterS::Current);
// ===================================== 기타 랜더 =======================================
for (auto&[type, outiter] : m_ObjectList)
{
if (type == EObjType::Object || type == EObjType::Map)
continue;
for (auto& initer : outiter)
{
initer->Render(pDContext);
}
}
for (auto& iter : m_InstanceList)
{
iter->Render(pDContext);
}
// ===================== 미니맵 ========================
DxManager::GetInstance().ClearDepthStencilView();
DxManager::GetInstance().SetViewPort(EViewPort::MiniMap);
CurCamera = Cameras[ECamera::MiniMap];
for (auto& iter : Lights)
{
iter->Render(pDContext);
}
for (auto&[type, objects] : m_ObjectList)
{
if (type == EObjType::UI)
continue;
for (auto& iter : objects)
{
iter->Render(pDContext);
}
}
for (auto& iter : m_InstanceList)
{
iter->Render(pDContext);
}
CurCamera = Cameras[ECamera::Main];
DxManager::GetInstance().SetViewPort(EViewPort::Main);
return true;
}
bool ObjectManager::Release() noexcept
{
// Global이 아닌 오브젝트 비활성화
for (auto&& outIter = m_ObjectList.begin(); outIter != m_ObjectList.end(); outIter++)
{
outIter->second.remove_if([&](GameObject* pObj) {
if (pObj->isGlobal())
return false;
pObj->isEnable(false);
m_DisabledPull[pObj->m_myName].push(pObj);
return true;
});
}
return true;
}
// 스트라이트 리스트
bool ObjectManager::ReadSpriteScript() noexcept
{
FILE* fp;
_wfopen_s(&fp, L"../../data/script/sprite.txt", L"rt");
if (fp == nullptr)
{
ErrorMessage(L""s + __FUNCTIONW__ + L" -> 파일 읽기 실패!");
return false;
}
TCHAR _buffer[100] = { 0, };
TCHAR _objName[25] = { 0, };
TCHAR _bitName[25] = { 0, };
D3DXVECTOR4 _vector4;
float _frame = 0.0f;
Texture* _pTexture = nullptr;
_fgetts(_buffer, _countof(_buffer), fp); // 한줄 읽기
while (wcscmp(_buffer, L"end\n"))
{
_stscanf_s(_buffer, L"%s %s", _objName, 25, _bitName, 25); // 객체 이름, 갯수
_fgetts(_buffer, _countof(_buffer), fp);
while (wcscmp(_buffer, L"\n"))
{
_stscanf_s(_buffer, L"%f %f %f %f %f", // 스프라이트 정보(프레임, 좌표)
&_frame,
&_vector4.x, &_vector4.y,
&_vector4.z, &_vector4.w);
_pTexture = DxManager::Get().GetTexture(_bitName);
_vector4.x /= _pTexture->GetTexWidth();
_vector4.y /= _pTexture->GetTexHeight();
_vector4.z /= _pTexture->GetTexWidth();
_vector4.w /= _pTexture->GetTexHeight();
m_SpriteList[_objName].emplace_back(_pTexture, _frame, _vector4);
_fgetts(_buffer, _countof(_buffer), fp);
}
_fgetts(_buffer, _countof(_buffer), fp);
}
fclose(fp);
return true;
}
void ObjectManager::SetCurCamera(const ECamera& eCamera) noexcept
{
CurCamera = Cameras[eCamera];
}
forward_list<GameObject*>* ObjectManager::GetObjectList(const EObjType& objType) noexcept
{
return &m_ObjectList[objType];
}
vector<Sprite>* ObjectManager::GetSpriteList(const wstring_view& spriteName) noexcept
{
auto iter = m_SpriteList.find(spriteName.data());
if (iter == m_SpriteList.end())
{
auto pTexture = DxManager::GetInstance().GetTexture(spriteName.data());
// 스프라이트 생성하고 스프라이트 리스트로 추가
m_SpriteList[spriteName.data()].emplace_back(pTexture, 0.0f);
return &m_SpriteList[spriteName.data()];
}
return &iter->second;
}
map<wstring, vector<Sprite> >& ObjectManager::GetSpriteList() noexcept
{
return m_SpriteList;
}
GameObject* ObjectManager::TakeObject(const wstring_view& objName) noexcept
{
GameObject* myObj = nullptr;
if (m_DisabledPull[objName].empty())
{
//대기 풀이 비었다면 복사 생성
auto&& iter = m_ProtoPull.find(objName);
if (iter == m_ProtoPull.end())
{
ErrorMessage(L""s + __FUNCTIONW__ + L" -> " + objName.data() + L" : 미등록된 오브젝트!");
return nullptr;
}
myObj = iter->second->clone(); // 복사
}
else
{
// 대기 풀이 있다면 꺼내옴
myObj = m_DisabledPull[objName].top();
m_DisabledPull[objName].pop();
}
//myObj->Init();
myObj->isEnable(true);
m_ObjectList[myObj->m_objType].push_front(myObj);
return myObj;
}
GameObject* ObjectManager::SetProtoObject(GameObject* pObject) noexcept
{
if (m_ProtoPull.find(pObject->m_myName) != m_ProtoPull.end())
{
ErrorMessage(""s + __FUNCTION__ + " -> 중복된 이름!");
return nullptr;
}
m_ProtoPull[pObject->m_myName] = pObject;
//pObject->isEnable(false);
return pObject;
}
GameObject* ObjectManager::PushObject(GameObject* pObject) noexcept
{
if (find(m_ObjectList[pObject->m_objType].begin(), m_ObjectList[pObject->m_objType].end(), pObject)
== m_ObjectList[pObject->m_objType].end())
{
m_ObjectList[pObject->m_objType].push_front(pObject);
}
pObject->isEnable(true);
return pObject;
}
void ObjectManager::PopObject(GameObject* pObject) noexcept
{
auto& findList = m_ObjectList[pObject->m_objType];
auto&& iter = find(findList.begin(), findList.end(), pObject);
if (iter == findList.end())
{
//ErrorMessage(L""s + __FUNCTIONW__ + L" -> " + pObject->m_myName + L", Not Found!" );
return;
}
findList.remove(*iter);
}
void ObjectManager::DisableObject(GameObject* pObject) noexcept
{
pObject->isEnable(false);
PopObject(pObject);
m_DisabledPull[pObject->m_myName].push(pObject);
}
bool ObjectManager::RemoveObject(GameObject* pObject) noexcept
{
if (pObject == nullptr || pObject->isNotDelete())
{
ErrorMessage(L""s + __FUNCTIONW__ + L" -> " + pObject->m_myName + L" : 삭제할 수 없는 오브젝트!");
return false;
}
pObject->isEnable(false);
auto deleteEvent = [](void* pVoid, void*) {
auto pObj = (GameObject*)pVoid;
pObj->CutParent();
ObjectManager::GetInstance().PopObject(pObj);
pObj->Release();
delete pObj;
};
PostFrameEvent.emplace(deleteEvent, pObject, nullptr);
return true;
}
bool ObjectManager::RemoveComponent(Component* pComponent) noexcept
{
if (pComponent == nullptr)
return false;
pComponent->isEnable(false);
auto deleteEvent = [](void* pVoid, void*) {
auto pComp = (Component*)pVoid;
pComp->m_pParent->GetComponentList()[pComp->m_comptType].remove(pComp);
pComp->Release();
delete pComp;
};
PostFrameEvent.emplace(deleteEvent, pComponent, nullptr);
return true;
}
Component* ObjectManager::TakeComponent(const wstring_view& compName) noexcept
{
Component* pComponent = nullptr;
auto&& iter = m_ComponentPull.find(compName.data());
if (iter == m_ComponentPull.end())
{
ErrorMessage(L""s + __FUNCTIONW__ + L" -> " + compName.data() + L" : 미등록된 컴포넌트!");
return nullptr;
}
pComponent = iter->second->clone(); // 복사
//pComponent->Init();
pComponent->isEnable(true);
return pComponent;
}
Component* ObjectManager::SetProtoComponent(Component* pComponent) noexcept
{
if (m_ComponentPull.find(pComponent->m_myName) != m_ComponentPull.end())
{
ErrorMessage(""s + __FUNCTION__ + " -> 중복된 이름!");
return nullptr;
}
m_ComponentPull[pComponent->m_myName] = pComponent;
//pComponent->isEnable(false);
return pComponent;
}
InstanceRenderer* ObjectManager::PushInstance(InstanceRenderer* pInstance) noexcept
{
for (auto&& iter = m_InstanceList.begin(); iter != m_InstanceList.end(); ++iter)
{
if (*iter == pInstance)
{
ErrorMessage(""s + __FUNCTION__ + " -> 이미 등록된 인스턴스!");
return nullptr;
}
}
m_InstanceList.push_front(pInstance);
//pInstance->isEnable(true);
return pInstance;
}
void ObjectManager::PopInstance(InstanceRenderer* pInstance) noexcept
{
for (auto&& iter = m_InstanceList.begin(); iter != m_InstanceList.end(); ++iter)
{
if (*iter == pInstance)
{
m_InstanceList.remove(*iter);
return;
}
}
//ErrorMessage(L""s + __FUNCTIONW__ + L" -> " + pObject->m_myName + L", Not Found!" );
} | [
"kgcaschool@outlook.kr"
] | kgcaschool@outlook.kr |
33b62dfc8cc0f3886d0cb69c47e6b72508b182e6 | 3cf9e141cc8fee9d490224741297d3eca3f5feff | /C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-2732.cpp | 83e4786f34e72d17f54e8435853baf6b5b1dac79 | [] | no_license | TeamVault/tauCFI | e0ac60b8106fc1bb9874adc515fc01672b775123 | e677d8cc7acd0b1dd0ac0212ff8362fcd4178c10 | refs/heads/master | 2023-05-30T20:57:13.450360 | 2021-06-14T09:10:24 | 2021-06-14T09:10:24 | 154,563,655 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,604 | cpp | struct c0;
void __attribute__ ((noinline)) tester0(c0* p);
struct c0
{
bool active0;
c0() : active0(true) {}
virtual ~c0()
{
tester0(this);
active0 = false;
}
virtual void f0(){}
};
void __attribute__ ((noinline)) tester0(c0* p)
{
p->f0();
}
struct c1;
void __attribute__ ((noinline)) tester1(c1* p);
struct c1
{
bool active1;
c1() : active1(true) {}
virtual ~c1()
{
tester1(this);
active1 = false;
}
virtual void f1(){}
};
void __attribute__ ((noinline)) tester1(c1* p)
{
p->f1();
}
struct c2;
void __attribute__ ((noinline)) tester2(c2* p);
struct c2
{
bool active2;
c2() : active2(true) {}
virtual ~c2()
{
tester2(this);
active2 = false;
}
virtual void f2(){}
};
void __attribute__ ((noinline)) tester2(c2* p)
{
p->f2();
}
struct c3;
void __attribute__ ((noinline)) tester3(c3* p);
struct c3 : virtual c1, virtual c0
{
bool active3;
c3() : active3(true) {}
virtual ~c3()
{
tester3(this);
c0 *p0_0 = (c0*)(c3*)(this);
tester0(p0_0);
c1 *p1_0 = (c1*)(c3*)(this);
tester1(p1_0);
active3 = false;
}
virtual void f3(){}
};
void __attribute__ ((noinline)) tester3(c3* p)
{
p->f3();
if (p->active0)
p->f0();
if (p->active1)
p->f1();
}
struct c4;
void __attribute__ ((noinline)) tester4(c4* p);
struct c4 : c3, virtual c2, virtual c1
{
bool active4;
c4() : active4(true) {}
virtual ~c4()
{
tester4(this);
c0 *p0_0 = (c0*)(c3*)(c4*)(this);
tester0(p0_0);
c1 *p1_0 = (c1*)(c3*)(c4*)(this);
tester1(p1_0);
c1 *p1_1 = (c1*)(c4*)(this);
tester1(p1_1);
c2 *p2_0 = (c2*)(c4*)(this);
tester2(p2_0);
c3 *p3_0 = (c3*)(c4*)(this);
tester3(p3_0);
active4 = false;
}
virtual void f4(){}
};
void __attribute__ ((noinline)) tester4(c4* p)
{
p->f4();
if (p->active3)
p->f3();
if (p->active0)
p->f0();
if (p->active1)
p->f1();
if (p->active2)
p->f2();
}
int __attribute__ ((noinline)) inc(int v) {return ++v;}
int main()
{
c0* ptrs0[25];
ptrs0[0] = (c0*)(new c0());
ptrs0[1] = (c0*)(c3*)(new c3());
ptrs0[2] = (c0*)(c3*)(c4*)(new c4());
for (int i=0;i<3;i=inc(i))
{
tester0(ptrs0[i]);
delete ptrs0[i];
}
c1* ptrs1[25];
ptrs1[0] = (c1*)(new c1());
ptrs1[1] = (c1*)(c3*)(new c3());
ptrs1[2] = (c1*)(c3*)(c4*)(new c4());
ptrs1[3] = (c1*)(c4*)(new c4());
for (int i=0;i<4;i=inc(i))
{
tester1(ptrs1[i]);
delete ptrs1[i];
}
c2* ptrs2[25];
ptrs2[0] = (c2*)(new c2());
ptrs2[1] = (c2*)(c4*)(new c4());
for (int i=0;i<2;i=inc(i))
{
tester2(ptrs2[i]);
delete ptrs2[i];
}
c3* ptrs3[25];
ptrs3[0] = (c3*)(new c3());
ptrs3[1] = (c3*)(c4*)(new c4());
for (int i=0;i<2;i=inc(i))
{
tester3(ptrs3[i]);
delete ptrs3[i];
}
c4* ptrs4[25];
ptrs4[0] = (c4*)(new c4());
for (int i=0;i<1;i=inc(i))
{
tester4(ptrs4[i]);
delete ptrs4[i];
}
return 0;
}
| [
"ga72foq@mytum.de"
] | ga72foq@mytum.de |
0f7a55fb38204d31fd1c860eb3e1292277ad6d4f | 4257f6fb1fd44bb29f05ab2ed78c1071a950be64 | /LineFollowSenseLCD/LineFollowSenseLCD.ino | 8b739983937d29c99257964585d5010cd986fa82 | [] | no_license | uklejaj/master-code | e28e1b4c2dcf21daee952361f64c90ed8437f42a | ea0ca9d5145da12543cee6868e73b6c4bba34114 | refs/heads/master | 2021-01-01T03:59:43.704475 | 2016-04-14T16:55:17 | 2016-04-14T16:55:17 | 56,249,463 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 8,172 | ino | //Line Following Setup
#include <Servo.h> // Use the Servo library (included with Arduino IDE)
#include <SoftwareSerial.h>
Servo servoL; // Define the left and right servos
Servo servoR;
const int TxPin = 8;
const int sio = 53; // ColorPAL connected to pin 2
const int unused = 255; // Non-existant pin # for SoftwareSerial
const int sioBaud = 4800;
const int waitDelay = 200;
// Received RGB values from ColorPAL
int red;
int grn;
int blu;
int farLP = 9;
int centerLP = 6;
int centerRP = 5;
int farRP = 4;
int left = 0;
int right = 0;
boolean linefollowing = true;
boolean senselcd = false;
// Set up two software serials on the same pin.
SoftwareSerial mySerial = SoftwareSerial(255, TxPin);
SoftwareSerial serin(sio, unused);
SoftwareSerial serout(unused, sio);
void setup() {
Serial.begin(9600);
servoL.attach(13); // Attach (programmatically connect) servos to pins on Arduino
servoR.attach(12);
reset(); // Send reset to ColorPal
serout.begin(sioBaud);
pinMode(sio, OUTPUT);
serout.print("= (00 $ m) !"); // Loop print values, see ColorPAL documentation
serout.end(); // Discontinue serial port for transmitting
serin.begin(sioBaud); // Set up serial port for receiving
pinMode(sio, INPUT);
pinMode(2, OUTPUT);
pinMode(8, OUTPUT);
pinMode(TxPin, OUTPUT);
digitalWrite(TxPin, HIGH);
mySerial.begin(9600);
}
long RCTime(int sensorIn) {
long duration = 0;
pinMode(sensorIn, OUTPUT); // Make pin OUTPUT
digitalWrite(sensorIn, HIGH); // Pin HIGH (discharge capacitor)
delay(1); // Wait 1ms
pinMode(sensorIn, INPUT); // Make pin INPUT
digitalWrite(sensorIn, LOW); // Turn off internal pullups
while (digitalRead(sensorIn)) { // Wait for pin to go LOW
duration++;
}
return duration;
}
int isHighfR(int rctime) {
if (rctime < 40)
return 0;
else
return 1;
}
int isHighCR(int rctime) {
if (rctime < 35)
return 0;
else
return 1;
}
int isHighCL(int rctime) {
if (rctime < 25)
return 0;
else
return 1;
}
int isHighfL(int rctime) {
if (rctime < 20)
return 0;
else
return 1;
}
void loop() {
if (linefollowing == true && senselcd == false) {
pinMode(farLP, OUTPUT);
pinMode(centerLP, OUTPUT);
pinMode(centerRP, OUTPUT);
pinMode(farRP, OUTPUT);
digitalWrite(farLP, HIGH);
digitalWrite(centerLP, HIGH);
digitalWrite(centerRP, HIGH);
digitalWrite(farRP, HIGH);
delayMicroseconds(230); // allow capcitor charge in QTI
pinMode(farLP, INPUT);
pinMode(centerLP, INPUT);
pinMode(centerRP, INPUT);
pinMode(farRP, INPUT);
digitalWrite(farLP, LOW);
digitalWrite(centerLP, LOW);
digitalWrite(centerRP, LOW);
digitalWrite(farRP, LOW);
delayMicroseconds(230);
int pin4 = isHighfR(RCTime(farRP));
int pin1 = isHighCR(RCTime(centerRP));
int pin2 = isHighCL(RCTime(centerLP));
int pin3 = isHighfL(RCTime(farLP));
//Serial.println(RCTime(centerLP));
//Serial.println(isHighCR(RCTime(farRP)));
String s = String(pin3) + String(pin2) + String(pin1) + String(pin4);
int pins = s.toInt();
Serial.println(pins);
// Steering based on state of the four QTI sensors
int vL, vR;
switch (pins) // Compare pins to known line following states
{
case 1000:
vL = -200; // -100 to 100 indicate course correction values
vR = 200; // -100: full reverse; 0=stopped; 100=full forward
left = left + 1;
break;
case 1100:
vL = -200;
vR = 0;
left = left + 1;
break;
case 101:
vL = -200;
vR = -200;
left + 1;
right = right + 1;
case 1010:
vL = 200;
vR = 200;
case 100:
vL = -200;
vR = 200;
left = left + 1;
break;
case 110:
vL = 100;
vR = 100;
break;
case 10:
vL = 200;
vR = -200;
right = right + 1;
break;
case 11:
vL = 0;
vR = -200;
right = right + 1;
break;
case 1:
vL = 200;
vR = -200;
right = right + 1;
break;
case 1110:
vL = -200;
vR = 200;
left = left + 1;
break;
case 111:
vL = 200;
vR = -200;
right = right + 1;
break;
case 1111:
servoL.writeMicroseconds(1500); // Steer robot to recenter it over the line
servoR.writeMicroseconds(1500);
delay(250);
Serial.println(left);
Serial.println(right);
servoL.writeMicroseconds(1300);
servoR.writeMicroseconds(1700);
delay(300);
servoL.writeMicroseconds(1500);
servoR.writeMicroseconds(1500);
if (right > left) {
servoL.writeMicroseconds(1700);
delay(1915);
servoL.writeMicroseconds(1500);
}
else if (left > right) {
servoR.writeMicroseconds(1300);
delay(1915);
servoR.writeMicroseconds(1500);
}
servoL.writeMicroseconds(1700);
servoR.writeMicroseconds(1300);
delay(1000);
servoL.writeMicroseconds(1500);
servoR.writeMicroseconds(1500);
linefollowing = false;
senselcd = true;
break;
case 0000:
vL = 0;
vR = 0;
break;
}
servoL.writeMicroseconds(1500 + vL); // Steer robot to recenter it over the line
servoR.writeMicroseconds(1500 - vR);
// Delay for 50 milliseconds (1/20 second)
delay(50);
}
if (senselcd == true && linefollowing == false) {
readData();
}
}
// Reset ColorPAL; see ColorPAL documentation for sequence
void reset() {
delay(200);
pinMode(sio, OUTPUT);
digitalWrite(sio, LOW);
pinMode(sio, INPUT);
while (digitalRead(sio) != HIGH);
pinMode(sio, OUTPUT);
digitalWrite(sio, LOW);
delay(80);
pinMode(sio, INPUT);
delay(waitDelay);
}
void readData() {
char buffer[32];
if (serin.available() > 0) {
// Wait for a $ character, then read three 3 digit hex numbers
buffer[0] = serin.read();
if (buffer[0] == '$') {
for (int i = 0; i < 9; i++) {
while (serin.available() == 0); // Wait for next input character
buffer[i] = serin.read();
if (buffer[i] == '$') // Return early if $ character encountered
return;
}
parseAndPrint(buffer);
delay(50);
}
}
}
// Parse the hex data into integers
void parseAndPrint(char * data) {
sscanf (data, "%3x%3x%3x", &red, &grn, &blu);
char buffer[32];
Serial.println(red);
Serial.println(grn);
Serial.println(blu);
//if(counter==5){
if (red > 15 ) {
mySerial.write(12); // Clear
mySerial.write(17); // Turn backlight on
delay(5); // Required delay
mySerial.print("GOLD! Breathtaking swan dive!"); // First line
mySerial.write(13); // Form feed
delay(3000); // Wait 3 seconds
mySerial.write(18);
}
else if (blu > 15) {
mySerial.write(12); // Clear
mySerial.write(17); // Turn backlight on
delay(5); // Required delay
mySerial.print("SILVER-Incredible pencil dive!"); // First line
mySerial.write(13); // Form feed
delay(3000); // Wait 3 seconds
mySerial.write(18);
}
else if (red < 15 && blu < 15 && grn < 15) {
mySerial.write(12); // Clear
mySerial.write(17); // Turn backlight on
delay(5); // Required delay
mySerial.print("Bronze-Subpar cannonball..."); // First line
mySerial.write(13); // Form feed
delay(3000); // Wait 3 seconds
mySerial.write(18);
}
senselcd = false;
}
| [
"Jake@wl-10-190-44-102.wireless.duke.edu"
] | Jake@wl-10-190-44-102.wireless.duke.edu |
69da02eba1956e4d7c13c7a17da6ce6ba234716d | ab6be55b11215b205652518942da43570b3dbc0e | /trunk/server/gameserver/NetBase/SocketOutputStream.cpp | 8fab861f8b698a8d0404e1af8175d46c1e27e444 | [] | no_license | windgs/bumper_code | ef42ea99aa245aab34250bd5c59e26437748779c | 0ab6b686307694c4807ffccee02010aada8ea212 | refs/heads/master | 2022-05-26T23:25:43.389142 | 2019-05-19T02:34:00 | 2019-05-19T02:34:00 | 187,365,265 | 0 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 11,146 | cpp | ////////////////////////////////////////////////////////////////
//文件名称:SocketOutputStream.cpp
//功能描述:接收缓存
//版本说明:SocketOutputStream API
//
//编写作者:2017.08.15 yanfeng.hu
//
//修改情况:完成基本功能搭建 V1.0.0
//
////////////////////////////////////////////////////////////////
#include "../Common/Config.h"
#include "SocketOutputStream.h"
#include "../MsgHandler/NetMsg.h"
#include <string.h>
#include "Socket.h"
////////////////////////////////////////////////////////////////
//常量
////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
// func description : constructor
//
//-----input------
// Parameters
// sock : 套接字描述符
// BufferSize : buffer长度
// MaxBufferLen : buffer最大长度
//------output------
// Return
// 无
SocketOutputStream::SocketOutputStream(Socket* sock, UINT BufferSize /*= DEFAULTSOCKETOUTPUTBUFFERSIZE*/, UINT MaxBufferLen /*= DISCONNECTSOCKETOUTPUTSIZE*/)
{
ASSERT(sock);
m_pSocket = sock;
m_BufferLen = BufferSize;
m_MaxBufferLen = MaxBufferLen;
m_Head = 0;
m_Tail = 0;
m_Buffer = new CHAR[BufferSize];
memset(m_Buffer, 0, BufferSize);
}
//////////////////////////////////////////////////////////////////////
//
// func description : destructor
//
//-----input------
// Parameters
// 无
//------output------
// Return
// 无
SocketOutputStream::~SocketOutputStream()
{
SAFE_DELETE_ARRAY(m_Buffer);
}
//////////////////////////////////////////////////////////////////////
//
// func description : 获取BUFF的有效数据长度
//
//-----input------
// Parameters
// 无
//------output------
// Return
// BOOL : 成功:TRUE 失败:FALSE
UINT SocketOutputStream::Length() const
{
if (m_Head < m_Tail)
{
return m_Tail-m_Head;
}
else if (m_Head > m_Tail)
{
return m_BufferLen - m_Head + m_Tail;
}
return 0;
}
//////////////////////////////////////////////////////////////////////
//
// func description : InitSize
//
//-----input------
// Parameters
// 无
//------output------
// Return
// 无
VOID SocketOutputStream::InitSize()
{
SAFE_DELETE_ARRAY(m_Buffer);
m_Head = 0;
m_Tail = 0;
m_BufferLen = g_config.ONLINE_DEFAULT_OUTPUT_BUFFER_SIZE;
m_MaxBufferLen = g_config.ONLINE_DISCONNECT_OUTPUT_BUFFER_SIZE;
m_Buffer = new CHAR[g_config.ONLINE_DEFAULT_OUTPUT_BUFFER_SIZE];
memset(m_Buffer, 0, g_config.ONLINE_DEFAULT_OUTPUT_BUFFER_SIZE);
}
//////////////////////////////////////////////////////////////////////
//
// func description : Write:将数据写入用户buffer缓冲区。
//
//-----input------
// Parameters
// buf : 缓存区指针
// len : buf长度
//------output------
// Return
// UINT 成功: len 失败:0
UINT SocketOutputStream::Write(const CHAR* buf, UINT len)
{
DEBUG_TRY
CHECKF(buf);
CHECKF(len);
UINT unBeforeTail = m_Tail;
// //
// T H // H T LEN=10
// 0123456789 // 0123456789
// abcd...efg // ...abcd...
// //
//检查剩余空间
UINT nFree = ((m_Head <= m_Tail) ? (m_BufferLen - m_Tail + m_Head - 1) : (m_Head - m_Tail - 1));
if (len >= nFree)//剩余空间不足,重新分配下内存
{
if (!Resize(len - nFree + 1))
{
LOGERROR("[SocketOutputStream::Write] Resize() write_len=[%u] nFree=[%u] m_Head=[%u] m_Tail=[%u] m_BufferLen=[%u]", len, nFree, m_Head, m_Tail, m_BufferLen);
return 0;
}
}
//分配好后继续写数据
if (m_Head <= m_Tail)
{
//
//H T LEN=10
//0123456789
//abcd......
//
if(m_Head == 0)
{
nFree = m_BufferLen - m_Tail - 1;
memcpy(&m_Buffer[m_Tail], buf, len);
}
//
// H T LEN=10
//0123456789
//...abcd...
//
else //if(m_Head > 0)
{
nFree = m_BufferLen - m_Tail;
if (len <= nFree)
{
memcpy(&m_Buffer[m_Tail], buf, len);
}
else //(len > nFree)
{
memcpy(&m_Buffer[m_Tail], buf, nFree);
memcpy(m_Buffer, &buf[nFree], len - nFree);
}
}
}
else
{
//
// T H LEN=10
//0123456789
//efg...abcd
//
memcpy(&m_Buffer[m_Tail], buf, len);
}
m_Tail = (m_Tail + len) % m_BufferLen;
//LOGDEBUG("[SocketOutputStream::Write] Write SocketID=[%u] len=[%u] nFree=[%u] m_Head=[%u] m_Tail=[%u ===> %u] m_BufferLen=[%u] m_MaxBufferLen=[%u]", m_pSocket->getSocketID(), len, nFree, m_Head, unBeforeTail, m_Tail, m_BufferLen, m_MaxBufferLen);
return len;
DEBUG_CATCH0("SocketInputStream::Write")
}
//////////////////////////////////////////////////////////////////////
//
// func description : Flush:将用户发送缓冲区的数据发送到socket缓冲区
//
//-----input------
// Parameters
// 无
//------output------
// Return
// 无
INT SocketOutputStream::Flush()
{
CHECKF(m_pSocket);
INT nFlushed = 0;
INT nSent = 0;
INT nLeft = 0;
UINT unBeforeHead = m_Head;
DEBUG_TRY
if (m_BufferLen > m_MaxBufferLen)
{
InitSize();
LOGERROR("[SocketOutputStream::Flush] m_BufferLen > m_MaxBufferLen m_BufferLen=[%u] m_MaxBufferLen=[%u]", m_BufferLen, m_MaxBufferLen);
return -1;
}
#if defined(__WINDOWS__)
UINT flag = MSG_DONTROUTE;
#elif defined(__LINUX__)
UINT flag = MSG_NOSIGNAL;//禁止 send() 函数向系统发送常消息。
#endif
if (m_Head < m_Tail)
{
// //
// H T // H T LEN=10
// 0123456789 // 0123456789
// abcd...... // ...abcd...
// //
nLeft = m_Tail - m_Head;
while(nLeft > 0)
{
nSent = m_pSocket->send(&m_Buffer[m_Head], nLeft, flag);
if(nSent == -1)
{
if (errno == EAGAIN || errno == EINTR)
{
return SOCKET_ERROR_WOULDBLOCK;
}
return -2;
}
if(nSent == 0)
return 0;
nFlushed += nSent;
//m_Head += nSent;
m_Head = (m_Head + nSent) % m_BufferLen; //!alter by huyf 2018.03.09:谨慎做%处理
nLeft -= nSent;
}
}
else if (m_Head > m_Tail)
{
// //
// T H // T H LEN=10
// 0123456789 // 0123456789
// ....abcdef // defg...abc
//
nLeft = m_BufferLen - m_Head;
while(nLeft > 0)
{
nSent = m_pSocket->send(&m_Buffer[m_Head], nLeft, flag);
if(nSent == -1)
{
if (errno == EAGAIN || errno == EINTR)
{
return SOCKET_ERROR_WOULDBLOCK;
}
return -3;
}
if(nSent == 0)
return 0;
nFlushed += nSent;
//m_Head += nSent;
m_Head = (m_Head + nSent) % m_BufferLen; //!alter by huyf 2018.03.09:谨慎做%处理
nLeft -= nSent;
}
//!alter by huyf 2018.03.09:当全部发出去之后再进行前一段的数据发送
//设置头指针和剩余数据
m_Head = m_Head % m_BufferLen;
nLeft += m_Tail;
//继续发送剩余的数据
while(nLeft > 0)
{
nSent = m_pSocket->send(m_Buffer, nLeft, flag);
if(nSent == -1)
{
if (errno == EAGAIN || errno == EINTR)
{
return SOCKET_ERROR_WOULDBLOCK;
}
return -4;
}
if(nSent == 0)
return 0;
nFlushed += nSent;
//m_Head += nSent;
m_Head = (m_Head + nSent) % m_BufferLen; //!alter by huyf 2018.03.09:谨慎做%处理
nLeft -= nSent;
}
}
else//m_Head == m_Tail
{
LOGDEBUG("[SocketOutputStream::Flush] m_Head == m_Tail have no data to Flush m_Head=[%u] m_Tail=[%u] m_BufferLen=[%u]", m_Head, m_Tail, m_BufferLen);
}
//此时应该是头和尾指针指向相同的位置
if (m_Head != m_Tail)
{
LOGERROR("[SocketOutputStream::Flush] 数据没有全部被发送... m_Head != m_Tail m_Head=[%u ===> %u] m_Tail=[%u] nSent=[%u] nLeft=[%u] m_BufferLen=[%u]", unBeforeHead, m_Head, m_Tail, nSent, nLeft, m_BufferLen);
return nFlushed;
}
DEBUG_CATCH0("SocketOutputStream::Flush")
//{
// if( nSent>0 )
// {
// m_Head += nSent;
// }
//}
//if (m_pSocket->m_Port != g_config.MTS_PORT && m_pSocket->m_Port != g_config.ACC_PORT && m_pSocket->m_Port != g_config.PW_PORT)
{
/* code */
//LOGDEBUG("[SocketOutputStream::Flush] 数据全部被发送...Send Ip=[%s] Port=[%d] socket_id=[%u] nSent=[%u] m_Head=[%u ===> %u ===> 0] m_Tail=[%u ===> 0] m_BufferLen=[%u] m_MaxBufferLen=[%u]",m_pSocket->m_Host,m_pSocket->m_Port, m_pSocket->getSocketID(), nFlushed, unBeforeHead, m_Head, m_Tail, m_BufferLen, m_MaxBufferLen);
}
m_Head = m_Tail = 0;
return nFlushed;
}
//////////////////////////////////////////////////////////////////////
//
// func description : CleanUp
//
//-----input------
// Parameters
// 无
//------output------
// Return
// BOOL : 成功:TRUE 失败:FALSE
VOID SocketOutputStream::CleanUp()
{
m_Head = 0;
m_Tail = 0;
}
//////////////////////////////////////////////////////////////////////
//
// func description : Resize
//
//-----input------
// Parameters
// size : 增加的buff的长度
//------output------
// Return
// BOOL : 成功:TRUE 失败:FALSE
BOOL SocketOutputStream::Resize(UINT size)
{
//扩充一半的内存空间
size = max(size, (UINT)(m_BufferLen>>1));
UINT newBufferLen = m_BufferLen + size;
UINT len = Length();
if (size < 0)
{
if (newBufferLen < 0 || newBufferLen < len)
{
return FALSE;
}
}
//新申请buffer缓存空间
CHAR* newBuffer = new CHAR[newBufferLen];
CHECKF(newBuffer);
//复制内存数据
if (m_Head < m_Tail)
{
memcpy(newBuffer, &m_Buffer[m_Head], m_Tail - m_Head);
}
else if (m_Head > m_Tail)
{
memcpy(newBuffer, &m_Buffer[m_Head], m_BufferLen - m_Head);
memcpy(&newBuffer[m_BufferLen - m_Head], m_Buffer, m_Tail);
}
else//m_Head == m_Tail:无数据
{
//...
}
m_Head = 0;
m_Tail = len;
m_BufferLen = newBufferLen;
//释放原来buffer缓存
SAFE_DELETE_ARRAY(m_Buffer);
//将缓冲区指针重定向为新申请的内存空间
m_Buffer = newBuffer;
return TRUE;
}
| [
"398303171@qq.com"
] | 398303171@qq.com |
82f349731f94d5ab78c8b2d34d5cd8e22d58b1bc | c365d25ee2237b3c260198827b33b0253d43eaf4 | /uva/146.cpp | 1fffcf5cfccfac07e263f780dbf7f198c3743791 | [] | no_license | germanohn/competitive-programming | fb1249910ce951fe290e9a5be3876d3870ab8aa3 | fab9dc0e2998dd395c1b9d6639f8c187cf637669 | refs/heads/master | 2021-06-12T08:17:52.907705 | 2021-03-17T19:06:19 | 2021-03-17T19:06:19 | 58,595,999 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 453 | cpp | #include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define debug (args...) fprintf (stderr, args)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
string s;
int main () {
while (cin >> s && s[0] != '#') {
if (next_permutation (s.begin (), s.end ())) {
cout << s << "\n";
} else {
printf ("No Successor\n");
}
}
}
| [
"germanohn@hotmail.com"
] | germanohn@hotmail.com |
cbad592fa35eb967aa721cfffe38c7a75da0a508 | 9eb8913126c2b4a608ac2defa7108a46c15f828f | /FireflyEngine/include/Firefly/Core/EnumFlags.h | 7bcb3dd434c31f6b69a363c0b3eb260479f54fda | [
"MIT"
] | permissive | GitDaroth/FireflyEngine | 1b13e8b32f0f8062981efe17882a233d35b44fe5 | ea19a6a7f283e25eb989b2a499297e0834024c0b | refs/heads/master | 2023-06-27T19:11:31.901728 | 2021-07-18T11:53:01 | 2021-07-18T11:53:01 | 267,032,715 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,895 | h | #pragma once
#include <type_traits>
#include <bitset>
template<typename EnumT, typename = typename std::enable_if_t<std::is_enum<EnumT>::value>>
class EnumFlags
{
public:
constexpr EnumFlags() = default;
constexpr EnumFlags(EnumT value) : m_bitset(1 << static_cast<std::size_t>(value)) {}
constexpr EnumFlags(const EnumFlags& other) : m_bitset(other.m_bitset) {}
constexpr EnumFlags operator|(const EnumFlags& value) const { EnumFlags result = *this; result.m_bitset |= value.m_bitset; return result; };
constexpr EnumFlags operator&(const EnumFlags& value) const { EnumFlags result = *this; result.m_bitset &= value.m_bitset; return result; };
constexpr EnumFlags operator^(const EnumFlags& value) const { EnumFlags result = *this; result.m_bitset ^= value.m_bitset; return result; };
constexpr EnumFlags& operator|=(const EnumFlags& value) { m_bitset |= value.m_bitset; return *this; };
constexpr EnumFlags& operator&=(const EnumFlags& value) { m_bitset &= value.m_bitset; return *this; };
constexpr EnumFlags& operator^=(const EnumFlags& value) { m_bitset ^= value.m_bitset; return *this; };
constexpr EnumFlags operator!() const { EnumFlags result = *this; result.m_bitset.flip(); return result; }
constexpr operator bool() const { return m_bitset.any(); }
constexpr EnumFlags operator|(EnumT value) const { EnumFlags result = *this; result.m_bitset |= 1 << static_cast<std::size_t>(value); return result; }
constexpr EnumFlags operator&(EnumT value) const { EnumFlags result = *this; result.m_bitset &= 1 << static_cast<std::size_t>(value); return result; }
constexpr EnumFlags operator^(EnumT value) const { EnumFlags result = *this; result.m_bitset ^= 1 << static_cast<std::size_t>(value); return result; }
constexpr EnumFlags& operator|=(EnumT value) { m_bitset |= 1 << static_cast<std::size_t>(value); return *this; }
constexpr EnumFlags& operator&=(EnumT value) { m_bitset &= 1 << static_cast<std::size_t>(value); return *this; }
constexpr EnumFlags& operator^=(EnumT value) { m_bitset ^= 1 << static_cast<std::size_t>(value); return *this; }
private:
constexpr static int m_bitCount = std::numeric_limits<typename std::underlying_type<EnumT>::type>::digits;
std::bitset<m_bitCount> m_bitset;
};
template<typename EnumT, typename = typename std::enable_if_t<std::is_enum<EnumT>::value>::type>
constexpr EnumFlags<EnumT> operator|(EnumT left, EnumT right) { return EnumFlags<EnumT>(left) | right; }
template<typename EnumT, typename = typename std::enable_if_t<std::is_enum<EnumT>::value>::type>
constexpr EnumFlags<EnumT> operator&(EnumT left, EnumT right) { return EnumFlags<EnumT>(left) & right; }
template<typename EnumT, typename = typename std::enable_if_t<std::is_enum<EnumT>::value>::type>
constexpr EnumFlags<EnumT> operator^(EnumT left, EnumT right) { return EnumFlags<EnumT>(left) ^ right; } | [
"fabian.gulde@gmx.de"
] | fabian.gulde@gmx.de |
a3e0c616d6a4a5c5f2f26f36d3b263d906690a24 | ec4c772d5b393bc2fa5f447d29688e8ac2ef09b9 | /src/anims/SimpleVerticalAnim.cpp | dd6277b0014ed4bb6896f9881ea28a88bf410a65 | [] | no_license | martial/ModularShip | 212a7733a2357f12b032e4c32432d14446a88c50 | ac5b9f5f7dd74c824cc1aefd21d83a3883c188e4 | refs/heads/master | 2020-05-18T10:18:05.976569 | 2011-09-21T15:33:39 | 2011-09-21T15:33:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,310 | cpp | //
// SimpleVerticalAnim.cpp
// LightField
//
// Created by Martial Geoffre on 03/05/2011.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#include "SimpleVerticalAnim.h"
SimpleVerticalAnim::SimpleVerticalAnim () {
AbstractTubeAnimation::AbstractTubeAnimation();
}
void SimpleVerticalAnim::init(string name, vector<ofxTube*> * tubes) {
AbstractTubeAnimation::init(name, tubes);
}
void SimpleVerticalAnim::launch(vector<ofxTube*> * tubes) {
for ( int i = 0; i < (int)tubes->size(); i++ ) {
ofxTube * tube = tubes->at(i);
tube->changeSizePct(0, 0.0);
}
}
void SimpleVerticalAnim::onAnimationStart(ofxTubeEvent * args) {
AbstractTubeAnimation::onAnimationStart(args);
ofxTube * tube = tubes->at(args->id);
tube->changeSizePct(tube->globalSizePct, 1);
tube->setAllPixelAlpha(1.0, 0.0);
}
void SimpleVerticalAnim::onAnimationEnd(ofxTubeEvent * args) {
AbstractTubeAnimation::onAnimationEnd(args);
ofxTube * tube = tubes->at(args->id);
tube->changeSizePct(0, tube->nextTimeActive * decayTimePct * .5);
//tube->setAllPixelAlpha(1.0, 0.0);
}
void SimpleVerticalAnim::onAnimationLoopEvent(int & a) {
}
void SimpleVerticalAnim::update () {
AbstractTubeAnimation::update();
}
void SimpleVerticalAnim::quit () {
AbstractTubeAnimation::quit();
} | [
"martialou@gmail.com"
] | martialou@gmail.com |
76463963a136e08665c112e4e09f116d19df9a09 | dd80a584130ef1a0333429ba76c1cee0eb40df73 | /external/chromium_org/ppapi/shared_impl/ppapi_globals.h | 93ab2998e3476d04b6e0c372adb155c058cc56b8 | [
"MIT",
"BSD-3-Clause",
"LicenseRef-scancode-khronos"
] | permissive | karunmatharu/Android-4.4-Pay-by-Data | 466f4e169ede13c5835424c78e8c30ce58f885c1 | fcb778e92d4aad525ef7a995660580f948d40bc9 | refs/heads/master | 2021-03-24T13:33:01.721868 | 2017-02-18T17:48:49 | 2017-02-18T17:48:49 | 81,847,777 | 0 | 2 | MIT | 2020-03-09T00:02:12 | 2017-02-13T16:47:00 | null | UTF-8 | C++ | false | false | 5,535 | h | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_
#define PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_
#include <string>
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/threading/thread_local.h" // For testing purposes only.
#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_module.h"
#include "ppapi/c/ppb_console.h"
#include "ppapi/shared_impl/api_id.h"
#include "ppapi/shared_impl/ppapi_shared_export.h"
namespace base {
class MessageLoopProxy;
class TaskRunner;
}
namespace ppapi {
class CallbackTracker;
class MessageLoopShared;
class ResourceTracker;
class VarTracker;
namespace thunk {
class PPB_Instance_API;
class ResourceCreationAPI;
}
// Abstract base class
class PPAPI_SHARED_EXPORT PpapiGlobals {
public:
// Must be created on the main thread.
PpapiGlobals();
// This constructor is to be used only for making a PpapiGlobal for testing
// purposes. This avoids setting the global static ppapi_globals_. For unit
// tests that use this feature, the "test" PpapiGlobals should be constructed
// using this method. See SetPpapiGlobalsOnThreadForTest for more information.
struct PerThreadForTest {};
explicit PpapiGlobals(PerThreadForTest);
virtual ~PpapiGlobals();
// Getter for the global singleton.
static PpapiGlobals* Get();
// This allows us to set a given PpapiGlobals object as the PpapiGlobals for
// a given thread. After setting the PpapiGlobals for a thread, Get() will
// return that PpapiGlobals when Get() is called on that thread. Other threads
// are unaffected. This allows us to have tests which use >1 PpapiGlobals in
// the same process, e.g. for having 1 thread emulate the "host" and 1 thread
// emulate the "plugin".
//
// PpapiGlobals object must have been constructed using the "PerThreadForTest"
// parameter.
static void SetPpapiGlobalsOnThreadForTest(PpapiGlobals* ptr);
// Retrieves the corresponding tracker.
virtual ResourceTracker* GetResourceTracker() = 0;
virtual VarTracker* GetVarTracker() = 0;
virtual CallbackTracker* GetCallbackTrackerForInstance(
PP_Instance instance) = 0;
// Logs the given string to the JS console. If "source" is empty, the name of
// the current module will be used, if it can be determined.
virtual void LogWithSource(PP_Instance instance,
PP_LogLevel level,
const std::string& source,
const std::string& value) = 0;
// Like LogWithSource but broadcasts the log to all instances of the given
// module. The module may be 0 to specify that all consoles possibly
// associated with the calling code should be notified. This allows us to
// log errors for things like bad resource IDs where we may not have an
// associated instance.
//
// Note that in the plugin process, the module parameter is ignored since
// there is only one possible one.
virtual void BroadcastLogWithSource(PP_Module module,
PP_LogLevel level,
const std::string& source,
const std::string& value) = 0;
// Returns the given API object associated with the given instance, or NULL
// if the instance is invalid.
virtual thunk::PPB_Instance_API* GetInstanceAPI(PP_Instance instance) = 0;
virtual thunk::ResourceCreationAPI* GetResourceCreationAPI(
PP_Instance instance) = 0;
// Returns the PP_Module associated with the given PP_Instance, or 0 on
// failure.
virtual PP_Module GetModuleForInstance(PP_Instance instance) = 0;
// Returns the base::MessageLoopProxy for the main thread. This is set in the
// constructor, so PpapiGlobals must be created on the main thread.
base::MessageLoopProxy* GetMainThreadMessageLoop();
// In tests, the PpapiGlobals object persists across tests but the MLP pointer
// it hangs on will go stale and the next PPAPI test will crash because of
// thread checks. This resets the pointer to be the current MLP object.
void ResetMainThreadMessageLoopForTesting();
// Return the MessageLoopShared of the current thread, if any. This will
// always return NULL on the host side, where PPB_MessageLoop is not
// supported.
virtual MessageLoopShared* GetCurrentMessageLoop() = 0;
// Returns a task runner for file operations that may block.
// TODO(bbudge) Move this to PluginGlobals when we no longer support
// in-process plugins.
virtual base::TaskRunner* GetFileTaskRunner() = 0;
// Returns the command line for the process.
virtual std::string GetCmdLine() = 0;
// Preloads the font on Windows, does nothing on other platforms.
// TODO(brettw) remove this by passing the instance into the API so we don't
// have to have it on the globals.
virtual void PreCacheFontForFlash(const void* logfontw) = 0;
virtual bool IsHostGlobals() const;
virtual bool IsPluginGlobals() const;
private:
// Return the thread-local pointer which is used only for unit testing. It
// should always be NULL when running in production. It allows separate
// threads to have distinct "globals".
static PpapiGlobals* GetThreadLocalPointer();
scoped_refptr<base::MessageLoopProxy> main_loop_proxy_;
DISALLOW_COPY_AND_ASSIGN(PpapiGlobals);
};
} // namespace ppapi
#endif // PPAPI_SHARED_IMPL_PPAPI_GLOBALS_H_
| [
"karun.matharu@gmail.com"
] | karun.matharu@gmail.com |
e913d77f9daada73632fa545c8f42e1420bcffa1 | 72a2d8eb5028968ad90c3840c998a972ef5ffbdb | /test_refill.cpp | 6539e3d550a88e85a0834408114ff90fc593ce33 | [] | no_license | akh1lt/coffeemachine | 7b28d7e2616d8da4c0dcabda7e1707c549d3d3db | 51a227a32da4453b9642d09f46d80bfd1d07b2f2 | refs/heads/master | 2022-11-13T00:48:39.838327 | 2020-07-04T22:08:23 | 2020-07-04T22:08:23 | 277,191,917 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,780 | cpp | #include "coffee_machine.h"
/**
* Test for
* 1. Verifying the refill signal in case of missing ingredients.
* 2. Interface for the refill.
*/
int main() {
// initialize the machine
map<Ingredient, int> ingredient_slots;
ingredient_slots[WATER] = 30;
ingredient_slots[MILK] = 30;
ingredient_slots[SUGAR] = 30;
ingredient_slots[TEA_POWDER] = 30;
ingredient_slots[COFFEE_POWDER] = 30;
CoffeeMachine machine(1, 1, 1, 20, ingredient_slots);
// drink recipes
Drink tea("tea", HOT, WATER, 10);
tea.add_ingredient(SUGAR, 10);
tea.add_ingredient(TEA_POWDER, 10);
tea.add_ingredient(MILK, 10);
Drink coffee("coffee", HOT, WATER, 10);
coffee.add_ingredient(SUGAR, 10);
coffee.add_ingredient(COFFEE_POWDER, 10);
coffee.add_ingredient(MILK, 10);
Drink cold_coffee("cold coffee", COLD, WATER, 10);
cold_coffee.add_ingredient(SUGAR, 10);
cold_coffee.add_ingredient(COFFEE_POWDER, 10);
machine.add_drink(tea);
machine.add_drink(coffee);
machine.add_drink(cold_coffee);
// successful requests
machine.request_drink("tea");
machine.request_drink("coffee");
machine.request_drink("cold coffee");
this_thread::sleep_for(chrono::seconds(5));
// fails with a refill message
machine.request_drink("coffee");
this_thread::sleep_for(chrono::seconds(5));
machine.refill_ingredient(SUGAR);
// fails with a refill message
machine.request_drink("coffee");
this_thread::sleep_for(chrono::seconds(5));
machine.refill_ingredient(WATER);
// succeeds
this_thread::sleep_for(chrono::seconds(5));
machine.request_drink("coffee");
// wait for completion & turns off
this_thread::sleep_for(chrono::seconds(5));
machine.turn_off();
}
| [
"athatipamula@linkedin.com"
] | athatipamula@linkedin.com |
3c1bdba297671436f5580759446fd609f01abc7e | 8983dca670be7d84829caa01260ec7e0a74ae5bb | /content/alarm-clock/AlarmTone.h | 9f82cc0d56c93f7fda5124152d2a1c9af702dfb5 | [
"MIT",
"CC-BY-SA-4.0",
"CC-BY-SA-3.0"
] | permissive | LironHazan/good-arduino-code | b33a780b26ec2017c3e42daae7c087fb71c4584c | 3e3c7b374b1039b0890cffafa7f5639c33f60ea5 | refs/heads/master | 2022-12-26T14:28:09.952100 | 2020-09-21T19:40:13 | 2020-09-21T19:40:13 | 297,131,470 | 1 | 0 | MIT | 2020-09-20T17:48:53 | 2020-09-20T17:48:52 | null | UTF-8 | C++ | false | false | 411 | h | /**
Arduino Digital Alarm Clock
Copyright (C) 2020, Uri Shaked.
Released under the MIT License.
*/
#ifndef __ALARM_TONE_H__
#define __ALARM_TONE_H__
class AlarmTone {
public:
AlarmTone();
void begin(uint8_t pin);
void play();
void stop();
private:
uint8_t _pin;
bool _playing;
uint8_t _tone_index;
unsigned long _last_tone_time;
};
#endif /* __ALARM_TONE_H */
| [
"uri@urishaked.com"
] | uri@urishaked.com |
187ab2be79c316acb891c075d05fd7c1ad05def6 | e0452bf70df26d099678ff58dc3dbe307beb4a4c | /lib/psk31_decoder_impl.cc | 20c0d09c7fa0e2cd05db5e000756bfaf1d21c86f | [] | no_license | christophL/gr-digimodes | a58a9d49c00912c1ab563be4583a7846eea95a86 | 992e73b4e542488b91636efadaf4986b8854aeaf | refs/heads/master | 2016-09-08T09:22:01.369485 | 2014-02-06T10:42:07 | 2014-02-06T10:42:07 | 14,304,713 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,888 | cc | #include "psk31_decoder_impl.h"
#include <gnuradio/io_signature.h>
#define DEBUG 1
#define dout DEBUG && std::cout
using namespace gr::digimodes;
psk31_decoder_impl::psk31_decoder_impl()
: sync_block("psk31_decoder",
gr::io_signature::make(1, 1, sizeof(uint8_t)),
gr::io_signature::make(0,0,0)),
d_num_zeroes(0)
{
message_port_register_out(pmt::mp("out"));
fill_rev_varimap();
d_out_string.erase();
d_curr.erase();
}
void
psk31_decoder_impl::fill_rev_varimap(){
for(int i = 0; i < varicodes::varicode_num_entries; i++){
std::pair<std::string, char> to_insert(varicodes::varicode_vals[i], varicodes::varicode_keys[i]);
d_rev_varimap.insert(to_insert);
}
}
int
psk31_decoder_impl::work(int noutput,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items){
const unsigned char *in = static_cast<const unsigned char *>(input_items[0]);
int n_read = noutput;
for(int i = 0; i < n_read; i++){
unsigned char bit = in[i];
if(bit == 0) bit = 1;
else bit = 0;
if(bit == 0){
d_num_zeroes += 1;
if(d_num_zeroes == 2){
if(d_rev_varimap.count(d_curr) > 0){
dout << "decoder curr: " + d_curr << std::endl;
unsigned char c = d_rev_varimap[d_curr];
d_out_string += c;
dout << "decoder out_string: " + d_out_string << std::endl;
if(c == '\n'){
pmt::pmt_t payload = pmt::make_blob(d_out_string.data(), d_out_string.length());
message_port_pub(pmt::mp("out"), pmt::cons(pmt::PMT_NIL, payload));
dout << "decoder sent pdu" << std::endl;
d_out_string.erase();
}
}
d_num_zeroes = 0;
d_curr.erase();
}
} else {
if(d_num_zeroes == 1 && d_curr.length() != 0){
d_curr += "0";
}
d_curr += "1";
d_num_zeroes = 0;
}
}
return n_read;
}
psk31_decoder::sptr
psk31_decoder::make(){
return gnuradio::get_initial_sptr(new psk31_decoder_impl());
}
| [
"c.leitner@student.uibk.ac.at"
] | c.leitner@student.uibk.ac.at |
ce67a9de3e677ee24db583ba47cc5b9be0a7c16b | 605150f112444991732b850f1c61da52b3095d82 | /fifthLab/one.cpp | 8c7f063faea7ac792ea060d1aeaca20ba41e39a7 | [] | no_license | alexandder/cppProgramming | c323a92b1f37d53a415370e0a7add243c534a075 | d2b5fd1a4e7f54c8ee03bc9932b0433347c84712 | refs/heads/master | 2020-05-18T13:23:38.599326 | 2015-01-15T00:31:29 | 2015-01-15T00:31:29 | 29,272,750 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 329 | cpp | #include <iostream>
using namespace std;
void f1(char* s) {
cout << s << endl;
}
void f1(char* s, int n) {
static int f1ID = 1;
for (int i = 0; i < f1ID; ++i) {
cout << s << endl;
}
f1ID++;
}
int main(int argc, char const *argv[])
{
f1("dsa");
f1("aaa", 2);
f1("zxcz", 0);
f1("xcz");
f1("zxcz", 0);
return 0;
} | [
"aleksanderbolt@yahoo.com"
] | aleksanderbolt@yahoo.com |
59440109c8a86a639800070ecd5f31692042792c | 35f1a2b751819d0e5741a87121cfdf2aae3e646b | /study/study/14503.cpp | 251b0cd0b6e036a7ac2f98f2bbf006d6df606c37 | [] | no_license | namhyo01/ForStudy | b15ec2dc8b3e659509b93604b4468fbd7460bed8 | fa7b8f6279a02f1ed261a209fefccc96a4ef4752 | refs/heads/master | 2022-03-20T15:38:47.140018 | 2022-03-09T12:41:05 | 2022-03-09T12:41:05 | 250,731,941 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,594 | cpp | //#include <bits/stdc++.h>
//
//using namespace std;
//int n, m;
//int r, c, d;
//int room[51][51];
//bool visited[51][51];
//int cnt = 1;
//int dx[] = { -1 ,0,1,0 };
//int dy[] = { 0 ,1,0,-1 };
//int td;
//
//int direction() {
// if (d == 0)
// return 3;
// else if (d == 1)
// return 0;
// else if (d == 2)
// return 1;
// else
// return 2;
//}
//int back_direction() {
// if (td == 0)
// return 2;
// if (td == 1)
// return 3;
// if (td == 2)
// return 0;
// return 1;
//}
//int count_wall = 0;
//
//int go() {
// int temp = direction();
// int rx = r + dx[temp];
// int ry = c + dy[temp];
//
// if (rx >= 0 && ry >= 0 && rx < n&&ry < m) {
// //2.1
// if (!visited[rx][ry] && room[rx][ry] == 0) {
// visited[rx][ry] = true;
// r = rx;
// c = ry;
// d = temp;
// td = temp;
// cnt++;
// count_wall = 0;
// return 1;
// }
// if (room[rx][ry] == 1 || visited[rx][ry]) {
// d = temp;
// count_wall++;
//
// }
// if (count_wall == 4) {
// rx
// //if (dx[back_dir] + r >= 0 && dy[back_dir] + c >= 0 && dx[back_dir] + r < n&&dy[back_dir] + c < m) {
// if (r-room[dx[td]][c - dy[td]] == 1)
// return -1;
// r -= dx[td];
// c -= dy[td];
// count_wall = 0;
// return 1;
//
//
// }
// return 1;
// }
// else {
// return -1;
// }
//}
//int main() {
// ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// cin >> n >> m;
// cin >> r >> c >> d;
//
//
// for (int i = 0; i < n; i++) {
// for (int j = 0; j < m; j++) {
// cin >> room[i][j];
// }
// }
// td = d;
// while (go() != -1);
// cout << cnt << endl;
//
// system("pause");
// return 0;
//} | [
"namhyo01@naver.com"
] | namhyo01@naver.com |
05d0653b662ab60433479f9a3fda496603d2e65b | 8734d01e8d468bd6543fec812b58e171fd65deab | /heekscad/interface/HeeksObj.h | 391339e0d60e179aa4a19123cd6ba74fcc649fe6 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | JohnyEngine/CNC | 97d8fa9bb2d4e3b76a577cfd35d0c1dbbd46214c | e4c77250ab2b749d3014022cbb5eb9924e939993 | refs/heads/master | 2020-12-25T16:49:01.672871 | 2016-11-10T19:33:19 | 2016-11-10T19:33:19 | 32,200,805 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 8,254 | h | // HeeksObj.h
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include "Box.h"
#include "wx/dc.h"
#include <list>
class HeeksColor;
class Property;
class Tool;
class MarkedObject;
class TiXmlNode;
class TiXmlElement;
class GripData;
class TopoDS_Shape;
#define m_owner m_owner
// NOTE: If adding to this enumeration, please also add the verbose description to the HeeksCADType() routine
enum{
UnknownType,
DocumentType,
GripperType,
PointType,
LineType,
ArcType,
ILineType,
CircleType,
SketchType,
AreaType,
VertexType,
EdgeType,
FaceType,
LoopType,
SolidType,
StlSolidType,
WireType,
CoordinateSystemType,
TextType,
DimensionType,
RulerType,
EllipseType,
SplineType,
GroupType,
CorrelationToolType,
AngularDimensionType,
OrientationModifierType,
HoleType,
HolePositionsType,
GearType,
ImageType,
XmlType,
InsertType, // just temporarily during dxf import
ObjectMaximumType,
};
#define MARKING_FILTER_LINE 0x00000001
#define MARKING_FILTER_ARC 0x00000002
#define MARKING_FILTER_ILINE 0x00000004
#define MARKING_FILTER_CIRCLE 0x00000008
#define MARKING_FILTER_POINT 0x00000010
#define MARKING_FILTER_SOLID 0x00000020
#define MARKING_FILTER_STL_SOLID 0x00000040
#define MARKING_FILTER_WIRE 0x00000080
#define MARKING_FILTER_FACE 0x00000100
#define MARKING_FILTER_EDGE 0x00000200
#define MARKING_FILTER_SKETCH 0x00000400
#define MARKING_FILTER_IMAGE 0x00000800
#define MARKING_FILTER_COORDINATE_SYSTEM 0x00000800
#define MARKING_FILTER_TEXT 0x00001000
#define MARKING_FILTER_DIMENSION 0x00002000
#define MARKING_FILTER_RULER 0x00004000
#define MARKING_FILTER_LOOP 0x00008000
#define MARKING_FILTER_VERTEX 0x00010000
#define MARKING_FILTER_PAD 0x00020000
#define MARKING_FILTER_PART 0x00040000
#define MARKING_FILTER_POCKETSOLID 0x00080000
#define MARKING_FILTER_GEAR 0x00100000
#define MARKING_FILTER_AREA 0x00200000
#define MARKING_FILTER_UNKNOWN 0x00400000
#define MARKING_FILTER_SKETCH_GROUP (MARKING_FILTER_SKETCH | MARKING_FILTER_AREA | MARKING_FILTER_CIRCLE)
#define MARKING_FILTER_SOLIDS_GROUP (MARKING_FILTER_SOLID | MARKING_FILTER_STL_SOLID)
#ifdef HEEKSCAD
#define GET_ICON(X,Y) x = (X); y = (Y); texture_number = wxGetApp().m_icon_texture_number
#else
#define GET_ICON(X,Y) x = (X); y = (Y); texture_number = theApp.m_icon_texture_number
#endif
class HeeksObj{
public:
HeeksObj* m_owner;
bool m_skip_for_undo;
unsigned int m_id;
unsigned int m_layer;
bool m_visible;
bool m_preserving_id;
unsigned int m_index;
HeeksObj(void);
HeeksObj(const HeeksObj& ho);
virtual ~HeeksObj();
virtual const HeeksObj& operator=(const HeeksObj &ho);
// virtual functions
virtual int GetType()const{return UnknownType;}
virtual long GetMarkingMask()const{return MARKING_FILTER_UNKNOWN;}
virtual int GetIDGroupType()const{return GetType();}
virtual void glCommands(bool select, bool marked, bool no_color){};
virtual void Draw(wxDC& dc){} // for printing
virtual bool DrawAfterOthers(){return false;}
virtual void GetBox(CBox &box){}
virtual const wxChar* GetShortString(void)const{return NULL;}
virtual const wxChar* GetTypeString(void)const{return _("Unknown");}
const wxChar* GetShortStringOrTypeString(void)const{if(GetShortString())return GetShortString();return GetTypeString();}
virtual bool CanEditString(void)const{return false;}
virtual void OnEditString(const wxChar* str){}
virtual void KillGLLists(void){};
virtual HeeksObj *MakeACopy()const = 0;
virtual HeeksObj *MakeACopyWithID();
virtual void Clear(){}
virtual void ReloadPointers(){}
virtual void Disconnect(std::list<HeeksObj*>parents){}
virtual void CopyFrom(const HeeksObj* object){}
virtual void SetColor(const HeeksColor &col){}
virtual const HeeksColor* GetColor()const{return NULL;}
virtual void ModifyByMatrix(const double *m){} // transform the object
virtual bool GetStartPoint(double* pos){return false;}
virtual bool GetEndPoint(double* pos){return false;}
virtual bool GetCentrePoint(double* pos){return false;}
virtual int GetCentrePoints(double* pos, double* pos2){if(GetCentrePoint(pos))return 1; return 0;}
virtual bool GetMidPoint(double* pos){return false;}
virtual bool GetScaleAboutMatrix(double *m);
virtual void GetProperties(std::list<Property *> *list); // use GetDialog instead of this, if you have time to code one.
virtual void GetOnEdit(bool(**callback)(HeeksObj*)){} // returns a function for doing edit with a dialog
bool Edit(){bool(*fn)(HeeksObj*) = NULL;GetOnEdit(&fn);if(fn){if((*fn)(this)){WriteDefaultValues();return true;}}return false;} // do edit with a dialog
virtual void OnApplyProperties(){}
virtual bool ValidateProperties(){return true;}
virtual const wxBitmap &GetIcon();
virtual int Intersects(const HeeksObj *object, std::list< double > *rl)const{return 0;}
virtual bool FindNearPoint(const double* ray_start, const double* ray_direction, double *point){return false;}
virtual bool FindPossTangentPoint(const double* ray_start, const double* ray_direction, double *point){return false;}
virtual void GetTools(std::list<Tool*>* t_list, const wxPoint* p){}
virtual void GetGripperPositionsTransformed(std::list<GripData> *list, bool just_for_endof);
virtual bool Stretch(const double *p, const double* shift, void* data){return false;} // return true, if undo stretch is done with Add and Delete
virtual bool StretchTemporary(const double *p, const double* shift, void* data){Stretch(p, shift, data); return true;} // returns true, because Stretch was done. If not done, then override and return false;
virtual void SetClickMarkPoint(MarkedObject* marked_object, const double* ray_start, const double* ray_direction){}
virtual bool CanAdd(HeeksObj* object){return false;}
virtual bool CanAddTo(HeeksObj* owner){return true;}
virtual HeeksObj* PreferredPasteTarget(){return NULL;}
virtual bool DescendForUndo(){return true;}
virtual bool GetSkipForUndo(){return m_skip_for_undo;}
virtual void SetSkipForUndo(bool val){m_skip_for_undo = val;}
virtual bool OneOfAKind(){return false;} // if true, then, instead of pasting, find the first object of the same type and copy object to it.
virtual bool Add(HeeksObj* object, HeeksObj* prev_object);
virtual bool IsDifferent(HeeksObj* other){return false;}
virtual void Remove(HeeksObj* object){object->OnRemove();}
virtual void OnAdd(){}
virtual void OnRemove();
virtual bool CanBeRemoved(){return true;}
virtual bool CanBeDragged(){return true;}
virtual bool CanBeCopied(){return true;}
virtual HeeksObj* GetFirstChild(){return NULL;}
virtual HeeksObj* GetNextChild(){return NULL;}
virtual HeeksObj* GetAtIndex(int index){return NULL;}
virtual int GetNumChildren(){return 0;}
virtual std::list<HeeksObj *> GetChildren() const { std::list<HeeksObj *> empty; return(empty); }
virtual bool AutoExpand(){return false;}
virtual void GetTriangles(void(*callbackfunc)(const double* x, const double* n), double cusp, bool just_one_average_normal = true){} // [nine doubles, three doubles], or [nine doubles, nine doubles] if just_one_average_normal = false
virtual double Area()const{return 0.0;}
virtual void GetSegments(void(*callbackfunc)(const double *p), double pixels_per_mm, bool want_start_point = true)const{};
virtual void WriteXML(TiXmlNode *root){}
virtual void WriteBaseXML(TiXmlElement *element);
virtual void ReadBaseXML(TiXmlElement* element);
void SetID(int id);
virtual unsigned int GetID(){return m_id;}
virtual bool UsesID(){return true;}
bool OnVisibleLayer();
virtual const TopoDS_Shape *GetShape() { return(NULL); }
virtual bool IsList(){return false;}
virtual HeeksObj *Find( const int type, const unsigned int id );
virtual void SetIdPreservation(const bool flag) { m_preserving_id = flag; }
virtual void ToString(char* buf, unsigned int* rlen, unsigned int len);
virtual unsigned int GetIndex();
virtual bool UsesCustomSubNames(){return false;}
protected:
virtual void GetGripperPositions(std::list<GripData> *list, bool just_for_endof);
public:
virtual void OnChangeViewUnits(const double units){}
virtual void WriteDefaultValues(){}
virtual void ReadDefaultValues(){}
};
| [
"johny.engine@gmail.com"
] | johny.engine@gmail.com |
de79eba3d169f73012f15335151a9b73ed77d15e | 271ddb3fc058138f8267b5b9907118738081645e | /MonoInjector/MonoInjector.cpp | 907bff96baa5a3d8b0ed73a1ea9b195e5be6d008 | [
"MIT"
] | permissive | ExpLife0011/MonoInjector | 415e81af231b3fa18921042dd91def4576db4122 | bc7680a2ec8be606f5fdc8614c0c991a1d074382 | refs/heads/master | 2020-03-27T06:53:07.431961 | 2017-08-03T07:09:23 | 2017-08-03T07:09:23 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,419 | cpp | #include <iostream>
#include "tools.h"
#include "Injector.h"
#include "args/args.hxx"
int main(int argc, char* argv[])
{
args::ArgumentParser parser{"Mono Assembly Injector V1.0", "https://github.com/Michidu/MonoInjector"};
args::HelpFlag help{parser, "help", "Display help menu", {'h', "help"}};
args::Group group{parser, "Required arguments:", args::Group::Validators::All};
args::ValueFlag<std::string> process_name_value{group, "target", "Target process name", {'t', "target"}};
args::ValueFlag<std::string> dll_name_value{group, "dll", "DLL file name", {'d', "dll"}};
args::ValueFlag<std::string> name_space_value{group, "namespace", "Namespace of the Init class", {'n', "namespace"}};
args::ValueFlag<std::string> class_name_value{group, "class", "Init class", {'c', "class"}};
args::ValueFlag<std::string> method_name_value{group, "method", "Init method", {'m', "method"}};
args::Flag unlink(parser, "unlink", "Unlink assembly (Experimental)", {"unlink"});
try
{
parser.ParseCLI(argc, argv);
}
catch (const args::Help&)
{
std::cout << parser;
return 0;
}
catch (const args::ParseError& e)
{
std::cerr << e.what() << std::endl;
std::cerr << parser;
return -1;
}
catch (const args::ValidationError& e)
{
std::cerr << e.what() << std::endl;
std::cerr << parser;
return -1;
}
std::wcout << "Mono Assembly Injector V1.0" << std::endl << std::endl;
std::wstring process_name = blackbone::Utils::AnsiToWstring(args::get(process_name_value));
std::string dll_name = args::get(dll_name_value);
std::string name_space = args::get(name_space_value);
std::string class_name = args::get(class_name_value);
std::string method_name = args::get(method_name_value);
if (!MonoInjector::tools::IsFileExists(dll_name))
{
std::cout << "File " << dll_name.c_str() << " does not exist" << std::endl;
return -1;
}
DWORD pid = MonoInjector::tools::GetProcessPid(process_name);
if (pid == 0)
{
std::wcout << "Could not find " << process_name.c_str() << std::endl;
return -1;
}
MonoInjector::Injector injector;
MonoInjector::AssemblyInfo assembly_info{dll_name, name_space, class_name, method_name, unlink};
bool result = injector.InjectDll(pid, assembly_info);
if (!result)
{
std::wcout << "Failed to inject dll" << std::endl;
return -1;
}
std::wcout << std::endl << "Successfully injected dll!" << std::endl << std::endl;
system("pause");
return 0;
}
| [
"michido@protonmail.com"
] | michido@protonmail.com |
cfd90c60636770ec9485585aa61cb3a6effd7e8f | fcdfe976c9ed60b18def889692a17dc18a8dd6d7 | /opencv/cpp/ros_rs_segm.cpp | fbfc6591044e8e2648a1dd335ab10015c7bd5f17 | [] | no_license | akihikoy/ay_test | 4907470889c9bda11cdc84e8231ef3156fda8bd7 | a24dfb720960bfedb94be3b4d147e37616e7f39a | refs/heads/master | 2023-09-02T19:24:47.832392 | 2023-08-27T06:45:20 | 2023-08-27T06:45:20 | 181,903,332 | 6 | 3 | null | null | null | null | UTF-8 | C++ | false | false | 10,790 | cpp | //-------------------------------------------------------------------------------------------
/*! \file ros_rs_segm.cpp
\brief Apply contour detection to an edge feature and filter with normal angle.
\author Akihiko Yamaguchi, info@akihikoy.net
\version 0.1
\date Nov.01, 2022
$ g++ -O2 -g -W -Wall -o ros_rs_segm.out ros_rs_segm.cpp -I/opt/ros/$ROS_DISTR/include -pthread -llog4cxx -lpthread -L/opt/ros/$ROS_DISTR/lib -rdynamic -lroscpp -lrosconsole -lroscpp_serialization -lrostime -lcv_bridge -lopencv_highgui -lopencv_imgproc -lopencv_core -lopencv_videoio -Wl,-rpath,/opt/ros/$ROS_DISTR/lib
*/
//-------------------------------------------------------------------------------------------
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <iostream>
#include <unistd.h>
#include "cap_open.h"
#define LIBRARY
#include "cv2-edge_cmp.cpp"
#include "ros_proj_mat.cpp"
#include "ros_rs_normal.cpp"
#include "ros_capture2.cpp"
#include "float_trackbar.cpp"
#include "cv2-print_elem.cpp"
//-------------------------------------------------------------------------------------------
bool mouse_event_detected(false);
int x_mouse(0), y_mouse(0);
std::string win_mouse("");
void setMouseCallback(const std::string &winname, cv::MouseCallback onMouse, const char *userdata)
{
cv::setMouseCallback(winname, onMouse, const_cast<char*>(userdata));
}
static void onMouse(int event, int x, int y, int /*flags*/, void* param)
{
if(event == CV_EVENT_LBUTTONDOWN)
{
mouse_event_detected= true;
x_mouse= x; y_mouse= y;
win_mouse= std::string(reinterpret_cast<const char*>(param));
}
}
void ProcMouseEvent(const std::string &win, const cv::Mat &m)
{
if(mouse_event_detected && win_mouse==win)
{
std::cout<<win<<": clicked: ("<<x_mouse<<","<<y_mouse<<"): value= "<<GetPixelVal(m,x_mouse,y_mouse)<<std::endl;
mouse_event_detected= false;
}
}
//-------------------------------------------------------------------------------------------
double depth_scale(0.3);
cv::Mat proj_mat;
double canny_threshold1=770.0;
double canny_threshold2=780.0;
int canny_ksize=5;
int canny_blur_size=3;
double canny_blur_std=1.5;
int laplacian_ksize=3;
double laplacian_scale=4.0;
double laplacian_delta=0.0;
int laplacian_blur_size=3;
double laplacian_blur_std=1.5;
int sobel_ksize=3;
double sobel_scale=3.8;
double sobel_delta=0.0;
int sobel_blur_size=3;
double sobel_blur_std=1.5;
int edge_kind(2); //0:canny,1:laplacian,2:sobel
int edge_threshold(100);
int wsize(5);
int cd2ntype(cd2ntSimple);
float resize_ratio(0.5);
float beta_min(0.001), beta_max(0.25);
double dim_image=0.5;
double dim_edge_bin=0.3;
double dim_fbeta=0.3;
double dim_and= 0.7;
bool quit_at_cap_err(false);
void CVCallback(const cv::Mat &frame_depth, const cv::Mat &frame_rgb)
{
if(frame_depth.empty() || frame_rgb.empty())
{
if(quit_at_cap_err) FinishLoop();
return;
}
cv::Mat canny, laplacian, sobel;
canny= GetCanny(frame_rgb,
canny_threshold1, canny_threshold2, canny_ksize,
canny_blur_size, canny_blur_std,
/*is_depth=*/false);
laplacian= GetLaplacian(frame_rgb,
laplacian_ksize, laplacian_scale, laplacian_delta,
laplacian_blur_size, laplacian_blur_std,
/*is_depth=*/false);
sobel= GetSobel(frame_rgb,
sobel_ksize, sobel_scale, sobel_delta,
sobel_blur_size, sobel_blur_std,
/*is_depth=*/false);
cv::Mat edge_binary;
if (edge_kind==0)
cv::threshold(canny,edge_binary,edge_threshold,255,cv::THRESH_BINARY);
else if(edge_kind==1)
cv::threshold(laplacian,edge_binary,edge_threshold,255,cv::THRESH_BINARY);
else if(edge_kind==2)
{
cv::Mat gray;
cv::cvtColor(sobel, gray, CV_BGR2GRAY);
cv::threshold(gray,edge_binary,edge_threshold,255,cv::THRESH_BINARY);
}
cv::Mat normal_img, cloud_img;
DepthImgToNormalImg(
frame_depth, proj_mat,
normal_img, cloud_img, wsize, resize_ratio, /*type=*/TCD2NType(cd2ntype)); // cd2ntSimple,cd2ntRobust
cv::Mat alpha_beta_img;
PolarizeNormalImg(normal_img, alpha_beta_img);
cv::Mat filtered_beta;
cv::inRange(alpha_beta_img, cv::Scalar(-1.f,beta_min,-1.f), cv::Scalar(1.f,beta_max,1.f), filtered_beta);
cv::Mat edge_binary_and_normal_beta;
cv::bitwise_and(edge_binary,filtered_beta, edge_binary_and_normal_beta);
std::vector<std::vector<cv::Point> > contours;
cv::findContours(edge_binary_and_normal_beta, contours, /*CV_RETR_EXTERNAL*/CV_RETR_LIST, CV_CHAIN_APPROX_SIMPLE);
cv::Mat edge_contour,edge_bin_col;
edge_contour= dim_image*frame_rgb;
cv::Mat edge_bin_col_decom[3]= {dim_edge_bin*edge_binary,dim_fbeta*filtered_beta,dim_and*edge_binary_and_normal_beta};
cv::merge(edge_bin_col_decom,3,edge_bin_col);
edge_contour+= edge_bin_col;
for(int ic(0),ic_end(contours.size()); ic<ic_end; ++ic)
cv::drawContours(edge_contour, contours, ic, CV_RGB(255,0,255), /*thickness=*/1, /*linetype=*/8);
cv::Mat img_depth_disp(frame_depth*depth_scale);
img_depth_disp.convertTo(img_depth_disp, CV_8U);
cv::cvtColor(img_depth_disp, img_depth_disp, CV_GRAY2BGR);
cv::imshow("input_depth", img_depth_disp);
ProcMouseEvent("input_depth", frame_depth);
cv::imshow("input_rgb", frame_rgb);
ProcMouseEvent("input_rgb", frame_rgb);
cv::imshow("canny", canny);
ProcMouseEvent("canny", canny);
cv::imshow("laplacian", laplacian);
ProcMouseEvent("laplacian", laplacian);
cv::imshow("sobel", sobel);
ProcMouseEvent("sobel", sobel);
cv::imshow("edge_binary", edge_binary);
ProcMouseEvent("edge_binary", edge_binary);
cv::imshow("normal", normal_img);
ProcMouseEvent("normal", normal_img);
cv::imshow("alpha_beta", alpha_beta_img);
ProcMouseEvent("alpha_beta", alpha_beta_img);
cv::imshow("filtered_beta", filtered_beta);
ProcMouseEvent("filtered_beta", filtered_beta);
cv::imshow("edge_contour", edge_contour);
ProcMouseEvent("edge_contour", edge_contour);
char c(cv::waitKey(1));
if(c=='\x1b'||c=='q') FinishLoop();
}
//-------------------------------------------------------------------------------------------
int main(int argc, char**argv)
{
std::string img1_topic("/camera/aligned_depth_to_color/image_raw");
std::string img2_topic("/camera/color/image_raw");
if(argc>1) img1_topic= argv[1];
if(argc>2) img2_topic= argv[2];
ros::init(argc, argv, "ros_rs_edge_cmp");
ros::NodeHandle node("~");
std::string encoding1= GetImageEncoding(img1_topic, node, /*convert_cv=*/true);
std::string encoding2= GetImageEncoding(img2_topic, node, /*convert_cv=*/true);
if(encoding1!="16UC1")
{
std::cerr<<"WARNING: We assume img1 as a depth image topic, but is "<<encoding1<<std::endl;
}
// cv::Mat proj_mat;
std::string img_info_topic(img1_topic), frame_id, ltopic("image_raw");
img_info_topic.replace(img_info_topic.find(ltopic),ltopic.length(),"camera_info");
GetCameraProjectionMatrix(img_info_topic, frame_id, proj_mat);
cv::namedWindow("input_depth",1);
setMouseCallback("input_depth", onMouse, "input_depth");
cv::namedWindow("input_rgb",1);
setMouseCallback("input_rgb", onMouse, "input_rgb");
cv::namedWindow("canny",1);
setMouseCallback("canny", onMouse, "canny");
CreateTrackbar<double>("threshold1", "canny", &canny_threshold1, 0.0, 1000.0, 0.1, &TrackbarPrintOnTrack);
CreateTrackbar<double>("threshold2", "canny", &canny_threshold2, 0.0, 1000.0, 0.1, &TrackbarPrintOnTrack);
CreateTrackbar<int> ("ksize", "canny", &canny_ksize, 3, 7, 2, &TrackbarPrintOnTrack);
CreateTrackbar<int> ("blur_size", "canny", &canny_blur_size, 1, 25, 2, &TrackbarPrintOnTrack);
CreateTrackbar<double>("blur_std", "canny", &canny_blur_std, 0.01, 10.0, 0.01, &TrackbarPrintOnTrack);
cv::namedWindow("laplacian",1);
setMouseCallback("laplacian", onMouse, "laplacian");
CreateTrackbar<int> ("ksize", "laplacian", &laplacian_ksize, 3, 25, 2, &TrackbarPrintOnTrack);
CreateTrackbar<double>("scale", "laplacian", &laplacian_scale, 0.0, 50.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<double>("delta", "laplacian", &laplacian_delta, -255.0, 255.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<int> ("blur_size","laplacian", &laplacian_blur_size, 1, 25, 2, &TrackbarPrintOnTrack);
CreateTrackbar<double>("blur_std", "laplacian", &laplacian_blur_std, 0.01, 10.0, 0.01, &TrackbarPrintOnTrack);
cv::namedWindow("sobel",1);
setMouseCallback("sobel", onMouse, "sobel");
CreateTrackbar<int> ("ksize", "sobel", &sobel_ksize, 3, 25, 2, &TrackbarPrintOnTrack);
CreateTrackbar<double>("scale", "sobel", &sobel_scale, 0.0, 50.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<double>("delta", "sobel", &sobel_delta, -255.0, 255.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<int> ("blur_size","sobel", &sobel_blur_size, 1, 25, 2, &TrackbarPrintOnTrack);
CreateTrackbar<double>("blur_std", "sobel", &sobel_blur_std, 0.01, 10.0, 0.01, &TrackbarPrintOnTrack);
cv::namedWindow("edge_binary",1);
setMouseCallback("edge_binary", onMouse, "edge_binary");
CreateTrackbar<int> ("edge_kind", "edge_binary", &edge_kind, 0, 2, 1, &TrackbarPrintOnTrack);
CreateTrackbar<int> ("edge_threshold", "edge_binary", &edge_threshold, 0, 255, 1, &TrackbarPrintOnTrack);
cv::namedWindow("normal",1);
setMouseCallback("normal", onMouse, "normal");
CreateTrackbar<int>("wsize", "normal", &wsize, 1, 15, 2, &TrackbarPrintOnTrack);
CreateTrackbar<int>("cd2ntype", "normal", &cd2ntype, 0, 1, 1, &TrackbarPrintOnTrack);
CreateTrackbar<float>("resize_ratio", "normal", &resize_ratio, 0.0f, 1.0f, 0.01f, &TrackbarPrintOnTrack);
cv::namedWindow("alpha_beta",1);
setMouseCallback("alpha_beta", onMouse, "alpha_beta");
cv::namedWindow("filtered_beta",1);
setMouseCallback("filtered_beta", onMouse, "filtered_beta");
CreateTrackbar<float>("beta_min", "filtered_beta", &beta_min, -1.0f, 1.0f, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<float>("beta_max", "filtered_beta", &beta_max, -1.0f, 1.0f, 0.01, &TrackbarPrintOnTrack);
cv::namedWindow("edge_contour",1);
setMouseCallback("edge_contour", onMouse, "edge_contour");
CreateTrackbar<double>("dim_image", "edge_contour", &dim_image, 0.0, 1.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<double>("dim_edge_bin", "edge_contour", &dim_edge_bin, 0.0, 1.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<double>("dim_fbeta", "edge_contour", &dim_fbeta, 0.0, 1.0, 0.01, &TrackbarPrintOnTrack);
CreateTrackbar<double>("dim_and", "edge_contour", &dim_and, 0.0, 1.0, 0.01, &TrackbarPrintOnTrack);
StartLoop(argc, argv, img1_topic, img2_topic, encoding1, encoding2, CVCallback, /*node_name=*/"");
return 0;
}
//-------------------------------------------------------------------------------------------
| [
"info@akihikoy.net"
] | info@akihikoy.net |
fa4622b8e699d68a232a21f79d55e321cde300db | c30a23e3f670567baeb6052eaa9d5618f6ddd94d | /src/entities/CTaskWorm.cpp | bfdb062c63d312248027d4f676678cd8fbfc522a | [
"WTFPL"
] | permissive | nizikawa-worms/wkWormOrder | e3810f6a5be4521ce0899d656344727386a28db0 | c5d13e5adaecbc69039787aded7ec38cf56ef46e | refs/heads/master | 2023-08-17T09:11:17.977301 | 2021-10-02T19:38:27 | 2021-10-02T19:38:27 | 402,715,335 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,489 | cpp | #include "CTaskWorm.h"
#include "../Hooks.h"
#include "../BitmapTextbox.h"
#include "CTaskTeam.h"
#include "../W2App.h"
#include "../Utils.h"
#include "../Config.h"
#include <fmt/format.h>
BitmapImage* __stdcall CTaskWorm::hookSetNameTextbox(CTaskWorm * worm, BitmapTextbox * box, char *text, int text_color, int color1, int color2, int * width, int * height, int opacity) {
if (CTaskTeam *team = (CTaskTeam *) worm->parent) {
if (DWORD ddmain = *(DWORD *) (worm->gameglobal2c + 0x24)) {
BYTE mymachine = *(BYTE *) (ddmain + 0xD9DC);
DWORD ddgame = W2App::getAddrDdGame();
if((ddgame && *(BYTE *) (ddgame + 0x490)) // replay
|| (orderState == OrderMy && mymachine == team->owner_byte40) // my worms
|| (orderState == OrderAll)) {
std::string buff;
try {
buff = fmt::format(Config::getWormNameFormat(), fmt::arg("name", text), fmt::arg("number", worm->wormnumber_dword100));
} catch(std::exception & e) {
buff = fmt::format("Format error: {}", e.what());
}
return BitmapTextbox::origTextboxSetText(box, (char *) buff.c_str(), text_color, color1, color2, width, height, opacity);
}
}
}
return BitmapTextbox::origTextboxSetText(box, text, text_color, color1, color2, width, height, opacity);
}
DWORD addrDrawWormTextboxes_patch1_ret;
void __declspec(naked) CTaskWorm::hookDrawWormTextboxes_patch1() {
_asm {
mov ecx,dword ptr ds:[ecx+0x7328]
push 0x10000
lea edx,dword ptr ss:[esp+0x14]
push edx
lea edx,dword ptr ss:[esp+0x1C]
push edx
mov edx,dword ptr ss:[esp+0x30]
push edx
mov edx,dword ptr ds:[esi+0x350]
push ecx
mov ecx,dword ptr ss:[esp+0x34]
push ecx
push eax
push edx
push esi // worm
call hookSetNameTextbox
jmp addrDrawWormTextboxes_patch1_ret
}
}
void CTaskWorm::install() {
DWORD addrDrawWormTextboxes = _ScanPattern("DrawWormTextboxes", "\x81\xEC\x00\x00\x00\x00\x8B\x86\x00\x00\x00\x00\x8B\x4E\x2C\x33\xD2\x89\x44\x24\x14\x8B\x41\x24\x89\x44\x24\x04\x39\x90\x00\x00\x00\x00\x53\x0F\x95\xC2\x55\x57\x83\xC2\x01", "??????xx????xxxxxxxxxxxxxxxxxx????xxxxxxxxx");
DWORD addrDrawWormTextboxes_patch1 = addrDrawWormTextboxes + 0x2BB;
addrDrawWormTextboxes_patch1_ret = addrDrawWormTextboxes + 0x2E8;
_HookAsm(addrDrawWormTextboxes_patch1, (DWORD)&hookDrawWormTextboxes_patch1);
}
CTaskWorm::OrderState CTaskWorm::getOrderState() {
return orderState;
}
void CTaskWorm::setOrderState(CTaskWorm::OrderState orderState) {
CTaskWorm::orderState = orderState;
}
| [
"82811103+nizikawa-worms@users.noreply.github.com"
] | 82811103+nizikawa-worms@users.noreply.github.com |
11ac957abac16c10575a48750a9887518157ee71 | af287211c5af4766b7f5f89070973d58bb209e73 | /BFS/529-Minesweeper.cpp | 0466bc05b16ba938c59d29a5447099f53f844d91 | [] | no_license | Teddies/LeetCode | 48734d624679bd9d185fa3c99c9153213f7e78a8 | c5e59bc9b509cf3667fbf4d58ba2a900ce88f92f | refs/heads/master | 2020-03-10T03:13:28.148416 | 2018-06-15T07:57:15 | 2018-06-15T07:57:15 | 129,158,605 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,025 | cpp | class Solution {
public:
int countMines(vector<vector<char>>& board, int i, int j, int n, int m) {
int res = 0;
if (i - 1 >= 0) {
if (j - 1 >= 0 && board[i - 1][j - 1] == 'M') res ++;
if (board[i - 1][j] == 'M') res ++;
if (j + 1 < m && board[i - 1][j + 1] == 'M') res ++;
}
if (j - 1 >= 0 && board[i][j - 1] == 'M') res ++;
if (j + 1 < m && board[i][j + 1] == 'M') res ++;
if (i + 1 < n) {
if (j - 1 >= 0 && board[i + 1][j - 1] == 'M') res ++;
if (board[i + 1][j] == 'M') res ++;
if (j + 1 < m && board[i + 1][j + 1] == 'M') res ++;
}
return res;
}
vector<vector<char>> updateBoard(vector<vector<char>>& board, vector<int>& click) {
if (board[click[0]][click[1]] == 'M') {
board[click[0]][click[1]] = 'X';
return board;
}
queue<vector<int>> q;
q.push(click);
int n = board.size(), m = board[0].size();
while (!q.empty()) {
int size = q.size();
for (int k = 0; k < size; ++ k) {
int i = q.front()[0];
int j = q.front()[1];
if (i < 0 || i >= n || j < 0 || j >= m || board[i][j] != 'E') {
q.pop();
continue;
}
int count = countMines(board, i, j, n, m);
if (count == 0) {
board[i][j] = 'B';
vector<int> v(2, 0);
v[0] = i - 1; v[1] = j - 1; q.push(v);
v[1] = j; q.push(v); v[1] = j + 1; q.push(v);
v[0] = i; q.push(v); v[1]= j - 1; q.push(v);
v[0] = i + 1; q.push(v); v[1] = j; q.push(v);
v[1] = j + 1; q.push(v);
}
else {
board[i][j] = count + '0';
}
q.pop();
}
}
return board;
}
}; | [
"Teddies@sjtu.edu.cn"
] | Teddies@sjtu.edu.cn |
a83d8bdb94e49616e44e272309cdd294a9cb827c | e162982fa4a413d89f96edd6dd07a3ec44432ba0 | /Baekjoon/1000/1696-중앙값구하기.cpp | cd1ee7718f49d4bc334f159bae7be074cb8e1a0a | [] | no_license | Bucoco/Baekjoon | 3a70b867a8577de62a1486187bda2b6e5ce77a9b | 055ff80540c8da3c8c395f72461c061f6d676969 | refs/heads/master | 2023-06-19T21:21:16.420591 | 2021-07-21T06:44:12 | 2021-07-21T06:44:12 | 349,312,541 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 746 | cpp | #include <iostream>
#include <vector>
#include <queue>
#include <functional>
using namespace std;
int main() {
cin.tie(0); cout.tie(0);
ios::sync_with_stdio(false);
int t, n, a;
cin >> t;
while (t--){
priority_queue<int, vector<int>, greater<int>> minh;
priority_queue<int, vector<int>, less<int>> maxh;
cin >> n;
cout << n / 2 + 1 << "\n";
for (int i = 0;i < n;i++) {
cin >> a;
if (i & 1)
minh.push(a);
else {
maxh.push(a);
if (!minh.empty()) {
int x = maxh.top(), y = minh.top();
if (x > y) {
maxh.pop();
minh.pop();
maxh.push(y);
minh.push(x);
}
}
cout << maxh.top() << " ";
}
if (i % 20 == 19)
cout << "\n";
}
cout << "\n";
}
return 0;
} | [
"nam2660433@naver.com"
] | nam2660433@naver.com |
d92705ab89f2084105c7b4bf9ef84a29e5ea313a | 23d44a604a35650a9b610e2813a2aab8bab31c73 | /126_Surrounded_Regions.cpp | 46011a10fa97232414d4a49ce01bae7912286451 | [
"MIT"
] | permissive | liyiji/LeetCode | a65438ca4140c73477e4595b94d74329094eb28c | 5b882167d61bbfe3ad6128379a88d8f3765622a9 | refs/heads/master | 2021-01-02T08:33:13.502125 | 2014-12-30T15:39:06 | 2014-12-30T15:39:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,093 | cpp | /*
* Surrounded Regions
* Total Accepted: 8939 Total Submissions: 65153
*
* Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.
*
* A region is captured by flipping all 'O's into 'X's in that surrounded region.
*
* For example,
*
* X X X X
* X O O X
* X X O X
* X O X X
*
* After running your function, the board should be:
*
* X X X X
* X X X X
* X X X X
* X O X X
*
*/
struct pos
{
int i;
int j;
pos() :
i(0), j(0)
{
}
pos(int ii, int jj)
{
i = ii;
j = jj;
}
};
class Solution
{
public:
void solve(vector<vector<char> > &board)
{
if (board.size() < 3 || board[0].size() < 3)
return;
stack<pos> record;
for (size_t i = 0; i < board.size(); i++)
{
if (board[i][0] == 'O')
{
record.push(pos(i, 0));
processSub(board, record);
}
}
for (size_t i = 0; i < board.size(); i++)
{
if (board[i][board[0].size() - 1] == 'O')
{
record.push(pos(i, board[0].size() - 1));
processSub(board, record);
}
}
for (size_t j = 0; j < board[0].size(); j++)
{
if (board[0][j] == 'O')
{
record.push(pos(0, j));
processSub(board, record);
}
}
for (size_t j = 0; j < board[0].size(); j++)
{
if (board[board.size() - 1][j] == 'O')
{
record.push(pos(board.size() - 1, j));
processSub(board, record);
}
}
for (size_t i = 0; i < board.size(); i++)
{
for (size_t j = 0; j < board[0].size(); j++)
{
if (board[i][j] == 'O')
board[i][j] = 'X';
}
}
for (size_t i = 0; i < board.size(); i++)
{
for (size_t j = 0; j < board[0].size(); j++)
{
if (board[i][j] == 'A')
board[i][j] = 'O';
}
}
}
void processSub(vector<vector<char> > &board, stack<pos> &record)
{
while (record.size())
{
pos tmp = record.top();
board[tmp.i][tmp.j] = 'A';
record.pop();
if (tmp.i > 0)
{
if (board[tmp.i - 1][tmp.j] == 'O')
record.push(pos(tmp.i - 1, tmp.j));
}
if (tmp.i + 1 < board.size())
{
if (board[tmp.i + 1][tmp.j] == 'O')
record.push(pos(tmp.i + 1, tmp.j));
}
if (tmp.j > 0)
{
if (board[tmp.i][tmp.j - 1] == 'O')
record.push(pos(tmp.i, tmp.j - 1));
}
if (tmp.j + 1 < board[0].size())
{
if (board[tmp.i][tmp.j + 1] == 'O')
record.push(pos(tmp.i, tmp.j + 1));
}
}
}
};
| [
"liyijipersonal@gmail.com"
] | liyijipersonal@gmail.com |
3e36dbdebe3d96462f9af917f8ac957ada30cd9b | 8074a5307e064965c2c194141ddb266351109944 | /P5G02/P5G02/ListaCorreos.h | 70f6227f17d9bf3374d7c04c344407449a896733 | [] | no_license | Vantile/FP | 7b53b0b41be14015b4b7af3463101956a9a5dd90 | 2ad64c5a50aea82878ab7b6c9b0749d88f2330f9 | refs/heads/master | 2020-05-21T04:06:19.083984 | 2017-03-10T14:59:54 | 2017-03-10T14:59:54 | 84,570,700 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,284 | h | #ifndef ListaCorreos_h
#define ListaCorreos_h
#include "Correo.h"
const int MAX_CORREOS = 100; // Maximo de correos permitidos en la lista de correos.
typedef tCorreo *tCorreoPtr; // Puntero a array de correos.
typedef struct {
tCorreoPtr listaCorreo; // Lista de correos.
int dimension; // Dimension de la lista de correos.
int numCorreos; // Numero de correos en la lista.
} tListaCorreos; // Estructura de lista de correos.
void inicializar(tListaCorreos &correos); // Inicializa una lista de correos.
bool cargar(tListaCorreos &correos, std::string dominio); // Carga una lista de correos de un archivo.
void guardar(const tListaCorreos &correos, std::string dominio); // Guarda una lista de correos en un archivo.
bool insertar(tListaCorreos &correos, const tCorreo &correo); // Inserta un correo ordenadamente en una lista de correos.
bool buscar(const tListaCorreos &correos, std::string id, int &pos); // Busca un correo por su id en una lista de correos.
void ordenar_AF(tListaCorreos &correos); // Ordena por asunto y fecha una lista de correos.
void redimensionar(tListaCorreos &correos); // Redimensiona una listaCorreos para aumentar/disminuir su tamaño.
void destruir(tListaCorreos &correos); // Destruye de la memoria dinámica un dato tipo tListaCorreos.
#endif | [
"vantilesyfon@gmail.com"
] | vantilesyfon@gmail.com |
7a9010c903983569b54d3640732a77bde89ce822 | aaa60b19f500fc49dbaac1ec87e9c535a66b4ff5 | /depth-first-search-medium/337.打家劫舍-iii.cpp | 5e1ff99f4ded5c42c82e3a157322713b9ee99fde | [] | no_license | younger-1/leetcode-younger | c24e4a2a77c2f226c064c4eaf61e7f47d7e98d74 | a6dc92bbb90c5a095ac405476aeae6690e204b6b | refs/heads/master | 2023-07-25T02:31:42.430740 | 2021-09-09T08:06:05 | 2021-09-09T08:06:05 | 334,441,040 | 2 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,292 | cpp | /*
* @lc app=leetcode.cn id=337 lang=cpp
*
* [337] 打家劫舍 III
*/
#include <map>
#include <vector>
using namespace std;
/*
* Definition for a binary tree node.
*/
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
// @lc code=start
// 123/123 cases passed (8 ms)
// Your runtime beats 99.1 % of cpp submissions
// Your memory usage beats 92.54 % of cpp submissions (21.5 MB)
struct SubtreeStatus {
int selected;
int notSelected;
};
class Solution {
public:
SubtreeStatus dfs(TreeNode *node) {
if (!node) {
return {0, 0};
}
auto l = dfs(node->left);
auto r = dfs(node->right);
int selected = node->val + l.notSelected + r.notSelected;
int notSelected = max(l.selected, l.notSelected) + max(r.selected, r.notSelected);
return {selected, notSelected};
}
int rob(TreeNode *root) {
auto rootStatus = dfs(root);
return max(rootStatus.selected, rootStatus.notSelected);
}
};
// @lc code=end
// 123/123 cases passed (44 ms)
// Your runtime beats 24.65 % of cpp submissions
// Your memory usage beats 25.48 % of cpp submissions (28.6 MB)
class Solution_0 {
private:
map<pair<TreeNode *, bool>, int> memo;
public:
int rob(TreeNode *root) { return max(rob_or_not(root, false), rob_or_not(root, true)); }
int rob_or_not(TreeNode *root, bool rob_node) {
if (root == nullptr) {
return 0;
}
if (memo.find({root, rob_node}) != memo.end()) {
return memo[{root, rob_node}];
}
if (rob_node) {
int r = rob_or_not(root->right, false);
int l = rob_or_not(root->left, false);
memo[{root, rob_node}] = root->val + r + l;
} else {
int r_max = max(rob_or_not(root->right, true), rob_or_not(root->right, false));
int l_max = max(rob_or_not(root->left, true), rob_or_not(root->left, false));
memo[{root, rob_node}] = r_max + l_max;
}
return memo[{root, rob_node}];
}
};
| [
"45989017+younger-1@users.noreply.github.com"
] | 45989017+younger-1@users.noreply.github.com |
0a13f20db3916596002373cfcf7fe33a53903746 | dbdea98c6e0548ef2d17674c0ff64527365f483e | /divi/src/wallet.cpp | 8f25f10f2c6f20df64cd966dfcc37c3360b05448 | [
"MIT"
] | permissive | YungQuant/divi | e5e5ec44a6685c945cf509078c3539062659a065 | a52031cc32ab248385d15ada02b51c01c1ba7442 | refs/heads/master | 2022-02-20T08:46:46.972541 | 2019-09-25T18:16:42 | 2019-09-25T18:16:42 | 210,910,805 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 153,322 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin developers
// Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX Developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "wallet.h"
#include "accumulators.h"
#include "base58.h"
#include "checkpoints.h"
#include "coincontrol.h"
#include "kernel.h"
#include "masternode-budget.h"
#include "net.h"
#include "primitives/transaction.h"
#include "script/script.h"
#include "script/sign.h"
#include "spork.h"
#include "swifttx.h"
#include "timedata.h"
#include "util.h"
#include "utilmoneystr.h"
#include "denomination_functions.h"
#include "libzerocoin/Denominations.h"
#include <assert.h>
#include <boost/algorithm/string/replace.hpp>
#include <boost/thread.hpp>
#include <boost/filesystem/operations.hpp>
using namespace std;
/**
* Settings
*/
CFeeRate payTxFee(DEFAULT_TRANSACTION_FEE);
CAmount nTransactionValueMultiplier = 10000; // 1 / 0.0001 = 10000;
unsigned int nTransactionSizeMultiplier = 300;
unsigned int nTxConfirmTarget = 1;
bool bSpendZeroConfChange = true;
bool bdisableSystemnotifications = false; // Those bubbles can be annoying and slow down the UI when you get lots of trx
bool fSendFreeTransactions = false;
bool fPayAtLeastCustomFee = true;
static const unsigned int DEFAULT_KEYPOOL_SIZE = 1000;
/**
* Fees smaller than this (in duffs) are considered zero fee (for transaction creation)
* We are ~100 times smaller then bitcoin now (2015-06-23), set minTxFee 10 times higher
* so it's still 10 times lower comparing to bitcoin.
* Override with -mintxfee
*/
CFeeRate CWallet::minTxFee = CFeeRate(10000);
int64_t nStartupTime = GetAdjustedTime();
/** @defgroup mapWallet
*
* @{
*/
struct CompareValueOnly {
bool operator()(const pair<CAmount, pair<const CWalletTx*, unsigned int> >& t1,
const pair<CAmount, pair<const CWalletTx*, unsigned int> >& t2) const
{
return t1.first < t2.first;
}
};
std::string COutput::ToString() const
{
return strprintf("COutput(%s, %d, %d) [%s]", tx->GetHash().ToString(), i, nDepth, FormatMoney(tx->vout[i].nValue));
}
const CWalletTx* CWallet::GetWalletTx(const uint256& hash) const
{
LOCK(cs_wallet);
std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(hash);
if (it == mapWallet.end())
return NULL;
return &(it->second);
}
CPubKey CWallet::GenerateNewKey(uint32_t nAccountIndex, bool fInternal)
{
AssertLockHeld(cs_wallet); // mapKeyMetadata
bool fCompressed = CanSupportFeature(FEATURE_COMPRPUBKEY); // default to compressed public keys if we want 0.6.0 wallets
CKey secret;
// Create new metadata
int64_t nCreationTime = GetTime();
CKeyMetadata metadata(nCreationTime);
CPubKey pubkey;
// use HD key derivation if HD was enabled during wallet creation
if (IsHDEnabled()) {
DeriveNewChildKey(metadata, secret, nAccountIndex, fInternal);
pubkey = secret.GetPubKey();
} else {
secret.MakeNewKey(fCompressed);
// Compressed public keys were introduced in version 0.6.0
if (fCompressed)
SetMinVersion(FEATURE_COMPRPUBKEY);
pubkey = secret.GetPubKey();
assert(secret.VerifyPubKey(pubkey));
// Create new metadata
mapKeyMetadata[pubkey.GetID()] = metadata;
UpdateTimeFirstKey(nCreationTime);
if (!AddKeyPubKey(secret, pubkey))
throw std::runtime_error(std::string(__func__) + ": AddKey failed");
}
return pubkey;
}
void CWallet::DeriveNewChildKey(const CKeyMetadata& metadata, CKey& secretRet, uint32_t nAccountIndex, bool fInternal)
{
CHDChain hdChainTmp;
if (!GetHDChain(hdChainTmp)) {
throw std::runtime_error(std::string(__func__) + ": GetHDChain failed");
}
if (!DecryptHDChain(hdChainTmp))
throw std::runtime_error(std::string(__func__) + ": DecryptHDChainSeed failed");
// make sure seed matches this chain
if (hdChainTmp.GetID() != hdChainTmp.GetSeedHash())
throw std::runtime_error(std::string(__func__) + ": Wrong HD chain!");
CHDAccount acc;
if (!hdChainTmp.GetAccount(nAccountIndex, acc))
throw std::runtime_error(std::string(__func__) + ": Wrong HD account!");
// derive child key at next index, skip keys already known to the wallet
CExtKey childKey;
uint32_t nChildIndex = fInternal ? acc.nInternalChainCounter : acc.nExternalChainCounter;
do {
hdChainTmp.DeriveChildExtKey(nAccountIndex, fInternal, nChildIndex, childKey);
// increment childkey index
nChildIndex++;
} while (HaveKey(childKey.key.GetPubKey().GetID()));
secretRet = childKey.key;
CPubKey pubkey = secretRet.GetPubKey();
assert(secretRet.VerifyPubKey(pubkey));
// store metadata
mapKeyMetadata[pubkey.GetID()] = metadata;
UpdateTimeFirstKey(metadata.nCreateTime);
// update the chain model in the database
CHDChain hdChainCurrent;
GetHDChain(hdChainCurrent);
if (fInternal) {
acc.nInternalChainCounter = nChildIndex;
}
else {
acc.nExternalChainCounter = nChildIndex;
}
if (!hdChainCurrent.SetAccount(nAccountIndex, acc))
throw std::runtime_error(std::string(__func__) + ": SetAccount failed");
if (IsCrypted()) {
if (!SetCryptedHDChain(hdChainCurrent, false))
throw std::runtime_error(std::string(__func__) + ": SetCryptedHDChain failed");
}
else {
if (!SetHDChain(hdChainCurrent, false))
throw std::runtime_error(std::string(__func__) + ": SetHDChain failed");
}
if (!AddHDPubKey(childKey.Neuter(), fInternal))
throw std::runtime_error(std::string(__func__) + ": AddHDPubKey failed");
}
bool CWallet::GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const
{
LOCK(cs_wallet);
std::map<CKeyID, CHDPubKey>::const_iterator mi = mapHdPubKeys.find(address);
if (mi != mapHdPubKeys.end())
{
const CHDPubKey &hdPubKey = (*mi).second;
vchPubKeyOut = hdPubKey.extPubKey.pubkey;
return true;
}
else
return CCryptoKeyStore::GetPubKey(address, vchPubKeyOut);
}
bool CWallet::GetKey(const CKeyID &address, CKey& keyOut) const
{
LOCK(cs_wallet);
std::map<CKeyID, CHDPubKey>::const_iterator mi = mapHdPubKeys.find(address);
if (mi != mapHdPubKeys.end())
{
// if the key has been found in mapHdPubKeys, derive it on the fly
const CHDPubKey &hdPubKey = (*mi).second;
CHDChain hdChainCurrent;
if (!GetHDChain(hdChainCurrent))
throw std::runtime_error(std::string(__func__) + ": GetHDChain failed");
if (!DecryptHDChain(hdChainCurrent))
throw std::runtime_error(std::string(__func__) + ": DecryptHDChainSeed failed");
// make sure seed matches this chain
if (hdChainCurrent.GetID() != hdChainCurrent.GetSeedHash())
throw std::runtime_error(std::string(__func__) + ": Wrong HD chain!");
CExtKey extkey;
hdChainCurrent.DeriveChildExtKey(hdPubKey.nAccountIndex, hdPubKey.nChangeIndex != 0, hdPubKey.extPubKey.nChild, extkey);
keyOut = extkey.key;
return true;
}
else {
return CCryptoKeyStore::GetKey(address, keyOut);
}
}
bool CWallet::HaveKey(const CKeyID &address) const
{
LOCK(cs_wallet);
if (mapHdPubKeys.count(address) > 0)
return true;
return CCryptoKeyStore::HaveKey(address);
}
bool CWallet::LoadHDPubKey(const CHDPubKey &hdPubKey)
{
AssertLockHeld(cs_wallet);
mapHdPubKeys[hdPubKey.extPubKey.pubkey.GetID()] = hdPubKey;
return true;
}
bool CWallet::AddHDPubKey(const CExtPubKey &extPubKey, bool fInternal)
{
AssertLockHeld(cs_wallet);
CHDChain hdChainCurrent;
GetHDChain(hdChainCurrent);
CHDPubKey hdPubKey;
hdPubKey.extPubKey = extPubKey;
hdPubKey.hdchainID = hdChainCurrent.GetID();
hdPubKey.nChangeIndex = fInternal ? 1 : 0;
mapHdPubKeys[extPubKey.pubkey.GetID()] = hdPubKey;
// check if we need to remove from watch-only
CScript script;
script = GetScriptForDestination(extPubKey.pubkey.GetID());
if (HaveWatchOnly(script))
RemoveWatchOnly(script);
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteHDPubKey(hdPubKey, mapKeyMetadata[extPubKey.pubkey.GetID()]);
}
bool CWallet::AddKeyPubKey(const CKey& secret, const CPubKey &pubkey)
{
AssertLockHeld(cs_wallet); // mapKeyMetadata
if (!CCryptoKeyStore::AddKeyPubKey(secret, pubkey))
return false;
// check if we need to remove from watch-only
CScript script;
script = GetScriptForDestination(pubkey.GetID());
if (HaveWatchOnly(script))
RemoveWatchOnly(script);
if (!fFileBacked)
return true;
if (!IsCrypted()) {
return CWalletDB(strWalletFile).WriteKey(pubkey,
secret.GetPrivKey(),
mapKeyMetadata[pubkey.GetID()]);
}
return true;
}
bool CWallet::AddCryptedKey(const CPubKey& vchPubKey,
const vector<unsigned char>& vchCryptedSecret)
{
if (!CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret))
return false;
if (!fFileBacked)
return true;
{
LOCK(cs_wallet);
if (pwalletdbEncryption)
return pwalletdbEncryption->WriteCryptedKey(vchPubKey,
vchCryptedSecret,
mapKeyMetadata[vchPubKey.GetID()]);
else
return CWalletDB(strWalletFile).WriteCryptedKey(vchPubKey, vchCryptedSecret, mapKeyMetadata[vchPubKey.GetID()]);
}
return false;
}
bool CWallet::LoadKeyMetadata(const CPubKey& pubkey, const CKeyMetadata& meta)
{
AssertLockHeld(cs_wallet); // mapKeyMetadata
if (meta.nCreateTime && (!nTimeFirstKey || meta.nCreateTime < nTimeFirstKey))
nTimeFirstKey = meta.nCreateTime;
mapKeyMetadata[pubkey.GetID()] = meta;
return true;
}
bool CWallet::LoadMinVersion(int nVersion)
{
AssertLockHeld(cs_wallet);
nWalletVersion = nVersion;
nWalletMaxVersion = std::max(nWalletMaxVersion, nVersion);
return true;
}
void CWallet::UpdateTimeFirstKey(int64_t nCreateTime)
{
AssertLockHeld(cs_wallet);
if (nCreateTime <= 1) {
// Cannot determine birthday information, so set the wallet birthday to
// the beginning of time.
nTimeFirstKey = 1;
} else if (!nTimeFirstKey || nCreateTime < nTimeFirstKey) {
nTimeFirstKey = nCreateTime;
}
}
bool CWallet::LoadCryptedKey(const CPubKey& vchPubKey, const std::vector<unsigned char>& vchCryptedSecret)
{
return CCryptoKeyStore::AddCryptedKey(vchPubKey, vchCryptedSecret);
}
bool CWallet::AddCScript(const CScript& redeemScript)
{
if (!CCryptoKeyStore::AddCScript(redeemScript))
return false;
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteCScript(Hash160(redeemScript), redeemScript);
}
bool CWallet::LoadCScript(const CScript& redeemScript)
{
/* A sanity check was added in pull #3843 to avoid adding redeemScripts
* that never can be redeemed. However, old wallets may still contain
* these. Do not add them to the wallet and warn. */
if (redeemScript.size() > MAX_SCRIPT_ELEMENT_SIZE) {
std::string strAddr = CBitcoinAddress(CScriptID(redeemScript)).ToString();
LogPrintf("%s: Warning: This wallet contains a redeemScript of size %i which exceeds maximum size %i thus can never be redeemed. Do not use address %s.\n",
__func__, redeemScript.size(), MAX_SCRIPT_ELEMENT_SIZE, strAddr);
return true;
}
return CCryptoKeyStore::AddCScript(redeemScript);
}
bool CWallet::AddWatchOnly(const CScript& dest)
{
if (!CCryptoKeyStore::AddWatchOnly(dest))
return false;
nTimeFirstKey = 1; // No birthday information for watch-only keys.
NotifyWatchonlyChanged(true);
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteWatchOnly(dest);
}
bool CWallet::RemoveWatchOnly(const CScript& dest)
{
AssertLockHeld(cs_wallet);
if (!CCryptoKeyStore::RemoveWatchOnly(dest))
return false;
if (!HaveWatchOnly())
NotifyWatchonlyChanged(false);
if (fFileBacked)
if (!CWalletDB(strWalletFile).EraseWatchOnly(dest))
return false;
return true;
}
bool CWallet::LoadWatchOnly(const CScript& dest)
{
return CCryptoKeyStore::AddWatchOnly(dest);
}
bool CWallet::AddMultiSig(const CScript& dest)
{
if (!CCryptoKeyStore::AddMultiSig(dest))
return false;
nTimeFirstKey = 1; // No birthday information
NotifyMultiSigChanged(true);
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteMultiSig(dest);
}
bool CWallet::RemoveMultiSig(const CScript& dest)
{
AssertLockHeld(cs_wallet);
if (!CCryptoKeyStore::RemoveMultiSig(dest))
return false;
if (!HaveMultiSig())
NotifyMultiSigChanged(false);
if (fFileBacked)
if (!CWalletDB(strWalletFile).EraseMultiSig(dest))
return false;
return true;
}
bool CWallet::LoadMultiSig(const CScript& dest)
{
return CCryptoKeyStore::AddMultiSig(dest);
}
bool CWallet::Unlock(const SecureString& strWalletPassphrase, bool anonymizeOnly)
{
SecureString strWalletPassphraseFinal;
if (!IsLocked()) {
fWalletUnlockAnonymizeOnly = anonymizeOnly;
return true;
}
strWalletPassphraseFinal = strWalletPassphrase;
CCrypter crypter;
CKeyingMaterial vMasterKey;
{
LOCK(cs_wallet);
BOOST_FOREACH (const MasterKeyMap::value_type& pMasterKey, mapMasterKeys) {
if (!crypter.SetKeyFromPassphrase(strWalletPassphraseFinal, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
return false;
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
continue; // try another master key
if (CCryptoKeyStore::Unlock(vMasterKey)) {
fWalletUnlockAnonymizeOnly = anonymizeOnly;
return true;
}
}
}
return false;
}
bool CWallet::ChangeWalletPassphrase(const SecureString& strOldWalletPassphrase, const SecureString& strNewWalletPassphrase)
{
bool fWasLocked = IsLocked();
SecureString strOldWalletPassphraseFinal = strOldWalletPassphrase;
{
LOCK(cs_wallet);
Lock();
CCrypter crypter;
CKeyingMaterial vMasterKey;
BOOST_FOREACH (MasterKeyMap::value_type& pMasterKey, mapMasterKeys) {
if (!crypter.SetKeyFromPassphrase(strOldWalletPassphraseFinal, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
return false;
if (!crypter.Decrypt(pMasterKey.second.vchCryptedKey, vMasterKey))
return false;
if (CCryptoKeyStore::Unlock(vMasterKey)) {
int64_t nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
pMasterKey.second.nDeriveIterations = pMasterKey.second.nDeriveIterations * (100 / ((double)(GetTimeMillis() - nStartTime)));
nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod);
pMasterKey.second.nDeriveIterations = (pMasterKey.second.nDeriveIterations + pMasterKey.second.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
if (pMasterKey.second.nDeriveIterations < 25000)
pMasterKey.second.nDeriveIterations = 25000;
LogPrintf("Wallet passphrase changed to an nDeriveIterations of %i\n", pMasterKey.second.nDeriveIterations);
if (!crypter.SetKeyFromPassphrase(strNewWalletPassphrase, pMasterKey.second.vchSalt, pMasterKey.second.nDeriveIterations, pMasterKey.second.nDerivationMethod))
return false;
if (!crypter.Encrypt(vMasterKey, pMasterKey.second.vchCryptedKey))
return false;
CWalletDB(strWalletFile).WriteMasterKey(pMasterKey.first, pMasterKey.second);
if (fWasLocked)
Lock();
return true;
}
}
}
return false;
}
void CWallet::SetBestChain(const CBlockLocator& loc)
{
CWalletDB walletdb(strWalletFile);
walletdb.WriteBestBlock(loc);
}
bool CWallet::SetMinVersion(enum WalletFeature nVersion, CWalletDB* pwalletdbIn, bool fExplicit)
{
LOCK(cs_wallet); // nWalletVersion
if (nWalletVersion >= nVersion)
return true;
// when doing an explicit upgrade, if we pass the max version permitted, upgrade all the way
if (fExplicit && nVersion > nWalletMaxVersion)
nVersion = FEATURE_LATEST;
nWalletVersion = nVersion;
if (nVersion > nWalletMaxVersion)
nWalletMaxVersion = nVersion;
if (fFileBacked) {
CWalletDB* pwalletdb = pwalletdbIn ? pwalletdbIn : new CWalletDB(strWalletFile);
if (nWalletVersion > 40000)
pwalletdb->WriteMinVersion(nWalletVersion);
if (!pwalletdbIn)
delete pwalletdb;
}
return true;
}
bool CWallet::SetMaxVersion(int nVersion)
{
LOCK(cs_wallet); // nWalletVersion, nWalletMaxVersion
// cannot downgrade below current version
if (nWalletVersion > nVersion)
return false;
nWalletMaxVersion = nVersion;
return true;
}
set<uint256> CWallet::GetConflicts(const uint256& txid) const
{
set<uint256> result;
AssertLockHeld(cs_wallet);
std::map<uint256, CWalletTx>::const_iterator it = mapWallet.find(txid);
if (it == mapWallet.end())
return result;
const CWalletTx& wtx = it->second;
std::pair<TxSpends::const_iterator, TxSpends::const_iterator> range;
BOOST_FOREACH (const CTxIn& txin, wtx.vin) {
if (mapTxSpends.count(txin.prevout) <= 1 || wtx.IsZerocoinSpend())
continue; // No conflict if zero or one spends
range = mapTxSpends.equal_range(txin.prevout);
for (TxSpends::const_iterator it = range.first; it != range.second; ++it)
result.insert(it->second);
}
return result;
}
void CWallet::SyncMetaData(pair<TxSpends::iterator, TxSpends::iterator> range)
{
// We want all the wallet transactions in range to have the same metadata as
// the oldest (smallest nOrderPos).
// So: find smallest nOrderPos:
int nMinOrderPos = std::numeric_limits<int>::max();
const CWalletTx* copyFrom = NULL;
for (TxSpends::iterator it = range.first; it != range.second; ++it) {
const uint256& hash = it->second;
int n = mapWallet[hash].nOrderPos;
if (n < nMinOrderPos) {
nMinOrderPos = n;
copyFrom = &mapWallet[hash];
}
}
// Now copy data from copyFrom to rest:
for (TxSpends::iterator it = range.first; it != range.second; ++it) {
const uint256& hash = it->second;
CWalletTx* copyTo = &mapWallet[hash];
if (copyFrom == copyTo) continue;
copyTo->mapValue = copyFrom->mapValue;
copyTo->vOrderForm = copyFrom->vOrderForm;
// fTimeReceivedIsTxTime not copied on purpose
// nTimeReceived not copied on purpose
copyTo->nTimeSmart = copyFrom->nTimeSmart;
copyTo->fFromMe = copyFrom->fFromMe;
copyTo->strFromAccount = copyFrom->strFromAccount;
// nOrderPos not copied on purpose
// cached members not copied on purpose
}
}
/**
* Outpoint is spent if any non-conflicted transaction
* spends it:
*/
bool CWallet::IsSpent(const uint256& hash, unsigned int n) const
{
const COutPoint outpoint(hash, n);
pair<TxSpends::const_iterator, TxSpends::const_iterator> range;
range = mapTxSpends.equal_range(outpoint);
for (TxSpends::const_iterator it = range.first; it != range.second; ++it) {
const uint256& wtxid = it->second;
std::map<uint256, CWalletTx>::const_iterator mit = mapWallet.find(wtxid);
if (mit != mapWallet.end() && mit->second.GetDepthInMainChain() >= 0)
return true; // Spent
}
return false;
}
void CWallet::AddToSpends(const COutPoint& outpoint, const uint256& wtxid)
{
mapTxSpends.insert(make_pair(outpoint, wtxid));
pair<TxSpends::iterator, TxSpends::iterator> range;
range = mapTxSpends.equal_range(outpoint);
SyncMetaData(range);
}
void CWallet::AddToSpends(const uint256& wtxid)
{
assert(mapWallet.count(wtxid));
CWalletTx& thisTx = mapWallet[wtxid];
if (thisTx.IsCoinBase()) // Coinbases don't spend anything!
return;
BOOST_FOREACH (const CTxIn& txin, thisTx.vin)
AddToSpends(txin.prevout, wtxid);
}
bool CWallet::GetMasternodeVinAndKeys(CTxIn& txinRet, CPubKey& pubKeyRet, CKey& keyRet, std::string strTxHash, std::string strOutputIndex)
{
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
// Find specific vin
uint256 txHash = uint256S(strTxHash);
int nOutputIndex;
try {
nOutputIndex = std::stoi(strOutputIndex.c_str());
} catch (const std::exception& e) {
LogPrintf("%s: %s on strOutputIndex\n", __func__, e.what());
return false;
}
if(auto walletTx = GetWalletTx(txHash))
{
if(IsSpent(txHash, nOutputIndex))
{
LogPrintf("CWallet::GetMasternodeVinAndKeys -- Could not locate specified masternode vin, outpoint spent\n");
return false;
}
return GetVinAndKeysFromOutput(COutput(walletTx, nOutputIndex, walletTx->GetDepthInMainChain(), true), txinRet, pubKeyRet, keyRet);
}
else
{
LogPrintf("CWallet::GetMasternodeVinAndKeys -- Could not locate any valid masternode vin\n");
return false;
}
return false;
}
bool CWallet::GetVinAndKeysFromOutput(COutput out, CTxIn& txinRet, CPubKey& pubKeyRet, CKey& keyRet)
{
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
CScript pubScript;
txinRet = CTxIn(out.tx->GetHash(), out.i);
pubScript = out.tx->vout[out.i].scriptPubKey; // the inputs PubKey
CTxDestination address1;
ExtractDestination(pubScript, address1);
CBitcoinAddress address2(address1);
CKeyID keyID;
if (!address2.GetKeyID(keyID)) {
LogPrintf("CWallet::GetVinAndKeysFromOutput -- Address does not refer to a key\n");
return false;
}
if (!GetKey(keyID, keyRet)) {
LogPrintf("CWallet::GetVinAndKeysFromOutput -- Private key for address is not known\n");
return false;
}
pubKeyRet = keyRet.GetPubKey();
return true;
}
bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
{
if (IsCrypted())
return false;
CKeyingMaterial vMasterKey;
vMasterKey.resize(WALLET_CRYPTO_KEY_SIZE);
GetStrongRandBytes(&vMasterKey[0], WALLET_CRYPTO_KEY_SIZE);
CMasterKey kMasterKey;
kMasterKey.vchSalt.resize(WALLET_CRYPTO_SALT_SIZE);
GetStrongRandBytes(&kMasterKey.vchSalt[0], WALLET_CRYPTO_SALT_SIZE);
CCrypter crypter;
int64_t nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, 25000, kMasterKey.nDerivationMethod);
kMasterKey.nDeriveIterations = 2500000 / ((double)(GetTimeMillis() - nStartTime));
nStartTime = GetTimeMillis();
crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod);
kMasterKey.nDeriveIterations = (kMasterKey.nDeriveIterations + kMasterKey.nDeriveIterations * 100 / ((double)(GetTimeMillis() - nStartTime))) / 2;
if (kMasterKey.nDeriveIterations < 25000)
kMasterKey.nDeriveIterations = 25000;
LogPrintf("Encrypting Wallet with an nDeriveIterations of %i\n", kMasterKey.nDeriveIterations);
if (!crypter.SetKeyFromPassphrase(strWalletPassphrase, kMasterKey.vchSalt, kMasterKey.nDeriveIterations, kMasterKey.nDerivationMethod))
return false;
if (!crypter.Encrypt(vMasterKey, kMasterKey.vchCryptedKey))
return false;
{
LOCK(cs_wallet);
mapMasterKeys[++nMasterKeyMaxID] = kMasterKey;
if (fFileBacked) {
assert(!pwalletdbEncryption);
pwalletdbEncryption = new CWalletDB(strWalletFile);
if (!pwalletdbEncryption->TxnBegin()) {
delete pwalletdbEncryption;
pwalletdbEncryption = NULL;
return false;
}
pwalletdbEncryption->WriteMasterKey(nMasterKeyMaxID, kMasterKey);
}
// must get current HD chain before EncryptKeys
CHDChain hdChainCurrent;
GetHDChain(hdChainCurrent);
if (!EncryptKeys(vMasterKey))
{
if (fFileBacked) {
pwalletdbEncryption->TxnAbort();
delete pwalletdbEncryption;
}
// We now probably have half of our keys encrypted in memory, and half not...
// die and let the user reload the unencrypted wallet.
assert(false);
}
if (!hdChainCurrent.IsNull()) {
assert(EncryptHDChain(vMasterKey));
CHDChain hdChainCrypted;
assert(GetHDChain(hdChainCrypted));
// ids should match, seed hashes should not
assert(hdChainCurrent.GetID() == hdChainCrypted.GetID());
assert(hdChainCurrent.GetSeedHash() != hdChainCrypted.GetSeedHash());
assert(SetCryptedHDChain(hdChainCrypted, false));
}
// Encryption was introduced in version 0.4.0
SetMinVersion(FEATURE_WALLETCRYPT, pwalletdbEncryption, true);
if (fFileBacked)
{
if (!pwalletdbEncryption->TxnCommit()) {
delete pwalletdbEncryption;
// We now have keys encrypted in memory, but not on disk...
// die to avoid confusion and let the user reload the unencrypted wallet.
assert(false);
}
delete pwalletdbEncryption;
pwalletdbEncryption = NULL;
}
Lock();
Unlock(strWalletPassphrase);
// if we are not using HD, generate new keypool
if(IsHDEnabled()) {
TopUpKeyPool();
}
else {
NewKeyPool();
}
Lock();
// Need to completely rewrite the wallet file; if we don't, bdb might keep
// bits of the unencrypted private key in slack space in the database file.
CDB::Rewrite(strWalletFile);
}
NotifyStatusChanged(this);
return true;
}
int64_t CWallet::IncOrderPosNext(CWalletDB* pwalletdb)
{
AssertLockHeld(cs_wallet); // nOrderPosNext
int64_t nRet = nOrderPosNext++;
if (pwalletdb) {
pwalletdb->WriteOrderPosNext(nOrderPosNext);
} else {
CWalletDB(strWalletFile).WriteOrderPosNext(nOrderPosNext);
}
return nRet;
}
CWallet::TxItems CWallet::OrderedTxItems(std::list<CAccountingEntry>& acentries, std::string strAccount)
{
AssertLockHeld(cs_wallet); // mapWallet
CWalletDB walletdb(strWalletFile);
// First: get all CWalletTx and CAccountingEntry into a sorted-by-order multimap.
TxItems txOrdered;
// Note: maintaining indices in the database of (account,time) --> txid and (account, time) --> acentry
// would make this much faster for applications that do this a lot.
for (map<uint256, CWalletTx>::iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
CWalletTx* wtx = &((*it).second);
txOrdered.insert(make_pair(wtx->nOrderPos, TxPair(wtx, (CAccountingEntry*)0)));
}
acentries.clear();
walletdb.ListAccountCreditDebit(strAccount, acentries);
BOOST_FOREACH (CAccountingEntry& entry, acentries) {
txOrdered.insert(make_pair(entry.nOrderPos, TxPair((CWalletTx*)0, &entry)));
}
return txOrdered;
}
void CWallet::MarkDirty()
{
{
LOCK(cs_wallet);
BOOST_FOREACH (PAIRTYPE(const uint256, CWalletTx) & item, mapWallet)
item.second.MarkDirty();
}
}
bool CWallet::AddToWallet(const CWalletTx& wtxIn, bool fFromLoadWallet)
{
uint256 hash = wtxIn.GetHash();
if (fFromLoadWallet) {
mapWallet[hash] = wtxIn;
mapWallet[hash].BindWallet(this);
AddToSpends(hash);
} else {
LOCK(cs_wallet);
// Inserts only if not already there, returns tx inserted or tx found
pair<map<uint256, CWalletTx>::iterator, bool> ret = mapWallet.insert(make_pair(hash, wtxIn));
CWalletTx& wtx = (*ret.first).second;
wtx.BindWallet(this);
bool fInsertedNew = ret.second;
if (fInsertedNew) {
wtx.nTimeReceived = GetAdjustedTime();
wtx.nOrderPos = IncOrderPosNext();
wtx.nTimeSmart = wtx.nTimeReceived;
if (wtxIn.hashBlock != 0) {
if (mapBlockIndex.count(wtxIn.hashBlock)) {
int64_t latestNow = wtx.nTimeReceived;
int64_t latestEntry = 0;
{
// Tolerate times up to the last timestamp in the wallet not more than 5 minutes into the future
int64_t latestTolerated = latestNow + 300;
std::list<CAccountingEntry> acentries;
TxItems txOrdered = OrderedTxItems(acentries);
for (TxItems::reverse_iterator it = txOrdered.rbegin(); it != txOrdered.rend(); ++it) {
CWalletTx* const pwtx = (*it).second.first;
if (pwtx == &wtx)
continue;
CAccountingEntry* const pacentry = (*it).second.second;
int64_t nSmartTime;
if (pwtx) {
nSmartTime = pwtx->nTimeSmart;
if (!nSmartTime)
nSmartTime = pwtx->nTimeReceived;
} else
nSmartTime = pacentry->nTime;
if (nSmartTime <= latestTolerated) {
latestEntry = nSmartTime;
if (nSmartTime > latestNow)
latestNow = nSmartTime;
break;
}
}
}
int64_t blocktime = mapBlockIndex[wtxIn.hashBlock]->GetBlockTime();
wtx.nTimeSmart = std::max(latestEntry, std::min(blocktime, latestNow));
} else
LogPrintf("AddToWallet() : found %s in block %s not in index\n",
wtxIn.GetHash().ToString(),
wtxIn.hashBlock.ToString());
}
AddToSpends(hash);
}
bool fUpdated = false;
if (!fInsertedNew) {
// Merge
if (wtxIn.hashBlock != 0 && wtxIn.hashBlock != wtx.hashBlock) {
wtx.hashBlock = wtxIn.hashBlock;
fUpdated = true;
}
if (wtxIn.nIndex != -1 && (wtxIn.vMerkleBranch != wtx.vMerkleBranch || wtxIn.nIndex != wtx.nIndex)) {
wtx.vMerkleBranch = wtxIn.vMerkleBranch;
wtx.nIndex = wtxIn.nIndex;
fUpdated = true;
}
if (wtxIn.fFromMe && wtxIn.fFromMe != wtx.fFromMe) {
wtx.fFromMe = wtxIn.fFromMe;
fUpdated = true;
}
}
//// debug print
LogPrintf("AddToWallet %s %s%s\n", wtxIn.GetHash().ToString(), (fInsertedNew ? "new" : ""), (fUpdated ? "update" : ""));
// Write to disk
if (fInsertedNew || fUpdated)
if (!wtx.WriteToDisk())
return false;
// Break debit/credit balance caches:
wtx.MarkDirty();
// Notify UI of new or updated transaction
NotifyTransactionChanged(this, hash, fInsertedNew ? CT_NEW : CT_UPDATED);
// notify an external script when a wallet transaction comes in or is updated
std::string strCmd = GetArg("-walletnotify", "");
if (!strCmd.empty()) {
boost::replace_all(strCmd, "%s", wtxIn.GetHash().GetHex());
boost::thread t(runCommand, strCmd); // thread runs free
}
}
return true;
}
/**
* Add a transaction to the wallet, or update it.
* pblock is optional, but should be provided if the transaction is known to be in a block.
* If fUpdate is true, existing transactions will be updated.
*/
bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pblock, bool fUpdate)
{
{
AssertLockHeld(cs_wallet);
bool fExisted = mapWallet.count(tx.GetHash()) != 0;
if (fExisted && !fUpdate) return false;
if (fExisted || IsMine(tx) || IsFromMe(tx)) {
CWalletTx wtx(this, tx);
// Get merkle branch if transaction was found in a block
if (pblock)
wtx.SetMerkleBranch(*pblock);
return AddToWallet(wtx);
}
}
return false;
}
void CWallet::SyncTransaction(const CTransaction& tx, const CBlock* pblock)
{
LOCK2(cs_main, cs_wallet);
if (!AddToWalletIfInvolvingMe(tx, pblock, true))
return; // Not one of ours
// If a transaction changes 'conflicted' state, that changes the balance
// available of the outputs it spends. So force those to be
// recomputed, also:
BOOST_FOREACH (const CTxIn& txin, tx.vin) {
if (!tx.IsZerocoinSpend() && mapWallet.count(txin.prevout.hash))
mapWallet[txin.prevout.hash].MarkDirty();
}
}
void CWallet::EraseFromWallet(const uint256& hash)
{
if (!fFileBacked)
return;
{
LOCK(cs_wallet);
if (mapWallet.erase(hash))
CWalletDB(strWalletFile).EraseTx(hash);
}
return;
}
isminetype CWallet::IsMine(const CTxIn& txin) const
{
{
LOCK(cs_wallet);
map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
if (mi != mapWallet.end()) {
const CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size())
return IsMine(prev.vout[txin.prevout.n]);
}
}
return ISMINE_NO;
}
bool CWallet::IsMyZerocoinSpend(const CBigNum& bnSerial) const
{
return CWalletDB(strWalletFile).ReadZerocoinSpendSerialEntry(bnSerial);
}
CAmount CWallet::GetDebit(const CTxIn& txin, const isminefilter& filter) const
{
{
LOCK(cs_wallet);
map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(txin.prevout.hash);
if (mi != mapWallet.end()) {
const CWalletTx& prev = (*mi).second;
if (txin.prevout.n < prev.vout.size())
if (IsMine(prev.vout[txin.prevout.n]) & filter)
return prev.vout[txin.prevout.n].nValue;
}
}
return 0;
}
bool CWallet::IsChange(const CTxOut& txout) const
{
// TODO: fix handling of 'change' outputs. The assumption is that any
// payment to a script that is ours, but is not in the address book
// is change. That assumption is likely to break when we implement multisignature
// wallets that return change back into a multi-signature-protected address;
// a better way of identifying which outputs are 'the send' and which are
// 'the change' will need to be implemented (maybe extend CWalletTx to remember
// which output, if any, was change).
if (::IsMine(*this, txout.scriptPubKey))
{
CTxDestination address;
if (!ExtractDestination(txout.scriptPubKey, address))
return true;
LOCK(cs_wallet);
// if (!mapAddressBook.count(address))
// return true;
if(txout.scriptPubKey.IsPayToPublicKeyHash()) {
auto keyID = boost::get<CKeyID>(address);
if(mapHdPubKeys.count(keyID)) {
return mapHdPubKeys.at(keyID).nChangeIndex > 0;
}
}
}
return false;
}
int64_t CWalletTx::GetTxTime() const
{
int64_t n = nTimeSmart;
return n ? n : nTimeReceived;
}
int64_t CWalletTx::GetComputedTxTime() const
{
int64_t nTime = GetTxTime();
if (IsZerocoinSpend() || IsZerocoinMint()) {
if (IsInMainChain())
return mapBlockIndex.at(hashBlock)->GetBlockTime();
else
return nTimeReceived;
}
return nTime;
}
int CWalletTx::GetRequestCount() const
{
// Returns -1 if it wasn't being tracked
int nRequests = -1;
{
LOCK(pwallet->cs_wallet);
if (IsCoinBase()) {
// Generated block
if (hashBlock != 0) {
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
if (mi != pwallet->mapRequestCount.end())
nRequests = (*mi).second;
}
} else {
// Did anyone request this transaction?
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(GetHash());
if (mi != pwallet->mapRequestCount.end()) {
nRequests = (*mi).second;
// How about the block it's in?
if (nRequests == 0 && hashBlock != 0) {
map<uint256, int>::const_iterator mi = pwallet->mapRequestCount.find(hashBlock);
if (mi != pwallet->mapRequestCount.end())
nRequests = (*mi).second;
else
nRequests = 1; // If it's in someone else's block it must have got out
}
}
}
}
return nRequests;
}
void CWalletTx::GetAmounts(list<COutputEntry>& listReceived,
list<COutputEntry>& listSent,
CAmount& nFee,
string& strSentAccount,
const isminefilter& filter) const
{
nFee = 0;
listReceived.clear();
listSent.clear();
strSentAccount = strFromAccount;
// Compute fee:
CAmount nDebit = GetDebit(filter);
if (nDebit > 0) // debit>0 means we signed/sent this transaction
{
CAmount nValueOut = GetValueOut();
nFee = nDebit - nValueOut;
}
// Sent/received.
for (unsigned int i = 0; i < vout.size(); ++i) {
const CTxOut& txout = vout[i];
isminetype fIsMine = pwallet->IsMine(txout);
// Only need to handle txouts if AT LEAST one of these is true:
// 1) they debit from us (sent)
// 2) the output is to us (received)
if (nDebit > 0) {
// Don't report 'change' txouts
if (pwallet->IsChange(txout))
continue;
} else if (!(fIsMine & filter) && !IsZerocoinSpend())
continue;
// In either case, we need to get the destination address
CTxDestination address;
if (txout.scriptPubKey.IsZerocoinMint()) {
address = CNoDestination();
} else if (!ExtractDestination(txout.scriptPubKey, address)) {
if (!IsCoinStake() && !IsCoinBase()) {
LogPrintf("CWalletTx::GetAmounts: Unknown transaction type found, txid %s\n", this->GetHash().ToString());
}
address = CNoDestination();
}
COutputEntry output = {address, txout.nValue, (int)i};
// If we are debited by the transaction, add the output as a "sent" entry
if (nDebit > 0)
listSent.push_back(output);
// If we are receiving the output, add it as a "received" entry
if (fIsMine & filter)
listReceived.push_back(output);
}
}
void CWalletTx::GetAccountAmounts(const string& strAccount, CAmount& nReceived, CAmount& nSent, CAmount& nFee, const isminefilter& filter) const
{
nReceived = nSent = nFee = 0;
CAmount allFee;
string strSentAccount;
list<COutputEntry> listReceived;
list<COutputEntry> listSent;
GetAmounts(listReceived, listSent, allFee, strSentAccount, filter);
if (strAccount == strSentAccount) {
for (const COutputEntry& s : listSent)
nSent += s.amount;
nFee = allFee;
}
{
LOCK(pwallet->cs_wallet);
for (const COutputEntry& r : listReceived) {
if (pwallet->mapAddressBook.count(r.destination)) {
map<CTxDestination, CAddressBookData>::const_iterator mi = pwallet->mapAddressBook.find(r.destination);
if (mi != pwallet->mapAddressBook.end() && (*mi).second.name == strAccount)
nReceived += r.amount;
} else if (strAccount.empty()) {
nReceived += r.amount;
}
}
}
}
bool CWalletTx::WriteToDisk()
{
return CWalletDB(pwallet->strWalletFile).WriteTx(GetHash(), *this);
}
/**
* Scan the block chain (starting in pindexStart) for transactions
* from or to us. If fUpdate is true, found transactions that already
* exist in the wallet will be updated.
*/
int CWallet::ScanForWalletTransactions(CBlockIndex* pindexStart, bool fUpdate)
{
int ret = 0;
int64_t nNow = GetTime();
CBlockIndex* pindex = pindexStart;
{
LOCK2(cs_main, cs_wallet);
// no need to read and scan block, if block was created before
// our wallet birthday (as adjusted for block time variability)
while (pindex && nTimeFirstKey && (pindex->GetBlockTime() < (nTimeFirstKey - 7200)))
pindex = chainActive.Next(pindex);
ShowProgress(_("Rescanning..."), 0); // show rescan progress in GUI as dialog or on splashscreen, if -rescan on startup
double dProgressStart = Checkpoints::GuessVerificationProgress(pindex, false);
double dProgressTip = Checkpoints::GuessVerificationProgress(chainActive.Tip(), false);
while (pindex) {
if (pindex->nHeight % 100 == 0 && dProgressTip - dProgressStart > 0.0)
ShowProgress(_("Rescanning..."), std::max(1, std::min(99, (int)((Checkpoints::GuessVerificationProgress(pindex, false) - dProgressStart) / (dProgressTip - dProgressStart) * 100))));
CBlock block;
ReadBlockFromDisk(block, pindex);
BOOST_FOREACH (CTransaction& tx, block.vtx) {
if (AddToWalletIfInvolvingMe(tx, &block, fUpdate))
ret++;
}
pindex = chainActive.Next(pindex);
if (GetTime() >= nNow + 60) {
nNow = GetTime();
LogPrintf("Still rescanning. At block %d. Progress=%f\n", pindex->nHeight, Checkpoints::GuessVerificationProgress(pindex));
}
}
ShowProgress(_("Rescanning..."), 100); // hide progress dialog in GUI
}
return ret;
}
void CWallet::ReacceptWalletTransactions()
{
LOCK2(cs_main, cs_wallet);
BOOST_FOREACH (PAIRTYPE(const uint256, CWalletTx) & item, mapWallet) {
const uint256& wtxid = item.first;
CWalletTx& wtx = item.second;
assert(wtx.GetHash() == wtxid);
int nDepth = wtx.GetDepthInMainChain();
if (!wtx.IsCoinBase() && !wtx.IsCoinStake() && nDepth < 0) {
// Try to add to memory pool
LOCK(mempool.cs);
wtx.AcceptToMemoryPool(false);
}
}
}
bool CWalletTx::InMempool() const
{
LOCK(mempool.cs);
if (mempool.exists(GetHash())) {
return true;
}
return false;
}
void CWalletTx::RelayWalletTransaction(std::string strCommand)
{
if (!IsCoinBase()) {
if (GetDepthInMainChain() == 0) {
uint256 hash = GetHash();
LogPrintf("Relaying wtx %s\n", hash.ToString());
if (strCommand == "ix") {
mapTxLockReq.insert(make_pair(hash, (CTransaction) * this));
CreateNewLock(((CTransaction) * this));
RelayTransactionLockReq((CTransaction) * this, true);
} else {
RelayTransaction((CTransaction) * this);
}
}
}
}
set<uint256> CWalletTx::GetConflicts() const
{
set<uint256> result;
if (pwallet != NULL) {
uint256 myHash = GetHash();
result = pwallet->GetConflicts(myHash);
result.erase(myHash);
}
return result;
}
void CWallet::ResendWalletTransactions()
{
// Do this infrequently and randomly to avoid giving away
// that these are our transactions.
if (GetTime() < nNextResend)
return;
bool fFirst = (nNextResend == 0);
nNextResend = GetTime() + GetRand(30 * 60);
if (fFirst)
return;
// Only do it if there's been a new block since last time
if (nTimeBestReceived < nLastResend)
return;
nLastResend = GetTime();
// Rebroadcast any of our txes that aren't in a block yet
LogPrintf("ResendWalletTransactions()\n");
{
LOCK(cs_wallet);
// Sort them in chronological order
multimap<unsigned int, CWalletTx*> mapSorted;
BOOST_FOREACH (PAIRTYPE(const uint256, CWalletTx) & item, mapWallet) {
CWalletTx& wtx = item.second;
// Don't rebroadcast until it's had plenty of time that
// it should have gotten in already by now.
if (nTimeBestReceived - (int64_t)wtx.nTimeReceived > 5 * 60)
mapSorted.insert(make_pair(wtx.nTimeReceived, &wtx));
}
BOOST_FOREACH (PAIRTYPE(const unsigned int, CWalletTx*) & item, mapSorted) {
CWalletTx& wtx = *item.second;
wtx.RelayWalletTransaction();
}
}
}
/** @} */ // end of mapWallet
/** @defgroup Actions
*
* @{
*/
CAmount CWallet::GetBalance() const
{
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsTrusted())
nTotal += pcoin->GetAvailableCredit();
}
}
return nTotal;
}
CAmount CWallet::GetZerocoinBalance(bool fMatureOnly) const
{
CAmount nTotal = 0;
//! zerocoin specific fields
std::map<libzerocoin::CoinDenomination, unsigned int> myZerocoinSupply;
for (auto& denom : libzerocoin::zerocoinDenomList) {
myZerocoinSupply.insert(make_pair(denom, 0));
}
{
LOCK2(cs_main, cs_wallet);
// Get Unused coins
list<CZerocoinMint> listPubCoin = CWalletDB(strWalletFile).ListMintedCoins(true, fMatureOnly, true);
for (auto& mint : listPubCoin) {
libzerocoin::CoinDenomination denom = mint.GetDenomination();
nTotal += libzerocoin::ZerocoinDenominationToAmount(denom);
myZerocoinSupply.at(denom)++;
}
}
for (auto& denom : libzerocoin::zerocoinDenomList) {
LogPrint("zero","%s My coins for denomination %d pubcoin %s\n", __func__,denom, myZerocoinSupply.at(denom));
}
LogPrint("zero","Total value of coins %d\n",nTotal);
if (nTotal < 0 ) nTotal = 0; // Sanity never hurts
return nTotal;
}
CAmount CWallet::GetImmatureZerocoinBalance() const
{
return GetZerocoinBalance(false) - GetZerocoinBalance(true);
}
CAmount CWallet::GetUnconfirmedZerocoinBalance() const
{
CAmount nUnconfirmed = 0;
CWalletDB walletdb(pwalletMain->strWalletFile);
list<CZerocoinMint> listMints = walletdb.ListMintedCoins(true, false, true);
std::map<libzerocoin::CoinDenomination, int> mapUnconfirmed;
for (const auto& denom : libzerocoin::zerocoinDenomList){
mapUnconfirmed.insert(make_pair(denom, 0));
}
{
LOCK2(cs_main, cs_wallet);
for (auto& mint : listMints){
if (!mint.GetHeight() || mint.GetHeight() > chainActive.Height() - Params().Zerocoin_MintRequiredConfirmations()) {
libzerocoin::CoinDenomination denom = mint.GetDenomination();
nUnconfirmed += libzerocoin::ZerocoinDenominationToAmount(denom);
mapUnconfirmed.at(denom)++;
}
}
}
for (auto& denom : libzerocoin::zerocoinDenomList) {
LogPrint("zero","%s My unconfirmed coins for denomination %d pubcoin %s\n", __func__,denom, mapUnconfirmed.at(denom));
}
LogPrint("zero","Total value of unconfirmed coins %ld\n", nUnconfirmed);
if (nUnconfirmed < 0 ) nUnconfirmed = 0; // Sanity never hurts
return nUnconfirmed;
}
CAmount CWallet::GetUnlockedCoins() const
{
if (fLiteMode) return 0;
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsTrusted() && pcoin->GetDepthInMainChain() > 0)
nTotal += pcoin->GetUnlockedCredit();
}
}
return nTotal;
}
CAmount CWallet::GetLockedCoins() const
{
if (fLiteMode) return 0;
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsTrusted() && pcoin->GetDepthInMainChain() > 0)
nTotal += pcoin->GetLockedCredit();
}
}
return nTotal;
}
// Get a Map pairing the Denominations with the amount of Zerocoin for each Denomination
std::map<libzerocoin::CoinDenomination, CAmount> CWallet::GetMyZerocoinDistribution() const
{
std::map<libzerocoin::CoinDenomination, CAmount> spread;
for (const auto& denom : libzerocoin::zerocoinDenomList)
spread.insert(std::pair<libzerocoin::CoinDenomination, CAmount>(denom, 0));
{
LOCK2(cs_main, cs_wallet);
list<CZerocoinMint> listPubCoin = CWalletDB(strWalletFile).ListMintedCoins(true, true, true);
for (auto& mint : listPubCoin)
spread.at(mint.GetDenomination())++;
}
return spread;
}
CAmount CWallet::GetUnconfirmedBalance() const
{
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (!IsFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0))
nTotal += pcoin->GetAvailableCredit();
}
}
return nTotal;
}
CAmount CWallet::GetImmatureBalance() const
{
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
nTotal += pcoin->GetImmatureCredit();
}
}
return nTotal;
}
CAmount CWallet::GetWatchOnlyBalance() const
{
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsTrusted())
nTotal += pcoin->GetAvailableWatchOnlyCredit();
}
}
return nTotal;
}
CAmount CWallet::GetUnconfirmedWatchOnlyBalance() const
{
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (!IsFinalTx(*pcoin) || (!pcoin->IsTrusted() && pcoin->GetDepthInMainChain() == 0))
nTotal += pcoin->GetAvailableWatchOnlyCredit();
}
}
return nTotal;
}
CAmount CWallet::GetImmatureWatchOnlyBalance() const
{
CAmount nTotal = 0;
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
nTotal += pcoin->GetImmatureWatchOnlyCredit();
}
}
return nTotal;
}
/**
* populate vCoins with vector of available COutputs.
*/
void CWallet::AvailableCoins(vector<COutput>& vCoins, bool fOnlyConfirmed, const CCoinControl* coinControl, bool fIncludeZeroValue, AvailableCoinsType nCoinType, bool fUseIX, CAmount nExactValue) const
{
vCoins.clear();
{
LOCK2(cs_main, cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const uint256& wtxid = it->first;
const CWalletTx* pcoin = &(*it).second;
if (!CheckFinalTx(*pcoin))
continue;
if (fOnlyConfirmed && !pcoin->IsTrusted())
continue;
if ((pcoin->IsCoinBase() || pcoin->IsCoinStake()) && pcoin->GetBlocksToMaturity() > 0)
continue;
int nDepth = pcoin->GetDepthInMainChain(false);
// do not use IX for inputs that have less then 6 blockchain confirmations
if (fUseIX && nDepth < 6)
continue;
// We should not consider coins which aren't at least in our mempool
// It's possible for these to be conflicted via ancestors which we may never be able to detect
if (nDepth == 0 && !pcoin->InMempool())
continue;
for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
bool found = false;
if(nExactValue > 0)
{
found = pcoin->vout[i].nValue == nExactValue;
}
else
{
found = true;
}
if (!found) continue;
if (nCoinType == STAKABLE_COINS) {
if (pcoin->vout[i].IsZerocoinMint())
continue;
}
isminetype mine = IsMine(pcoin->vout[i]);
if (IsSpent(wtxid, i))
continue;
if (mine == ISMINE_NO)
continue;
if (mine == ISMINE_WATCH_ONLY)
continue;
if (IsLockedCoin((*it).first, i))
continue;
if (pcoin->vout[i].nValue <= 0 && !fIncludeZeroValue)
continue;
if (coinControl && coinControl->HasSelected() && !coinControl->fAllowOtherInputs && !coinControl->IsSelected((*it).first, i))
continue;
bool fIsSpendable = false;
if ((mine & ISMINE_SPENDABLE) != ISMINE_NO)
fIsSpendable = true;
if ((mine & ISMINE_MULTISIG) != ISMINE_NO)
fIsSpendable = true;
vCoins.emplace_back(COutput(pcoin, i, nDepth, fIsSpendable));
}
}
}
}
map<CBitcoinAddress, vector<COutput> > CWallet::AvailableCoinsByAddress(bool fConfirmed, CAmount maxCoinValue)
{
vector<COutput> vCoins;
AvailableCoins(vCoins, fConfirmed);
map<CBitcoinAddress, vector<COutput> > mapCoins;
BOOST_FOREACH (COutput out, vCoins) {
if (maxCoinValue > 0 && out.tx->vout[out.i].nValue > maxCoinValue)
continue;
CTxDestination address;
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, address))
continue;
mapCoins[CBitcoinAddress(address)].push_back(out);
}
return mapCoins;
}
static void ApproximateBestSubset(vector<pair<CAmount, pair<const CWalletTx*, unsigned int> > > vValue, const CAmount& nTotalLower, const CAmount& nTargetValue, vector<char>& vfBest, CAmount& nBest, int iterations = 1000)
{
vector<char> vfIncluded;
vfBest.assign(vValue.size(), true);
nBest = nTotalLower;
for (int nRep = 0; nRep < iterations && nBest != nTargetValue; nRep++) {
vfIncluded.assign(vValue.size(), false);
CAmount nTotal = 0;
bool fReachedTarget = false;
for (int nPass = 0; nPass < 2 && !fReachedTarget; nPass++) {
for (unsigned int i = 0; i < vValue.size(); i++) {
//The solver here uses a randomized algorithm,
//the randomness serves no real security purpose but is just
//needed to prevent degenerate behavior and it is important
//that the rng is fast. We do not use a constant random sequence,
//because there may be some privacy improvement by making
//the selection random.
if (nPass == 0 ? FastRandomContext().rand32() & 1 : !vfIncluded[i]) {
nTotal += vValue[i].first;
vfIncluded[i] = true;
if (nTotal >= nTargetValue) {
fReachedTarget = true;
if (nTotal < nBest) {
nBest = nTotal;
vfBest = vfIncluded;
}
nTotal -= vValue[i].first;
vfIncluded[i] = false;
}
}
}
}
}
}
bool CWallet::SelectStakeCoins(std::set<std::pair<const CWalletTx*, unsigned int> >& setCoins, CAmount nTargetAmount) const
{
vector<COutput> vCoins;
AvailableCoins(vCoins, true, NULL, false, STAKABLE_COINS);
CAmount nAmountSelected = 0;
for (const COutput& out : vCoins) {
//make sure not to outrun target amount
if (nAmountSelected + out.tx->vout[out.i].nValue > nTargetAmount)
continue;
//if zerocoinspend, then use the block time
int64_t nTxTime = out.tx->GetTxTime();
if (out.tx->IsZerocoinSpend()) {
if (!out.tx->IsInMainChain())
continue;
nTxTime = mapBlockIndex.at(out.tx->hashBlock)->GetBlockTime();
}
//check for min age
if (GetAdjustedTime() - nTxTime < nStakeMinAge)
continue;
//check that it is matured
if (out.nDepth < (out.tx->IsCoinStake() ? Params().COINBASE_MATURITY() : 10))
continue;
//add to our stake set
setCoins.insert(make_pair(out.tx, out.i));
nAmountSelected += out.tx->vout[out.i].nValue;
}
return true;
}
bool CWallet::MintableCoins()
{
CAmount nBalance = GetBalance();
if (mapArgs.count("-reservebalance") && !ParseMoney(mapArgs["-reservebalance"], nReserveBalance))
return error("MintableCoins() : invalid reserve balance amount");
if (nBalance <= nReserveBalance)
return false;
vector<COutput> vCoins;
AvailableCoins(vCoins, true);
for (const COutput& out : vCoins) {
int64_t nTxTime = out.tx->GetTxTime();
if (out.tx->IsZerocoinSpend()) {
if (!out.tx->IsInMainChain())
continue;
nTxTime = mapBlockIndex.at(out.tx->hashBlock)->GetBlockTime();
}
if (GetAdjustedTime() - nTxTime > nStakeMinAge)
return true;
}
return false;
}
bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, int nConfMine, int nConfTheirs, vector<COutput> vCoins, set<pair<const CWalletTx*, unsigned int> >& setCoinsRet, CAmount& nValueRet) const
{
setCoinsRet.clear();
nValueRet = 0;
// List of values less than target
pair<CAmount, pair<const CWalletTx*,unsigned int> > coinLowestLarger;
coinLowestLarger.first = std::numeric_limits<CAmount>::max();
coinLowestLarger.second.first = NULL;
vector<pair<CAmount, pair<const CWalletTx*,unsigned int> > > vValue;
CAmount nTotalLower = 0;
random_shuffle(vCoins.begin(), vCoins.end(), GetRandInt);
BOOST_FOREACH(const COutput &output, vCoins)
{
if (!output.fSpendable)
continue;
const CWalletTx *pcoin = output.tx;
if (output.nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? nConfMine : nConfTheirs))
continue;
int i = output.i;
CAmount n = pcoin->vout[i].nValue;
pair<CAmount,pair<const CWalletTx*,unsigned int> > coin = make_pair(n,make_pair(pcoin, i));
if (n == nTargetValue)
{
setCoinsRet.insert(coin.second);
nValueRet += coin.first;
return true;
}
else if (n < nTargetValue + CENT)
{
vValue.push_back(coin);
nTotalLower += n;
}
else if (n < coinLowestLarger.first)
{
coinLowestLarger = coin;
}
}
if (nTotalLower == nTargetValue)
{
for (unsigned int i = 0; i < vValue.size(); ++i)
{
setCoinsRet.insert(vValue[i].second);
nValueRet += vValue[i].first;
}
return true;
}
if (nTotalLower < nTargetValue)
{
if (coinLowestLarger.second.first == NULL)
return false;
setCoinsRet.insert(coinLowestLarger.second);
nValueRet += coinLowestLarger.first;
return true;
}
// Solve subset sum by stochastic approximation
sort(vValue.rbegin(), vValue.rend(), CompareValueOnly());
vector<char> vfBest;
CAmount nBest;
ApproximateBestSubset(vValue, nTotalLower, nTargetValue, vfBest, nBest, 1000);
if (nBest != nTargetValue && nTotalLower >= nTargetValue + CENT)
ApproximateBestSubset(vValue, nTotalLower, nTargetValue + CENT, vfBest, nBest, 1000);
// If we have a bigger coin and (either the stochastic approximation didn't find a good solution,
// or the next bigger coin is closer), return the bigger coin
if (coinLowestLarger.second.first &&
((nBest != nTargetValue && nBest < nTargetValue + CENT) || coinLowestLarger.first <= nBest))
{
setCoinsRet.insert(coinLowestLarger.second);
nValueRet += coinLowestLarger.first;
}
else {
for (unsigned int i = 0; i < vValue.size(); i++)
if (vfBest[i])
{
setCoinsRet.insert(vValue[i].second);
nValueRet += vValue[i].first;
}
LogPrint("selectcoins", "SelectCoins() best subset: ");
for (unsigned int i = 0; i < vValue.size(); i++)
if (vfBest[i])
LogPrint("selectcoins", "%s ", FormatMoney(vValue[i].first));
LogPrint("selectcoins", "total %s\n", FormatMoney(nBest));
}
return true;
}
bool CWallet::SelectCoins(const CAmount& nTargetValue, set<pair<const CWalletTx*, unsigned int> >& setCoinsRet, CAmount& nValueRet, const CCoinControl* coinControl, AvailableCoinsType coin_type, bool useIX) const
{
// Note: this function should never be used for "always free" tx types like dstx
vector<COutput> vCoins;
AvailableCoins(vCoins, true, coinControl, false, coin_type, useIX);
// coin control -> return all selected outputs (we want all selected to go into the transaction for sure)
if (coinControl && coinControl->HasSelected()) {
BOOST_FOREACH (const COutput& out, vCoins) {
if (!out.fSpendable)
continue;
nValueRet += out.tx->vout[out.i].nValue;
setCoinsRet.insert(make_pair(out.tx, out.i));
}
return (nValueRet >= nTargetValue);
}
return (SelectCoinsMinConf(nTargetValue, 1, 6, vCoins, setCoinsRet, nValueRet) ||
SelectCoinsMinConf(nTargetValue, 1, 1, vCoins, setCoinsRet, nValueRet) ||
(bSpendZeroConfChange && SelectCoinsMinConf(nTargetValue, 0, 1, vCoins, setCoinsRet, nValueRet)));
}
int CWallet::CountInputsWithAmount(CAmount nInputAmount)
{
CAmount nTotal = 0;
{
LOCK(cs_wallet);
for (map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); ++it) {
const CWalletTx* pcoin = &(*it).second;
if (pcoin->IsTrusted()) {
int nDepth = pcoin->GetDepthInMainChain(false);
for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
COutput out = COutput(pcoin, i, nDepth, true);
CTxIn vin = CTxIn(out.tx->GetHash(), out.i);
if (out.tx->vout[out.i].nValue != nInputAmount) continue;
if (IsSpent(out.tx->GetHash(), i) || IsMine(pcoin->vout[i]) != ISMINE_SPENDABLE) continue;
nTotal++;
}
}
}
}
return nTotal;
}
bool CWallet::ConvertList(std::vector<CTxIn> vCoins, std::vector<CAmount>& vecAmounts)
{
BOOST_FOREACH (CTxIn i, vCoins) {
if (mapWallet.count(i.prevout.hash)) {
CWalletTx& wtx = mapWallet[i.prevout.hash];
if (i.prevout.n < wtx.vout.size()) {
vecAmounts.push_back(wtx.vout[i.prevout.n].nValue);
}
} else {
LogPrintf("ConvertList -- Couldn't find transaction\n");
}
}
return true;
}
bool CWallet::CreateTransaction(const vector<pair<CScript, CAmount> >& vecSend,
CWalletTx& wtxNew,
CReserveKey& reservekey,
CAmount& nFeeRet,
std::string& strFailReason,
const CCoinControl* coinControl,
AvailableCoinsType coin_type,
bool useIX,
CAmount nFeePay)
{
if (useIX && nFeePay < CENT) nFeePay = CENT;
CAmount nValue = 0;
BOOST_FOREACH (const PAIRTYPE(CScript, CAmount) & s, vecSend) {
if (nValue < 0) {
strFailReason = _("Transaction amounts must be positive");
return false;
}
nValue += s.second;
}
if (vecSend.empty() || nValue < 0) {
strFailReason = _("Transaction amounts must be positive");
return false;
}
wtxNew.fTimeReceivedIsTxTime = true;
wtxNew.BindWallet(this);
CMutableTransaction txNew;
{
LOCK2(cs_main, cs_wallet);
{
nFeeRet = 0;
if (nFeePay > 0) nFeeRet = nFeePay;
while (true) {
txNew.vin.clear();
txNew.vout.clear();
wtxNew.fFromMe = true;
CAmount nTotalValue = nValue + nFeeRet;
double dPriority = 0;
// vouts to the payees
if (coinControl && !coinControl->fSplitBlock) {
BOOST_FOREACH (const PAIRTYPE(CScript, CAmount) & s, vecSend) {
CTxOut txout(s.second, s.first);
if (txout.IsDust(::minRelayTxFee)) {
strFailReason = _("Transaction amount too small");
return false;
}
txNew.vout.push_back(txout);
}
} else //UTXO Splitter Transaction
{
int nSplitBlock;
if (coinControl)
nSplitBlock = coinControl->nSplitBlock;
else
nSplitBlock = 1;
BOOST_FOREACH (const PAIRTYPE(CScript, CAmount) & s, vecSend) {
for (int i = 0; i < nSplitBlock; i++) {
if (i == nSplitBlock - 1) {
uint64_t nRemainder = s.second % nSplitBlock;
txNew.vout.push_back(CTxOut((s.second / nSplitBlock) + nRemainder, s.first));
} else
txNew.vout.push_back(CTxOut(s.second / nSplitBlock, s.first));
}
}
}
// Choose coins to use
set<pair<const CWalletTx*, unsigned int> > setCoins;
CAmount nValueIn = 0;
if (!SelectCoins(nTotalValue, setCoins, nValueIn, coinControl, coin_type, useIX)) {
if (coin_type == ALL_COINS) {
strFailReason = _("Insufficient funds.");
} else {
strFailReason = _("Unable to locate enough Obfuscation denominated funds for this transaction.");
strFailReason += " " + _("Obfuscation uses exact denominated amounts to send funds, you might simply need to anonymize some more coins.");
}
if (useIX) {
strFailReason += " " + _("SwiftX requires inputs with at least 6 confirmations, you might need to wait a few minutes and try again.");
}
return false;
}
BOOST_FOREACH (PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setCoins) {
CAmount nCredit = pcoin.first->vout[pcoin.second].nValue;
//The coin age after the next block (depth+1) is used instead of the current,
//reflecting an assumption the user would accept a bit more delay for
//a chance at a free transaction.
//But mempool inputs might still be in the mempool, so their age stays 0
int age = pcoin.first->GetDepthInMainChain();
if (age != 0)
age += 1;
dPriority += (double)nCredit * age;
}
CAmount nChange = nValueIn - nValue - nFeeRet;
if (nChange > 0) {
// Fill a vout to ourself
// TODO: pass in scriptChange instead of reservekey so
// change transaction isn't always pay-to-divi-address
CScript scriptChange;
// coin control: send change to custom address
if (coinControl && !boost::get<CNoDestination>(&coinControl->destChange))
scriptChange = GetScriptForDestination(coinControl->destChange);
// no coin control: send change to newly generated address
else {
// Note: We use a new key here to keep it from being obvious which side is the change.
// The drawback is that by not reusing a previous key, the change may be lost if a
// backup is restored, if the backup doesn't have the new private key for the change.
// If we reused the old key, it would be possible to add code to look for and
// rediscover unknown transactions that were written with keys of ours to recover
// post-backup change.
// Reserve a new key pair from key pool
CPubKey vchPubKey;
bool ret;
ret = reservekey.GetReservedKey(vchPubKey, true);
assert(ret); // should never fail, as we just unlocked
scriptChange = GetScriptForDestination(vchPubKey.GetID());
}
CTxOut newTxOut(nChange, scriptChange);
// Never create dust outputs; if we would, just
// add the dust to the fee.
if (newTxOut.IsDust(::minRelayTxFee)) {
nFeeRet += nChange;
nChange = 0;
reservekey.ReturnKey();
} else {
// Insert change txn at random position:
vector<CTxOut>::iterator position = txNew.vout.begin() + GetRandInt(txNew.vout.size() + 1);
txNew.vout.insert(position, newTxOut);
}
} else
reservekey.ReturnKey();
// Fill vin
BOOST_FOREACH (const PAIRTYPE(const CWalletTx*, unsigned int) & coin, setCoins)
txNew.vin.push_back(CTxIn(coin.first->GetHash(), coin.second));
// Sign
int nIn = 0;
BOOST_FOREACH (const PAIRTYPE(const CWalletTx*, unsigned int) & coin, setCoins)
if (!SignSignature(*this, *coin.first, txNew, nIn++)) {
strFailReason = _("Signing transaction failed");
return false;
}
// Embed the constructed transaction data in wtxNew.
*static_cast<CTransaction*>(&wtxNew) = CTransaction(txNew);
// Limit size
unsigned int nBytes = ::GetSerializeSize(*(CTransaction*)&wtxNew, SER_NETWORK, PROTOCOL_VERSION);
if (nBytes >= MAX_STANDARD_TX_SIZE) {
strFailReason = _("Transaction too large");
return false;
}
dPriority = wtxNew.ComputePriority(dPriority, nBytes);
// Can we complete this as a free transaction?
if (fSendFreeTransactions && nBytes <= MAX_FREE_TRANSACTION_CREATE_SIZE) {
// Not enough fee: enough priority?
double dPriorityNeeded = mempool.estimatePriority(nTxConfirmTarget);
// Not enough mempool history to estimate: use hard-coded AllowFree.
if (dPriorityNeeded <= 0 && AllowFree(dPriority))
break;
// Small enough, and priority high enough, to send for free
if (dPriorityNeeded > 0 && dPriority >= dPriorityNeeded)
break;
}
CAmount nFeeNeeded = max(nFeePay, GetMinimumFee(nValue, nBytes, nTxConfirmTarget, mempool));
// If we made it here and we aren't even able to meet the relay fee on the next pass, give up
// because we must be at the maximum allowed fee.
if (nFeeNeeded < ::minRelayTxFee.GetFee(nBytes)) {
strFailReason = _("Transaction too large for fee policy");
return false;
}
if (nFeeRet >= nFeeNeeded) // Done, enough fee included
break;
// Include more fee and try again.
nFeeRet = nFeeNeeded;
continue;
}
}
}
return true;
}
bool CWallet::CreateTransaction(CScript scriptPubKey, const CAmount& nValue, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, std::string& strFailReason, const CCoinControl* coinControl, AvailableCoinsType coin_type, bool useIX, CAmount nFeePay)
{
vector<pair<CScript, CAmount> > vecSend;
vecSend.push_back(make_pair(scriptPubKey, nValue));
return CreateTransaction(vecSend, wtxNew, reservekey, nFeeRet, strFailReason, coinControl, coin_type, useIX, nFeePay);
}
// ppcoin: create coin stake transaction
bool CWallet::CreateCoinStake(const CKeyStore& keystore, unsigned int nBits, int64_t nSearchInterval, CMutableTransaction& txNew, unsigned int& nTxNewTime)
{
// The following split & combine thresholds are important to security
// Should not be adjusted if you don't understand the consequences
//int64_t nCombineThreshold = 0;
txNew.vin.clear();
txNew.vout.clear();
// Mark coin stake transaction
CScript scriptEmpty;
scriptEmpty.clear();
txNew.vout.push_back(CTxOut(0, scriptEmpty));
// Choose coins to use
CAmount nBalance = GetBalance();
if (mapArgs.count("-reservebalance") && !ParseMoney(mapArgs["-reservebalance"], nReserveBalance))
return error("CreateCoinStake : invalid reserve balance amount");
if (nBalance <= nReserveBalance)
return false;
// presstab HyperStake - Initialize as static and don't update the set on every run of CreateCoinStake() in order to lighten resource use
static std::set<pair<const CWalletTx*, unsigned int> > setStakeCoins;
static int nLastStakeSetUpdate = 0;
if (GetTime() - nLastStakeSetUpdate > nStakeSetUpdateTime) {
setStakeCoins.clear();
if (!SelectStakeCoins(setStakeCoins, nBalance - nReserveBalance))
return false;
nLastStakeSetUpdate = GetTime();
}
if (setStakeCoins.empty())
return false;
vector<const CWalletTx*> vwtxPrev;
CAmount nCredit = 0;
CScript scriptPubKeyKernel;
//prevent staking a time that won't be accepted
if (GetAdjustedTime() <= chainActive.Tip()->nTime)
MilliSleep(10000);
const CBlockIndex* pIndex0 = chainActive.Tip();
auto blockSubsidity = GetBlockSubsidity(pIndex0->nHeight + 1);
BOOST_FOREACH (PAIRTYPE(const CWalletTx*, unsigned int) pcoin, setStakeCoins) {
//make sure that enough time has elapsed between
CBlockIndex* pindex = NULL;
BlockMap::iterator it = mapBlockIndex.find(pcoin.first->hashBlock);
if (it != mapBlockIndex.end())
pindex = it->second;
else {
if (fDebug)
LogPrintf("CreateCoinStake() failed to find block index \n");
continue;
}
// Read block header
CBlockHeader block = pindex->GetBlockHeader();
bool fKernelFound = false;
uint256 hashProofOfStake = 0;
COutPoint prevoutStake = COutPoint(pcoin.first->GetHash(), pcoin.second);
nTxNewTime = GetAdjustedTime();
//iterates each utxo inside of CheckStakeKernelHash()
if (CheckStakeKernelHash(nBits, block, *pcoin.first, prevoutStake, nTxNewTime, nHashDrift, false, hashProofOfStake, true)) {
//Double check that this will pass time requirements
if (nTxNewTime <= chainActive.Tip()->GetMedianTimePast()) {
LogPrintf("CreateCoinStake() : kernel found, but it is too far in the past \n");
continue;
}
// Found a kernel
if (fDebug && GetBoolArg("-printcoinstake", false))
LogPrintf("CreateCoinStake : kernel found\n");
vector<valtype> vSolutions;
txnouttype whichType;
CScript scriptPubKeyOut;
scriptPubKeyKernel = pcoin.first->vout[pcoin.second].scriptPubKey;
if (!Solver(scriptPubKeyKernel, whichType, vSolutions)) {
LogPrintf("CreateCoinStake : failed to parse kernel\n");
break;
}
if (fDebug && GetBoolArg("-printcoinstake", false))
LogPrintf("CreateCoinStake : parsed kernel type=%d\n", whichType);
if (whichType != TX_PUBKEY && whichType != TX_PUBKEYHASH) {
if (fDebug && GetBoolArg("-printcoinstake", false))
LogPrintf("CreateCoinStake : no support for kernel type=%d\n", whichType);
break; // only support pay to public key and pay to address
}
scriptPubKeyOut = scriptPubKeyKernel;
txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
vwtxPrev.push_back(pcoin.first);
txNew.vout.push_back(CTxOut(0, scriptPubKeyOut));
//presstab HyperStake - calculate the total size of our new output including the stake reward so that we can use it to decide whether to split the stake outputs
uint64_t nTotalSize = pcoin.first->vout[pcoin.second].nValue + blockSubsidity.nStakeReward;
//presstab HyperStake - if MultiSend is set to send in coinstake we will add our outputs here (values asigned further down)
if (nTotalSize > nStakeSplitThreshold * COIN)
txNew.vout.push_back(CTxOut(0, scriptPubKeyOut)); //split stake
if (fDebug && GetBoolArg("-printcoinstake", false))
LogPrintf("CreateCoinStake : added kernel type=%d\n", whichType);
fKernelFound = true;
break;
}
if (fKernelFound)
break; // if kernel is found stop searching
}
if (nCredit == 0 || nCredit > nBalance - nReserveBalance)
return false;
// Calculate reward
CAmount nReward = blockSubsidity.nStakeReward;
nCredit += nReward;
if(txNew.vout.size() == 2)
{
const CAmount nCombineThreshold = (nStakeSplitThreshold / 2) * COIN;
using Entry = std::pair<const CWalletTx*, unsigned int>;
std::vector<Entry> vCombineCandidates;
for(auto &&pcoin : setStakeCoins)
{
// Attempt to add more inputs
// Only add coins of the same key/address as kernel
if (pcoin.first->vout[pcoin.second].scriptPubKey == txNew.vout[1].scriptPubKey &&
pcoin.first->GetHash() != txNew.vin[0].prevout.hash)
{
// Do not add additional significant input
if (pcoin.first->vout[pcoin.second].nValue + nCredit > nCombineThreshold)
continue;
vCombineCandidates.push_back(pcoin);
}
}
std::sort(std::begin(vCombineCandidates), std::end(vCombineCandidates), [](const Entry &left, const Entry &right) {
return left.first->vout[left.second].nValue < right.first->vout[right.second].nValue;
});
for(auto &&pcoin : vCombineCandidates)
{
// Stop adding more inputs if already too many inputs
if (txNew.vin.size() >= MAX_KERNEL_COMBINED_INPUTS)
break;
// Stop adding more inputs if value is already pretty significant
if (nCredit > nCombineThreshold)
break;
// Stop adding inputs if reached reserve limit
if (nCredit + pcoin.first->vout[pcoin.second].nValue > nBalance - nReserveBalance)
break;
// Can't add anymore, cause vector is sorted
if (nCredit + pcoin.first->vout[pcoin.second].nValue > nCombineThreshold)
break;
txNew.vin.push_back(CTxIn(pcoin.first->GetHash(), pcoin.second));
nCredit += pcoin.first->vout[pcoin.second].nValue;
vwtxPrev.push_back(pcoin.first);
}
}
// Set output amount
if (txNew.vout.size() == 3) {
txNew.vout[1].nValue = nCredit / 2;
txNew.vout[2].nValue = nCredit - txNew.vout[1].nValue;
} else {
txNew.vout[1].nValue = nCredit;
}
// Masternode payment
FillBlockPayee(txNew, blockSubsidity, true);
// Sign
int nIn = 0;
for (const CWalletTx* pcoin : vwtxPrev) {
if (!SignSignature(*this, *pcoin, txNew, nIn++))
return error("CreateCoinStake : failed to sign coinstake");
}
// Successfully generated coinstake
nLastStakeSetUpdate = 0; //this will trigger stake set to repopulate next round
return true;
}
/**
* Call after CreateTransaction unless you want to abort
*/
bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, std::string strCommand)
{
{
LOCK2(cs_main, cs_wallet);
LogPrintf("CommitTransaction:\n%s", wtxNew.ToString());
{
// This is only to keep the database open to defeat the auto-flush for the
// duration of this scope. This is the only place where this optimization
// maybe makes sense; please don't do it anywhere else.
CWalletDB* pwalletdb = fFileBacked ? new CWalletDB(strWalletFile, "r") : NULL;
// Take key pair from key pool so it won't be used again
reservekey.KeepKey();
// Add tx to wallet, because if it has change it's also ours,
// otherwise just for transaction history.
AddToWallet(wtxNew);
// Notify that old coins are spent
if (!wtxNew.IsZerocoinSpend()) {
set<uint256> updated_hahes;
BOOST_FOREACH (const CTxIn& txin, wtxNew.vin) {
// notify only once
if (updated_hahes.find(txin.prevout.hash) != updated_hahes.end()) continue;
CWalletTx& coin = mapWallet[txin.prevout.hash];
coin.BindWallet(this);
NotifyTransactionChanged(this, txin.prevout.hash, CT_UPDATED);
updated_hahes.insert(txin.prevout.hash);
}
}
if (fFileBacked)
delete pwalletdb;
}
// Track how many getdata requests our transaction gets
mapRequestCount[wtxNew.GetHash()] = 0;
// Broadcast
if (!wtxNew.AcceptToMemoryPool(false)) {
// This must not fail. The transaction has already been signed and recorded.
LogPrintf("CommitTransaction() : Error: Transaction not valid\n");
return false;
}
wtxNew.RelayWalletTransaction(strCommand);
}
return true;
}
CAmount CWallet::GetMinimumFee(const CAmount &nTransactionValue, unsigned int nTxBytes, unsigned int nConfirmTarget, const CTxMemPool& pool)
{
// // payTxFee is user-set "I want to pay this much"
// CAmount nFeeNeeded = payTxFee.GetFee(nTxBytes);
// // user selected total at least (default=true)
// if (fPayAtLeastCustomFee && nFeeNeeded > 0 && nFeeNeeded < payTxFee.GetFeePerK())
// nFeeNeeded = payTxFee.GetFeePerK();
CAmount nFeeNeeded = (nTransactionValue / nTransactionValueMultiplier) * std::max(nTxBytes / nTransactionSizeMultiplier, 1u);
// User didn't set: use -txconfirmtarget to estimate...
if (nFeeNeeded == 0)
nFeeNeeded = pool.estimateFee(nConfirmTarget).GetFee(nTxBytes);
// ... unless we don't have enough mempool data, in which case fall
// back to a hard-coded fee
if (nFeeNeeded == 0)
nFeeNeeded = minTxFee.GetFee(nTxBytes);
// prevent user from paying a non-sense fee (like 1 satoshi): 0 < fee < minRelayFee
if (nFeeNeeded < ::minRelayTxFee.GetFee(nTxBytes))
nFeeNeeded = ::minRelayTxFee.GetFee(nTxBytes);
// But always obey the maximum
if (nFeeNeeded > maxTxFee)
nFeeNeeded = maxTxFee;
return nFeeNeeded;
}
CAmount CWallet::GetTotalValue(std::vector<CTxIn> vCoins)
{
CAmount nTotalValue = 0;
CWalletTx wtx;
BOOST_FOREACH (CTxIn i, vCoins) {
if (mapWallet.count(i.prevout.hash)) {
CWalletTx& wtx = mapWallet[i.prevout.hash];
if (i.prevout.n < wtx.vout.size()) {
nTotalValue += wtx.vout[i.prevout.n].nValue;
}
} else {
LogPrintf("GetTotalValue -- Couldn't find transaction\n");
}
}
return nTotalValue;
}
DBErrors CWallet::LoadWallet(bool& fFirstRunRet)
{
if (!fFileBacked)
return DB_LOAD_OK;
fFirstRunRet = false;
DBErrors nLoadWalletRet = CWalletDB(strWalletFile,"cr+").LoadWallet(this);
if (nLoadWalletRet == DB_NEED_REWRITE)
{
if (CDB::Rewrite(strWalletFile, "\x04pool"))
{
LOCK(cs_wallet);
setInternalKeyPool.clear();
setExternalKeyPool.clear();
// Note: can't top-up keypool here, because wallet is locked.
// User will be prompted to unlock wallet the next operation
// that requires a new key.
}
}
// {
// LOCK2(cs_main, cs_wallet);
// for (auto& pair : mapWallet) {
// for(unsigned int i = 0; i < pair.second.tx->vout.size(); ++i) {
// if (IsMine(pair.second.tx->vout[i]) && !IsSpent(pair.first, i)) {
// setWalletUTXO.insert(COutPoint(pair.first, i));
// }
// }
// }
// }
if (nLoadWalletRet != DB_LOAD_OK)
return nLoadWalletRet;
fFirstRunRet = !vchDefaultKey.IsValid();
uiInterface.LoadWallet(this);
return DB_LOAD_OK;
}
DBErrors CWallet::ZapWalletTx(std::vector<CWalletTx>& vWtx)
{
if (!fFileBacked)
return DB_LOAD_OK;
DBErrors nZapWalletTxRet = CWalletDB(strWalletFile,"cr+").ZapWalletTx(this, vWtx);
if (nZapWalletTxRet == DB_NEED_REWRITE)
{
if (CDB::Rewrite(strWalletFile, "\x04pool"))
{
LOCK(cs_wallet);
setInternalKeyPool.clear();
setExternalKeyPool.clear();
// Note: can't top-up keypool here, because wallet is locked.
// User will be prompted to unlock wallet the next operation
// that requires a new key.
}
}
if (nZapWalletTxRet != DB_LOAD_OK)
return nZapWalletTxRet;
return DB_LOAD_OK;
}
bool CWallet::SetAddressBook(const CTxDestination& address, const string& strName, const string& strPurpose)
{
bool fUpdated = false;
{
LOCK(cs_wallet); // mapAddressBook
std::map<CTxDestination, CAddressBookData>::iterator mi = mapAddressBook.find(address);
fUpdated = mi != mapAddressBook.end();
mapAddressBook[address].name = strName;
if (!strPurpose.empty()) /* update purpose only if requested */
mapAddressBook[address].purpose = strPurpose;
}
NotifyAddressBookChanged(this, address, strName, ::IsMine(*this, address) != ISMINE_NO,
strPurpose, (fUpdated ? CT_UPDATED : CT_NEW));
if (!fFileBacked)
return false;
if (!strPurpose.empty() && !CWalletDB(strWalletFile).WritePurpose(CBitcoinAddress(address).ToString(), strPurpose))
return false;
return CWalletDB(strWalletFile).WriteName(CBitcoinAddress(address).ToString(), strName);
}
bool CWallet::DelAddressBook(const CTxDestination& address)
{
{
LOCK(cs_wallet); // mapAddressBook
if (fFileBacked) {
// Delete destdata tuples associated with address
std::string strAddress = CBitcoinAddress(address).ToString();
BOOST_FOREACH (const PAIRTYPE(string, string) & item, mapAddressBook[address].destdata) {
CWalletDB(strWalletFile).EraseDestData(strAddress, item.first);
}
}
mapAddressBook.erase(address);
}
NotifyAddressBookChanged(this, address, "", ::IsMine(*this, address) != ISMINE_NO, "", CT_DELETED);
if (!fFileBacked)
return false;
CWalletDB(strWalletFile).ErasePurpose(CBitcoinAddress(address).ToString());
return CWalletDB(strWalletFile).EraseName(CBitcoinAddress(address).ToString());
}
bool CWallet::SetDefaultKey(const CPubKey& vchPubKey)
{
if (fFileBacked) {
if (!CWalletDB(strWalletFile).WriteDefaultKey(vchPubKey))
return false;
}
vchDefaultKey = vchPubKey;
return true;
}
/**
* Mark old keypool keys as used,
* and generate all new keys
*/
bool CWallet::NewKeyPool()
{
{
LOCK(cs_wallet);
CWalletDB walletdb(strWalletFile);
BOOST_FOREACH(int64_t nIndex, setInternalKeyPool) {
walletdb.ErasePool(nIndex);
}
setInternalKeyPool.clear();
BOOST_FOREACH(int64_t nIndex, setExternalKeyPool) {
walletdb.ErasePool(nIndex);
}
setExternalKeyPool.clear();
if (IsLocked())
return false;
if (!TopUpKeyPool())
return false;
LogPrintf("CWallet::NewKeyPool rewrote keypool\n");
}
return true;
}
bool CWallet::TopUpKeyPool(unsigned int kpSize)
{
{
LOCK(cs_wallet);
if (IsLocked(true))
return false;
// Top up key pool
unsigned int nTargetSize;
if (kpSize > 0)
nTargetSize = kpSize;
else
nTargetSize = std::max(GetArg("-keypool", DEFAULT_KEYPOOL_SIZE), (int64_t) 0);
// count amount of available keys (internal, external)
// make sure the keypool of external and internal keys fits the user selected target (-keypool)
int64_t amountExternal = setExternalKeyPool.size();
int64_t amountInternal = setInternalKeyPool.size();
int64_t missingExternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - amountExternal, (int64_t) 0);
int64_t missingInternal = std::max(std::max((int64_t) nTargetSize, (int64_t) 1) - amountInternal, (int64_t) 0);
if (!IsHDEnabled())
{
// don't create extra internal keys
missingInternal = 0;
} else {
nTargetSize *= 2;
}
bool fInternal = false;
CWalletDB walletdb(strWalletFile);
for (int64_t i = missingInternal + missingExternal; i--;)
{
int64_t nEnd = 1;
if (i < missingInternal) {
fInternal = true;
}
if (!setInternalKeyPool.empty()) {
nEnd = *(--setInternalKeyPool.end()) + 1;
}
if (!setExternalKeyPool.empty()) {
nEnd = std::max(nEnd, *(--setExternalKeyPool.end()) + 1);
}
// TODO: implement keypools for all accounts?
if (!walletdb.WritePool(nEnd, CKeyPool(GenerateNewKey(0, fInternal), fInternal)))
throw std::runtime_error(std::string(__func__) + ": writing generated key failed");
if (fInternal) {
setInternalKeyPool.insert(nEnd);
} else {
setExternalKeyPool.insert(nEnd);
}
LogPrintf("keypool added key %d, size=%u, internal=%d\n", nEnd, setInternalKeyPool.size() + setExternalKeyPool.size(), fInternal);
double dProgress = 100.f * nEnd / (nTargetSize + 1);
std::string strMsg = strprintf(_("Loading wallet... (%3.2f %%)"), dProgress);
uiInterface.InitMessage(strMsg);
}
}
return true;
}
void CWallet::ReserveKeyFromKeyPool(int64_t& nIndex, CKeyPool& keypool, bool fInternal)
{
nIndex = -1;
keypool.vchPubKey = CPubKey();
{
LOCK(cs_wallet);
if (!IsLocked(true))
TopUpKeyPool();
fInternal = fInternal && IsHDEnabled();
std::set<int64_t>& setKeyPool = fInternal ? setInternalKeyPool : setExternalKeyPool;
// Get the oldest key
if(setKeyPool.empty())
return;
CWalletDB walletdb(strWalletFile);
nIndex = *setKeyPool.begin();
setKeyPool.erase(nIndex);
if (!walletdb.ReadPool(nIndex, keypool)) {
throw std::runtime_error(std::string(__func__) + ": read failed");
}
if (!HaveKey(keypool.vchPubKey.GetID())) {
throw std::runtime_error(std::string(__func__) + ": unknown key in key pool");
}
if (keypool.fInternal != fInternal) {
throw std::runtime_error(std::string(__func__) + ": keypool entry misclassified");
}
assert(keypool.vchPubKey.IsValid());
LogPrintf("keypool reserve %d\n", nIndex);
}
}
void CWallet::KeepKey(int64_t nIndex)
{
// Remove from key pool
if (fFileBacked) {
CWalletDB walletdb(strWalletFile);
walletdb.ErasePool(nIndex);
}
LogPrintf("keypool keep %d\n", nIndex);
}
void CWallet::ReturnKey(int64_t nIndex, bool fInternal)
{
// Return to key pool
{
LOCK(cs_wallet);
if (fInternal) {
setInternalKeyPool.insert(nIndex);
} else {
setExternalKeyPool.insert(nIndex);
}
}
LogPrintf("keypool return %d\n", nIndex);
}
bool CWallet::GetKeyFromPool(CPubKey& result, bool fInternal)
{
int64_t nIndex = 0;
CKeyPool keypool;
{
LOCK(cs_wallet);
ReserveKeyFromKeyPool(nIndex, keypool, fInternal);
if (nIndex == -1) {
if (IsLocked()) return false;
result = GenerateNewKey(0, fInternal);
return true;
}
KeepKey(nIndex);
result = keypool.vchPubKey;
}
return true;
}
static int64_t GetOldestKeyInPool(const std::set<int64_t>& setKeyPool, CWalletDB& walletdb) {
CKeyPool keypool;
int64_t nIndex = *(setKeyPool.begin());
if (!walletdb.ReadPool(nIndex, keypool)) {
throw std::runtime_error(std::string(__func__) + ": read oldest key in keypool failed");
}
assert(keypool.vchPubKey.IsValid());
return keypool.nTime;
}
int64_t CWallet::GetOldestKeyPoolTime()
{
LOCK(cs_wallet);
// if the keypool is empty, return <NOW>
if (setExternalKeyPool.empty() && setInternalKeyPool.empty())
return GetTime();
CWalletDB walletdb(strWalletFile);
int64_t oldestKey = -1;
// load oldest key from keypool, get time and return
if (!setInternalKeyPool.empty()) {
oldestKey = std::max(GetOldestKeyInPool(setInternalKeyPool, walletdb), oldestKey);
}
if (!setExternalKeyPool.empty()) {
oldestKey = std::max(GetOldestKeyInPool(setExternalKeyPool, walletdb), oldestKey);
}
return oldestKey;
}
std::map<CTxDestination, CAmount> CWallet::GetAddressBalances()
{
map<CTxDestination, CAmount> balances;
{
LOCK(cs_wallet);
BOOST_FOREACH (PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet) {
CWalletTx* pcoin = &walletEntry.second;
if (!IsFinalTx(*pcoin) || !pcoin->IsTrusted())
continue;
if (pcoin->IsCoinBase() && pcoin->GetBlocksToMaturity() > 0)
continue;
int nDepth = pcoin->GetDepthInMainChain();
if (nDepth < (pcoin->IsFromMe(ISMINE_ALL) ? 0 : 1))
continue;
for (unsigned int i = 0; i < pcoin->vout.size(); i++) {
CTxDestination addr;
if (!IsMine(pcoin->vout[i]))
continue;
if (!ExtractDestination(pcoin->vout[i].scriptPubKey, addr))
continue;
CAmount n = IsSpent(walletEntry.first, i) ? 0 : pcoin->vout[i].nValue;
if (!balances.count(addr))
balances[addr] = 0;
balances[addr] += n;
}
}
}
return balances;
}
set<set<CTxDestination> > CWallet::GetAddressGroupings()
{
AssertLockHeld(cs_wallet); // mapWallet
set<set<CTxDestination> > groupings;
set<CTxDestination> grouping;
BOOST_FOREACH (PAIRTYPE(uint256, CWalletTx) walletEntry, mapWallet) {
CWalletTx* pcoin = &walletEntry.second;
if (pcoin->vin.size() > 0) {
bool any_mine = false;
// group all input addresses with each other
BOOST_FOREACH (CTxIn txin, pcoin->vin) {
CTxDestination address;
if (!IsMine(txin)) /* If this input isn't mine, ignore it */
continue;
if (!ExtractDestination(mapWallet[txin.prevout.hash].vout[txin.prevout.n].scriptPubKey, address))
continue;
grouping.insert(address);
any_mine = true;
}
// group change with input addresses
if (any_mine) {
BOOST_FOREACH (CTxOut txout, pcoin->vout)
if (IsChange(txout)) {
CTxDestination txoutAddr;
if (!ExtractDestination(txout.scriptPubKey, txoutAddr))
continue;
grouping.insert(txoutAddr);
}
}
if (grouping.size() > 0) {
groupings.insert(grouping);
grouping.clear();
}
}
// group lone addrs by themselves
for (unsigned int i = 0; i < pcoin->vout.size(); i++)
if (IsMine(pcoin->vout[i])) {
CTxDestination address;
if (!ExtractDestination(pcoin->vout[i].scriptPubKey, address))
continue;
grouping.insert(address);
groupings.insert(grouping);
grouping.clear();
}
}
set<set<CTxDestination>*> uniqueGroupings; // a set of pointers to groups of addresses
map<CTxDestination, set<CTxDestination>*> setmap; // map addresses to the unique group containing it
BOOST_FOREACH (set<CTxDestination> grouping, groupings) {
// make a set of all the groups hit by this new group
set<set<CTxDestination>*> hits;
map<CTxDestination, set<CTxDestination>*>::iterator it;
BOOST_FOREACH (CTxDestination address, grouping)
if ((it = setmap.find(address)) != setmap.end())
hits.insert((*it).second);
// merge all hit groups into a new single group and delete old groups
set<CTxDestination>* merged = new set<CTxDestination>(grouping);
BOOST_FOREACH (set<CTxDestination>* hit, hits) {
merged->insert(hit->begin(), hit->end());
uniqueGroupings.erase(hit);
delete hit;
}
uniqueGroupings.insert(merged);
// update setmap
BOOST_FOREACH (CTxDestination element, *merged)
setmap[element] = merged;
}
set<set<CTxDestination> > ret;
BOOST_FOREACH (set<CTxDestination>* uniqueGrouping, uniqueGroupings) {
ret.insert(*uniqueGrouping);
delete uniqueGrouping;
}
return ret;
}
set<CTxDestination> CWallet::GetAccountAddresses(string strAccount) const
{
LOCK(cs_wallet);
set<CTxDestination> result;
BOOST_FOREACH (const PAIRTYPE(CTxDestination, CAddressBookData) & item, mapAddressBook) {
const CTxDestination& address = item.first;
const string& strName = item.second.name;
if (strName == strAccount)
result.insert(address);
}
return result;
}
bool CReserveKey::GetReservedKey(CPubKey& pubkey, bool fInternalIn)
{
if (nIndex == -1)
{
CKeyPool keypool;
pwallet->ReserveKeyFromKeyPool(nIndex, keypool, fInternalIn);
if (nIndex != -1) {
vchPubKey = keypool.vchPubKey;
}
else {
return false;
}
fInternal = keypool.fInternal;
}
assert(vchPubKey.IsValid());
pubkey = vchPubKey;
return true;
}
void CReserveKey::KeepKey()
{
if (nIndex != -1) {
pwallet->KeepKey(nIndex);
}
nIndex = -1;
vchPubKey = CPubKey();
}
void CReserveKey::ReturnKey()
{
if (nIndex != -1) {
pwallet->ReturnKey(nIndex, fInternal);
}
nIndex = -1;
vchPubKey = CPubKey();
}
static void LoadReserveKeysToSet(std::set<CKeyID>& setAddress, const std::set<int64_t>& setKeyPool, CWalletDB& walletdb)
{
BOOST_FOREACH(const int64_t& id, setKeyPool)
{
CKeyPool keypool;
if (!walletdb.ReadPool(id, keypool))
throw std::runtime_error(std::string(__func__) + ": read failed");
assert(keypool.vchPubKey.IsValid());
CKeyID keyID = keypool.vchPubKey.GetID();
setAddress.insert(keyID);
}
}
void CWallet::GetAllReserveKeys(set<CKeyID>& setAddress) const
{
setAddress.clear();
CWalletDB walletdb(strWalletFile);
LOCK2(cs_main, cs_wallet);
LoadReserveKeysToSet(setAddress, setInternalKeyPool, walletdb);
LoadReserveKeysToSet(setAddress, setExternalKeyPool, walletdb);
BOOST_FOREACH (const CKeyID& keyID, setAddress) {
if (!HaveKey(keyID)) {
throw std::runtime_error(std::string(__func__) + ": unknown key in key pool");
}
}
}
bool CWallet::UpdatedTransaction(const uint256& hashTx)
{
{
LOCK(cs_wallet);
// Only notify UI if this transaction is in this wallet
map<uint256, CWalletTx>::const_iterator mi = mapWallet.find(hashTx);
if (mi != mapWallet.end()) {
NotifyTransactionChanged(this, hashTx, CT_UPDATED);
return true;
}
}
return false;
}
unsigned int CWallet::GetKeyPoolSize() const
{
AssertLockHeld(cs_wallet); // set{Ex,In}ternalKeyPool
return setInternalKeyPool.size() + setExternalKeyPool.size();
}
void CWallet::LockCoin(const COutPoint& output)
{
AssertLockHeld(cs_wallet); // setLockedCoins
setLockedCoins.insert(output);
std::map<uint256, CWalletTx>::iterator it = mapWallet.find(output.hash);
if (it != mapWallet.end()) it->second.MarkDirty(); // recalculate all credits for this tx
}
void CWallet::UnlockCoin(const COutPoint& output)
{
AssertLockHeld(cs_wallet); // setLockedCoins
setLockedCoins.erase(output);
}
void CWallet::UnlockAllCoins()
{
AssertLockHeld(cs_wallet); // setLockedCoins
setLockedCoins.clear();
}
bool CWallet::IsLockedCoin(uint256 hash, unsigned int n) const
{
AssertLockHeld(cs_wallet); // setLockedCoins
COutPoint outpt(hash, n);
return (setLockedCoins.count(outpt) > 0);
}
void CWallet::ListLockedCoins(std::vector<COutPoint>& vOutpts)
{
AssertLockHeld(cs_wallet); // setLockedCoins
for (std::set<COutPoint>::iterator it = setLockedCoins.begin();
it != setLockedCoins.end(); it++) {
COutPoint outpt = (*it);
vOutpts.push_back(outpt);
}
}
/** @} */ // end of Actions
class CAffectedKeysVisitor : public boost::static_visitor<void> {
private:
const CKeyStore &keystore;
std::vector<CKeyID> &vKeys;
public:
CAffectedKeysVisitor(const CKeyStore &keystoreIn, std::vector<CKeyID> &vKeysIn) : keystore(keystoreIn), vKeys(vKeysIn) {}
void Process(const CScript &script) {
txnouttype type;
std::vector<CTxDestination> vDest;
int nRequired;
if (ExtractDestinations(script, type, vDest, nRequired)) {
BOOST_FOREACH(const CTxDestination &dest, vDest)
boost::apply_visitor(*this, dest);
}
}
void operator()(const CKeyID &keyId) {
if (keystore.HaveKey(keyId))
vKeys.push_back(keyId);
}
void operator()(const CScriptID &scriptId) {
CScript script;
if (keystore.GetCScript(scriptId, script))
Process(script);
}
void operator()(const CNoDestination &none) {}
};
void CWallet::GetKeyBirthTimes(std::map<CKeyID, int64_t>& mapKeyBirth) const
{
AssertLockHeld(cs_wallet); // mapKeyMetadata
mapKeyBirth.clear();
// get birth times for keys with metadata
for (std::map<CKeyID, CKeyMetadata>::const_iterator it = mapKeyMetadata.begin(); it != mapKeyMetadata.end(); it++)
if (it->second.nCreateTime)
mapKeyBirth[it->first] = it->second.nCreateTime;
// map in which we'll infer heights of other keys
CBlockIndex* pindexMax = chainActive[std::max(0, chainActive.Height() - 144)]; // the tip can be reorganised; use a 144-block safety margin
std::map<CKeyID, CBlockIndex*> mapKeyFirstBlock;
std::set<CKeyID> setKeys;
GetKeys(setKeys);
BOOST_FOREACH (const CKeyID& keyid, setKeys) {
if (mapKeyBirth.count(keyid) == 0)
mapKeyFirstBlock[keyid] = pindexMax;
}
setKeys.clear();
// if there are no such keys, we're done
if (mapKeyFirstBlock.empty())
return;
// find first block that affects those keys, if there are any left
std::vector<CKeyID> vAffected;
for (std::map<uint256, CWalletTx>::const_iterator it = mapWallet.begin(); it != mapWallet.end(); it++) {
// iterate over all wallet transactions...
const CWalletTx& wtx = (*it).second;
BlockMap::const_iterator blit = mapBlockIndex.find(wtx.hashBlock);
if (blit != mapBlockIndex.end() && chainActive.Contains(blit->second)) {
// ... which are already in a block
int nHeight = blit->second->nHeight;
BOOST_FOREACH (const CTxOut& txout, wtx.vout) {
// iterate over all their outputs
CAffectedKeysVisitor(*this, vAffected).Process(txout.scriptPubKey);
BOOST_FOREACH (const CKeyID& keyid, vAffected) {
// ... and all their affected keys
std::map<CKeyID, CBlockIndex*>::iterator rit = mapKeyFirstBlock.find(keyid);
if (rit != mapKeyFirstBlock.end() && nHeight < rit->second->nHeight)
rit->second = blit->second;
}
vAffected.clear();
}
}
}
// Extract block timestamps for those keys
for (std::map<CKeyID, CBlockIndex*>::const_iterator it = mapKeyFirstBlock.begin(); it != mapKeyFirstBlock.end(); it++)
mapKeyBirth[it->first] = it->second->GetBlockTime() - 7200; // block times can be 2h off
}
bool CWallet::AddDestData(const CTxDestination& dest, const std::string& key, const std::string& value)
{
if (boost::get<CNoDestination>(&dest))
return false;
mapAddressBook[dest].destdata.insert(std::make_pair(key, value));
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).WriteDestData(CBitcoinAddress(dest).ToString(), key, value);
}
bool CWallet::EraseDestData(const CTxDestination& dest, const std::string& key)
{
if (!mapAddressBook[dest].destdata.erase(key))
return false;
if (!fFileBacked)
return true;
return CWalletDB(strWalletFile).EraseDestData(CBitcoinAddress(dest).ToString(), key);
}
bool CWallet::LoadDestData(const CTxDestination& dest, const std::string& key, const std::string& value)
{
mapAddressBook[dest].destdata.insert(std::make_pair(key, value));
return true;
}
bool CWallet::GetDestData(const CTxDestination& dest, const std::string& key, std::string* value) const
{
std::map<CTxDestination, CAddressBookData>::const_iterator i = mapAddressBook.find(dest);
if (i != mapAddressBook.end()) {
CAddressBookData::StringMap::const_iterator j = i->second.destdata.find(key);
if (j != i->second.destdata.end()) {
if (value)
*value = j->second;
return true;
}
}
return false;
}
void CWallet::AutoCombineDust()
{
if (IsInitialBlockDownload() || IsLocked()) {
return;
}
map<CBitcoinAddress, vector<COutput> > mapCoinsByAddress = AvailableCoinsByAddress(true, 0);
//coins are sectioned by address. This combination code only wants to combine inputs that belong to the same address
for (map<CBitcoinAddress, vector<COutput> >::iterator it = mapCoinsByAddress.begin(); it != mapCoinsByAddress.end(); it++) {
vector<COutput> vCoins, vRewardCoins;
vCoins = it->second;
//find masternode rewards that need to be combined
CCoinControl* coinControl = new CCoinControl();
CAmount nTotalRewardsValue = 0;
BOOST_FOREACH (const COutput& out, vCoins) {
//no coins should get this far if they dont have proper maturity, this is double checking
if (out.tx->IsCoinStake() && out.tx->GetDepthInMainChain() < Params().COINBASE_MATURITY() + 1)
continue;
if (out.Value() > nAutoCombineThreshold * COIN)
continue;
COutPoint outpt(out.tx->GetHash(), out.i);
coinControl->Select(outpt);
vRewardCoins.push_back(out);
nTotalRewardsValue += out.Value();
}
//if no inputs found then return
if (!coinControl->HasSelected())
continue;
//we cannot combine one coin with itself
if (vRewardCoins.size() <= 1)
continue;
vector<pair<CScript, CAmount> > vecSend;
CScript scriptPubKey = GetScriptForDestination(it->first.Get());
vecSend.push_back(make_pair(scriptPubKey, nTotalRewardsValue));
// Create the transaction and commit it to the network
CWalletTx wtx;
CReserveKey keyChange(this); // this change address does not end up being used, because change is returned with coin control switch
string strErr;
CAmount nFeeRet = 0;
//get the fee amount
CWalletTx wtxdummy;
CreateTransaction(vecSend, wtxdummy, keyChange, nFeeRet, strErr, coinControl, ALL_COINS, false, CAmount(0));
vecSend[0].second = nTotalRewardsValue - nFeeRet - 500;
if (!CreateTransaction(vecSend, wtx, keyChange, nFeeRet, strErr, coinControl, ALL_COINS, false, CAmount(0))) {
LogPrintf("AutoCombineDust createtransaction failed, reason: %s\n", strErr);
continue;
}
if (!CommitTransaction(wtx, keyChange)) {
LogPrintf("AutoCombineDust transaction commit failed\n");
continue;
}
LogPrintf("AutoCombineDust sent transaction\n");
delete coinControl;
}
}
bool CWallet::MultiSend()
{
if (IsInitialBlockDownload() || IsLocked()) {
return false;
}
if (chainActive.Tip()->nHeight <= nLastMultiSendHeight) {
LogPrintf("Multisend: lastmultisendheight is higher than current best height\n");
return false;
}
std::vector<COutput> vCoins;
AvailableCoins(vCoins);
int stakeSent = 0;
int mnSent = 0;
BOOST_FOREACH (const COutput& out, vCoins) {
//need output with precise confirm count - this is how we identify which is the output to send
if (out.tx->GetDepthInMainChain() != Params().COINBASE_MATURITY() + 1)
continue;
COutPoint outpoint(out.tx->GetHash(), out.i);
bool sendMSonMNReward = fMultiSendMasternodeReward && outpoint.IsMasternodeReward(out.tx);
bool sendMSOnStake = fMultiSendStake && out.tx->IsCoinStake() && !sendMSonMNReward; //output is either mnreward or stake reward, not both
if (!(sendMSOnStake || sendMSonMNReward))
continue;
CTxDestination destMyAddress;
if (!ExtractDestination(out.tx->vout[out.i].scriptPubKey, destMyAddress)) {
LogPrintf("Multisend: failed to extract destination\n");
continue;
}
//Disabled Addresses won't send MultiSend transactions
if (vDisabledAddresses.size() > 0) {
for (unsigned int i = 0; i < vDisabledAddresses.size(); i++) {
if (vDisabledAddresses[i] == CBitcoinAddress(destMyAddress).ToString()) {
LogPrintf("Multisend: disabled address preventing multisend\n");
return false;
}
}
}
// create new coin control, populate it with the selected utxo, create sending vector
CCoinControl* cControl = new CCoinControl();
COutPoint outpt(out.tx->GetHash(), out.i);
cControl->Select(outpt);
cControl->destChange = destMyAddress;
CWalletTx wtx;
CReserveKey keyChange(this); // this change address does not end up being used, because change is returned with coin control switch
CAmount nFeeRet = 0;
vector<pair<CScript, CAmount> > vecSend;
// loop through multisend vector and add amounts and addresses to the sending vector
const isminefilter filter = ISMINE_SPENDABLE;
CAmount nAmount = 0;
for (unsigned int i = 0; i < vMultiSend.size(); i++) {
// MultiSend vector is a pair of 1)Address as a std::string 2) Percent of stake to send as an int
nAmount = ((out.tx->GetCredit(filter) - out.tx->GetDebit(filter)) * vMultiSend[i].second) / 100;
CBitcoinAddress strAddSend(vMultiSend[i].first);
CScript scriptPubKey;
scriptPubKey = GetScriptForDestination(strAddSend.Get());
vecSend.push_back(make_pair(scriptPubKey, nAmount));
}
//get the fee amount
CWalletTx wtxdummy;
string strErr;
CreateTransaction(vecSend, wtxdummy, keyChange, nFeeRet, strErr, cControl, ALL_COINS, false, CAmount(0));
CAmount nLastSendAmount = vecSend[vecSend.size() - 1].second;
if (nLastSendAmount < nFeeRet + 500) {
LogPrintf("%s: fee of %d is too large to insert into last output\n", __func__, nFeeRet + 500);
return false;
}
vecSend[vecSend.size() - 1].second = nLastSendAmount - nFeeRet - 500;
// Create the transaction and commit it to the network
if (!CreateTransaction(vecSend, wtx, keyChange, nFeeRet, strErr, cControl, ALL_COINS, false, CAmount(0))) {
LogPrintf("MultiSend createtransaction failed\n");
return false;
}
if (!CommitTransaction(wtx, keyChange)) {
LogPrintf("MultiSend transaction commit failed\n");
return false;
} else
fMultiSendNotify = true;
delete cControl;
//write nLastMultiSendHeight to DB
CWalletDB walletdb(strWalletFile);
nLastMultiSendHeight = chainActive.Tip()->nHeight;
if (!walletdb.WriteMSettings(fMultiSendStake, fMultiSendMasternodeReward, nLastMultiSendHeight))
LogPrintf("Failed to write MultiSend setting to DB\n");
LogPrintf("MultiSend successfully sent\n");
if (sendMSOnStake)
stakeSent++;
else
mnSent++;
//stop iterating if we are done
if (mnSent > 0 && stakeSent > 0)
return true;
if (stakeSent > 0 && !fMultiSendMasternodeReward)
return true;
if (mnSent > 0 && !fMultiSendStake)
return true;
}
return true;
}
CKeyPool::CKeyPool()
{
nTime = GetTime();
}
CKeyPool::CKeyPool(const CPubKey& vchPubKeyIn, bool fInternalIn)
{
nTime = GetTime();
vchPubKey = vchPubKeyIn;
fInternal = fInternalIn;
}
CWalletKey::CWalletKey(int64_t nExpires)
{
nTimeCreated = (nExpires ? GetTime() : 0);
nTimeExpires = nExpires;
}
int CMerkleTx::SetMerkleBranch(const CBlock& block)
{
AssertLockHeld(cs_main);
CBlock blockTmp;
// Update the tx's hashBlock
hashBlock = block.GetHash();
// Locate the transaction
for (nIndex = 0; nIndex < (int)block.vtx.size(); nIndex++)
if (block.vtx[nIndex] == *(CTransaction*)this)
break;
if (nIndex == (int)block.vtx.size()) {
vMerkleBranch.clear();
nIndex = -1;
LogPrintf("ERROR: SetMerkleBranch() : couldn't find tx in block\n");
return 0;
}
// Fill in merkle branch
vMerkleBranch = block.GetMerkleBranch(nIndex);
// Is the tx in a block that's in the main chain
BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
if (mi == mapBlockIndex.end())
return 0;
const CBlockIndex* pindex = (*mi).second;
if (!pindex || !chainActive.Contains(pindex))
return 0;
return chainActive.Height() - pindex->nHeight + 1;
}
int CMerkleTx::GetDepthInMainChainINTERNAL(const CBlockIndex*& pindexRet) const
{
if (hashBlock == 0 || nIndex == -1)
return 0;
AssertLockHeld(cs_main);
// Find the block it claims to be in
BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
if (mi == mapBlockIndex.end())
return 0;
CBlockIndex* pindex = (*mi).second;
if (!pindex || !chainActive.Contains(pindex))
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 chainActive.Height() - pindex->nHeight + 1;
}
int CMerkleTx::GetDepthInMainChain(const CBlockIndex*& pindexRet, bool enableIX) const
{
AssertLockHeld(cs_main);
int nResult = GetDepthInMainChainINTERNAL(pindexRet);
if (nResult == 0 && !mempool.exists(GetHash()))
return -1; // Not in chain, not in mempool
if (enableIX) {
if (nResult < 6) {
int signatures = GetTransactionLockSignatures();
if (signatures >= SWIFTTX_SIGNATURES_REQUIRED) {
return nSwiftTXDepth + nResult;
}
}
}
return nResult;
}
int CMerkleTx::GetBlocksToMaturity() const
{
if (!(IsCoinBase() || IsCoinStake()))
return 0;
return max(0, (Params().COINBASE_MATURITY() + 1) - GetDepthInMainChain());
}
bool CMerkleTx::AcceptToMemoryPool(bool fLimitFree, bool fRejectInsaneFee, bool ignoreFees)
{
CValidationState state;
bool fAccepted = ::AcceptToMemoryPool(mempool, state, *this, fLimitFree, NULL, fRejectInsaneFee, ignoreFees);
if (!fAccepted)
LogPrintf("%s : %s\n", __func__, state.GetRejectReason());
return fAccepted;
}
int CMerkleTx::GetTransactionLockSignatures() const
{
if (fLargeWorkForkFound || fLargeWorkInvalidChainFound) return -2;
if (!sporkManager.IsSporkActive(SPORK_2_SWIFTTX_ENABLED)) return -3;
if (!fEnableSwiftTX) return -1;
//compile consessus vote
std::map<uint256, CTransactionLock>::iterator i = mapTxLocks.find(GetHash());
if (i != mapTxLocks.end()) {
return (*i).second.CountSignatures();
}
return -1;
}
bool CMerkleTx::IsTransactionLockTimedOut() const
{
if (!fEnableSwiftTX) return 0;
//compile consessus vote
std::map<uint256, CTransactionLock>::iterator i = mapTxLocks.find(GetHash());
if (i != mapTxLocks.end()) {
return GetTime() > (*i).second.nTimeout;
}
return false;
}
bool CWallet::CreateZerocoinMintTransaction(const CAmount nValue, CMutableTransaction& txNew, vector<CZerocoinMint>& vMints, CReserveKey* reservekey, int64_t& nFeeRet, std::string& strFailReason, const CCoinControl* coinControl, const bool isZCSpendChange)
{
if (IsLocked()) {
strFailReason = _("Error: Wallet locked, unable to create transaction!");
LogPrintf("SpendZerocoin() : %s", strFailReason.c_str());
return false;
}
//add multiple mints that will fit the amount requested as closely as possible
CAmount nMintingValue = 0;
CAmount nValueRemaining = 0;
while (true) {
//mint a coin with the closest denomination to what is being requested
nFeeRet = max(static_cast<int>(txNew.vout.size()), 1) * Params().Zerocoin_MintFee();
nValueRemaining = nValue - nMintingValue - (isZCSpendChange ? nFeeRet : 0);
// if this is change of a zerocoinspend, then we can't mint all change, at least something must be given as a fee
if (isZCSpendChange && nValueRemaining <= 1 * COIN)
break;
libzerocoin::CoinDenomination denomination = libzerocoin::AmountToClosestDenomination(nValueRemaining, nValueRemaining);
if (denomination == libzerocoin::ZQ_ERROR)
break;
CAmount nValueNewMint = libzerocoin::ZerocoinDenominationToAmount(denomination);
nMintingValue += nValueNewMint;
// mint a new coin (create Pedersen Commitment) and extract PublicCoin that is shareable from it
libzerocoin::PrivateCoin newCoin(Params().Zerocoin_Params(), denomination);
libzerocoin::PublicCoin pubCoin = newCoin.getPublicCoin();
// Validate
if(!pubCoin.validate()) {
strFailReason = _("failed to validate zerocoin");
return false;
}
CScript scriptSerializedCoin = CScript() << OP_ZEROCOINMINT << pubCoin.getValue().getvch().size() << pubCoin.getValue().getvch();
CTxOut outMint(nValueNewMint, scriptSerializedCoin);
txNew.vout.push_back(outMint);
//store as CZerocoinMint for later use
CZerocoinMint mint(denomination, pubCoin.getValue(), newCoin.getRandomness(), newCoin.getSerialNumber(), false);
vMints.push_back(mint);
}
// calculate fee
CAmount nFee = Params().Zerocoin_MintFee() * txNew.vout.size();
// no ability to select more coins if this is a ZCSpend change mint
CAmount nTotalValue = (isZCSpendChange ? nValue : (nValue + nFee));
// check for a zerocoinspend that mints the change
CAmount nValueIn = 0;
set<pair<const CWalletTx*, unsigned int> > setCoins;
if (isZCSpendChange) {
nValueIn = nValue;
} else {
// select UTXO's to use
if (!SelectCoins(nTotalValue, setCoins, nValueIn, coinControl)) {
strFailReason = _("Insufficient or insufficient confirmed funds, you might need to wait a few minutes and try again.");
return false;
}
// Fill vin
for (const std::pair<const CWalletTx*, unsigned int>& coin : setCoins)
txNew.vin.push_back(CTxIn(coin.first->GetHash(), coin.second));
}
//any change that is less than 0.0100000 will be ignored and given as an extra fee
//also assume that a zerocoinspend that is minting the change will not have any change that goes to Div
CAmount nChange = nValueIn - nTotalValue; // Fee already accounted for in nTotalValue
if (nChange > 1 * CENT && !isZCSpendChange) {
// Fill a vout to ourself
CScript scriptChange;
// if coin control: send change to custom address
if (coinControl && !boost::get<CNoDestination>(&coinControl->destChange))
scriptChange = GetScriptForDestination(coinControl->destChange);
else {
// Reserve a new key pair from key pool
CPubKey vchPubKey;
assert(reservekey->GetReservedKey(vchPubKey, true)); // should never fail, as we just unlocked
scriptChange = GetScriptForDestination(vchPubKey.GetID());
}
//add to the transaction
CTxOut outChange(nChange, scriptChange);
txNew.vout.push_back(outChange);
} else {
if (reservekey)
reservekey->ReturnKey();
}
// Sign if these are divi outputs - NOTE that zDiv outputs are signed later in SoK
if (!isZCSpendChange) {
int nIn = 0;
for (const std::pair<const CWalletTx*, unsigned int>& coin : setCoins) {
if (!SignSignature(*this, *coin.first, txNew, nIn++)) {
strFailReason = _("Signing transaction failed");
return false;
}
}
}
return true;
}
bool CWallet::MintToTxIn(CZerocoinMint zerocoinSelected, int nSecurityLevel, const uint256& hashTxOut, CTxIn& newTxIn, CZerocoinSpendReceipt& receipt)
{
// Default error status if not changed below
receipt.SetStatus(_("Transaction Mint Started"), ZDIV_TXMINT_GENERAL);
libzerocoin::CoinDenomination denomination = zerocoinSelected.GetDenomination();
// 2. Get pubcoin from the private coin
libzerocoin::PublicCoin pubCoinSelected(Params().Zerocoin_Params(), zerocoinSelected.GetValue(), denomination);
LogPrintf("%s : pubCoinSelected:\n denom=%d\n value%s\n", __func__, denomination, pubCoinSelected.getValue().GetHex());
if (!pubCoinSelected.validate()) {
receipt.SetStatus(_("The selected mint coin is an invalid coin"), ZDIV_INVALID_COIN);
return false;
}
// 3. Compute Accumulator and Witness
libzerocoin::Accumulator accumulator(Params().Zerocoin_Params(), pubCoinSelected.getDenomination());
libzerocoin::AccumulatorWitness witness(Params().Zerocoin_Params(), accumulator, pubCoinSelected);
string strFailReason = "";
int nMintsAdded = 0;
if (!GenerateAccumulatorWitness(pubCoinSelected, accumulator, witness, nSecurityLevel, nMintsAdded, strFailReason)) {
receipt.SetStatus(_("Try to spend with a higher security level to include more coins"), ZDIV_FAILED_ACCUMULATOR_INITIALIZATION);
LogPrintf("%s : %s \n", __func__, receipt.GetStatusMessage());
return false;
}
// Construct the CoinSpend object. This acts like a signature on the transaction.
libzerocoin::PrivateCoin privateCoin(Params().Zerocoin_Params(), denomination);
privateCoin.setPublicCoin(pubCoinSelected);
privateCoin.setRandomness(zerocoinSelected.GetRandomness());
privateCoin.setSerialNumber(zerocoinSelected.GetSerialNumber());
uint32_t nChecksum = GetChecksum(accumulator.getValue());
try {
libzerocoin::CoinSpend spend(Params().Zerocoin_Params(), privateCoin, accumulator, nChecksum, witness, hashTxOut);
if (!spend.Verify(accumulator)) {
receipt.SetStatus(_("The new spend coin transaction did not verify"), ZDIV_INVALID_WITNESS);
return false;
}
// Deserialize the CoinSpend intro a fresh object
CDataStream serializedCoinSpend(SER_NETWORK, PROTOCOL_VERSION);
serializedCoinSpend << spend;
std::vector<unsigned char> data(serializedCoinSpend.begin(), serializedCoinSpend.end());
//Add the coin spend into a DIVI transaction
newTxIn.scriptSig = CScript() << OP_ZEROCOINSPEND << data.size();
newTxIn.scriptSig.insert(newTxIn.scriptSig.end(), data.begin(), data.end());
newTxIn.prevout.SetNull();
//use nSequence as a shorthand lookup of denomination
//NOTE that this should never be used in place of checking the value in the final blockchain acceptance/verification
//of the transaction
newTxIn.nSequence = denomination;
CDataStream serializedCoinSpendChecking(SER_NETWORK, PROTOCOL_VERSION);
try {
serializedCoinSpendChecking << spend;
}
catch (...) {
receipt.SetStatus(_("Failed to deserialize"), ZDIV_BAD_SERIALIZATION);
return false;
}
libzerocoin::CoinSpend newSpendChecking(Params().Zerocoin_Params(), serializedCoinSpendChecking);
if (!newSpendChecking.Verify(accumulator)) {
receipt.SetStatus(_("The transaction did not verify"), ZDIV_BAD_SERIALIZATION);
return false;
}
std::list<CBigNum> listCoinSpendSerial = CWalletDB(strWalletFile).ListSpentCoinsSerial();
for (const CBigNum& item : listCoinSpendSerial) {
if (spend.getCoinSerialNumber() == item) {
//Tried to spend an already spent zDiv
zerocoinSelected.SetUsed(true);
if (!CWalletDB(strWalletFile).WriteZerocoinMint(zerocoinSelected))
LogPrintf("%s failed to write zerocoinmint\n", __func__);
pwalletMain->NotifyZerocoinChanged(pwalletMain, zerocoinSelected.GetValue().GetHex(), "Used", CT_UPDATED);
receipt.SetStatus(_("The coin spend has been used"), ZDIV_SPENT_USED_ZDIV);
return false;
}
}
uint32_t nAccumulatorChecksum = GetChecksum(accumulator.getValue());
CZerocoinSpend zcSpend(spend.getCoinSerialNumber(), 0, zerocoinSelected.GetValue(), zerocoinSelected.GetDenomination(), nAccumulatorChecksum);
zcSpend.SetMintCount(nMintsAdded);
receipt.AddSpend(zcSpend);
}
catch (const std::exception&) {
receipt.SetStatus(_("CoinSpend: Accumulator witness does not verify"), ZDIV_INVALID_WITNESS);
return false;
}
receipt.SetStatus(_("Spend Valid"), ZDIV_SPEND_OKAY); // Everything okay
return true;
}
bool CWallet::CreateZerocoinSpendTransaction(CAmount nValue, int nSecurityLevel, CWalletTx& wtxNew, CReserveKey& reserveKey, CZerocoinSpendReceipt& receipt, vector<CZerocoinMint>& vSelectedMints, vector<CZerocoinMint>& vNewMints, bool fMintChange, bool fMinimizeChange, CBitcoinAddress* address)
{
// Check available funds
int nStatus = ZDIV_TRX_FUNDS_PROBLEMS;
if (nValue > GetZerocoinBalance(true)) {
receipt.SetStatus(_("You don't have enough Zerocoins in your wallet"), nStatus);
return false;
}
if (nValue < 1) {
receipt.SetStatus(_("Value is below the the smallest available denomination (= 1) of zDiv"), nStatus);
return false;
}
// Create transaction
nStatus = ZDIV_TRX_CREATE;
// If not already given pre-selected mints, then select mints from the wallet
CWalletDB walletdb(pwalletMain->strWalletFile);
list<CZerocoinMint> listMints;
CAmount nValueSelected = 0;
int nCoinsReturned = 0; // Number of coins returned in change from function below (for debug)
int nNeededSpends = 0; // Number of spends which would be needed if selection failed
const int nMaxSpends = Params().Zerocoin_MaxSpendsPerTransaction(); // Maximum possible spends for one zDIV transaction
if (vSelectedMints.empty()) {
listMints = walletdb.ListMintedCoins(true, true, true); // need to find mints to spend
if(listMints.empty()) {
receipt.SetStatus(_("Failed to find Zerocoins in in wallet.dat"), nStatus);
return false;
}
// If the input value is not an int, then we want the selection algorithm to round up to the next highest int
double dValue = static_cast<double>(nValue) / static_cast<double>(COIN);
bool fWholeNumber = floor(dValue) == dValue;
CAmount nValueToSelect = nValue;
if(!fWholeNumber)
nValueToSelect = static_cast<CAmount>(ceil(dValue) * COIN);
// Select the zDiv mints to use in this spend
std::map<libzerocoin::CoinDenomination, CAmount> DenomMap = GetMyZerocoinDistribution();
vSelectedMints = SelectMintsFromList(nValueToSelect, nValueSelected, nMaxSpends, fMinimizeChange,
nCoinsReturned, listMints, DenomMap, nNeededSpends);
} else {
for (const CZerocoinMint mint : vSelectedMints)
nValueSelected += ZerocoinDenominationToAmount(mint.GetDenomination());
}
listSpends(vSelectedMints);
int nArchived = 0;
for (CZerocoinMint mint : vSelectedMints) {
// see if this serial has already been spent
if (IsSerialKnown(mint.GetSerialNumber())) {
receipt.SetStatus(_("Trying to spend an already spent serial #, try again."), nStatus);
mint.SetUsed(true);
walletdb.WriteZerocoinMint(mint);
return false;
}
//check that this mint made it into the blockchain
CTransaction txMint;
uint256 hashBlock;
bool fArchive = false;
if (!GetTransaction(mint.GetTxHash(), txMint, hashBlock)) {
receipt.SetStatus(_("Unable to find transaction containing mint"), nStatus);
fArchive = true;
} else if (mapBlockIndex.count(hashBlock) < 1) {
receipt.SetStatus(_("Mint did not make it into blockchain"), nStatus);
fArchive = true;
}
// archive this mint as an orphan
if (fArchive) {
walletdb.ArchiveMintOrphan(mint);
nArchived++;
}
}
if (nArchived)
return false;
if (vSelectedMints.empty()) {
if(nNeededSpends > 0){
// Too much spends needed, so abuse nStatus to report back the number of needed spends
receipt.SetStatus(_("Too many spends needed"), nStatus, nNeededSpends);
}
else {
receipt.SetStatus(_("Failed to select a zerocoin"), nStatus);
}
return false;
}
if ((static_cast<int>(vSelectedMints.size()) > Params().Zerocoin_MaxSpendsPerTransaction())) {
receipt.SetStatus(_("Failed to find coin set amongst held coins with less than maxNumber of Spends"), nStatus);
return false;
}
// Create change if needed
nStatus = ZDIV_TRX_CHANGE;
CMutableTransaction txNew;
wtxNew.BindWallet(this);
{
LOCK2(cs_main, cs_wallet);
{
txNew.vin.clear();
txNew.vout.clear();
//if there is an address to send to then use it, if not generate a new address to send to
CScript scriptZerocoinSpend;
CScript scriptChange;
CAmount nChange = nValueSelected - nValue;
if (nChange && !address) {
receipt.SetStatus(_("Need address because change is not exact"), nStatus);
return false;
}
if (address) {
scriptZerocoinSpend = GetScriptForDestination(address->Get());
if (nChange) {
// Reserve a new key pair from key pool
CPubKey vchPubKey;
assert(reserveKey.GetReservedKey(vchPubKey, true)); // should never fail
scriptChange = GetScriptForDestination(vchPubKey.GetID());
}
} else {
// Reserve a new key pair from key pool
CPubKey vchPubKey;
assert(reserveKey.GetReservedKey(vchPubKey, false)); // should never fail
scriptZerocoinSpend = GetScriptForDestination(vchPubKey.GetID());
}
//add change output if we are spending too much (only applies to spending multiple at once)
if (nChange) {
//mint change as zerocoins
if (fMintChange) {
CAmount nFeeRet = 0;
string strFailReason = "";
if (!CreateZerocoinMintTransaction(nChange, txNew, vNewMints, &reserveKey, nFeeRet, strFailReason, NULL, true)) {
receipt.SetStatus(_("Failed to create mint"), nStatus);
return false;
}
} else {
CTxOut txOutChange(nValueSelected - nValue, scriptChange);
txNew.vout.push_back(txOutChange);
}
}
//add output to divi address to the transaction (the actual primary spend taking place)
CTxOut txOutZerocoinSpend(nValue, scriptZerocoinSpend);
txNew.vout.push_back(txOutZerocoinSpend);
//hash with only the output info in it to be used in Signature of Knowledge
uint256 hashTxOut = txNew.GetHash();
//add all of the mints to the transaction as inputs
for (CZerocoinMint mint : vSelectedMints) {
CTxIn newTxIn;
if (!MintToTxIn(mint, nSecurityLevel, hashTxOut, newTxIn, receipt)) {
return false;
}
txNew.vin.push_back(newTxIn);
}
// Limit size
unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION);
if (nBytes >= MAX_ZEROCOIN_TX_SIZE) {
receipt.SetStatus(_("In rare cases, a spend with 7 coins exceeds our maximum allowable transaction size, please retry spend using 6 or less coins"), ZDIV_TX_TOO_LARGE);
return false;
}
//now that all inputs have been added, add full tx hash to zerocoinspend records and write to db
uint256 txHash = txNew.GetHash();
for (CZerocoinSpend spend : receipt.GetSpends()) {
spend.SetTxHash(txHash);
if (!CWalletDB(strWalletFile).WriteZerocoinSpendSerialEntry(spend)) {
receipt.SetStatus(_("Failed to write coin serial number into wallet"), nStatus);
}
}
//turn the finalized transaction into a wallet transaction
wtxNew = CWalletTx(this, txNew);
wtxNew.fFromMe = true;
wtxNew.fTimeReceivedIsTxTime = true;
wtxNew.nTimeReceived = GetAdjustedTime();
}
}
receipt.SetStatus(_("Transaction Created"), ZDIV_SPEND_OKAY); // Everything okay
return true;
}
string CWallet::ResetMintZerocoin(bool fExtendedSearch)
{
long updates = 0;
long deletions = 0;
CWalletDB walletdb(pwalletMain->strWalletFile);
list<CZerocoinMint> listMints = walletdb.ListMintedCoins(false, false, true);
vector<CZerocoinMint> vMintsToFind{ std::make_move_iterator(std::begin(listMints)), std::make_move_iterator(std::end(listMints)) };
vector<CZerocoinMint> vMintsMissing;
vector<CZerocoinMint> vMintsToUpdate;
// search all of our available data for these mints
FindMints(vMintsToFind, vMintsToUpdate, vMintsMissing, fExtendedSearch);
// Update the meta data of mints that were marked for updating
for (CZerocoinMint mint : vMintsToUpdate) {
updates++;
walletdb.WriteZerocoinMint(mint);
}
// Delete any mints that were unable to be located on the blockchain
for (CZerocoinMint mint : vMintsMissing) {
deletions++;
walletdb.ArchiveMintOrphan(mint);
}
string strResult = _("ResetMintZerocoin finished: ") + to_string(updates) + _(" mints updated, ") + to_string(deletions) + _(" mints deleted\n");
return strResult;
}
string CWallet::ResetSpentZerocoin()
{
long removed = 0;
CWalletDB walletdb(pwalletMain->strWalletFile);
list<CZerocoinMint> listMints = walletdb.ListMintedCoins(false, false, false);
list<CZerocoinSpend> listSpends = walletdb.ListSpentCoins();
list<CZerocoinSpend> listUnconfirmedSpends;
for (CZerocoinSpend spend : listSpends) {
CTransaction tx;
uint256 hashBlock = 0;
if (!GetTransaction(spend.GetTxHash(), tx, hashBlock)) {
listUnconfirmedSpends.push_back(spend);
continue;
}
//no confirmations
if (hashBlock == 0)
listUnconfirmedSpends.push_back(spend);
}
for (CZerocoinSpend spend : listUnconfirmedSpends) {
for (CZerocoinMint mint : listMints) {
if (mint.GetSerialNumber() == spend.GetSerial()) {
removed++;
mint.SetUsed(false);
RemoveSerialFromDB(spend.GetSerial());
walletdb.WriteZerocoinMint(mint);
walletdb.EraseZerocoinSpendSerialEntry(spend.GetSerial());
continue;
}
}
}
string strResult = _("ResetSpentZerocoin finished: ") + to_string(removed) + _(" unconfirmed transactions removed\n");
return strResult;
}
void CWallet::ReconsiderZerocoins(std::list<CZerocoinMint>& listMintsRestored)
{
CWalletDB walletdb(pwalletMain->strWalletFile);
list<CZerocoinMint> listMints = walletdb.ListArchivedZerocoins();
if (listMints.empty())
return;
for (CZerocoinMint mint : listMints) {
if (IsSerialKnown(mint.GetSerialNumber()))
continue;
uint256 txHash;
if (!GetZerocoinMint(mint.GetValue(), txHash))
continue;
uint256 hashBlock = 0;
CTransaction tx;
if (!GetTransaction(txHash, tx, hashBlock))
continue;
mint.SetTxHash(txHash);
mint.SetHeight(mapBlockIndex.at(hashBlock)->nHeight);
if (!walletdb.UnarchiveZerocoin(mint)) {
LogPrintf("%s : failed to unarchive mint %s\n", __func__, mint.GetValue().GetHex());
}
listMintsRestored.emplace_back(mint);
}
}
void CWallet::ZDivBackupWallet()
{
filesystem::path backupDir = GetDataDir() / "backups";
filesystem::path backupPath;
string strNewBackupName;
for (int i = 0; i < 10; i++) {
strNewBackupName = strprintf("wallet-autozdivbackup-%d.dat", i);
backupPath = backupDir / strNewBackupName;
if (filesystem::exists(backupPath)) {
//Keep up to 10 backups
if (i <= 8) {
//If the next file backup exists and is newer, then iterate
filesystem::path nextBackupPath = backupDir / strprintf("wallet-autozdivbackup-%d.dat", i + 1);
if (filesystem::exists(nextBackupPath)) {
time_t timeThis = filesystem::last_write_time(backupPath);
time_t timeNext = filesystem::last_write_time(nextBackupPath);
if (timeThis > timeNext) {
//The next backup is created before this backup was
//The next backup is the correct path to use
backupPath = nextBackupPath;
break;
}
}
//Iterate to the next filename/number
continue;
}
//reset to 0 because name with 9 already used
strNewBackupName = strprintf("wallet-autozdivbackup-%d.dat", 0);
backupPath = backupDir / strNewBackupName;
break;
}
//This filename is fresh, break here and backup
break;
}
BackupWallet(*this, backupPath.string());
}
void CWallet::LoadKeyPool(int nIndex, const CKeyPool &keypool)
{
if (keypool.fInternal) {
setInternalKeyPool.insert(nIndex);
} else {
setExternalKeyPool.insert(nIndex);
}
// If no metadata exists yet, create a default with the pool key's
// creation time. Note that this may be overwritten by actually
// stored metadata for that key later, which is fine.
CKeyID keyid = keypool.vchPubKey.GetID();
if (mapKeyMetadata.count(keyid) == 0)
mapKeyMetadata[keyid] = CKeyMetadata(keypool.nTime);
}
string CWallet::MintZerocoin(CAmount nValue, CWalletTx& wtxNew, vector<CZerocoinMint>& vMints, const CCoinControl* coinControl)
{
// Check amount
if (nValue <= 0)
return _("Invalid amount");
if (nValue + Params().Zerocoin_MintFee() > GetBalance())
return _("Insufficient funds");
CReserveKey reservekey(this);
int64_t nFeeRequired;
if (IsLocked()) {
string strError = _("Error: Wallet locked, unable to create transaction!");
LogPrintf("MintZerocoin() : %s", strError.c_str());
return strError;
}
string strError;
CMutableTransaction txNew;
if (!CreateZerocoinMintTransaction(nValue, txNew, vMints, &reservekey, nFeeRequired, strError, coinControl)) {
if (nValue + nFeeRequired > GetBalance())
return strprintf(_("Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!"), FormatMoney(nFeeRequired).c_str());
return strError;
}
wtxNew = CWalletTx(this, txNew);
wtxNew.fFromMe = true;
wtxNew.fTimeReceivedIsTxTime = true;
// Limit size
unsigned int nBytes = ::GetSerializeSize(txNew, SER_NETWORK, PROTOCOL_VERSION);
if (nBytes >= MAX_ZEROCOIN_TX_SIZE) {
return _("Error: The transaction is larger than the maximum allowed transaction size!");
}
//commit the transaction to the network
if (!CommitTransaction(wtxNew, reservekey)) {
return _("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.");
} else {
//update mints with full transaction hash and then database them
CWalletDB walletdb(pwalletMain->strWalletFile);
for (CZerocoinMint mint : vMints) {
mint.SetTxHash(wtxNew.GetHash());
walletdb.WriteZerocoinMint(mint);
pwalletMain->NotifyZerocoinChanged(pwalletMain, mint.GetValue().GetHex(), "Used", CT_UPDATED);
}
}
//Create a backup of the wallet
if (fBackupMints)
ZDivBackupWallet();
return "";
}
bool CWallet::SpendZerocoin(CAmount nAmount, int nSecurityLevel, CWalletTx& wtxNew, CZerocoinSpendReceipt& receipt, vector<CZerocoinMint>& vMintsSelected, bool fMintChange, bool fMinimizeChange, CBitcoinAddress* addressTo)
{
// Default: assume something goes wrong. Depending on the problem this gets more specific below
int nStatus = ZDIV_SPEND_ERROR;
if (IsLocked()) {
receipt.SetStatus("Error: Wallet locked, unable to create transaction!", ZDIV_WALLET_LOCKED);
return false;
}
CReserveKey reserveKey(this);
vector<CZerocoinMint> vNewMints;
if (!CreateZerocoinSpendTransaction(nAmount, nSecurityLevel, wtxNew, reserveKey, receipt, vMintsSelected, vNewMints, fMintChange, fMinimizeChange, addressTo)) {
return false;
}
if (fMintChange && fBackupMints)
ZDivBackupWallet();
CWalletDB walletdb(pwalletMain->strWalletFile);
if (!CommitTransaction(wtxNew, reserveKey)) {
LogPrintf("%s: failed to commit\n", __func__);
nStatus = ZDIV_COMMIT_FAILED;
//reset all mints
for (CZerocoinMint mint : vMintsSelected) {
mint.SetUsed(false); // having error, so set to false, to be able to use again
walletdb.WriteZerocoinMint(mint);
pwalletMain->NotifyZerocoinChanged(pwalletMain, mint.GetValue().GetHex(), "New", CT_UPDATED);
}
//erase spends
for (CZerocoinSpend spend : receipt.GetSpends()) {
if (!walletdb.EraseZerocoinSpendSerialEntry(spend.GetSerial())) {
receipt.SetStatus("Error: It cannot delete coin serial number in wallet", ZDIV_ERASE_SPENDS_FAILED);
}
//Remove from public zerocoinDB
RemoveSerialFromDB(spend.GetSerial());
}
// erase new mints
for (auto& mint : vNewMints) {
if (!walletdb.EraseZerocoinMint(mint)) {
receipt.SetStatus("Error: Unable to cannot delete zerocoin mint in wallet", ZDIV_ERASE_NEW_MINTS_FAILED);
}
}
receipt.SetStatus("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.", nStatus);
return false;
}
for (CZerocoinMint mint : vMintsSelected) {
mint.SetUsed(true);
if (!walletdb.WriteZerocoinMint(mint)) {
receipt.SetStatus("Failed to write mint to db", nStatus);
return false;
}
CZerocoinMint mintCheck;
if (!walletdb.ReadZerocoinMint(mint.GetValue(), mintCheck)) {
receipt.SetStatus("failed to read mintcheck", nStatus);
return false;
}
if (!mintCheck.IsUsed()) {
receipt.SetStatus("Error, the mint did not get marked as used", nStatus);
return false;
}
}
// write new Mints to db
for (CZerocoinMint mint : vNewMints) {
mint.SetTxHash(wtxNew.GetHash());
walletdb.WriteZerocoinMint(mint);
}
receipt.SetStatus("Spend Successful", ZDIV_SPEND_OKAY); // When we reach this point spending zDIV was successful
return true;
}
void CWallet::GenerateNewHDChain()
{
CHDChain newHdChain;
std::string strSeed = GetArg("-hdseed", "not hex");
if(mapArgs.count("-hdseed") && IsHex(strSeed)) {
std::vector<unsigned char> vchSeed = ParseHex(strSeed);
if (!newHdChain.SetSeed(SecureVector(vchSeed.begin(), vchSeed.end()), true))
throw std::runtime_error(std::string(__func__) + ": SetSeed failed");
}
else {
if (mapArgs.count("-hdseed") && !IsHex(strSeed))
LogPrintf("CWallet::GenerateNewHDChain -- Incorrect seed, generating random one instead\n");
// NOTE: empty mnemonic means "generate a new one for me"
std::string strMnemonic = GetArg("-mnemonic", "");
// NOTE: default mnemonic passphrase is an empty string
std::string strMnemonicPassphrase = GetArg("-mnemonicpassphrase", "");
SecureVector vchMnemonic(strMnemonic.begin(), strMnemonic.end());
SecureVector vchMnemonicPassphrase(strMnemonicPassphrase.begin(), strMnemonicPassphrase.end());
if (!newHdChain.SetMnemonic(vchMnemonic, vchMnemonicPassphrase, true))
throw std::runtime_error(std::string(__func__) + ": SetMnemonic failed");
}
newHdChain.Debug(__func__);
if (!SetHDChain(newHdChain, false))
throw std::runtime_error(std::string(__func__) + ": SetHDChain failed");
// clean up
ForceRemoveArg("-hdseed");
ForceRemoveArg("-mnemonic");
ForceRemoveArg("-mnemonicpassphrase");
}
bool CWallet::SetHDChain(const CHDChain& chain, bool memonly)
{
LOCK(cs_wallet);
if (!CCryptoKeyStore::SetHDChain(chain))
return false;
if (!memonly && !CWalletDB(strWalletFile).WriteHDChain(chain))
throw std::runtime_error(std::string(__func__) + ": WriteHDChain failed");
return true;
}
bool CWallet::SetCryptedHDChain(const CHDChain& chain, bool memonly)
{
LOCK(cs_wallet);
if (!CCryptoKeyStore::SetCryptedHDChain(chain))
return false;
if (!memonly) {
if (!fFileBacked)
return false;
if (pwalletdbEncryption) {
if (!pwalletdbEncryption->WriteCryptedHDChain(chain))
throw std::runtime_error(std::string(__func__) + ": WriteCryptedHDChain failed");
} else {
if (!CWalletDB(strWalletFile).WriteCryptedHDChain(chain))
throw std::runtime_error(std::string(__func__) + ": WriteCryptedHDChain failed");
}
}
return true;
}
bool CWallet::GetDecryptedHDChain(CHDChain& hdChainRet)
{
LOCK(cs_wallet);
CHDChain hdChainTmp;
if (!GetHDChain(hdChainTmp)) {
return false;
}
if (!DecryptHDChain(hdChainTmp))
return false;
// make sure seed matches this chain
if (hdChainTmp.GetID() != hdChainTmp.GetSeedHash())
return false;
hdChainRet = hdChainTmp;
return true;
}
bool CWallet::IsHDEnabled()
{
CHDChain hdChainCurrent;
return GetHDChain(hdChainCurrent);
}
| [
"theboss723@gmail.com"
] | theboss723@gmail.com |
e3b6eaa1b4de6be756a0cddcad765ab18350d4d6 | e8e5daf403fd8ace54ed70a3072bede7db3d57b1 | /66PlusOne.cpp | 1d6d860e2189ba09f49d97591d76e9078ea52ffc | [
"MIT"
] | permissive | wangxianghust/leetcode | acc61781ef3723e681faac72b94c9b5a26ddce99 | a3b49b24b24e60e93fb1c4122790df4483dfa039 | refs/heads/master | 2021-01-20T11:35:33.523969 | 2017-09-28T03:04:17 | 2017-09-28T03:04:17 | 83,956,885 | 5 | 2 | null | null | null | null | UTF-8 | C++ | false | false | 709 | cpp | /*问题:求一个数加1后的结果,含负数,数字使用vector保存
*/
#include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
vector<int> plusOne(vector<int>& digits) {
int size = digits.size();
int i=size-1;
vector<int> ret(digits);
while(i>=0 && digits[i] == 9) --i;
if(i<0){
ret[0] = 1;
for(int j=1; j<size; ++j)ret[j] = 0;
ret.push_back(0);
} else {
ret[i] += 1;
for(int j=i+1; j<size; ++j) ret[j] = 0;
}
return ret;
}
};
void print(vector<int> d){
for(int i:d) cout << i << " ";
cout << endl;
}
int main(){
//AC
}
| [
"xianghust@gmail.com"
] | xianghust@gmail.com |
ff67ba568aa40bff32a28556ff4d1ef8a338892c | 83964e7fb41ee62e3084eef5d3deef07eecdd93e | /clang/include/clang/StaticAnalyzer/Core/PathSensitive/TaintManager.h | 53205d3b720c78bbea5678321c180e3c5e868dde | [
"NCSA",
"BSD-2-Clause"
] | permissive | pbb59/ScaffCC | e0bee9e5b16a6f145224ad6b0b6eb32adb026f95 | 7d28d310063d147930ec4705aa5ebdf94ea8e924 | refs/heads/master | 2020-09-23T04:43:54.059923 | 2019-12-19T03:59:22 | 2019-12-19T03:59:22 | 225,405,289 | 0 | 1 | BSD-2-Clause | 2019-12-02T15:17:37 | 2019-12-02T15:17:36 | null | UTF-8 | C++ | false | false | 1,198 | h | //== TaintManager.h - Managing taint --------------------------- -*- C++ -*--=//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file provides APIs for adding, removing, querying symbol taint.
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TAINTMANAGER_H
#define LLVM_CLANG_TAINTMANAGER_H
#include "clang/StaticAnalyzer/Core/PathSensitive/TaintTag.h"
namespace clang {
namespace ento {
/// The GDM component containing the tainted root symbols. We lazily infer the
/// taint of the dependent symbols. Currently, this is a map from a symbol to
/// tag kind. TODO: Should support multiple tag kinds.
struct TaintMap {};
typedef llvm::ImmutableMap<SymbolRef, TaintTagType> TaintMapImpl;
template<> struct ProgramStateTrait<TaintMap>
: public ProgramStatePartialTrait<TaintMapImpl> {
static void *GDMIndex() { static int index = 0; return &index; }
};
class TaintManager {
TaintManager() {}
};
}
}
#endif
| [
"ajavadia@princeton.edu"
] | ajavadia@princeton.edu |
152d09afcbffe02d3081f6c70de71ca9f6d1dccb | 7d36a8381e9cb8b3e7069970f9f9e9141a933ee5 | /src/network_controller.cpp | 214e6e26783bb7084fa169e5431fc0fa847c46b1 | [
"MIT"
] | permissive | thesstefan/triviality | ed73472dafd3a73ede5101f1bba328d7846355eb | 09bda0ec8c53adc1fdfde92b021e89eeba7edfe6 | refs/heads/master | 2023-08-10T22:51:39.038427 | 2021-10-09T22:56:45 | 2021-10-09T22:56:45 | 129,100,922 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,446 | cpp | #include "network_controller.h"
#include <QJsonDocument>
#include <QNetworkReply>
const QUrl NetworkController::TEST_URL =
QUrl("https://opentdb.com/api.php?amount=1&type=boolean");
NetworkController::NetworkController(QObject *parent)
: QObject(parent) {
QObject::connect(&manager, &QNetworkAccessManager::finished,
this, &NetworkController::onConnection);
}
NetworkController::NetworkController(const QUrl& requestURL, QObject *parent)
: QObject(parent), request(requestURL) {
QObject::connect(&manager, &QNetworkAccessManager::finished,
this, &NetworkController::onConnection);
}
void NetworkController::setRequestURL(const QUrl& requestURL) {
this->request = QNetworkRequest(requestURL);
}
void NetworkController::testConnection() {
this->manager.get(QNetworkRequest(TEST_URL));
}
void NetworkController::executeRequest() {
this->manager.get(this->request);
}
QJsonObject NetworkController::getObject() const {
return this->jsonObject;
}
int NetworkController::getStatus() const {
return this->status;
}
void NetworkController::onConnection(QNetworkReply *reply) {
if (reply->error() != QNetworkReply::NoError) {
this->manager.clearAccessCache();
reply->deleteLater();
this->status = reply->error();
}
this->jsonObject = QJsonDocument::fromJson(reply->readAll()).object();
emit finished();
}
| [
"stefan_sf@protonmail.com"
] | stefan_sf@protonmail.com |
a321bcb7d37340fc3f81f47036345c98421cfda8 | 98d25456e1ed88e32a940ea26e1051c9ef9f640e | /lang/steve/Format.hpp | b55f22144e9ac78ed15f1a6d26dcf8d9a85f2fc6 | [
"Apache-2.0"
] | permissive | flowgrammable/steve-legacy | 3184cc710f5c6ad153d36230d3d4ff02a13ec42d | 5e7cbc16280c199732d26a2cb0703422695abe16 | refs/heads/master | 2021-01-12T21:00:22.958379 | 2015-03-29T23:02:42 | 2015-03-29T23:02:42 | 19,458,176 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 616 | hpp |
#ifndef STEVE_FORMAT_HPP
#define STEVE_FORMAT_HPP
#include <iosfwd>
// This module imports the cppformat library by Victor Zverovich.
// In particular, it makes a number of facilities available in the
// steve namesapce.
#include <steve/contrib/cppformat/format.h>
namespace steve {
using fmt::format; // The format facilitiy
// Text formatters.
using fmt::bin;
using fmt::oct;
using fmt::hex;
using fmt::pad;
// Import the Writer class as an alternative to stringstream.
using fmt::Writer;
// Other formatting and streaming utilities.
int stream_base(const std::ios_base&);
} // namespace steve
#endif
| [
"andrew.n.sutton@gmail.com"
] | andrew.n.sutton@gmail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.