blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 4 201 | content_id stringlengths 40 40 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | repo_name stringlengths 7 100 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringclasses 260
values | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 11.4k 681M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 17
values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 80
values | src_encoding stringclasses 28
values | language stringclasses 1
value | is_vendor bool 1
class | is_generated bool 2
classes | length_bytes int64 8 9.86M | extension stringclasses 52
values | content stringlengths 8 9.86M | authors listlengths 1 1 | author stringlengths 0 119 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
98306ba526b04d670d0dc4cc42d2384873b77788 | 5dd6b245be47ddf92ba37cbae0618391ecb34e8f | /lib/module/0010_text_bild_video_link/styles_scss.inc | 16336903ab31cb480225475ecea69ccaeb7cfc43 | [
"MIT"
] | permissive | cukabeka/REX_Themesync | ea288f4ce0501b789284e9ba89a6778e4c385d7f | 978d21c11c41b9975567f32eb3026b21f38b40e2 | refs/heads/master | 2023-02-28T15:04:23.093892 | 2017-09-23T23:07:33 | 2017-09-23T23:07:33 | 106,560,395 | 4 | 0 | MIT | 2018-05-18T12:18:29 | 2017-10-11T13:49:28 | JavaScript | UTF-8 | C++ | false | false | 282 | inc | // CSS für die Einbindung von Videos
.responsive-video iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.responsive-video {
position: relative;
padding-bottom: 56.25%; /* 16:9 ratio*/
padding-top: 0px;
height: 0;
overflow: hidden;
}
| [
"github@kreischer.de"
] | github@kreischer.de |
3f893b942cce680f9657f0711def247b07064c7b | 67751aed18c35fa7a0806bfae934bf7636944458 | /src/irc.cpp | 6dcb529f8d4d65877cc944ba7fc66c46efd51e54 | [
"MIT"
] | permissive | SheffCrypto/AlienCoin-ALN | 5fd590756bcbaed12b8d91bdc6e78bf24326c59d | 12eeabdef1b3124926e5b625004273abe588350a | refs/heads/master | 2020-12-25T17:35:22.068937 | 2014-02-11T02:07:39 | 2014-02-11T02:07:39 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 10,608 | cpp | // Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2012 The Bitcoin developers
// Copyright (c) 2011-2012 Litecoin Developers
// Copyright (c) 2013 Aliencoin Developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "irc.h"
#include "net.h"
#include "strlcpy.h"
#include "base58.h"
using namespace std;
using namespace boost;
int nGotIRCAddresses = 0;
void ThreadIRCSeed2(void* parg);
#pragma pack(push, 1)
struct ircaddr
{
struct in_addr ip;
short port;
};
#pragma pack(pop)
string EncodeAddress(const CService& addr)
{
struct ircaddr tmp;
if (addr.GetInAddr(&tmp.ip))
{
tmp.port = htons(addr.GetPort());
vector<unsigned char> vch(UBEGIN(tmp), UEND(tmp));
return string("u") + EncodeBase58Check(vch);
}
return "";
}
bool DecodeAddress(string str, CService& addr)
{
vector<unsigned char> vch;
if (!DecodeBase58Check(str.substr(1), vch))
return false;
struct ircaddr tmp;
if (vch.size() != sizeof(tmp))
return false;
memcpy(&tmp, &vch[0], sizeof(tmp));
addr = CService(tmp.ip, ntohs(tmp.port));
return true;
}
static bool Send(SOCKET hSocket, const char* pszSend)
{
if (strstr(pszSend, "PONG") != pszSend)
printf("IRC SENDING: %s\n", pszSend);
const char* psz = pszSend;
const char* pszEnd = psz + strlen(psz);
while (psz < pszEnd)
{
int ret = send(hSocket, psz, pszEnd - psz, MSG_NOSIGNAL);
if (ret < 0)
return false;
psz += ret;
}
return true;
}
bool RecvLineIRC(SOCKET hSocket, string& strLine)
{
loop
{
bool fRet = RecvLine(hSocket, strLine);
if (fRet)
{
if (fShutdown)
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() >= 1 && vWords[0] == "PING")
{
strLine[1] = 'O';
strLine += '\r';
Send(hSocket, strLine.c_str());
continue;
}
}
return fRet;
}
}
int RecvUntil(SOCKET hSocket, const char* psz1, const char* psz2=NULL, const char* psz3=NULL, const char* psz4=NULL)
{
loop
{
string strLine;
strLine.reserve(10000);
if (!RecvLineIRC(hSocket, strLine))
return 0;
printf("IRC %s\n", strLine.c_str());
if (psz1 && strLine.find(psz1) != string::npos)
return 1;
if (psz2 && strLine.find(psz2) != string::npos)
return 2;
if (psz3 && strLine.find(psz3) != string::npos)
return 3;
if (psz4 && strLine.find(psz4) != string::npos)
return 4;
}
}
bool Wait(int nSeconds)
{
if (fShutdown)
return false;
printf("IRC waiting %d seconds to reconnect\n", nSeconds);
for (int i = 0; i < nSeconds; i++)
{
if (fShutdown)
return false;
Sleep(1000);
}
return true;
}
bool RecvCodeLine(SOCKET hSocket, const char* psz1, string& strRet)
{
strRet.clear();
loop
{
string strLine;
if (!RecvLineIRC(hSocket, strLine))
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
if (vWords[1] == psz1)
{
printf("IRC %s\n", strLine.c_str());
strRet = strLine;
return true;
}
}
}
bool GetIPFromIRC(SOCKET hSocket, string strMyName, CNetAddr& ipRet)
{
Send(hSocket, strprintf("USERHOST %s\r", strMyName.c_str()).c_str());
string strLine;
if (!RecvCodeLine(hSocket, "302", strLine))
return false;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 4)
return false;
string str = vWords[3];
if (str.rfind("@") == string::npos)
return false;
string strHost = str.substr(str.rfind("@")+1);
// Hybrid IRC used by lfnet always returns IP when you userhost yourself,
// but in case another IRC is ever used this should work.
printf("GetIPFromIRC() got userhost %s\n", strHost.c_str());
CNetAddr addr(strHost, true);
if (!addr.IsValid())
return false;
ipRet = addr;
return true;
}
void ThreadIRCSeed(void* parg)
{
IMPLEMENT_RANDOMIZE_STACK(ThreadIRCSeed(parg));
// Make this thread recognisable as the IRC seeding thread
RenameThread("bitcoin-ircseed");
try
{
ThreadIRCSeed2(parg);
}
catch (std::exception& e) {
PrintExceptionContinue(&e, "ThreadIRCSeed()");
} catch (...) {
PrintExceptionContinue(NULL, "ThreadIRCSeed()");
}
printf("ThreadIRCSeed exited\n");
}
void ThreadIRCSeed2(void* parg)
{
/* Dont advertise on IRC if we don't allow incoming connections */
if (mapArgs.count("-connect") || fNoListen)
return;
if (!GetBoolArg("-irc", false))
return;
printf("ThreadIRCSeed started\n");
int nErrorWait = 10;
int nRetryWait = 10;
while (!fShutdown)
{
CService addrConnect("92.243.23.21", 6667); // irc.lfnet.org
CService addrIRC("irc.lfnet.org", 6667, true);
if (addrIRC.IsValid())
addrConnect = addrIRC;
SOCKET hSocket;
if (!ConnectSocket(addrConnect, hSocket))
{
printf("IRC connect failed\n");
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
if (!RecvUntil(hSocket, "Found your hostname", "using your IP address instead", "Couldn't look up your hostname", "ignoring hostname"))
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
CNetAddr addrIPv4("1.2.3.4"); // arbitrary IPv4 address to make GetLocal prefer IPv4 addresses
CService addrLocal;
string strMyName;
if (GetLocal(addrLocal, &addrIPv4))
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
if (strMyName == "")
strMyName = strprintf("x%u", GetRand(1000000000));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
Send(hSocket, strprintf("USER %s 8 * : %s\r", strMyName.c_str(), strMyName.c_str()).c_str());
int nRet = RecvUntil(hSocket, " 004 ", " 433 ");
if (nRet != 1)
{
closesocket(hSocket);
hSocket = INVALID_SOCKET;
if (nRet == 2)
{
printf("IRC name already in use\n");
Wait(10);
continue;
}
nErrorWait = nErrorWait * 11 / 10;
if (Wait(nErrorWait += 60))
continue;
else
return;
}
Sleep(500);
// Get our external IP from the IRC server and re-nick before joining the channel
CNetAddr addrFromIRC;
if (GetIPFromIRC(hSocket, strMyName, addrFromIRC))
{
printf("GetIPFromIRC() returned %s\n", addrFromIRC.ToString().c_str());
if (addrFromIRC.IsRoutable())
{
// IRC lets you to re-nick
AddLocal(addrFromIRC, LOCAL_IRC);
strMyName = EncodeAddress(GetLocalAddress(&addrConnect));
Send(hSocket, strprintf("NICK %s\r", strMyName.c_str()).c_str());
}
}
if (fTestNet) {
Send(hSocket, "JOIN #aliencoininvasionTEST3\r");
Send(hSocket, "WHO #aliencoininvasionTEST3\r");
} else {
// randomly join #aliencoin00-#aliencoin99
int channel_number = GetRandInt(100);
channel_number = 0; // Aliencoin: for now, just use one channel
Send(hSocket, strprintf("JOIN #aliencoininvasion%02d\r", channel_number).c_str());
Send(hSocket, strprintf("WHO #aliencoininvasion%02d\r", channel_number).c_str());
}
int64 nStart = GetTime();
string strLine;
strLine.reserve(10000);
while (!fShutdown && RecvLineIRC(hSocket, strLine))
{
if (strLine.empty() || strLine.size() > 900 || strLine[0] != ':')
continue;
vector<string> vWords;
ParseString(strLine, ' ', vWords);
if (vWords.size() < 2)
continue;
char pszName[10000];
pszName[0] = '\0';
if (vWords[1] == "352" && vWords.size() >= 8)
{
// index 7 is limited to 16 characters
// could get full length name at index 10, but would be different from join messages
strlcpy(pszName, vWords[7].c_str(), sizeof(pszName));
printf("IRC got who\n");
}
if (vWords[1] == "JOIN" && vWords[0].size() > 1)
{
// :username!username@50000007.F000000B.90000002.IP JOIN :#channelname
strlcpy(pszName, vWords[0].c_str() + 1, sizeof(pszName));
if (strchr(pszName, '!'))
*strchr(pszName, '!') = '\0';
printf("IRC got join\n");
}
if (pszName[0] == 'u')
{
CAddress addr;
if (DecodeAddress(pszName, addr))
{
addr.nTime = GetAdjustedTime();
if (addrman.Add(addr, addrConnect, 51 * 60))
printf("IRC got new address: %s\n", addr.ToString().c_str());
nGotIRCAddresses++;
}
else
{
printf("IRC decode failed\n");
}
}
}
closesocket(hSocket);
hSocket = INVALID_SOCKET;
if (GetTime() - nStart > 20 * 60)
{
nErrorWait /= 3;
nRetryWait /= 3;
}
nRetryWait = nRetryWait * 11 / 10;
if (!Wait(nRetryWait += 60))
return;
}
}
#ifdef TEST
int main(int argc, char *argv[])
{
WSADATA wsadata;
if (WSAStartup(MAKEWORD(2,2), &wsadata) != NO_ERROR)
{
printf("Error at WSAStartup()\n");
return false;
}
ThreadIRCSeed(NULL);
WSACleanup();
return 0;
}
#endif
| [
"root@d1stkfactory"
] | root@d1stkfactory |
e0fc3c0e7dc08f9fb1863e4a731aa8e459d57751 | ef395f98b0fc97bb16ac9efddbbc03bc22f47ca8 | /LearningDsAlgoCLite/AvlTreeCode/AvlTree.cpp | 74fb9fa30e0d9d8e4ed5de445c8f1e5a725873c6 | [] | no_license | Bipul1895/DS-and-Algo-in-Cpp | a03d4f4e63d454c0f8a821bd11a0480c71c408fd | 9a35b2427de68ac411139fd674ec69bc318ef69d | refs/heads/master | 2022-11-21T12:48:34.725470 | 2020-07-28T11:39:36 | 2020-07-28T11:39:36 | 283,155,019 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,040 | cpp | #include "AvlTree.hpp"
#include <algorithm>
AvlTree::AvlTree(int key) : val(key) , height(1), lTree(nullptr), rTree(nullptr) {
}
AvlTree* AvlTree::insert(AvlTree *root, int key) {
if(root== nullptr) {
AvlTree* newNode=new AvlTree(key);
return newNode;
}
if(key < root->val){
root->lTree=insert(root->lTree, key);
}
else{
root->rTree=insert(root->rTree, key);
}
root->height=nodeHeight(root);
if(balanceFactor(root)==2){
if(balanceFactor(root->lTree)==1){
return LLRotation(root);
}
else if(balanceFactor(root->lTree)==-1){
return LRRotation(root);
}
}
else if(balanceFactor(root)==-2){
}
return root;
}
int AvlTree::balanceFactor(AvlTree * root) {
AvlTree *left=root->lTree, *right=root->rTree;
if(left==nullptr and right==nullptr) return 0;
else if(left==nullptr) return 0-right->height;
else if(right==nullptr) return left->height;
return left->height - right->height;
}
int AvlTree::nodeHeight(AvlTree * root) {
if(root== nullptr) return 0;
AvlTree *left=root->lTree, *right=root->rTree;
if(left== nullptr && right== nullptr) return 1;
else if(left== nullptr) return right->height+1;
else if(right== nullptr) return left->height+1;
return std::max(left->height, right->height) + 1;
}
AvlTree* AvlTree::LRRotation(AvlTree * root) {
AvlTree* lRoot=root->lTree;
AvlTree* rLRoot=lRoot->rTree;
lRoot->rTree=rLRoot->lTree;
root->lTree=rLRoot->rTree;
rLRoot->lTree=lRoot;
rLRoot->rTree=root;
//fixing heights:
root->height=nodeHeight(root);
lRoot->height=nodeHeight(lRoot);
rLRoot->height=nodeHeight(rLRoot);
return rLRoot;
}
AvlTree* AvlTree::LLRotation(AvlTree * root) {
AvlTree* lRoot=root->lTree;
AvlTree* lRRoot=lRoot->rTree;
root->lTree=lRRoot;
lRoot->rTree=root;
//fixing heights:
root->height=nodeHeight(root);
lRoot->height=nodeHeight(lRoot);
return lRoot;
}
| [
"bipuliitian2016@gmail.com"
] | bipuliitian2016@gmail.com |
7d54b011119a4a2f8edf6b90fd6896192c238b63 | 6e6792d640329e1d537bf6e1667922eb63a08a68 | /6.2) Graphs Dijkstras Algorithm/dijkstra.cpp | bb469de96682a800c6d3d4659e99e8dc33bf3647 | [] | no_license | BohdanRomaniuk/ParallelProgramming-Tasks | 66ee23a35f7452d8acc846b0323eff131f79b5eb | 6f41ef5f6aa8aa2283ae837ecd4a1c2eae8e3d02 | refs/heads/master | 2021-08-23T21:32:17.521821 | 2017-11-13T18:05:59 | 2017-11-13T18:05:59 | 103,436,668 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,296 | cpp | #include <iostream>
#include <thread>
#include <ctime>
using namespace std;
void checking(int** matrix, int* ways, bool* visited, int pos, unsigned from, unsigned to)
{
for (unsigned j = from; j < to; ++j)
{
if (!visited[j] && matrix[pos][j] != 0 && ways[pos] != INT_MAX && ways[pos] + matrix[pos][j] < ways[j])
{
ways[j] = ways[pos] + matrix[pos][j];
}
}
}
void dijkstra(int** matrix, int* ways, unsigned size, unsigned threadsCount=1)
{
bool* visited = new bool[size];
for (unsigned i = 0; i<size; ++i)
{
ways[i] = INT_MAX;
visited[i] = false;
}
ways[0] = 0;
for (unsigned i = 0; i < size-1; ++i)
{
int min = INT_MAX;
int pos=0;
for (unsigned j = 0; j < size; ++j)
{
if (!visited[j] && ways[j] <= min)
{
min = ways[j];
pos = j;
}
}
visited[pos] = true;
thread* threadArray = new thread[threadsCount];
unsigned from = 0;
unsigned threadStep = size / threadsCount;
unsigned to = threadStep;
for (unsigned i = 0; i < threadsCount; ++i)
{
threadArray[i] = thread(checking, matrix, ways, visited, pos, from, to);
threadArray[i].join();
from += threadStep;
to += threadStep;
}
}
delete[] visited;
}
void main()
{
const unsigned size = 100;
int** matrix = new int*[size];
int* ways = new int[size];
srand(time(NULL));
for (unsigned i = 0; i < size; ++i)
{
matrix[i] = new int[size];
for (unsigned j = 0; j < size; ++j)
{
if (i == j)
{
matrix[i][j] = 0;
}
else
{
matrix[i][j] = rand() % 100;
}
}
}
clock_t beginTime = clock();
dijkstra(matrix, ways, size);
cout << "1 thread time: " << (float)(clock() - beginTime) / CLOCKS_PER_SEC << " s" << endl;
beginTime = clock();
dijkstra(matrix, ways, size, 2);
cout << "2 threads time: " << (float)(clock() - beginTime) / CLOCKS_PER_SEC << " s" << endl;
beginTime = clock();
dijkstra(matrix, ways, size, 4);
cout << "4 threads time: " << (float)(clock() - beginTime) / CLOCKS_PER_SEC << " s" << endl;
beginTime = clock();
dijkstra(matrix, ways, size, 10);
cout << "10 threads time: " << (float)(clock() - beginTime) / CLOCKS_PER_SEC << " s" << endl;
beginTime = clock();
dijkstra(matrix, ways, size, 50);
cout << "50 threads time: " << (float)(clock() - beginTime) / CLOCKS_PER_SEC << " s" << endl;
system("pause");
} | [
"bohdan2307@gmail.com"
] | bohdan2307@gmail.com |
4cfa55eb0c9ec9ce155411cc2785de10843e7592 | 369a3f9f2f2122b285466ad4439547cbaa8fc301 | /OOP Lab 10/OOP Lab 10/Task1/Academic.h | 1f4c9271cc0e6bad58dd28244388677e63b69ba4 | [] | no_license | musakhan18/OOP | d275bb8ee7fc8cc039b2a5df63d7d1e338279b63 | e19cb1d152f59b422fd92aac837d3bbed23aed77 | refs/heads/main | 2023-04-19T02:40:15.061391 | 2021-04-20T12:41:32 | 2021-04-20T12:41:32 | 354,809,313 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 307 | h | #pragma once
#include"Employee.h"
class Academic:public Employee
{
public:
Academic();
Academic(int, char* , char* , int , int=0, char* =nullptr, int =0);
void SetcourseID(int);
void SetcourseTitle(char*);
int GetcourseID()const;
char* GetcourseTitle()const;
void display()const;
};
| [
"noreply@github.com"
] | noreply@github.com |
53130f0c9cd55feb15a1544060b6ca8d5d0ad0d6 | d2ea2cf1c9f476b936914c20857c37556bc92603 | /main.cpp | d8e1824c5b08b0dcabf773c75312f48e3ae24ad5 | [] | no_license | mkknts35/RSA | 2df5fa809eac63521335c0d779efa43a9bb3666a | 77c420053cf08a338ded3169a58a9b04c154a9db | refs/heads/master | 2020-05-23T07:55:45.318442 | 2017-01-30T22:37:04 | 2017-01-30T22:37:04 | 80,465,576 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,382 | cpp | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <regex>
#include "rsa.h"
#include "pp.h"
using namespace std;
const int PUBLIC_KEY[] = {121, 10677301};
const int PRIVATE_KEY[] = {705481, 10677301};
int main(int argc, char *argv[]){
regex exp("[+-]?[0-9]+");
ifstream fin;
if (argc != 4) {
cout << "Invalid input." << endl;
return 0;
}
string filename(argv[1]);
fin.open(filename);
if (!fin){
cout << "Cannot open file: " << filename << endl;
return 0;
}
string s_key(argv[2]);
string s_n(argv[3]);
if (!regex_match(s_key, exp) || !regex_match(s_n, exp)){
cout << "Invalid input: (" << s_key << ", " << s_n << ") is not a valid key pair." << endl;
return 0;
}
int key = stoi(s_key);
int n = stoi(s_n);
stringstream buffer;
buffer << fin.rdbuf();
fin.close();
#if ENCRYPT
string message = encrypt(buffer.str(), key, n);
string extension = ".encoded";
#else
string message = decrypt(buffer, key, n);
string extension = ".decoded";
#endif
string outfile = filename.substr(0, filename.find('.')) + extension;
ofstream fout;
fout.open(outfile);
if (!fout) {
cout << "Cannot create file: " << outfile << endl;
return 0;
}
fout << message;
fout.close();
return 0;
}
| [
"mk.77@live.ca"
] | mk.77@live.ca |
57e667cdf61c4eaa52f438d820863e713d4a42ee | e99c2d3c59237d4d6562be01205c1060bc1903c3 | /src/modules/module_rtc.h | 212b64d10148f38c6f17d06de5b34abe9daae674 | [
"WTFPL"
] | permissive | punkyman/smartphone | 56d291887ee120f4159aaeb5d7874dede8a42a2d | 28d630ef9a1295643b57a502aa703aa8e6bdc39a | refs/heads/master | 2021-09-20T02:37:47.155096 | 2018-08-02T09:49:21 | 2018-08-02T09:49:21 | 119,412,833 | 1 | 0 | WTFPL | 2018-02-23T13:45:20 | 2018-01-29T17:00:36 | C++ | UTF-8 | C++ | false | false | 413 | h | #pragma once
#include <Arduino.h>
namespace ModuleRtc
{
void setup();
void update();
void get_time(uint8_t* hour, uint8_t* minutes);
void get_date(uint8_t* day,uint8_t* month, uint16_t* year);
void set_time(uint8_t hour, uint8_t minutes);
void set_date(uint8_t day,uint8_t month, uint16_t year);
// temperature (!), rough values but it does work!
float get_temperature();
}
| [
"punky@tromblon"
] | punky@tromblon |
a7063ccf08c84d85840fc70af89996005b08c0da | f8f4984afe524ccd22e6d9763b5a4673246614fc | /滴滴笔试编程题/源.cpp | c1ddccb0298c67e1b64c2776b6b3c6adcb30a17b | [] | no_license | ades4/cpp_code | cbe8b42a5caab5af34e756188e05af0528ac849f | 7188e6c94c984b16c3df766ab6a4e8ad94bd469c | refs/heads/master | 2021-07-16T00:51:00.215427 | 2020-09-18T14:19:33 | 2020-09-18T14:19:33 | 207,292,663 | 1 | 0 | null | null | null | null | IBM852 | C++ | false | false | 591 | cpp | #define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <string>
using namespace std;
string r_string(string &h)
{
//─ŠÍ├
string res = "";
int begin = 0;
int end = h.length() - 1;
char tmp;
while (begin <= end) {
tmp = h[begin];
h[begin] = h[end];
h[end] = tmp;
begin++;
end--;
}
res = h;
return res;
}
int main()
{
int n, i = 0;
cin >> n;
string s, h, tmp, res;
cin.get();
getline(cin, s);
while (i < s.length()) {
h = s.substr(i, n);
tmp = r_string(h);
res += tmp;
i += n;
}
cout << res << endl;
res = "";
system("pause");
return 0;
} | [
"1647635529@qq.com"
] | 1647635529@qq.com |
9ae325aae23acb438a6b8475ebc425827743d2c5 | 713926478a1f876c0d30744d90f829109cd1bd64 | /Lol2019/Day_2/K/20270667.cpp | 25b4d1ba9740f62aec228767c8515d61cfa5336e | [] | no_license | Igor-SeVeR/OlympiadProblems | f8b191488c11bf92bdfc580bbac660f6ed7bddef | 7197aa7a6853ff916ee9da090d53580253dabffb | refs/heads/master | 2020-06-10T21:45:20.565411 | 2019-07-21T18:18:55 | 2019-07-21T18:18:55 | 193,752,484 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 639 | cpp | #include <iostream>
#include <deque>
#include <string>
#include <cctype>
using namespace std;
int main() {
int n;
cin >> n;
string str, num = "", x;
deque <string> first;
deque <string> second;
char doing;
for (int i = 0; i < n; i++) {
cin >> doing;
if (doing != '-') {
cin >> num;
}
if (doing == '+') {
second.push_back(num);
}
else if (doing == '*') {
second.push_front(num);
}
else {
cout << first.front() << endl;
first.pop_front();
}
if (second.size() > first.size()) {
x = second.front();
first.push_back(x);
second.pop_front();
}
num = "";
}
//system("pause");
return 0;
} | [
"voafanasev@edu.hse.ru"
] | voafanasev@edu.hse.ru |
dc49d33e03aa9275cb2bfac32af84d65df7b7ee5 | 38b9daafe39f937b39eefc30501939fd47f7e668 | /tutorials/2WayCouplingOceanWave3D/EvalResults180628-Eta/92.8/p_rgh | 8fa7799c4078e5d91f3d674356a56765b62d29a2 | [] | no_license | rubynuaa/2-way-coupling | 3a292840d9f56255f38c5e31c6b30fcb52d9e1cf | a820b57dd2cac1170b937f8411bc861392d8fbaa | refs/heads/master | 2020-04-08T18:49:53.047796 | 2018-08-29T14:22:18 | 2018-08-29T14:22:18 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 195,838 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 3.0.1 |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "92.8";
object p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -1 -2 0 0 0 0];
internalField nonuniform List<scalar>
21420
(
368.749
386.814
401.187
411.71
418.297
420.771
418.965
413.119
403.328
389.608
372.137
351.169
327.057
300.113
270.749
239.33
206.291
172.114
137.183
101.918
66.7313
31.9431
-2.11187
-35.0449
-66.7413
-96.9649
-125.586
-152.479
-177.569
-200.818
-222.2
-241.722
-259.409
-275.293
-289.418
-301.831
-312.581
-321.716
-329.279
-335.31
-339.838
-342.889
-344.475
-344.566
-343.165
-340.261
-335.817
-329.804
-322.176
-312.888
-301.916
-289.188
-274.685
-258.347
-240.149
-220.092
-198.189
-174.451
-148.939
-121.732
-92.9349
-62.7114
-31.2239
1.34357
34.8112
68.6967
102.79
136.751
170.24
202.885
234.3
264.118
291.979
317.518
340.413
360.35
377.053
390.265
399.77
405.425
407.102
404.757
398.393
388.078
373.899
356.086
334.87
310.53
283.394
253.817
222.171
188.847
154.256
118.813
82.9329
47.025
11.4898
-23.2786
-56.9855
-89.314
-120.005
-148.855
-175.714
-200.481
-223.101
-243.561
-261.881
-278.105
-292.292
-304.516
-314.848
-323.363
-330.132
-335.223
-338.694
-340.606
-340.995
-339.892
-337.333
-333.366
-327.992
-321.22
-313.05
-303.478
-292.503
-280.105
-266.267
-250.976
-234.203
-215.929
-196.137
-174.805
-151.923
-127.507
-101.585
-74.2129
-45.481
-15.5299
15.45
47.8412
80.3002
113.118
145.943
178.409
210.122
240.676
269.648
296.615
321.159
342.877
361.403
376.409
387.618
394.812
397.819
396.54
391.025
381.341
367.56
349.931
328.731
304.299
277.027
247.346
215.715
182.604
148.488
113.828
79.0638
44.603
10.8227
-21.9755
-53.5079
-83.5548
-111.946
-138.559
-163.314
-186.17
-207.113
-226.157
-243.33
-258.679
-272.26
-284.137
-294.372
-303.024
-310.153
-315.805
-320.033
-322.89
-324.425
-324.652
-323.581
-321.29
-317.752
-312.968
-306.921
-299.588
-290.934
-280.914
-269.485
-256.593
-242.197
-226.264
-208.762
-189.679
-169.008
-146.757
-122.961
-97.6718
-70.9607
-42.938
-13.7399
16.4676
47.4785
79.1592
111.043
142.918
174.436
205.227
234.894
263.032
289.224
313.059
334.141
352.1
366.601
377.361
384.159
386.814
385.27
379.536
369.708
355.881
338.31
317.281
293.139
266.275
237.119
206.126
173.765
140.51
106.82
73.1324
39.848
7.3196
-24.1504
-54.3128
-82.9728
-109.986
-135.253
-158.715
-180.342
-200.138
-218.125
-234.34
-248.833
-261.658
-272.875
-282.54
-290.711
-297.442
-302.788
-306.803
-309.528
-311.004
-311.246
-310.277
-308.112
-304.764
-300.233
-294.53
-287.622
-279.504
-270.158
-259.551
-247.652
-234.415
-219.802
-203.769
-186.276
-167.284
-146.78
-124.738
-101.151
-76.0475
-49.4523
-21.4114
8.00987
38.8223
65.3605
97.0818
128.877
160.476
191.511
221.596
250.247
276.989
301.386
322.995
341.43
356.36
367.498
374.657
377.721
376.59
371.313
361.974
348.772
331.98
311.937
289.029
263.657
236.246
207.261
177.142
146.327
115.207
84.1457
53.4725
23.4815
-5.4435
-33.4228
-60.344
-86.0783
-110.554
-133.722
-155.562
-176.071
-195.242
-213.081
-229.591
-244.763
-258.588
-271.049
-282.121
-291.771
-299.964
-306.659
-311.817
-315.408
-317.384
-317.68
-316.218
-313.031
-308.096
-301.434
-293.028
-282.89
-271.042
-257.48
-242.243
-225.358
-206.884
-186.895
-165.456
-142.646
368.866
386.945
401.33
411.862
418.452
420.936
419.131
413.281
403.481
389.749
372.265
351.282
327.152
300.19
270.807
239.369
206.311
172.116
137.168
101.888
66.6881
31.8884
-2.17616
-35.1172
-66.8191
-97.0465
-125.67
-152.563
-177.654
-200.901
-222.282
-241.802
-259.486
-275.367
-289.489
-301.9
-312.647
-321.78
-329.341
-335.37
-339.897
-342.947
-344.532
-344.623
-343.226
-340.323
-335.878
-329.867
-322.241
-312.956
-301.987
-289.26
-274.76
-258.424
-240.228
-220.173
-198.271
-174.532
-149.019
-121.81
-93.0093
-62.7809
-31.2878
1.28521
34.7692
68.6631
102.769
136.743
170.246
202.908
234.338
264.173
292.05
317.605
340.515
360.466
377.182
390.405
399.918
405.578
407.265
404.909
398.542
388.221
374.034
356.208
334.978
310.622
283.468
253.873
222.208
188.866
154.256
118.795
82.8988
46.9757
11.4264
-23.3525
-57.0697
-89.406
-120.103
-148.956
-175.817
-200.584
-223.202
-243.66
-261.977
-278.196
-292.38
-304.6
-314.929
-323.44
-330.206
-335.295
-338.763
-340.674
-341.061
-339.954
-337.397
-333.429
-328.055
-321.283
-313.113
-303.543
-292.568
-280.171
-266.335
-251.046
-234.275
-216.003
-196.212
-174.882
-152.002
-127.586
-101.663
-74.2894
-45.554
-15.5968
15.3837
47.791
80.2548
113.086
145.926
178.407
210.138
240.709
269.701
296.687
321.249
342.985
361.527
376.547
387.766
394.969
397.986
396.699
391.181
381.49
367.699
350.057
328.839
304.389
277.097
247.394
215.742
182.612
148.477
113.799
79.0192
44.5452
10.7536
-22.0534
-53.5923
-83.6437
-112.038
-138.651
-163.406
-186.261
-207.202
-226.243
-243.413
-258.758
-272.336
-284.21
-294.442
-303.092
-310.218
-315.867
-320.093
-322.949
-324.482
-324.706
-323.637
-321.345
-317.808
-313.024
-306.979
-299.647
-290.995
-280.978
-269.551
-256.661
-242.267
-226.336
-208.836
-189.754
-169.084
-146.834
-123.037
-97.7461
-71.0328
-43.0064
-13.803
16.411
47.4318
79.1171
111.015
142.903
174.436
205.243
234.928
263.084
289.295
313.148
334.248
352.223
366.738
377.509
384.315
386.979
385.427
379.69
369.854
356.016
338.431
317.385
293.224
266.341
237.164
206.15
173.769
140.495
106.788
73.0852
39.7881
7.2494
-24.2284
-54.3964
-83.06
-110.075
-135.343
-158.804
-180.43
-200.223
-218.207
-234.419
-248.909
-261.731
-272.944
-282.606
-290.774
-297.503
-302.846
-306.859
-309.583
-311.056
-311.297
-310.326
-308.162
-304.814
-300.283
-294.58
-287.674
-279.557
-270.212
-259.607
-247.709
-234.476
-219.865
-203.835
-186.344
-167.355
-146.854
-124.813
-101.228
-76.1246
-49.5295
-21.4888
7.92934
38.7231
65.352
97.0581
128.859
160.471
191.523
221.628
250.299
277.062
301.48
323.107
341.559
356.502
367.651
374.816
377.889
376.748
371.465
362.118
348.905
332.098
312.037
289.11
263.719
236.288
207.284
177.148
146.317
115.182
84.1092
53.4269
23.4295
-5.50015
-33.483
-60.4065
-86.1419
-110.618
-133.785
-155.624
-176.132
-195.302
-213.14
-229.649
-244.821
-258.646
-271.107
-282.179
-291.831
-300.024
-306.72
-311.88
-315.473
-317.45
-317.747
-316.286
-313.099
-308.165
-301.503
-293.096
-282.958
-271.111
-257.549
-242.312
-225.426
-206.951
-186.961
-165.521
-142.708
369.1
387.208
401.617
412.166
418.761
421.259
419.468
413.607
403.787
390.033
372.522
351.508
327.344
300.345
270.924
239.446
206.351
172.12
137.138
101.829
66.6016
31.7789
-2.30496
-35.2618
-66.9747
-97.2097
-125.838
-152.733
-177.823
-201.069
-222.446
-241.961
-259.64
-275.515
-289.632
-302.037
-312.779
-321.907
-329.465
-335.49
-340.015
-343.063
-344.647
-344.736
-343.347
-340.444
-336.002
-329.994
-322.372
-313.091
-302.126
-289.405
-274.909
-258.578
-240.385
-220.333
-198.433
-174.694
-149.179
-121.965
-93.157
-62.919
-31.4143
1.16937
34.6865
68.5973
102.726
136.728
170.261
202.954
234.416
264.285
292.194
317.78
340.722
360.7
377.441
390.686
400.216
405.889
407.593
405.219
398.845
388.513
374.309
356.46
335.201
310.812
283.624
253.993
222.291
188.912
154.266
118.77
82.8412
46.8877
11.3107
-23.489
-57.2264
-89.5782
-120.286
-149.146
-176.01
-200.776
-223.392
-243.844
-262.155
-278.367
-292.543
-304.755
-315.076
-323.58
-330.34
-335.424
-338.888
-340.794
-341.178
-340.065
-337.509
-333.54
-328.166
-321.394
-313.225
-303.657
-292.684
-280.289
-266.457
-251.17
-234.403
-216.135
-196.348
-175.02
-152.144
-127.729
-101.804
-74.4269
-45.6848
-15.7157
15.2734
47.6982
80.1782
113.036
145.905
178.417
210.182
240.789
269.818
296.843
321.442
343.214
361.788
376.835
388.076
395.293
398.327
397.031
391.505
381.8
367.989
350.318
329.067
304.578
277.246
247.502
215.808
182.637
148.464
113.751
78.9408
44.4405
10.6262
-22.1982
-53.7502
-83.8104
-112.21
-138.825
-163.579
-186.431
-207.368
-226.403
-243.567
-258.906
-272.477
-284.344
-294.57
-303.215
-310.335
-315.98
-320.203
-323.055
-324.584
-324.802
-323.737
-321.443
-317.906
-313.124
-307.08
-299.752
-291.105
-281.092
-269.669
-256.785
-242.396
-226.468
-208.972
-189.892
-169.224
-146.974
-123.177
-97.8821
-71.1645
-43.1307
-13.9173
16.3095
47.3492
79.0451
110.969
142.884
174.447
205.286
235.006
263.198
289.447
313.337
334.472
352.479
367.022
377.815
384.636
387.318
385.751
380.008
370.157
356.297
338.683
317.604
293.405
266.481
237.263
206.208
173.787
140.475
106.734
73.0009
39.6786
7.11939
-24.374
-54.553
-83.2237
-110.242
-135.511
-158.97
-180.593
-200.382
-218.36
-234.566
-249.049
-261.865
-273.072
-282.728
-290.891
-297.614
-302.953
-306.962
-309.682
-311.152
-311.389
-310.418
-308.255
-304.905
-300.375
-294.673
-287.769
-279.655
-270.315
-259.713
-247.82
-234.591
-219.986
-203.964
-186.478
-167.494
-146.997
-124.96
-101.378
-76.2766
-49.6817
-21.6415
7.77068
38.5333
65.3289
97.0111
128.824
160.463
191.55
221.693
250.405
277.21
301.668
323.332
341.818
356.788
367.958
375.135
378.221
377.071
371.771
362.407
349.172
332.335
312.239
289.274
263.844
236.373
207.331
177.16
146.296
115.133
84.0362
53.3354
23.3255
-5.61344
-33.6035
-60.5316
-86.2691
-110.745
-133.911
-155.748
-176.253
-195.421
-213.258
-229.765
-244.936
-258.761
-271.223
-282.296
-291.949
-300.144
-306.843
-312.006
-315.602
-317.583
-317.88
-316.423
-313.235
-308.301
-301.64
-293.234
-283.096
-271.248
-257.687
-242.449
-225.562
-207.085
-187.092
-165.649
-142.831
369.451
387.602
402.047
412.622
419.229
421.734
419.975
414.095
404.247
390.458
372.907
351.846
327.631
300.576
271.098
239.563
206.41
172.125
137.094
101.739
66.4716
31.6145
-2.49839
-35.479
-67.2085
-97.4547
-126.09
-152.988
-178.077
-201.32
-222.691
-242.2
-259.871
-275.738
-289.846
-302.243
-312.977
-322.098
-329.65
-335.67
-340.192
-343.237
-344.82
-344.909
-343.527
-340.626
-336.186
-330.184
-322.568
-313.294
-302.336
-289.623
-275.134
-258.81
-240.622
-220.573
-198.675
-174.936
-149.418
-122.197
-93.3788
-63.1262
-31.6041
0.995108
34.5626
68.4981
102.662
136.705
170.283
203.024
234.533
264.452
292.41
318.044
341.031
361.052
377.83
391.109
400.665
406.355
408.071
405.695
399.304
388.953
374.723
356.839
335.537
311.1
283.86
254.175
222.417
188.982
154.282
118.735
82.7563
46.7573
11.1386
-23.692
-57.46
-89.8349
-120.559
-149.429
-176.297
-201.063
-223.674
-244.119
-262.42
-278.621
-292.785
-304.985
-315.295
-323.789
-330.54
-335.616
-339.074
-340.972
-341.351
-340.232
-337.677
-333.706
-328.331
-321.559
-313.392
-303.826
-292.855
-280.464
-266.637
-251.354
-234.593
-216.331
-196.549
-175.226
-152.354
-127.94
-102.014
-74.6308
-45.8789
-15.8921
15.1327
47.5387
80.0652
112.963
145.875
178.435
210.25
240.912
269.997
297.079
321.734
343.559
362.181
377.269
388.543
395.782
398.83
397.54
391.996
382.269
368.426
350.713
329.411
304.865
277.472
247.665
215.908
182.677
148.446
113.682
78.8248
44.285
10.4366
-22.414
-53.9855
-84.0591
-112.466
-139.084
-163.838
-186.685
-207.616
-226.643
-243.797
-259.126
-272.687
-284.545
-294.761
-303.397
-310.51
-316.148
-320.365
-323.212
-324.736
-324.946
-323.884
-321.588
-318.052
-313.271
-307.232
-299.909
-291.267
-281.262
-269.846
-256.968
-242.586
-226.665
-209.174
-190.098
-169.432
-147.184
-123.384
-98.0849
-71.3603
-43.3158
-14.0873
16.1588
47.2257
78.9398
110.902
142.858
174.465
205.353
235.125
263.372
289.676
313.622
334.81
352.866
367.45
378.276
385.119
387.82
386.246
380.49
370.614
356.721
339.064
317.933
293.678
266.694
237.414
206.297
173.816
140.447
106.654
72.8762
39.516
6.92597
-24.5908
-54.7863
-83.4676
-110.492
-135.762
-159.219
-180.836
-200.618
-218.588
-234.785
-249.259
-262.064
-273.262
-282.91
-291.064
-297.78
-303.112
-307.115
-309.829
-311.295
-311.526
-310.558
-308.392
-305.042
-300.514
-294.813
-287.913
-279.803
-270.468
-259.872
-247.986
-234.765
-220.169
-204.156
-186.678
-167.702
-147.213
-125.182
-101.604
-76.5049
-49.9101
-21.8705
7.53388
38.2558
65.286
96.9389
128.771
160.451
191.589
221.79
250.564
277.43
301.949
323.67
342.206
357.217
368.418
375.614
378.706
377.563
372.234
362.842
349.572
332.69
312.541
289.52
264.03
236.501
207.401
177.177
146.264
115.058
83.9263
53.1979
23.1694
-5.78348
-33.7844
-60.7194
-86.4601
-110.936
-134.1
-155.935
-176.436
-195.6
-213.434
-229.939
-245.109
-258.934
-271.397
-282.471
-292.127
-300.325
-307.027
-312.194
-315.794
-317.781
-318.082
-316.629
-313.439
-308.505
-301.845
-293.44
-283.303
-271.455
-257.893
-242.656
-225.766
-207.286
-187.29
-165.841
-143.016
369.919
388.128
402.621
413.231
419.857
422.369
420.64
414.744
404.858
391.025
373.42
352.298
328.015
300.886
271.33
239.717
206.489
172.132
137.034
101.618
66.2979
31.3949
-2.75664
-35.7691
-67.5204
-97.7816
-126.426
-153.328
-178.417
-201.655
-223.019
-242.519
-260.179
-276.035
-290.132
-302.517
-313.241
-322.353
-329.897
-335.911
-340.428
-343.469
-345.049
-345.14
-343.766
-340.868
-336.433
-330.438
-322.829
-313.565
-302.616
-289.913
-275.432
-259.118
-240.937
-220.894
-199
-175.26
-149.736
-122.507
-93.6749
-63.4027
-31.8571
0.763044
34.3964
68.3649
102.577
136.673
170.312
203.116
234.689
264.674
292.698
318.396
341.443
361.52
378.349
391.672
401.262
406.976
408.701
406.335
399.922
389.542
375.275
357.344
335.985
311.483
284.176
254.417
222.585
189.076
154.304
118.687
82.643
46.5835
10.9089
-23.9625
-57.7716
-90.1773
-120.923
-149.807
-176.681
-201.446
-224.051
-244.486
-262.773
-278.959
-293.108
-305.292
-315.587
-324.068
-330.806
-335.871
-339.32
-341.209
-341.579
-340.458
-337.899
-333.926
-328.55
-321.778
-313.613
-304.051
-293.084
-280.698
-266.876
-251.6
-234.846
-216.592
-196.817
-175.5
-152.633
-128.222
-102.294
-74.903
-46.1377
-16.1272
14.9547
47.316
79.9149
112.867
145.836
178.458
210.342
241.076
270.236
297.394
322.124
344.02
362.706
377.849
389.166
396.435
399.496
398.222
392.657
382.895
369.01
351.24
329.87
305.249
277.773
247.883
216.043
182.73
148.423
113.589
78.6699
44.0774
10.1838
-22.7019
-54.2996
-84.3909
-112.808
-139.43
-164.182
-187.024
-207.947
-226.962
-244.103
-259.419
-272.967
-284.812
-295.016
-303.641
-310.743
-316.372
-320.582
-323.42
-324.936
-325.141
-324.08
-321.782
-318.247
-313.469
-307.434
-300.118
-291.484
-281.489
-270.082
-257.213
-242.841
-226.927
-209.444
-190.373
-169.709
-147.462
-123.661
-98.3556
-71.6215
-43.5628
-14.3146
15.9577
47.0587
78.8013
110.813
142.822
174.489
205.441
235.283
263.604
289.982
314.002
335.262
353.382
368.022
378.893
385.765
388.48
386.913
381.137
371.225
357.288
339.572
318.373
294.042
266.978
237.615
206.415
173.854
140.41
106.548
72.71
39.299
6.66803
-24.8798
-55.0973
-83.7927
-110.824
-136.096
-159.55
-181.161
-200.933
-218.892
-235.076
-249.537
-262.33
-273.516
-283.152
-291.295
-298.002
-303.325
-307.318
-310.026
-311.484
-311.711
-310.744
-308.575
-305.225
-300.698
-294.999
-288.104
-280
-270.672
-260.085
-248.208
-234.997
-220.413
-204.412
-186.946
-167.98
-147.501
-125.478
-101.906
-76.8094
-50.2148
-22.1754
7.22027
37.8964
65.2168
96.8393
128.699
160.434
191.641
221.918
250.776
277.725
302.324
324.121
342.724
357.79
369.032
376.253
379.351
378.217
372.856
363.423
350.106
333.163
312.945
289.847
264.279
236.671
207.495
177.199
146.222
114.958
83.7794
53.0139
22.9613
-6.01045
-34.026
-60.9701
-86.7149
-111.191
-134.353
-156.183
-176.68
-195.839
-213.669
-230.171
-245.34
-259.164
-271.628
-282.705
-292.364
-300.566
-307.273
-312.445
-316.049
-318.041
-318.356
-316.902
-313.71
-308.777
-302.118
-293.715
-283.578
-271.731
-258.169
-242.93
-226.038
-207.555
-187.553
-166.097
-143.262
370.504
388.786
403.338
413.994
420.646
423.17
421.458
415.554
405.622
391.735
374.063
352.863
328.494
301.272
271.62
239.911
206.588
172.14
136.958
101.467
66.08
31.1197
-3.08005
-36.1325
-67.911
-98.1909
-126.846
-153.754
-178.841
-202.074
-223.429
-242.917
-260.565
-276.406
-290.489
-302.86
-313.571
-322.671
-330.205
-336.211
-340.722
-343.76
-345.336
-345.432
-344.063
-341.17
-336.74
-330.755
-323.155
-313.903
-302.965
-290.276
-275.806
-259.505
-241.331
-221.296
-199.405
-175.664
-150.135
-122.896
-94.0456
-63.7487
-32.1733
0.473718
34.1869
68.1972
102.469
136.634
170.347
203.23
234.884
264.951
293.057
318.835
341.959
362.106
378.998
392.377
402.01
407.752
409.49
407.129
400.698
390.28
375.966
357.976
336.545
311.963
284.569
254.72
222.794
189.193
154.33
118.626
82.5007
46.3657
10.6203
-24.3009
-58.1621
-90.6062
-121.379
-150.28
-177.162
-201.925
-224.522
-244.944
-263.215
-279.382
-293.511
-305.676
-315.952
-324.416
-331.139
-336.19
-339.627
-341.505
-341.866
-340.74
-338.178
-334.201
-328.824
-322.053
-313.89
-304.332
-293.369
-280.99
-267.176
-251.907
-235.163
-216.918
-197.152
-175.844
-152.983
-128.575
-102.644
-75.2442
-46.4619
-16.4228
14.7166
47.0512
79.7273
112.746
145.786
178.487
210.456
241.28
270.535
297.788
322.611
344.596
363.363
378.575
389.947
397.253
400.332
399.067
393.486
383.681
369.741
351.9
330.445
305.728
278.151
248.155
216.21
182.796
148.394
113.472
78.4751
43.8169
9.86688
-23.0626
-54.6932
-84.8065
-113.236
-139.863
-164.613
-187.448
-208.36
-227.362
-244.487
-259.787
-273.317
-285.146
-295.335
-303.945
-311.034
-316.653
-320.852
-323.68
-325.186
-325.387
-324.325
-322.024
-318.49
-313.715
-307.686
-300.379
-291.755
-281.771
-270.376
-257.52
-243.16
-227.256
-209.78
-190.716
-170.057
-147.812
-124.007
-98.6948
-71.9484
-43.8722
-14.5995
15.7048
46.8456
78.6307
110.702
142.778
174.518
205.552
235.481
263.892
290.364
314.478
335.826
354.027
368.738
379.664
386.574
389.305
387.746
381.949
371.991
357.996
340.208
318.924
294.498
267.334
237.867
206.563
173.902
140.363
106.415
72.5016
39.0271
6.34488
-25.2418
-55.4867
-84.1995
-111.241
-136.514
-159.964
-181.567
-201.327
-219.272
-235.441
-249.886
-262.662
-273.833
-283.455
-291.584
-298.278
-303.59
-307.573
-310.271
-311.721
-311.943
-310.975
-308.804
-305.453
-300.929
-295.232
-288.343
-280.246
-270.927
-260.35
-248.484
-235.288
-220.718
-204.732
-187.28
-168.328
-147.861
-125.847
-102.283
-77.1902
-50.5957
-22.5559
6.83136
37.4615
65.1139
96.7102
128.607
160.412
191.705
222.079
251.041
278.092
302.794
324.685
343.371
358.507
369.8
377.053
380.16
379.027
373.639
364.152
350.774
333.755
313.449
290.256
264.589
236.882
207.611
177.226
146.168
114.833
83.595
52.7829
22.701
-6.29456
-34.3284
-61.284
-87.0338
-111.51
-134.669
-156.493
-176.984
-196.138
-213.962
-230.461
-245.628
-259.452
-271.917
-282.997
-292.66
-300.868
-307.58
-312.758
-316.367
-318.365
-318.697
-317.242
-314.049
-309.117
-302.46
-294.058
-283.923
-272.076
-258.514
-243.274
-226.379
-207.891
-187.883
-166.418
-143.571
371.207
389.575
404.2
414.91
421.597
424.138
422.437
416.521
406.539
392.586
374.834
353.542
329.069
301.736
271.968
240.142
206.705
172.149
136.866
101.284
65.8176
30.7884
-3.46915
-36.5696
-68.3806
-98.6828
-127.351
-154.265
-179.351
-202.577
-223.922
-243.396
-261.027
-276.851
-290.917
-303.271
-313.967
-323.053
-330.575
-336.572
-341.076
-344.108
-345.681
-345.781
-344.417
-341.532
-337.109
-331.136
-323.547
-314.309
-303.385
-290.712
-276.255
-259.968
-241.805
-221.778
-199.892
-176.151
-150.615
-123.362
-94.4913
-64.1643
-32.5525
0.127098
33.9333
67.994
102.339
136.586
170.389
203.367
235.117
265.284
293.488
319.363
342.578
362.809
379.777
393.223
402.909
408.685
410.439
408.08
401.629
391.168
376.797
358.735
337.217
312.538
285.042
255.083
223.045
189.333
154.361
118.553
82.3289
46.1032
10.2722
-24.708
-58.6325
-91.1223
-121.928
-150.849
-177.739
-202.502
-225.089
-245.495
-263.746
-279.89
-293.996
-306.136
-316.39
-324.833
-331.539
-336.573
-339.996
-341.861
-342.21
-341.079
-338.511
-334.531
-329.153
-322.383
-314.223
-304.669
-293.713
-281.34
-267.535
-252.277
-235.543
-217.31
-197.555
-176.257
-153.404
-128.999
-103.065
-75.6552
-46.8522
-16.7801
14.4162
46.745
79.5026
112.599
145.726
178.52
210.591
241.525
270.893
298.26
323.197
345.288
364.151
379.446
390.884
398.237
401.339
400.081
394.482
384.625
370.62
352.692
331.135
306.304
278.604
248.482
216.41
182.875
148.357
113.33
78.2399
43.5027
9.48512
-23.497
-55.1669
-85.3067
-113.752
-140.384
-165.132
-187.958
-208.856
-227.842
-244.949
-260.228
-273.738
-285.546
-295.718
-304.311
-311.385
-316.99
-321.176
-323.993
-325.486
-325.683
-324.617
-322.315
-318.782
-314.012
-307.99
-300.692
-292.081
-282.111
-270.731
-257.889
-243.542
-227.65
-210.185
-191.129
-170.475
-148.231
-124.424
-99.1029
-72.3418
-44.2445
-14.9426
15.3996
46.5879
78.4254
110.567
142.723
174.552
205.683
235.717
264.238
290.823
315.048
336.504
354.803
369.597
380.591
387.547
390.299
388.745
382.923
372.913
358.848
340.972
319.585
295.046
267.76
238.169
206.74
173.958
140.305
106.254
72.2502
38.6994
5.95585
-25.6773
-55.9551
-84.6887
-111.741
-137.016
-160.462
-182.054
-201.8
-219.728
-235.878
-250.304
-263.061
-274.214
-283.818
-291.931
-298.61
-303.909
-307.879
-310.565
-312.007
-312.224
-311.251
-309.077
-305.726
-301.205
-295.511
-288.63
-280.542
-271.234
-260.669
-248.816
-235.636
-221.083
-205.116
-187.682
-168.746
-148.293
-126.291
-102.736
-77.6476
-51.0528
-23.0116
6.36873
36.9574
64.9699
96.5489
128.494
160.384
191.78
222.27
251.358
278.534
303.357
325.362
344.149
359.368
370.724
378.014
381.134
379.997
374.578
365.03
351.577
334.466
314.054
290.747
264.962
237.136
207.75
177.258
146.102
114.681
83.3724
52.5042
22.3883
-6.63609
-34.6921
-61.6612
-87.4169
-111.894
-135.048
-156.866
-177.349
-196.496
-214.315
-230.809
-245.973
-259.797
-272.265
-283.348
-293.016
-301.229
-307.948
-313.134
-316.75
-318.756
-319.106
-317.65
-314.455
-309.525
-302.871
-294.471
-284.336
-272.489
-258.928
-243.687
-226.788
-208.294
-188.278
-166.803
-143.941
372.028
390.496
405.207
415.981
422.71
425.271
423.579
417.646
407.609
393.581
375.735
354.334
329.74
302.277
272.374
240.411
206.841
172.158
136.757
101.07
65.5098
30.4004
-3.92461
-37.0809
-68.9296
-99.2577
-127.942
-154.862
-179.947
-203.165
-224.497
-243.954
-261.567
-277.371
-291.416
-303.752
-314.429
-323.499
-331.006
-336.992
-341.488
-344.515
-346.085
-346.189
-344.83
-341.954
-337.539
-331.58
-324.004
-314.783
-303.876
-291.22
-276.778
-260.509
-242.357
-222.341
-200.461
-176.719
-151.175
-123.907
-95.0122
-64.65
-32.9946
-0.276275
33.634
67.7545
102.186
136.53
170.438
203.525
235.389
265.671
293.991
319.978
343.301
363.631
380.687
394.209
403.958
409.774
411.55
409.191
402.716
392.205
377.768
359.621
338.002
313.211
285.593
255.506
223.338
189.495
154.395
118.465
82.1267
45.7958
9.86423
-25.1846
-59.1836
-91.7265
-122.57
-151.515
-178.415
-203.175
-225.751
-246.138
-264.366
-280.484
-294.561
-306.674
-316.902
-325.321
-332.005
-337.02
-340.426
-342.276
-342.613
-341.474
-338.901
-334.916
-329.537
-322.769
-314.612
-305.063
-294.113
-281.75
-267.955
-252.708
-235.987
-217.768
-198.026
-176.74
-153.896
-129.495
-103.558
-76.1362
-47.3097
-17.2001
14.0536
46.3961
79.2404
112.428
145.654
178.558
210.748
241.809
271.31
298.812
323.88
346.096
365.073
380.465
391.98
399.387
402.517
401.266
395.643
385.73
371.646
353.618
331.941
306.975
279.132
248.862
216.643
182.964
148.313
113.163
77.9634
43.134
9.03782
-24.0059
-55.7215
-85.8921
-114.354
-140.993
-165.737
-188.554
-209.437
-228.403
-245.488
-260.743
-274.229
-286.014
-296.164
-304.739
-311.795
-317.383
-321.555
-324.358
-325.838
-326.029
-324.959
-322.654
-319.123
-314.358
-308.344
-301.058
-292.461
-282.508
-271.145
-258.32
-243.989
-228.111
-210.658
-191.612
-170.964
-148.722
-124.911
-99.5802
-72.8023
-44.68
-15.3445
15.0416
46.2854
78.1843
110.409
142.657
174.59
205.835
235.991
264.641
291.358
315.714
337.294
355.708
370.602
381.674
388.684
391.462
389.912
384.06
373.989
359.844
341.865
320.357
295.685
268.257
238.52
206.946
174.022
140.237
106.065
71.9551
38.3153
5.50024
-26.187
-56.5029
-85.2607
-112.325
-137.603
-161.044
-182.623
-202.353
-220.261
-236.389
-250.792
-263.527
-274.658
-284.241
-292.336
-298.998
-304.28
-308.235
-310.909
-312.34
-312.551
-311.573
-309.396
-306.045
-301.528
-295.837
-288.965
-280.887
-271.591
-261.04
-249.204
-236.043
-221.51
-205.564
-188.15
-169.234
-148.798
-126.81
-103.265
-78.1817
-51.5863
-23.5423
5.83385
36.3888
64.7785
96.3527
128.358
160.348
191.866
222.493
251.726
279.05
304.016
326.153
345.057
360.373
371.803
379.138
382.274
381.128
375.672
366.056
352.514
335.297
314.761
291.32
265.395
237.43
207.911
177.294
146.023
114.502
83.1108
52.1767
22.0231
-7.03531
-35.1173
-62.1021
-87.8646
-112.341
-135.49
-157.301
-177.776
-196.914
-214.726
-231.215
-246.376
-260.2
-272.669
-283.757
-293.431
-301.651
-308.378
-313.571
-317.196
-319.212
-319.58
-318.124
-314.929
-310.001
-303.35
-294.952
-284.819
-272.972
-259.411
-244.169
-227.265
-208.765
-188.74
-167.253
-144.374
372.966
391.55
406.359
417.208
423.985
426.572
424.885
418.93
408.831
394.719
376.765
355.24
330.508
302.895
272.837
240.718
206.994
172.167
136.631
100.823
65.1562
29.955
-4.44724
-37.6671
-69.5586
-99.9161
-128.617
-155.545
-180.628
-203.837
-225.154
-244.593
-262.184
-277.965
-291.987
-304.3
-314.956
-324.008
-331.499
-337.472
-341.959
-344.979
-346.547
-346.655
-345.303
-342.434
-338.03
-332.087
-324.527
-315.324
-304.436
-291.801
-277.377
-261.128
-242.99
-222.985
-201.112
-177.369
-151.816
-124.532
-95.6088
-65.2061
-33.4997
-0.732141
33.2837
67.4776
102.009
136.464
170.492
203.705
235.699
266.113
294.566
320.682
344.127
364.57
381.727
395.338
405.158
411.021
412.821
410.463
403.959
393.393
378.879
360.634
338.898
313.98
286.223
255.989
223.671
189.679
154.433
118.364
81.8935
45.4429
9.4107
-25.7469
-59.8166
-92.4197
-123.307
-152.278
-179.189
-203.947
-226.51
-246.875
-265.075
-281.162
-295.208
-307.29
-317.487
-325.879
-332.538
-337.531
-340.918
-342.751
-343.074
-341.927
-339.345
-335.357
-329.976
-323.209
-315.056
-305.514
-294.572
-282.219
-268.436
-253.202
-236.495
-218.291
-198.565
-177.293
-154.459
-130.063
-104.123
-76.6877
-47.8354
-17.6839
13.6285
46.0032
78.9405
112.23
145.569
178.599
210.926
242.133
271.785
299.441
324.661
347.02
366.126
381.631
393.235
400.704
403.866
402.621
396.971
386.996
372.822
354.677
332.863
307.743
279.735
249.295
216.907
183.065
148.26
112.969
77.645
42.7097
8.52417
-24.59
-56.3579
-86.5634
-115.045
-141.69
-166.431
-189.236
-210.101
-229.045
-246.105
-261.333
-274.791
-286.55
-296.675
-305.227
-312.263
-317.833
-321.988
-324.775
-326.242
-326.424
-325.349
-323.042
-319.513
-314.753
-308.749
-301.477
-292.896
-282.962
-271.619
-258.814
-244.501
-228.639
-211.2
-192.165
-171.523
-149.283
-125.469
-100.127
-73.3302
-45.1795
-15.8056
14.6303
45.9372
77.907
110.226
142.58
174.632
206.006
236.303
265.101
291.968
316.474
338.199
356.744
371.752
382.914
389.986
392.794
391.247
385.361
375.223
360.984
342.886
321.24
296.416
268.825
238.921
207.18
174.094
140.156
105.847
71.6155
37.8738
4.97727
-26.7717
-57.1309
-85.916
-112.995
-138.276
-161.709
-183.275
-202.985
-220.87
-236.973
-251.349
-264.059
-275.165
-284.726
-292.798
-299.44
-304.705
-308.643
-311.302
-312.722
-312.924
-311.94
-309.76
-306.409
-301.896
-296.21
-289.347
-281.281
-271.999
-261.464
-249.647
-236.508
-221.997
-206.076
-188.686
-169.793
-149.375
-127.403
-103.871
-78.7927
-52.1965
-24.1477
5.22821
35.7589
64.5348
96.1187
128.198
160.304
191.961
222.745
252.145
279.639
304.769
327.057
346.097
361.525
373.038
380.426
383.579
382.423
376.924
367.232
353.587
336.247
315.569
291.974
265.891
237.766
208.093
177.333
145.932
114.296
82.8092
51.7994
21.6053
-7.49259
-35.6045
-62.6071
-88.3771
-112.853
-135.997
-157.799
-178.263
-197.392
-215.195
-231.679
-246.837
-260.66
-273.132
-284.224
-293.905
-302.133
-308.869
-314.072
-317.705
-319.733
-320.121
-318.664
-315.47
-310.546
-303.897
-295.502
-285.371
-273.525
-259.964
-244.719
-227.811
-209.303
-189.268
-167.768
-144.87
374.022
392.737
407.657
418.59
425.424
428.039
426.356
420.373
410.208
396
377.926
356.26
331.371
303.59
273.357
241.061
207.166
172.175
136.487
100.542
64.7559
29.4515
-5.03801
-38.3287
-70.2681
-100.659
-129.379
-156.315
-181.396
-204.594
-225.894
-245.312
-262.878
-278.634
-292.629
-304.917
-315.55
-324.58
-332.054
-338.012
-342.488
-345.502
-347.067
-347.179
-345.834
-342.974
-338.582
-332.656
-325.116
-315.933
-305.066
-292.455
-278.052
-261.824
-243.703
-223.711
-201.845
-178.102
-152.539
-125.236
-96.2816
-65.8331
-34.0678
-1.21947
32.86
67.1624
101.808
136.389
170.552
203.906
236.047
266.609
295.212
321.473
345.056
365.628
382.899
396.609
406.51
412.427
414.254
411.894
405.359
394.731
380.131
361.775
339.908
314.846
286.932
256.531
224.045
189.883
154.474
118.247
81.6288
45.0434
8.89469
-26.38
-60.5321
-93.2028
-124.138
-153.139
-180.062
-204.817
-227.365
-247.706
-265.874
-281.927
-295.936
-307.982
-318.145
-326.506
-333.137
-338.107
-341.472
-343.286
-343.594
-342.435
-339.846
-335.853
-330.471
-323.705
-315.557
-306.021
-295.088
-282.746
-268.976
-253.758
-237.068
-218.88
-199.172
-177.916
-155.094
-130.703
-104.761
-77.3105
-48.4297
-18.2328
13.1409
45.5649
78.6024
112.005
145.472
178.643
211.124
242.496
272.319
300.149
325.54
348.06
367.314
382.944
394.649
402.189
405.389
404.15
398.468
388.422
374.147
355.872
333.902
308.608
280.413
249.782
217.203
183.176
148.198
112.748
77.2832
42.2291
7.94312
-25.2507
-57.0769
-87.3214
-115.825
-142.477
-167.214
-190.005
-210.85
-229.769
-246.799
-261.997
-275.424
-287.153
-297.251
-305.777
-312.791
-318.341
-322.476
-325.245
-326.696
-326.868
-325.788
-323.479
-319.952
-315.199
-309.204
-301.947
-293.386
-283.473
-272.152
-259.369
-245.077
-229.235
-211.811
-192.788
-172.154
-149.917
-126.098
-100.744
-73.926
-45.7436
-16.3265
14.165
45.542
77.5929
110.018
142.491
174.676
206.198
236.652
265.617
292.655
317.33
339.217
357.911
373.048
384.313
391.455
394.298
392.751
386.828
376.614
362.268
344.037
322.235
297.238
269.464
239.372
207.442
174.173
140.064
105.598
71.2307
37.3739
4.38595
-27.4323
-57.8397
-86.6554
-113.75
-139.033
-162.459
-184.009
-203.697
-221.555
-237.63
-251.977
-264.658
-275.736
-285.27
-293.318
-299.938
-305.182
-309.101
-311.744
-313.151
-313.344
-312.355
-310.169
-306.818
-302.309
-296.629
-289.777
-281.725
-272.457
-261.941
-250.145
-237.03
-222.546
-206.651
-189.288
-170.421
-150.025
-128.072
-104.552
-79.481
-52.8835
-24.8275
4.55316
35.0698
64.2343
95.8442
128.012
160.251
192.066
223.028
252.618
280.297
305.615
328.076
347.267
362.822
374.43
381.877
385.052
383.882
378.333
368.558
354.795
337.317
316.479
292.71
266.447
238.143
208.296
177.375
145.826
114.061
82.4665
51.3707
21.1348
-8.00839
-36.1542
-63.1767
-88.9547
-113.43
-136.567
-158.358
-178.811
-197.929
-215.723
-232.2
-247.355
-261.178
-273.652
-284.75
-294.438
-302.676
-309.421
-314.635
-318.279
-320.319
-320.728
-319.271
-316.078
-311.158
-304.514
-296.121
-285.992
-274.146
-260.586
-245.34
-228.426
-209.909
-189.863
-168.347
-145.428
375.197
394.057
409.101
420.129
427.026
429.674
427.993
421.978
411.739
397.426
379.216
357.395
332.331
304.362
273.935
241.441
207.354
172.18
136.324
100.227
64.3078
28.8891
-5.69807
-39.0665
-71.0589
-101.486
-130.228
-157.172
-182.25
-205.436
-226.718
-246.111
-263.65
-279.376
-293.343
-305.603
-316.208
-325.215
-332.669
-338.612
-343.075
-346.083
-347.645
-347.76
-346.426
-343.573
-339.196
-333.288
-325.769
-316.609
-305.766
-293.182
-278.802
-262.599
-244.496
-224.518
-202.661
-178.917
-153.344
-126.02
-97.0311
-66.5319
-34.6999
-1.74509
32.3685
66.8083
101.583
136.304
170.617
204.127
236.432
267.16
295.929
322.351
346.089
366.805
384.204
398.022
408.014
413.993
415.847
413.488
406.917
396.22
381.525
363.045
341.032
315.809
287.718
257.133
224.459
190.109
154.517
118.114
81.3321
44.5961
8.31543
-27.0851
-61.331
-94.0769
-125.066
-154.1
-181.035
-205.787
-228.317
-248.63
-266.764
-282.777
-296.746
-308.752
-318.878
-327.204
-333.804
-338.746
-342.088
-343.881
-344.172
-342.999
-340.402
-336.404
-331.02
-324.257
-316.113
-306.585
-295.662
-283.332
-269.578
-254.376
-237.704
-219.536
-199.848
-178.609
-155.801
-131.417
-105.471
-78.0053
-49.0935
-18.8482
12.5924
45.078
78.2253
111.752
145.361
178.689
211.342
242.897
272.911
300.935
326.516
349.218
368.635
384.407
396.224
403.843
407.086
405.852
400.135
390.011
375.622
357.201
335.057
309.569
281.167
250.321
217.53
183.297
148.126
112.499
76.8769
41.6912
7.29344
-25.9888
-57.8794
-88.167
-116.695
-143.354
-168.085
-190.861
-211.684
-230.574
-247.573
-262.736
-276.128
-287.823
-297.89
-306.389
-313.378
-318.904
-323.019
-325.768
-327.201
-327.362
-326.275
-323.964
-320.44
-315.693
-309.711
-302.47
-293.93
-284.041
-272.746
-259.988
-245.719
-229.897
-212.49
-193.481
-172.857
-150.623
-126.799
-101.432
-74.5904
-46.3731
-16.9082
13.6451
45.0988
77.2413
109.784
142.389
174.722
206.407
237.038
266.188
293.416
318.281
340.349
359.21
374.491
385.87
393.091
395.974
394.428
388.461
378.163
363.699
345.318
323.342
298.152
270.174
239.871
207.731
174.259
139.958
105.318
70.7993
36.8148
3.725
-28.1697
-58.63
-87.4794
-114.591
-139.877
-163.294
-184.826
-204.488
-222.318
-238.36
-252.675
-265.324
-276.371
-285.876
-293.896
-300.49
-305.712
-309.611
-312.235
-313.628
-313.811
-312.815
-310.623
-307.273
-302.767
-297.095
-290.255
-282.217
-272.966
-262.471
-250.698
-237.61
-223.155
-207.291
-189.959
-171.121
-150.749
-128.815
-105.311
-80.2467
-53.6474
-25.5816
3.80985
34.3225
63.8734
95.5264
127.798
160.187
192.178
223.339
253.141
281.031
306.556
329.21
348.57
364.267
375.981
383.494
386.692
385.506
379.9
370.035
356.141
338.509
317.49
293.528
267.064
238.559
208.519
177.418
145.705
113.797
82.0815
50.8888
20.6122
-8.58331
-36.7669
-63.8113
-89.5979
-114.071
-137.201
-158.981
-179.421
-198.526
-216.309
-232.779
-247.93
-261.752
-274.23
-285.334
-295.031
-303.279
-310.035
-315.26
-318.916
-320.969
-321.4
-319.943
-316.754
-311.839
-305.199
-296.809
-286.682
-274.837
-261.277
-246.029
-229.11
-210.584
-190.525
-168.992
-146.049
376.49
395.512
410.692
421.825
428.793
431.477
429.798
423.745
413.426
398.997
380.639
358.644
333.388
305.211
274.569
241.858
207.558
172.184
136.14
99.8763
63.811
28.267
-6.42874
-39.8811
-71.9318
-102.398
-131.164
-158.117
-183.191
-206.364
-227.625
-246.991
-264.499
-280.194
-294.128
-306.356
-316.933
-325.914
-333.346
-339.271
-343.721
-346.721
-348.281
-348.399
-347.075
-344.231
-339.871
-333.982
-326.489
-317.353
-306.537
-293.982
-279.629
-263.451
-245.368
-225.407
-203.56
-179.816
-154.232
-126.885
-97.8579
-67.3036
-35.3976
-2.33397
31.8326
66.4156
101.333
136.207
170.686
204.369
236.855
267.764
296.717
323.318
347.226
368.1
385.64
399.579
409.67
415.718
417.603
415.244
408.635
397.862
383.061
364.442
342.27
316.868
288.582
257.794
224.912
190.355
154.561
117.965
81.0019
44.0995
7.6727
-27.8638
-62.2144
-95.0431
-126.091
-155.16
-182.11
-206.857
-229.367
-249.649
-267.743
-283.713
-297.638
-309.6
-319.683
-327.972
-334.538
-339.45
-342.765
-344.536
-344.807
-343.62
-341.013
-337.011
-331.625
-324.863
-316.725
-307.205
-296.294
-283.978
-270.24
-255.056
-238.404
-220.258
-200.592
-179.373
-156.581
-132.205
-106.256
-78.7733
-49.8277
-19.5302
11.9819
44.541
77.8079
111.471
145.235
178.736
211.578
243.335
273.561
301.799
327.591
350.492
370.091
386.019
397.961
405.668
408.958
407.73
401.973
391.764
377.25
358.667
336.331
310.627
281.995
250.914
217.886
183.427
148.043
112.221
76.4248
41.0953
6.57366
-26.8054
-58.7668
-89.1014
-117.655
-144.322
-169.047
-191.805
-212.603
-231.461
-248.425
-263.549
-276.903
-288.561
-298.594
-307.062
-314.023
-319.525
-323.616
-326.343
-327.757
-327.905
-326.812
-324.498
-320.976
-316.238
-310.268
-303.046
-294.529
-284.667
-273.4
-260.669
-246.426
-230.627
-213.24
-194.246
-173.631
-151.401
-127.573
-102.191
-75.3239
-47.0685
-17.5516
13.0697
44.6078
76.8501
109.522
142.274
174.77
206.635
237.46
266.815
294.253
319.327
341.596
360.642
376.082
387.588
394.897
397.824
396.277
390.263
379.872
365.276
346.73
324.561
299.159
270.955
240.419
208.047
174.35
139.838
105.006
70.3204
36.1951
2.99332
-28.985
-59.503
-88.3889
-115.518
-140.807
-164.214
-185.725
-205.36
-223.157
-239.164
-253.443
-266.056
-277.069
-286.542
-294.531
-301.098
-306.295
-310.171
-312.776
-314.153
-314.326
-313.319
-311.122
-307.771
-303.271
-297.608
-290.78
-282.758
-273.526
-263.053
-251.306
-238.248
-223.826
-207.994
-190.697
-171.891
-151.546
-129.634
-106.147
-81.0903
-54.4885
-26.4101
2.99868
33.5178
63.4491
95.1626
127.555
160.11
192.297
223.68
253.714
281.84
307.592
330.458
350.006
365.86
377.691
385.278
388.501
387.298
381.629
371.663
357.625
339.821
318.603
294.427
267.741
239.015
208.762
177.463
145.569
113.503
81.653
50.3526
20.0367
-9.21815
-37.4434
-64.5115
-90.3071
-114.778
-137.899
-159.666
-180.091
-199.183
-216.954
-233.415
-248.562
-262.384
-274.865
-285.976
-295.682
-303.942
-310.71
-315.948
-319.616
-321.684
-322.138
-320.681
-317.497
-312.588
-305.953
-297.566
-287.442
-275.598
-262.039
-246.789
-229.863
-211.326
-191.253
-169.703
-146.734
377.902
397.1
412.431
423.679
430.726
433.449
431.772
425.676
415.269
400.714
382.192
360.009
334.541
306.136
275.259
242.309
207.777
172.183
135.936
99.4887
63.2643
27.5845
-7.23143
-40.7734
-72.8875
-103.397
-132.187
-159.151
-184.22
-207.377
-228.615
-247.952
-265.427
-281.085
-294.984
-307.178
-317.723
-326.675
-334.083
-339.989
-344.425
-347.417
-348.974
-349.095
-347.782
-344.948
-340.607
-334.738
-327.273
-318.164
-307.378
-294.855
-280.531
-264.38
-246.322
-226.378
-204.542
-180.799
-155.204
-127.831
-98.7626
-68.1492
-36.1625
-2.98955
31.254
65.984
101.057
136.099
170.758
204.63
237.315
268.423
297.576
324.372
348.466
369.515
387.21
401.281
411.48
417.605
419.522
417.163
410.513
399.658
384.74
365.97
343.623
318.025
289.525
258.514
225.403
190.621
154.606
117.798
80.637
43.5529
6.96543
-28.7176
-63.1836
-96.1028
-127.215
-156.322
-183.287
-208.028
-230.516
-250.763
-268.814
-284.736
-298.611
-310.525
-320.563
-328.809
-335.338
-340.217
-343.504
-345.25
-345.501
-344.299
-341.681
-337.672
-332.285
-325.526
-317.394
-307.883
-296.984
-284.683
-270.962
-255.799
-239.169
-221.047
-201.405
-180.209
-157.434
-133.067
-107.116
-79.6151
-50.6336
-20.2796
11.3077
43.9532
77.3493
111.16
145.093
178.784
211.833
243.812
274.268
302.741
328.765
351.885
371.683
387.783
399.862
407.665
411.007
409.785
403.985
393.682
379.03
360.27
337.723
311.783
282.899
251.558
218.272
183.565
147.947
111.912
75.9253
40.4398
5.78254
-27.7019
-59.7406
-90.1255
-118.707
-145.382
-170.099
-192.837
-213.608
-232.432
-249.355
-264.438
-277.749
-289.366
-299.362
-307.797
-314.728
-320.203
-324.267
-326.971
-328.364
-328.498
-327.397
-325.08
-321.562
-316.832
-310.875
-303.673
-295.182
-285.35
-274.114
-261.414
-247.199
-231.425
-214.059
-195.082
-174.479
-152.252
-128.419
-103.022
-76.1275
-47.8307
-18.2571
12.4376
44.0677
76.4182
109.233
142.143
174.818
206.879
237.917
267.496
295.165
320.468
342.958
362.206
377.822
389.468
396.873
399.848
398.3
392.234
381.742
367.002
348.274
325.894
300.259
271.807
241.016
208.39
174.445
139.702
104.66
69.7924
35.5136
2.18957
-29.8791
-60.4597
-89.3846
-116.533
-141.824
-165.22
-186.709
-206.313
-224.074
-240.042
-254.281
-266.855
-277.83
-287.268
-295.225
-301.761
-306.929
-310.782
-313.366
-314.726
-314.887
-313.868
-311.666
-308.315
-303.82
-298.167
-291.352
-283.347
-274.136
-263.689
-251.969
-238.943
-224.557
-208.76
-191.503
-172.731
-152.416
-130.529
-107.06
-82.0122
-55.4073
-27.313
2.11954
32.6578
62.9575
94.7496
127.279
160.02
192.422
224.047
254.337
282.72
308.722
331.822
351.576
367.601
379.562
387.229
390.481
389.259
383.522
373.443
359.248
341.254
319.818
295.407
268.478
239.51
209.023
177.506
145.416
113.177
81.1795
49.7632
19.4054
-9.91375
-38.1843
-65.278
-91.0827
-115.551
-138.661
-160.413
-180.822
-199.898
-217.657
-234.109
-249.251
-263.073
-275.558
-286.676
-296.393
-304.665
-311.447
-316.698
-320.38
-322.463
-322.94
-321.485
-318.307
-313.405
-306.775
-298.393
-288.272
-276.428
-262.87
-247.618
-230.685
-212.137
-192.049
-170.48
-147.482
379.433
398.824
414.319
425.693
432.825
435.593
433.915
427.772
417.27
402.577
383.879
361.489
335.791
307.138
276.005
242.796
208.011
172.178
135.709
99.0632
62.6664
26.8402
-8.10675
-41.7443
-73.927
-104.483
-133.299
-160.273
-185.337
-208.477
-229.69
-248.994
-266.432
-282.052
-295.911
-308.068
-318.578
-327.5
-334.881
-340.766
-345.188
-348.17
-349.724
-349.848
-348.544
-345.724
-341.404
-335.558
-328.122
-319.043
-308.29
-295.801
-281.511
-265.388
-247.356
-227.431
-205.608
-181.866
-156.26
-128.86
-99.7463
-69.0699
-36.9958
-3.71078
30.6299
65.5134
100.754
135.979
170.833
204.911
237.811
269.136
298.505
325.513
349.81
371.049
388.914
403.129
413.443
419.652
421.607
419.248
412.553
401.608
386.561
367.627
345.092
319.277
290.545
259.293
225.934
190.906
154.65
117.613
80.2364
42.9552
6.19205
-29.6482
-64.2401
-97.2575
-128.439
-157.587
-184.567
-209.301
-231.764
-251.972
-269.976
-285.846
-299.667
-311.527
-321.516
-329.717
-336.205
-341.049
-344.305
-346.025
-346.253
-345.033
-342.404
-338.389
-333
-326.244
-318.118
-308.617
-297.731
-285.447
-271.745
-256.604
-239.999
-221.903
-202.287
-181.116
-158.362
-134.004
-108.051
-80.5318
-51.5122
-21.0978
10.5702
43.3116
76.8483
110.818
144.935
178.832
212.105
244.324
275.032
303.761
330.037
353.396
373.411
389.698
401.927
409.835
413.234
412.018
406.171
395.766
380.964
362.011
339.234
313.036
283.877
252.254
218.688
183.71
147.839
111.571
75.3768
39.7235
4.91874
-28.6802
-60.8018
-91.2408
-119.851
-146.534
-171.242
-193.958
-214.698
-233.485
-250.365
-265.403
-278.666
-290.239
-300.195
-308.594
-315.493
-320.938
-324.974
-327.652
-329.021
-329.139
-328.031
-325.71
-322.196
-317.475
-311.532
-304.353
-295.891
-286.091
-274.889
-262.221
-248.038
-232.291
-214.948
-195.99
-175.399
-153.177
-129.339
-103.926
-77.0019
-48.6605
-19.0258
11.7479
43.4771
75.9446
108.915
141.997
174.864
207.14
238.409
268.232
296.152
321.705
344.436
363.905
379.713
391.511
399.022
402.05
400.5
394.377
383.774
368.876
349.95
327.341
301.451
272.729
241.662
208.758
174.545
139.55
104.28
69.2141
34.7687
1.31248
-30.8536
-61.5013
-90.4674
-117.636
-142.929
-166.312
-187.776
-207.345
-225.067
-240.993
-255.189
-267.721
-278.655
-288.055
-295.976
-302.479
-307.617
-311.443
-314.004
-315.346
-315.495
-314.463
-312.256
-308.903
-304.414
-298.772
-291.971
-283.985
-274.797
-264.377
-252.687
-239.697
-225.348
-209.591
-192.378
-173.643
-153.361
-131.501
-108.051
-83.0128
-56.404
-28.291
1.17232
31.7467
62.3919
94.2843
126.97
159.913
192.552
224.442
255.008
283.673
309.947
333.302
353.28
369.492
381.594
389.349
392.633
391.391
385.581
375.376
361.012
342.81
321.136
296.468
269.275
240.042
209.302
177.548
145.244
112.819
80.6597
49.1205
18.7158
-10.6708
-38.9904
-66.1116
-91.9254
-116.39
-139.487
-161.223
-181.614
-200.674
-218.418
-234.86
-249.997
-263.818
-276.308
-287.434
-297.163
-305.449
-312.245
-317.511
-321.208
-323.306
-323.807
-322.353
-319.185
-314.291
-307.666
-299.289
-289.171
-277.329
-263.772
-248.517
-231.576
-213.017
-192.913
-171.322
-148.295
381.085
400.683
416.356
427.867
435.091
437.907
436.228
430.034
419.43
404.588
385.698
363.084
337.137
308.217
276.806
243.316
208.257
172.166
135.459
98.5986
62.0158
26.0309
-9.05377
-42.7948
-75.0513
-105.657
-134.501
-161.484
-186.542
-209.664
-230.848
-250.117
-267.515
-283.093
-296.91
-309.027
-319.499
-328.387
-335.74
-341.602
-346.008
-348.98
-350.531
-350.658
-349.361
-346.557
-342.261
-336.44
-329.035
-319.989
-309.273
-296.819
-282.566
-266.474
-248.471
-228.568
-206.758
-183.018
-157.401
-129.971
-100.81
-70.0663
-37.8988
-4.49729
29.9577
65.003
100.424
135.845
170.909
205.211
238.342
269.902
299.505
326.742
351.257
372.701
390.751
405.123
415.562
421.861
423.861
421.5
414.756
403.713
388.526
369.417
346.676
320.627
291.645
260.13
226.503
191.209
154.693
117.408
79.7991
42.3049
5.35159
-30.657
-65.3853
-98.5087
-129.764
-158.956
-185.952
-210.677
-233.113
-253.278
-271.23
-287.043
-300.805
-312.608
-322.543
-330.695
-337.139
-341.945
-345.168
-346.859
-347.063
-345.825
-343.182
-339.161
-333.771
-327.017
-318.899
-309.409
-298.537
-286.27
-272.589
-257.472
-240.893
-222.825
-203.239
-182.095
-159.363
-135.018
-109.063
-81.5244
-52.4644
-21.9866
9.76881
42.6142
76.3035
110.444
144.758
178.877
212.394
244.873
275.853
304.859
331.407
355.026
375.277
391.767
404.158
412.181
415.643
414.433
408.534
398.02
383.055
363.892
340.865
314.388
284.931
253.001
219.131
183.861
147.715
111.197
74.7773
38.945
3.98027
-29.7418
-61.9519
-92.4486
-121.089
-147.78
-172.477
-195.169
-215.876
-234.622
-251.455
-266.443
-279.655
-291.179
-301.092
-309.452
-316.316
-321.73
-325.736
-328.385
-329.73
-329.829
-328.713
-326.389
-322.879
-318.168
-312.24
-305.084
-296.653
-286.89
-275.725
-263.093
-248.943
-233.227
-215.908
-196.97
-176.393
-154.177
-130.334
-104.903
-77.9479
-49.5591
-19.8589
10.9996
42.8344
75.4285
108.566
141.834
174.909
207.415
238.934
269.021
297.213
323.038
346.03
365.739
381.755
393.719
401.345
404.431
402.879
396.693
385.97
370.902
351.761
328.902
302.736
273.723
242.355
209.152
174.648
139.38
103.862
68.5841
33.9586
0.360686
-31.9101
-62.6287
-91.6382
-118.828
-144.123
-167.491
-188.928
-208.46
-226.139
-242.018
-256.168
-268.653
-279.543
-288.902
-296.784
-303.252
-308.357
-312.154
-314.691
-316.014
-316.15
-315.103
-312.89
-309.536
-305.053
-299.422
-292.638
-284.672
-275.509
-265.117
-253.46
-240.508
-226.2
-210.487
-193.32
-174.627
-154.38
-132.55
-109.121
-84.0925
-57.4791
-29.3453
0.156943
30.7922
61.7419
93.7636
126.624
159.788
192.685
224.861
255.729
284.698
311.267
334.898
355.12
371.534
383.789
391.64
394.96
393.695
387.806
377.463
362.918
344.488
322.555
297.609
270.13
240.612
209.596
177.588
145.053
112.426
80.0921
48.4229
17.9674
-11.49
-39.8627
-67.0131
-92.8357
-117.295
-140.379
-162.096
-182.467
-201.508
-219.236
-235.668
-250.799
-264.62
-277.115
-288.25
-297.992
-306.293
-313.105
-318.387
-322.099
-324.212
-324.734
-323.286
-320.13
-315.245
-308.625
-300.255
-290.14
-278.299
-264.744
-249.486
-232.537
-213.966
-193.844
-172.232
-149.172
382.856
402.679
418.543
430.202
437.527
440.395
438.715
432.464
421.749
406.747
387.652
364.796
338.58
309.371
277.662
243.87
208.517
172.147
135.184
98.094
61.3111
25.1554
-10.0744
-43.9261
-76.2615
-106.919
-135.793
-162.786
-187.837
-210.937
-232.091
-251.321
-268.676
-284.209
-297.98
-310.053
-320.485
-329.336
-336.659
-342.496
-346.885
-349.847
-351.394
-351.525
-350.237
-347.45
-343.178
-337.384
-330.014
-321.003
-310.327
-297.911
-283.699
-267.638
-249.668
-229.787
-207.993
-184.256
-158.627
-131.166
-101.955
-71.1393
-38.8725
-5.34914
29.2356
64.4517
100.065
135.696
170.987
205.529
238.908
270.721
300.575
328.06
352.809
374.473
392.722
407.265
417.838
424.233
426.283
423.921
417.123
405.975
390.637
371.339
348.374
322.073
292.824
261.024
227.109
191.528
154.735
117.183
79.3237
41.6002
4.44286
-31.7462
-66.6212
-99.8583
-131.193
-160.431
-187.443
-212.158
-234.562
-254.681
-272.576
-288.327
-302.026
-313.767
-323.643
-331.743
-338.14
-342.906
-346.093
-347.753
-347.931
-346.672
-344.016
-339.988
-334.597
-327.846
-319.735
-310.257
-299.4
-287.152
-273.494
-258.402
-241.853
-223.815
-204.261
-183.147
-160.439
-136.108
-110.152
-82.594
-53.4916
-22.9465
8.90147
41.8598
75.7131
110.036
144.562
178.919
212.697
245.457
276.73
306.035
332.877
356.776
377.281
393.99
406.557
414.705
418.233
417.03
411.076
400.444
385.304
365.914
342.617
315.838
286.059
253.799
219.601
184.016
147.575
110.788
74.1248
38.103
2.96507
-30.8882
-63.1928
-93.7502
-122.423
-149.121
-173.805
-196.47
-217.14
-235.842
-252.625
-267.558
-280.716
-292.188
-302.053
-310.372
-317.2
-322.579
-326.553
-329.172
-330.489
-330.568
-329.444
-327.117
-323.61
-318.91
-312.998
-305.868
-297.47
-287.746
-276.622
-264.029
-249.916
-234.231
-216.939
-198.024
-177.461
-155.251
-131.403
-105.954
-78.9667
-50.5274
-20.7576
10.1915
42.1397
74.8674
108.185
141.652
174.951
207.705
239.492
269.864
298.349
324.467
347.74
367.709
383.951
396.095
403.844
406.993
405.439
399.185
388.333
373.08
353.707
330.578
304.115
274.787
243.096
209.569
174.752
139.192
103.407
67.9005
33.0812
-0.667642
-33.0499
-63.8432
-92.8983
-120.111
-145.406
-168.758
-190.164
-209.655
-227.288
-243.118
-257.216
-269.652
-280.495
-289.809
-297.651
-304.08
-309.15
-312.915
-315.426
-316.729
-316.851
-315.787
-313.568
-310.214
-305.736
-300.119
-293.352
-285.408
-276.27
-265.909
-254.287
-241.377
-227.112
-211.448
-194.33
-175.683
-155.474
-133.675
-110.268
-85.2518
-58.6344
-30.4767
-0.927454
29.7898
61.0091
93.1852
126.24
159.644
192.82
225.304
256.497
285.796
312.683
336.611
357.097
373.729
386.149
394.103
397.463
396.174
390.2
379.706
364.965
346.288
324.077
298.831
271.044
241.217
209.907
177.623
144.841
111.997
79.4747
47.6658
17.1616
-12.3717
-40.8022
-67.9831
-93.8141
-118.266
-141.335
-163.032
-183.381
-202.402
-220.113
-236.533
-251.658
-265.479
-277.979
-289.124
-298.88
-307.197
-314.027
-319.326
-323.054
-325.181
-325.719
-324.284
-321.142
-316.267
-309.654
-301.291
-291.18
-279.34
-265.787
-250.526
-233.569
-214.984
-194.844
-173.208
-150.115
384.749
404.811
420.881
432.699
440.133
443.058
441.375
435.063
424.23
409.056
389.74
366.624
340.121
310.602
278.572
244.457
208.788
172.12
134.884
97.548
60.551
24.2122
-11.1701
-45.1395
-77.5589
-108.272
-137.176
-164.179
-189.222
-212.299
-233.419
-252.607
-269.916
-285.399
-299.122
-311.147
-321.536
-330.348
-337.638
-343.45
-347.82
-350.771
-352.314
-352.449
-351.17
-348.403
-344.154
-338.392
-331.056
-322.084
-311.452
-299.075
-284.907
-268.881
-250.946
-231.091
-209.313
-185.581
-159.94
-132.446
-103.183
-72.2897
-39.9183
-6.26672
28.4618
63.8581
99.677
135.532
171.064
205.866
239.508
271.593
301.717
329.465
354.466
376.363
394.827
409.555
420.273
426.77
428.875
426.513
419.655
408.395
392.894
373.395
350.186
323.619
294.079
261.975
227.752
191.864
154.772
116.935
78.809
40.8398
3.46405
-32.9173
-67.9494
-101.308
-132.727
-162.014
-189.041
-213.744
-236.114
-256.182
-274.016
-289.698
-303.329
-315.004
-324.818
-332.861
-339.209
-343.93
-347.08
-348.707
-348.857
-347.576
-344.906
-340.871
-335.478
-328.731
-320.629
-311.163
-300.322
-288.094
-274.46
-259.395
-242.877
-224.872
-205.353
-184.273
-161.591
-137.275
-111.32
-83.7419
-54.5953
-23.9791
7.96685
41.0465
75.0752
109.593
144.346
178.957
213.015
246.075
277.662
307.288
334.447
358.646
379.425
396.37
409.126
417.408
421.009
419.813
413.799
403.04
387.712
368.078
344.49
317.387
287.262
254.648
220.098
184.175
147.418
110.343
73.4163
37.1965
1.87107
-32.1217
-64.5262
-95.1476
-123.852
-150.557
-175.227
-197.862
-218.493
-237.148
-253.876
-268.751
-281.849
-293.263
-303.079
-311.354
-318.143
-323.486
-327.426
-330.012
-331.298
-331.356
-330.223
-327.893
-324.39
-319.701
-313.807
-306.703
-298.342
-288.66
-277.58
-265.029
-250.955
-235.305
-218.042
-199.151
-178.604
-156.402
-132.549
-107.081
-80.0591
-51.5664
-21.7231
9.3219
41.3915
74.2598
107.771
141.45
174.987
208.006
240.082
270.759
299.559
325.991
349.567
369.817
386.301
398.639
406.523
409.738
408.181
401.855
390.863
375.411
355.788
332.37
305.589
275.922
243.884
210.011
174.858
138.982
102.912
67.1615
32.1351
-1.77483
-34.2743
-65.1461
-94.2487
-121.483
-146.779
-170.113
-191.485
-210.933
-228.515
-244.291
-258.335
-270.718
-281.51
-290.777
-298.575
-304.963
-309.996
-313.726
-316.209
-317.49
-317.6
-316.516
-314.291
-310.935
-306.464
-300.861
-294.113
-286.192
-277.081
-266.753
-255.17
-242.302
-228.084
-212.474
-195.41
-176.81
-156.641
-134.877
-111.495
-86.4921
-59.8704
-31.6862
-2.08287
28.7327
60.1971
92.5472
125.815
159.479
192.956
225.77
257.312
286.965
314.194
338.441
359.211
376.077
388.675
396.741
400.143
398.828
392.764
382.107
367.156
348.213
325.702
300.133
272.014
241.858
210.231
177.652
144.606
111.531
78.8055
46.8393
16.3055
-13.3166
-41.8102
-69.0228
-94.8614
-119.305
-142.356
-164.031
-184.356
-203.354
-221.047
-237.455
-252.574
-266.395
-278.9
-290.056
-299.827
-308.162
-315.01
-320.328
-324.072
-326.214
-326.761
-325.348
-322.222
-317.359
-310.751
-302.397
-292.29
-280.451
-266.901
-251.636
-234.67
-216.072
-195.912
-174.252
-151.123
386.762
407.082
423.371
435.36
442.911
445.896
444.21
437.833
426.873
411.516
391.963
368.57
341.758
311.908
279.535
245.075
209.07
172.083
134.555
96.9592
59.7343
23.1994
-12.3422
-46.4366
-78.9448
-109.715
-138.651
-165.664
-190.697
-213.748
-234.832
-253.975
-271.233
-286.665
-300.335
-312.31
-322.651
-331.423
-338.678
-344.461
-348.811
-351.751
-353.291
-353.429
-352.16
-349.415
-345.19
-339.463
-332.162
-323.233
-312.647
-300.313
-286.192
-270.204
-252.306
-232.479
-210.72
-186.991
-161.339
-133.814
-104.493
-73.5188
-41.0375
-7.24972
27.6332
63.221
99.2573
135.351
171.142
206.219
240.142
272.517
302.928
330.958
356.228
378.375
397.066
411.992
422.868
429.474
431.638
429.277
422.352
410.974
395.301
375.583
352.116
325.264
295.411
262.984
228.431
192.216
154.806
116.664
78.2531
40.0218
2.4134
-34.1727
-69.3723
-102.86
-134.368
-163.705
-190.748
-215.437
-237.769
-257.781
-275.548
-291.158
-304.715
-316.319
-326.066
-334.049
-340.344
-345.019
-348.128
-349.721
-349.842
-348.536
-345.851
-341.808
-336.415
-329.671
-321.578
-312.125
-301.302
-289.096
-275.486
-260.452
-243.966
-225.997
-206.515
-185.471
-162.82
-138.522
-112.568
-84.9697
-55.777
-25.0863
6.96433
40.1733
74.3874
109.112
144.107
178.989
213.346
246.726
278.65
308.618
336.116
360.637
381.709
398.909
411.866
420.292
423.972
422.784
416.706
405.812
390.281
370.385
346.487
319.036
288.54
255.546
220.62
184.336
147.242
109.86
72.6491
36.2243
0.695807
-33.4443
-65.954
-96.6427
-125.38
-152.09
-176.743
-199.346
-219.934
-238.538
-255.208
-270.019
-283.054
-294.407
-304.169
-312.398
-319.146
-324.452
-328.354
-330.905
-332.158
-332.192
-331.051
-328.717
-325.218
-320.542
-314.665
-307.589
-299.267
-289.633
-278.6
-266.095
-252.063
-236.449
-219.218
-200.352
-179.823
-157.628
-133.771
-108.284
-81.2263
-52.6776
-22.7566
8.3899
40.5878
73.6138
107.311
141.227
175.018
208.319
240.702
271.705
300.842
327.611
351.513
372.063
388.808
401.354
409.383
412.67
411.11
404.705
393.563
377.898
358.008
334.279
307.156
277.129
244.719
210.475
174.963
138.751
102.375
66.3653
31.1181
-2.96258
-35.5851
-66.5392
-95.6906
-122.948
-148.243
-171.558
-192.893
-212.292
-229.82
-245.538
-259.524
-271.851
-282.588
-291.805
-299.555
-305.901
-310.893
-314.588
-317.039
-318.298
-318.395
-317.29
-315.057
-311.699
-307.237
-301.648
-294.921
-287.025
-277.942
-267.65
-256.108
-243.284
-229.118
-213.566
-196.557
-178.009
-157.885
-136.156
-112.801
-87.8138
-61.1879
-32.9752
-3.31178
27.6166
59.3072
91.8478
125.348
159.292
193.091
226.258
258.173
288.205
315.802
340.39
361.463
378.581
391.369
399.555
403.002
401.657
395.498
384.668
369.491
350.263
327.43
301.515
273.042
242.533
210.568
177.674
144.347
111.026
78.0828
45.9363
15.4032
-14.3253
-42.8879
-70.1331
-95.9783
-120.411
-143.442
-165.092
-185.392
-204.366
-222.039
-238.433
-253.546
-267.366
-279.877
-291.045
-300.832
-309.187
-316.055
-321.393
-325.155
-327.311
-327.865
-326.478
-323.368
-318.519
-311.918
-303.573
-293.471
-281.633
-268.087
-252.817
-235.842
-217.23
-197.049
-175.364
-152.197
388.897
409.49
426.015
438.186
445.861
448.911
447.223
440.775
429.681
414.128
394.323
370.633
343.493
313.289
280.551
245.724
209.361
172.034
134.197
96.3258
58.8596
22.1151
-13.5914
-47.8192
-80.4206
-111.251
-140.22
-167.242
-192.263
-215.287
-236.331
-255.425
-272.63
-288.005
-301.619
-313.54
-323.832
-332.559
-339.777
-345.531
-349.86
-352.787
-354.324
-354.466
-353.207
-350.484
-346.286
-340.596
-333.333
-324.449
-313.912
-301.625
-287.554
-271.608
-253.748
-233.952
-212.212
-188.489
-162.826
-135.269
-105.888
-74.8278
-42.2316
-8.29897
26.7478
62.5387
98.8051
135.153
171.218
206.587
240.81
273.492
304.209
332.538
358.095
380.508
399.44
414.578
425.624
432.347
434.573
432.211
425.219
413.713
397.857
377.904
354.165
327.004
296.82
264.049
229.144
192.581
154.833
116.369
77.6547
39.1449
1.28933
-35.5145
-70.8919
-104.517
-136.119
-165.508
-192.566
-217.239
-239.528
-259.48
-277.175
-292.707
-306.185
-317.712
-327.388
-335.307
-341.546
-346.172
-349.239
-350.795
-350.884
-349.554
-346.851
-342.801
-337.407
-330.668
-322.584
-313.145
-302.34
-290.157
-276.574
-261.571
-245.121
-227.19
-207.748
-186.745
-164.126
-139.849
-113.897
-86.2785
-57.0382
-26.2692
5.89195
39.2462
73.6392
108.593
143.843
179.014
213.689
247.41
279.691
310.025
337.885
362.75
384.136
401.606
414.781
423.362
427.124
425.945
419.799
408.761
393.014
372.838
348.607
320.784
289.892
256.493
221.166
184.497
147.045
109.338
71.85
35.155
-0.563628
-34.8586
-67.4784
-98.237
-127.008
-153.722
-178.356
-200.923
-221.464
-240.014
-256.622
-271.365
-284.331
-295.618
-305.323
-313.503
-320.209
-325.475
-329.338
-331.852
-333.069
-333.075
-331.927
-329.59
-326.095
-321.432
-315.573
-308.526
-300.247
-290.663
-279.682
-267.226
-253.239
-237.664
-220.467
-201.628
-181.118
-158.932
-135.07
-109.564
-82.4695
-53.8622
-23.8595
7.39411
39.7277
72.9241
106.808
140.981
175.041
208.642
241.352
272.702
302.198
329.327
353.577
374.449
391.474
404.243
412.426
415.79
414.227
407.737
396.436
380.542
360.366
336.306
308.819
278.406
245.601
210.961
175.066
138.496
101.797
65.507
30.0272
-4.23308
-36.9848
-68.024
-97.2254
-124.506
-149.8
-173.092
-194.388
-213.733
-231.204
-246.861
-260.783
-273.05
-283.73
-292.893
-300.594
-306.893
-311.843
-315.5
-317.917
-319.152
-319.235
-318.111
-315.864
-312.508
-308.054
-302.481
-295.776
-287.906
-278.853
-268.597
-257.099
-244.323
-230.213
-214.722
-197.772
-179.28
-159.205
-137.514
-114.188
-89.2166
-62.5879
-34.3453
-4.6165
26.4387
58.3388
91.0851
124.835
159.079
193.222
226.766
259.08
289.516
317.506
342.457
363.854
381.243
394.232
402.548
406.042
404.664
398.404
387.392
371.969
352.439
329.262
302.977
274.126
243.24
210.915
177.688
144.063
110.48
77.3054
44.9486
14.4592
-15.3995
-44.037
-71.315
-97.1656
-121.586
-144.593
-166.217
-186.489
-205.436
-223.088
-239.468
-254.573
-268.394
-280.912
-292.092
-301.897
-310.272
-317.162
-322.521
-326.302
-328.472
-329.033
-327.674
-324.583
-319.748
-313.154
-304.819
-294.723
-282.886
-269.343
-254.07
-237.084
-218.458
-198.255
-176.545
-153.339
391.155
412.038
428.812
441.179
448.987
452.105
450.414
443.892
432.654
416.893
396.819
372.815
345.325
314.746
281.62
246.403
209.66
171.973
133.808
95.646
57.925
20.9598
-14.9216
-49.2892
-81.9878
-112.881
-141.883
-168.914
-193.921
-216.914
-237.916
-256.958
-274.104
-289.42
-302.975
-314.838
-325.076
-333.757
-340.935
-346.658
-350.965
-353.88
-355.412
-355.559
-354.311
-351.611
-347.441
-341.791
-334.569
-325.732
-315.246
-303.011
-288.991
-273.093
-255.273
-235.51
-213.791
-190.076
-164.402
-136.812
-107.369
-76.2184
-43.5016
-9.41645
25.8048
61.8096
98.3193
134.937
171.293
206.968
241.511
274.517
305.56
334.205
360.067
382.763
401.951
417.312
428.541
435.392
437.682
435.318
428.258
416.614
400.563
380.361
356.331
328.842
298.308
265.169
229.891
192.96
154.853
116.047
77.0118
38.2069
0.08917
-36.9445
-72.5109
-106.28
-137.982
-167.424
-194.497
-219.15
-241.393
-261.28
-278.896
-294.345
-307.738
-319.183
-328.784
-336.636
-342.815
-347.39
-350.412
-351.929
-351.985
-350.627
-347.907
-343.85
-338.454
-331.72
-323.646
-314.222
-303.436
-291.278
-277.724
-262.754
-246.342
-228.451
-209.053
-188.093
-165.51
-141.256
-115.309
-87.6696
-58.3812
-27.5299
4.74802
38.2613
72.8303
108.033
143.554
179.03
214.042
248.125
280.787
311.51
339.754
364.986
386.707
404.466
417.873
426.617
430.469
429.3
423.081
411.889
395.913
375.438
350.852
322.633
291.319
257.489
221.735
184.657
146.825
108.773
70.9883
34.0146
-1.90889
-36.3667
-69.1015
-99.932
-128.737
-155.454
-180.066
-202.593
-223.084
-241.576
-258.119
-272.789
-285.681
-296.898
-306.541
-314.671
-321.332
-326.557
-330.379
-332.852
-334.03
-334.006
-332.85
-330.512
-327.021
-322.371
-316.53
-309.514
-301.281
-291.752
-280.826
-268.423
-254.483
-238.951
-221.789
-202.979
-182.49
-160.314
-136.449
-110.923
-83.7902
-55.122
-25.0331
6.33219
38.8088
72.1824
106.264
140.711
175.054
208.972
242.03
273.748
303.627
331.14
355.76
376.976
394.3
407.308
415.656
419.103
417.535
410.956
399.484
383.346
362.864
338.452
310.576
279.754
246.529
211.469
175.166
138.216
101.175
64.5845
28.8603
-5.58908
-38.4751
-69.6016
-98.8545
-126.159
-151.449
-174.716
-195.97
-215.258
-232.666
-248.257
-262.112
-274.315
-284.935
-294.042
-301.691
-307.94
-312.845
-316.461
-318.844
-320.053
-320.123
-318.973
-316.715
-313.361
-308.916
-303.358
-296.677
-288.835
-279.813
-269.597
-258.143
-245.42
-231.37
-215.943
-199.055
-180.625
-160.602
-138.952
-115.656
-90.7028
-64.0715
-35.7978
-5.99928
25.1953
57.2912
90.2578
124.275
158.84
193.347
227.293
260.03
290.897
319.305
344.646
366.386
384.062
397.268
405.721
409.265
407.852
401.482
390.281
374.593
354.742
331.197
304.519
275.266
243.98
211.273
177.691
143.751
109.893
76.4728
43.865
13.4809
-16.5415
-45.2592
-72.5699
-98.424
-122.828
-145.811
-167.405
-187.646
-206.565
-224.194
-240.559
-255.657
-269.477
-282.003
-293.197
-303.021
-311.418
-318.331
-323.712
-327.513
-329.697
-330.26
-328.937
-325.866
-321.046
-314.46
-306.136
-296.046
-284.209
-270.672
-255.394
-238.397
-219.757
-199.531
-177.794
-154.547
393.535
414.727
431.766
444.339
452.289
455.479
453.787
447.185
435.795
419.813
399.454
375.117
347.255
316.279
282.741
247.111
209.965
171.899
133.386
94.9176
56.9286
19.7324
-16.336
-50.8487
-83.6481
-114.605
-143.641
-170.68
-195.672
-218.632
-239.587
-258.573
-275.658
-290.91
-304.401
-316.204
-326.386
-335.016
-342.152
-347.843
-352.126
-355.027
-356.556
-356.707
-355.474
-352.794
-348.656
-343.046
-335.869
-327.083
-316.649
-304.471
-290.505
-274.659
-256.881
-237.154
-215.457
-191.753
-166.069
-138.444
-108.937
-77.6924
-44.8486
-10.6047
24.8034
61.0323
97.799
134.701
171.365
207.363
242.244
275.592
306.98
335.96
362.144
385.141
404.601
420.197
431.62
438.609
440.968
438.603
431.469
419.68
403.421
382.954
358.615
330.779
299.872
266.344
230.672
193.351
154.865
115.698
76.3232
37.2056
-1.18822
-38.4652
-74.2315
-108.154
-139.958
-169.456
-196.542
-221.173
-243.365
-263.18
-280.712
-296.072
-309.375
-320.734
-330.255
-338.034
-344.152
-348.672
-351.647
-353.124
-353.144
-351.756
-349.019
-344.953
-339.558
-332.829
-324.766
-315.356
-304.59
-292.459
-278.935
-263.999
-247.628
-229.781
-210.429
-189.516
-166.974
-142.745
-116.805
-89.1449
-59.807
-28.8711
3.5303
37.2077
71.9668
107.43
143.237
179.036
214.403
248.87
281.934
313.071
341.724
367.346
389.422
407.489
421.143
430.063
434.01
432.851
426.556
415.201
398.98
378.188
353.224
324.583
292.82
258.531
222.325
184.814
146.579
108.164
70.0619
32.8002
-3.34272
-37.9713
-70.8257
-101.73
-130.57
-157.287
-181.874
-204.358
-224.795
-243.225
-259.698
-274.291
-287.103
-298.245
-307.822
-315.899
-322.515
-327.697
-331.476
-333.906
-335.042
-334.984
-333.822
-331.483
-327.995
-323.359
-317.537
-310.552
-302.368
-292.899
-282.033
-269.686
-255.797
-240.31
-223.186
-204.407
-183.94
-161.774
-137.907
-112.361
-85.1894
-56.4583
-26.2788
5.20279
37.8282
71.387
105.677
140.416
175.056
209.308
242.734
274.843
305.128
333.048
358.063
379.645
397.288
410.551
419.076
422.611
421.038
414.363
402.708
386.311
365.505
340.716
312.429
281.172
247.502
211.996
175.261
137.908
100.505
63.5966
27.6148
-7.03325
-40.0575
-71.2743
-100.579
-127.906
-153.193
-176.433
-197.64
-216.866
-234.206
-249.728
-263.512
-275.647
-286.203
-295.251
-302.844
-309.042
-313.898
-317.472
-319.818
-321
-321.063
-319.878
-317.609
-314.256
-309.82
-304.282
-297.625
-289.811
-280.822
-270.646
-259.241
-246.573
-232.587
-217.228
-200.407
-182.043
-162.075
-140.468
-117.207
-92.2732
-65.6402
-37.3345
-7.46286
23.8714
56.1745
89.3643
123.666
158.573
193.464
227.838
261.025
292.348
321.199
346.955
369.06
387.042
400.478
409.077
412.676
411.226
404.735
393.335
377.364
357.173
333.236
306.141
276.46
244.75
211.638
177.682
143.41
109.262
75.5857
42.6863
12.4636
-17.7553
-46.5564
-73.899
-99.7544
-124.14
-147.094
-168.657
-188.864
-207.752
-225.357
-241.705
-256.796
-270.616
-283.149
-294.359
-304.203
-312.624
-319.562
-324.968
-328.789
-330.988
-331.549
-330.266
-327.217
-322.413
-315.835
-307.525
-297.441
-285.604
-272.073
-256.789
-239.782
-221.127
-200.877
-179.112
-155.824
396.039
417.556
434.876
447.669
455.769
459.037
457.343
450.657
439.105
422.889
402.227
377.538
349.284
317.886
283.914
247.847
210.276
171.807
132.928
94.1379
55.8683
18.4308
-17.8364
-52.4999
-85.4029
-116.426
-145.497
-172.542
-197.516
-220.44
-241.346
-260.272
-277.291
-292.475
-305.899
-317.638
-327.759
-336.337
-343.429
-349.084
-353.343
-356.23
-357.756
-357.91
-356.693
-354.033
-349.931
-344.362
-337.235
-328.501
-318.122
-306.007
-292.095
-276.306
-258.573
-238.884
-217.211
-193.521
-167.827
-140.166
-110.595
-79.2514
-46.2741
-11.8638
23.7395
60.2054
97.243
134.444
171.431
207.77
243.009
276.717
308.468
337.802
364.325
387.641
407.389
423.236
434.861
441.998
444.432
442.065
434.853
422.911
406.43
385.686
361.017
332.815
301.513
267.574
231.485
193.752
154.867
115.319
75.5866
36.1397
-2.54706
-40.0801
-76.0565
-110.139
-142.052
-171.607
-198.705
-223.31
-245.445
-265.183
-282.625
-297.889
-311.096
-322.363
-331.799
-339.503
-345.555
-350.019
-352.944
-354.378
-354.361
-352.939
-350.185
-346.112
-340.717
-333.994
-325.941
-316.547
-305.803
-293.699
-280.207
-265.309
-248.98
-231.179
-211.878
-191.017
-168.518
-144.318
-118.386
-90.7067
-61.3179
-30.2936
2.23562
36.085
71.0435
106.783
142.89
179.028
214.772
249.643
283.134
314.708
343.794
369.831
392.284
410.679
424.595
433.701
437.75
436.602
430.226
418.699
402.219
381.089
355.724
326.635
294.395
259.621
222.935
184.966
146.306
107.508
69.0695
31.509
-4.86729
-39.6746
-72.6532
-103.633
-132.507
-159.222
-183.782
-206.218
-226.597
-244.962
-261.36
-275.871
-288.599
-299.66
-309.168
-317.189
-323.759
-328.898
-332.63
-335.015
-336.105
-336.007
-334.841
-332.502
-329.019
-324.396
-318.593
-311.64
-303.51
-294.104
-283.304
-271.017
-257.181
-241.741
-224.657
-205.912
-185.468
-163.315
-139.446
-113.88
-86.6683
-57.8717
-27.5982
4.00481
36.7854
70.5354
105.045
140.094
175.044
209.649
243.463
275.985
306.7
335.052
360.487
382.458
400.44
413.975
422.688
426.317
424.739
417.962
406.113
389.44
368.289
343.102
314.379
282.662
248.521
212.543
175.35
137.571
99.7844
62.5415
26.2878
-8.56747
-41.7347
-73.0432
-102.4
-129.75
-155.031
-178.242
-199.398
-218.559
-235.827
-251.275
-264.983
-277.046
-287.534
-296.519
-304.055
-310.199
-315.005
-318.532
-320.837
-321.992
-322.054
-320.825
-318.547
-315.194
-310.768
-305.25
-298.619
-290.835
-281.88
-271.747
-260.393
-247.783
-233.865
-218.575
-201.827
-183.536
-163.626
-142.065
-118.84
-93.9287
-67.2952
-38.9573
-9.0099
22.4599
54.9901
88.403
123.006
158.273
193.572
228.398
262.061
293.869
323.189
349.384
371.878
390.183
403.865
412.619
416.277
414.791
408.167
396.557
380.285
359.732
335.38
307.842
277.708
245.55
212.008
177.659
143.037
108.585
74.645
41.4205
11.3958
-19.0459
-47.9307
-75.3036
-101.158
-125.521
-148.442
-169.972
-190.143
-208.998
-226.577
-242.907
-257.99
-271.811
-284.353
-295.578
-305.445
-313.891
-320.856
-326.287
-330.13
-332.344
-332.903
-331.661
-328.638
-323.85
-317.28
-308.984
-298.907
-287.07
-273.547
-258.257
-241.238
-222.569
-202.294
-180.501
-157.17
398.667
420.528
438.144
451.17
459.43
462.779
461.083
454.31
442.586
426.123
405.14
380.08
351.41
319.567
285.138
248.608
210.589
171.697
132.432
93.3037
54.742
17.0529
-19.4252
-54.2449
-87.2542
-118.345
-147.451
-174.501
-199.455
-222.339
-243.192
-262.053
-279.003
-294.115
-307.467
-319.138
-329.197
-337.719
-344.764
-350.382
-354.615
-357.488
-359.01
-359.169
-357.962
-355.329
-351.265
-345.739
-338.665
-329.986
-319.665
-307.616
-293.763
-278.035
-260.348
-240.701
-219.056
-195.38
-169.679
-141.98
-112.344
-80.8967
-47.7796
-13.1957
22.6118
59.3276
96.6497
134.164
171.49
208.188
243.803
277.892
310.024
339.732
366.61
390.262
410.316
426.429
438.269
445.562
448.078
445.712
438.416
426.311
409.596
388.557
363.539
334.948
303.231
268.858
232.33
194.161
154.858
114.909
74.8003
35.008
-3.98937
-41.7911
-77.9884
-112.24
-144.266
-173.877
-200.985
-225.561
-247.635
-267.29
-284.635
-299.796
-312.901
-324.071
-333.418
-341.041
-347.025
-351.431
-354.304
-355.694
-355.637
-354.18
-351.408
-347.327
-341.932
-335.215
-327.174
-317.797
-307.075
-295
-281.542
-266.682
-250.399
-232.647
-213.399
-192.594
-170.144
-145.976
-120.055
-92.3568
-62.9158
-31.8003
0.861788
34.8904
70.0581
106.09
142.511
179.005
215.146
250.443
284.384
316.421
345.965
372.44
395.294
414.036
428.231
437.534
441.692
440.557
434.095
422.386
405.63
384.143
358.353
328.789
296.044
260.756
223.565
185.112
146.004
106.802
68.009
30.1373
-6.48642
-41.4809
-74.5879
-105.644
-134.551
-161.263
-185.79
-208.175
-228.491
-246.787
-263.107
-277.53
-290.168
-301.144
-310.576
-318.54
-325.063
-330.157
-333.841
-336.178
-337.218
-337.074
-335.906
-333.571
-330.09
-325.482
-319.697
-312.778
-304.704
-295.367
-284.638
-272.416
-258.635
-243.246
-226.205
-207.495
-187.075
-164.936
-141.068
-115.482
-88.229
-59.3646
-28.9942
2.73581
35.6778
69.6269
104.362
139.746
175.016
209.992
244.216
277.174
308.343
337.153
363.032
385.417
403.76
417.584
426.498
430.225
428.642
421.756
409.701
392.735
371.218
345.609
316.425
284.222
249.584
213.108
175.43
137.201
99.0107
61.4157
24.8756
-10.1957
-43.5094
-74.911
-104.32
-131.693
-156.967
-180.145
-201.246
-220.335
-237.526
-252.896
-266.524
-278.511
-288.928
-297.848
-305.324
-311.41
-316.163
-319.642
-321.904
-323.026
-323.096
-321.815
-319.527
-316.175
-311.758
-306.263
-299.658
-291.906
-282.988
-272.898
-261.597
-249.049
-235.203
-219.986
-203.317
-185.103
-165.254
-143.743
-120.556
-95.6701
-69.0381
-40.6683
-10.6429
20.9604
53.7323
87.3718
122.292
157.939
193.668
228.972
263.137
295.459
325.275
351.935
374.841
393.487
407.429
416.348
420.071
418.548
411.785
399.948
383.359
362.42
337.627
309.621
279.009
246.378
212.383
177.618
142.63
107.863
73.652
40.0861
10.2555
-20.4195
-49.3843
-76.7851
-102.635
-126.972
-149.857
-171.35
-191.482
-210.301
-227.852
-244.164
-259.239
-273.06
-285.611
-296.855
-306.745
-315.218
-322.212
-327.67
-331.537
-333.767
-334.326
-333.124
-330.127
-325.356
-318.796
-310.515
-300.445
-288.607
-275.093
-259.796
-242.766
-224.082
-203.782
-181.96
-158.585
401.42
423.644
441.572
454.843
463.272
466.71
465.011
458.145
446.241
429.516
408.196
382.741
353.634
321.322
286.411
249.394
210.903
171.566
131.895
92.4129
53.5474
15.5969
-21.1055
-56.0861
-89.2037
-120.362
-149.505
-176.558
-201.489
-224.33
-245.126
-263.919
-280.794
-295.83
-309.107
-320.706
-330.698
-339.161
-346.157
-351.737
-355.943
-358.801
-360.319
-360.483
-359.287
-356.681
-352.657
-347.177
-340.159
-331.537
-321.278
-309.299
-295.509
-279.844
-262.209
-242.606
-220.991
-197.331
-171.624
-143.887
-114.183
-82.6302
-49.3671
-14.6025
21.4189
58.3971
96.0174
133.86
171.541
208.618
244.625
279.116
311.648
341.749
369.001
393.006
413.381
429.777
441.847
449.302
451.905
449.539
442.152
429.878
412.917
391.564
366.18
337.18
305.023
270.195
233.205
194.578
154.835
114.466
73.9619
33.8069
-5.51705
-43.6012
-80.0305
-114.459
-146.602
-176.271
-203.387
-227.929
-249.936
-269.501
-286.742
-301.793
-314.79
-325.858
-335.111
-342.65
-348.562
-352.907
-355.727
-357.07
-356.971
-355.477
-352.685
-348.597
-343.203
-336.492
-328.462
-319.104
-308.406
-296.361
-282.939
-268.119
-251.884
-234.183
-214.993
-194.248
-171.851
-147.721
-121.811
-94.0967
-64.6019
-33.3929
-0.59325
33.6222
69.0082
105.349
142.097
178.966
215.524
251.271
285.686
318.209
348.238
375.178
398.454
417.563
432.054
441.567
445.84
444.718
438.166
426.265
409.219
387.353
361.112
331.045
297.767
261.935
224.211
185.248
145.669
106.042
66.8754
28.6799
-8.20332
-43.3936
-76.631
-107.765
-136.704
-163.409
-187.9
-210.228
-230.476
-248.7
-264.938
-279.268
-291.81
-302.693
-312.047
-319.951
-326.427
-331.476
-335.11
-337.395
-338.381
-338.184
-337.019
-334.69
-331.211
-326.617
-320.852
-313.965
-305.95
-296.69
-286.037
-273.883
-260.161
-244.825
-227.831
-209.157
-188.764
-166.639
-142.773
-117.167
-89.8745
-60.9409
-30.4696
1.39161
34.5018
68.656
103.623
139.366
174.967
210.332
244.989
278.407
310.056
339.35
365.699
388.523
407.249
421.38
430.507
434.339
432.75
425.749
413.475
396.198
374.294
348.24
318.568
285.854
250.691
213.689
175.5
136.797
98.182
60.2169
23.3768
-11.9196
-45.382
-76.8786
-106.337
-133.734
-158.999
-182.141
-203.183
-222.194
-239.304
-254.591
-268.135
-280.041
-290.384
-299.236
-306.649
-312.676
-317.372
-320.801
-323.016
-324.101
-324.185
-322.844
-320.549
-317.197
-312.791
-307.321
-300.742
-293.025
-284.145
-274.098
-262.852
-250.371
-236.601
-221.463
-204.877
-186.743
-166.96
-145.499
-122.356
-97.4983
-70.8701
-42.4691
-12.3641
19.3788
52.3886
86.2674
121.522
157.566
193.751
229.557
264.253
297.118
327.459
354.609
377.951
396.958
411.174
420.268
424.061
422.498
415.59
403.509
386.588
365.239
339.979
311.477
280.361
247.233
212.759
177.557
142.185
107.091
72.6082
38.7613
8.96081
-21.8827
-50.9195
-78.3449
-104.187
-128.493
-151.338
-172.792
-192.881
-211.662
-229.184
-245.476
-260.543
-274.365
-286.926
-298.188
-308.104
-316.606
-323.63
-329.118
-333.01
-335.257
-335.82
-334.654
-331.686
-326.933
-320.381
-312.118
-302.056
-290.217
-276.713
-261.408
-244.365
-225.668
-205.341
-183.49
-160.071
404.299
426.903
445.161
458.692
467.299
470.83
469.13
462.164
450.07
433.071
411.395
385.524
355.955
323.151
287.732
250.204
211.216
171.41
131.316
91.4631
52.2822
14.0607
-22.8799
-58.0257
-91.2534
-122.481
-151.66
-178.714
-203.62
-226.415
-247.148
-265.868
-282.665
-297.621
-310.818
-322.341
-332.263
-340.664
-347.608
-353.147
-357.325
-360.168
-361.683
-361.852
-360.664
-358.092
-354.107
-348.678
-341.716
-333.156
-322.963
-311.056
-297.335
-281.735
-264.156
-244.598
-223.017
-199.376
-173.666
-145.89
-116.115
-84.4544
-51.0388
-16.0855
20.159
57.4122
95.3436
133.529
171.582
209.059
245.475
280.388
313.34
343.853
371.499
395.872
416.585
433.28
445.594
453.224
455.918
453.555
446.074
433.618
416.397
394.714
368.943
339.512
306.894
271.584
234.108
195.003
154.797
113.988
73.0699
32.5342
-7.13269
-45.513
-82.1863
-116.8
-149.065
-178.792
-205.914
-230.417
-252.351
-271.819
-288.948
-303.883
-316.765
-327.724
-336.879
-344.33
-350.167
-354.448
-357.212
-358.508
-358.365
-356.827
-354.016
-349.923
-344.53
-337.825
-329.808
-320.469
-309.795
-297.782
-284.397
-269.62
-253.435
-235.789
-216.659
-195.981
-173.642
-149.553
-123.658
-95.9289
-66.38
-35.0749
-2.13231
32.2756
67.8892
104.556
141.644
178.906
215.903
252.122
287.034
320.072
350.612
378.042
401.766
421.265
436.068
445.803
450.198
449.091
442.444
430.34
412.988
390.72
364.004
333.405
299.561
263.158
224.871
185.373
145.299
105.23
65.6687
27.1387
-10.016
-45.4107
-78.7825
-109.993
-138.965
-165.659
-190.111
-212.378
-232.553
-250.7
-266.852
-281.085
-293.525
-304.31
-313.579
-321.421
-327.851
-332.854
-336.436
-338.667
-339.596
-339.341
-338.179
-335.858
-332.381
-327.8
-322.055
-315.2
-307.249
-298.071
-287.502
-275.419
-261.757
-246.478
-229.534
-210.897
-190.532
-168.424
-144.561
-118.936
-91.6027
-62.5986
-32.0222
-0.0261716
33.2584
67.6249
102.826
138.957
174.895
210.67
245.78
279.682
311.836
341.64
368.487
391.775
410.909
425.366
434.719
438.663
437.066
429.943
417.438
399.832
377.518
350.994
320.809
287.556
251.843
214.288
175.558
136.358
97.2957
58.9426
21.7876
-13.7429
-47.3556
-78.9469
-108.456
-135.874
-161.13
-184.233
-205.211
-224.139
-241.161
-256.362
-269.816
-281.638
-291.903
-300.684
-308.031
-313.995
-318.631
-322.008
-324.175
-325.215
-325.305
-323.91
-321.612
-318.261
-313.867
-308.421
-301.873
-294.191
-285.35
-275.347
-264.159
-251.748
-238.058
-223.005
-206.507
-188.457
-168.743
-147.336
-124.241
-99.414
-72.7928
-44.3614
-14.1757
17.712
50.9549
85.0867
120.694
157.152
193.817
230.152
265.407
298.844
329.739
357.406
381.209
400.597
415.101
424.381
428.249
426.641
419.586
407.243
389.972
368.188
342.436
313.41
281.763
248.111
213.135
177.474
141.699
106.269
71.513
37.4667
7.48718
-23.4397
-52.5382
-79.9845
-105.814
-130.086
-152.885
-174.298
-194.341
-213.081
-230.571
-246.843
-261.901
-275.724
-288.296
-299.578
-309.521
-318.055
-325.111
-330.63
-334.549
-336.815
-337.381
-336.253
-333.313
-328.581
-322.038
-313.792
-303.739
-291.899
-278.407
-263.092
-246.035
-227.328
-206.973
-185.092
-161.627
407.304
430.309
448.912
462.717
471.512
475.142
473.44
466.372
454.078
436.788
414.737
388.427
358.375
325.052
289.101
251.035
211.527
171.228
130.69
90.4527
50.944
12.4383
-24.7469
-60.0662
-93.4051
-124.702
-153.919
-180.971
-205.848
-228.592
-249.26
-267.902
-284.615
-299.486
-312.6
-324.043
-333.891
-342.227
-349.116
-354.613
-358.761
-361.588
-363.101
-363.275
-362.095
-359.558
-355.615
-350.239
-343.336
-334.84
-324.719
-312.887
-299.241
-283.707
-266.189
-246.679
-225.134
-201.515
-175.806
-147.989
-118.143
-86.3713
-52.7963
-17.647
18.8303
56.3704
94.6262
133.169
171.613
209.506
246.352
281.707
315.099
346.043
374.103
398.863
419.929
436.938
449.513
457.327
460.118
457.748
450.174
437.529
420.034
398.002
371.823
341.939
308.836
273.021
235.037
195.432
154.742
113.474
72.121
31.1865
-8.84056
-47.531
-84.4601
-119.267
-151.659
-181.443
-208.566
-233.027
-254.88
-274.243
-291.253
-306.064
-318.823
-329.668
-338.719
-346.079
-351.837
-356.052
-358.76
-360.006
-359.816
-358.228
-355.404
-351.304
-345.914
-339.216
-331.213
-321.894
-311.245
-299.265
-285.92
-271.187
-255.054
-237.465
-218.401
-197.796
-175.52
-151.476
-125.598
-97.8567
-68.2537
-36.8497
-3.76091
30.8497
66.6974
103.709
141.15
178.823
216.281
252.996
288.431
322.008
353.087
381.035
405.231
425.14
440.276
450.244
454.77
453.679
446.932
434.615
416.94
394.25
367.031
335.87
301.431
264.426
225.55
185.489
144.895
104.363
64.3866
25.5079
-11.9312
-47.5407
-81.0516
-112.34
-141.341
-168.02
-192.429
-214.629
-234.725
-252.791
-268.852
-282.982
-295.313
-305.992
-315.171
-322.949
-329.332
-334.29
-337.819
-339.992
-340.859
-340.541
-339.382
-337.072
-333.598
-329.028
-323.302
-316.478
-308.594
-299.506
-289.026
-277.02
-263.423
-248.202
-231.31
-212.713
-192.376
-170.288
-146.429
-120.787
-93.4122
-64.3366
-33.6513
-1.51632
31.9485
66.5357
101.973
138.519
174.803
211.006
246.592
281.002
313.687
344.029
371.4
395.179
414.743
429.546
439.137
443.199
441.596
434.344
421.594
403.641
380.896
353.876
323.15
289.332
253.039
214.903
175.604
135.879
96.3481
57.588
20.1018
-15.6705
-49.4346
-81.1203
-110.678
-138.116
-163.361
-186.422
-207.33
-226.168
-243.096
-258.206
-271.567
-283.299
-293.483
-302.19
-309.468
-315.367
-319.94
-323.262
-325.379
-326.369
-326.358
-325.012
-322.712
-319.368
-314.982
-309.565
-303.05
-295.404
-286.601
-276.643
-265.516
-253.178
-239.572
-224.611
-208.203
-190.244
-170.605
-149.256
-126.21
-101.418
-74.8075
-46.3469
-16.0801
15.9554
49.4283
83.8271
119.802
156.695
193.863
230.754
266.596
300.638
332.115
360.329
384.615
404.407
419.215
428.69
432.637
430.979
423.773
411.156
393.514
371.27
344.998
315.418
283.214
249.011
213.508
177.364
141.17
105.393
70.3624
36.1963
5.83628
-25.0915
-54.2423
-81.7053
-107.519
-131.75
-154.497
-175.868
-195.861
-214.556
-232.013
-248.264
-263.313
-277.138
-289.721
-301.025
-310.997
-319.564
-326.655
-332.207
-336.154
-338.442
-339.012
-337.921
-335.01
-330.3
-323.766
-315.538
-305.494
-293.653
-280.177
-264.849
-247.778
-229.061
-208.678
-186.767
-163.255
410.436
433.861
452.828
466.921
475.915
479.648
477.946
470.77
458.265
440.67
418.225
391.452
360.893
327.025
290.515
251.887
211.834
171.017
130.014
89.3792
49.5312
10.7257
-26.7079
-62.2105
-95.6609
-127.027
-156.283
-183.328
-208.174
-230.864
-251.461
-270.02
-286.645
-301.427
-314.453
-325.812
-335.582
-343.849
-350.682
-356.134
-360.252
-363.061
-364.573
-364.753
-363.579
-361.078
-357.181
-351.861
-345.02
-336.592
-326.546
-314.792
-301.225
-285.762
-268.308
-248.849
-227.344
-203.751
-178.043
-150.187
-120.268
-88.3818
-54.641
-19.2897
17.4306
55.2692
93.8627
132.78
171.632
209.959
247.256
283.071
316.924
348.318
376.813
401.979
423.416
440.753
453.602
461.618
464.51
462.146
454.465
441.62
423.834
401.436
374.83
344.473
310.858
274.517
235.995
195.866
154.67
112.921
71.1137
29.7605
-10.6416
-49.6563
-86.8525
-121.861
-154.383
-184.223
-211.344
-235.757
-257.522
-276.772
-293.656
-308.336
-320.966
-331.689
-340.633
-347.897
-353.573
-357.721
-360.37
-361.565
-361.328
-359.692
-356.848
-352.742
-347.354
-340.665
-332.676
-323.379
-312.757
-300.811
-287.508
-272.82
-256.741
-239.213
-220.218
-199.691
-177.485
-153.492
-127.632
-99.8821
-70.2258
-38.7201
-5.48004
29.3394
65.4583
102.775
140.61
178.714
216.654
253.89
289.872
324.016
355.661
384.155
408.851
429.192
444.676
454.888
459.559
458.486
451.634
439.095
421.08
397.945
370.194
338.44
303.374
265.736
226.238
185.584
144.447
103.431
63.0186
23.7785
-13.9573
-49.7893
-83.4406
-114.803
-143.831
-170.49
-194.847
-216.977
-236.987
-254.967
-270.933
-284.955
-297.169
-307.733
-316.816
-324.53
-330.869
-335.782
-339.257
-341.368
-342.17
-341.765
-340.625
-338.332
-334.86
-330.3
-324.592
-317.8
-309.983
-300.994
-290.613
-278.69
-265.157
-249.996
-233.163
-214.606
-194.301
-172.234
-148.38
-122.722
-95.307
-66.1583
-35.361
-3.08346
30.5675
65.3847
101.13
137.975
174.682
211.335
247.42
282.365
315.607
346.515
374.438
398.738
418.755
433.926
443.769
447.955
446.343
438.956
425.946
407.623
384.42
356.877
325.583
291.171
254.273
215.524
175.627
135.349
95.3341
56.1458
18.3141
-17.7067
-51.6199
-83.3997
-113.004
-140.459
-165.693
-188.706
-209.54
-228.279
-245.109
-260.122
-273.385
-285.022
-295.122
-303.752
-310.958
-316.792
-321.299
-324.562
-326.629
-327.565
-327.443
-326.155
-323.855
-320.517
-316.137
-310.749
-304.271
-296.664
-287.899
-277.987
-266.923
-254.66
-241.143
-226.278
-209.966
-192.102
-172.543
-151.256
-128.263
-103.509
-76.9157
-48.4282
-18.0815
14.1059
47.8057
82.4853
118.843
156.191
193.887
231.362
267.82
302.486
334.587
363.378
388.173
408.388
423.518
433.199
437.229
435.519
428.15
415.25
397.213
374.486
347.664
317.502
284.712
249.931
213.876
177.225
140.595
104.459
69.1503
34.8596
4.09369
-26.8363
-56.0334
-83.5088
-109.301
-133.485
-156.176
-177.502
-197.441
-216.088
-233.51
-249.738
-264.779
-278.605
-291.201
-302.528
-312.531
-321.134
-328.262
-333.849
-337.827
-340.138
-340.723
-339.66
-336.776
-332.091
-325.567
-317.355
-307.323
-295.478
-282.023
-266.677
-249.592
-230.869
-210.455
-188.514
-164.955
413.696
437.562
456.909
471.306
480.509
484.35
482.649
475.36
462.634
444.718
421.859
394.6
363.509
329.07
291.974
252.756
212.136
170.774
129.286
88.2396
48.0408
8.92617
-28.7706
-64.4617
-98.0229
-129.457
-158.753
-185.789
-210.599
-233.231
-253.753
-272.223
-288.754
-303.443
-316.377
-327.648
-337.336
-345.531
-352.304
-357.709
-361.795
-364.587
-366.098
-366.285
-365.119
-362.653
-358.805
-353.543
-346.768
-338.41
-328.441
-316.771
-303.288
-287.901
-270.514
-251.11
-229.645
-206.084
-180.381
-152.486
-122.492
-90.4877
-56.5756
-21.016
15.9574
54.1062
93.0517
132.36
171.639
210.415
248.186
284.48
318.815
350.679
379.627
405.22
427.045
444.728
457.865
466.09
469.094
466.726
458.938
445.885
427.798
405.011
377.954
347.098
312.949
276.055
236.972
196.297
154.574
112.323
70.0447
28.2557
-12.5371
-51.8914
-89.3664
-124.585
-157.243
-187.139
-214.253
-238.614
-260.283
-279.411
-296.159
-310.702
-323.195
-333.789
-342.62
-349.785
-355.375
-359.453
-362.042
-363.185
-362.898
-361.21
-358.344
-354.232
-348.847
-342.165
-334.19
-324.914
-314.319
-302.41
-289.151
-274.51
-258.488
-241.024
-222.102
-201.661
-179.531
-155.594
-129.758
-102
-72.2926
-40.6814
-7.28761
27.7476
64.1474
101.783
140.028
178.58
217.025
254.807
291.361
326.1
358.341
387.409
412.63
433.426
449.28
459.751
464.567
463.514
456.555
443.781
425.409
401.803
373.491
341.111
305.384
267.079
226.931
185.656
143.952
102.435
61.5675
21.9535
-16.0884
-52.1507
-85.9436
-117.377
-146.428
-173.063
-197.363
-219.416
-239.336
-257.222
-273.089
-286.998
-299.092
-309.535
-318.516
-326.164
-332.462
-337.331
-340.75
-342.795
-343.527
-343.054
-341.908
-339.634
-336.167
-331.617
-325.926
-319.164
-311.42
-302.538
-292.262
-280.426
-266.959
-251.86
-235.091
-216.576
-196.305
-174.26
-150.414
-124.743
-97.2898
-68.0672
-37.155
-4.73158
29.1075
64.1656
100.22
137.389
174.526
211.649
248.256
283.762
317.587
349.095
377.598
402.448
422.946
438.505
448.616
452.934
451.311
443.779
430.496
411.785
388.102
360.01
328.12
293.085
255.554
216.164
175.638
134.778
94.2581
54.6225
16.4285
-19.847
-53.9072
-85.7773
-115.428
-142.898
-168.12
-191.084
-211.836
-230.47
-247.193
-262.107
-275.266
-286.805
-296.818
-305.37
-312.504
-318.268
-322.707
-325.906
-327.919
-328.801
-328.516
-327.33
-325.035
-321.706
-317.328
-311.975
-305.537
-297.969
-289.243
-279.376
-268.376
-256.194
-242.769
-228.006
-211.791
-194.031
-174.557
-153.334
-130.399
-105.689
-79.1185
-50.608
-20.1842
12.1551
46.0887
81.0583
117.814
155.637
193.884
231.97
269.084
304.392
337.147
366.552
391.885
412.544
428.013
437.91
442.027
440.269
432.722
419.527
401.07
377.836
350.434
319.661
286.255
250.871
214.235
177.053
139.971
103.463
67.8727
33.4329
2.27613
-28.6725
-57.9128
-85.3964
-111.162
-135.293
-157.919
-179.201
-199.081
-217.676
-235.061
-251.266
-266.298
-280.126
-292.736
-304.087
-314.124
-322.765
-329.932
-335.557
-339.567
-341.904
-342.514
-341.472
-338.611
-333.953
-327.438
-319.244
-309.226
-297.375
-283.947
-268.576
-251.477
-232.753
-212.306
-190.335
-166.728
417.086
441.411
461.157
475.874
485.297
489.253
487.553
480.147
467.187
448.936
425.64
397.872
366.224
331.186
293.479
253.642
212.429
170.498
128.501
87.03
46.4702
7.03822
-30.9393
-66.8235
-100.493
-131.994
-161.334
-188.354
-213.125
-235.695
-256.135
-274.512
-290.944
-305.534
-318.372
-329.549
-339.152
-347.272
-353.982
-359.339
-363.392
-366.166
-367.676
-367.872
-366.705
-364.282
-360.487
-355.284
-348.579
-340.294
-330.405
-318.827
-305.429
-290.126
-272.807
-253.461
-232.037
-208.515
-182.821
-154.887
-124.819
-92.6914
-58.6025
-22.8263
14.406
52.8792
92.192
131.906
171.629
210.874
249.14
285.934
320.772
353.127
382.547
408.585
430.818
448.867
462.307
470.756
473.875
471.513
463.603
450.328
431.921
408.729
381.2
349.822
315.12
277.649
237.983
196.738
154.466
111.691
68.9204
26.6721
-14.53
-54.2425
-92.0102
-127.449
-160.248
-190.198
-217.297
-241.599
-263.163
-282.157
-298.76
-313.155
-325.5
-335.958
-344.67
-351.733
-357.236
-361.243
-363.77
-364.859
-364.519
-362.762
-359.885
-355.771
-350.389
-343.715
-335.754
-326.5
-315.933
-304.06
-290.847
-276.256
-260.294
-242.899
-224.054
-203.705
-181.659
-157.782
-131.974
-104.212
-74.4548
-42.7347
-9.18575
26.0715
62.7606
100.73
139.399
178.417
217.391
255.744
292.895
328.257
361.125
390.796
416.572
437.847
454.09
464.837
469.809
468.771
461.698
448.68
429.93
405.827
376.925
343.886
307.465
268.46
227.632
185.708
143.414
101.38
60.0336
20.0361
-18.3222
-54.6253
-88.5619
-120.062
-149.135
-175.739
-199.975
-221.944
-241.77
-259.556
-275.319
-289.115
-301.088
-311.4
-320.27
-327.85
-334.107
-338.929
-342.292
-344.268
-344.929
-344.392
-343.227
-340.978
-337.516
-332.974
-327.301
-320.569
-312.898
-304.132
-293.969
-282.222
-268.823
-253.788
-237.09
-218.619
-198.38
-176.362
-152.525
-126.842
-99.3539
-70.0572
-39.0274
-6.45616
27.5752
62.8811
99.245
136.765
174.339
211.95
249.102
285.194
319.631
351.767
380.883
406.311
427.318
443.289
453.682
458.137
456.503
448.822
435.255
416.139
391.949
363.279
330.753
295.066
256.872
216.812
175.625
134.155
93.1153
53.0119
14.4394
-22.0972
-56.3026
-88.2551
-117.954
-145.434
-170.645
-193.554
-214.216
-232.738
-249.35
-264.161
-277.214
-288.649
-298.572
-307.043
-314.101
-319.793
-324.158
-327.291
-329.248
-330.079
-329.776
-328.56
-326.254
-322.941
-318.558
-313.239
-306.846
-299.317
-290.629
-280.808
-269.873
-257.776
-244.447
-229.791
-213.676
-196.027
-176.647
-155.486
-132.615
-107.957
-81.4167
-52.8879
-22.3921
10.0941
44.2793
79.543
116.712
155.029
193.852
232.579
270.374
306.373
339.808
369.853
395.753
416.877
432.701
442.828
447.036
445.23
437.496
423.99
405.091
381.322
353.309
321.894
287.843
251.83
214.582
176.846
139.295
102.4
66.526
31.9073
0.385698
-30.5992
-59.8821
-87.3698
-113.104
-137.174
-159.726
-180.965
-200.781
-219.319
-236.666
-252.846
-267.871
-281.7
-294.324
-305.702
-315.775
-324.457
-331.665
-337.33
-341.375
-343.741
-344.379
-343.356
-340.516
-335.886
-329.381
-321.206
-311.202
-299.343
-285.95
-270.546
-253.433
-234.713
-214.23
-192.23
-168.574
420.605
445.409
465.575
480.627
490.281
494.36
492.662
485.132
471.928
453.324
429.571
401.266
369.037
333.373
295.027
254.542
212.712
170.182
127.655
85.7447
44.817
5.06046
-33.2185
-69.2995
-103.074
-134.639
-164.026
-191.024
-215.753
-238.255
-258.609
-276.886
-293.213
-307.7
-320.437
-331.517
-341.03
-349.072
-355.716
-361.022
-365.041
-367.796
-369.308
-369.513
-368.339
-365.965
-362.225
-357.084
-350.453
-342.244
-332.437
-320.96
-307.648
-292.438
-275.187
-255.905
-234.522
-211.047
-185.366
-157.389
-127.251
-94.996
-60.7234
-24.7232
12.7737
51.5874
91.2814
131.418
171.599
211.336
250.115
287.433
322.793
355.66
385.571
412.072
434.73
453.164
466.927
475.614
478.855
476.5
468.465
454.956
436.214
412.607
384.591
352.667
317.372
279.29
239.012
197.167
154.321
111.002
67.7162
24.9874
-16.6375
-56.7197
-94.7908
-130.456
-163.395
-193.392
-220.47
-244.703
-266.15
-284.995
-301.442
-315.681
-327.876
-338.195
-346.787
-353.743
-359.157
-363.092
-365.556
-366.59
-366.199
-364.382
-361.481
-357.361
-351.983
-345.319
-337.371
-328.141
-317.604
-305.767
-292.603
-278.064
-262.164
-244.839
-226.075
-205.828
-183.873
-160.061
-134.285
-106.523
-76.7155
-44.8867
-11.1752
24.3075
61.2912
99.6145
138.724
178.224
217.749
256.698
294.472
330.484
364.008
394.314
420.672
442.451
459.107
470.14
475.281
474.26
467.071
453.8
434.655
410.031
380.506
346.775
309.623
269.887
228.347
185.744
142.83
100.267
58.4153
18.0208
-20.6663
-57.2172
-91.299
-122.86
-151.948
-178.513
-202.678
-224.559
-244.288
-261.97
-277.62
-291.3
-303.147
-313.313
-322.062
-329.575
-335.795
-340.57
-343.876
-345.778
-346.371
-345.885
-344.588
-342.356
-338.901
-334.368
-328.713
-322.008
-314.412
-305.77
-295.726
-284.075
-270.745
-255.773
-239.152
-220.728
-200.526
-178.536
-154.709
-129.018
-101.498
-72.1258
-40.9755
-8.25482
25.9749
61.5296
98.2061
136.095
174.118
212.232
249.95
286.658
321.73
354.523
384.283
410.32
431.864
448.273
458.966
463.569
461.922
454.082
440.213
420.664
395.942
366.666
333.482
297.116
258.235
217.475
175.596
133.491
91.9052
51.3162
12.3473
-24.4555
-58.8
-90.8284
-120.576
-148.061
-173.263
-196.114
-216.678
-235.08
-251.574
-266.278
-279.219
-290.542
-300.369
-308.758
-315.739
-321.356
-325.646
-328.709
-330.607
-331.386
-331.026
-329.81
-327.501
-324.19
-319.81
-314.528
-308.192
-300.703
-292.056
-282.277
-271.412
-259.4
-246.171
-231.627
-215.617
-198.084
-178.806
-157.708
-134.908
-110.309
-83.8104
-55.2703
-24.7088
7.91872
42.3737
77.9354
115.534
154.362
193.787
233.183
271.698
308.413
342.561
373.283
399.778
421.391
437.586
447.956
452.26
450.404
442.478
428.641
409.279
384.945
356.289
324.197
289.472
252.804
214.913
176.597
138.561
101.265
65.1052
30.2796
-1.58
-32.6166
-61.9431
-89.4306
-115.128
-139.129
-161.596
-182.795
-202.54
-221.017
-238.324
-254.478
-269.496
-283.328
-295.967
-307.374
-317.484
-326.21
-333.461
-339.169
-343.252
-345.647
-346.316
-345.311
-342.495
-337.89
-331.396
-323.241
-313.252
-301.38
-288.035
-272.585
-255.46
-236.751
-216.228
-194.201
-170.493
424.254
449.558
470.164
485.568
495.464
499.674
497.977
490.319
476.858
457.886
433.653
404.781
371.949
335.628
296.617
255.454
212.981
169.824
126.744
84.3783
43.0796
2.98744
-35.609
-71.8941
-105.767
-137.393
-166.834
-193.799
-218.483
-240.914
-261.176
-279.346
-295.562
-309.942
-322.573
-333.551
-342.97
-350.93
-357.505
-362.757
-366.741
-369.476
-370.992
-371.211
-370.02
-367.705
-364.021
-358.945
-352.389
-344.26
-334.538
-323.169
-309.945
-294.837
-277.654
-258.441
-237.102
-213.681
-188.019
-159.995
-129.791
-97.4043
-62.9394
-26.7104
11.0585
50.228
90.3175
130.889
171.548
211.799
251.109
288.976
324.88
358.28
388.705
415.687
438.788
457.623
471.73
480.665
484.035
481.666
473.509
459.758
440.662
416.607
388.073
355.58
319.677
280.967
240.049
197.589
154.151
110.272
66.4542
23.2257
-18.8348
-59.3005
-97.69
-133.589
-166.672
-196.713
-223.761
-247.916
-269.239
-287.928
-304.216
-318.295
-330.337
-340.508
-348.971
-355.815
-361.134
-364.991
-367.392
-368.368
-367.927
-366.05
-363.121
-358.996
-353.622
-346.966
-339.034
-329.827
-319.321
-307.52
-294.41
-279.924
-264.086
-246.837
-228.157
-208.023
-186.169
-162.431
-136.692
-108.936
-79.0818
-47.1454
-13.2674
22.4421
59.7296
98.4168
137.987
177.984
218.09
257.66
296.088
332.781
366.997
397.97
424.942
447.248
464.342
475.675
480.976
479.978
472.671
459.134
439.573
414.398
384.22
349.757
311.839
271.34
229.054
185.744
142.184
99.0778
56.7057
15.9014
-23.1177
-59.9191
-94.1467
-125.761
-154.853
-181.377
-205.463
-227.252
-246.878
-264.443
-279.969
-293.529
-305.25
-315.264
-323.884
-331.329
-337.514
-342.242
-345.492
-347.317
-347.829
-347.231
-345.96
-343.755
-340.324
-335.79
-330.152
-323.478
-315.959
-307.448
-297.529
-285.977
-272.716
-257.808
-241.273
-222.905
-202.74
-180.779
-156.965
-131.266
-103.716
-74.2681
-42.9936
-10.1195
24.3078
60.1199
97.1198
135.378
173.866
212.505
250.808
288.158
323.89
357.374
387.805
414.484
436.589
453.461
464.466
469.218
467.556
459.551
445.361
425.359
400.081
370.176
336.318
299.246
259.647
218.156
175.53
132.759
90.6256
49.5346
10.1414
-26.9274
-61.4047
-93.5024
-123.297
-150.776
-175.968
-198.759
-219.212
-237.483
-253.854
-268.444
-281.268
-292.476
-302.202
-310.506
-317.409
-322.952
-327.164
-330.152
-331.991
-332.726
-332.369
-331.094
-328.806
-325.463
-321.09
-315.848
-309.573
-302.126
-293.517
-283.778
-272.985
-261.061
-247.936
-233.508
-217.603
-200.195
-181.025
-159.994
-137.274
-112.746
-86.2988
-57.7575
-27.136
5.62744
40.3653
76.2318
114.275
153.633
193.685
233.782
273.044
310.535
345.411
376.842
403.961
426.087
442.673
453.297
457.701
455.791
447.673
433.483
413.636
388.706
359.374
326.57
291.142
253.792
215.226
176.305
137.763
100.054
63.6048
28.5481
-3.62533
-34.7254
-64.0975
-91.5807
-117.235
-141.158
-163.527
-184.692
-204.357
-222.769
-240.035
-256.162
-271.174
-285.007
-297.662
-309.1
-319.252
-328.024
-335.321
-341.073
-345.197
-347.624
-348.321
-347.337
-344.547
-339.966
-333.481
-325.348
-315.377
-303.486
-290.201
-274.69
-257.557
-238.867
-218.298
-196.248
-172.483
428.036
453.857
474.925
490.699
500.849
505.195
503.503
495.713
481.981
462.624
437.888
408.417
374.959
337.95
298.248
256.374
213.236
169.42
125.762
82.927
41.256
0.81851
-38.1179
-74.6118
-108.575
-140.256
-169.762
-196.681
-221.318
-243.672
-263.835
-281.892
-297.992
-312.26
-324.78
-335.65
-344.97
-352.845
-359.349
-364.545
-368.493
-371.207
-372.729
-372.965
-371.745
-369.497
-365.874
-360.866
-354.388
-346.342
-336.708
-325.453
-312.322
-297.326
-280.211
-261.069
-239.777
-216.416
-190.783
-162.707
-132.439
-99.9182
-65.2523
-28.7907
9.25809
48.7985
89.2956
130.319
171.475
212.259
252.123
290.558
327.028
360.981
391.944
419.425
442.989
462.247
476.712
485.925
489.433
487.076
478.776
464.766
445.294
420.766
391.682
358.597
322.073
282.717
241.127
198.029
153.97
109.507
65.1282
21.3732
-21.144
-62.0112
-100.73
-136.867
-170.09
-200.164
-227.169
-251.245
-272.442
-290.971
-307.088
-320.993
-332.865
-342.877
-351.203
-357.93
-363.152
-366.929
-369.265
-370.187
-369.695
-367.712
-364.783
-360.659
-355.291
-348.647
-340.727
-331.545
-321.073
-309.31
-296.254
-281.82
-266.046
-248.872
-230.281
-210.268
-188.523
-164.867
-139.173
-111.427
-81.5333
-49.4851
-15.4486
20.4906
58.0885
97.1447
137.186
177.697
218.4
258.621
297.719
335.122
370.06
401.738
429.358
452.223
469.778
481.431
486.922
485.94
478.505
464.691
444.692
418.941
388.074
352.846
314.125
272.829
229.769
185.72
141.494
97.816
54.9503
13.7039
-25.6571
-62.7175
-97.0958
-128.764
-157.852
-184.328
-208.323
-230.011
-249.531
-266.977
-282.358
-295.797
-307.396
-317.249
-325.729
-333.106
-339.258
-343.933
-347.127
-348.872
-349.295
-348.801
-347.367
-345.185
-341.785
-337.224
-331.599
-324.973
-317.531
-309.15
-299.36
-287.904
-274.712
-259.866
-243.423
-225.122
-204.998
-183.067
-159.268
-133.567
-105.994
-76.4791
-45.0821
-12.0593
22.5653
58.6377
95.9845
134.591
173.568
212.754
251.663
289.682
326.11
360.308
391.448
418.798
441.499
458.857
470.193
475.103
473.42
465.242
450.716
430.236
404.372
373.803
339.229
301.421
261.082
218.835
175.438
131.978
89.2952
47.6735
7.84186
-29.4956
-64.0813
-96.2357
-126.078
-153.55
-178.734
-201.466
-221.793
-239.924
-256.169
-270.643
-283.343
-294.43
-304.052
-312.27
-319.095
-324.561
-328.692
-331.605
-333.385
-334.083
-333.732
-332.395
-330.123
-326.766
-322.372
-317.181
-310.976
-303.574
-295.003
-285.302
-274.58
-262.745
-249.728
-235.422
-219.631
-202.352
-183.297
-162.336
-139.708
-115.269
-88.8839
-60.3505
-29.6779
3.21772
38.2457
74.4289
112.933
152.837
193.542
234.372
274.408
312.723
348.361
380.534
408.307
430.967
447.965
458.855
463.363
461.393
453.08
438.522
418.164
392.605
362.564
329.01
292.849
254.79
215.518
175.961
136.897
98.764
62.0196
26.7133
-5.75608
-36.9269
-66.3475
-93.8218
-119.426
-143.263
-165.516
-186.659
-206.233
-224.573
-241.798
-257.896
-272.905
-286.739
-299.41
-310.882
-321.078
-329.899
-337.245
-343.045
-347.212
-349.67
-350.394
-349.436
-346.673
-342.114
-335.638
-327.527
-317.577
-305.655
-292.45
-276.858
-259.724
-241.064
-220.44
-198.374
-174.544
431.951
458.307
479.861
496.023
506.44
510.928
509.242
501.315
487.299
467.539
442.278
412.174
378.069
340.339
299.918
257.299
213.475
168.963
124.705
81.3865
39.3449
-1.44702
-40.7511
-77.4576
-111.499
-143.23
-172.814
-199.669
-224.258
-246.53
-266.588
-284.524
-300.501
-314.652
-327.057
-337.815
-347.032
-354.818
-361.247
-366.384
-370.296
-372.985
-374.519
-374.779
-373.523
-371.342
-367.782
-362.848
-356.447
-348.487
-338.948
-327.813
-314.779
-299.904
-282.856
-263.792
-242.547
-219.256
-193.661
-165.526
-135.198
-102.541
-67.6646
-30.9664
7.36868
47.2954
88.2137
129.706
171.38
212.715
253.159
292.181
329.241
363.768
395.289
423.289
447.334
467.031
481.876
491.371
495.029
492.656
484.22
469.947
450.084
425.066
395.41
361.7
324.514
284.474
242.182
198.424
153.723
108.661
63.7137
19.4209
-23.5536
-64.8256
-103.877
-140.253
-173.617
-203.719
-230.675
-254.668
-275.726
-294.073
-310.004
-323.725
-335.423
-345.274
-353.46
-360.071
-365.196
-368.891
-371.163
-372.032
-371.494
-369.385
-366.462
-362.344
-356.984
-350.353
-342.448
-333.292
-322.856
-311.133
-298.13
-283.751
-268.041
-250.941
-232.445
-212.562
-190.935
-167.365
-141.718
-113.985
-84.052
-51.8916
-17.6925
18.4864
56.4003
95.8415
136.363
177.406
218.72
259.624
299.413
337.545
373.231
405.636
433.93
457.376
475.412
487.401
493.068
492.106
484.556
470.457
450.003
423.65
392.057
356.03
316.462
274.334
230.48
185.666
140.756
96.4851
53.132
11.3854
-28.3279
-65.6402
-100.156
-131.862
-160.921
-187.334
-211.222
-232.799
-252.218
-269.537
-284.757
-298.068
-309.553
-319.245
-327.582
-334.886
-341.008
-345.624
-348.762
-350.425
-350.751
-350.159
-348.727
-346.598
-343.203
-338.652
-333.06
-326.471
-319.116
-310.868
-301.199
-289.833
-276.72
-261.936
-245.588
-227.366
-207.29
-185.392
-161.596
-135.893
-108.301
-78.7258
-47.2048
-14.0399
20.7858
57.1086
94.7996
133.754
173.23
212.973
252.499
291.215
328.363
363.305
395.188
423.246
446.576
464.451
476.137
481.219
479.515
471.161
456.286
435.305
408.824
377.56
342.228
303.655
262.545
219.521
175.32
131.115
87.8849
45.733
5.43794
-32.1734
-66.8497
-99.0513
-128.942
-156.397
-181.562
-204.228
-224.411
-242.393
-258.507
-272.86
-285.429
-296.39
-305.904
-314.033
-320.78
-326.17
-330.218
-333.057
-334.774
-335.443
-335.114
-333.71
-331.428
-328.084
-323.652
-318.517
-312.389
-305.036
-296.502
-286.845
-276.193
-264.45
-251.54
-237.362
-221.687
-204.539
-185.616
-164.718
-142.201
-117.867
-91.5643
-63.0435
-32.3349
0.692584
35.9997
72.5239
111.502
151.969
193.353
234.946
275.794
314.956
351.403
384.356
412.818
436.034
453.464
464.636
469.251
467.225
458.701
443.761
422.862
396.644
365.857
331.517
294.591
255.798
215.786
175.561
135.958
97.387
60.3466
24.7758
-7.97866
-39.2221
-68.6953
-96.1558
-121.704
-145.444
-167.56
-188.697
-208.166
-226.43
-243.613
-259.681
-274.687
-288.523
-301.211
-312.719
-322.961
-331.836
-339.233
-345.082
-349.296
-351.788
-352.531
-351.608
-348.874
-344.333
-337.867
-329.776
-319.851
-307.881
-294.785
-279.082
-261.962
-243.343
-222.649
-200.581
-176.671
436.001
462.907
484.972
501.544
512.24
516.874
515.199
507.131
492.816
472.636
446.825
416.053
381.279
342.792
301.626
258.226
213.698
168.452
123.565
79.7532
37.3431
-3.80584
-43.5162
-80.438
-114.542
-146.312
-175.995
-202.763
-227.304
-249.488
-269.435
-287.242
-303.09
-317.119
-329.405
-340.045
-349.155
-356.85
-363.2
-368.277
-372.15
-374.813
-376.362
-376.655
-375.317
-373.231
-369.74
-364.882
-358.564
-350.695
-341.251
-330.244
-317.31
-302.568
-285.584
-266.603
-245.409
-222.201
-196.654
-168.455
-138.074
-105.28
-70.1792
-33.2408
5.39039
45.7115
87.0667
129.045
171.258
213.162
254.212
293.841
331.516
366.642
398.744
427.283
451.828
471.99
487.234
497.033
500.845
498.459
489.867
475.314
455.038
429.506
399.255
364.907
327.04
286.304
243.289
198.857
153.501
107.824
62.2939
17.4429
-26.0071
-67.7007
-107.108
-143.748
-177.276
-207.408
-234.304
-258.195
-279.103
-297.247
-312.983
-326.512
-338.029
-347.712
-355.75
-362.236
-367.263
-370.873
-373.08
-373.901
-373.348
-371.155
-368.183
-364.054
-358.698
-352.082
-344.188
-335.057
-324.658
-312.973
-300.025
-285.708
-270.061
-253.039
-234.649
-214.915
-193.42
-169.945
-144.349
-116.647
-86.6744
-54.4117
-20.0388
16.3711
54.6045
94.4424
135.466
177.055
219.009
260.63
301.146
340.043
376.52
409.682
438.681
462.731
481.273
493.608
499.461
498.51
490.832
476.432
455.498
428.511
396.157
359.298
318.844
275.859
231.175
185.571
139.939
95.0692
51.222
8.98548
-31.0461
-68.5893
-103.228
-134.97
-163.986
-190.332
-214.12
-235.581
-254.909
-272.101
-287.144
-300.311
-311.7
-321.229
-329.419
-336.649
-342.741
-347.291
-350.371
-351.955
-352.178
-351.485
-350.077
-348.008
-344.575
-340.076
-334.551
-327.977
-320.722
-312.594
-303.034
-291.755
-278.73
-264.016
-247.777
-229.656
-209.647
-187.779
-163.978
-138.267
-110.663
-81.0252
-49.3686
-16.0603
18.9661
55.5544
93.5745
132.907
172.882
213.194
253.352
292.783
330.669
366.381
399.036
427.83
451.819
470.237
482.29
487.533
485.796
477.266
462.021
440.508
413.376
381.385
345.263
305.896
263.989
220.153
175.119
130.156
86.4403
43.7323
2.9574
-34.9291
-69.6677
-101.873
-131.8
-159.23
-184.385
-206.988
-227.01
-244.837
-260.826
-275.055
-287.487
-298.319
-307.719
-315.764
-322.433
-327.748
-331.71
-334.476
-336.123
-336.76
-336.393
-334.971
-332.679
-329.358
-324.913
-319.825
-313.782
-306.493
-297.997
-288.375
-277.792
-266.138
-253.342
-239.298
-223.75
-206.742
-187.971
-167.124
-144.738
-120.53
-94.3349
-65.8348
-35.1079
-1.95342
33.6217
70.5129
109.978
151.027
193.113
235.503
277.198
317.224
354.541
388.312
417.497
441.292
459.174
470.642
475.369
473.289
464.54
449.203
427.733
400.824
369.253
334.087
296.364
256.817
216.023
175.098
134.945
95.9145
58.5858
22.7355
-10.3009
-41.6129
-71.1441
-98.5852
-124.071
-147.703
-169.654
-190.81
-210.156
-228.336
-245.479
-261.513
-276.521
-290.357
-303.063
-314.61
-324.903
-333.834
-341.286
-347.188
-351.451
-353.977
-354.761
-353.857
-351.151
-346.623
-340.166
-332.097
-322.198
-310.16
-297.206
-281.356
-264.27
-245.704
-224.921
-202.874
-178.858
440.188
467.657
490.26
507.265
518.251
523.04
521.378
513.165
498.532
477.915
451.532
420.052
384.591
345.307
303.376
259.15
213.906
167.879
122.338
78.0195
35.2457
-6.23708
-46.4395
-83.5579
-117.701
-149.498
-179.314
-205.963
-230.466
-252.557
-272.386
-290.05
-305.75
-319.648
-331.806
-342.328
-351.327
-358.928
-365.196
-370.205
-374.037
-376.66
-378.218
-378.518
-377.11
-375.186
-371.757
-366.996
-360.766
-352.986
-343.627
-332.759
-319.929
-305.333
-288.399
-269.504
-248.351
-225.24
-199.75
-171.484
-141.062
-108.132
-72.798
-35.6175
3.31764
44.0457
85.8535
128.335
171.104
213.599
255.277
295.536
333.848
369.594
402.297
431.397
456.459
477.11
492.777
502.911
506.883
504.506
495.746
480.902
460.199
434.128
403.258
368.247
329.67
288.205
244.419
199.284
153.234
106.91
60.7643
15.329
-28.6059
-70.7324
-110.513
-147.415
-181.081
-211.184
-237.978
-261.736
-282.466
-300.373
-315.895
-329.224
-340.556
-350.067
-357.96
-364.322
-369.253
-372.781
-374.922
-375.689
-375.065
-372.731
-369.826
-365.712
-360.37
-353.774
-345.896
-336.789
-326.434
-314.787
-301.889
-287.631
-272.044
-255.096
-236.821
-217.258
-195.905
-172.54
-147.007
-119.352
-89.3549
-56.9938
-22.4636
14.1668
52.7216
92.9345
134.47
176.614
219.225
261.593
302.853
342.557
379.85
413.824
443.563
468.257
487.334
500.041
506.107
505.166
497.357
482.651
461.216
433.569
400.423
362.693
321.312
277.439
231.905
185.473
139.09
93.6336
49.3166
6.59204
-33.7918
-71.5746
-106.343
-138.137
-167.125
-193.378
-217.044
-238.366
-257.587
-274.647
-289.49
-302.49
-313.769
-323.161
-331.227
-338.378
-344.444
-348.922
-351.939
-353.445
-353.597
-352.823
-351.487
-349.375
-345.908
-341.449
-336.004
-329.483
-322.33
-314.304
-304.832
-293.618
-280.685
-266.042
-249.931
-231.928
-212.014
-190.18
-166.372
-140.655
-113.058
-83.3758
-51.5952
-18.1516
17.0611
53.9185
92.2572
132.007
172.468
213.368
254.179
294.349
333.01
369.516
402.983
432.542
457.219
476.213
488.647
494.078
492.298
483.579
467.941
445.873
418.069
385.327
348.4
308.221
265.518
220.871
174.977
129.204
85.0015
41.7262
0.471921
-37.6557
-72.4869
-104.675
-134.645
-162.083
-187.239
-209.761
-229.595
-247.244
-263.11
-277.209
-289.491
-300.188
-309.47
-317.437
-324.038
-329.284
-333.158
-335.854
-337.439
-338.066
-337.732
-336.21
-333.915
-330.6
-326.154
-321.112
-315.148
-307.926
-299.477
-289.891
-279.377
-267.805
-255.126
-241.222
-225.814
-208.95
-190.336
-169.541
-147.308
-123.245
-97.1856
-68.7241
-37.9966
-4.7274
31.1026
68.3937
108.355
150.003
192.817
236.035
278.632
319.539
357.757
392.403
422.346
446.742
465.098
476.878
481.721
479.585
470.61
454.851
432.781
405.146
372.752
336.718
298.164
257.849
216.223
174.567
133.853
94.3356
56.7393
20.5887
-12.7295
-44.0985
-73.6944
-101.109
-126.525
-150.041
-171.79
-193.004
-212.2
-230.292
-247.398
-263.397
-278.415
-292.247
-304.966
-316.555
-326.9
-335.888
-343.4
-349.357
-353.672
-356.236
-357.008
-356.188
-353.505
-348.984
-342.534
-334.492
-324.613
-312.494
-299.719
-283.676
-266.655
-248.152
-227.246
-205.258
-181.093
444.512
472.554
495.725
513.188
524.474
529.426
527.781
519.421
504.451
483.381
456.401
424.168
388.007
347.881
305.166
260.064
214.097
167.24
121.016
76.1716
33.0494
-8.75289
-49.5045
-86.8262
-120.991
-152.814
-182.804
-209.249
-233.697
-255.692
-275.402
-292.922
-308.468
-322.235
-334.25
-344.604
-353.348
-360.507
-365.982
-369.644
-371.303
-370.648
-367.659
-362.288
-354.821
-348.175
-342.68
-337.701
-334.163
-331.53
-328.716
-325.123
-318.904
-308.108
-291.328
-272.549
-251.391
-228.405
-202.978
-174.605
-144.149
-111.078
-75.5118
-38.0886
1.14909
42.2928
84.5711
127.574
170.918
214.03
256.359
297.271
336.248
372.633
405.955
435.634
461.231
482.389
498.506
508.988
513.139
510.713
501.795
486.656
465.504
438.857
407.325
371.614
332.295
290.069
245.477
199.636
152.884
105.936
59.18
13.1654
-31.2288
-73.76
-113.85
-150.923
-184.608
-214.437
-240.706
-263.577
-282.795
-298.188
-309.913
-317.992
-322.716
-324.547
-324.035
-321.92
-318.783
-315.631
-313.057
-311.524
-311.473
-312.253
-313.892
-315.903
-318.02
-319.843
-320.998
-320.682
-318.181
-312.711
-303.237
-289.53
-273.974
-257.078
-238.901
-219.51
-198.297
-175.042
-149.592
-121.994
-91.9919
-59.5426
-24.8817
11.971
50.8545
91.4188
133.454
176.155
219.429
262.569
304.584
345.106
383.238
418.055
448.564
473.937
493.572
506.673
512.949
511.995
504.071
489.053
467.096
438.761
404.772
366.127
323.769
278.985
232.59
185.298
138.157
92.115
47.3063
4.05541
-36.6606
-74.6567
-109.5
-141.241
-170.061
-196.02
-219.314
-240.113
-258.611
-274.601
-287.857
-298.519
-306.829
-313.584
-318.925
-322.046
-322.655
-322.315
-321.122
-319.524
-319.666
-320.143
-318.991
-318.468
-319.567
-320.435
-320.326
-319.445
-316.901
-312.546
-305.639
-295.37
-282.517
-267.884
-251.923
-234.071
-214.271
-192.464
-168.635
-142.912
-115.345
-85.6186
-53.7771
-20.1914
15.1803
52.3016
90.9217
131.096
172.015
213.503
254.966
295.891
335.347
372.67
406.99
437.346
462.752
482.353
495.194
500.812
498.989
490.088
474.045
451.402
422.896
389.379
351.616
310.598
267.072
221.576
174.765
128.104
83.4556
39.6076
-2.13885
-40.4551
-75.3599
-107.491
-137.473
-164.819
-189.827
-212.081
-231.433
-248.482
-263.641
-276.789
-287.797
-296.895
-304.223
-309.793
-313.909
-316.572
-318.489
-319.879
-321.02
-321.519
-321.09
-321.007
-320.676
-319.744
-318.349
-316.251
-312.907
-307.864
-300.741
-291.333
-280.867
-269.366
-256.807
-243.054
-227.813
-211.102
-192.678
-171.924
-149.874
-125.983
-100.094
-71.6952
-40.9836
-7.62902
28.4349
66.1696
106.631
148.893
192.458
236.543
280.068
321.96
361.07
396.629
427.369
452.387
471.239
483.349
488.31
486.115
476.916
460.71
438.013
409.611
376.357
339.404
299.987
258.894
216.381
173.959
132.675
92.6438
54.8113
18.3368
-15.2682
-46.6766
-76.3516
-103.734
-129.077
-152.474
-173.97
-195.296
-214.292
-232.279
-249.341
-265.297
-280.328
-294.163
-306.899
-318.54
-328.944
-337.997
-345.571
-351.588
-355.946
-358.499
-358.98
-356.711
-353.033
-347.999
-341.802
-334.394
-325.892
-314.884
-302.29
-285.987
-269.086
-250.656
-229.6
-207.748
-183.368
448.978
477.596
501.37
519.32
530.917
536.034
534.414
525.906
510.575
489.036
461.438
428.4
391.528
350.51
306.999
260.96
214.273
166.523
119.589
74.2021
30.7601
-11.4629
-52.6632
-90.2848
-124.342
-156.167
-186.394
-212.51
-236.518
-255.898
-265.415
-249.011
-216.15
-184.358
-155.916
-130.573
-108.147
-88.5039
-71.4911
-57.8735
-48.1401
-42.5104
-40.5875
-42.8314
-48.9077
-57.5436
-68.5503
-81.9566
-97.8216
-116.263
-137.485
-160.952
-187.144
-212.323
-230.037
-234.241
-232.512
-224.41
-206.268
-177.861
-147.429
-114.145
-78.3034
-40.6321
-1.10211
40.4593
83.2215
126.755
170.696
214.449
257.453
299.04
338.711
375.761
409.729
440.002
466.153
487.846
504.434
515.288
519.626
517.147
508.051
492.597
470.965
443.723
411.498
375.078
334.998
292.021
246.608
200.073
152.623
105.054
57.6812
11.0817
-33.7076
-76.4879
-116.672
-153.487
-185.967
-211.913
-228.898
-233.508
-222.576
-199.666
-175.917
-153.793
-134.207
-117.567
-103.832
-93.048
-85.0841
-79.7204
-76.8676
-76.3576
-77.9988
-81.638
-87.2623
-95.1229
-105.249
-117.806
-132.952
-150.364
-169.503
-189.676
-208.309
-221.587
-227.685
-229.609
-226.675
-217.536
-200.613
-177.518
-152.1
-124.559
-94.5486
-62.0387
-27.2421
9.798
48.9983
89.9293
132.464
175.714
219.658
263.581
306.378
347.725
386.716
422.382
453.683
479.763
499.977
513.49
519.986
518.951
510.928
495.589
473.078
444.027
409.145
369.572
326.195
280.499
233.222
185.08
137.207
90.6011
45.303
1.58288
-39.2904
-77.3344
-112.012
-143.323
-171.265
-195.313
-214.638
-227.849
-233.517
-230.007
-217.127
-199.956
-183.606
-169.258
-156.764
-144.946
-134.42
-126.372
-121.098
-119.117
-119.855
-121.439
-123.359
-127.186
-133.985
-142.639
-152.942
-165.24
-178.027
-191.314
-204.898
-217.213
-224.959
-229.483
-229.761
-225.082
-213.972
-194.63
-170.738
-144.993
-117.488
-87.7534
-55.8639
-22.1468
13.3701
50.7481
89.6183
130.228
171.581
213.659
255.748
297.44
337.699
375.83
411.031
442.205
468.372
488.606
501.881
507.683
505.772
496.703
480.235
456.977
427.738
393.412
354.781
312.915
268.524
222.235
174.5
126.89
81.9647
37.5579
-4.51411
-42.9639
-77.8433
-109.669
-139.339
-165.996
-189.755
-209.364
-223.454
-231.985
-234.926
-231.137
-220.935
-207.168
-193.664
-181.481
-171.112
-162.881
-157.174
-153.258
-151.392
-150.946
-151.954
-154.152
-158.513
-164.679
-172.912
-181.774
-191.367
-201.825
-212.293
-220.908
-225.973
-228.852
-229.618
-227.65
-222.007
-211.469
-194.814
-174.257
-152.33
-128.652
-103.013
-74.6846
-44.0455
-10.65
25.6328
63.8501
104.804
147.691
192.029
237.021
281.504
324.437
364.478
400.994
432.568
458.231
477.601
490.06
495.14
492.883
483.459
466.784
443.429
414.22
380.07
342.141
301.832
259.952
216.493
173.268
131.408
90.8296
52.7958
15.9438
-17.9366
-49.3533
-79.13
-106.43
-131.668
-154.947
-176.116
-197.646
-216.365
-234.138
-250.793
-265.12
-273.897
-260.786
-231.757
-202.585
-175.578
-151.659
-131.362
-115.102
-103.289
-96.4307
-94.3948
-98.2059
-107.075
-121.04
-140.216
-163.891
-192.734
-227.976
-265.745
-274.04
-262.962
-247.648
-230.554
-210.276
-185.536
453.588
482.778
507.195
525.663
537.58
542.866
541.281
532.628
516.905
494.883
466.647
432.746
395.16
353.187
308.878
261.826
214.441
165.726
118.057
72.0707
28.3096
-14.6261
-55.549
-93.7967
-127.508
-157.141
-168.416
-136.282
-99.6994
-65.4184
-34.0955
-17.479
-11.6037
-7.71704
-4.69123
-2.43352
-0.910977
-0.0948146
0.117912
0.113115
0.099702
0.0836792
0.0571644
0.0227365
-0.0246767
-0.091792
-0.196639
-0.373868
-0.643951
-1.11123
-2.0476
-3.754
-7.1193
-13.8575
-27.7947
-52.3584
-80.9582
-111
-138.178
-145.177
-137.083
-116.151
-81.2073
-43.3142
-3.42945
38.5527
81.8255
125.885
170.438
214.854
258.559
300.837
341.235
378.968
413.611
444.497
471.218
493.472
510.563
521.826
526.363
523.825
514.535
498.756
476.625
448.768
415.824
378.686
337.816
294.074
247.778
200.528
152.355
104.204
56.2735
9.15591
-35.9096
-78.5051
-115.943
-141.055
-140.88
-115.762
-87.3474
-60.968
-40.6305
-27.7933
-18.9417
-12.7051
-8.43763
-5.6222
-3.82391
-2.74939
-2.1506
-1.84768
-1.72001
-1.69583
-1.73971
-1.87715
-2.10267
-2.45553
-2.98791
-3.79903
-5.03834
-6.98785
-10.0681
-15.0353
-23.2037
-36.348
-54.6352
-75.7177
-98.4418
-120.652
-137.868
-142.279
-137.239
-122.956
-97.1138
-64.521
-29.5238
7.67774
47.0944
88.3958
131.455
175.248
219.874
264.61
308.2
350.429
390.3
426.826
458.949
485.755
506.564
520.498
527.228
526.109
517.985
502.304
479.214
449.425
413.63
373.104
328.713
282.118
233.943
184.844
136.319
89.3503
43.7149
-0.379863
-41.3088
-78.9515
-111.25
-134.985
-144.935
-134.21
-112.829
-90.3404
-68.853
-50.6688
-37.5846
-28.392
-21.2917
-15.7894
-11.4309
-8.23242
-6.35073
-5.3597
-4.99043
-4.80334
-4.4379
-4.39792
-5.0415
-5.56466
-5.808
-6.42813
-7.53577
-9.13853
-11.6036
-15.3157
-21.2456
-30.734
-44.7471
-62.5255
-82.7681
-104.785
-126.345
-140.858
-141.651
-134.271
-117.463
-89.8094
-57.8599
-24.047
11.6062
49.2179
88.3022
129.352
171.144
213.82
256.507
298.979
340.078
379.007
415.113
447.108
474.061
494.941
508.678
514.644
512.618
503.398
486.481
462.596
432.608
397.466
357.97
315.24
270.034
223.035
174.305
125.609
80.8441
35.862
-6.41082
-44.8325
-79.1027
-108.457
-131.866
-143.978
-138.845
-120.494
-100.781
-81.4797
-63.4848
-48.3995
-37.0238
-29.1507
-23.2998
-18.5823
-14.92
-12.2041
-10.1998
-8.72324
-7.65152
-7.02939
-6.9249
-7.19594
-7.82549
-8.90568
-10.5001
-12.4948
-15.3633
-19.7205
-26.0582
-35.2005
-47.2455
-61.3248
-77.0216
-94.1885
-112.199
-129.102
-140.484
-141.514
-136.765
-125.467
-105.402
-77.5684
-47.0774
-13.7156
22.7011
61.4648
102.889
146.401
191.527
237.461
282.95
326.948
367.966
405.499
437.95
464.275
484.19
497.016
502.217
499.905
490.245
473.077
449.028
418.974
383.888
344.923
303.689
261.031
216.552
172.481
130.035
88.8533
50.6815
13.432
-20.6481
-52.0201
-81.9054
-108.978
-133.636
-154.82
-168.046
-161.338
-134.366
-106.691
-78.9156
-51.2336
-25.3517
-11.8143
-7.50946
-4.87069
-3.05701
-1.76195
-0.908724
-0.412677
-0.176265
-0.108769
-0.0845661
-0.152716
-0.258168
-0.379538
-0.51175
-0.657222
-0.796959
-0.889838
-1.72405
-19.9584
-51.5969
-87.4187
-127.146
-169.969
-175.096
458.345
488.093
513.201
532.223
544.466
549.93
548.385
539.596
523.441
500.923
472.038
437.205
398.91
355.903
310.807
262.653
214.618
164.807
116.327
69.8032
25.878
-17.7834
-57.2586
-77.8124
-56.1294
-32.7857
-11.8245
-5.27013
-1.85922
0.162781
0.469056
0.427172
0.38055
0.330002
0.284765
0.244257
0.203846
0.153096
0.125141
0.114809
0.0997044
0.0868404
0.0748142
0.0612343
0.0481671
0.0355004
0.0250431
0.0135444
0.00284705
-0.00552431
-0.0161546
-0.0295233
-0.0491677
-0.0934435
-0.210268
-0.499182
-1.25562
-3.33356
-9.11464
-23.759
-43.3646
-60.5135
-59.2645
-39.3759
-5.9781
36.558
80.3569
124.974
170.15
215.249
259.677
302.664
343.818
382.246
417.597
449.112
476.418
499.261
516.888
528.589
533.34
530.658
521.191
505.08
482.434
453.922
420.214
382.314
340.617
296.086
248.834
200.879
151.935
103.152
54.5643
7.29535
-34.2525
-58.8509
-52.4898
-35.7381
-19.1591
-9.34603
-3.64154
-0.799548
0.0641897
0.0689992
0.0640149
0.0477987
0.0379198
0.0318106
0.0278043
0.0244567
0.0218213
0.0195426
0.0168924
0.0141302
0.0116449
0.00795844
0.00437574
-0.000430002
-0.0076133
-0.0177907
-0.0323247
-0.0570302
-0.0965759
-0.159704
-0.27271
-0.473753
-0.860084
-1.63932
-3.19499
-6.34516
-12.9244
-25.2126
-40.5575
-55.4643
-61.9243
-50.918
-28.5342
5.61471
45.2403
86.7935
130.351
174.671
219.95
265.553
309.922
353.085
393.864
431.296
464.275
491.878
513.317
527.692
534.658
533.462
525.258
509.211
485.531
454.983
418.225
376.676
331.156
283.727
234.697
184.667
135.471
88.0195
41.9788
-1.76453
-38.2499
-58.7281
-54.4001
-41.4644
-27.2817
-16.0661
-8.8826
-4.24484
-1.49246
-0.222826
0.0441043
0.0178469
0.00813209
0.0105845
0.0172492
0.0234271
0.0307156
0.0218972
-0.00938539
-0.0576098
-0.0516049
-0.056623
-0.0973831
-0.113616
-0.0873426
-0.0752963
-0.0757314
-0.0799843
-0.104301
-0.152462
-0.237673
-0.388124
-0.599862
-0.953792
-1.7819
-3.65505
-7.58223
-15.9044
-29.843
-45.6018
-58.9581
-60.574
-47.1626
-23.8453
9.93457
47.7905
87.04
128.465
170.669
213.949
257.205
300.446
342.404
382.157
419.199
452.033
479.79
501.341
515.575
521.736
519.584
510.209
492.796
468.28
437.502
401.558
361.189
317.564
271.609
223.798
173.969
123.912
79.8047
34.3856
-7.00868
-40.5046
-58.2713
-54.7375
-43.166
-30.1421
-18.3885
-10.7297
-5.94624
-2.84922
-0.969946
-0.116466
0.019932
0.0156719
0.00887832
-0.0190461
-0.0360746
-0.0482216
-0.0554178
-0.0572549
-0.0558563
-0.0525356
-0.0448992
-0.041948
-0.0487978
-0.069095
-0.0940637
-0.120086
-0.157406
-0.217483
-0.307982
-0.439186
-0.636134
-0.992258
-1.62225
-2.73479
-4.78346
-8.56289
-15.7882
-27.3819
-40.5899
-53.5324
-61.5587
-56.4777
-41.1433
-15.9223
19.8854
59.0521
100.899
145.035
190.952
237.87
284.396
329.516
371.541
410.146
443.517
470.524
491.007
504.222
509.543
507.174
497.287
479.595
454.816
423.875
387.818
347.745
305.554
262.148
216.535
171.575
128.566
86.8153
48.6295
10.9532
-22.9401
-51.9476
-72.567
-67.0123
-51.8384
-35.4545
-18.2474
-8.26046
-4.59669
-2.20654
-0.45634
0.46321
0.46542
0.450137
0.442715
0.414538
0.37908
0.331131
0.269562
0.193798
0.10607
0.00859828
-0.071321
-0.147288
-0.247625
-0.36245
-0.487756
-0.625076
-0.759171
-0.860458
-1.03498
-1.48359
-1.77458
-2.01036
-2.17678
-2.60961
-15.864
463.257
493.532
519.393
539
551.575
557.228
555.733
546.822
530.182
507.162
477.617
441.775
402.785
358.646
312.81
263.403
214.734
163.799
114.597
67.6334
24.4122
5.25916
1.43097
1.25014
1.13998
0.931641
0.84817
0.748269
0.658327
0.556476
0.473991
0.417884
0.369579
0.318505
0.273542
0.233353
0.192979
0.147678
0.121384
0.109651
0.0952923
0.0831424
0.0718848
0.059033
0.0464444
0.0349347
0.0244225
0.0143077
0.00514111
-0.00144357
-0.00575645
-0.00847944
-0.00969865
-0.0109389
-0.0215941
-0.0260017
-0.0234679
-0.0247666
-0.0188954
-0.0158812
0.00800885
0.102049
0.557162
2.8164
12.9973
41.1084
79.0656
123.962
169.813
215.615
260.795
304.518
346.466
385.599
421.688
453.845
481.748
505.204
523.398
535.568
540.566
537.686
528.008
511.546
488.331
459.098
424.545
385.83
343.232
297.855
249.47
200.725
150.881
101.697
54.9149
20.6375
6.1531
0.584922
0.155438
0.0956024
0.131119
0.107633
0.0864792
0.070569
0.0872743
0.0802695
0.0697805
0.062299
0.0569619
0.0526737
0.0495411
0.0469708
0.0450075
0.0434036
0.0418157
0.0402559
0.0389165
0.0373965
0.0369554
0.0369556
0.0371097
0.0377367
0.0387775
0.039306
0.0398485
0.0405885
0.041736
0.0439123
0.0461754
0.0491228
0.0532219
0.0582885
0.0665059
0.0827324
0.118826
0.205246
0.459673
1.43032
5.36174
19.7344
48.4485
85.4243
129.245
174.074
219.958
266.43
311.554
355.64
397.306
435.651
469.473
497.952
520.087
534.945
542.161
540.809
532.56
516.092
491.752
460.373
422.588
380.029
333.354
285.043
235.038
183.958
133.995
86.6765
44.4404
17.2625
5.38022
0.596924
0.189838
0.170087
0.104131
0.0822054
0.0835467
0.0758189
0.0667444
0.0620388
0.0634095
0.0561882
0.0502285
0.047325
0.0462973
0.0456919
0.0445653
0.0403176
0.0335107
0.0286813
0.0304485
0.0310393
0.0274339
0.0260113
0.0282368
0.0301872
0.0323784
0.0357954
0.0391079
0.0421939
0.0448171
0.0457096
0.0489346
0.0532452
0.0564304
0.0541312
0.0523264
0.0577157
0.0764424
0.109823
0.201773
0.518626
1.77547
6.73028
22.9495
50.876
86.078
127.713
170.236
214.07
257.871
301.839
344.599
385.21
423.2
456.914
485.498
507.735
522.499
528.853
526.504
517.027
499.08
473.907
442.263
405.488
364.188
319.603
272.891
224.256
173.164
122.135
79.4107
38.919
15.6999
5.06987
0.761413
0.331082
0.268331
0.14265
0.103103
0.0931532
0.0901304
0.0790374
0.0730367
0.0725096
0.068731
0.0662561
0.0568008
0.0425178
0.0331068
0.0298894
0.0301685
0.0319063
0.0334519
0.034642
0.0368909
0.037823
0.0341531
0.0273853
0.02343
0.0231187
0.0231128
0.0245599
0.0281064
0.0318061
0.0333752
0.0354694
0.0374667
0.0405073
0.0431455
0.045389
0.0503263
0.0664403
0.1005
0.162653
0.334018
0.82213
2.63248
9.29143
28.9369
59.414
98.8607
143.589
190.284
238.228
285.848
332.095
375.193
414.939
449.277
476.981
498.057
511.685
517.123
514.697
504.587
486.347
460.797
428.929
391.875
350.606
307.417
263.321
216.453
170.74
127.201
84.9752
47.9258
16.8628
6.32397
1.94543
0.635441
0.60298
0.566132
0.501461
0.539582
0.536348
0.499937
0.496187
0.459845
0.466684
0.45174
0.431967
0.422865
0.394722
0.35988
0.313452
0.254415
0.182466
0.0999797
0.00897503
-0.0676552
-0.142478
-0.238036
-0.346946
-0.466017
-0.595714
-0.72363
-0.831496
-1.00831
-1.39512
-1.67355
-1.89931
-2.06783
-2.23414
-2.69175
468.336
499.079
525.775
546.002
558.91
564.72
563.328
554.331
537.127
513.599
483.395
446.451
406.807
361.391
314.809
264.04
215.076
162.724
109.99
65.011
24.8414
7.70287
2.09823
1.27087
1.09363
0.923172
0.810626
0.713303
0.621751
0.530834
0.454284
0.398971
0.352247
0.303617
0.260899
0.222622
0.184081
0.142949
0.117683
0.104863
0.0909714
0.0790482
0.068033
0.0559874
0.0442394
0.0333423
0.0235953
0.014175
0.00558885
-0.000644769
-0.00477777
-0.0082642
-0.009619
-0.0117747
-0.0210609
-0.0251885
-0.0224835
-0.0224968
-0.019702
-0.0142583
0.00642553
0.0922888
0.503165
2.61714
12.0665
39.745
77.8648
122.872
169.42
215.805
261.878
306.35
349.157
389.02
425.887
458.692
487.196
511.295
530.078
542.75
547.999
544.868
534.959
518.108
494.25
464.225
428.722
389.131
345.475
299.127
249.479
199.886
148.996
99.2153
52.4589
19.3206
5.65948
0.541458
0.158602
0.104205
0.121475
0.103808
0.0845408
0.0710267
0.0815013
0.0761146
0.0671275
0.0600777
0.0548915
0.0507435
0.0476804
0.0451623
0.0432141
0.0416452
0.0401422
0.0386731
0.0374099
0.0363173
0.0358125
0.0357966
0.0358986
0.0364691
0.0374679
0.0379394
0.0384362
0.0391879
0.0402193
0.0421942
0.0442361
0.0467535
0.0503417
0.0550782
0.0635372
0.0799605
0.114222
0.194726
0.441822
1.37097
5.12185
18.9656
47.2177
83.6034
127.989
173.432
220.047
267.315
313.251
358.272
400.77
439.961
474.596
503.898
526.752
542.11
549.496
547.798
539.643
522.702
497.701
465.443
426.62
382.956
335.032
285.701
234.666
182.579
131.754
84.2418
42.4137
16.2023
5.00569
0.58008
0.191624
0.163907
0.100977
0.0844249
0.0813719
0.0737756
0.0650649
0.0603018
0.0603682
0.0544392
0.0488722
0.0457952
0.0448058
0.0441436
0.0426734
0.038554
0.0323402
0.0280911
0.0291661
0.0300377
0.0274793
0.0257088
0.0277572
0.0298508
0.0318945
0.0347405
0.0378132
0.0408217
0.043575
0.0448832
0.0481819
0.0521121
0.0543046
0.0524446
0.0512873
0.0572722
0.0747518
0.106135
0.191922
0.5035
1.71793
6.47591
22.2002
49.842
84.953
126.993
169.814
214.227
258.572
303.216
346.736
388.154
427.087
461.682
491.127
514.053
529.342
535.905
533.304
523.73
505.183
479.308
446.736
409.117
366.811
321.139
273.684
224.402
171.95
119.968
77.8164
37.601
14.8969
4.81044
0.7587
0.318948
0.267318
0.145442
0.104769
0.0927849
0.0866732
0.077317
0.071698
0.0706282
0.0675107
0.0643262
0.0553301
0.0416542
0.0318721
0.0286359
0.0295575
0.0312916
0.0326787
0.0342523
0.0363313
0.0370683
0.0332362
0.0264659
0.0225057
0.0221796
0.0220133
0.0233349
0.0271678
0.0309302
0.0328673
0.0346955
0.0369651
0.039987
0.0431072
0.0459355
0.0525667
0.0671659
0.0954276
0.152886
0.302307
0.806318
2.47594
8.35843
27.2851
57.4405
97.2641
142.089
189.534
238.493
287.258
334.697
378.893
419.874
455.239
483.645
505.338
519.408
524.961
522.477
512.147
493.338
466.971
434.15
396.068
353.47
309.298
264.801
216.473
169.695
124.52
81.3115
45.0923
17.1886
7.02977
1.93849
0.639651
0.57886
0.543629
0.500481
0.512732
0.505941
0.476426
0.469658
0.437032
0.442704
0.429952
0.411115
0.400689
0.373876
0.340547
0.29636
0.240464
0.172727
0.0952674
0.0103686
-0.0636695
-0.136997
-0.227855
-0.33098
-0.443861
-0.566442
-0.688971
-0.80098
-0.977322
-1.31683
-1.57939
-1.79456
-1.9621
-2.13533
-2.4987
473.585
504.703
532.357
553.239
566.483
572.406
571.165
562.114
544.27
520.238
489.383
451.257
410.928
364.039
317.022
264.677
208.261
121.033
40.1237
10.0918
1.97166
1.57135
1.30198
1.15117
1.00953
0.872575
0.769076
0.677923
0.590395
0.505941
0.433498
0.379698
0.334665
0.288518
0.247945
0.211403
0.174773
0.137485
0.113398
0.0999911
0.0866844
0.0751899
0.0645274
0.053118
0.0420999
0.0316894
0.0223721
0.0134728
0.00550042
-0.000428778
-0.00448409
-0.00751776
-0.00925827
-0.0114319
-0.0196236
-0.0232023
-0.0221257
-0.0231384
-0.0228008
-0.0225765
-0.0231829
-0.018764
-0.00216211
0.0767695
0.436709
2.62382
15.8282
65.8493
138.302
206.372
261.821
308.061
351.842
392.452
430.174
463.643
492.768
517.561
536.948
550.142
555.621
552.334
542.111
524.813
500.241
469.33
432.768
392.192
347.451
300.008
247.211
184.045
102.049
36.9493
8.86123
0.49794
0.25675
0.166757
0.102267
0.0802471
0.103648
0.0949152
0.0804021
0.0699412
0.076503
0.0719789
0.0641219
0.0575581
0.0525981
0.0486384
0.0456955
0.0432482
0.0413465
0.0398565
0.0384177
0.0369901
0.0358138
0.0348602
0.0344156
0.0343638
0.0344017
0.0349572
0.0359412
0.0363745
0.0368246
0.0375851
0.0385022
0.0402549
0.0420909
0.0439421
0.0463767
0.0485814
0.0516376
0.0558003
0.0609998
0.0654604
0.0794423
0.126282
0.275034
0.916548
4.26729
20.7517
73.7056
143.209
210.81
267.108
314.888
360.863
404.299
444.197
479.72
509.824
533.327
549.175
556.828
554.738
546.669
529.189
503.568
470.399
430.49
385.646
336.418
285.649
229.855
156.093
76.1624
26.4516
5.62818
0.585573
0.357662
0.181201
0.103254
0.100743
0.081581
0.0745452
0.0730728
0.0688311
0.0622699
0.0580991
0.0575095
0.0523948
0.0472393
0.0441147
0.0433723
0.0428214
0.040957
0.036787
0.0309617
0.0267436
0.0273419
0.0283025
0.0265403
0.0249764
0.026658
0.0287095
0.030671
0.033472
0.0362995
0.0392907
0.0422926
0.0438289
0.0473367
0.0511669
0.0525148
0.0495018
0.0464993
0.0469884
0.0508123
0.0524237
0.0524124
0.0676379
0.122167
0.291558
1.00837
4.66911
21.8382
72.6591
138.31
203.343
257.323
304.403
348.769
390.946
430.827
466.269
496.597
520.254
536.049
542.786
540.016
530.376
511.195
484.635
451.085
412.666
369.287
322.497
273.749
218.492
139.729
60.9663
22.415
4.80288
0.876347
0.534845
0.233896
0.114781
0.107939
0.0922615
0.0841258
0.0795914
0.0777473
0.0726752
0.0689785
0.0682814
0.0660474
0.0624392
0.0535353
0.0406023
0.0305978
0.0272683
0.028259
0.0302574
0.0317471
0.0336102
0.035553
0.0358768
0.0323196
0.0254803
0.0215405
0.0211145
0.020683
0.0218346
0.0258792
0.0295758
0.0314913
0.0328037
0.0343589
0.0364296
0.0374666
0.0371974
0.0382466
0.0415525
0.0451926
0.0475296
0.0498779
0.0813959
0.157129
0.390171
1.43764
6.64988
32.3942
93.61
168.961
234.674
288.583
337.314
382.572
424.908
461.387
490.51
512.847
527.388
533.051
530.505
519.962
500.57
473.314
439.506
400.404
356.362
311.278
265.52
207.89
133.211
60.1161
19.5709
4.5037
0.772543
0.62546
0.54277
0.54468
0.52354
0.502129
0.472862
0.484349
0.477979
0.453589
0.445308
0.417468
0.419545
0.407391
0.389853
0.378762
0.353295
0.321469
0.279473
0.226595
0.162866
0.0901642
0.0110472
-0.0599735
-0.131242
-0.217463
-0.314953
-0.421747
-0.537495
-0.654771
-0.768375
-0.940898
-1.24136
-1.4876
-1.69214
-1.85675
-2.02784
-2.32149
479.001
510.317
539.146
560.722
574.305
580.3
579.251
570.161
551.602
527.081
495.55
456.125
415.334
366.922
311.327
195.018
63.8109
13.4416
2.32742
1.78223
1.57032
1.38567
1.2056
1.07999
0.951963
0.828153
0.728627
0.642342
0.55847
0.480809
0.41241
0.36043
0.317184
0.273565
0.235118
0.200339
0.165677
0.131667
0.108769
0.0950958
0.0823164
0.0712513
0.0609938
0.0502473
0.0399558
0.0301947
0.0213676
0.0130214
0.00547132
-0.000187287
-0.00405656
-0.0070901
-0.00898498
-0.0113557
-0.0182804
-0.0217277
-0.0208642
-0.0219497
-0.0217591
-0.0222577
-0.0236245
-0.023874
-0.0233361
-0.0209922
-0.00949508
0.0542782
0.449141
2.76148
19.124
91.6778
197.731
288.949
351.621
395.855
434.499
468.625
498.424
523.965
544.007
557.753
563.604
560.216
549.69
531.929
506.608
474.745
437.146
395.431
346.545
276.665
161.811
59.9703
14.0758
0.768752
0.337883
0.204862
0.115918
0.107235
0.0834623
0.0745866
0.0941296
0.088565
0.0766497
0.0679977
0.0719429
0.0680321
0.0611114
0.0549942
0.0502437
0.0464186
0.0435597
0.0411783
0.0393375
0.0379207
0.0365361
0.0351833
0.0341908
0.0332275
0.0328163
0.0327549
0.0327791
0.033316
0.0342299
0.0346874
0.035135
0.0358566
0.0367625
0.0384458
0.0402466
0.0420884
0.0444158
0.0464281
0.0489915
0.0523779
0.0560686
0.0563404
0.0570299
0.061066
0.0616569
0.0832479
0.191106
0.683418
3.72813
22.7085
99.6573
206.994
297.431
361.29
407.591
448.301
484.636
515.655
539.841
556.195
564.24
562.399
554.225
536.12
509.822
475.654
434.542
388.068
331.148
244.536
127.019
42.0606
7.34627
0.962459
0.459912
0.206168
0.135484
0.110762
0.0817393
0.0852135
0.0755807
0.0705411
0.0691845
0.0656637
0.059945
0.0560616
0.0548954
0.050359
0.0456077
0.0423675
0.0413899
0.0407528
0.0389241
0.0356736
0.0299625
0.0258158
0.0259744
0.0268824
0.0256322
0.0242883
0.0256607
0.0276912
0.0294832
0.0322618
0.0347586
0.0378158
0.0407458
0.0426725
0.0458527
0.050152
0.0504601
0.0471489
0.044241
0.0447035
0.0477919
0.0477098
0.043151
0.0424283
0.0477221
0.0549505
0.076923
0.181857
0.651898
3.4608
20.0206
88.0593
186.945
279.682
345.748
393.214
434.192
470.528
501.761
526.208
542.573
549.558
546.949
537.181
517.274
489.961
455.389
416.113
370.234
311.543
218.637
108.43
34.2616
5.1974
1.05199
0.662246
0.228155
0.139626
0.102715
0.0715487
0.0774794
0.0789594
0.0778543
0.0753954
0.0737178
0.0696853
0.0668938
0.0660121
0.063601
0.0597045
0.0511116
0.0391722
0.0294281
0.0261254
0.0269572
0.0290532
0.0306246
0.0322467
0.0340812
0.0341721
0.0309827
0.0244586
0.0206997
0.0200753
0.0195346
0.0207344
0.0248573
0.0287806
0.0306826
0.0317904
0.0331267
0.034931
0.0355925
0.03544
0.0364064
0.0383492
0.0388089
0.0360203
0.0294986
0.0331114
0.0408072
0.0465159
0.0865141
0.25139
1.09122
5.97783
38.5533
142.066
255.494
333.725
386.222
429.993
467.497
497.52
520.561
535.625
541.393
538.762
528.016
507.99
479.734
444.98
404.785
357.458
297.494
190.472
76.81
21.7203
1.93047
0.75561
0.576744
0.566101
0.5282
0.49636
0.506515
0.492418
0.474196
0.451069
0.457355
0.450646
0.429833
0.420794
0.396782
0.396535
0.385111
0.368721
0.357147
0.333032
0.302732
0.262952
0.213082
0.153261
0.0851551
0.0114373
-0.056406
-0.125193
-0.206818
-0.298788
-0.399585
-0.508751
-0.620798
-0.734161
-0.900817
-1.16841
-1.3982
-1.59187
-1.75184
-1.91682
-2.15599
484.785
515.954
546.154
568.494
582.388
588.503
587.587
578.504
559.119
534.047
501.926
461.682
413.579
280.391
102.037
20.3144
2.77857
2.0052
1.7719
1.55268
1.43972
1.29208
1.13796
1.01794
0.897654
0.784056
0.688682
0.607062
0.527227
0.455334
0.390997
0.341108
0.299709
0.258557
0.222206
0.189223
0.156612
0.125499
0.103835
0.0901723
0.0779313
0.0673279
0.0575029
0.0473878
0.037772
0.0285947
0.020266
0.0124223
0.00541691
7.2214e-05
-0.003631
-0.00657158
-0.00858424
-0.0110922
-0.0170879
-0.0202378
-0.0198858
-0.020934
-0.0210714
-0.0212213
-0.0226572
-0.0229105
-0.0234548
-0.0247849
-0.0268416
-0.0305385
-0.0113057
0.0507458
0.460803
3.2947
23.0949
115.549
249.108
359.827
429.792
473.631
503.973
530.304
551.148
565.453
571.824
568.154
557.341
539.15
513.004
479.408
435.594
362.815
228.745
92.4657
23.1989
1.33
0.514065
0.23892
0.0926442
0.104895
0.0838794
0.0907282
0.0773372
0.0720744
0.0867727
0.082879
0.0730021
0.065607
0.0675334
0.0639461
0.057804
0.0521414
0.047646
0.0440154
0.0412719
0.0389916
0.0372259
0.0358487
0.0345296
0.0332491
0.0322279
0.0314342
0.0310427
0.0309876
0.0310037
0.0315131
0.0323251
0.0327506
0.0332167
0.0338903
0.0347858
0.0363977
0.0380864
0.0399462
0.0422009
0.0441735
0.0464823
0.049635
0.0531678
0.053317
0.0537659
0.0557029
0.0512265
0.0481793
0.0497866
0.0590787
0.139923
0.644561
4.21873
28.8515
131.197
271.781
380.445
447.259
489.003
521.089
546.081
563.003
571.451
569.453
561.435
542.729
515.625
479.565
429.623
339.203
189.509
68.2324
14.4705
1.86845
0.758754
0.238036
0.118304
0.107086
0.0981167
0.0948426
0.0772808
0.0792421
0.072191
0.0676862
0.0661127
0.0628674
0.0575166
0.0536237
0.0519414
0.0478065
0.0434072
0.0403564
0.0393088
0.0386038
0.0368127
0.033591
0.0281957
0.024096
0.0245418
0.0253615
0.0244021
0.023312
0.0243933
0.0262776
0.0280686
0.0306538
0.0330014
0.0360456
0.0387737
0.0408335
0.0437079
0.0479465
0.047662
0.0447915
0.0420136
0.0425222
0.0455193
0.0454437
0.041497
0.0401148
0.0422537
0.0415124
0.0368882
0.0379637
0.0492333
0.128736
0.543216
3.11126
19.7596
102.113
233.475
349.183
424.988
473.455
506.125
531.503
548.569
555.672
552.87
543.283
522.521
494.026
455.05
398.479
289.358
149.064
53.7979
11.6299
2.59958
0.907279
0.273898
0.13302
0.0787836
0.0736978
0.0755493
0.064227
0.0710721
0.0746449
0.0748668
0.0726721
0.0707896
0.0668462
0.0639146
0.0628272
0.0605401
0.0565849
0.0485138
0.0374683
0.028391
0.025041
0.0256496
0.0275777
0.0291294
0.0306798
0.0322336
0.0323203
0.0292421
0.0233062
0.0197943
0.019046
0.0184693
0.019599
0.0235581
0.0274607
0.0294565
0.0305004
0.0316865
0.0333588
0.0339081
0.0339401
0.0355184
0.0372998
0.0369778
0.0338183
0.0279288
0.0285285
0.0294171
0.0228721
0.0179678
0.02102
0.0446786
0.164058
0.976118
8.36847
60.4722
205.664
345.656
426.119
473.909
504.628
528.392
544.073
549.879
547.184
536.257
515.387
485.663
447.319
384.568
251.141
104.926
27.0383
1.5562
0.810209
0.62392
0.525028
0.48708
0.508755
0.489829
0.469264
0.475858
0.463688
0.446636
0.428465
0.430745
0.423904
0.406004
0.396708
0.375907
0.373689
0.362974
0.347656
0.335788
0.312998
0.284253
0.246698
0.199809
0.143803
0.0801581
0.0115452
-0.0529564
-0.118915
-0.19597
-0.28251
-0.377389
-0.480146
-0.586892
-0.69845
-0.857754
-1.09731
-1.31085
-1.49346
-1.64737
-1.80362
-2.00025
468.142
515.889
553.316
576.599
590.78
597.105
596.17
587.139
566.965
541.306
499.311
345.655
137.653
26.7672
3.04105
2.29779
1.9471
1.69777
1.60321
1.44304
1.34613
1.21042
1.072
0.957328
0.844148
0.739472
0.648806
0.571587
0.496272
0.429413
0.369167
0.321613
0.282164
0.243482
0.209239
0.178091
0.147554
0.119045
0.0986331
0.0851871
0.0734999
0.0633866
0.0540318
0.0445477
0.035588
0.0271109
0.0191865
0.011841
0.0052934
0.000252654
-0.00327794
-0.0061278
-0.00819892
-0.0107407
-0.0159257
-0.0188728
-0.0189761
-0.0199318
-0.0202374
-0.0202114
-0.0219061
-0.0222251
-0.0229425
-0.0245293
-0.0267248
-0.0319867
-0.0302068
-0.0334907
-0.0246308
0.050911
0.523686
3.83841
24.9058
118.095
265.533
394.851
475.12
525.687
556.09
571.538
578.01
575.15
562.917
541.027
500.195
414.812
269.533
118.806
34.9519
2.75149
0.814631
0.304949
0.0891671
0.078825
0.0477088
0.0804689
0.0750118
0.0822819
0.0731268
0.0696334
0.0803713
0.0772515
0.0689391
0.0625808
0.0631561
0.0598426
0.0543825
0.0491796
0.0449623
0.0415377
0.0389226
0.0367539
0.0350744
0.0337409
0.0324964
0.0312891
0.0302832
0.0295831
0.0292075
0.0291565
0.0291731
0.0296513
0.0303473
0.0307433
0.031233
0.0318404
0.0327136
0.0342129
0.0357327
0.0375179
0.0395738
0.0413743
0.0435463
0.0464979
0.0497324
0.0501871
0.0508853
0.0520192
0.0479643
0.0446665
0.0423061
0.0351035
0.0291122
0.0328776
0.131477
0.75309
5.19496
36.3621
158.215
312.464
433.243
504.373
545.713
567.112
575.906
573.926
565.922
542.588
500.44
407.595
251.426
102.649
27.1469
3.27139
1.35801
0.408053
0.153208
0.0889889
0.0723799
0.0879351
0.0887147
0.0876686
0.0746256
0.0749702
0.0691216
0.0646286
0.0625342
0.0593768
0.0545675
0.0508602
0.0488624
0.0450895
0.0410798
0.0382586
0.0371572
0.0363946
0.0346404
0.0315677
0.0266913
0.0235813
0.0232509
0.0238525
0.0228385
0.0220647
0.0230451
0.0247049
0.0265107
0.028887
0.0311657
0.0340486
0.0365753
0.0385868
0.0413712
0.0450535
0.0446352
0.0420766
0.0394619
0.0399532
0.0427004
0.0427815
0.0396331
0.0382853
0.0399043
0.0388426
0.0340333
0.0302964
0.0229294
0.0182199
0.0307173
0.103568
0.543492
3.32512
21.2189
106.49
255.735
386.798
470.247
519.15
546.18
555.879
553.773
542.077
509.081
446.81
323.242
180.147
71.4205
18.2873
3.59758
1.64123
0.645541
0.201585
0.087681
0.0545889
0.0517635
0.0601468
0.0673396
0.0621841
0.0682747
0.0716533
0.0722211
0.0700808
0.0671586
0.0633855
0.0606652
0.0594289
0.0572196
0.0532902
0.045778
0.035718
0.0274953
0.0239922
0.0243763
0.0260486
0.0275537
0.0290236
0.0303918
0.0303532
0.0274924
0.0221538
0.0188731
0.0180444
0.0174434
0.0185143
0.022157
0.0258288
0.0278233
0.028866
0.0299822
0.0315212
0.0320808
0.0323213
0.0341895
0.0358736
0.035155
0.0322581
0.0275481
0.0275695
0.0268808
0.0203178
0.011783
0.00409122
-0.00875482
-0.017389
0.000403021
0.18179
1.30643
12.3892
91.4458
256.725
407.536
484.919
528.279
550.542
556.851
553.889
540.837
510.058
437.922
296.59
128.714
35.3161
2.36633
0.864197
0.627787
0.510246
0.494796
0.464156
0.452503
0.472888
0.458938
0.443235
0.446412
0.435664
0.419964
0.404442
0.40439
0.397742
0.382204
0.372648
0.354713
0.351009
0.340894
0.326597
0.314664
0.293193
0.266029
0.230708
0.186776
0.134498
0.0751918
0.0114345
-0.0495946
-0.112443
-0.18494
-0.266124
-0.355151
-0.451629
-0.552947
-0.661433
-0.812396
-1.02764
-1.2253
-1.3967
-1.54342
-1.68949
-1.85255
46.468
244.533
436.387
564.683
591.893
604.671
605.368
591.196
488.391
319.137
127.866
25.0129
2.73179
2.20775
1.9788
1.8439
1.7348
1.57065
1.48961
1.35071
1.25702
1.13111
1.00542
0.896725
0.790787
0.694157
0.608705
0.535935
0.465311
0.403191
0.347014
0.301978
0.264572
0.228346
0.196216
0.166935
0.138474
0.112347
0.0932041
0.0801423
0.0690324
0.0594322
0.0505729
0.0417097
0.0333868
0.0256709
0.0180916
0.0112164
0.00514175
0.000407628
-0.00294378
-0.00569596
-0.00777285
-0.0103484
-0.0147775
-0.0177
-0.0180903
-0.0186714
-0.0192163
-0.0192078
-0.0210342
-0.0212241
-0.022147
-0.0238693
-0.0259728
-0.0305184
-0.0306183
-0.0358639
-0.0408732
-0.045265
-0.035945
0.0413056
0.508425
3.27833
18.7903
78.9512
204.682
330.658
431.178
492.863
513.3
506.023
453.151
364.688
238.221
112.026
37.679
3.86794
1.20822
0.475734
0.0776934
0.0520256
0.0177813
0.0470121
0.0406997
0.0701232
0.069832
0.0756585
0.0689964
0.0664229
0.074188
0.071705
0.0647197
0.0592174
0.0588764
0.05579
0.0509229
0.0461635
0.0422302
0.0390146
0.0365383
0.0344879
0.0328961
0.0316132
0.0304433
0.0293064
0.0282859
0.0276848
0.0273528
0.0272863
0.0273142
0.0277408
0.0283506
0.0287317
0.0292052
0.0297583
0.0306079
0.0319628
0.0333514
0.0350283
0.0369004
0.0385699
0.0405846
0.0432472
0.0460523
0.0464308
0.0470609
0.0477055
0.0446361
0.0419322
0.038863
0.0313666
0.0224389
0.00898697
-0.000828538
0.00622966
0.12845
0.947379
6.04672
33.7442
132.779
274.978
392.036
466.532
496.873
492.291
456.249
363.569
241.076
116.801
40.076
7.17481
2.42001
0.85311
0.207841
0.088446
0.0641358
0.0644104
0.0644928
0.0803288
0.0828313
0.0818658
0.0716241
0.0704273
0.065309
0.0610797
0.0587711
0.0557508
0.0514228
0.04794
0.0457678
0.0423153
0.0386756
0.0360703
0.0349508
0.0341223
0.0324067
0.0295243
0.0251018
0.0221419
0.0218389
0.0222861
0.0214013
0.0208161
0.0217095
0.0231543
0.0248656
0.0270581
0.0292321
0.0319225
0.0342459
0.0362174
0.038902
0.0421313
0.041574
0.0392983
0.0369971
0.037376
0.0397769
0.0396468
0.0367861
0.035829
0.0371904
0.0361473
0.0320978
0.0280945
0.0206611
0.012632
0.00654271
-0.00466986
0.00716564
0.101016
0.602606
3.35134
18.6864
80.7934
204.038
318.909
394.072
418.003
409.891
363.306
263.382
155.949
70.9693
22.164
6.02551
2.70206
0.986308
0.293672
0.119349
0.0763398
0.0574208
0.0434412
0.0445283
0.0536525
0.0620644
0.0603041
0.0655229
0.0687218
0.0690156
0.0665042
0.0633291
0.0597866
0.0572643
0.0559071
0.0537369
0.0498925
0.0429166
0.0337341
0.026328
0.0228808
0.0230689
0.0244933
0.0258913
0.0272026
0.0284711
0.0283162
0.0256817
0.0208975
0.0178744
0.0170113
0.0164084
0.0174649
0.0207951
0.0241764
0.0260818
0.0271127
0.0281453
0.0295177
0.0300137
0.0303574
0.0322824
0.0337727
0.0330337
0.0305626
0.02675
0.0265201
0.0251502
0.019427
0.0112106
0.00234373
-0.0113668
-0.0268681
-0.040854
-0.0557255
-0.0597434
0.166111
1.93405
14.1753
79.8143
217.234
338.583
418.489
441.168
418.343
352.215
237.29
106.925
38.2762
3.34952
0.933002
0.615471
0.425137
0.446454
0.428804
0.449208
0.430917
0.424853
0.440096
0.428926
0.416612
0.417223
0.407624
0.39353
0.379956
0.378318
0.371864
0.358297
0.3487
0.333125
0.328442
0.318891
0.30557
0.293751
0.273593
0.248035
0.214955
0.173954
0.125327
0.0702517
0.0111476
-0.0463009
-0.105811
-0.173752
-0.249637
-0.332868
-0.423156
-0.518891
-0.623279
-0.765245
-0.959069
-1.14132
-1.3014
-1.44006
-1.57523
-1.71152
-3.56172
-2.71606
-2.37532
29.9481
123.605
165.179
142.287
70.9407
22.7566
13.318
2.55753
1.87174
1.78309
1.75439
1.74037
1.67976
1.60079
1.46342
1.38372
1.25929
1.16917
1.05278
0.938317
0.836162
0.737545
0.648389
0.56845
0.500163
0.434323
0.376718
0.324566
0.282193
0.246926
0.213148
0.18314
0.155754
0.129359
0.10544
0.0875747
0.0750315
0.064526
0.0554648
0.0471262
0.0388764
0.0311823
0.0241682
0.0169772
0.0105698
0.00494298
0.000519948
-0.00264774
-0.00527311
-0.00733122
-0.00991984
-0.0137012
-0.0165693
-0.0170139
-0.0173291
-0.0180698
-0.0184452
-0.0199278
-0.020045
-0.0210503
-0.0228416
-0.0253258
-0.0290621
-0.029907
-0.0345806
-0.0393165
-0.04607
-0.0524912
-0.0622658
-0.0625186
-0.019429
0.26229
1.52317
6.74908
22.9544
57.2823
103.737
137.032
136.53
102.326
59.8381
20.564
2.85204
1.40258
0.548734
0.0730952
0.0241676
-0.0235642
0.0108303
0.00841214
0.0376679
0.0390592
0.0628412
0.0648958
0.0694651
0.0646132
0.0627218
0.0683044
0.066285
0.0604102
0.055625
0.0546745
0.0517898
0.0474384
0.0431051
0.0394557
0.0364565
0.0341243
0.0321997
0.0306964
0.0294757
0.0283799
0.0273145
0.0263744
0.0257979
0.0255135
0.0254209
0.0254669
0.0258353
0.0263858
0.0267397
0.0271801
0.0277106
0.0285088
0.0297289
0.0310219
0.0325618
0.0342585
0.0358514
0.0376424
0.0400418
0.0424605
0.0428821
0.0434018
0.0436189
0.0408369
0.0380306
0.0347289
0.0282957
0.0194837
0.00640901
-0.00634808
-0.0206087
-0.0341967
-0.0277511
0.0853475
0.778822
3.85215
16.6786
47.6251
91.2642
126.381
126.973
110.053
67.2029
27.886
7.56225
3.52782
1.59579
0.406916
0.0940392
0.0306555
0.0421703
0.0498237
0.0577256
0.061224
0.0743425
0.077099
0.0759371
0.0677908
0.0657779
0.0612761
0.0573181
0.0549435
0.0520548
0.0481576
0.0449065
0.0426528
0.0394921
0.0361971
0.0338073
0.0326803
0.0317852
0.0301318
0.0273694
0.0234099
0.0207158
0.0203581
0.0204916
0.019885
0.019485
0.0202671
0.0215534
0.0232017
0.0252235
0.0272945
0.0297507
0.0318973
0.0337379
0.0362308
0.0390259
0.0385654
0.0364947
0.0344616
0.0347813
0.0367409
0.0365069
0.0340477
0.0330828
0.0338345
0.0327197
0.0293331
0.0257695
0.0190556
0.0109078
0.00361573
-0.00967988
-0.0181034
-0.0246983
-0.0208591
0.0655214
0.536367
2.65993
10.5251
30.7119
60.6953
81.604
80.4067
66.0908
36.342
13.3085
6.39381
3.37552
1.46087
0.456348
0.122532
0.0420156
0.0412095
0.0568559
0.0523513
0.0413226
0.0395875
0.0475088
0.0568785
0.0576931
0.0626213
0.065163
0.0649813
0.0624885
0.0593372
0.0560321
0.0536928
0.0522445
0.0501131
0.0464119
0.0399914
0.031691
0.0250425
0.0217252
0.021719
0.0229055
0.0241501
0.025356
0.026458
0.0262339
0.0238133
0.0195865
0.016824
0.0159257
0.0153604
0.0163815
0.0194094
0.0224951
0.024337
0.025364
0.0263395
0.0275888
0.0280456
0.0284338
0.030268
0.0314767
0.0305767
0.028412
0.0253533
0.0249442
0.0233092
0.0185298
0.0110086
0.00229101
-0.0101531
-0.0256888
-0.0417027
-0.0634769
-0.0972774
-0.108057
-0.10006
0.0547903
0.976816
5.0041
16.6583
35.8886
52.895
55.5765
42.4103
15.4235
1.6858
0.76962
0.547566
0.342713
0.358314
0.330125
0.392942
0.392003
0.415276
0.401135
0.397779
0.408597
0.399379
0.389527
0.388397
0.379686
0.367003
0.355348
0.352391
0.34615
0.33423
0.324869
0.311253
0.305955
0.296952
0.284574
0.273027
0.254183
0.230256
0.199419
0.161326
0.116279
0.0653361
0.0107209
-0.0430588
-0.0990445
-0.162428
-0.233057
-0.310537
-0.394693
-0.484679
-0.584139
-0.716693
-0.891365
-1.05871
-1.20741
-1.33737
-1.46139
-1.57609
-3.20842
-2.52992
-2.20297
-1.84404
-0.943829
-0.479349
-0.11435
0.277703
0.811004
1.28527
1.56104
1.54334
1.58298
1.59543
1.59507
1.54746
1.47739
1.35815
1.27996
1.1677
1.08198
0.975005
0.870842
0.775591
0.684336
0.602247
0.528001
0.464276
0.403268
0.350036
0.301858
0.262266
0.229225
0.197891
0.170012
0.144548
0.120197
0.0983507
0.0817712
0.069855
0.0599821
0.0514827
0.0436844
0.0360436
0.0289629
0.0226133
0.0158433
0.00989916
0.00471249
0.000599368
-0.00239093
-0.00487962
-0.00688172
-0.00941517
-0.0126704
-0.0153038
-0.0157664
-0.0163286
-0.0168528
-0.0176112
-0.018654
-0.0191045
-0.0200174
-0.0220323
-0.0246487
-0.0275493
-0.0290165
-0.033178
-0.0375576
-0.0437579
-0.050544
-0.0609566
-0.0705666
-0.0840785
-0.0958048
-0.106819
-0.119601
-0.130836
-0.140422
-0.15058
-0.153312
-0.13731
0.869666
0.730249
0.761282
0.269195
0.0372804
-0.0105316
-0.0468303
-0.02495
-0.0328785
0.00246813
0.00808758
0.0325914
0.0372876
0.0564801
0.0598302
0.0635497
0.0600701
0.058694
0.0626845
0.0609936
0.0560472
0.0518687
0.0505341
0.047841
0.0439422
0.0400163
0.0366473
0.033871
0.0316864
0.0298917
0.0284802
0.0273295
0.0263048
0.0253161
0.0244547
0.0239215
0.0236573
0.0235612
0.0236078
0.0239373
0.0244038
0.0247404
0.0251531
0.0256335
0.0263831
0.0274843
0.0286514
0.0300745
0.0315934
0.0330536
0.0346899
0.0368321
0.0389047
0.0393327
0.039793
0.0397325
0.0372536
0.0346595
0.0309605
0.0249361
0.0159421
0.00439196
-0.00711216
-0.0217522
-0.03908
-0.0569136
-0.0819144
-0.0985346
-0.110898
-0.124034
-0.130493
-0.131247
-0.129082
0.100058
0.638672
2.2417
1.89053
1.08752
0.412645
0.113111
-0.00949617
-0.00680176
0.00782957
0.032584
0.0448649
0.0532097
0.0576488
0.0684331
0.0712237
0.070057
0.0635191
0.0610822
0.057074
0.0534074
0.0510306
0.0482979
0.0447854
0.0417689
0.0395211
0.0366351
0.0336577
0.0314753
0.0303637
0.0294216
0.0278541
0.0252767
0.021764
0.0193863
0.0190883
0.0189351
0.0184081
0.0181666
0.0188562
0.0200032
0.0215769
0.0233821
0.0253075
0.0275229
0.0294825
0.031204
0.0334915
0.0357506
0.0353313
0.0335644
0.0318496
0.0321432
0.0336106
0.0332458
0.0313362
0.0302287
0.0308172
0.0295158
0.0265964
0.0228308
0.0165818
0.00919626
0.00198762
-0.0107857
-0.0197902
-0.0303667
-0.0459761
-0.0627646
-0.0787548
-0.0985311
-0.112156
-0.122217
-0.127561
-0.123256
0.151117
1.01917
1.82589
1.46709
0.912083
0.386578
0.119534
0.0104933
0.000282591
0.0124759
0.0318998
0.0512021
0.0490073
0.0392167
0.0351515
0.0417943
0.0512297
0.0544577
0.0589422
0.0608514
0.0605485
0.0581856
0.0551753
0.0521362
0.0499632
0.0484924
0.046421
0.0429091
0.0370337
0.0295936
0.0236481
0.0204956
0.0203184
0.021301
0.0223605
0.0234667
0.0243974
0.0241253
0.0219254
0.0182539
0.0157766
0.014869
0.0143527
0.0153254
0.0180379
0.0208218
0.022544
0.0235323
0.0244536
0.0255778
0.0260158
0.0264763
0.028203
0.0291834
0.0281956
0.0263325
0.023827
0.0230506
0.0210806
0.01698
0.0101188
0.00198259
-0.00887296
-0.0239871
-0.0395166
-0.0596034
-0.0911336
-0.108844
-0.135056
-0.158594
-0.164392
-0.158974
-0.148911
-0.116233
-0.0923824
0.00137434
0.170728
0.292233
0.229899
0.19495
0.222512
0.235248
0.299844
0.299043
0.357234
0.362444
0.383097
0.372067
0.370173
0.37769
0.370029
0.36206
0.359807
0.351873
0.340487
0.330364
0.326599
0.320603
0.310078
0.301111
0.289154
0.283529
0.275073
0.263614
0.252474
0.234946
0.212672
0.184083
0.148872
0.107342
0.0604406
0.0101838
-0.0398551
-0.0921643
-0.150983
-0.216391
-0.288154
-0.366213
-0.450283
-0.544149
-0.667042
-0.824344
-0.977287
-1.1146
-1.23538
-1.34833
-1.44537
-2.88314
-2.33686
-2.01451
-1.65806
-0.888642
-0.45159
-0.116156
0.251955
0.693313
1.09632
1.3469
1.39779
1.44726
1.46281
1.46259
1.42094
1.35686
1.2523
1.17708
1.07618
0.995447
0.897674
0.803078
0.715004
0.631108
0.55582
0.487362
0.428287
0.372128
0.323173
0.278923
0.242203
0.21147
0.182575
0.156836
0.133315
0.110985
0.0911046
0.0758155
0.0646138
0.055402
0.0474865
0.0402464
0.0332151
0.0267272
0.0210152
0.0146833
0.00920387
0.0044486
0.000649458
-0.00213943
-0.00448632
-0.0064082
-0.00883117
-0.0116773
-0.0139524
-0.0144107
-0.0154995
-0.0157375
-0.0163878
-0.0172073
-0.0181677
-0.0194869
-0.0213884
-0.0237798
-0.0262138
-0.0279734
-0.0318576
-0.0358042
-0.0413551
-0.0481255
-0.0577118
-0.0667275
-0.0784319
-0.0891015
-0.099706
-0.112014
-0.12256
-0.131867
-0.140775
-0.13461
-0.129081
-0.0720555
-0.0917572
-0.0931432
-0.0883438
-0.0801765
-0.057119
-0.0569964
-0.0307112
-0.029567
-0.000225331
0.00813564
0.028532
0.0349923
0.0507231
0.0547442
0.0578837
0.0554294
0.0544368
0.057264
0.0558163
0.0516445
0.0479882
0.0464376
0.0439301
0.0404417
0.0368982
0.0338116
0.031255
0.0292276
0.0275631
0.0262506
0.0251746
0.0242226
0.0233126
0.022512
0.0220381
0.0217899
0.0216949
0.0217403
0.0220296
0.0224247
0.0227348
0.0231132
0.0235436
0.0242287
0.0252064
0.0262394
0.0275247
0.0288712
0.0301612
0.0316508
0.0335269
0.0352719
0.0356386
0.0359948
0.0357271
0.0334742
0.0310716
0.0273524
0.0217963
0.0133288
0.00282055
-0.00851396
-0.022248
-0.0378074
-0.0549438
-0.0790529
-0.0952986
-0.108244
-0.122204
-0.128505
-0.129031
-0.124075
-0.0959759
-0.0937428
-0.0167366
-0.0280245
-0.0371236
-0.0789961
-0.076592
-0.0582248
-0.0199252
0.00411093
0.0279264
0.0406295
0.048804
0.0537009
0.0626588
0.0652983
0.0642387
0.0589362
0.0563276
0.052719
0.0493871
0.0470493
0.0444999
0.0413338
0.0385599
0.0363795
0.0337557
0.0310805
0.0290943
0.0280122
0.0270606
0.025578
0.0231775
0.0200831
0.0179938
0.0176065
0.0174644
0.0169782
0.0168041
0.0174533
0.0184686
0.0199094
0.0215146
0.0232886
0.025267
0.0270325
0.0286249
0.0306987
0.0325412
0.0320929
0.030597
0.0290437
0.029223
0.0303906
0.0298804
0.0283332
0.027332
0.0276483
0.0264356
0.0239159
0.0201646
0.0146651
0.00753197
0.000374482
-0.0113051
-0.0196706
-0.0307208
-0.0453469
-0.0616775
-0.0783052
-0.0974148
-0.11235
-0.12251
-0.12633
-0.122457
-0.106927
-0.0980653
-0.0286629
-0.0356237
-0.0387462
-0.0716585
-0.0645413
-0.0408132
-0.0123656
0.00873544
0.0288426
0.0464253
0.0455757
0.036508
0.0315924
0.0372359
0.0458564
0.0501844
0.0544523
0.0561786
0.0558508
0.0536829
0.0508987
0.0481521
0.046149
0.0447087
0.0427159
0.0394203
0.0340687
0.0274096
0.0217966
0.0191675
0.0188683
0.0196799
0.020549
0.0215591
0.0223318
0.0220342
0.0200653
0.0168428
0.0146566
0.0137872
0.0133199
0.0142322
0.0166368
0.0191286
0.0207335
0.0216857
0.0225362
0.023549
0.0239407
0.0244141
0.0259911
0.0267739
0.0258579
0.0242784
0.0222507
0.0212595
0.0190591
0.0153834
0.00906582
0.00141672
-0.00830308
-0.022696
-0.0366993
-0.0553895
-0.0831905
-0.101093
-0.124125
-0.145537
-0.155116
-0.154662
-0.141517
-0.128564
-0.106987
-0.0828981
-0.0622103
-0.0218242
0.0634347
0.113829
0.173896
0.206309
0.268205
0.27643
0.324441
0.333354
0.35145
0.343144
0.342161
0.347249
0.340835
0.334294
0.331367
0.324136
0.313969
0.305097
0.300886
0.295176
0.285858
0.277405
0.266875
0.261149
0.253248
0.242691
0.232073
0.215867
0.195267
0.168926
0.136575
0.0985063
0.0555654
0.00956026
-0.0366795
-0.0851886
-0.139432
-0.199645
-0.265718
-0.337695
-0.415693
-0.503438
-0.616529
-0.757871
-0.896898
-1.02283
-1.13413
-1.23624
-1.31866
-2.57997
-2.13743
-1.82841
-1.48269
-0.827508
-0.4193
-0.103051
0.23881
0.629049
0.980792
1.20864
1.27056
1.31803
1.33305
1.33308
1.29598
1.23761
1.14615
1.07508
0.984648
0.909437
0.820694
0.73512
0.654393
0.577831
0.509169
0.446544
0.392207
0.340893
0.296154
0.255787
0.222012
0.193661
0.167205
0.143613
0.122053
0.101719
0.0837221
0.0697269
0.0593102
0.0507869
0.0434758
0.0368088
0.0303866
0.0244712
0.0192793
0.0134967
0.00848773
0.00415626
0.000673546
-0.00190275
-0.00410116
-0.00595906
-0.00822781
-0.0107923
-0.0125982
-0.0131265
-0.0144558
-0.0143585
-0.0151113
-0.0160437
-0.0171839
-0.0190208
-0.0207377
-0.0228278
-0.0251079
-0.026843
-0.0304001
-0.0341559
-0.0393548
-0.0461496
-0.0549791
-0.0632126
-0.0733895
-0.0830506
-0.0929114
-0.104265
-0.114352
-0.123305
-0.131112
-0.13274
-0.121437
-0.115139
-0.11736
-0.121264
-0.101818
-0.0830473
-0.0580575
-0.0527416
-0.0301462
-0.0258132
-0.00171588
0.00789396
0.0250875
0.0323638
0.0454074
0.0496877
0.0524007
0.0507143
0.0500052
0.0519873
0.0507318
0.0472093
0.0440125
0.0423698
0.0400498
0.0369394
0.0337573
0.030953
0.0286169
0.0267515
0.0252221
0.0240118
0.023017
0.0221417
0.0213198
0.0206238
0.0201733
0.0199276
0.0198327
0.0198692
0.0201197
0.0204538
0.020733
0.0210686
0.0214578
0.0220705
0.0229244
0.0238462
0.0249775
0.0261528
0.0273013
0.028593
0.0302129
0.031634
0.0319153
0.0320992
0.0316324
0.0295522
0.0272194
0.0236353
0.0183186
0.0105514
0.00103998
-0.00930132
-0.0221159
-0.0365076
-0.0524743
-0.0746886
-0.0905585
-0.103563
-0.116485
-0.122641
-0.124645
-0.12248
-0.116013
-0.120429
-0.125714
-0.128962
-0.122428
-0.115635
-0.0891316
-0.0593055
-0.0219139
0.00233601
0.0241604
0.0366501
0.04446
0.0494648
0.0569324
0.0593567
0.0584331
0.0540965
0.0515088
0.0482762
0.0452595
0.043032
0.0406653
0.0378299
0.0353036
0.033228
0.0308556
0.0284669
0.0266721
0.0256369
0.0247008
0.023314
0.0211158
0.0183442
0.0165325
0.0161038
0.0159196
0.0155134
0.0154004
0.0159882
0.0168963
0.018212
0.0196354
0.0212636
0.0230254
0.0246238
0.0260722
0.0279046
0.0294068
0.0289737
0.0276394
0.0262551
0.02629
0.0271399
0.0266208
0.025203
0.0243037
0.0244235
0.0233254
0.0208995
0.0173806
0.0122375
0.00564042
-0.00124293
-0.0114916
-0.0197543
-0.0300993
-0.0436234
-0.0589449
-0.0756198
-0.0933028
-0.10811
-0.118113
-0.121883
-0.119817
-0.11723
-0.122953
-0.123413
-0.121377
-0.115097
-0.104828
-0.0760235
-0.0432459
-0.0139438
0.0069312
0.026118
0.0418702
0.0419127
0.0336125
0.0285824
0.0333428
0.0410656
0.0457993
0.0496911
0.0512896
0.0509988
0.0490635
0.0465518
0.0441007
0.0422864
0.0408968
0.039011
0.0359472
0.0311065
0.0251861
0.0202107
0.0177639
0.0173732
0.0180397
0.0187219
0.0196652
0.0202977
0.0199742
0.0182143
0.015426
0.0134881
0.0126433
0.0122347
0.0130761
0.0151869
0.0173686
0.0188295
0.0197203
0.0205128
0.0214064
0.0217783
0.0222456
0.0236031
0.024206
0.0233629
0.0220544
0.0202896
0.0191777
0.0169965
0.0137919
0.00803446
0.000735218
-0.0080122
-0.0212625
-0.0343769
-0.0517515
-0.0759794
-0.0925458
-0.113563
-0.133908
-0.14433
-0.150284
-0.146681
-0.137314
-0.113692
-0.0891997
-0.0692994
-0.0312202
0.0451692
0.0955484
0.15342
0.187217
0.241369
0.254022
0.291341
0.302761
0.320282
0.314277
0.313832
0.317162
0.311759
0.306324
0.303047
0.296465
0.28743
0.279619
0.27523
0.269845
0.261592
0.253734
0.244452
0.238804
0.231473
0.221806
0.211808
0.196931
0.178024
0.153931
0.124419
0.0897615
0.0507116
0.00886947
-0.0335239
-0.0781319
-0.12779
-0.182825
-0.243229
-0.309125
-0.380908
-0.462113
-0.565337
-0.691841
-0.817405
-0.93202
-1.03364
-1.12523
-1.19536
-2.29477
-1.93465
-1.64624
-1.31962
-0.760068
-0.385054
-0.090517
0.222732
0.568323
0.875815
1.08268
1.14613
1.18923
1.20595
1.20496
1.1723
1.11957
1.03975
0.97377
0.893134
0.823889
0.743988
0.667036
0.593754
0.524485
0.462336
0.405558
0.356041
0.309558
0.268998
0.232474
0.201703
0.175799
0.151782
0.130348
0.110762
0.0923992
0.076221
0.0635228
0.053948
0.0461391
0.0394515
0.0333705
0.0275537
0.0221953
0.0174495
0.0122847
0.00775094
0.00383852
0.000673587
-0.00170838
-0.00375154
-0.00557045
-0.00758529
-0.00983731
-0.0112112
-0.0120354
-0.0132715
-0.0128593
-0.0140741
-0.015086
-0.0163795
-0.0181682
-0.0198245
-0.0219082
-0.0239469
-0.0258041
-0.0289548
-0.0326678
-0.037702
-0.0439412
-0.0521485
-0.0594095
-0.0682365
-0.0768921
-0.0856798
-0.0959522
-0.105193
-0.114093
-0.120589
-0.122147
-0.112087
-0.108202
-0.108651
-0.110424
-0.0935694
-0.0761888
-0.0541786
-0.0475496
-0.0283983
-0.0224676
-0.00245042
0.00746382
0.0220438
0.0295075
0.0404138
0.0446854
0.0470664
0.045955
0.0454553
0.0468297
0.045734
0.0427605
0.0399731
0.0383281
0.036202
0.0334386
0.0306032
0.0280761
0.0259636
0.02426
0.0228701
0.0217622
0.0208527
0.0200529
0.019314
0.0186876
0.0182802
0.0180479
0.0179572
0.0179838
0.0181961
0.018471
0.0187172
0.0190129
0.0193506
0.0198849
0.0206237
0.0214278
0.022405
0.0234146
0.0244137
0.0255095
0.0268706
0.0279967
0.028193
0.0282077
0.0276059
0.0256385
0.0232952
0.0197978
0.0147972
0.00759744
-0.00103874
-0.010538
-0.0221015
-0.0352234
-0.0497839
-0.0695319
-0.0845511
-0.0967432
-0.108456
-0.114413
-0.11666
-0.114378
-0.109872
-0.11337
-0.121198
-0.124219
-0.118095
-0.10896
-0.0838981
-0.0554335
-0.0219513
0.00123448
0.0209565
0.0327764
0.0400791
0.0449591
0.051227
0.0534467
0.0526676
0.0491278
0.0466621
0.0437936
0.0410807
0.0389934
0.0368317
0.0343025
0.0320142
0.0300877
0.0279533
0.0258272
0.0242236
0.0232483
0.0223419
0.0210625
0.0191059
0.0166495
0.0150363
0.0146593
0.0144172
0.0140652
0.0140284
0.0145166
0.0153235
0.0165116
0.0177623
0.0192376
0.020777
0.0222017
0.0234958
0.0250898
0.0262421
0.025832
0.0246397
0.0234231
0.0233278
0.0238794
0.0233501
0.0221005
0.0212395
0.0212008
0.0200355
0.0177806
0.0144407
0.00960738
0.00355872
-0.00304348
-0.0120589
-0.0198732
-0.0292968
-0.0417113
-0.0557473
-0.0713542
-0.087686
-0.101611
-0.111129
-0.114983
-0.112636
-0.112832
-0.116328
-0.119747
-0.117881
-0.111253
-0.0984992
-0.0710429
-0.040625
-0.0139944
0.00571118
0.0234881
0.0373317
0.0379283
0.0306441
0.0259203
0.0298927
0.0367206
0.0413872
0.0448438
0.0463374
0.0461094
0.0444206
0.042195
0.0400236
0.0383877
0.037075
0.0353084
0.0324927
0.0281473
0.0229192
0.0185318
0.0162886
0.0158419
0.0163894
0.0169093
0.0178167
0.0183142
0.0179679
0.016387
0.0139987
0.0122741
0.0114885
0.0111546
0.0119152
0.0137768
0.0156951
0.0169926
0.0178119
0.0185299
0.0193135
0.0196608
0.0201282
0.0213088
0.02176
0.0209737
0.0198637
0.0183061
0.0171646
0.0149266
0.0120146
0.00685244
0.000200137
-0.00769466
-0.0198808
-0.031997
-0.0477916
-0.0692703
-0.0851761
-0.104324
-0.121847
-0.131464
-0.137006
-0.134296
-0.125317
-0.102835
-0.082693
-0.0634583
-0.0268245
0.0381285
0.0853065
0.137564
0.169252
0.215926
0.230494
0.260087
0.27149
0.289571
0.28542
0.285275
0.287345
0.282773
0.278209
0.274815
0.26885
0.260864
0.253979
0.249611
0.24459
0.237291
0.230085
0.221915
0.216484
0.209742
0.200958
0.191664
0.178125
0.160926
0.139082
0.112388
0.0810982
0.0458774
0.00812674
-0.0303817
-0.0710066
-0.116066
-0.165939
-0.220686
-0.280495
-0.34593
-0.420257
-0.513609
-0.626176
-0.738692
-0.842058
-0.933885
-1.01532
-1.07496
-2.0243
-1.73062
-1.46713
-1.16549
-0.688222
-0.348928
-0.0784262
0.204159
0.508193
0.775806
0.961111
1.02331
1.0628
1.08091
1.07811
1.04959
1.00251
0.933243
0.873007
0.801653
0.738738
0.667495
0.598876
0.533091
0.471066
0.415357
0.364424
0.319798
0.278126
0.241723
0.209008
0.181286
0.157887
0.136311
0.117044
0.0994435
0.0830282
0.0686168
0.0572179
0.0485308
0.0414599
0.0354127
0.0299291
0.0247158
0.0199052
0.0156032
0.011052
0.00699633
0.00349799
0.000652211
-0.00151131
-0.00338494
-0.0051384
-0.00690568
-0.00873372
-0.0099544
-0.0109889
-0.0122154
-0.0118753
-0.0132251
-0.0142341
-0.0154688
-0.0171617
-0.0187989
-0.0209952
-0.0224651
-0.0246744
-0.0275771
-0.0313136
-0.0361562
-0.0412378
-0.0489216
-0.0552912
-0.0627258
-0.0702385
-0.0779592
-0.0868589
-0.0948747
-0.102633
-0.108073
-0.109198
-0.101394
-0.0981279
-0.0978445
-0.0980474
-0.0837978
-0.0682406
-0.0496384
-0.0420782
-0.0259737
-0.0194285
-0.00273413
0.00686568
0.0192687
0.0265114
0.0356737
0.0397537
0.0418601
0.0411702
0.0408249
0.0417632
0.040805
0.038299
0.0358814
0.0342986
0.032373
0.0299343
0.0274309
0.0251781
0.0232877
0.0217519
0.0205021
0.0195013
0.0186795
0.0179573
0.0172958
0.0167229
0.0163679
0.0161575
0.0160705
0.0160897
0.0162645
0.016489
0.0166969
0.0169443
0.0172337
0.0176843
0.0183072
0.0189898
0.01981
0.0206539
0.0214887
0.0223986
0.0235097
0.0243512
0.0244363
0.0242918
0.0235515
0.0216693
0.0193419
0.0160096
0.011274
0.0047004
-0.00312873
-0.0118325
-0.0222193
-0.034068
-0.0473364
-0.0646492
-0.0780418
-0.0889253
-0.0990802
-0.104431
-0.106485
-0.104532
-0.101468
-0.10419
-0.110999
-0.113227
-0.107868
-0.0986464
-0.0764338
-0.0503784
-0.0208508
0.000512422
0.01806
0.0289667
0.0357152
0.0403393
0.0456284
0.047605
0.0469952
0.0440981
0.041819
0.039274
0.0368701
0.0349466
0.032993
0.0307524
0.0287041
0.0269417
0.0250403
0.0231695
0.0217431
0.0208376
0.0199869
0.0188189
0.0170884
0.0150018
0.0135558
0.0131332
0.0129431
0.0126257
0.0125941
0.0130514
0.0137389
0.0147918
0.015881
0.0172016
0.0185304
0.0197828
0.0209089
0.0222538
0.0231264
0.0226879
0.0216167
0.0205255
0.0203234
0.0206329
0.0200458
0.0189222
0.0180633
0.0178562
0.0166869
0.0145228
0.0113341
0.00688392
0.001403
-0.00468283
-0.012728
-0.0199325
-0.0286186
-0.0397313
-0.052342
-0.0664423
-0.0810792
-0.0935885
-0.102274
-0.10588
-0.103795
-0.104099
-0.107032
-0.109989
-0.108045
-0.101518
-0.0887478
-0.0641946
-0.0370293
-0.0133462
0.00471745
0.0207896
0.0328512
0.033771
0.0275862
0.0234344
0.0267325
0.0326139
0.0369956
0.0400491
0.0414029
0.0412329
0.039776
0.0378274
0.0359234
0.0344541
0.0332356
0.0316048
0.0290531
0.0251901
0.0206121
0.0167722
0.0147427
0.0142733
0.0147137
0.0150567
0.0159142
0.0163108
0.0159711
0.0145738
0.0125075
0.0110068
0.0103064
0.0100278
0.010697
0.0123154
0.0139651
0.015127
0.0158716
0.016512
0.0171876
0.0174911
0.0179161
0.0189176
0.0192274
0.018505
0.0174533
0.0161223
0.0150391
0.012872
0.0102621
0.005647
-0.000292945
-0.00744221
-0.0185501
-0.029641
-0.0439931
-0.0629971
-0.0774712
-0.094455
-0.109339
-0.1179
-0.122757
-0.120132
-0.111608
-0.090871
-0.0738044
-0.0557588
-0.0215067
0.0333838
0.0763005
0.122415
0.152709
0.192755
0.207863
0.231874
0.242988
0.259398
0.256595
0.256565
0.257743
0.253862
0.249997
0.246653
0.241284
0.234272
0.228216
0.224015
0.219395
0.212969
0.20645
0.199288
0.194184
0.18805
0.180146
0.171626
0.159434
0.143959
0.124362
0.100469
0.0725074
0.0410617
0.00734425
-0.0272482
-0.0638231
-0.104272
-0.148992
-0.198091
-0.251801
-0.310771
-0.377952
-0.461456
-0.560809
-0.660651
-0.752856
-0.83485
-0.906501
-0.95703
-1.7661
-1.52669
-1.2909
-1.01834
-0.613261
-0.311324
-0.0676803
0.183742
0.4483
0.679301
0.842719
0.902026
0.938823
0.954796
0.95231
0.92776
0.886312
0.826704
0.77268
0.710204
0.653913
0.591159
0.530668
0.4724
0.417568
0.368252
0.323153
0.283478
0.246597
0.214339
0.185405
0.16077
0.139925
0.120794
0.103701
0.0880958
0.0736077
0.0609234
0.0508266
0.0430646
0.0367537
0.0313626
0.0264861
0.0218748
0.017613
0.013766
0.0098035
0.00622553
0.00313795
0.000615464
-0.00131248
-0.00299987
-0.00463995
-0.0062094
-0.00776989
-0.00896224
-0.00992227
-0.0111196
-0.0111044
-0.0126118
-0.0133213
-0.0143394
-0.016054
-0.0178674
-0.0199262
-0.021028
-0.0234307
-0.0261408
-0.029797
-0.0343636
-0.0385407
-0.0456586
-0.0511177
-0.0573377
-0.0637911
-0.0703715
-0.0778421
-0.0845265
-0.0909477
-0.095274
-0.0959189
-0.089709
-0.0870275
-0.0863337
-0.0856358
-0.0736609
-0.0599943
-0.0443669
-0.0366625
-0.0232761
-0.0166154
-0.00276042
0.00615361
0.0166886
0.0234351
0.0311262
0.0348896
0.0367517
0.0363607
0.0361305
0.0367572
0.0359241
0.0338219
0.0317456
0.030272
0.0285549
0.0264262
0.0242423
0.0222617
0.0205931
0.0192306
0.0181228
0.0172329
0.0165029
0.0158631
0.015289
0.0148185
0.0144749
0.0142775
0.0141904
0.0141985
0.014338
0.0145145
0.0146845
0.0148825
0.0151209
0.015488
0.0159978
0.016559
0.017227
0.0179043
0.018578
0.0193041
0.0201725
0.0207456
0.0207072
0.0203979
0.0195049
0.0176972
0.0153651
0.0121959
0.00776638
0.00182964
-0.0051936
-0.0129791
-0.0222598
-0.0327257
-0.0444508
-0.0594755
-0.0711822
-0.0806996
-0.0891549
-0.0936463
-0.0953001
-0.0936053
-0.0915346
-0.0938072
-0.0993128
-0.10101
-0.0962873
-0.0873874
-0.067914
-0.0447177
-0.0191413
-1.6776e-06
0.0154196
0.0252651
0.0313891
0.0356531
0.0401043
0.0418449
0.0413655
0.0389873
0.0369486
0.0347207
0.0326073
0.0308805
0.029131
0.027176
0.0253728
0.0237845
0.0221136
0.0204895
0.0192348
0.018414
0.0176337
0.0165867
0.0150707
0.0132656
0.0120463
0.0116018
0.0114174
0.011147
0.0111406
0.0115323
0.0121407
0.0130673
0.0139993
0.0151683
0.0163069
0.0173792
0.0183326
0.0194361
0.0200606
0.019598
0.0186116
0.0176022
0.0173102
0.0174084
0.0167755
0.0157325
0.0148582
0.0145129
0.013348
0.0112502
0.00827479
0.00419027
-0.000740157
-0.00636346
-0.0133704
-0.0198876
-0.0275984
-0.0374127
-0.04858
-0.0610293
-0.0737618
-0.0846307
-0.0921791
-0.0952902
-0.0936317
-0.0931793
-0.0961562
-0.0984673
-0.0965617
-0.0903471
-0.0781974
-0.0567214
-0.0330355
-0.0123449
0.00384043
0.0181219
0.0285225
0.0296059
0.0244603
0.0210007
0.0237046
0.0286796
0.0326211
0.0352732
0.0364679
0.0363462
0.0351011
0.0334188
0.0317732
0.0304792
0.0293724
0.0279019
0.0256272
0.0222368
0.0182723
0.0149467
0.0131419
0.0126726
0.0130327
0.0135262
0.0140467
0.0143397
0.0140046
0.0127802
0.0110144
0.00972124
0.00909064
0.00885033
0.00943277
0.0108353
0.0122275
0.0132391
0.0138946
0.0144517
0.0150203
0.0152801
0.0156596
0.0164982
0.0166699
0.0159393
0.0149736
0.0138027
0.012776
0.0108296
0.00851043
0.00446116
-0.000901796
-0.00736819
-0.0172902
-0.0272626
-0.0400453
-0.0565998
-0.0696296
-0.084545
-0.0972079
-0.104446
-0.108461
-0.10575
-0.0978343
-0.0798108
-0.064665
-0.047951
-0.0168105
0.0299593
0.0682426
0.108051
0.136703
0.170671
0.185846
0.20513
0.215703
0.229694
0.227793
0.22773
0.228294
0.224997
0.221711
0.218533
0.21375
0.207647
0.202353
0.198429
0.194242
0.188628
0.182819
0.176588
0.171896
0.166391
0.159367
0.151681
0.140844
0.127107
0.109757
0.0886465
0.0639804
0.0362633
0.00653169
-0.0241198
-0.0565904
-0.0924179
-0.131991
-0.175448
-0.223041
-0.275446
-0.33527
-0.408967
-0.495691
-0.583191
-0.664331
-0.736493
-0.798711
-0.841203
-1.51776
-1.32366
-1.11728
-0.876628
-0.536106
-0.27252
-0.0575322
0.16195
0.388784
0.585699
0.727268
0.782035
0.815819
0.828499
0.827475
0.806681
0.770857
0.720203
0.67272
0.618807
0.569366
0.514954
0.462446
0.411694
0.364007
0.321054
0.281775
0.2471
0.21499
0.186872
0.161694
0.140174
0.121924
0.105242
0.0903304
0.0767258
0.0641454
0.0531551
0.0443611
0.0375527
0.0320194
0.0272968
0.0230356
0.0190251
0.0153177
0.0119451
0.00853974
0.00544066
0.00276158
0.000561288
-0.00114197
-0.0026359
-0.00415048
-0.00550428
-0.00697136
-0.00799858
-0.00884469
-0.0099315
-0.0102624
-0.0117102
-0.0123413
-0.0132734
-0.015008
-0.016836
-0.0183767
-0.0199858
-0.0222093
-0.0248553
-0.0283161
-0.0325022
-0.0362416
-0.0421624
-0.0468305
-0.0520023
-0.0573731
-0.0627333
-0.0688209
-0.0741714
-0.079283
-0.0825481
-0.0827494
-0.077588
-0.0754307
-0.07456
-0.0734266
-0.0635263
-0.0517931
-0.0387862
-0.0314823
-0.0203844
-0.0140688
-0.00260578
0.00538592
0.0142557
0.0203181
0.0267274
0.0300918
0.0317218
0.0315368
0.0313912
0.0318005
0.0310857
0.0293407
0.0275801
0.0262519
0.0247484
0.0229191
0.0210438
0.0193322
0.0178862
0.016698
0.0157342
0.0149562
0.0143194
0.013761
0.0132663
0.0128609
0.012555
0.0123776
0.0122946
0.0122921
0.0123948
0.0125258
0.0126548
0.0128044
0.0129861
0.013269
0.0136673
0.0141046
0.0146215
0.0151347
0.015645
0.0161715
0.0168036
0.0171402
0.0169628
0.0164969
0.0154921
0.013736
0.0114386
0.00837957
0.00435353
-0.00103363
-0.00721865
-0.0141608
-0.0222785
-0.0313736
-0.0415496
-0.0541653
-0.0639947
-0.072004
-0.0788057
-0.0823652
-0.0835488
-0.0820243
-0.0805885
-0.0823553
-0.0867987
-0.0880039
-0.0838836
-0.0756774
-0.0589541
-0.038842
-0.0170733
-0.000349861
0.0129767
0.0216519
0.0270873
0.0309094
0.0346272
0.0361426
0.0357705
0.0338386
0.0320608
0.0301469
0.0283205
0.0267993
0.0252724
0.0235896
0.0220262
0.0206318
0.0191875
0.0177948
0.0167129
0.0159846
0.0152837
0.0143642
0.0130603
0.0115237
0.010451
0.0100726
0.00991905
0.00968704
0.00968965
0.0100381
0.0105488
0.0113376
0.0121406
0.0131282
0.0140725
0.0149557
0.0157233
0.0165927
0.0169782
0.0164984
0.0155873
0.0146189
0.01424
0.0141607
0.0134965
0.0125175
0.0116757
0.0111734
0.01
0.00802017
0.00525125
0.00153725
-0.0029158
-0.0080015
-0.0140557
-0.0198394
-0.0265738
-0.0349949
-0.0445598
-0.0551864
-0.0659351
-0.075025
-0.0812831
-0.0837649
-0.0823794
-0.0817194
-0.0842231
-0.086006
-0.0841602
-0.0784906
-0.0674365
-0.0490898
-0.0288699
-0.0110911
0.00308672
0.01552
0.02434
0.0254748
0.0212852
0.0184786
0.0207122
0.0248235
0.028256
0.030497
0.0315534
0.0314689
0.0304282
0.0289994
0.0276015
0.0264868
0.0255086
0.0242079
0.0222162
0.0192862
0.0159029
0.0130638
0.0114921
0.0110454
0.0113348
0.0118052
0.012175
0.0123879
0.0120868
0.011011
0.00950881
0.00841714
0.00786915
0.00765652
0.00815066
0.00935686
0.0105239
0.0113961
0.0119574
0.0124246
0.0128903
0.0130962
0.0134232
0.014107
0.0141573
0.0134553
0.0125496
0.0114722
0.010628
0.00896043
0.00685574
0.00328903
-0.00137193
-0.00707828
-0.0158652
-0.0248002
-0.0361543
-0.050515
-0.0619336
-0.0746023
-0.0851199
-0.0912574
-0.0944593
-0.0916943
-0.0843811
-0.0688047
-0.0555897
-0.0404074
-0.0128897
0.0265982
0.0601846
0.0939009
0.119572
0.14822
0.162814
0.1791
0.187203
0.19983
0.199046
0.198827
0.198989
0.196192
0.193396
0.190465
0.186259
0.181009
0.176427
0.172859
0.169131
0.164284
0.159197
0.153838
0.149623
0.144766
0.138621
0.131817
0.122344
0.110356
0.0952512
0.0769089
0.0555089
0.0314805
0.0056964
-0.0209939
-0.0493164
-0.0805112
-0.114942
-0.152759
-0.194219
-0.239971
-0.292274
-0.356217
-0.43078
-0.506227
-0.576401
-0.638762
-0.691865
-0.727144
-1.27746
-1.12196
-0.945996
-0.739149
-0.457417
-0.232765
-0.0478745
0.139128
0.329654
0.494373
0.614258
0.663124
0.693177
0.704125
0.703478
0.686231
0.656012
0.613753
0.573042
0.527443
0.485023
0.438824
0.39419
0.350943
0.310355
0.273746
0.240273
0.210637
0.183283
0.159302
0.137864
0.119482
0.103866
0.0896374
0.0769165
0.0653198
0.0546336
0.0453153
0.0378289
0.0320013
0.0272655
0.0232262
0.0195902
0.016181
0.0130283
0.0101416
0.00727727
0.00464797
0.00237082
0.000493351
-0.000972039
-0.0022626
-0.00361145
-0.00478302
-0.00613191
-0.00696316
-0.00784186
-0.00879454
-0.00942949
-0.0104415
-0.0113912
-0.0121807
-0.0141216
-0.0157274
-0.0168971
-0.0194594
-0.0210335
-0.0237576
-0.0268037
-0.0307195
-0.034086
-0.0384506
-0.0425494
-0.0467591
-0.0509558
-0.0551328
-0.0598665
-0.0639107
-0.0677175
-0.0699489
-0.0697681
-0.0653825
-0.063675
-0.0627929
-0.0615101
-0.0535601
-0.0437283
-0.0330147
-0.0264701
-0.017352
-0.0117113
-0.00233302
0.00458687
0.011924
0.01718
0.0224509
0.0253652
0.0267612
0.0267139
0.0266249
0.0268854
0.0262845
0.0248599
0.0233923
0.0222359
0.0209486
0.0194116
0.0178344
0.0163898
0.0151654
0.0141543
0.0133353
0.0126714
0.0121291
0.0116529
0.0112316
0.0108717
0.0106156
0.0104633
0.0103848
0.0103714
0.0104382
0.0105256
0.0106103
0.0107019
0.0108255
0.0110219
0.0113032
0.0116161
0.0119804
0.0123281
0.0126726
0.0130019
0.0134069
0.0135056
0.0131842
0.0125736
0.0114712
0.00975813
0.00751563
0.0046258
0.000978328
-0.00379597
-0.00918652
-0.0152378
-0.0222382
-0.0299411
-0.0385526
-0.0488761
-0.0567789
-0.0630987
-0.0682745
-0.0708426
-0.0714995
-0.0700489
-0.0689646
-0.070301
-0.0738149
-0.0746069
-0.0710993
-0.0638681
-0.0498481
-0.0328768
-0.0147634
-0.000558496
0.0106935
0.0181312
0.0228316
0.0261559
0.0292123
0.0304939
0.0302221
0.0286788
0.0271685
0.0255537
0.0240152
0.0227152
0.0214134
0.0199941
0.0186725
0.0174746
0.0162565
0.0150892
0.0141747
0.0135454
0.0129362
0.0121476
0.0110473
0.00975619
0.00879658
0.00850919
0.00838511
0.00819739
0.00820648
0.00850163
0.0089225
0.00957872
0.0102372
0.0110546
0.0118007
0.0124973
0.0130777
0.0137066
0.0139014
0.0133933
0.0124913
0.0115862
0.0111204
0.0108687
0.0101742
0.00922611
0.00840516
0.00779736
0.00661365
0.00475602
0.00222026
-0.00117208
-0.00510887
-0.00958578
-0.0147325
-0.0197298
-0.0254666
-0.0324961
-0.0404241
-0.0491275
-0.0578303
-0.0650688
-0.0699435
-0.0717171
-0.0704604
-0.0698644
-0.0717268
-0.0730571
-0.0713429
-0.0663908
-0.0567429
-0.0414524
-0.0245893
-0.0096537
0.00242688
0.0129801
0.0203019
0.0213945
0.0180528
0.0158484
0.0176451
0.0209787
0.023904
0.0257529
0.0266643
0.0266125
0.0257603
0.0245758
0.0234164
0.0224767
0.0216372
0.0205151
0.018812
0.0163349
0.0135066
0.0111317
0.00979528
0.0093907
0.00961742
0.0099673
0.0102865
0.0104411
0.0101658
0.00924464
0.00798951
0.00708103
0.00659974
0.00642193
0.00682993
0.00784083
0.00879435
0.00952096
0.00998909
0.0103698
0.0107324
0.0108792
0.011134
0.0116546
0.0116171
0.0109649
0.0101419
0.0091453
0.00843438
0.00693985
0.00515014
0.0021078
-0.00193646
-0.00695598
-0.0145899
-0.0224867
-0.0323741
-0.044359
-0.0540298
-0.0645802
-0.0731889
-0.0782221
-0.0805779
-0.0778729
-0.0712554
-0.0582959
-0.0470019
-0.0336725
-0.0100376
0.0225525
0.0514514
0.079721
0.102129
0.12601
0.139183
0.153356
0.159296
0.168949
0.169727
0.169819
0.169746
0.167385
0.165019
0.162394
0.158763
0.154319
0.150419
0.147269
0.144026
0.139914
0.135557
0.13103
0.127346
0.123156
0.117896
0.112017
0.103918
0.0936887
0.080829
0.0652428
0.0470848
0.0267118
0.00484499
-0.0178682
-0.0420077
-0.0685603
-0.0978514
-0.130029
-0.165337
-0.204366
-0.24902
-0.303264
-0.366041
-0.429683
-0.488987
-0.541595
-0.585863
-0.614555
-1.0436
-0.921761
-0.776747
-0.604958
-0.377673
-0.19227
-0.0386199
0.115546
0.270892
0.404851
0.503313
0.545243
0.570973
0.580772
0.580139
0.566416
0.541738
0.507425
0.473646
0.436172
0.400914
0.362825
0.325992
0.290232
0.256705
0.22643
0.19875
0.174183
0.151566
0.131723
0.114006
0.0987778
0.0858197
0.0740443
0.0635146
0.0539249
0.0451145
0.0374433
0.0312594
0.0264244
0.022492
0.0191371
0.0161249
0.0133115
0.0107157
0.00833684
0.00597174
0.00382535
0.00196117
0.000418282
-0.000792947
-0.00187558
-0.00302698
-0.00408486
-0.00528269
-0.00605644
-0.00699624
-0.00783139
-0.00860371
-0.00953856
-0.0104691
-0.0113911
-0.0131686
-0.014694
-0.0159986
-0.0187552
-0.0201146
-0.0227184
-0.025315
-0.0288864
-0.0318823
-0.034832
-0.0382474
-0.0413096
-0.0445093
-0.0475866
-0.0509828
-0.0537465
-0.0562525
-0.0574925
-0.0569668
-0.0532582
-0.0519063
-0.0511105
-0.0498015
-0.0435822
-0.0356192
-0.0270521
-0.0215022
-0.0142517
-0.0094179
-0.00197429
0.00378028
0.00967591
0.0140546
0.0182848
0.0207065
0.0218587
0.0218922
0.0218379
0.0219951
0.0215049
0.0203701
0.019182
0.0182132
0.0171486
0.0158967
0.0146124
0.0134315
0.0124288
0.0115972
0.0109246
0.0103769
0.00993028
0.00953558
0.00917945
0.00882743
0.00865559
0.00853474
0.00846554
0.00844265
0.00847844
0.00852445
0.00856663
0.00860245
0.00866688
0.00877865
0.00894351
0.00913309
0.00934611
0.00952824
0.00970164
0.00982638
0.00998831
0.00986714
0.00939033
0.00862318
0.00741807
0.00571916
0.00353743
0.000823097
-0.00245568
-0.00663538
-0.0112221
-0.0163565
-0.0221477
-0.0284172
-0.0354166
-0.0435079
-0.0494485
-0.0540561
-0.0576214
-0.0591598
-0.0592652
-0.0578022
-0.0568691
-0.0578241
-0.0605556
-0.0610331
-0.0581416
-0.0520691
-0.0406914
-0.0268688
-0.0122689
-0.000630997
0.00856057
0.0147072
0.0186258
0.0214086
0.0238567
0.0249086
0.0247058
0.0235029
0.0222662
0.0209472
0.0196877
0.0186141
0.0175427
0.0163858
0.0153039
0.0143104
0.0133155
0.0123661
0.0116189
0.0110963
0.0105862
0.00993393
0.00903398
0.0079761
0.00708392
0.00693471
0.00683955
0.00668941
0.00670792
0.00692617
0.00728145
0.00781002
0.00831662
0.00897447
0.00953133
0.0100389
0.0104351
0.0108416
0.0108596
0.010312
0.00940947
0.00854799
0.00799622
0.00757815
0.00684958
0.00590781
0.00504594
0.00435706
0.00317093
0.00140331
-0.00094326
-0.00396718
-0.00739538
-0.0112138
-0.0154571
-0.0195729
-0.0242555
-0.0298626
-0.0361385
-0.0428981
-0.049525
-0.0548786
-0.0583456
-0.0593673
-0.0581251
-0.0575929
-0.0588995
-0.059868
-0.0583644
-0.0542294
-0.0461737
-0.0338315
-0.0202189
-0.00807914
0.00185463
0.0105163
0.0164085
0.01739
0.0148
0.0131056
0.0145143
0.0171665
0.0195674
0.0210506
0.0218015
0.0217755
0.0210932
0.0201459
0.0192121
0.0184396
0.0177428
0.0168101
0.015405
0.0133791
0.0110867
0.00915925
0.0080619
0.00771361
0.00788774
0.00812746
0.00840081
0.00850976
0.00826433
0.00749046
0.00646949
0.00572372
0.00530757
0.00516479
0.00551215
0.00633335
0.00710153
0.00767872
0.00804409
0.00833312
0.00859487
0.00867907
0.00885891
0.00923173
0.00912257
0.0085353
0.00779629
0.00686274
0.0061389
0.004767
0.0032759
0.000820984
-0.00260459
-0.00690442
-0.0133604
-0.0200212
-0.0282979
-0.0380645
-0.0459288
-0.0544722
-0.0613508
-0.0652361
-0.0668054
-0.0641689
-0.0583127
-0.0475203
-0.038316
-0.0270492
-0.00736872
0.0189802
0.0430079
0.0659154
0.0848542
0.10426
0.115651
0.12759
0.132786
0.138689
0.139854
0.140838
0.140636
0.138661
0.136687
0.134408
0.131346
0.127669
0.124427
0.121735
0.118994
0.11559
0.11196
0.108228
0.10511
0.101598
0.0972199
0.0922938
0.085566
0.0771022
0.0664832
0.0536389
0.0387001
0.0219535
0.0039787
-0.0147441
-0.0346723
-0.0565736
-0.0807258
-0.107263
-0.136404
-0.16865
-0.205556
-0.250156
-0.301447
-0.353492
-0.402013
-0.444923
-0.480591
-0.503163
-0.814639
-0.723006
-0.60921
-0.473283
-0.297221
-0.151213
-0.0296914
0.091388
0.212417
0.316649
0.393957
0.428554
0.449412
0.457498
0.457117
0.446735
0.427476
0.400828
0.374096
0.344632
0.316648
0.286621
0.257549
0.22928
0.20279
0.178843
0.156954
0.137492
0.119612
0.103916
0.0899195
0.0778676
0.0676033
0.0582995
0.0499833
0.0424157
0.0354828
0.0294575
0.0245928
0.0207815
0.0176815
0.0150387
0.0126759
0.0104743
0.00843702
0.00655445
0.00475671
0.00307082
0.00159703
0.000359311
-0.000629868
-0.00153098
-0.00249915
-0.00343722
-0.00455607
-0.00529299
-0.00620318
-0.00683187
-0.00757384
-0.0084801
-0.00935286
-0.0106759
-0.0117467
-0.0131915
-0.0145592
-0.0168488
-0.0188571
-0.0210566
-0.0235053
-0.02644
-0.0290887
-0.0306703
-0.033477
-0.0356621
-0.0381166
-0.0401027
-0.0421595
-0.0436466
-0.0448775
-0.0451779
-0.0443371
-0.041586
-0.0403294
-0.0395965
-0.0383507
-0.0336379
-0.0275192
-0.0210074
-0.0166007
-0.0110892
-0.00721208
-0.00155353
0.00295528
0.00748845
0.0109379
0.0141785
0.0160788
0.0169824
0.0170473
0.0170159
0.0171053
0.0167218
0.0158561
0.0149418
0.0141724
0.0133413
0.0123679
0.0113757
0.0104566
0.00967651
0.00902706
0.00850304
0.0080747
0.00772621
0.00741666
0.00713205
0.00680381
0.00670303
0.00661309
0.0065532
0.0065231
0.00653079
0.00654111
0.00654263
0.00653177
0.00653749
0.00657145
0.00663408
0.00670286
0.00677221
0.00679909
0.00679817
0.00672096
0.00664854
0.0063312
0.00568581
0.00476138
0.00345594
0.00174752
-0.000382721
-0.00293533
-0.00586989
-0.00949996
-0.0133027
-0.0175579
-0.0221844
-0.0270167
-0.0323802
-0.0382907
-0.0421993
-0.0450296
-0.0469699
-0.0474428
-0.0469487
-0.0453822
-0.0444638
-0.0450754
-0.0471367
-0.0473808
-0.0451104
-0.0403055
-0.0315917
-0.0208383
-0.00963276
-0.000591591
0.00654647
0.0113631
0.0144538
0.0166564
0.0185369
0.0193525
0.019206
0.0183032
0.0173425
0.0163169
0.015338
0.0144931
0.0136563
0.01276
0.0119148
0.0111388
0.0103631
0.00962846
0.00904848
0.00863888
0.00823496
0.00772406
0.00702398
0.00619765
0.0053673
0.00536056
0.00529966
0.0051887
0.00520103
0.00536208
0.00563753
0.00603906
0.00640962
0.00690855
0.0072884
0.00762572
0.00784642
0.00804094
0.00788724
0.00729421
0.00640884
0.00555794
0.00493436
0.00438663
0.003609
0.00266641
0.00177465
0.000958582
-0.000231417
-0.00194038
-0.00410287
-0.00679181
-0.00975708
-0.0129343
-0.0163427
-0.0195574
-0.0231449
-0.0272954
-0.0318621
-0.0366439
-0.0411906
-0.044641
-0.0466473
-0.0468587
-0.0455359
-0.0450026
-0.0458793
-0.0465624
-0.04533
-0.0420713
-0.0357285
-0.0262422
-0.0157811
-0.00639388
0.0013641
0.00811612
0.012645
0.0134616
0.0115329
0.0103087
0.0113739
0.0133657
0.0152224
0.0163618
0.0169488
0.0169375
0.0164187
0.0156918
0.0149717
0.0143719
0.0138225
0.0130908
0.0119928
0.0104171
0.00864689
0.00715597
0.00630017
0.00601982
0.00614882
0.00628643
0.00651514
0.00658772
0.00638359
0.00575227
0.00494611
0.00435597
0.00401703
0.00391457
0.00420825
0.00484629
0.00543729
0.00586541
0.0061286
0.0063287
0.0064965
0.00652386
0.00663223
0.0068612
0.00669221
0.00617622
0.00551398
0.00465288
0.00376111
0.00260968
0.00138485
-0.000616572
-0.00338353
-0.00685162
-0.0120336
-0.0171636
-0.023669
-0.0314449
-0.0378144
-0.0444914
-0.0496914
-0.0525039
-0.0533157
-0.0507609
-0.0456921
-0.0375221
-0.0300806
-0.0209945
-0.00535538
0.0151502
0.0342051
0.0520297
0.0673854
0.0825353
0.0918544
0.101533
0.106186
0.110024
0.110229
0.111488
0.111219
0.109619
0.10802
0.10613
0.103656
0.100741
0.0981571
0.0959684
0.093761
0.0910679
0.0881851
0.0852442
0.0827356
0.0799326
0.0764605
0.072538
0.0672223
0.0605417
0.0521711
0.04207
0.0303437
0.0172077
0.00311315
-0.0116093
-0.0273063
-0.0445521
-0.0635697
-0.0844702
-0.107435
-0.132845
-0.161929
-0.196934
-0.236975
-0.277589
-0.315403
-0.348669
-0.375927
-0.392685
-0.589502
-0.525628
-0.443096
-0.343487
-0.216301
-0.109744
-0.020992
0.0668865
0.154337
0.22971
0.286145
0.31245
0.327865
0.333426
0.334013
0.326613
0.31279
0.293742
0.274247
0.252833
0.232307
0.210405
0.189151
0.16845
0.149033
0.131451
0.115384
0.101072
0.0879387
0.076395
0.0661111
0.0572345
0.0496659
0.0428206
0.0367033
0.0311356
0.0260479
0.0216317
0.0180569
0.0152433
0.0129489
0.0109869
0.00922923
0.00759369
0.00609551
0.00473849
0.00331788
0.00209049
0.00101249
0.000102791
-0.000626599
-0.00129195
-0.00198583
-0.0026793
-0.00366471
-0.0042706
-0.00504432
-0.00544673
-0.00613672
-0.00683587
-0.0078387
-0.0093444
-0.0101228
-0.0115006
-0.0128913
-0.0148616
-0.0171701
-0.0191498
-0.0214725
-0.0238106
-0.0259401
-0.0267531
-0.0288198
-0.030574
-0.0320563
-0.0328409
-0.0335107
-0.0336693
-0.0336041
-0.0329852
-0.0318444
-0.0298191
-0.0288293
-0.0281673
-0.0271517
-0.0238148
-0.0194954
-0.0149322
-0.0117629
-0.00790116
-0.00508108
-0.00110822
0.00210365
0.00532642
0.00781142
0.0100955
0.0114571
0.0121115
0.0121751
0.0121605
0.0122123
0.0119348
0.0113266
0.0106818
0.0101225
0.00953108
0.00883363
0.00813056
0.00747328
0.00691576
0.00645044
0.00607584
0.00576892
0.00552001
0.00529895
0.00509638
0.00483464
0.00477792
0.00471276
0.00465998
0.00462194
0.00460206
0.004578
0.00453805
0.00448315
0.00442955
0.00438473
0.00435008
0.00429797
0.00422612
0.00410272
0.00393169
0.00368897
0.00339761
0.00287211
0.00207394
0.00102046
-0.000364273
-0.002078
-0.0041478
-0.00654463
-0.00914781
-0.0122425
-0.0153069
-0.0186911
-0.022219
-0.025681
-0.0294541
-0.0332904
-0.0351913
-0.0362027
-0.0364518
-0.0357803
-0.0346271
-0.032895
-0.0319092
-0.0322292
-0.0336242
-0.0337448
-0.0321198
-0.028653
-0.0224961
-0.0148464
-0.00694394
-0.000476096
0.00461737
0.0080756
0.0103022
0.0118949
0.013226
0.0138057
0.0137153
0.0130807
0.0123974
0.0116643
0.0109708
0.0103633
0.00975867
0.0091214
0.00851482
0.00796117
0.00740393
0.00688352
0.0064688
0.006176
0.00588397
0.00551745
0.00501722
0.00442665
0.00376761
0.00381543
0.00377245
0.00369688
0.00370713
0.00381881
0.00401137
0.00428945
0.00453678
0.00486597
0.00509054
0.00525934
0.0053112
0.00529037
0.00496343
0.00431618
0.00345372
0.00259399
0.00190236
0.00125589
0.000416687
-0.000531475
-0.00142322
-0.00228473
-0.00347443
-0.00508891
-0.00708019
-0.00946084
-0.0119818
-0.0145434
-0.0171548
-0.0194828
-0.0220176
-0.0247498
-0.0276434
-0.0304748
-0.0329586
-0.0344875
-0.0349839
-0.034321
-0.0328232
-0.0322324
-0.0327709
-0.0332171
-0.0323048
-0.0299643
-0.0254158
-0.0187089
-0.011299
-0.0046255
0.000931646
0.00576251
0.00897255
0.00958617
0.00825196
0.00742386
0.00817617
0.0095507
0.0108625
0.0116683
0.012095
0.0120921
0.0117341
0.0112156
0.0107054
0.010286
0.0098903
0.00936626
0.00857775
0.00744982
0.00619094
0.00512985
0.00451682
0.0043117
0.00440375
0.00449309
0.00465891
0.00469536
0.00452524
0.00403701
0.00342798
0.00298457
0.0027334
0.00268027
0.00291378
0.00339048
0.00381463
0.00411326
0.00428468
0.00440401
0.00449303
0.0044764
0.0045231
0.00463699
0.00443756
0.00399592
0.00341601
0.00262944
0.0016186
0.000829462
-6.30039e-05
-0.00163627
-0.00365875
-0.0063102
-0.0102625
-0.0138925
-0.0187053
-0.0245003
-0.0293143
-0.0341226
-0.0377077
-0.0395396
-0.0396624
-0.037251
-0.0330326
-0.0265145
-0.0213509
-0.0146264
-0.00310508
0.0117985
0.0259257
0.0389948
0.0501918
0.0610517
0.0679348
0.0751711
0.079104
0.0815375
0.0812557
0.0820863
0.0818335
0.0806418
0.0794215
0.0779755
0.0761237
0.0739731
0.0720466
0.0703881
0.0687248
0.0667342
0.0646007
0.0624309
0.06054
0.058449
0.0558794
0.0529725
0.0490702
0.0441465
0.0380001
0.0306029
0.0220377
0.0124643
0.00220851
-0.00851529
-0.019964
-0.0325415
-0.0464114
-0.0616571
-0.0784146
-0.0969595
-0.118177
-0.14362
-0.172583
-0.201901
-0.22908
-0.252758
-0.271759
-0.282889
-0.367073
-0.329726
-0.278584
-0.215452
-0.135266
-0.0680001
-0.0125713
0.0417229
0.095694
0.142263
0.177424
0.193717
0.203259
0.206375
0.207372
0.20272
0.194156
0.182437
0.170248
0.15691
0.144053
0.130405
0.117155
0.10424
0.0921212
0.0811498
0.0711388
0.0622148
0.05404
0.0468607
0.0404792
0.0349743
0.0302914
0.0260732
0.0223129
0.0188918
0.0157722
0.013073
0.0108949
0.00918654
0.00781247
0.0066558
0.00562403
0.00467457
0.00379885
0.00296487
0.00224763
0.00154939
0.000925112
0.000383198
-7.42167e-05
-0.00052905
-0.00102886
-0.00156293
-0.00237649
-0.00294167
-0.00376975
-0.0045294
-0.0054514
-0.00641493
-0.00770057
-0.00932018
-0.0105448
-0.0121379
-0.013724
-0.015641
-0.0177084
-0.0195554
-0.0214471
-0.0231986
-0.0245386
-0.0249565
-0.0258776
-0.0265171
-0.0265607
-0.0259462
-0.0251327
-0.0238704
-0.0224814
-0.0209097
-0.0194608
-0.0183073
-0.0174318
-0.0168651
-0.0161682
-0.0141543
-0.0115827
-0.00889142
-0.00698963
-0.00471274
-0.00300854
-0.000653281
0.00126746
0.00318615
0.00467821
0.00603381
0.00685516
0.00725563
0.00730145
0.00729733
0.00732709
0.00715854
0.00679875
0.00641546
0.00607503
0.00572122
0.00530089
0.00488101
0.00448613
0.0041514
0.00387169
0.0036472
0.00346318
0.00331469
0.00318518
0.00307716
0.00299034
0.00291478
0.00285783
0.00280311
0.00275101
0.0026986
0.00263516
0.00254808
0.00244411
0.002325
0.0021949
0.00205602
0.00187579
0.00165591
0.00137062
0.00102253
0.00060177
8.89642e-05
-0.000650466
-0.00160511
-0.00278405
-0.00424783
-0.00595261
-0.00794511
-0.0101684
-0.0123993
-0.0149409
-0.017233
-0.019722
-0.0221006
-0.0242911
-0.0264841
-0.028311
-0.0282117
-0.0273795
-0.0259374
-0.0241229
-0.022308
-0.0203821
-0.0192809
-0.0193327
-0.0201334
-0.0201793
-0.0192046
-0.0171294
-0.0134251
-0.00890762
-0.00419743
-0.000317605
0.00274102
0.00482359
0.00616727
0.00713274
0.00792523
0.00827558
0.00823155
0.00785045
0.00744353
0.00700281
0.00659049
0.0062247
0.00585724
0.00547645
0.00511061
0.00477802
0.00444234
0.00413094
0.00388226
0.00370698
0.00353134
0.00331192
0.00301472
0.00267239
0.00241932
0.00233687
0.00230254
0.00225153
0.00225596
0.00232727
0.00243054
0.00259265
0.0027263
0.00286525
0.00292768
0.0029058
0.00276817
0.00252912
0.00202069
0.00130091
0.00043435
-0.000431394
-0.00119176
-0.00195138
-0.00284161
-0.00379361
-0.00469698
-0.00558752
-0.00675231
-0.00825866
-0.010063
-0.0121151
-0.0141603
-0.0160857
-0.0178932
-0.0192933
-0.0207491
-0.0220765
-0.0233544
-0.0242611
-0.0246961
-0.0243281
-0.023333
-0.0217871
-0.0200657
-0.0193728
-0.0196466
-0.0198951
-0.01934
-0.0179394
-0.015211
-0.0112136
-0.0067942
-0.0028074
0.000530929
0.00344158
0.00536363
0.00573567
0.00495048
0.00447149
0.0049181
0.00573068
0.00651528
0.00698817
0.00725122
0.00725265
0.00704507
0.00673489
0.00643214
0.00618457
0.00594533
0.00563093
0.00515623
0.00447769
0.00372319
0.0030877
0.00271868
0.0025936
0.00265538
0.00274972
0.00283345
0.00282858
0.00268233
0.00231372
0.00188891
0.00157939
0.00141253
0.00139258
0.00156062
0.00186495
0.00211723
0.002267
0.00231882
0.00232657
0.00230015
0.00218969
0.00211239
0.002034
0.00169982
0.00121069
0.000583323
-0.000302339
-0.00128858
-0.00190827
-0.00253552
-0.003686
-0.00506214
-0.00696377
-0.00975385
-0.0120644
-0.0152456
-0.0190245
-0.0220637
-0.0248777
-0.0266977
-0.0273855
-0.0267006
-0.0242834
-0.0208035
-0.0172222
-0.0139265
-0.00958658
-0.00221046
0.00718349
0.0163324
0.0247646
0.0313821
0.0379824
0.0422408
0.0466326
0.0492857
0.0504723
0.0502407
0.0505898
0.0503293
0.0495165
0.0486969
0.0477454
0.0465618
0.0452191
0.0440232
0.0429941
0.0419762
0.0407732
0.0394798
0.0381726
0.0370287
0.0357725
0.0342308
0.032481
0.0301247
0.0271236
0.0233751
0.0188448
0.0135816
0.00769621
0.00139148
-0.00525358
-0.0123884
-0.020265
-0.0289819
-0.0385869
-0.0491544
-0.0608906
-0.0742999
-0.0902989
-0.108393
-0.126571
-0.143187
-0.157293
-0.168074
-0.173587
-0.133219
-0.123255
-0.106386
-0.0833813
-0.0526172
-0.0261229
-0.00382736
0.0184999
0.0409065
0.0606415
0.0762823
0.0840595
0.0892442
0.0920669
0.0936519
0.0927631
0.0898543
0.0854139
0.0803942
0.0747338
0.0690604
0.0630234
0.057071
0.0511699
0.045593
0.0404617
0.0357058
0.0314018
0.0274325
0.0239042
0.0207426
0.0179623
0.0155599
0.0133879
0.0114377
0.00966822
0.00807773
0.00671447
0.00560278
0.00470583
0.00396371
0.00332255
0.0027355
0.00218289
0.00164092
0.00119008
0.000767833
0.000308175
-0.000134349
-0.000569128
-0.000996508
-0.00147757
-0.0020188
-0.00262159
-0.0033571
-0.00405032
-0.00498479
-0.00597957
-0.00710397
-0.00830902
-0.0096702
-0.0112773
-0.0127265
-0.0143389
-0.0159084
-0.0175825
-0.0192079
-0.0206637
-0.0218965
-0.0228455
-0.0232618
-0.023163
-0.0228038
-0.0218863
-0.0203512
-0.0183245
-0.0160412
-0.0134618
-0.0109114
-0.00861063
-0.00704035
-0.00630244
-0.00583205
-0.00556516
-0.00530787
-0.00463533
-0.00378917
-0.00291395
-0.00228864
-0.00154517
-0.000982164
-0.000209162
0.000426005
0.00106214
0.00155831
0.00200831
0.0022851
0.00242125
0.0024396
0.00244073
0.00244934
0.00239106
0.00227089
0.0021428
0.00202787
0.00190906
0.00176868
0.00162837
0.00149656
0.0013852
0.001292
0.00121749
0.00115663
0.00110835
0.00106948
0.00105063
0.00104702
0.00099428
0.000949905
0.000893712
0.000824186
0.000737694
0.000629946
0.00049263
0.000327118
0.000137931
-8.29608e-05
-0.000342999
-0.000655416
-0.00103353
-0.00149741
-0.00203737
-0.00269039
-0.00343651
-0.00439572
-0.00555121
-0.00688627
-0.0084666
-0.0101843
-0.0121246
-0.0141838
-0.0159976
-0.0179598
-0.0193555
-0.0208595
-0.021989
-0.0226794
-0.0230982
-0.0226886
-0.020412
-0.0177091
-0.0146974
-0.0118827
-0.00956312
-0.00762273
-0.00655371
-0.00642521
-0.00668867
-0.00669683
-0.00637745
-0.0056915
-0.00447106
-0.00298119
-0.0013947
-0.000124276
0.000898559
0.00160142
0.00205454
0.00237946
0.00264402
0.00276254
0.00274972
0.00262203
0.00248785
0.00234041
0.00220195
0.00207842
0.00195489
0.00182755
0.0017053
0.0015928
0.00148142
0.00137746
0.00129501
0.00123646
0.0011792
0.00110649
0.00101026
0.000906334
0.000916277
0.000801768
0.000780042
0.000759879
0.000759625
0.000776487
0.000802958
0.000832674
0.000817526
0.000791317
0.000639745
0.000432121
7.01634e-05
-0.000377249
-0.00106272
-0.0018709
-0.00278912
-0.00364615
-0.00448476
-0.00537387
-0.00632116
-0.00729753
-0.00822653
-0.00916462
-0.0103067
-0.0117244
-0.0133441
-0.0150536
-0.0165781
-0.0177956
-0.0187055
-0.019066
-0.0193444
-0.019142
-0.0186178
-0.0174848
-0.0157928
-0.013549
-0.0111578
-0.00889148
-0.00712729
-0.00647
-0.00653339
-0.00661609
-0.00643809
-0.00597675
-0.00506502
-0.00372923
-0.00226881
-0.000949837
0.000161917
0.00114853
0.00179911
0.00191467
0.00164296
0.00149558
0.00164214
0.00191025
0.00216881
0.00232047
0.00241446
0.0024188
0.00235276
0.00225156
0.00215059
0.00206616
0.00198785
0.00188349
0.00172501
0.00149737
0.00124501
0.00103313
0.000910749
0.000873449
0.000913565
0.00097921
0.000973186
0.000916541
0.000779877
0.000529935
0.000287959
0.000118111
3.36449e-05
3.55695e-05
0.000120235
0.000222653
0.000274752
0.000244088
0.000141683
-3.94118e-06
-0.000194637
-0.000455118
-0.000722394
-0.00106549
-0.00160953
-0.00223754
-0.00302512
-0.00410333
-0.00505047
-0.00562983
-0.00610444
-0.00686166
-0.0076857
-0.00884971
-0.010493
-0.011714
-0.0132857
-0.0151347
-0.0163603
-0.0171846
-0.017186
-0.0164177
-0.0145439
-0.0117476
-0.00872046
-0.00741202
-0.00433453
-0.00141228
0.00260963
0.00728837
0.0119163
0.0161381
0.0193882
0.0224411
0.0244874
0.0262853
0.0273812
0.0278282
0.0276513
0.0275479
0.0271303
0.0264952
0.0258664
0.025154
0.0243612
0.0235346
0.0227718
0.0220836
0.021411
0.0206721
0.0198987
0.0191147
0.0183716
0.0175695
0.0166329
0.0156053
0.0143058
0.0127151
0.0107985
0.00855011
0.00600372
0.00322955
0.000336988
-0.00266945
-0.00584578
-0.00928597
-0.0130134
-0.0170273
-0.0213321
-0.0260062
-0.0312098
-0.0372487
-0.0438116
-0.0500479
-0.0552767
-0.0591159
-0.0612802
-0.0611572
)
;
boundaryField
{
inlet
{
type zeroGradient;
}
bottom
{
type zeroGradient;
}
outlet
{
type zeroGradient;
}
atmosphere
{
type totalPressure;
rho none;
psi none;
gamma 1;
p0 uniform 0;
value nonuniform List<scalar>
357
(
-0.00658813
-0.00603192
-0.00494201
-0.00342178
-0.00158135
-0.000442421
-5.05559e-06
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-6.26702e-06
-3.84866e-05
-0.000101652
-0.00020259
-0.000344817
-0.00055194
-0.000830827
-0.00120059
-0.00166173
-0.00223212
-0.00295215
-0.0037797
-0.0047909
-0.00590627
-0.00719378
-0.00867631
-0.0101632
-0.0117652
-0.0133508
-0.0149364
-0.0164329
-0.0178082
-0.0188647
-0.0195843
-0.0197602
-0.0196075
-0.0188411
-0.017357
-0.0151891
-0.0126668
-0.00983329
-0.00686792
-0.0041577
-0.0018647
-0.000450387
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-2.78746e-07
-1.51736e-05
-5.28432e-05
-0.000114108
-0.000199505
-0.000310921
-0.000450767
-0.000623251
-0.000832218
-0.00107017
-0.00135241
-0.00169153
-0.00209513
-0.00258048
-0.00316443
-0.00383084
-0.00463447
-0.00554987
-0.00667657
-0.00797748
-0.00944475
-0.0111265
-0.0128833
-0.0148167
-0.0167667
-0.0182977
-0.0198635
-0.020649
-0.0215235
-0.0218558
-0.0215442
-0.0208062
-0.0189997
-0.0155378
-0.0119371
-0.00829988
-0.0051242
-0.00274521
-0.00100497
-0.000137756
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-7.01422e-07
-3.98551e-06
-8.94291e-06
-1.62158e-05
-2.94147e-05
-5.28453e-05
-0.000100197
-0.000196787
-0.000339675
-0.000598358
-0.000952341
-0.00143915
-0.00205313
-0.00287529
-0.00375116
-0.00469779
-0.00557883
-0.00647689
-0.00745227
-0.00845461
-0.00944436
-0.010392
-0.0113727
-0.0125301
-0.0139208
-0.0154408
-0.016925
-0.018098
-0.0188377
-0.0191921
-0.0188977
-0.018451
-0.0173141
-0.0157294
-0.013441
-0.0105923
-0.00745708
-0.0044791
-0.00204506
-0.000476383
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-4.28579e-07
-2.12265e-05
-9.89328e-05
-0.000227789
-0.000414426
-0.000552014
-0.000631242
-0.000663712
-0.000638408
-0.000589187
-0.000584942
-0.000634255
-0.000746691
-0.000912386
-0.00110877
-0.00134475
-0.0016285
-0.00192768
-0.00232569
-0.00285873
-0.00340239
-0.00411602
-0.00504667
-0.005757
-0.00608543
-0.00623522
-0.00653175
-0.00683581
-0.00732539
-0.00799112
-0.00825499
-0.0085661
-0.00891025
-0.00885128
-0.00840692
-0.00737468
-0.00589778
-0.00391852
-0.00197162
-0.000605756
-1.0458e-05
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
-4.04537e-08
-1.55656e-05
-5.63908e-05
-0.000120901
-0.000207955
-0.000316014
-0.000443719
-0.000592448
-0.00076906
-0.000988546
-0.00123607
-0.00146757
-0.00164343
-0.00174192
-0.00175251
-0.00165406
)
;
}
frontBack
{
type empty;
}
}
// ************************************************************************* //
| [
"abenaz15@etudiant.mines-nantes.fr"
] | abenaz15@etudiant.mines-nantes.fr | |
fefe33766b04a472abf12cc5bbd161e80375929a | 7a99d9d0eb8798f65120238af13aca3b12ba8856 | /C++Code/string/iterator/rbeginAndRend/rbegin.cpp | eeeacef7680ac0710e918c5efa216ca5cc79a6e4 | [] | no_license | yangli1227/Code | 963b8cd0c289aaedf98d9191f9bc09b763a37ebd | 7471b05ef3aa817a9237ecad1b1511850e3697ae | refs/heads/master | 2020-08-23T04:46:24.357938 | 2019-06-03T10:10:04 | 2019-06-03T10:10:04 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 221 | cpp | #include <iostream>
int main()
{
std::string str = "hello world";
for (std::string::reverse_iterator it = str.rbegin(); it != str.rend(); it++)
{
std::cout << *it << " ";
}
std::cout << '\n';
return 0;
}
| [
"yk@localhost.localdomain"
] | yk@localhost.localdomain |
b29123daaab09703eb5b0f248a8ddc6bf45481c9 | 85fd36aaa4c11262839ce4d6d5a24285d8a30bdd | /9장 예외처리/unexpected.cpp | 8d47386e464f8eb263d178126b5e663c55a7eb30 | [] | no_license | ochestra365/C-study | b4cbdfbd145c8ccd632c4f7ff37bb97f794e9697 | 14726e1cbe334bb5a9d07b2688c6567bed7ee941 | refs/heads/main | 2023-06-22T06:51:57.417870 | 2021-07-15T06:32:51 | 2021-07-15T06:32:51 | 371,535,261 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 310 | cpp | #include <stdio.h>
#include <exception>
using namespace std;
void myunex() {
puts("발생해서는 안 되는 에러 발생");
exit(-2);
}
void calc() throw(int) {
throw "string";
}
int main() {
set_unexpected(myunex);
try {
calc();
}
catch (int) {
puts("정수형 예외 발생");
}
return 0;
} | [
"ochestra365@naver.com"
] | ochestra365@naver.com |
0a20f00e548428b6db508064219448412661adcc | aff897590667d3189dfe8033b8174dac9c3b58cf | /impeller/renderer/backend/vulkan/fence_waiter_vk.h | aecc5a63a81ccf93e0b1fbdc11e6ab3b9a4936fd | [
"BSD-3-Clause"
] | permissive | coltorchen/engine | 77621bf27d59bac032868f20c2fbd067984a470d | 8a38f536ff88232432511d28deb25ae1aaedf008 | refs/heads/main | 2023-06-08T18:26:35.893199 | 2023-06-02T09:08:10 | 2023-06-02T09:08:10 | 225,273,939 | 0 | 0 | BSD-3-Clause | 2019-12-02T03:06:36 | 2019-12-02T03:06:33 | null | UTF-8 | C++ | false | false | 1,382 | h | // Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#pragma once
#include <condition_variable>
#include <memory>
#include <optional>
#include <thread>
#include <unordered_map>
#include "flutter/fml/closure.h"
#include "flutter/fml/macros.h"
#include "impeller/base/thread.h"
#include "impeller/renderer/backend/vulkan/device_holder.h"
#include "impeller/renderer/backend/vulkan/shared_object_vk.h"
#include "impeller/renderer/backend/vulkan/vk.h"
namespace impeller {
class ContextVK;
class FenceWaiterVK {
public:
~FenceWaiterVK();
bool IsValid() const;
void Terminate();
bool AddFence(vk::UniqueFence fence, const fml::closure& callback);
private:
friend class ContextVK;
std::weak_ptr<DeviceHolder> device_holder_;
std::unique_ptr<std::thread> waiter_thread_;
std::mutex wait_set_mutex_;
std::condition_variable wait_set_cv_;
std::unordered_map<SharedHandleVK<vk::Fence>, fml::closure> wait_set_;
bool terminate_ = false;
bool is_valid_ = false;
explicit FenceWaiterVK(std::weak_ptr<DeviceHolder> device_holder);
void Main();
std::optional<std::vector<vk::Fence>> TrimAndCreateWaitSetLocked(
std::shared_ptr<DeviceHolder> device_holder);
FML_DISALLOW_COPY_AND_ASSIGN(FenceWaiterVK);
};
} // namespace impeller
| [
"noreply@github.com"
] | noreply@github.com |
7d4c5c8b97fd89e945e6703d638289563003b082 | 30e1dc84fe8c54d26ef4a1aff000a83af6f612be | /src/external/boost/boost_1_68_0/libs/config/test/no_cxx17_iterator_traits_pass.cpp | f97e79e1b8d06104bbeb08c3430e0b6e6d281473 | [
"BSL-1.0",
"BSD-3-Clause"
] | permissive | Sitispeaks/turicreate | 0bda7c21ee97f5ae7dc09502f6a72abcb729536d | d42280b16cb466a608e7e723d8edfbe5977253b6 | refs/heads/main | 2023-05-19T17:55:21.938724 | 2021-06-14T17:53:17 | 2021-06-14T17:53:17 | 385,034,849 | 1 | 0 | BSD-3-Clause | 2021-07-11T19:23:21 | 2021-07-11T19:23:20 | null | UTF-8 | C++ | false | false | 1,078 | cpp | // This file was automatically generated on Sun Jul 9 15:26:23 2017
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id$
//
// Test file for macro BOOST_NO_CXX17_ITERATOR_TRAITS
// This file should compile, if it does not then
// BOOST_NO_CXX17_ITERATOR_TRAITS should be defined.
// See file boost_no_cxx17_iterator_traits.ipp for details
// Must not have BOOST_ASSERT_CONFIG set; it defeats
// the objective of this file:
#ifdef BOOST_ASSERT_CONFIG
# undef BOOST_ASSERT_CONFIG
#endif
#include <boost/config.hpp>
#include "test.hpp"
#ifndef BOOST_NO_CXX17_ITERATOR_TRAITS
#include "boost_no_cxx17_iterator_traits.ipp"
#else
namespace boost_no_cxx17_iterator_traits = empty_boost;
#endif
int main( int, char *[] )
{
return boost_no_cxx17_iterator_traits::test();
}
| [
"noreply@github.com"
] | noreply@github.com |
9cf420ac51fe03d7e396ca220c545c6db61551dd | 07306d96ba61d744cb54293d75ed2e9a09228916 | /External/Scaleform/Src/Render/ImageFiles/JPEG_ImageReader.cpp | 8d14cdff05135f548d6c0a56701f5dd5bc6afff8 | [] | no_license | D34Dspy/warz-client | e57783a7c8adab1654f347f389c1dace35b81158 | 5262ea65e0baaf3f37ffaede5f41c9b7eafee7c1 | refs/heads/master | 2023-03-17T00:56:46.602407 | 2015-12-20T16:43:00 | 2015-12-20T16:43:00 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 25,173 | cpp | /**************************************************************************
Filename : JPEG_ImageReader.cpp
Content : JPEG ImageReader implementation
Created : June 24, 2005
Authors : Michael Antonov
Copyright : Copyright 2011 Autodesk, Inc. All Rights reserved.
Use of this software is subject to the terms of the Autodesk license
agreement provided at the time of installation or download, or which
otherwise accompanies this software in either electronic or hard copy form.
**************************************************************************/
#include "JPEG_ImageCommon.h"
#ifdef SF_ENABLE_LIBJPEG
namespace Scaleform { namespace Render { namespace JPEG {
// jpeglib data source constructors, for using File* instead
// of stdio for jpeg IO.
static void GJPEGUtil_SetupRwSource(jpeg_decompress_struct* pcinfo, File* pinstream);
static void GJPEGUtil_ReplaceRwSource(jpeg_decompress_struct* pcinfo, File* pinstream);
// ***** GPEG Input helper class
// A jpeglib source manager that reads from a File.
// Paraphrased from IJG jpeglib jdatasrc.c
class JPEGRwSource : public NewOverrideBase<Stat_Default_Mem>
{
public:
struct jpeg_source_mgr SMgr; // public fields
Ptr<File> pInStream; // source stream
bool StartOfFile; // have we gotten any data yet?
JOCTET Buffer[JPEG_BufferSize]; // start of Buffer
// Constructor. The caller is responsible for closing the input stream
// after it's done using us.
JPEGRwSource(File* pin)
{
pInStream = pin;
StartOfFile = 1;
// fill in function pointers...
SMgr.init_source = InitSource;
SMgr.fill_input_buffer = FillInputBuffer;
SMgr.skip_input_data = SkipInputData;
SMgr.resync_to_restart = jpeg_resync_to_restart; // use default method
SMgr.term_source = TermSource;
SMgr.bytes_in_buffer = 0;
SMgr.next_input_byte = NULL;
}
JPEGRwSource(const struct jpeg_source_mgr& smgr)
{
pInStream = 0;
StartOfFile = 1;
SMgr = smgr;
}
static void InitSource(j_decompress_ptr cinfo)
{
JPEGRwSource* psrc = (JPEGRwSource*) cinfo->src;
psrc->StartOfFile = true;
}
// Read data into our input Buffer. Client calls this
// when it needs more data from the file.
static boolean FillInputBuffer(j_decompress_ptr cinfo)
{
JPEGRwSource* psrc = (JPEGRwSource*) cinfo->src;
UPInt bytesRead = psrc->pInStream->Read(psrc->Buffer, JPEG_BufferSize);
if (bytesRead <= 0) {
// Is the file completely empty?
if (psrc->StartOfFile) {
// Treat this as a fatal error.
//throw "empty jpeg source stream.";
SF_DEBUG_WARNING(1, "empty jpeg source stream.");
return 0;
}
// Warn("jpeg end-of-stream");
// Insert a fake EOI marker.
psrc->Buffer[0] = (JOCTET) 0xFF;
psrc->Buffer[1] = (JOCTET) JPEG_EOI;
bytesRead = 2;
}
// Hack to work around SWF bug: sometimes data
// starts with FFD9FFD8, when it should be
// FFD8FFD9!
if (psrc->StartOfFile && bytesRead >= 4)
{
if (psrc->Buffer[0] == 0xFF
&& psrc->Buffer[1] == 0xD9
&& psrc->Buffer[2] == 0xFF
&& psrc->Buffer[3] == 0xD8)
{
psrc->Buffer[1] = 0xD8;
psrc->Buffer[3] = 0xD9;
}
}
// Expose Buffer state to clients.
psrc->SMgr.next_input_byte = psrc->Buffer;
psrc->SMgr.bytes_in_buffer = bytesRead;
psrc->StartOfFile = 0;
return TRUE;
}
// Called by client when it wants to advance past some
// uninteresting data.
static void SkipInputData(j_decompress_ptr cinfo, long numBytes)
{
JPEGRwSource* psrc = (JPEGRwSource*) cinfo->src;
// According to jpeg docs, large skips are
// infrequent. So let's just do it the simple
// way.
if (numBytes > 0)
{
while (numBytes > (long) psrc->SMgr.bytes_in_buffer)
{
numBytes -= (long) psrc->SMgr.bytes_in_buffer;
FillInputBuffer(cinfo);
}
// Handle remainder.
psrc->SMgr.next_input_byte += (UPInt) numBytes;
psrc->SMgr.bytes_in_buffer -= (UPInt) numBytes;
}
}
// Terminate the source. Make sure we get deleted.
static void TermSource(j_decompress_ptr cinfo)
{
SF_UNUSED(cinfo);
/*JPEGRwSource* psrc = (JPEGRwSource*) cinfo->src;
SF_ASSERT(psrc);
// @@ it's kind of bogus to be deleting here
// -- TermSource happens at the end of
// reading an image, but we're probably going
// to want to init a source and use it to read
// many images, without reallocating our Buffer.
delete psrc;
cinfo->src = NULL;*/
}
void DiscardPartialBuffer()
{
// Discard existing bytes in our Buffer.
SMgr.bytes_in_buffer = 0;
SMgr.next_input_byte = NULL;
}
};
// Set up the given decompress object to read from the given stream.
void GJPEGUtil_SetupRwSource(jpeg_decompress_struct* cinfo, File* pinstream)
{
// SF_ASSERT(cinfo->src == NULL);
cinfo->src = (jpeg_source_mgr*) SF_NEW JPEGRwSource(pinstream);
}
void GJPEGUtil_ReplaceRwSource(jpeg_decompress_struct* cinfo, File* pinstream)
{
// SF_ASSERT(cinfo->src == NULL);
JPEGRwSource* psrc = (JPEGRwSource*) cinfo->src;
delete psrc;
cinfo->src = (jpeg_source_mgr*) SF_NEW JPEGRwSource(pinstream);
}
// Basically this is a thin wrapper around JpegDecompress object.
class JPEGInputImpl_jpeglib : public Input
{
public:
// State needed for JPEGInput.
struct jpeg_decompress_struct CInfo;
struct JpegErrorHandler JErr;
private:
static int JpegCreateDecompress(jpeg_decompress_struct* pcinfo, JpegErrorHandler* pjerr);
static int JpegReadHeader(jpeg_decompress_struct* pcinfo, JpegErrorHandler* pjerr, bool require_image);
static void InitSource(j_decompress_ptr ) {}
static void TermSource(j_decompress_ptr ) {}
public:
bool CompressorOpened :1;
bool ErrorOccurred :1;
bool Initialized :1;
enum SWF_DEFINE_BITS_JPEG2 { SWF_JPEG2 };
enum SWF_DEFINE_BITS_JPEG2_HEADER_ONLY { SWF_JPEG2_HEADER_ONLY };
// Constructor. Read the header data from in, and
// prepare to read data.
JPEGInputImpl_jpeglib(File* pin)
{
Initialized = CompressorOpened = ErrorOccurred = false;
CInfo.err = SetupJpegErr(&JErr);
// Initialize decompression object.
if (!JpegCreateDecompress(&CInfo, &JErr))
return;
GJPEGUtil_SetupRwSource(&CInfo, pin);
if (!StartImage())
return;
Initialized = true;
}
// The SWF file format stores JPEG images with the
// encoding tables separate from the image data. This
// constructor reads the encoding table only and keeps
// them in this object. You need to call
// StartImage() and FinishImage() around any calls
// to GetWidth/height/components and ReadScanline.
JPEGInputImpl_jpeglib(SWF_DEFINE_BITS_JPEG2_HEADER_ONLY e, File* pin)
{
SF_UNUSED(e);
Initialized = CompressorOpened = ErrorOccurred = false;
CInfo.err = SetupJpegErr(&JErr);
// Initialize decompression object.
if (!JpegCreateDecompress(&CInfo, &JErr))
return;
GJPEGUtil_SetupRwSource(&CInfo, pin);
// Read the encoding tables.
if (!JpegReadHeader(&CInfo, &JErr, FALSE))
return;
// Don't start reading any image data!
// App does that manually using StartImage.
Initialized = true;
}
JPEGInputImpl_jpeglib(SWF_DEFINE_BITS_JPEG2_HEADER_ONLY e, const UByte* pbuf, UPInt bufSize)
{
SF_UNUSED(e);
struct jpeg_source_mgr smgr;
memset(&smgr, 0, sizeof(smgr));
smgr.bytes_in_buffer = bufSize;
smgr.next_input_byte = pbuf;
smgr.init_source = InitSource;
smgr.term_source = TermSource;
Initialized = CompressorOpened = ErrorOccurred = false;
CInfo.err = SetupJpegErr(&JErr);
// Initialize decompression object.
if (!JpegCreateDecompress(&CInfo, &JErr))
return;
CInfo.src = (jpeg_source_mgr*) SF_NEW JPEGRwSource(smgr);
// Read the encoding tables.
if (!JpegReadHeader(&CInfo, &JErr, FALSE))
return;
// Don't start reading any image data!
// App does that manually using StartImage.
Initialized = true;
}
// Destructor. Clean up our jpeg reader state.
~JPEGInputImpl_jpeglib()
{
FinishImage();
JPEGRwSource* psrc = (JPEGRwSource*) CInfo.src;
delete psrc;
CInfo.src = NULL;
jpeg_destroy_decompress(&CInfo);
}
bool HasError() const { return ErrorOccurred; }
bool IsValid() const { return Initialized && !HasError(); }
// Discard any data sitting in our JPEGInput Buffer. Use
// this before/after reading headers or partial image
// data, to avoid screwing up future reads.
void DiscardPartialBuffer()
{
JPEGRwSource* psrc = (JPEGRwSource*) CInfo.src;
// We only have to discard the JPEGInput Buffer after reading the tables.
if (psrc)
psrc->DiscardPartialBuffer();
}
// This is something you can do with "abbreviated"
// streams; i.e. if you constructed this inputter
// Using (SWFJPEG2HEADERONLY) to just load the
// tables, or if you called FinishImage() and want to
// load another image using the existing tables.
bool StartImage()
{
if (ErrorOccurred) return false;
SF_DEBUG_WARNING(CompressorOpened != false, "JPEGInput::StartImage - image already started");
SF_JPEG_SET_JMP1(this, false);
// Now, read the image header.
// MA: If already in READY state (202), don't call read_header. This makes
// loading work for SW8. Need to reseatcj JPeg integration further.
if (CInfo.global_state != 202)
jpeg_read_header(&CInfo, TRUE);
jpeg_start_decompress(&CInfo);
CompressorOpened = true;
return true;
}
bool StartRawImage()
{
if (ErrorOccurred) return false;
SF_DEBUG_WARNING(CompressorOpened != false, "JPEGInput::StartRawImage - image already started");
SF_JPEG_SET_JMP1(this, false);
// Now, read the image header.
// MA: If already in READY state (202), don't call read_header. This makes
// loading work for SW8. Need to reseatcj JPeg integration further.
if (CInfo.global_state != 202)
jpeg_read_header(&CInfo, TRUE);
CompressorOpened = true;
return true;
}
bool FinishImage()
{
if (ErrorOccurred) return false;
if (CompressorOpened)
{
SF_JPEG_SET_JMP1(this, false);
jpeg_finish_decompress(&CInfo);
CompressorOpened = false;
}
return true;
}
// Abort reading image if it wasn't finished yet.
bool AbortImage()
{
if (ErrorOccurred) return false;
if (CompressorOpened)
{
SF_JPEG_SET_JMP1(this, false);
jpeg_abort_decompress(&CInfo);
CompressorOpened = false;
}
return true;
}
// Return the height of the image. Take the data from our cinfo struct.
ImageSize GetSize() const
{
// SF_ASSERT(CompressorOpened);
return ImageSize(CInfo.output_width, CInfo.output_height);
}
// Return number of Components (i.e. == 3 for RGB
// data). The size of the data for a scanline is
// GetWidth() * GetComponents().
int GetComponents() const
{
// SF_ASSERT(CompressorOpened);
return CInfo.output_components;
}
// Read a scanline's worth of image data into the
// given Buffer. The amount of data read is
// GetWidth() * GetComponents().
bool ReadScanline(unsigned char* prgbData)
{
if (ErrorOccurred) return false;
SF_DEBUG_ERROR(CompressorOpened != true, "JPEGInput::ReadScanline - image not yet started");
SF_JPEG_SET_JMP1(this, false);
// SF_ASSERT(cinfo.OutputScanline < cinfo.OutputHeight);
int LinesRead = jpeg_read_scanlines(&CInfo, &prgbData, 1);
// SF_ASSERT(LinesRead == 1);
LinesRead = LinesRead; // avoid warning in NDEBUG
return true;
}
bool ReadRawData(void** pprawData)
{
if (ErrorOccurred) return false;
SF_JPEG_SET_JMP1(this, false);
jvirt_barray_ptr * src_coef_arrays = jpeg_read_coefficients(&CInfo);
*pprawData = src_coef_arrays;
return true;
}
void* GetCInfo() { return &CInfo; }
};
int JPEGInputImpl_jpeglib::JpegCreateDecompress(jpeg_decompress_struct* pcinfo,
JpegErrorHandler* pjerr)
{
SF_UNUSED(pjerr); // in case if SF_NO_LONGJMP is defined.
SF_JPEG_SET_JMP(pcinfo, pjerr, 0);
// Initialize decompression object.
jpeg_create_decompress(pcinfo);
return 1;
}
int JPEGInputImpl_jpeglib::JpegReadHeader(jpeg_decompress_struct* pcinfo,
JpegErrorHandler* pjerr, bool require_image)
{
SF_UNUSED(pjerr); // in case if SF_NO_LONGJMP is defined.
SF_JPEG_SET_JMP(pcinfo, pjerr, 0);
jpeg_read_header(pcinfo, require_image);
return 1;
}
static bool DecodeHelper(ImageFormat format, Input *jin,
ImageData* pdest, Image::CopyScanlineFunc copyScanline, void* arg)
{
ImageSize size = jin->GetSize();
bool success = false;
ImageScanlineBuffer<1024*4> scanline(Image_R8G8B8, size.Width, format);
if (scanline.IsValid() && !jin->HasError())
{
// Read data by-scanline and convert it.
success = true;
for (unsigned y = 0; y < size.Height; y++)
{
if (!jin->ReadScanline(scanline.GetReadBuffer()))
{
success = false;
break; // read error!
}
UByte* destScanline = pdest->GetScanline(y);
scanline.ConvertReadBuffer(destScanline, 0, copyScanline, arg);
}
}
delete jin;
return success;
}
//--------------------------------------------------------------------
// ***** JPEG::ImageSource
// Create either from stand-along file (save for file length)
// or from file buffer (user must provide size).
class ImageSource : public FileImageSource
{
mutable Input* pOriginalInput;
Ptr<ExtraData> pExtraData;
bool WithHeaders;
public:
ImageSource(File* file, ImageFormat format = Image_None, ExtraData* exd = 0, UInt64 len = 0, bool withHeaders = false)
: FileImageSource(file, format, len), pOriginalInput(0), pExtraData(exd), WithHeaders(withHeaders)
{
}
~ImageSource()
{
if (pOriginalInput)
{
// Since data wasn't processed, abort JPEG.
pOriginalInput->AbortImage();
delete pOriginalInput;
}
}
bool ReadHeader();
virtual bool Decode(ImageData* pdest, CopyScanlineFunc copyScanline, void* arg) const;
// Creates an image out of source that is compatible with argument Use,
// updateSync and other settings.
virtual Image* CreateCompatibleImage(const ImageCreateArgs& args);
virtual unsigned GetMipmapCount() const { return 1;}
};
bool ImageSource::ReadHeader()
{
SF_ASSERT(pOriginalInput == 0);
if (!pExtraData || !pExtraData->IsTableHeader())
{
if (!WithHeaders) // regular jpeg from file
pOriginalInput = FileReader::Instance.CreateInput(pFile);
else
{
// used by swf jpeg w/o alpha
pOriginalInput = FileReader::Instance.CreateSwfJpeg2HeaderOnly(pFile);
pOriginalInput->StartImage();
}
}
else
{
// used by swf jpeg w/splitted header
pOriginalInput = FileReader::Instance.CreateSwfJpeg2HeaderOnly(pExtraData->Data, pExtraData->Size);
if (!pOriginalInput)
return false;
struct jpeg_decompress_struct* cinfo = static_cast<struct jpeg_decompress_struct*>(pOriginalInput->GetCInfo());
// replace source by file.
GJPEGUtil_ReplaceRwSource(cinfo, pFile);
pOriginalInput->StartImage();
}
if (!pOriginalInput)
return false;
Size = pOriginalInput->GetSize();
if (Format == Image_None)
Format = Image_R8G8B8;
return true;
}
bool ImageSource::Decode(ImageData* pdest, CopyScanlineFunc copyScanline, void* arg) const
{
Input* jin = pOriginalInput;
// Small optimization - use original input to avoid it
// being created/destroyed an extra time on file loading.
if (jin)
{
pOriginalInput = 0;
}
else
{
if (!seekFileToDecodeStart())
return false;
jin = FileReader::Instance.CreateInput(pFile);
if (!jin) return 0;
}
return DecodeHelper(Format, jin, pdest, copyScanline, arg);
}
// ***** JPEG MemoryBufferImage
MemoryBufferImage::MemoryBufferImage(ImageFormat format, const ImageSize& size, unsigned use,
ImageUpdateSync* sync,
File* file, SInt64 filePos, UPInt length, bool headers)
: Render::MemoryBufferImage(format,size, use, sync,
file, filePos, length), pExtraData(0)
{
if (headers)
Flags |= Flag_Headers;
}
MemoryBufferImage::MemoryBufferImage(ExtraData* exd, ImageFormat format, const ImageSize& size, unsigned use,
ImageUpdateSync* sync,
File* file, SInt64 filePos, UPInt length)
: Render::MemoryBufferImage(format,size, use, sync,
file, filePos, length), pExtraData(exd)
{
if (pExtraData)
{
pExtraData->AddRef();
if (pExtraData->IsTableHeader())
Flags |= Flag_Headers;
}
}
MemoryBufferImage::MemoryBufferImage(ExtraData* exd, ImageFormat format, const ImageSize& size, unsigned use,
ImageUpdateSync* sync,
const UByte* data, UPInt len)
: Render::MemoryBufferImage(format,size, use, sync, data, len),
pExtraData(exd)
{
if (pExtraData)
{
pExtraData->AddRef();
if (pExtraData->IsTableHeader())
Flags |= Flag_Headers;
}
}
MemoryBufferImage::~MemoryBufferImage()
{
if ((Flags & Mask_Flags) && GetExtraData())
GetExtraData()->Release();
}
ExtraData* MemoryBufferImage::GetExtraData() const
{
union
{
ExtraData* pExtraData;
UPInt Flags; // only 2 low bits can be used!
} u;
u.Flags = (Flags & (~Mask_Flags));
return u.pExtraData;
}
bool MemoryBufferImage::Decode(ImageData* pdest, CopyScanlineFunc copyScanline, void* arg) const
{
MemoryFile file(FilePath, &FileData[0], (int)FileData.GetSize());
Input* jin;
if (GetExtraData() == 0)
{
// swf jpeg no alpha
jin = FileReader::Instance.CreateSwfJpeg2HeaderOnly(&file);
if (jin)
jin->StartImage();
}
else
{
// used by swf jpeg w/splitted header
jin = FileReader::Instance.CreateSwfJpeg2HeaderOnly(GetExtraData()->Data, GetExtraData()->Size);
struct jpeg_decompress_struct* cinfo = static_cast<struct jpeg_decompress_struct*>(jin->GetCInfo());
// replace source by file.
GJPEGUtil_ReplaceRwSource(cinfo, &file);
if (jin)
jin->StartImage();
}
if (!jin) return 0;
return DecodeHelper(Format, jin, pdest, copyScanline, arg);
}
Image* ImageSource::CreateCompatibleImage(const ImageCreateArgs& args)
{
if (IsDecodeOnlyImageCompatible(args))
{
if (pExtraData)
return SF_HEAP_NEW(args.GetHeap())
MemoryBufferImage(pExtraData, GetFormat(), GetSize(),
args.Use, args.GetUpdateSync(),
pFile, FilePos, (UPInt)FileLen);
else
return SF_HEAP_NEW(args.GetHeap())
MemoryBufferImage(GetFormat(), GetSize(),
args.Use, args.GetUpdateSync(),
pFile, FilePos, (UPInt)FileLen, WithHeaders);
}
return Render::ImageSource::CreateCompatibleImage(args);
}
class WrapperImageSource : public Render::WrapperImageSource
{
mutable Input* pOriginalInput;
public:
WrapperImageSource(Image* pdelegate) : Render::WrapperImageSource(pdelegate), pOriginalInput(0) {}
~WrapperImageSource()
{
if (pOriginalInput)
{
// Since data wasn't processed, abort JPEG.
pOriginalInput->AbortImage();
delete pOriginalInput;
}
}
bool ReadHeader();
};
bool WrapperImageSource::ReadHeader()
{
SF_ASSERT(pOriginalInput == 0);
Render::MemoryBufferImage* img = pDelegate->GetAsMemoryImage();
if (img)
{
const UByte* fileData;
UPInt fileSz;
img->GetImageDataBits(&fileData, &fileSz);
pOriginalInput = FileReader::Instance.CreateSwfJpeg2HeaderOnly(fileData, fileSz);
if (!pOriginalInput)
return false;
pOriginalInput->StartImage();
img->SetImageSize(pOriginalInput->GetSize());
if (img->GetFormat() == Image_None)
img->SetFormat(Image_R8G8B8);
return true;
}
return false;
}
//--------------------------------------------------------------------
// ***** FileReader
bool FileReader::MatchFormat(File* file, UByte* headerArg, UPInt headerArgSize) const
{
FileHeaderReader<2> header(file, headerArg, headerArgSize);
if (!header || (header[0] != 0xFF) || (header[1] != 0xD8))
return false;
return true;
}
Render::ImageSource* FileReader::CreateImageSource(File* file, const ImageCreateArgs& args,
ExtraData* exd, UInt64 len, bool withHeaders) const
{
if (!file || !file->IsValid())
return 0;
JPEG::ImageSource* source = SF_NEW JPEG::ImageSource(file, args.Format, exd, len, withHeaders);
if (source && !source->ReadHeader())
{
source->Release();
source = 0;
}
return source;
}
Render::MemoryBufferImage* FileReader::CreateMemoryBufferImage
(File* file, const ImageCreateArgs& args, const ImageSize& sz, UInt64 length)
{
return SF_HEAP_NEW(args.GetHeap())
MemoryBufferImage(Image_None, sz,
args.Use, args.GetUpdateSync(),
file, file->LTell(), (UPInt)length);
}
Render::ImageSource* FileReader::CreateWrapperImageSource(Render::Image* memImage) const
{
JPEG::WrapperImageSource* source = SF_NEW JPEG::WrapperImageSource(memImage);
if (source && !source->ReadHeader())
{
source->Release();
source = 0;
}
return source;
}
Render::ImageSource* FileReader::ReadImageSource(File* file, const ImageCreateArgs& args) const
{
if (!file || !file->IsValid())
return 0;
JPEG::ImageSource* source = SF_NEW JPEG::ImageSource(file, args.Format);
if (source && !source->ReadHeader())
{
source->Release();
source = 0;
}
return source;
}
Input* FileReader::CreateInput(File* pin) const
{
if (!pin || !pin->IsValid()) return 0;
JPEGInputImpl_jpeglib* jpegInput = SF_NEW JPEGInputImpl_jpeglib(pin);
if (jpegInput && jpegInput->IsValid())
return jpegInput;
delete jpegInput;
return NULL;
}
Input* FileReader::CreateSwfJpeg2HeaderOnly(File* pin) const
{
if (!pin || !pin->IsValid()) return 0;
JPEGInputImpl_jpeglib* jpegInput = SF_NEW JPEGInputImpl_jpeglib(JPEGInputImpl_jpeglib::SWF_JPEG2_HEADER_ONLY, pin);
if (jpegInput && jpegInput->IsValid())
return jpegInput;
delete jpegInput;
return NULL;
}
Input* FileReader::CreateSwfJpeg2HeaderOnly(const UByte* pbuffer, UPInt bufSize) const
{
JPEGInputImpl_jpeglib* jpegInput = SF_NEW JPEGInputImpl_jpeglib(JPEGInputImpl_jpeglib::SWF_JPEG2_HEADER_ONLY,
pbuffer, bufSize);
if (jpegInput && jpegInput->IsValid())
return jpegInput;
delete jpegInput;
return NULL;
}
// Singleton instance.
FileReader FileReader::Instance;
}}} // namespace Scaleform::Render::JPEG
#endif // SF_ENABLE_LIBJPEG
| [
"hasan@openkod.com"
] | hasan@openkod.com |
a43bb9ca295c4df2acc487566c69fae20a856ce3 | 1cba84ed71ab68d8aa199ffe72764f1d8535e76c | /NeuralNetwork_Dauphine_5A/NN2.cpp | a308e6541416966c71d0ee9b2d45f22d2627a94e | [] | no_license | irisjoliman/NeuralNetwork | 477c6994da04125444260c791d08dd0dc97a0d1f | ef5683fa9a657fba4dbf5d55c085fc1ecf5a3639 | refs/heads/master | 2022-09-18T02:13:18.824808 | 2020-06-01T20:36:57 | 2020-06-01T20:36:57 | 259,097,326 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 2,096 | cpp | #include "pch.h"
#include "NN2.h"
#include <iostream>
#include <string>
#include "Input_intermediaire.h"
NN2::NN2()
{
}
NN2::NN2(int taille_input, int nbr_cat, int nbr_perceptron_c, Fonction_activation * f)
{
if (taille_input != 4 && taille_input != 784) {
throw std::string("Erreur dans la sélection de la taille d'input");
}
else {
if (nbr_cat != 10 && nbr_cat != 3) {
throw std::string("Erreur dans le nombre de catégorie");
}
else {
this->nbr_perceptron = nbr_cat;
this->nbr_perceptron_cachee = nbr_perceptron_c;
this->perceptron_list = new Perceptron[nbr_perceptron];
this->perceptron_cachee_list = new Perceptron_cachee[nbr_perceptron_c];
for (int i = 0; i < nbr_perceptron; i++) {
Perceptron p = Perceptron(taille_input, f, i);
this->perceptron_list[i] = p;
}
for (int i = 0; i < nbr_perceptron_c; i++) {
std::vector<Perceptron> couche_sortie = std::vector<Perceptron>(); // on met quoi dedans ?
Perceptron_cachee p = Perceptron_cachee(taille_input, f, i, couche_sortie);
this->perceptron_cachee_list[i] = p;
}
}
}
}
NN2::~NN2()
{
}
char NN2::evaluation(Input & input)
{
double max = 0;
int indice_max = 0;
Input_intermediaire input_int(input.get_label());
for (int i = 0; i < this->nbr_perceptron_cachee; i++) {
double valeur = this->perceptron_cachee_list[i].forward(input);
input_int.add(valeur);
}
for (int i = 0; i < this->nbr_perceptron; i++) {
double valeur = this->perceptron_list[i].forward(input_int);
if (valeur > max) {
max = valeur;
indice_max = i;
}
}
return(std::to_string(indice_max)[0]);
}
void NN2::apprentissage(Input & input, double mu)
{
Input_intermediaire input_int(input.get_label());
for (int i = 0; i < this->nbr_perceptron; i++) {
this->perceptron_list[i].calcul_delta(input_int);
}
for (int i = 0; i < this->nbr_perceptron_cachee; i++) {
this->perceptron_cachee_list[i].calcul_delta(input);
this->perceptron_cachee_list[i].backprop(input, mu);
}
for (int i = 0; i < this->nbr_perceptron; i++) {
this->perceptron_list[i].backprop(input_int, mu);
}
}
| [
"iris.joliman@dauphine.eu"
] | iris.joliman@dauphine.eu |
327fd462060a360c4ceda5156e353a37ee10c716 | 39307a4c1cfc41def8137d7c6cf06fc5f9adad5d | /Lilith/src/Lilith/Debug/Instrumentor.h | 1ddc8d9db275cf8b010312847a178a7d4893c05b | [
"Apache-2.0"
] | permissive | Murgn/Lilith | dd9f6141a8e50a849bbeec7ee4bb2e3ece33a5b6 | 3a57ce8e7ea2706649e56703c91ad8f05de42f98 | refs/heads/main | 2023-07-20T14:24:28.136550 | 2021-09-04T19:22:51 | 2021-09-04T19:22:51 | 394,475,012 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 3,937 | h | #pragma once
#include <string>
#include <chrono>
#include <algorithm>
#include <fstream>
#include <thread>
namespace Lilith {
struct ProfileResult
{
std::string Name;
long long Start, End;
uint32_t ThreadID;
};
struct InstrumentationSession
{
std::string Name;
};
class Instrumentor
{
private:
InstrumentationSession* m_CurrentSession;
std::ofstream m_OutputStream;
int m_ProfileCount;
public:
Instrumentor()
: m_CurrentSession(nullptr), m_ProfileCount(0)
{
}
void BeginSession(const std::string& name, const std::string& filepath = "results.json")
{
m_OutputStream.open(filepath);
WriteHeader();
m_CurrentSession = new InstrumentationSession{ name };
}
void EndSession()
{
WriteFooter();
m_OutputStream.close();
delete m_CurrentSession;
m_CurrentSession = nullptr;
m_ProfileCount = 0;
}
void WriteProfile(const ProfileResult& result)
{
if (m_ProfileCount++ > 0)
m_OutputStream << ",";
std::string name = result.Name;
std::replace(name.begin(), name.end(), '"', '\'');
m_OutputStream << "{";
m_OutputStream << "\"cat\":\"function\",";
m_OutputStream << "\"dur\":" << (result.End - result.Start) << ',';
m_OutputStream << "\"name\":\"" << name << "\",";
m_OutputStream << "\"ph\":\"X\",";
m_OutputStream << "\"pid\":0,";
m_OutputStream << "\"tid\":" << result.ThreadID << ",";
m_OutputStream << "\"ts\":" << result.Start;
m_OutputStream << "}";
m_OutputStream.flush();
}
void WriteHeader()
{
m_OutputStream << "{\"otherData\": {},\"traceEvents\":[";
m_OutputStream.flush();
}
void WriteFooter()
{
m_OutputStream << "]}";
m_OutputStream.flush();
}
static Instrumentor& Get()
{
static Instrumentor instance;
return instance;
}
};
class InstrumentationTimer
{
public:
InstrumentationTimer(const char* name)
: m_Name(name), m_Stopped(false)
{
m_StartTimepoint = std::chrono::high_resolution_clock::now();
}
~InstrumentationTimer()
{
if (!m_Stopped)
Stop();
}
void Stop()
{
auto endTimepoint = std::chrono::high_resolution_clock::now();
long long start = std::chrono::time_point_cast<std::chrono::microseconds>(m_StartTimepoint).time_since_epoch().count();
long long end = std::chrono::time_point_cast<std::chrono::microseconds>(endTimepoint).time_since_epoch().count();
uint32_t threadID = std::hash<std::thread::id>{}(std::this_thread::get_id());
Instrumentor::Get().WriteProfile({ m_Name, start, end, threadID });
m_Stopped = true;
}
private:
const char* m_Name;
std::chrono::time_point<std::chrono::high_resolution_clock> m_StartTimepoint;
bool m_Stopped;
};
}
// NOTE: Use chrome://tracing to view data!
#define LI_PROFILE 1
#if LI_PROFILE
#define LI_PROFILE_BEGIN_SESSION(name, filepath) ::Lilith::Instrumentor::Get().BeginSession(name, filepath)
#define LI_PROFILE_END_SESSION() ::Lilith::Instrumentor::Get().EndSession()
#define LI_PROFILE_SCOPE(name) ::Lilith::InstrumentationTimer timer##__LINE__(name);
#define LI_PROFILE_FUNCTION() LI_PROFILE_SCOPE(__FUNCSIG__)
#else
#define LI_PROFILE_BEGIN_SESSION(name, filepath)
#define LI_PROFILE_END_SESSION()
#define LI_PROFILE_SCOPE(name)
#define LI_PROFILE_FUNCTION()
#endif | [
"68158297+Murgn@users.noreply.github.com"
] | 68158297+Murgn@users.noreply.github.com |
535090fab7936fb3b7ce1560cd1565f64ec9a717 | bb1c9d8f47789137ce7269fdd056992f7848fed0 | /docs/qosprovider/c++/code/qos_provider.cpp | 3bd546394d390004a05d935f1552530b1901a983 | [
"Apache-2.0"
] | permissive | osrf/opensplice | e37ed7e1a24ece7c0f480b4807cd95d3ee18daad | 7c3466f76d083cae38a6d7fcbba1c29106a43ea5 | refs/heads/osrf-6.9.0 | 2021-01-15T14:20:20.065297 | 2020-05-11T18:05:53 | 2020-05-11T18:05:53 | 16,789,031 | 10 | 13 | Apache-2.0 | 2020-05-11T18:05:54 | 2014-02-13T02:13:20 | C | UTF-8 | C++ | false | false | 1,833 | cpp | #include <stdio.h>
#include <stdlib.h>
#include "ccpp_dds_dcps.h"
#include "QosProvider.h"
using namespace DDS;
int
main (void)
{
QosProvider_var provider = NULL;
DataReaderQos drQos;
DataWriterQos dwQos;
DataWriterQos dwBarQos;
ReturnCode_t result;
provider = new QosProvider ("file://path/to/file.xml", "FooQosProfile");
if (provider == NULL) {
printf ("Out of memory or syntax error in XML file");
exit (EXIT_FAILURE);
} else {
// As default QoS profile is "FooQosProfile", requesting
// "TransientKeepLast" in this case is equivalent to requesting
// "::FooQosProfile::TransientKeepLast".
result = provider->get_datareader_qos (drQos, "TransientKeepLast");
if(result != RETCODE_OK){
printf ("Unable to resolve ReaderQos.");
exit (EXIT_FAILURE);
}
// As default QoS profile is "FooQosProfile", requesting
// "Transient" would have been equivalent to requesting
// "::FooQosProfile::Transient".
result = provider->get_datawriter_qos (dwQos, "::FooQosProfile::Transient");
if(result != RETCODE_OK){
printf ("Unable to resolve WriterQos.");
exit (EXIT_FAILURE);
}
// As default QoS profile is "FooQosProfile" it is necessary
// to use the fully-qualified name to get access to QoS-ses from
// the "BarQosProfile".
result = provider->get_datawriter_qos (dwBarQos, "::BarQosProfile::Persistent");
if(result != RETCODE_OK){
printf ("Unable to resolve WriterQos.");
exit (EXIT_FAILURE);
}
// Create DDS DataReader with drQos DataReaderQos,
// DDS DataWriter with dwQos DataWriterQos and
// DDS DataWriter with dwBarQos DataWriterQos
return result;
}
}
| [
"michiel.beemster@prismtech.com"
] | michiel.beemster@prismtech.com |
5ee378d158b15baa405528690f65bbf78df10f05 | a18362424d796737ba13f6279f68dd078170d13a | /leetcode/p867.cpp | c24b407dccdb05e976378243903f4003ebfd7e01 | [] | no_license | liaobnb/Byteme | d11195f8ce3d615a34dfad31fe0867a38d7a7f59 | 9b6391b15d6ec241299704e06ac085d3ab632294 | refs/heads/master | 2020-04-14T15:23:31.868867 | 2019-01-03T01:22:06 | 2019-01-03T01:22:06 | 163,924,954 | 1 | 0 | null | 2019-01-03T04:56:17 | 2019-01-03T04:56:17 | null | UTF-8 | C++ | false | false | 322 | cpp | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
vector<vector<int>> transpose(vector<vector<int>>& aa) {
int m = sz(aa), n = sz(aa[0]);
vvi res (n, vi(m, 0));
fori (i, 0, n) {
fori (j, 0, m)
res[i][j] = aa[j][i];
}
return res;
}
};
int main() {
return 0;
}
| [
"landcold7@gmail.com"
] | landcold7@gmail.com |
a6f88be1b190d489d0eeac332c0291f5ee1776ba | 40aee99c2674f121c15ac23cde6bd736d1e418e6 | /devices/Keyence/KeyenceFake.cpp | 710860bf0262a6a271ddd1ad9f898359a01690c9 | [] | no_license | ksbeerna/cmstkmodlab | 1510e56a965bee9b6f42baaa1d863c5d0a2f311b | 90ce9c3867b856e85b66e4e73994e79fce49b351 | refs/heads/master | 2020-12-06T17:22:11.349564 | 2016-09-27T15:01:08 | 2016-09-27T15:01:08 | 45,681,511 | 0 | 0 | null | 2015-11-06T12:45:23 | 2015-11-06T12:45:22 | null | UTF-8 | C++ | false | false | 11,363 | cpp | #include <unistd.h>
#include <cmath>
#include <sstream>
#include <iostream>
#include "KeyenceFake.h"
#define KEYENCEDEBUG 1
KeyenceFake::KeyenceFake( const ioport_t ioPort )
:VKeyence(ioPort),
isDeviceAvailable_(false)
{
samplingRate_ = 20;
averagingRate_ = 1;
comHandler_ = new KeyenceComHandler( ioPort );
DeviceInit();
}
KeyenceFake::~KeyenceFake()
{
if(comHandler_) {delete comHandler_; comHandler_ = NULL;}
}
bool KeyenceFake::DeviceAvailable() const
{
return isDeviceAvailable_;
}
// low level debugging methods
void KeyenceFake::SendCommand(const std::string & command)
{
#ifdef KEYENCEDEBUG
std::cout << "SendCommand: " << command << std::endl;
#endif
comHandler_->SendCommand(command.c_str());
}
void KeyenceFake::ReceiveString(std::string & buffer)
{
usleep(1000);
char temp[1000];
comHandler_->ReceiveString(buffer, temp, samplingRate_, averagingRate_);
StripBuffer(buffer);
#ifdef KEYENCEDEBUG
std::cout << "ReceiveCommand: " << buffer << std::endl;
#endif
}
//ABLE -> automatic adjustement of light intensity to surface
//set on head 1 or head 2 -> out
//on = 0 = AUTO, on = 1 = MANUAL
//only in communication mode
void KeyenceFake::SetABLE(bool on, int out)
{
if(!comMode_){ChangeToCommunicationMode(true);}
std::string response = SetValue("SW,HA,M,",out,on);
if(response != "SW,HA"){
std::cerr << "[KeyenceFake::SetABLE] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
ChangeToCommunicationMode(false);
}
/*Set the measurement mode depending on the material of the target sample
set on head 1 or head 2 -> out
mode = 0 -> normal
mode = 1 -> translucent object
mode = 2 -> transparent object
mode = 3 -> transparent object 2
mode = 4 -> multi-reflective object
*/
void KeyenceFake::SetMaterialMode(int out, int mode)
{
if(!comMode_){ChangeToCommunicationMode(true);}
std::string response = SetValue("SW,HB,",out, mode);
if(response != "SW,HB"){
std::cerr << "[KeyenceFake::SetMaterialMode] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
ChangeToCommunicationMode(false);
}
/*Change settings if target sample is a mirror
set on head 1 or head 2 -> out
mode = 0 -> diffuse = normal
mode = 1 -> mirror reflection mode
*/
void KeyenceFake::SetDiffuseMode(int out, int mode)
{
if(!comMode_){ChangeToCommunicationMode(true);}
std::string response = SetValue("SW,HE,",out,mode);
if(response != "SW,HE"){
std::cerr << "[KeyenceFake::SetDiffuseMode] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
ChangeToCommunicationMode(false);
}
/*
Frequency of internal measurements
mode = 0 -> 20 microsec
mode = 1 -> 50 microsec
mode = 2 -> 100 microsec
mode = 3 -> 200 microsec
mode = 4 -> 500 microsec
mode = 5 -> 1000 microsec
only in communication mode
*/
void KeyenceFake::SetSamplingRate(int mode)
{
if(!comMode_){ChangeToCommunicationMode(true);}
std::string response = SetValue("SW,CA,",mode);
if(response != "SW,CA"){
std::cerr << "[KeyenceFake::SetSamplingRate] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}else{
switch(mode){
case 0 : samplingRate_ = 20; break;
case 1 : samplingRate_ = 50; break;
case 2 : samplingRate_ = 100; break;
case 3 : samplingRate_ = 200; break;
case 4 : samplingRate_ = 500; break;
case 5 : samplingRate_ = 1000; break;
default : samplingRate_ = 20;
}
}
ChangeToCommunicationMode(false);
}
/*
Number of internal measurements to average to output measurement
mode = 0 -> average over 1
mode = 1 -> 4
mode = 2 -> 16
mode = 3 -> 64
mode = 4 -> 256
mode = 5 -> 1024
mode = 6 -> 4096
mode = 7 -> 16384
mode = 8 -> 65536
mode = 9 -> 262144
only in communication mode
*/
void KeyenceFake::SetAveraging(int out, int mode)
{
if(!comMode_){ChangeToCommunicationMode(true);}
std::string response = SetValue("SW,OC,",out,"0",mode);
if(response != "SW,OC"){
std::cerr << "[KeyenceFake::SetAveraging] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}else{
switch(mode){
case 0 : averagingRate_ = 1;
case 1 : averagingRate_ = 4;
case 2 : averagingRate_ = 16;
case 3 : averagingRate_ = 64;
case 4 : averagingRate_ = 256;
case 5 : averagingRate_ = 1024;
case 6 : averagingRate_ = 4096;
case 7 : averagingRate_ = 16384;
case 8 : averagingRate_ = 65536;
case 9 : averagingRate_ = 262144;
default : averagingRate_ = 1;
}
}
ChangeToCommunicationMode(false);
}
//normal mode (commOn = 0) -> measurements can be received, writing or reading system settings is not accepted
//communication mode (commOn = 1) -> no measurement possible, writing and reading system settings is possible
void KeyenceFake::ChangeToCommunicationMode(bool commOn)
{
std::string response;
if(commOn){
response = SetValue("Q0");
if(response != "Q0"){
std::cerr << "[KeyenceFake::ChangeToCommunicationMode] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
comMode_ = true;
}else{
response = SetValue("R0");
if(response != "R0"){
std::cerr << "[KeyenceFake::ChangeToCommunicationMode] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
comMode_ = false;
}
}
void KeyenceFake::MeasurementValueOutput(int out, double & value)
{
std::string response = SetValue("M",out);
if(response.find("ER") != std::string::npos || response.find("M") == std::string::npos ){
std::cerr << "[KeyenceFake::MeasurementValueOutput] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
if(response.substr(3,8).find("F") != std::string::npos){
std::cerr << "[KeyenceFake::MeasurementValueOutput] ** ERROR: laser out of range, please adjust position "
<< std::endl;
value = 9999;
throw response.substr(3,8);
}else{
std::istringstream is(response.substr(3,8));
double temp;
is >> temp;
value = temp;
}
}
//lock the panel on the controller to avoid accidental pushing of buttons
void KeyenceFake::PanelLock(int status)
{
std::string response = SetValue("KL,", status);
if(response != "KL"){
std::cerr << "[KeyenceFake::PanelLock] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
void KeyenceFake::StripBuffer(std::string &buffer) const
{
if(buffer.size() == 0){return;}
if(buffer.at(buffer.size() - 1) == '\r'){buffer.erase(buffer.size() - 1);}
}
//No version checking for KeyenceFake laser available
void KeyenceFake::DeviceInit()
{
isDeviceAvailable_ = false;
if (comHandler_->DeviceAvailable()) {
isDeviceAvailable_ = true;
}
this->ChangeToCommunicationMode(false);
}
void KeyenceFake::Reset(int out)
{
std::string response = SetValue("VR,", out);
if(response != "VR"){
std::cerr << "[KeyenceFake::Reset] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
void KeyenceFake::ProgramChange(int prog_number)
{
std::string response = SetValue("PW,",prog_number);
if(response != "PW"){
std::cerr << "[KeyenceFake::ProgramChange] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
void KeyenceFake::ProgramCheck(int & value)
{
std::string response = SetValue("PR");
if(response.find("ER") != std::string::npos || response.find("PR") == std::string::npos ){
std::cerr << "[KeyenceFake::ProgramCheck] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
std::istringstream is(response.substr(3,1));
int temp;
is >> temp;
value = temp;
}
/*
void KeyenceFake::Timing(int out, int status)
{
std::string response = SetValue("T", status, out);
std::ostringstream os;
os << "T" << status;
if(response != os.str()){
std::cerr << "[KeyenceFake::Timing] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
void KeyenceFake::AutoZero(int out, bool status)
{
std::string response;
if(status){
response = SetValue("V", out);
std::ostringstream os;
os << "V" << out;
if(response != os.str()){
std::cerr << "[KeyenceFake::AutoZero] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}else{
response = SetValue("W", out);
std::ostringstream os;
os << "W" << out;
if(response != os.str()){
std::cerr << "[KeyenceFake::AutoZero] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
}
*/
/*
//FIX ME!!!
void KeyenceFake::StatResultOutput(int out, std::string value)
{
std::string response = SetValue("DO,", out, value);
if(response != "PW"){
std::cerr << "[KeyenceFake::StatResultOutput] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
void KeyenceFake::ClearStat(int out)
{
std::string response = SetValue("DQ,", out);
std::stringstream os;
os << "DQ," << out;
if(response != os.str()){
std::cerr << "[KeyenceFake::ClearStat] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
void KeyenceFake::StartDataStorage()
{
std::string response = SetValue("AS");
if(response != "AS"){
std::cerr << "[KeyenceFake::StartDataStorage] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
void KeyenceFake::StopDataStorage()
{
std::string response = SetValue("AP");
if(response != "AP"){
std::cerr << "[KeyenceFake::StopDataStorage] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
void KeyenceFake::InitDataStorage()
{
std::string response = SetValue("AQ");
if(response != "AQ"){
std::cerr << "[KeyenceFake::InitDataStorage] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
//FIX ME
void KeyenceFake::OutputDataStorage(int out, std::vector<double> values)
{
std::string response = SetValue("AO,",out,values);
if(response != "PW"){
std::cerr << "[KeyenceFake::OutputDataStorage] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
/*
//FIX ME
void KeyenceFake::DataStorageStatus(std::string value)
{
std::string response = SetValue("AN",value);
if(response != "PW"){
std::cerr << "[KeyenceFake::DataStorageStatus] ** ERROR: could not be executed, response : "
<< response
<< std::endl;
return;
}
}
*/
| [
"andreas@mussgiller.de"
] | andreas@mussgiller.de |
511250a4d6f473ed89836f49ff6c49cc0fe26faa | 99e494d9ca83ebafdbe6fbebc554ab229edcbacc | /.history/Day 2/Practice/Answers/MinimumWasteCells_20210305182754.cpp | e4655fcbb1a4dd9153bca725aa838342f9293ec9 | [] | no_license | Datta2901/CCC | c0364caa1e4937bc7bce68e4847c8d599aef0f59 | 4debb2c1c70df693d0e5f68b5798bd9c7a7ef3dc | refs/heads/master | 2023-04-19T10:05:12.372578 | 2021-04-23T12:50:08 | 2021-04-23T12:50:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 464 | cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
string name;
getline(cin,name);
int size = name.size();
int n = ceil(sqrt(size));
// cout << size << " " << n << endl;
int index = 0;
for(int i = 0; i < n; i++){
for(int j = 0; j < n; j++){
if(index < n * n){
cout << name[index++];
}else{
cout <<
}
}
cout << endl;
}
return 0;
} | [
"manikanta2901@gmail.com"
] | manikanta2901@gmail.com |
e61eaf4ede92716fe346a425d00abf0bd1b10ddf | 46020fd825fb670dda987db2b4d4f792ae378302 | /HorizontalScroll.cpp | f53ad1833099ea73856aa2f564d13876a2bfe18a | [] | no_license | hjc0127/Note | 1d68f6e0cb3abf328391519b9d65dc9fdc8e3b6d | 41fcdff19bcbe7e9cd9c91d4c1da9711ac510e5c | refs/heads/master | 2021-08-26T09:27:45.970547 | 2017-11-23T01:54:26 | 2017-11-23T01:54:26 | 111,749,591 | 0 | 0 | null | null | null | null | UHC | C++ | false | false | 17,365 | cpp | // HorizontalScroll.cpp
#include "HorizontalScroll.h"
#include "Caret.h"
#include "CharacterFaces.h"
#include "PageForm.h"
#include "Note.h"
HorizontalScroll::HorizontalScroll(OtherNoteForm *otherNoteForm)
:Scroll(otherNoteForm) {
CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->scrollBar->Create(SBS_HORZ, CRect(rect.left, rect.bottom-20, rect.right-20, rect.bottom), this->otherNoteForm, 1);
/*Caret *caret = Caret::Instance(0);
CharacterFaces *characterFaces = CharacterFaces::Instance(0);*/
//Long tabWidth = characterFaces->GetCharacterSize(97).GetWidth();
SCROLLINFO scrinfo;
scrinfo.cbSize = sizeof(scrinfo);
scrinfo.fMask = SIF_ALL;
scrinfo.nMin = 0;
scrinfo.nMax = rect.right - 20;//this->maxLineSize;//(rect.right / (characterFaces->GetCharacterSize(97).GetWidth())) - 1;
scrinfo.nPage = 150;//this ->maxLineSize / rect.right; //5;
scrinfo.nPos = 0;
this->scrollBar->SetScrollInfo(&scrinfo);
this->scrollBar->ShowScrollBar(SB_BOTH);
//this->scrollBar->EnableScrollBar(ESB_DISABLE_BOTH);
}
HorizontalScroll::HorizontalScroll(const HorizontalScroll& source)
:Scroll(source) {
}
HorizontalScroll::~HorizontalScroll() {
}
HorizontalScroll& HorizontalScroll::operator=(const HorizontalScroll& source) {
return *this;
}
//#include "OtherNoteForm.h"
//#include "Line.h"
//#include "Memo.h"
//#include "Character.h"
//void HorizontalScroll::UpdateLine() {
// //Memo *memo = this->otherNoteForm->GetMemo();
// Line *line;// = memo->GetLine(memo->GetRow());
// Long lineWidth;// = 0;
// Long i = 0;
// Long j;
// Long newMaxLineSize = 0;
// while (i < memo->GetLength()) {
// line = memo->GetLine(i);
// j = 0;
// lineWidth = 0;
// while (j < line->GetLength()) {
// lineWidth += line->GetCharacter(j)->GetWidth();
// j++;
// }
// if (newMaxLineSize < lineWidth) {
// newMaxLineSize = lineWidth;
// }
// i++;
// }
// if(newMaxLineSize > this->maxLineSize) {
// this->maxLineSize = newMaxLineSize;
// }
// CRect rect;
// this->otherNoteForm->GetClientRect(&rect);
// if (this->GetMaxLineSize() > rect.right - 20) {
// SCROLLINFO scrinfo;
// this->scrollBar->GetScrollInfo(&scrinfo);
// Long temp = scrinfo.nPos;
// scrinfo.nMax = this->maxLineSize;
// //scrinfo.nPos = temp;
// //scrinfo.nPage = 0;//rect.right - 20;
// //scrinfo.nPos = scrinfo.nMax - scrinfo.nPage;
// this->scrollBar->SetScrollInfo(&scrinfo);
// }
// if (this->otherNoteForm->GetMemo()->GetLength() == 1 &&
// this->otherNoteForm->GetMemo()->GetLine(0)->GetLength() == 0){
// this->SetScrollUnVisible();
// }
//}
//
void HorizontalScroll::ScrollNextLine() {
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
if((scrinfo.nPos + scrinfo.nPage) < scrinfo.nMax) {
//CharacterFaces *characterFaces = CharacterFaces::Instance(0);
Long width = 150;
scrinfo.nPos += width;
if (scrinfo.nPos + scrinfo.nPage > scrinfo.nMax) {
scrinfo.nPos -= width;
width -= scrinfo.nPos + scrinfo.nPage - scrinfo.nMax + width;
scrinfo.nPos += width;
}
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
//this->scrollBar->SetScrollInfo(&scrinfo);
/*CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(-width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
}
void HorizontalScroll::ScrollPreviousLine() {
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
if (scrinfo.nPos > 0) {
//CharacterFaces *characterFaces = CharacterFaces::Instance(0);
Long width = 150;
scrinfo.nPos -= width;
if (scrinfo.nPos < 0) {
scrinfo.nPos += width;
width = scrinfo.nPos;
scrinfo.nPos = 0;
}
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
//this->scrollBar->SetScrollInfo(&scrinfo);
/*CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(+width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
}
void HorizontalScroll::ScrollNextPage() {
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
Long width = scrinfo.nPage;
if ((scrinfo.nPos + scrinfo.nPage) < scrinfo.nMax) {
//CharacterFaces *characterFaces = CharacterFaces::Instance(0);
scrinfo.nPos += scrinfo.nPage;
if (scrinfo.nPos + scrinfo.nPage > scrinfo.nMax) {
scrinfo.nPos -= scrinfo.nPage;
width = scrinfo.nPage;
width -= scrinfo.nPos + scrinfo.nPage - scrinfo.nMax + width;
scrinfo.nPos += width;
}
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
//this->scrollBar->SetScrollInfo(&scrinfo);
/* CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(-width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
}
void HorizontalScroll::ScrollPreviousPage() {
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
Long width = scrinfo.nPage;
if (scrinfo.nPos > 0) {
//CharacterFaces *characterFaces = CharacterFaces::Instance(0);
scrinfo.nPos -= width;
if (scrinfo.nPos < 0) {
scrinfo.nPos += width;
width = scrinfo.nPos;
scrinfo.nPos = 0;
}
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
//this->scrollBar->SetScrollInfo(&scrinfo);
/* CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(+width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
}
void HorizontalScroll::MoveThumb() {
//스크롤 로직
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
Long width = scrinfo.nTrackPos - scrinfo.nPos;
scrinfo.nPos = scrinfo.nTrackPos;
//this->scrollBar->SetScrollInfo(&scrinfo);
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
//this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -scrinfo.nPos, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
/*CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(-width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
void HorizontalScroll::ScrollNext(Long size) {
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
if ((scrinfo.nPos + scrinfo.nPage) < scrinfo.nMax) {
scrinfo.nPos += size;
if (scrinfo.nPos + scrinfo.nPage > scrinfo.nMax) {
scrinfo.nPos -= size;
size -= scrinfo.nPos + scrinfo.nPage - scrinfo.nMax + size;
scrinfo.nPos += size;
}
//this->scrollBar->SetScrollInfo(&scrinfo);
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
/* CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(-size, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
}
void HorizontalScroll::ScrollPrevious(Long size) {
SCROLLINFO scrinfo;
//scrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
this->scrollBar->GetScrollInfo(&scrinfo);
if (scrinfo.nPos > 0) {
scrinfo.nPos -= size;
if (scrinfo.nPos < 0) {
scrinfo.nPos += size;
size = scrinfo.nPos;
scrinfo.nPos = 0;
}
//자료구조에 저장
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
//윈도우 이동
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
//this->scrollBar->SetScrollInfo(&scrinfo);
/*CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(size, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
}
//void HorizontalScroll::ScrollNextCharacter() {
// Line *line = this->otherNoteForm->GetMemo()->GetLine(this->otherNoteForm->GetMemo()->GetRow());
//
// Long currentLineWidth = 0;
// Long i = 0;
// while (i < line->GetColumn()) {
// currentLineWidth += line->GetCharacter(i)->GetWidth();
// i++;
// }
// SCROLLINFO scrinfo;
// this->GetScrollBar()->GetScrollInfo(&scrinfo);
//
// //현재까지의 글자들의넓이들과 라인 최대 글자들의 넓이와 같은 경우
// Long width = 0;
// if (currentLineWidth >= this->GetMaxLineSize()) {
// width = line->GetCharacter(line->GetColumn() - 1)->GetWidth();
// //this->ScrollNext(width);
//
// }
// else if (currentLineWidth > scrinfo.nPos + scrinfo.nPage) {//현재까지ㅡ이 글자들의 넓이들이 큰 경우
// CRect rect;
// this->otherNoteForm->GetClientRect(&rect);
// width = rect.right / 3.0;
// if ((this->GetMaxLineSize() - currentLineWidth) < width) {
// width = this->GetMaxLineSize() - currentLineWidth;
// }
// //this->ScrollNext(width);
// }
//
// if ((scrinfo.nPos + scrinfo.nPage) < scrinfo.nMax) {
// scrinfo.nPos += width;
// if (scrinfo.nPos + scrinfo.nPage > scrinfo.nMax) {
// scrinfo.nPos -= width;
// width -= scrinfo.nPos + scrinfo.nPage - scrinfo.nMax + width;
// scrinfo.nPos += width;
// }
// this->scrollBar->SetScrollInfo(&scrinfo);
// CRect rect;
// this->otherNoteForm->GetClientRect(&rect);
// this->otherNoteForm->ScrollWindow(-width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
// this->otherNoteForm->UpdateWindow();
// }
//}
//
//void HorizontalScroll::ScrollPreviousCharacter() {
// Line *line = this->otherNoteForm->GetMemo()->GetLine(this->otherNoteForm->GetMemo()->GetRow());
//
// SCROLLINFO scrinfo;
// this->scrollBar->GetScrollInfo(&scrinfo);
//
// Long currentLineWidth = 0;
// Long width = 0;
// Long i = 0;
// while (i < line->GetColumn()) {
// currentLineWidth += line->GetCharacter(i)->GetWidth();
// i++;
// }
// if (currentLineWidth < scrinfo.nPos) {
// CRect rect;
// this->otherNoteForm->GetClientRect(&rect);
// width = (rect.right-20) / 3.0;
// if (scrinfo.nPos < width) {
// width = scrinfo.nPos;
// //scrinfo.nPos = 0;
// }
// scrinfo.nPos -= width;
// this->scrollBar->SetScrollInfo(&scrinfo);
// /*CRect rect;
// this->otherNoteForm->GetClientRect(&rect);*/
// this->otherNoteForm->ScrollWindow(width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
// this->otherNoteForm->UpdateWindow();
// }
//
// /*if (scrinfo.nPos > 0) {
// scrinfo.nPos -= width;
// if (scrinfo.nPos < 0) {
// scrinfo.nPos += width;
// width = scrinfo.nPos;
// scrinfo.nPos = 0;
// }*/
// /*this->scrollBar->SetScrollInfo(&scrinfo);
// CRect rect;
// this->otherNoteForm->GetClientRect(&rect);
// this->otherNoteForm->ScrollWindow(width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
// this->otherNoteForm->UpdateWindow();*/
////}
//}
void HorizontalScroll::ScrollFirst() {
/*SCROLLINFO scrinfo;
this->scrollBar->GetScrollInfo(&scrinfo);
Long width = scrinfo.nPos;
scrinfo.nPos = 0;
this->scrollBar->SetScrollInfo(&scrinfo);
CRect rect;
this->otherNoteForm->GetClientRect(&rect);
this->otherNoteForm->ScrollWindow(width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();*/
}
void HorizontalScroll::ScrollLast() {
/*Line *line = this->otherNoteForm->GetMemo()->GetLine(this->otherNoteForm->GetMemo()->GetRow());
SCROLLINFO scrinfo;
this->scrollBar->GetScrollInfo(&scrinfo);
Long lineWidth = 0;
Long width = 0;
Long i = 0;
while (i < line->GetLength()) {
lineWidth += line->GetCharacter(i)->GetWidth();
i++;
}
CRect rect;
this->otherNoteForm->GetClientRect(&rect);
if((this->maxLineSize - lineWidth) < (rect.right-20)*(1/3.0)) {
Long nPos = scrinfo.nMax - scrinfo.nPage;
width = nPos - scrinfo.nPos;
scrinfo.nPos = nPos;
this->scrollBar->SetScrollInfo(&scrinfo);
this->otherNoteForm->ScrollWindow(-width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();
}
else {
Long nPos = lineWidth - ((rect.right-20)*(2/3.0));
width = nPos - scrinfo.nPos;
scrinfo.nPos = nPos;
this->scrollBar->SetScrollInfo(&scrinfo);
this->otherNoteForm->ScrollWindow(-width, 0, CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20), CRect(rect.left, rect.top, rect.right - 20, rect.bottom - 20));
this->otherNoteForm->UpdateWindow();
}*/
}
void HorizontalScroll::SetCurrent(Long index) {
this->current = index;
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(index)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
}
void HorizontalScroll::UpdateScrinfo(SCROLLINFO scrinfo) {
this->scrollBar->SetScrollInfo(&scrinfo);
}
void HorizontalScroll::ScrollToPosition(Long position) {
SCROLLINFO scrinfo;
this->scrollBar->GetScrollInfo(&scrinfo);
scrinfo.nPos = position;
if (scrinfo.nPos < 0) {
scrinfo.nPos = 0;
}
if (scrinfo.nPos + scrinfo.nPage > scrinfo.nMax) {
scrinfo.nPos = scrinfo.nMax - scrinfo.nPage;
}
this->otherNoteForm->GetPageForm(this->current)->SetHScrinfo(scrinfo);
SCROLLINFO hScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetHScrinfo();
SCROLLINFO vScrinfo = this->otherNoteForm->GetPageForm(this->current)->GetVScrinfo();
this->scrollBar->SetScrollInfo(&hScrinfo);
this->otherNoteForm->GetPageForm(this->current)->SetWindowPos(0, -hScrinfo.nPos, -vScrinfo.nPos, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
} | [
"cho0661@gmail.com"
] | cho0661@gmail.com |
f2a62fb2cbab411939b193c8fb9b5041eec644d0 | 3341781428cb24992f022f996e7387b79990dca1 | /src/statisticalmean/AccumulatedValue.h | 1623c9a8907c5a0dfb86107a2890da73b0ac864f | [] | no_license | fakesambinder/kvqc2d | a7f1340df8b786516858c4f1081f0666475dd4cf | 67eb7751daac29fc644ad5afc07ef0d20e3d912d | refs/heads/master | 2020-12-27T12:05:47.028453 | 2016-03-04T07:00:08 | 2016-03-04T07:00:08 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,234 | h | /* -*- c++ -*-
Kvalobs - Free Quality Control Software for Meteorological Observations
Copyright (C) 2011 met.no
Contact information:
Norwegian Meteorological Institute
Postboks 43 Blindern
N-0313 OSLO
NORWAY
email: kvalobs-dev@met.no
This file is part of KVALOBS
KVALOBS is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
KVALOBS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License along
with KVALOBS; if not, write to the Free Software Foundation Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef ACCUMULATEDVALUE_H_
#define ACCUMULATEDVALUE_H_
#include <boost/shared_ptr.hpp>
class AccumulatedValue {
public:
virtual ~AccumulatedValue() = 0;
};
typedef boost::shared_ptr<AccumulatedValue> AccumulatedValueP;
#endif /* ACCUMULATEDVALUE_H_ */
| [
"alexanderb@met.no"
] | alexanderb@met.no |
eec46ed46fab8745f2d741f0fb070dd9817d836f | 55cfc960c37c41d6c2e00d29d6d9ecb69f2b765a | /yukicoder/rank1.0/32.cpp | b06386d9eec7d036c962757946ce50386ca0da3e | [] | no_license | shopetan/problems | 469d39c8ba1e8f5e0929cadccc2d26a74682a223 | 694fadf408ac44c557bcd3f73526e8741d6aa77b | refs/heads/master | 2021-01-25T09:38:07.989063 | 2017-08-02T14:18:14 | 2017-08-02T14:18:14 | 93,864,713 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,383 | cpp | # include <bits/stdc++.h>
# define FOR(i,a,b) for (int i=(a);i<(b);i++)
# define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
# define REP(i, n) for (int i = 0; i < (int)(n); i++)
# define RREP(i,n) for (int i=(n)-1;i>=0;i--)
# define int(x) int x; scanf("%d",&x);
# define vint(v,n) vector<int> v(n); REP(i,n) scanf("%d", &v[i]);
# define string(x) string x; cin >> x;
using namespace std;
namespace utils{
template <typename T> void print(vector<vector<T>> mat) {
REP (i, mat.size()) {
REP (j, mat[0].size()) cout << mat[i][j] << ' ';
cout << endl;
}
}
template <typename T> void print(vector<T> v) {
REP (i, v.size())
if (i >= v.size()-1)
cout << v[i];
else
cout << v[i] << ' ';
cout << endl;
}
template <typename T> pair<T, T> shape(vector<vector<T>> mat) {
int d1, d2;
d1 = mat.size();
if (d1 > 0) d2 = mat[0].size();
else int d2 = 0;
cout << "(" << d1 << ", " << d2 << ")" << endl;
return make_pair(0, 0);
}
template <typename T> vector<vector<T>> empty(int n, int m) {
vector<vector<T>> mat(n, vector<T>(m));
return mat;
}
}
int main() {
int(l);
int(m);
int(n);
int l_rem;
int m_rem;
int n_rem;
int cnt = 0;
n_rem = n%25;
n = n/25;
m += n;
m_rem = m%4;
m = m/4;
l += m;
l_rem = l%10;
l = l/10;
cout << l_rem + m_rem + n_rem << endl;
}
| [
"shoppe_shopetan@yahoo.co.jp"
] | shoppe_shopetan@yahoo.co.jp |
ffdf0e0ce16eca174415ad7fa5f6544c62c5679a | 7511ee6cc1721745cb3ccee35ce2b994363fdd89 | /llvm/tools/clang/include/clang/Basic/TokenKinds.def | c98e8d37f84999af111926ebdd1862f3ddc335c4 | [
"NCSA",
"MIT"
] | permissive | sslab-gatech/apisan | a308fa7a707c6b870900895c9b33c24c6a383a66 | 9ff3d3bc04c8e119f4d659f03b38747395e58c3e | refs/heads/master | 2021-11-06T05:06:35.221153 | 2021-11-05T04:57:33 | 2021-11-05T04:57:33 | 66,595,888 | 64 | 27 | null | 2019-12-20T16:57:29 | 2016-08-25T21:53:26 | null | UTF-8 | C++ | false | false | 27,978 | def | //===--- TokenKinds.def - C Family Token Kind Database ----------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the TokenKind database. This includes normal tokens like
// tok::ampamp (corresponding to the && token) as well as keywords for various
// languages. Users of this file must optionally #define the TOK, KEYWORD,
// ALIAS, or PPKEYWORD macros to make use of this file.
//
//===----------------------------------------------------------------------===//
#ifndef TOK
#define TOK(X)
#endif
#ifndef PUNCTUATOR
#define PUNCTUATOR(X,Y) TOK(X)
#endif
#ifndef KEYWORD
#define KEYWORD(X,Y) TOK(kw_ ## X)
#endif
#ifndef TYPE_TRAIT
#define TYPE_TRAIT(N,I,K) KEYWORD(I,K)
#endif
#ifndef TYPE_TRAIT_1
#define TYPE_TRAIT_1(I,E,K) TYPE_TRAIT(1,I,K)
#endif
#ifndef TYPE_TRAIT_2
#define TYPE_TRAIT_2(I,E,K) TYPE_TRAIT(2,I,K)
#endif
#ifndef TYPE_TRAIT_N
#define TYPE_TRAIT_N(I,E,K) TYPE_TRAIT(0,I,K)
#endif
#ifndef ALIAS
#define ALIAS(X,Y,Z)
#endif
#ifndef PPKEYWORD
#define PPKEYWORD(X)
#endif
#ifndef CXX_KEYWORD_OPERATOR
#define CXX_KEYWORD_OPERATOR(X,Y)
#endif
#ifndef OBJC1_AT_KEYWORD
#define OBJC1_AT_KEYWORD(X)
#endif
#ifndef OBJC2_AT_KEYWORD
#define OBJC2_AT_KEYWORD(X)
#endif
#ifndef TESTING_KEYWORD
#define TESTING_KEYWORD(X, L) KEYWORD(X, L)
#endif
#ifndef ANNOTATION
#define ANNOTATION(X) TOK(annot_ ## X)
#endif
//===----------------------------------------------------------------------===//
// Preprocessor keywords.
//===----------------------------------------------------------------------===//
// These have meaning after a '#' at the start of a line. These define enums in
// the tok::pp_* namespace. Note that IdentifierInfo::getPPKeywordID must be
// manually updated if something is added here.
PPKEYWORD(not_keyword)
// C99 6.10.1 - Conditional Inclusion.
PPKEYWORD(if)
PPKEYWORD(ifdef)
PPKEYWORD(ifndef)
PPKEYWORD(elif)
PPKEYWORD(else)
PPKEYWORD(endif)
PPKEYWORD(defined)
// C99 6.10.2 - Source File Inclusion.
PPKEYWORD(include)
PPKEYWORD(__include_macros)
// C99 6.10.3 - Macro Replacement.
PPKEYWORD(define)
PPKEYWORD(undef)
// C99 6.10.4 - Line Control.
PPKEYWORD(line)
// C99 6.10.5 - Error Directive.
PPKEYWORD(error)
// C99 6.10.6 - Pragma Directive.
PPKEYWORD(pragma)
// GNU Extensions.
PPKEYWORD(import)
PPKEYWORD(include_next)
PPKEYWORD(warning)
PPKEYWORD(ident)
PPKEYWORD(sccs)
PPKEYWORD(assert)
PPKEYWORD(unassert)
// Clang extensions
PPKEYWORD(__public_macro)
PPKEYWORD(__private_macro)
//===----------------------------------------------------------------------===//
// Language keywords.
//===----------------------------------------------------------------------===//
// These define members of the tok::* namespace.
TOK(unknown) // Not a token.
TOK(eof) // End of file.
TOK(eod) // End of preprocessing directive (end of line inside a
// directive).
TOK(code_completion) // Code completion marker
TOK(cxx_defaultarg_end) // C++ default argument end marker
TOK(cxx_exceptspec_end) // C++ exception-specification end marker
// C99 6.4.9: Comments.
TOK(comment) // Comment (only in -E -C[C] mode)
// C99 6.4.2: Identifiers.
TOK(identifier) // abcde123
TOK(raw_identifier) // Used only in raw lexing mode.
// C99 6.4.4.1: Integer Constants
// C99 6.4.4.2: Floating Constants
TOK(numeric_constant) // 0x123
// C99 6.4.4: Character Constants
TOK(char_constant) // 'a'
TOK(wide_char_constant) // L'b'
// C++1z Character Constants
TOK(utf8_char_constant) // u8'a'
// C++11 Character Constants
TOK(utf16_char_constant) // u'a'
TOK(utf32_char_constant) // U'a'
// C99 6.4.5: String Literals.
TOK(string_literal) // "foo"
TOK(wide_string_literal) // L"foo"
TOK(angle_string_literal)// <foo>
// C++11 String Literals.
TOK(utf8_string_literal) // u8"foo"
TOK(utf16_string_literal)// u"foo"
TOK(utf32_string_literal)// U"foo"
// C99 6.4.6: Punctuators.
PUNCTUATOR(l_square, "[")
PUNCTUATOR(r_square, "]")
PUNCTUATOR(l_paren, "(")
PUNCTUATOR(r_paren, ")")
PUNCTUATOR(l_brace, "{")
PUNCTUATOR(r_brace, "}")
PUNCTUATOR(period, ".")
PUNCTUATOR(ellipsis, "...")
PUNCTUATOR(amp, "&")
PUNCTUATOR(ampamp, "&&")
PUNCTUATOR(ampequal, "&=")
PUNCTUATOR(star, "*")
PUNCTUATOR(starequal, "*=")
PUNCTUATOR(plus, "+")
PUNCTUATOR(plusplus, "++")
PUNCTUATOR(plusequal, "+=")
PUNCTUATOR(minus, "-")
PUNCTUATOR(arrow, "->")
PUNCTUATOR(minusminus, "--")
PUNCTUATOR(minusequal, "-=")
PUNCTUATOR(tilde, "~")
PUNCTUATOR(exclaim, "!")
PUNCTUATOR(exclaimequal, "!=")
PUNCTUATOR(slash, "/")
PUNCTUATOR(slashequal, "/=")
PUNCTUATOR(percent, "%")
PUNCTUATOR(percentequal, "%=")
PUNCTUATOR(less, "<")
PUNCTUATOR(lessless, "<<")
PUNCTUATOR(lessequal, "<=")
PUNCTUATOR(lesslessequal, "<<=")
PUNCTUATOR(greater, ">")
PUNCTUATOR(greatergreater, ">>")
PUNCTUATOR(greaterequal, ">=")
PUNCTUATOR(greatergreaterequal, ">>=")
PUNCTUATOR(caret, "^")
PUNCTUATOR(caretequal, "^=")
PUNCTUATOR(pipe, "|")
PUNCTUATOR(pipepipe, "||")
PUNCTUATOR(pipeequal, "|=")
PUNCTUATOR(question, "?")
PUNCTUATOR(colon, ":")
PUNCTUATOR(semi, ";")
PUNCTUATOR(equal, "=")
PUNCTUATOR(equalequal, "==")
PUNCTUATOR(comma, ",")
PUNCTUATOR(hash, "#")
PUNCTUATOR(hashhash, "##")
PUNCTUATOR(hashat, "#@")
// C++ Support
PUNCTUATOR(periodstar, ".*")
PUNCTUATOR(arrowstar, "->*")
PUNCTUATOR(coloncolon, "::")
// Objective C support.
PUNCTUATOR(at, "@")
// CUDA support.
PUNCTUATOR(lesslessless, "<<<")
PUNCTUATOR(greatergreatergreater, ">>>")
// C99 6.4.1: Keywords. These turn into kw_* tokens.
// Flags allowed:
// KEYALL - This is a keyword in all variants of C and C++, or it
// is a keyword in the implementation namespace that should
// always be treated as a keyword
// KEYC99 - This is a keyword introduced to C in C99
// KEYC11 - This is a keyword introduced to C in C11
// KEYCXX - This is a C++ keyword, or a C++-specific keyword in the
// implementation namespace
// KEYNOCXX - This is a keyword in every non-C++ dialect.
// KEYCXX11 - This is a C++ keyword introduced to C++ in C++11
// KEYGNU - This is a keyword if GNU extensions are enabled
// KEYMS - This is a keyword if Microsoft extensions are enabled
// KEYNOMS - This is a keyword that must never be enabled under
// Microsoft mode
// KEYOPENCL - This is a keyword in OpenCL
// KEYALTIVEC - This is a keyword in AltiVec
// KEYBORLAND - This is a keyword if Borland extensions are enabled
// BOOLSUPPORT - This is a keyword if 'bool' is a built-in type
// HALFSUPPORT - This is a keyword if 'half' is a built-in type
// WCHARSUPPORT - This is a keyword if 'wchar_t' is a built-in type
//
KEYWORD(auto , KEYALL)
KEYWORD(break , KEYALL)
KEYWORD(case , KEYALL)
KEYWORD(char , KEYALL)
KEYWORD(const , KEYALL)
KEYWORD(continue , KEYALL)
KEYWORD(default , KEYALL)
KEYWORD(do , KEYALL)
KEYWORD(double , KEYALL)
KEYWORD(else , KEYALL)
KEYWORD(enum , KEYALL)
KEYWORD(extern , KEYALL)
KEYWORD(float , KEYALL)
KEYWORD(for , KEYALL)
KEYWORD(goto , KEYALL)
KEYWORD(if , KEYALL)
KEYWORD(inline , KEYC99|KEYCXX|KEYGNU)
KEYWORD(int , KEYALL)
KEYWORD(long , KEYALL)
KEYWORD(register , KEYALL)
KEYWORD(restrict , KEYC99)
KEYWORD(return , KEYALL)
KEYWORD(short , KEYALL)
KEYWORD(signed , KEYALL)
KEYWORD(sizeof , KEYALL)
KEYWORD(static , KEYALL)
KEYWORD(struct , KEYALL)
KEYWORD(switch , KEYALL)
KEYWORD(typedef , KEYALL)
KEYWORD(union , KEYALL)
KEYWORD(unsigned , KEYALL)
KEYWORD(void , KEYALL)
KEYWORD(volatile , KEYALL)
KEYWORD(while , KEYALL)
KEYWORD(_Alignas , KEYALL)
KEYWORD(_Alignof , KEYALL)
KEYWORD(_Atomic , KEYALL|KEYNOMS)
KEYWORD(_Bool , KEYNOCXX)
KEYWORD(_Complex , KEYALL)
KEYWORD(_Generic , KEYALL)
KEYWORD(_Imaginary , KEYALL)
KEYWORD(_Noreturn , KEYALL)
KEYWORD(_Static_assert , KEYALL)
KEYWORD(_Thread_local , KEYALL)
KEYWORD(__func__ , KEYALL)
KEYWORD(__objc_yes , KEYALL)
KEYWORD(__objc_no , KEYALL)
// C++ 2.11p1: Keywords.
KEYWORD(asm , KEYCXX|KEYGNU)
KEYWORD(bool , BOOLSUPPORT)
KEYWORD(catch , KEYCXX)
KEYWORD(class , KEYCXX)
KEYWORD(const_cast , KEYCXX)
KEYWORD(delete , KEYCXX)
KEYWORD(dynamic_cast , KEYCXX)
KEYWORD(explicit , KEYCXX)
KEYWORD(export , KEYCXX)
KEYWORD(false , BOOLSUPPORT)
KEYWORD(friend , KEYCXX)
KEYWORD(mutable , KEYCXX)
KEYWORD(namespace , KEYCXX)
KEYWORD(new , KEYCXX)
KEYWORD(operator , KEYCXX)
KEYWORD(private , KEYCXX)
KEYWORD(protected , KEYCXX)
KEYWORD(public , KEYCXX)
KEYWORD(reinterpret_cast , KEYCXX)
KEYWORD(static_cast , KEYCXX)
KEYWORD(template , KEYCXX)
KEYWORD(this , KEYCXX)
KEYWORD(throw , KEYCXX)
KEYWORD(true , BOOLSUPPORT)
KEYWORD(try , KEYCXX)
KEYWORD(typename , KEYCXX)
KEYWORD(typeid , KEYCXX)
KEYWORD(using , KEYCXX)
KEYWORD(virtual , KEYCXX)
KEYWORD(wchar_t , WCHARSUPPORT)
// C++ 2.5p2: Alternative Representations.
CXX_KEYWORD_OPERATOR(and , ampamp)
CXX_KEYWORD_OPERATOR(and_eq , ampequal)
CXX_KEYWORD_OPERATOR(bitand , amp)
CXX_KEYWORD_OPERATOR(bitor , pipe)
CXX_KEYWORD_OPERATOR(compl , tilde)
CXX_KEYWORD_OPERATOR(not , exclaim)
CXX_KEYWORD_OPERATOR(not_eq , exclaimequal)
CXX_KEYWORD_OPERATOR(or , pipepipe)
CXX_KEYWORD_OPERATOR(or_eq , pipeequal)
CXX_KEYWORD_OPERATOR(xor , caret)
CXX_KEYWORD_OPERATOR(xor_eq , caretequal)
// C++11 keywords
KEYWORD(alignas , KEYCXX11)
KEYWORD(alignof , KEYCXX11)
KEYWORD(char16_t , KEYCXX11|KEYNOMS)
KEYWORD(char32_t , KEYCXX11|KEYNOMS)
KEYWORD(constexpr , KEYCXX11)
KEYWORD(decltype , KEYCXX11)
KEYWORD(noexcept , KEYCXX11)
KEYWORD(nullptr , KEYCXX11)
KEYWORD(static_assert , KEYCXX11)
KEYWORD(thread_local , KEYCXX11)
// GNU Extensions (in impl-reserved namespace)
KEYWORD(_Decimal32 , KEYALL)
KEYWORD(_Decimal64 , KEYALL)
KEYWORD(_Decimal128 , KEYALL)
KEYWORD(__null , KEYCXX)
KEYWORD(__alignof , KEYALL)
KEYWORD(__attribute , KEYALL)
KEYWORD(__builtin_choose_expr , KEYALL)
KEYWORD(__builtin_offsetof , KEYALL)
// __builtin_types_compatible_p is a GNU C extension that we handle like a C++
// type trait.
TYPE_TRAIT_2(__builtin_types_compatible_p, TypeCompatible, KEYNOCXX)
KEYWORD(__builtin_va_arg , KEYALL)
KEYWORD(__extension__ , KEYALL)
KEYWORD(__imag , KEYALL)
KEYWORD(__int128 , KEYALL)
KEYWORD(__label__ , KEYALL)
KEYWORD(__real , KEYALL)
KEYWORD(__thread , KEYALL)
KEYWORD(__FUNCTION__ , KEYALL)
KEYWORD(__PRETTY_FUNCTION__ , KEYALL)
// GNU Extensions (outside impl-reserved namespace)
KEYWORD(typeof , KEYGNU)
// MS Extensions
KEYWORD(__FUNCDNAME__ , KEYMS)
KEYWORD(__FUNCSIG__ , KEYMS)
KEYWORD(L__FUNCTION__ , KEYMS)
TYPE_TRAIT_1(__is_interface_class, IsInterfaceClass, KEYMS)
TYPE_TRAIT_1(__is_sealed, IsSealed, KEYMS)
// MSVC12.0 / VS2013 Type Traits
TYPE_TRAIT_1(__is_destructible, IsDestructible, KEYMS)
TYPE_TRAIT_1(__is_nothrow_destructible, IsNothrowDestructible, KEYMS)
TYPE_TRAIT_2(__is_nothrow_assignable, IsNothrowAssignable, KEYCXX)
TYPE_TRAIT_N(__is_constructible, IsConstructible, KEYCXX)
TYPE_TRAIT_N(__is_nothrow_constructible, IsNothrowConstructible, KEYCXX)
// GNU and MS Type Traits
TYPE_TRAIT_1(__has_nothrow_assign, HasNothrowAssign, KEYCXX)
TYPE_TRAIT_1(__has_nothrow_move_assign, HasNothrowMoveAssign, KEYCXX)
TYPE_TRAIT_1(__has_nothrow_copy, HasNothrowCopy, KEYCXX)
TYPE_TRAIT_1(__has_nothrow_constructor, HasNothrowConstructor, KEYCXX)
TYPE_TRAIT_1(__has_trivial_assign, HasTrivialAssign, KEYCXX)
TYPE_TRAIT_1(__has_trivial_move_assign, HasTrivialMoveAssign, KEYCXX)
TYPE_TRAIT_1(__has_trivial_copy, HasTrivialCopy, KEYCXX)
TYPE_TRAIT_1(__has_trivial_constructor, HasTrivialDefaultConstructor, KEYCXX)
TYPE_TRAIT_1(__has_trivial_move_constructor, HasTrivialMoveConstructor, KEYCXX)
TYPE_TRAIT_1(__has_trivial_destructor, HasTrivialDestructor, KEYCXX)
TYPE_TRAIT_1(__has_virtual_destructor, HasVirtualDestructor, KEYCXX)
TYPE_TRAIT_1(__is_abstract, IsAbstract, KEYCXX)
TYPE_TRAIT_2(__is_base_of, IsBaseOf, KEYCXX)
TYPE_TRAIT_1(__is_class, IsClass, KEYCXX)
TYPE_TRAIT_2(__is_convertible_to, IsConvertibleTo, KEYCXX)
TYPE_TRAIT_1(__is_empty, IsEmpty, KEYCXX)
TYPE_TRAIT_1(__is_enum, IsEnum, KEYCXX)
TYPE_TRAIT_1(__is_final, IsFinal, KEYCXX)
// Tentative name - there's no implementation of std::is_literal_type yet.
TYPE_TRAIT_1(__is_literal, IsLiteral, KEYCXX)
// Name for GCC 4.6 compatibility - people have already written libraries using
// this name unfortunately.
ALIAS("__is_literal_type", __is_literal, KEYCXX)
TYPE_TRAIT_1(__is_pod, IsPOD, KEYCXX)
TYPE_TRAIT_1(__is_polymorphic, IsPolymorphic, KEYCXX)
TYPE_TRAIT_1(__is_trivial, IsTrivial, KEYCXX)
TYPE_TRAIT_1(__is_union, IsUnion, KEYCXX)
// Clang-only C++ Type Traits
TYPE_TRAIT_N(__is_trivially_constructible, IsTriviallyConstructible, KEYCXX)
TYPE_TRAIT_1(__is_trivially_copyable, IsTriviallyCopyable, KEYCXX)
TYPE_TRAIT_2(__is_trivially_assignable, IsTriviallyAssignable, KEYCXX)
KEYWORD(__underlying_type , KEYCXX)
// Embarcadero Expression Traits
KEYWORD(__is_lvalue_expr , KEYCXX)
KEYWORD(__is_rvalue_expr , KEYCXX)
// Embarcadero Unary Type Traits
TYPE_TRAIT_1(__is_arithmetic, IsArithmetic, KEYCXX)
TYPE_TRAIT_1(__is_floating_point, IsFloatingPoint, KEYCXX)
TYPE_TRAIT_1(__is_integral, IsIntegral, KEYCXX)
TYPE_TRAIT_1(__is_complete_type, IsCompleteType, KEYCXX)
TYPE_TRAIT_1(__is_void, IsVoid, KEYCXX)
TYPE_TRAIT_1(__is_array, IsArray, KEYCXX)
TYPE_TRAIT_1(__is_function, IsFunction, KEYCXX)
TYPE_TRAIT_1(__is_reference, IsReference, KEYCXX)
TYPE_TRAIT_1(__is_lvalue_reference, IsLvalueReference, KEYCXX)
TYPE_TRAIT_1(__is_rvalue_reference, IsRvalueReference, KEYCXX)
TYPE_TRAIT_1(__is_fundamental, IsFundamental, KEYCXX)
TYPE_TRAIT_1(__is_object, IsObject, KEYCXX)
TYPE_TRAIT_1(__is_scalar, IsScalar, KEYCXX)
TYPE_TRAIT_1(__is_compound, IsCompound, KEYCXX)
TYPE_TRAIT_1(__is_pointer, IsPointer, KEYCXX)
TYPE_TRAIT_1(__is_member_object_pointer, IsMemberObjectPointer, KEYCXX)
TYPE_TRAIT_1(__is_member_function_pointer, IsMemberFunctionPointer, KEYCXX)
TYPE_TRAIT_1(__is_member_pointer, IsMemberPointer, KEYCXX)
TYPE_TRAIT_1(__is_const, IsConst, KEYCXX)
TYPE_TRAIT_1(__is_volatile, IsVolatile, KEYCXX)
TYPE_TRAIT_1(__is_standard_layout, IsStandardLayout, KEYCXX)
TYPE_TRAIT_1(__is_signed, IsSigned, KEYCXX)
TYPE_TRAIT_1(__is_unsigned, IsUnsigned, KEYCXX)
// Embarcadero Binary Type Traits
TYPE_TRAIT_2(__is_same, IsSame, KEYCXX)
TYPE_TRAIT_2(__is_convertible, IsConvertible, KEYCXX)
KEYWORD(__array_rank , KEYCXX)
KEYWORD(__array_extent , KEYCXX)
// Apple Extension.
KEYWORD(__private_extern__ , KEYALL)
KEYWORD(__module_private__ , KEYALL)
// Microsoft Extension.
KEYWORD(__declspec , KEYALL)
KEYWORD(__cdecl , KEYALL)
KEYWORD(__stdcall , KEYALL)
KEYWORD(__fastcall , KEYALL)
KEYWORD(__thiscall , KEYALL)
KEYWORD(__vectorcall , KEYALL)
KEYWORD(__forceinline , KEYMS)
KEYWORD(__unaligned , KEYMS)
KEYWORD(__super , KEYMS)
// OpenCL address space qualifiers
KEYWORD(__global , KEYOPENCL)
KEYWORD(__local , KEYOPENCL)
KEYWORD(__constant , KEYOPENCL)
KEYWORD(__private , KEYOPENCL)
KEYWORD(__generic , KEYOPENCL)
ALIAS("global", __global , KEYOPENCL)
ALIAS("local", __local , KEYOPENCL)
ALIAS("constant", __constant , KEYOPENCL)
ALIAS("private", __private , KEYOPENCL)
ALIAS("generic", __generic , KEYOPENCL)
// OpenCL function qualifiers
KEYWORD(__kernel , KEYOPENCL)
ALIAS("kernel", __kernel , KEYOPENCL)
// OpenCL access qualifiers
KEYWORD(__read_only , KEYOPENCL)
KEYWORD(__write_only , KEYOPENCL)
KEYWORD(__read_write , KEYOPENCL)
ALIAS("read_only", __read_only , KEYOPENCL)
ALIAS("write_only", __write_only , KEYOPENCL)
ALIAS("read_write", __read_write , KEYOPENCL)
// OpenCL builtins
KEYWORD(__builtin_astype , KEYOPENCL)
KEYWORD(vec_step , KEYOPENCL|KEYALTIVEC)
// Borland Extensions.
KEYWORD(__pascal , KEYALL)
// Altivec Extension.
KEYWORD(__vector , KEYALTIVEC)
KEYWORD(__pixel , KEYALTIVEC)
// ARM NEON extensions.
ALIAS("__fp16", half , KEYALL)
// OpenCL Extension.
KEYWORD(half , HALFSUPPORT)
// Objective-C ARC keywords.
KEYWORD(__bridge , KEYARC)
KEYWORD(__bridge_transfer , KEYARC)
KEYWORD(__bridge_retained , KEYARC)
KEYWORD(__bridge_retain , KEYARC)
// Alternate spelling for various tokens. There are GCC extensions in all
// languages, but should not be disabled in strict conformance mode.
ALIAS("__alignof__" , __alignof , KEYALL)
ALIAS("__asm" , asm , KEYALL)
ALIAS("__asm__" , asm , KEYALL)
ALIAS("__attribute__", __attribute, KEYALL)
ALIAS("__complex" , _Complex , KEYALL)
ALIAS("__complex__" , _Complex , KEYALL)
ALIAS("__const" , const , KEYALL)
ALIAS("__const__" , const , KEYALL)
ALIAS("__decltype" , decltype , KEYCXX)
ALIAS("__imag__" , __imag , KEYALL)
ALIAS("__inline" , inline , KEYALL)
ALIAS("__inline__" , inline , KEYALL)
ALIAS("__nullptr" , nullptr , KEYCXX)
ALIAS("__real__" , __real , KEYALL)
ALIAS("__restrict" , restrict , KEYALL)
ALIAS("__restrict__" , restrict , KEYALL)
ALIAS("__signed" , signed , KEYALL)
ALIAS("__signed__" , signed , KEYALL)
ALIAS("__typeof" , typeof , KEYALL)
ALIAS("__typeof__" , typeof , KEYALL)
ALIAS("__volatile" , volatile , KEYALL)
ALIAS("__volatile__" , volatile , KEYALL)
// Microsoft extensions which should be disabled in strict conformance mode
KEYWORD(__ptr64 , KEYMS)
KEYWORD(__ptr32 , KEYMS)
KEYWORD(__sptr , KEYMS)
KEYWORD(__uptr , KEYMS)
KEYWORD(__w64 , KEYMS)
KEYWORD(__uuidof , KEYMS | KEYBORLAND)
KEYWORD(__try , KEYMS | KEYBORLAND)
KEYWORD(__finally , KEYMS | KEYBORLAND)
KEYWORD(__leave , KEYMS | KEYBORLAND)
KEYWORD(__int64 , KEYMS)
KEYWORD(__if_exists , KEYMS)
KEYWORD(__if_not_exists , KEYMS)
KEYWORD(__single_inheritance , KEYMS)
KEYWORD(__multiple_inheritance , KEYMS)
KEYWORD(__virtual_inheritance , KEYMS)
KEYWORD(__interface , KEYMS)
ALIAS("__int8" , char , KEYMS)
ALIAS("_int8" , char , KEYMS)
ALIAS("__int16" , short , KEYMS)
ALIAS("_int16" , short , KEYMS)
ALIAS("__int32" , int , KEYMS)
ALIAS("_int32" , int , KEYMS)
ALIAS("_int64" , __int64 , KEYMS)
ALIAS("__wchar_t" , wchar_t , KEYMS)
ALIAS("_asm" , asm , KEYMS)
ALIAS("_alignof" , __alignof , KEYMS)
ALIAS("__builtin_alignof", __alignof , KEYMS)
ALIAS("_cdecl" , __cdecl , KEYMS | KEYBORLAND)
ALIAS("_fastcall" , __fastcall , KEYMS | KEYBORLAND)
ALIAS("_stdcall" , __stdcall , KEYMS | KEYBORLAND)
ALIAS("_thiscall" , __thiscall , KEYMS)
ALIAS("_vectorcall" , __vectorcall, KEYMS)
ALIAS("_uuidof" , __uuidof , KEYMS | KEYBORLAND)
ALIAS("_inline" , inline , KEYMS)
ALIAS("_declspec" , __declspec , KEYMS)
// Borland Extensions which should be disabled in strict conformance mode.
ALIAS("_pascal" , __pascal , KEYBORLAND)
// Clang Extensions.
KEYWORD(__builtin_convertvector , KEYALL)
ALIAS("__char16_t" , char16_t , KEYCXX)
ALIAS("__char32_t" , char32_t , KEYCXX)
// Clang-specific keywords enabled only in testing.
TESTING_KEYWORD(__unknown_anytype , KEYALL)
//===----------------------------------------------------------------------===//
// Objective-C @-preceded keywords.
//===----------------------------------------------------------------------===//
// These have meaning after an '@' in Objective-C mode. These define enums in
// the tok::objc_* namespace.
OBJC1_AT_KEYWORD(not_keyword)
OBJC1_AT_KEYWORD(class)
OBJC1_AT_KEYWORD(compatibility_alias)
OBJC1_AT_KEYWORD(defs)
OBJC1_AT_KEYWORD(encode)
OBJC1_AT_KEYWORD(end)
OBJC1_AT_KEYWORD(implementation)
OBJC1_AT_KEYWORD(interface)
OBJC1_AT_KEYWORD(private)
OBJC1_AT_KEYWORD(protected)
OBJC1_AT_KEYWORD(protocol)
OBJC1_AT_KEYWORD(public)
OBJC1_AT_KEYWORD(selector)
OBJC1_AT_KEYWORD(throw)
OBJC1_AT_KEYWORD(try)
OBJC1_AT_KEYWORD(catch)
OBJC1_AT_KEYWORD(finally)
OBJC1_AT_KEYWORD(synchronized)
OBJC1_AT_KEYWORD(autoreleasepool)
OBJC2_AT_KEYWORD(property)
OBJC2_AT_KEYWORD(package)
OBJC2_AT_KEYWORD(required)
OBJC2_AT_KEYWORD(optional)
OBJC2_AT_KEYWORD(synthesize)
OBJC2_AT_KEYWORD(dynamic)
OBJC2_AT_KEYWORD(import)
// TODO: What to do about context-sensitive keywords like:
// bycopy/byref/in/inout/oneway/out?
ANNOTATION(cxxscope) // annotation for a C++ scope spec, e.g. "::foo::bar::"
ANNOTATION(typename) // annotation for a C typedef name, a C++ (possibly
// qualified) typename, e.g. "foo::MyClass", or
// template-id that names a type ("std::vector<int>")
ANNOTATION(template_id) // annotation for a C++ template-id that names a
// function template specialization (not a type),
// e.g., "std::swap<int>"
ANNOTATION(primary_expr) // annotation for a primary expression
ANNOTATION(decltype) // annotation for a decltype expression,
// e.g., "decltype(foo.bar())"
// Annotation for #pragma unused(...)
// For each argument inside the parentheses the pragma handler will produce
// one 'pragma_unused' annotation token followed by the argument token.
ANNOTATION(pragma_unused)
// Annotation for #pragma GCC visibility...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_vis)
// Annotation for #pragma pack...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_pack)
// Annotation for #pragma clang __debug parser_crash...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_parser_crash)
// Annotation for #pragma clang __debug captured...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_captured)
// Annotation for #pragma ms_struct...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_msstruct)
// Annotation for #pragma align...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_align)
// Annotation for #pragma weak id
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_weak)
// Annotation for #pragma weak id = id
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_weakalias)
// Annotation for #pragma redefine_extname...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_redefine_extname)
// Annotation for #pragma STDC FP_CONTRACT...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_fp_contract)
// Annotation for #pragma pointers_to_members...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_ms_pointers_to_members)
// Annotation for #pragma vtordisp...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_ms_vtordisp)
// Annotation for all microsoft #pragmas...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_ms_pragma)
// Annotation for #pragma OPENCL EXTENSION...
// The lexer produces these so that they only take effect when the parser
// handles them.
ANNOTATION(pragma_opencl_extension)
// Annotations for OpenMP pragma directives - #pragma omp ...
// The lexer produces these so that they only take effect when the parser
// handles #pragma omp ... directives.
ANNOTATION(pragma_openmp)
ANNOTATION(pragma_openmp_end)
// Annotations for loop pragma directives #pragma clang loop ...
// The lexer produces these so that they only take effect when the parser
// handles #pragma loop ... directives.
ANNOTATION(pragma_loop_hint)
// Annotations for module import translated from #include etc.
ANNOTATION(module_include)
ANNOTATION(module_begin)
ANNOTATION(module_end)
#undef ANNOTATION
#undef TESTING_KEYWORD
#undef OBJC2_AT_KEYWORD
#undef OBJC1_AT_KEYWORD
#undef CXX_KEYWORD_OPERATOR
#undef PPKEYWORD
#undef ALIAS
#undef TYPE_TRAIT_N
#undef TYPE_TRAIT_2
#undef TYPE_TRAIT_1
#undef TYPE_TRAIT
#undef KEYWORD
#undef PUNCTUATOR
#undef TOK
| [
"wuninsu@gmail.com"
] | wuninsu@gmail.com |
485caea6e187f8c354179d862c14442f9f6a2e35 | bd1fea86d862456a2ec9f56d57f8948456d55ee6 | /000/087/965/CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84_goodG2B.cpp | cd60dcda430669d3da564f83b4e7d8cc5adc7ee0 | [] | no_license | CU-0xff/juliet-cpp | d62b8485104d8a9160f29213368324c946f38274 | d8586a217bc94cbcfeeec5d39b12d02e9c6045a2 | refs/heads/master | 2021-03-07T15:44:19.446957 | 2020-03-10T12:45:40 | 2020-03-10T12:45:40 | 246,275,244 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 1,749 | cpp | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84_goodG2B.cpp
Label Definition File: CWE195_Signed_to_Unsigned_Conversion_Error.label.xml
Template File: sources-sink-84_goodG2B.tmpl.cpp
*/
/*
* @description
* CWE: 195 Signed to Unsigned Conversion Error
* BadSource: fscanf Read data from the console using fscanf()
* GoodSource: Positive integer
* Sinks: memmove
* BadSink : Copy strings using memmove() with the length of data
* Flow Variant: 84 Data flow: data passed to class constructor and destructor by declaring the class object on the heap and deleting it after use
*
* */
#ifndef OMITGOOD
#include "std_testcase.h"
#include "CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84.h"
namespace CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84
{
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84_goodG2B::CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84_goodG2B(int dataCopy)
{
data = dataCopy;
/* FIX: Use a positive integer less than &InitialDataSize&*/
data = 100-1;
}
CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84_goodG2B::~CWE195_Signed_to_Unsigned_Conversion_Error__fscanf_memmove_84_goodG2B()
{
{
char source[100];
char dest[100] = "";
memset(source, 'A', 100-1);
source[100-1] = '\0';
if (data < 100)
{
/* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,
* the sign conversion could result in a very large number */
memmove(dest, source, data);
dest[data] = '\0'; /* NULL terminate */
}
printLine(dest);
}
}
}
#endif /* OMITGOOD */
| [
"frank@fischer.com.mt"
] | frank@fischer.com.mt |
df23b3f7d1698dfe3ecd8393d394b226c393815b | 9e9647d4cd76404298cdfca59ed451596be5ad9f | /remus/proto/JobResult.h | 71fd1c5eb1aad9d75d144ff6f9878fe1884643ac | [] | no_license | mathstuf/Remus | ec61cbeaf091a52701e8bc2212471a107d490358 | 7509e5ced66a40db1e050014e70d22b3cc57255c | refs/heads/master | 2020-12-01T03:08:30.577045 | 2015-02-27T16:00:30 | 2015-02-27T16:00:30 | 32,757,662 | 0 | 0 | null | 2015-03-23T20:41:19 | 2015-03-23T20:41:18 | null | UTF-8 | C++ | false | false | 4,783 | h | //=============================================================================
//
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
//=============================================================================
#ifndef remus_proto_JobResult_h
#define remus_proto_JobResult_h
#include <string>
#include <boost/shared_ptr.hpp>
//for ContentFormat and ContentSource
#include <remus/common/ContentTypes.h>
#include <remus/common/FileHandle.h>
#include <boost/uuid/uuid.hpp>
//included for export symbols
#include <remus/proto/ProtoExports.h>
//Job result holds the result that the worker generated for a given job.
//The Data string will hold the actual job result, be it a file path or a custom
//serialized data structure.
namespace remus {
namespace proto {
class REMUSPROTO_EXPORT JobResult
{
public:
//construct an invalid JobResult
JobResult(const boost::uuids::uuid& jid);
//pass in some data to send back to the client. The path to the file
//will passed to the client. In the future we plan to extend remus
//to support automatic file reading.
//The result should be considered invalid if the file names length is zero
JobResult(const boost::uuids::uuid& jid,
remus::common::ContentFormat::Type format,
const remus::common::FileHandle& fileHandle);
//pass in some data to send back to the client. The
//contents of the string will be copied into a local memory
//The result should be considered invalid if the contents length is zero
JobResult(const boost::uuids::uuid& jid,
remus::common::ContentFormat::Type format,
const std::string& contents);
//pass in some data to send back to the client. A pointer
//to the contents is kept and no copy will of data will happen, so
//the contents of the pointer can't be deleted while the JobResult instance
//is valid.
JobResult(const boost::uuids::uuid& jid,
remus::common::ContentFormat::Type format,
const char* contents,
std::size_t size);
//get the storage format that we currently have setup for the source
remus::common::ContentFormat::Type formatType() const
{ return this->FormatType; }
bool valid() const;
const boost::uuids::uuid& id() const { return JobId; }
const char* data() const;
std::size_t dataSize() const;
//implement a less than operator and equal operator so you
//can use the class in containers and algorithms
bool operator<(const JobResult& other) const;
bool operator==(const JobResult& other) const;
friend std::ostream& operator<<(std::ostream &os,
const JobResult &submission)
{ submission.serialize(os); return os; }
//needed to decode the object from the wire
friend std::istream& operator>>(std::istream &is,
JobResult &submission)
{ submission = JobResult(is); return is; }
private:
friend remus::proto::JobResult to_JobResult(const char* data, std::size_t size);
//serialize function
void serialize(std::ostream& buffer) const;
//deserialize constructor function
explicit JobResult(std::istream& buffer);
boost::uuids::uuid JobId;
remus::common::ContentFormat::Type FormatType;
struct InternalImpl;
boost::shared_ptr<InternalImpl> Implementation;
};
//------------------------------------------------------------------------------
inline remus::proto::JobResult make_JobResult(const boost::uuids::uuid& id,
const remus::common::FileHandle& handle,
remus::common::ContentFormat::Type format = remus::common::ContentFormat::User)
{
return remus::proto::JobResult(id,format,handle);
}
//------------------------------------------------------------------------------
inline remus::proto::JobResult make_JobResult(const boost::uuids::uuid& id,
const std::string& content,
remus::common::ContentFormat::Type format = remus::common::ContentFormat::User)
{
return remus::proto::JobResult(id,format,content);
}
//------------------------------------------------------------------------------
REMUSPROTO_EXPORT
std::string to_string(const remus::proto::JobResult& result);
//------------------------------------------------------------------------------
REMUSPROTO_EXPORT
remus::proto::JobResult to_JobResult(const char* data, std::size_t size);
//------------------------------------------------------------------------------
inline remus::proto::JobResult to_JobResult(const std::string& msg)
{
return to_JobResult(msg.c_str(), msg.size());
}
}
}
#endif
| [
"robert.maynard@kitware.com"
] | robert.maynard@kitware.com |
aea30bdaad9a0b64ff9507f52bed15d3e6c2821e | ff1b0386f874fa0f1b79e5e113066cc1342ab153 | /word catch/API Hook/HookApi通用框架/CodeInject/CodeInject.cpp | d0b31c71fb50615e1b6429f2dd2766e8accbd679 | [] | no_license | A-new/FileEncryption | 99a0c02aa8e8995575e99d099e09e1cafcafe3a8 | 0a26f94fef17a5ee1288cbfed6dbf67127aff463 | refs/heads/master | 2021-06-14T23:47:28.047924 | 2017-04-14T04:23:31 | 2017-04-14T04:23:31 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 17,620 | cpp | /*
*
* 代码注入函数
*
* 将Dll文件通过CreateRemoteThread函数注入到指定进程
*
* Made By Adly
*
* Email : Raojianhua242@yahoo.com.cn
*
* 2008-7-20
*/
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <tlhelp32.h>
#include "..\\Common\\CodeInject.h"
#include "..\\Common\\NtSysOperate.h" //驱动文件加载/卸载头等文件
#include "..\\Common\\NtNotifyProcessCreate.h" //驱动文件头
#define KERNEL_MODULE_NAME "kernel32" //Windows内核dll模块名
//LoadLibraryA函数由此模块导出
#define SYS_NAME "NtNotifyProcessCreate.sys" //驱动文件名
extern HANDLE g_hShutdownEvent; //导出关闭事件句柄
HANDLE g_hShutdownOverEvent;
CRITICAL_SECTION cs; //临界段,链表成原子操作
char g_szDllFileName[MAX_PATH+1];
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//--------------------------------------------------------------
//管理注入链表操作
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
pPidModuleListHead g_pListHead = NULL; //全局链表头指针
//!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//进程创建撤消监视线程
static void CreateProcessPrompt(PCALLBACK_INFO pProcInfo)
{
//如果是创建进程,则传递PID,进行代码注入
if(pProcInfo->bCreate)
{
//创建进程
DWORD dwDllModuleBase;
if(!CodeInject((DWORD)(pProcInfo->hProcessId), g_szDllFileName, &dwDllModuleBase))
{
//注入Dll失败
//Do Nothing
printf("注入进程Pid: %05d (父进程Pid: %05d)失败!\n", \
(DWORD)(pProcInfo->hProcessId), \
(DWORD)(pProcInfo->hParentId));
}
else
{
//注入Dll成功
printf("注入进程Pid: %05d (父进程Pid: %05d)成功!!!\n", \
(DWORD)(pProcInfo->hProcessId), \
(DWORD)(pProcInfo->hParentId));
}
}
else
{
//撤消进程
DWORD dwDllModuleBase;
if((dwDllModuleBase = LookupDllModuleBaseByPid((DWORD)(pProcInfo->hProcessId))) != ~0)
{
if(!UnCodeInject((DWORD)(pProcInfo->hProcessId), dwDllModuleBase))
{
//卸载Dll失败
//Do Nothing
//
// Execute Here
//
//-----------------------------测试
/*
printf("卸载进程Pid: %05d (父进程Pid: %05d)失败!\n", \
(DWORD)(pProcInfo->hProcessId), \
(DWORD)(pProcInfo->hParentId));
*/
}
else
{
//卸载Dll成功
//
// Never Execute
//
//-----------------------------测试
/*
printf("卸载进程Pid: %05d (父进程Pid: %05d)成功!!!\n", \
(DWORD)(pProcInfo->hProcessId), \
(DWORD)(pProcInfo->hParentId));
*/
}
}
else
{
//通过Pid查找Dll模块基址失败
//
//---------------------------------测试
/*
printf("通过Pid查找Dll模块基址( Pid: %05d )失败 (父进程Pid: %05d)!\n", \
(DWORD)(pProcInfo->hProcessId), \
(DWORD)(pProcInfo->hParentId));
*/
}
}
//释放内存
free(pProcInfo);
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//--------------------------------------------------------------
//向链中插入结点
//
// 链表中的结点以Pid值,从大到小排列
BOOL InsertList(pPidModuleList pList)
{
pPidModuleListHead pLH;
pPidModuleList pL;
//进入临界段
EnterCriticalSection(&cs);
//如果不存在头结点,则生成一个头结点
if(!g_pListHead)
{
g_pListHead = (pPidModuleListHead)malloc(sizeof(PidModuleListHead));
if(!g_pListHead)
{
//生成链表头失败
MessageBox(NULL, "生成链表头失败,程序结束!", "严重错误", MB_OK);
g_hShutdownOverEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); //创建关闭完毕提示事件
::SetEvent(g_hShutdownEvent); //设置退出事件,使创建进程提示结束,并自动卸载驱动
//等待驱动卸载完成
::WaitForSingleObject(g_hShutdownOverEvent, INFINITE);
LeaveCriticalSection(&cs); //离开临界段
::TerminateProcess(NULL, -1);
return FALSE;
}
//初始化链表头
memset(g_pListHead, 0, sizeof(PidModuleListHead));
g_pListHead->First = NULL;
g_pListHead->Last = NULL;
g_pListHead->ulCount = 0;
}
pLH = g_pListHead;
if(pLH)
{
//存在链表头
if(pLH->First)
{
//不是空链表
if(pLH->First->Pid < pList->Pid)
{
//插入为第一个结点
pList->Next = pLH->First;
pLH->First = pList;
pLH->ulCount++;
LeaveCriticalSection(&cs); //离开临界段
return TRUE;
}
pL = pLH->First; //pL指向第一个结点
do
{
if(pL->Next) //还存在下一个结点
{
if(pL->Next->Pid < pList->Pid)
{
//找到要插入的位置
pList->Next = pL->Next;
pL->Next = pList;
pLH->ulCount++;
LeaveCriticalSection(&cs); //离开临界段
return TRUE;
}
}
else //这是最后一个结点了
{
//插入到最后一个结点
pList->Next = NULL;
pL->Next = pList;
pLH->ulCount++;
pLH->Last = pList;
LeaveCriticalSection(&cs); //离开临界段
return TRUE;
}
}while(pL = pL->Next); //结点指针后移
}
else //此链表还没有结点
{
//直接加入到pLH->First和pLH->Last
pLH->First = pList;
pLH->Last = pList;
pLH->ulCount++;
LeaveCriticalSection(&cs); //离开临界段
return TRUE;
}
}
LeaveCriticalSection(&cs); //离开临界段
return FALSE;
}
//--------------------------------------------------------------
//移除链表中的指定结点
BOOL RemoveList(DWORD Pid)
{
pPidModuleListHead pLH;
pPidModuleList pL;
//进入临界段
EnterCriticalSection(&cs);
pLH = g_pListHead;
if(pLH)
{
//存在链表头
if(pLH->First)
{
//不是空链表
if(pLH->First->Pid == Pid)
{
//第一个结点为要删除的结点
if(pLH->First->Next) //不是删除最后一个结点
{
pPidModuleList pTemp;
pTemp = pLH->First; //指向第一个结点
pLH->First = pLH->First->Next; //头结点中的Next指针存放
free(pTemp); //释放删除的结点内存空间
}
else //删除的是最后一个结点
{
free(pLH->First);
pLH->First = NULL; //头结点的First指针置为NULL
pLH->Last = NULL;
}
pLH->ulCount--;
LeaveCriticalSection(&cs); //离开临界段
return TRUE;
}
pL = pLH->First; //pL指向第一个结点
do
{
if(pL->Next->Pid == Pid)
{
//找到要删除的结点
if(pL->Next->Next != NULL)
{
//要删除的结点不是最后一个结点
pPidModuleList pTemp;
pTemp = pL->Next; //保存要删除的结点位置
pL->Next = pTemp->Next; //从链中去掉结点
free(pTemp);
}
else
{
//要删除的结点是最后一个结点
free(pL->Next);
pL->Next = NULL; //pL成为了最后一个结点,将它指向NULL
pLH->Last = pL;
}
pLH->ulCount--;
LeaveCriticalSection(&cs); //离开临界段
return TRUE;
}
}while((pL = pL->Next) && (pL->Next)); //结点指针后移,并存在下一个结点
}
}
LeaveCriticalSection(&cs); //离开临界段
return FALSE;
}
//--------------------------------------------------------------
//输入链表中的信息
void PrintList()
{
pPidModuleListHead pLH;
pPidModuleList pL;
ULONG i = 0;
//进入临界段
EnterCriticalSection(&cs);
pLH = g_pListHead;
if(pLH)
{
//存在链表头
if(pLH->First)
{
//不是空链表
pL = pLH->First; //pL指向第一个结点
//打印链表信息
printf("-------------- 链表信息 -------------\n");
printf("链表中共有结点 %d 个\n\n", pLH->ulCount);
do
{
printf("%04d PID: %05d ModuleBase: %08X\n", ++i, pL->Pid, pL->dwDllModuleBase);
}while(pL = pL->Next); //结点指针后移
printf("------------ 链表信息结束 -----------\n");
}
}
LeaveCriticalSection(&cs); //离开临界段
}
//--------------------------------------------------------------
//通过Pid,查找Dll模块基址
DWORD LookupDllModuleBaseByPid(DWORD Pid)
{
pPidModuleListHead pLH;
pPidModuleList pL;
ULONG i = 0;
//进入临界段
EnterCriticalSection(&cs);
pLH = g_pListHead;
if(pLH)
{
//存在链表头
if(pLH->First)
{
//不是空链表
pL = pLH->First; //pL指向第一个结点
do
{
if(pL->Pid == Pid) //查找到要找的Dll模块基址
{
LeaveCriticalSection(&cs); //离开临界段
return pL->dwDllModuleBase;
}
}while(pL = pL->Next); //结点指针后移
}
}
LeaveCriticalSection(&cs); //离开临界段
return ~0;
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
//--------------------------------------------------------------
//修改进程运行特权级
//若需提升特权级到DEBUG模式,请使用字符串参数 "SeDebugPrivilege"
BOOL EnableDebugPriv(LPCTSTR szPrivilege)
{
HANDLE hToken;
LUID sedebugnameValue;
TOKEN_PRIVILEGES tkp;
if (!OpenProcessToken(GetCurrentProcess(),
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,
&hToken))
{
return FALSE;
}
if (!LookupPrivilegeValue(NULL, szPrivilege, &sedebugnameValue))
{
CloseHandle(hToken);
return FALSE;
}
tkp.PrivilegeCount = 1;
tkp.Privileges[0].Luid = sedebugnameValue;
tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
if (!AdjustTokenPrivileges(hToken, FALSE, &tkp, sizeof tkp, NULL, NULL))
{
CloseHandle(hToken);
return FALSE;
}
return TRUE;
}
//--------------------------------------------------------------
//代码注入
BOOL CodeInject(IN DWORD Pid, IN char *szDllFileName, OUT LPDWORD hDllModuleBase)
{
HANDLE hThread; //远线程
char szDllPathName[MAX_PATH + 1]; //Dll全路径名
char *pDllRemote; //远线程地址,指向存放Dll全路径名的地址
HANDLE hProcess; //打开进程句柄,即目标进程
DWORD dwRet;
memset(szDllPathName, 0, sizeof(szDllPathName));
//得到Dll的全路径名
if(!::GetFullPathName(szDllFileName, sizeof(szDllPathName) - 1, szDllPathName, NULL))
{
//出错
return FALSE;
}
if(::GetFileAttributes(szDllPathName) == -1)
{
//文件Dll文件不存在
return FALSE;
}
//提升进程特权级
if(!EnableDebugPriv("SeDebugPrivilege"))
{
//提升特权级失败
//Do Nothing
}
//打开目标进程
hProcess = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid);
if(!hProcess)
{
//打开进程失败
return FALSE;
}
pDllRemote = (char *)::VirtualAllocEx(hProcess, NULL, sizeof(szDllPathName), \
MEM_COMMIT, PAGE_READWRITE);
if(!pDllRemote)
{
//分配失败
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
if(!::WriteProcessMemory(hProcess, pDllRemote, (void*)szDllPathName, \
sizeof(szDllPathName), NULL))
{
//写入Dll路径出错
//释放分配的内存
::VirtualFreeEx(hProcess, pDllRemote, sizeof(szDllPathName), MEM_RELEASE);
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
hThread = ::CreateRemoteThread(hProcess, NULL, 0, \
(LPTHREAD_START_ROUTINE)::GetProcAddress( \
::GetModuleHandle(KERNEL_MODULE_NAME), \
"LoadLibraryA"), pDllRemote, 0, NULL);
//等待2秒
if(::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED)
{
//超时没有返回
//释放分配的内存
::VirtualFreeEx(hProcess, pDllRemote, sizeof(szDllPathName), MEM_RELEASE);
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
if(!hThread)
{
//创建远线程失败
//释放分配的内存
::VirtualFreeEx(hProcess, pDllRemote, sizeof(szDllPathName), MEM_RELEASE);
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
//得到加载模块的基址
while((dwRet = ::GetExitCodeThread(hThread, hDllModuleBase)) == STILL_ACTIVE)
{
Sleep(1);
}
if(!dwRet || !(LPDWORD)(*hDllModuleBase))
{
//得到加载基址失败
//Do Nothing
printf("Pid: %05d LoadLibraryA Failed!\n", Pid);
//释放分配的内存
::VirtualFreeEx(hProcess, pDllRemote, sizeof(szDllPathName), MEM_RELEASE);
//关闭远线程句柄
::CloseHandle(hThread);
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
//释放分配的内存
::VirtualFreeEx(hProcess, pDllRemote, sizeof(szDllPathName), MEM_RELEASE);
//关闭远线程句柄
::CloseHandle(hThread);
//关闭进程句柄
::CloseHandle(hProcess);
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//这里在链表中加入相应结点
//生成一个新结点
pPidModuleList pList = (pPidModuleList)malloc(sizeof(PidModuleList));
memset(pList, 0, sizeof(PidModuleList));
pList->Next = NULL;
pList->Pid = Pid;
pList->dwDllModuleBase = (DWORD)(*hDllModuleBase);
if(!InsertList(pList))
{
//加入链表出错
free(pList);
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
return TRUE;
}
//--------------------------------------------------------------
//卸载注入的代码模块
BOOL UnCodeInject(IN DWORD Pid, IN DWORD hDllModuleBase)
{
//远线程句柄
HANDLE hThread;
//卸载目标进程句柄
HANDLE hProcess;
DWORD dwRet;
DWORD dwFreeLibRet;
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//这里释放链表中的相应结点
if(!RemoveList(Pid))
{
//结点删除出错
//Do Nothing
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//打开目标进程
hProcess = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, Pid);
if(!hProcess)
{
//打开进程失败
return FALSE;
}
hThread = ::CreateRemoteThread(hProcess, NULL, 0, \
(LPTHREAD_START_ROUTINE)::GetProcAddress( \
::GetModuleHandle(KERNEL_MODULE_NAME), \
"FreeLibrary"), (void*)hDllModuleBase, 0, NULL);
//等待2秒
if(::WaitForSingleObject(hThread, INFINITE) == WAIT_FAILED)
{
//超时没有返回
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
if(!hThread)
{
//创建远线程失败
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
//得到释放库返回的值
while((dwRet = ::GetExitCodeThread(hThread, &dwFreeLibRet)) == STILL_ACTIVE)
{
Sleep(1);
}
if(!dwRet || !dwFreeLibRet)
{
//释放库失败
//Do Nothing
printf("FreeLibrary Failed!\n");
//关闭远线程句柄
::CloseHandle(hThread);
//关闭进程句柄
::CloseHandle(hProcess);
return FALSE;
}
//关闭远线程句柄
::CloseHandle(hThread);
//关闭进程句柄
::CloseHandle(hProcess);
return TRUE;
}
//--------------------------------------------------------------
//将代码注入所有进程
BOOL CodeInjectAll(IN char *szDllFileName)
{
//遍历所有进程,进行注入
HANDLE hProcessSnap = NULL;
BOOL bRet = FALSE;
PROCESSENTRY32 pe32 = {0};
DWORD dwCurrentId;
DWORD dwDllModuleBase;
//初始化临界段
InitializeCriticalSection(&cs);
//保存Dll文件名为全局变量
memset(g_szDllFileName, 0, sizeof(g_szDllFileName));
strcpy(g_szDllFileName, szDllFileName);
//得到本程序的PID
dwCurrentId = ::GetCurrentProcessId();
//对系统中的所有运行进程进行快照
hProcessSnap = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
if(hProcessSnap == INVALID_HANDLE_VALUE)
{
//获取快照失败
return FALSE;
}
pe32.dwSize = sizeof(PROCESSENTRY32);;
//遍历进程
if(::Process32First(hProcessSnap, &pe32))
{
//得到第一个成功
do
{
if(dwCurrentId != pe32.th32ProcessID) //枚举除本进程以外的全部运行进程
{
//这里对得到的进程信息进行操作
//进行Dll注入
if(!CodeInject(pe32.th32ProcessID, szDllFileName, &dwDllModuleBase))
{
//注入失败
}
}
}while(::Process32Next(hProcessSnap, &pe32));
//关闭快照句柄
::CloseHandle(hProcessSnap);
}
//------------------------------------------------------------------
//这里启动进程创建撤消监视进程
char SysPathName[MAX_PATH+1];
memset(SysPathName, 0, sizeof(SysPathName));
//得到当前驱动程序全路径名
if(::GetCurrentDirectory(sizeof(SysPathName) - 1, SysPathName))
{
//得到当前目录成功
strcat(SysPathName, "\\");
strcat(SysPathName, SYS_NAME);
//----------测试
printf("驱动全路径名: %s\n", SysPathName);///////////////测试
//开始创建进程提示
if(!CreateEventNotifyRing3(SysPathName, (DWORD)CreateProcessPrompt))
{
MessageBox(NULL, "进程监视线程安装失败!", "错误", MB_OK);
return FALSE;
}
}
return TRUE;
}
//--------------------------------------------------------------
//卸载所有注入的进程模块
BOOL UnCodeInjectAll()
{
//--------------------------------------------
//卸载驱动的事件
g_hShutdownOverEvent = ::CreateEvent(NULL, FALSE, FALSE, NULL); //创建关闭完毕提示事件
::SetEvent(g_hShutdownEvent); //设置退出事件,使创建进程提示结束,并自动卸载驱动
//等待驱动卸载完成
::WaitForSingleObject(g_hShutdownOverEvent, INFINITE);
//关闭事件句柄
::CloseHandle(g_hShutdownOverEvent);
//---------------------------------------------------
//注入模块卸载
//从链表中取出所有注入的模块,进行卸载
pPidModuleListHead pLH;
pLH = g_pListHead; //指向头结点
if(pLH)
{
while(pLH->First) //不是最后一个结点
{
if(!UnCodeInject(pLH->First->Pid, pLH->First->dwDllModuleBase))
{
//卸载此结点失败
//Do Nothing
}
}
free(g_pListHead); //释放头结点
}
//删除临界段
DeleteCriticalSection(&cs);
return TRUE;
} | [
"exp371@outlook.com"
] | exp371@outlook.com |
1e03b0530f96df194cd5d1bfa9dc5873dd3e1249 | 275a4fd85a1d85e6cfbfdc22adf6f1cb4bfb9360 | /shared/ClanLib-2.0/Sources/API/Core/System/autoptr.h | 844afba7abd844ddb38c74a1ec5855ac9256b182 | [
"LicenseRef-scancode-unknown-license-reference",
"XFree86-1.1"
] | permissive | fatalfeel/proton_sdk_source | 20656e1df64b29cfe0fc3d15f8b36cf1358704c4 | 15addf2c7f9b137788322d609b7df0506c767f68 | refs/heads/master | 2021-08-03T07:14:18.079209 | 2021-07-23T02:35:54 | 2021-07-23T02:35:54 | 17,131,205 | 20 | 5 | null | null | null | null | UTF-8 | C++ | false | false | 2,345 | h | /*
** ClanLib SDK
** Copyright (c) 1997-2010 The ClanLib Team
**
** This software is provided 'as-is', without any express or implied
** warranty. In no event will the authors be held liable for any damages
** arising from the use of this software.
**
** Permission is granted to anyone to use this software for any purpose,
** including commercial applications, and to alter it and redistribute it
** freely, subject to the following restrictions:
**
** 1. The origin of this software must not be misrepresented; you must not
** claim that you wrote the original software. If you use this software
** in a product, an acknowledgment in the product documentation would be
** appreciated but is not required.
** 2. Altered source versions must be plainly marked as such, and must not be
** misrepresented as being the original software.
** 3. This notice may not be removed or altered from any source distribution.
**
** Note: Some of the libraries ClanLib may link to may have additional
** requirements or restrictions.
**
** File Author(s):
**
** Magnus Norddahl
*/
#pragma once
#include "../api_core.h"
/// \addtogroup clanCore_System clanCore System
/// \{
template<typename Type>
/// \brief CL_AutoPtr
///
/// \xmlonly !group=Core/System! !header=core.h! \endxmlonly
class CL_AutoPtr
{
public:
CL_AutoPtr()
: ptr(0)
{
}
CL_AutoPtr<Type>(CL_AutoPtr<Type> &other)
: ptr(other.release())
{
}
explicit CL_AutoPtr<Type>(Type *ptr)
: ptr(ptr)
{
}
~CL_AutoPtr()
{
delete ptr;
}
CL_AutoPtr<Type> &operator =(CL_AutoPtr<Type> &other)
{
if (this != &other)
reset(other.release());
return *this;
}
CL_AutoPtr<Type> &operator =(Type *ptr)
{
reset(ptr);
return *this;
}
void reset(Type *p = 0)
{
delete ptr;
ptr = p;
}
Type *release()
{
Type *p = ptr;
ptr = 0;
return p;
}
Type *get() { return ptr; }
const Type *get() const { return ptr; }
operator Type *() { return get(); }
operator const Type *() const { return get(); }
Type *operator->() { return get(); }
const Type *operator->() const { return get(); }
private:
Type *ptr;
};
template<typename Container>
void cl_delete_container(Container &container)
{
for (typename Container::iterator it = container.begin(); it != container.end(); ++it)
delete (*it);
container.clear();
}
/// \}
| [
"fatalfeel@hotmail.com"
] | fatalfeel@hotmail.com |
3de301d997bc427b05424957b46d4b7b319cbeff | 5cc2cc7628b07aa737b0191c7e374eb88455aa98 | /libqt5qssh5-0.0.1/src/libs/ssh/sshkeycreationdialog.h | e9fcf2ac98c54b4f8cf07199a2205c07d96d85c4 | [] | no_license | JosephMillsAtWork/qtpublic | 42454bfebd77e28c9e11b7f6317c947e70c283eb | 430681d2ffc8b91f3abceeca809d6a621e4c3baa | refs/heads/master | 2021-01-10T16:39:13.257950 | 2015-06-02T20:38:58 | 2015-06-02T20:38:58 | 36,760,292 | 4 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,314 | h | /****************************************************************************
**
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://www.qt.io/licensing. For further information
** use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef SSHKEYCREATIONDIALOG_H
#define SSHKEYCREATIONDIALOG_H
#include "ssh_global.h"
#include <QDialog>
namespace QSsh {
class SshKeyGenerator;
namespace Ui { class SshKeyCreationDialog; }
class QSSH_EXPORT SshKeyCreationDialog : public QDialog
{
Q_OBJECT
public:
SshKeyCreationDialog(QWidget *parent = 0);
~SshKeyCreationDialog();
QString privateKeyFilePath() const;
QString publicKeyFilePath() const;
private slots:
void keyTypeChanged();
void generateKeys();
void handleBrowseButtonClicked();
private:
void setPrivateKeyFile(const QString &filePath);
void saveKeys();
bool userForbidsOverwriting();
private:
SshKeyGenerator *m_keyGenerator;
Ui::SshKeyCreationDialog *m_ui;
};
} // namespace QSsh
#endif // SSHKEYCREATIONDIALOG_H
| [
"joseph@infiniteautomation.com"
] | joseph@infiniteautomation.com |
1b08d65af7a2652503ef72feee30594a0513996b | a35b30a7c345a988e15d376a4ff5c389a6e8b23a | /boost/archive/impl/xml_wiarchive_impl.ipp | cd8e72accff8449fe950bcccccf3b6838e170f4a | [] | no_license | huahang/thirdparty | 55d4cc1c8a34eff1805ba90fcbe6b99eb59a7f0b | 07a5d64111a55dda631b7e8d34878ca5e5de05ab | refs/heads/master | 2021-01-15T14:29:26.968553 | 2014-02-06T07:35:22 | 2014-02-06T07:35:22 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 77 | ipp | #include "thirdparty/boost_1_55_0/boost/archive/impl/xml_wiarchive_impl.ipp"
| [
"liuhuahang@xiaomi.com"
] | liuhuahang@xiaomi.com |
a49d816e0ac6c3f4e390d0ce870c07ba74acec49 | 8774e1860d88aeadcd1709e543f262b9f7983f31 | /src/netbase.h | b891e3ceb2a2f0efc54011bfde39963af02659b1 | [
"MIT"
] | permissive | npq7721/raven-dark | cb1d0f5da007ff5a46f6b1d8410101ce827a7f5f | abc2c956f5eb5b01eb4703918f50ba325b676661 | refs/heads/master | 2020-08-04T17:04:11.847541 | 2019-07-19T19:32:55 | 2019-07-19T19:32:55 | 212,213,490 | 0 | 0 | MIT | 2019-10-01T22:47:40 | 2019-10-01T22:47:40 | null | UTF-8 | C++ | false | false | 2,621 | h | // Copyright (c) 2009-2015 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#ifndef RAVENDARK_NETBASE_H
#define RAVENDARK_NETBASE_H
#if defined(HAVE_CONFIG_H)
#include "config/ravendark-config.h"
#endif
#include "compat.h"
#include "netaddress.h"
#include "serialize.h"
#include <stdint.h>
#include <string>
#include <vector>
extern int nConnectTimeout;
extern bool fNameLookup;
//! -timeout default
static const int DEFAULT_CONNECT_TIMEOUT = 5000;
//! -dns default
static const int DEFAULT_NAME_LOOKUP = true;
class proxyType
{
public:
proxyType(): randomize_credentials(false) {}
proxyType(const CService &proxy, bool randomize_credentials=false): proxy(proxy), randomize_credentials(randomize_credentials) {}
bool IsValid() const { return proxy.IsValid(); }
CService proxy;
bool randomize_credentials;
};
enum Network ParseNetwork(std::string net);
std::string GetNetworkName(enum Network net);
void SplitHostPort(std::string in, int &portOut, std::string &hostOut);
bool SetProxy(enum Network net, const proxyType &addrProxy);
bool GetProxy(enum Network net, proxyType &proxyInfoOut);
bool IsProxy(const CNetAddr &addr);
bool SetNameProxy(const proxyType &addrProxy);
bool HaveNameProxy();
bool LookupHost(const char *pszName, std::vector<CNetAddr>& vIP, unsigned int nMaxSolutions, bool fAllowLookup);
bool LookupHost(const char *pszName, CNetAddr& addr, bool fAllowLookup);
bool Lookup(const char *pszName, CService& addr, int portDefault, bool fAllowLookup);
bool Lookup(const char *pszName, std::vector<CService>& vAddr, int portDefault, bool fAllowLookup, unsigned int nMaxSolutions);
CService LookupNumeric(const char *pszName, int portDefault = 0);
bool LookupSubNet(const char *pszName, CSubNet& subnet);
bool ConnectSocket(const CService &addr, SOCKET& hSocketRet, int nTimeout, bool *outProxyConnectionFailed = 0);
bool ConnectSocketByName(CService &addr, SOCKET& hSocketRet, const char *pszDest, int portDefault, int nTimeout, bool *outProxyConnectionFailed = 0);
/** Return readable error string for a network error code */
std::string NetworkErrorString(int err);
/** Close socket and set hSocket to INVALID_SOCKET */
bool CloseSocket(SOCKET& hSocket);
/** Disable or enable blocking-mode for a socket */
bool SetSocketNonBlocking(SOCKET& hSocket, bool fNonBlocking);
/**
* Convert milliseconds to a struct timeval for e.g. select.
*/
struct timeval MillisToTimeval(int64_t nTimeout);
void InterruptSocks5(bool interrupt);
#endif // RAVENDARK_NETBASE_H
| [
"j4ys0n@gmail.com"
] | j4ys0n@gmail.com |
cbdbff000e764d48d00d3d460c8b5dec29e78fa2 | 4fcf2967da46f37c831b72b7b97f705d3364306d | /problems/acmicpc_5648.cpp | 7c36c1e7824c5daa29bf5b12a8a2e434b22d7e41 | [
"MIT"
] | permissive | qawbecrdtey/BOJ-sol | e2be11e60c3c19e88439665d586cb69234f2e5db | 249b988225a8b4f52d27c5f526d7c8d3f4de557c | refs/heads/master | 2023-08-03T15:04:50.837332 | 2023-07-30T08:25:58 | 2023-07-30T08:25:58 | 205,078,469 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 439 | cpp | #include <algorithm>
#include <iostream>
using namespace std;
using ll = long long;
void reverse(ll &n) {
ll res = 0;
while(n) {
res = res * 10 + n % 10;
n /= 10;
} n = res;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr); cout.tie(nullptr);
ll n; cin >> n;
auto a = new ll[n];
for(int i = 0; i < n; i++) {
cin >> a[i];
reverse(a[i]);
} sort(a, a + n);
for(int i = 0; i < n; i++) cout << a[i] << '\n';
} | [
"qawbecrdtey@naver.com"
] | qawbecrdtey@naver.com |
f8d8e8d8af7ffd6fc7690051ae604cdd1e0c27f3 | 103f28ca5486ca54a67799db39ea0716f9d45b0d | /Fit_square_in_triangle.cpp | f110744ac8cb466fb79072450c99c35820805649 | [] | no_license | SANJAY-KUMAR-7/Code-Chef | 8da2b276857310995e7ed625e6f1ee3524dcaaca | 4fb4e7d9e038ded05e2452e4bbec09922103fec7 | refs/heads/main | 2023-08-27T19:19:12.580931 | 2021-10-30T10:37:37 | 2021-10-30T10:37:37 | 422,849,917 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 555 | cpp | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int b,sq=0,area1,area2=4,temp;
cin>>b;
if(b<=3)
cout<<0<<endl;
else{
if(b%2==0){
area1=b*b;
area2=4;
temp=(area1/area2)-(b/2);
sq=temp/2;
cout<<sq<<endl;
}
else{
b-=1;
area1=b*b;
area2=4;
temp=(area1/area2)-(b/2);
sq=temp/2;
cout<<sq<<endl;
}
}
}
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
e6820c8f933bec13559e91ed69311e67ce542f29 | 7e6c55e5ce203bc7560c824adba0296333323642 | /Week6_Adv_Shortest_Path/Q1SuggestFriend/Q1SuggestFriend/Source.cpp | 781ea2881c24b040c37b9bf9a36e8612d83a3544 | [] | no_license | savras/coursera-uoc-algorithms-on-graph | e42d43ce56c30d7091fde01f5f6f8da42a064378 | b6914f74019a5c583fca8c24485ec5ee1c62bd75 | refs/heads/master | 2021-06-16T10:08:40.759646 | 2017-04-14T10:29:35 | 2017-04-14T10:29:35 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 584 | cpp | #include "Bidijkstra.h"
#include "vector"
using std::vector;
int main() {
int n, m;
scanf_s("%d%d", &n, &m);
Adj adj(2, vector<vector<int>>(n));
Adj cost(2, vector<vector<int>>(n));
for (int i = 0; i < m; ++i) {
int u, v, c;
scanf_s("%d%d%d", &u, &v, &c);
adj[0][u - 1].push_back(v - 1);
cost[0][u - 1].push_back(c);
adj[1][v - 1].push_back(u - 1);
cost[1][v - 1].push_back(c);
}
Bidijkstra bidij(n, adj, cost);
int t;
scanf_s("%d", &t);
for (int i = 0; i < t; ++i) {
int u, v;
scanf_s("%d%d", &u, &v);
printf("%lld\n", bidij.query(u - 1, v - 1));
}
} | [
"vgim@sateva.com.au"
] | vgim@sateva.com.au |
940a163a8901fa37b4ac71910c7c586a6aef036d | 986d745d6a1653d73a497c1adbdc26d9bef48dba | /cppbuch/k24/sortieren/merge0.cpp | 202b7bb8552b86fc7ebbd2e99a902d87456f5c22 | [] | no_license | AnarNFT/books-code | 879f75327c1dad47a13f9c5d71a96d69d3cc7d3c | 66750c2446477ac55da49ade229c21dd46dffa99 | refs/heads/master | 2021-01-20T23:40:30.826848 | 2011-01-17T11:14:34 | 2011-01-17T11:14:34 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 892 | cpp | /* cppbuch/k24/sortieren/merge0.cpp
Beispiel zum Buch von Ulrich Breymann: Der C++ Programmierer; Hanser Verlag
Diese Software ist freie Software. Website zum Buch: http://www.cppbuch.de/
*/
#include<algorithm>
#include<vector>
#include<numeric>
#include<showSequence.h>
#if __GNUC__*10+__GNUC_MINOR__ < 44
#include<ersatziota.h>
#endif
using namespace std;
int main() {
vector<int> folge1(6);
iota(folge1.begin(), folge1.end(), 0); // initialisieren
showSequence(folge1);
vector<int> folge2(10);
iota(folge2.begin(), folge2.end(), 0); // initialisieren
showSequence(folge2);
vector<int> result(folge1.size()+folge2.size());
// Verschmelzen zweier Folgen \tt{v1} und \tt{v2}, Ablage in \tt{result}
merge(folge1.begin(), folge1.end(), folge2.begin(), folge2.end(), result.begin());
showSequence(result);
}
| [
"stefan.naewe@atlas-elektronik.com"
] | stefan.naewe@atlas-elektronik.com |
848e1d33c20b75d2fbb2b48123bff051ffa28c83 | d7d01b5963df10348930b105a063b2b8e2576985 | /backend/src/util.cpp | d6646d1000196aa69579119f174cce78a936d000 | [] | no_license | Hypersonic/DistributedDB | decb6c09ce0cc4ae3518b145441b3f4485c19713 | 11e0b1c3d9465aff2d007f1944c6e63e6f1d50a8 | refs/heads/master | 2021-01-17T10:04:26.395379 | 2016-05-10T04:02:06 | 2016-05-10T04:02:06 | 58,323,180 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,355 | cpp | #include "util.h"
std::vector<std::string> util::split(std::string in, char splitchar) {
std::vector<std::string> vec;
std::string curr = "";
for_each(in.begin(), in.end(), [&] (char c) {
if (c == splitchar) {
vec.push_back(curr);
curr = "";
} else {
curr += c;
}
});
vec.push_back(curr);
return vec;
}
std::string util::join(std::vector<std::string> in, char joinchar) {
std::string ret = "";
for_each(in.begin(), in.end(), [&] (std::string s) {
ret += s + joinchar;
});
return ret;
}
std::string util::hexdecode(std::string in) {
std::string res = "";
for (size_t i = 0; i < in.length(); i+=2) {
std::string hexstr = "";
hexstr += in[i];
hexstr += in[i+1];
if (hexstr.length() == 2) {
res += std::stoi(hexstr, nullptr, 16);
} else {
ERR("wtf, this isn't hex: %s\n", hexstr.c_str());
}
}
return res;
}
std::string util::hexencode(std::string in) {
std::string res = "";
char buf[3];
for_each(in.begin(), in.end(), [&] (char c) {
sprintf(buf, "%02x", c);
res += buf;
});
return res;
}
bool util::contains(std::string s, std::string val) {
return s.find(val) != std::string::npos;
}
| [
"joshhofing@gmail.com"
] | joshhofing@gmail.com |
9ea2a8a5842999dd86975b237f49416c0b5fbf66 | cda1bdc1da19908100cbda68c08acf16cbc95136 | /Project/P2/submitted/submit_20140307_1st/verbose.cpp | ee18fcacfddc02014e0a8f98e9aa78efcab4fe85 | [] | no_license | tinglai/Algorithms-and-Data-Structures | 8de06c9f45ceadd7325e4eaac5667ebf8e592c56 | 42d16425fda69d03aea06c46adb21390a8674604 | refs/heads/master | 2021-01-20T15:37:33.913479 | 2014-12-30T03:16:52 | 2014-12-30T03:16:52 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,126 | cpp | #include <iostream>
#include <list>
#include "verbose.h"
#include "zombie.h"
#include <vector>
using namespace std;
void verbose(list<Zombie*>& actZombies,
list<Zombie*>& inactZombies,
unsigned int v, int roundCount){
unsigned vv;
if (v > inactZombies.size())
vv = inactZombies.size();
else
vv = v;
//first vv zombies killed
cout << "Zombies still active: "
<< actZombies.size() << '\n'
<< "First zombies killed:\n";
list<Zombie*>::iterator temp = inactZombies.begin();
unsigned int i = 0;
while (i < vv){
cout << (*temp)->getName() << ' ' << ++i << '\n';
temp++;
}
//last vv zombies killed
cout << "Last zombies killed:\n";
temp = inactZombies.end();
i = 0;
while (i < vv){
temp--;
cout << (*temp)->getName() << ' ' << (vv-i) << '\n';
i++;
}
//most active v zombies and least active v zombies
//by count sort
int vvv;
if (v > inactZombies.size() + actZombies.size())
vvv = inactZombies.size() + actZombies.size();
else
vvv = v;
vector<list<Zombie*>> stat(roundCount);
temp = inactZombies.begin();
int round = 0;
while(temp != inactZombies.end()){
round = (*temp)->getActRound();
listInsert(stat[round-1], *temp);
temp++;
inactZombies.pop_front();
}
temp = actZombies.begin();
while(temp != actZombies.end()){
round = (*temp)->getActRound();
listInsert(stat[round-1], *temp);
temp++;
actZombies.pop_front();
}
//most active
vv = vvv;
i = 0;
unsigned int j = roundCount - 1;
cout << "Most active zombies:\n";
while(vv != 0){
if(stat[j].empty()){
j--;
continue;
}
if(vv >= stat[j].size()){
temp = stat[j].begin();
while(temp != stat[j].end()){
cout << (*temp)->getName() << ' '
<< (*temp)->getActRound() << '\n';
temp++;
}
vv = vv - stat[j].size();
j--;
}
else{
temp = stat[j].begin();
for(unsigned int lala = 0; lala < vv; lala++){
cout << (*temp)->getName() << ' '
<< (*temp)->getActRound() << '\n';
temp++;
}
break;
}
}//while
//least active
i = 0;
j = 0;
cout << "Least active zombies:\n";
vv = vvv;
while(vv != 0){
if(stat[j].empty()){
j++;
continue;
}
if(vv >= stat[j].size()){
temp = stat[j].begin();
while(temp != stat[j].end()){
cout << (*temp)->getName() << ' '
<< (*temp)->getActRound() << '\n';
temp++;
}
vv = vv - stat[j].size();
j++;
}
else{
temp = stat[j].begin();
for(unsigned int lala = 0; lala < vv; lala++){
cout << (*temp)->getName() << ' '
<< (*temp)->getActRound() << '\n';
temp++;
}
break;
}
}//while
for(unsigned int i = 0; i < stat.size(); i++){
temp = stat[i].begin();
while(temp != stat[i].end()){
delete *temp;
temp++;
}
}
}//verbose
void listInsert(list<Zombie*>& ll, Zombie* in){
if(ll.empty()){
ll.push_back(in);
}
else{
list<Zombie*>::iterator temp = ll.end();
while(temp != ll.begin()){
temp--;
if((*temp)->getName() < in->getName()){
ll.insert(++temp, in);
return;
}
}
ll.push_front( in);
}
}
| [
"laiting@umich.edu"
] | laiting@umich.edu |
695904bd05c8077b828a1f9c8f2606ae8c030e55 | eb9f56b1231140835e8d66aee73130aceaffafdc | /src/data.cpp | 98107aa4dec5d56bc173223a7bc0086d7264c250 | [] | no_license | pszachew/SCZR-shapes-recognition | 66644e1e24d7dec9051c1b6be2cb5df5600c9e6f | 096d877678a0c0c228dbc124f33c37ad77b3c898 | refs/heads/main | 2023-02-02T07:22:06.571070 | 2020-12-23T16:06:12 | 2020-12-23T16:06:12 | 322,871,974 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 374 | cpp | #include<stdio.h>
#include<stdlib.h>
#include<unistd.h>
#include <iostream>
#include <fstream>
FILE * openGNUPlot() {
FILE * gnuplot = popen( "gnuplot", "w" ); /* otwarcie potoku do zapisu */
return gnuplot;
}
void histogram(std::string data_filename, FILE * gnuplot){
}
int main() {
FILE * gnuplot= openGNUPlot();
pclose(gnuplot);
return 0; | [
"48053724+kkosteck@users.noreply.github.com"
] | 48053724+kkosteck@users.noreply.github.com |
baf350aa1ec590a117b6f0ba6bee9618fe26ceed | 3698040ce5c18c6828987c0c270dae9dbf63fd0a | /facade.cpp | 9a394f3d7ff6ad128a253c0ac3de702c3063ef05 | [] | no_license | DougArrow/lab7 | 7953f82fe6d3b53e78d437cbc5783d53832f8908 | a35b98bdd94b74b9484bb037dcc356920a4c1392 | refs/heads/master | 2020-03-19T01:47:44.547095 | 2018-05-31T11:09:04 | 2018-05-31T11:09:04 | 135,572,874 | 0 | 0 | null | null | null | null | WINDOWS-1251 | C++ | false | false | 3,683 | cpp |
#include "stdafx.h"
#include <iostream>
using namespace std;
class MisDepartment
{
public:
void submitNetworkRequest()
{
_state = 0;
}
bool checkOnStatus()
{
_state++;
if (_state == Complete)
return 1;
return 0;
}
private:
enum States
{
Received, DenyAllKnowledge, ReferClientToFacilities,
FacilitiesHasNotSentPaperwork, ElectricianIsNotDone,
ElectricianDidItWrong, DispatchTechnician, SignedOff,
DoesNotWork, FixElectriciansWiring, Complete
};
int _state;
};
class ElectricianUnion
{
public:
void submitNetworkRequest()
{
_state = 0;
}
bool checkOnStatus()
{
_state++;
if (_state == Complete)
return 1;
return 0;
}
private:
enum States
{
Received, RejectTheForm, SizeTheJob, SmokeAndJokeBreak,
WaitForAuthorization, DoTheWrongJob, BlameTheEngineer,
WaitToPunchOut, DoHalfAJob, ComplainToEngineer,
GetClarification, CompleteTheJob, TurnInThePaperwork,
Complete
};
int _state;
};
class FacilitiesDepartment
{
public:
void submitNetworkRequest()
{
_state = 0;
}
bool checkOnStatus()
{
_state++;
if (_state == Complete)
return 1;
return 0;
}
private:
enum States
{
Received, AssignToEngineer, EngineerResearches,
RequestIsNotPossible, EngineerLeavesCompany,
AssignToNewEngineer, NewEngineerResearches,
ReassignEngineer, EngineerReturns,
EngineerResearchesAgain, EngineerFillsOutPaperWork,
Complete
};
int _state;
};
class FacilitiesFacade
{
public:
FacilitiesFacade()
{
_count = 0;
}
void submitNetworkRequest()
{
_state = 0;
}
bool checkOnStatus()
{
_count++;
/* Запрос на обслуживание получен */
if (_state == Received)
{
_state++;
/* Перенаправим запрос инженеру */
_engineer.submitNetworkRequest();
cout << "submitted to Facilities - " << _count
<< " phone calls so far" << endl;
}
else if (_state == SubmitToEngineer)
{
/* Если инженер свою работу выполнил,
перенаправим запрос электрику */
if (_engineer.checkOnStatus())
{
_state++;
_electrician.submitNetworkRequest();
cout << "submitted to Electrician - " << _count
<< " phone calls so far" << endl;
}
}
else if (_state == SubmitToElectrician)
{
/* Если электрик свою работу выполнил,
перенаправим запрос технику */
if (_electrician.checkOnStatus())
{
_state++;
_technician.submitNetworkRequest();
cout << "submitted to MIS - " << _count
<< " phone calls so far" << endl;
}
}
else if (_state == SubmitToTechnician)
{
/* Если техник свою работу выполнил,
то запрос обслужен до конца */
if (_technician.checkOnStatus())
return 1;
}
/* Запрос еще не обслужен до конца */
return 0;
}
int getNumberOfCalls()
{
return _count;
}
private:
enum States
{
Received, SubmitToEngineer, SubmitToElectrician,
SubmitToTechnician
};
int _state;
int _count;
FacilitiesDepartment _engineer;
ElectricianUnion _electrician;
MisDepartment _technician;
};
int main()
{
FacilitiesFacade facilities;
facilities.submitNetworkRequest();
/* Звоним, пока работа не выполнена полностью */
while (!facilities.checkOnStatus())
;
cout << "job completed after only "
<< facilities.getNumberOfCalls()
<< " phone calls" << endl;
system("pause");
}
| [
"noreply@github.com"
] | noreply@github.com |
6fe329cfc58e592964f999932d797ede888fe0cf | 3d00c1653e4b4033354582ca75da4c61a1316ffd | /DSA PRACTICALS/MATRICES/lower triangular row major.cpp | d6722c07ab60c0c12de85eb934ad3b1f80fbf6aa | [] | no_license | Swatigupta-droid/Data_Structures | 5bbe08d1cb46b68cdc032590657fe35fadc5dd6c | 5a9a57dd5e2eaba8037374b3f146f911feeb12b0 | refs/heads/main | 2023-09-01T19:05:19.346978 | 2021-10-30T22:40:03 | 2021-10-30T22:40:03 | 423,003,082 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,967 | cpp | #include<iostream>
using namespace std;
template <class T>
class lowerrow
{
public:
lowerrow(int N=10);
T get(int ,int )const;
void set(int ,int , T&);
private:
int n;
T *arr;
};
template <class T>
lowerrow<T>::lowerrow(int N)
{
if(N<1)
throw ("Matrix size should be greater than 0");
n=N*(N+1)/2;
arr=new int[n];
}
template <class T>
T lowerrow<T>::get(int i,int j)const
{
if(i<0||j<0||i>n||j>n)
throw ("Array Index out of bounds");
if(i>=j)
return arr[i*(i-1)/2 +j-1];
else
return 0;
}
template <class T>
void lowerrow<T>::set(int i,int j, T& val)
{
if(i<0||j<0||i>n||j>n)
throw ("Array Index out of bounds");
if(i>=j)
arr[i*(i-1)/2 +j-1]=val;
else
if(val!=0)
throw ("Value should be zero");
}
int main()
{
int n;int val;
cout<<"Enter the order of matrix"<<endl;
cin>>n;int i,j;
lowerrow<int> d (n);
int **arr;
arr=new int*[n];
for(int i=0;i<n;i++)
{
arr[i]=new int[n];
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cout<<"element at position"<<i<<j<<endl;
cin>>arr[i][j];
d.set(i,j,arr[i][j]);
}
}
for(int i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
cout<<arr[i][j]<<" ";
}
cout<<endl;
}
int ch;char repeat;
do
{
cout<<"***MENU***"<<endl;
cout<<"1.Update a element"<<endl;
cout<<"2.Get an element"<<endl;
cout<<"Enter your choice"<<endl;
cin>>ch;
switch(ch)
{
case 1:
{
cout<<"Enter the index of the element"<<endl;
cin>>i>>j;
cout<<"Enter the value"<<endl;
cin>>val;
d.set(i,j,val);
break;
}
case 2:
{
cout<<"Enter the position of matrix you want to know the value of"<<endl;
cin>>i>>j;
cout<<"The value is "<<d.get(i,j)<<endl;
break;
}
default:
{
cout<<"Wrong choice"<<endl;
break;
}
}
cout<<"Do you want to continue(Y/N)?"<<endl;
cin>>repeat;
}
while(repeat=='y'||repeat=='Y');
return 0;
} | [
"noreply@github.com"
] | noreply@github.com |
5d15e282f43ae802ab1025508cf6a0f5ff0f498e | dd3be834f8fed4affe046fddbd2a84abb47717fe | /2Dising.cpp | d145532a02f29f669d398dc9c78fc7f9f93bece1 | [] | no_license | scottgeraedts/tfim | 080092e244ec11da5dee1903d6b9535ae94bd573 | c3d5b711a4e810bf4103ed61b0f1d5a9025b62a0 | refs/heads/master | 2020-12-31T04:28:58.763792 | 2016-12-16T18:20:42 | 2016-12-16T18:20:42 | 49,230,233 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,905 | cpp |
#include "version.h"
#include "tfim.h"
#include <string>
#include <bitset>
#include <Eigen/Core>
using namespace std;
//return integers that make nice entanglement cuts
int cuts(int Lx,int Ly){
bitset<30> out;
//4x3:
// 0 0 0 0
// 1 1 1 0
// 1 1 1 0 ==0,1,2,4,5,6
if(Lx*Ly==12) //careful! this won't work for 6x2!
out=bitset<30>(string("000001110111"));
//5x3:
// 0 0 0 0 0
// 1 1 1 1 0
// 1 1 1 1 0 ==0,1,2,4,5,6
if(Lx*Ly==15)
out=bitset<30>(string("000000111101111"));
if(Lx*Ly==16)
out=bitset<30>(string("0000000011111111"));
return out.to_ulong();
}
int main(){
clock_t CPUtime1=clock();
time_t walltime1=time(NULL);
//read parameters from a file
ifstream infile;
infile.open("params2d");
int Lx=value_from_file(infile,3);
int Ly=value_from_file(infile,3);
double Jz=value_from_file(infile,1.);
double hx=value_from_file(infile,1.);
double hz_const=value_from_file(infile,1.);
double hz_var=value_from_file(infile,1.);
#ifndef USE_COMPLEX
// if(hy!=0){
// cout<<"you can't use hy!=0 if you don't enable complex numbers!"<<endl;
// exit(0);
// }
#endif
int seed=value_from_file(infile,1);
infile.close();
//setup random coefficients
MTRand ran;
ran.seed(seed);
vector<double> alphax=vector<double>(Lx*Ly,0);
vector<double> alphay=vector<double>(Lx*Ly,0);
vector<double> alphaz=vector<double>(Lx*Ly,0);
// ifstream datfile;
// datfile.open("nicrans");
for(int i=0; i<Lx*Ly; i++){
alphax[i]= hx; //2.*hx*(ran.rand() -0.5);
alphay[i]= 0; //2.*hy*(ran.rand() -0.5);
alphaz[i]= hz_const+hz_var*2*(ran.rand()-0.5);
//getting random alphas from a file file sent by nicolas
// datfile>>alphax[i]>>alphay[i]>>alphaz[i];
// cout<<alphax[i]<<" "<<alphay[i]<<" "<<alphaz[i]<<endl;
}
// datfile.close();
#ifdef USE_COMPLEX
MatrixTFIM< complex<double> > A(Lx,Ly,0,0,Jz,alphax,alphay,alphaz,-1);
#else
MatrixTFIM<double> A(Lx,Ly,0,0,Jz,alphax,alphay,alphaz,-1);
#endif
bool sparseSolve=false;
if(Lx*Ly>12) sparseSolve=true;
int N_output_states,start,end;
if(!sparseSolve){
N_output_states=A.nrows();
A.makeDense();
A.EigenDenseEigs();
start=A.nrows()/3; end=2*A.nrows()/3;
}
else{
N_output_states=1000;
// clock_t CPUtime2=clock();
// time_t walltime2=time(NULL);
// double target=A.find_middle();
// CPUtime2=clock()-CPUtime2;
double target=0.5;
start=0; end=N_output_states;
// walltime2=time(NULL)-walltime2;
// cout<<"time to find middlish energies: "<<(float)CPUtime2/CLOCKS_PER_SEC<<" CPU time and "<<walltime2<<" walltime"<<endl;
N_output_states=A.eigenvalues(N_output_states,target);
start=0; end=N_output_states;
}
// for(int i=0;i<N_output_states;i++) cout<<A.eigvals[i]<<endl;
A.energy_spacings();
A.entanglement_spacings(start,end,cuts(Lx,Ly));
CPUtime1=clock()-CPUtime1;
walltime1=time(NULL)-walltime1;
cout<<"total time: "<<(float)CPUtime1/CLOCKS_PER_SEC<<" CPU time and "<<walltime1<<" walltime"<<endl;
}
| [
"scott.geraedts@gmail.com"
] | scott.geraedts@gmail.com |
f5db1ed4fe2bd95eca369407cd7962ee55d61509 | c211ef3f0102894fe7db592e3ff4816f23102c80 | /Luo_Jia_Li_Xian_Ji/huo_dong_zhong_xin.cpp | 63baab811cc7db1f8fc02c14070d94edf317a01b | [] | no_license | lost-cat/Luo_Jia_Li_Xian_Ji | e1f1d0f87237c47339dfa9a43d8b0ea1add4eb5d | 7c12c167f0221705be66d7b5185938138d8db05a | refs/heads/master | 2022-11-10T06:44:03.293173 | 2020-06-16T07:31:45 | 2020-06-16T07:31:45 | 263,050,455 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 3,242 | cpp | #include "huo_dong_zhong_xin.h"
#include<qtimer.h>
huo_dong_zhong_xin::huo_dong_zhong_xin(maincharc* mm, QWidget* parent)
: QMainWindow(parent)
{
ui.setupUi(this);
//int* meili = new int;
setAutoFillBackground(true);
QPalette backgound = this->palette();
backgound.setBrush(backgroundRole(), QPixmap(":/plotphoto/luojiashan3.jpg"));
setPalette(backgound);
//setFixedSize(500, 491);
setWindowTitle(QStringLiteral("大学生活动中心"));
//古琴笛箫吉他社
connect(ui.toolButton, &QPushButton::clicked, [=]() {
if (mm->movepoint>30)
{
ui.textEdit_2->setText(QStringLiteral("古琴笛箫社\n 弹了一段时间古琴,心情都变好了!\n 魅力+2!!"));
mm->meiLi += 2;
mm->movepoint -= 30;
}
else
{
ui.textEdit_2->append("No Enough Movepoint");
}
});
//球类运动
connect(ui.toolButton_2, &QPushButton::clicked, [=]() {
if (mm->movepoint>40)
{
ui.textEdit_2->setText(QStringLiteral("球类运动社\n 刚刚的篮球赛好激烈呀,不过还好赢啦!\n 健康+2!!"));
mm->HP += 2;
mm->movepoint -= 40;
}
else
{
ui.textEdit_2->append("No Enough Movepoint");
}
});
//四六级培训
connect(ui.toolButton_4, &QPushButton::clicked, [=]() {
if (mm->movepoint > 20)
{
ui.textEdit_2->setText(QStringLiteral("四六级培训\n 帮助同学们极大地提升了英语水平!\n 智慧+30!!"));
mm->zhiLI += 30;
mm->movepoint -= 20;
}
else
{
ui.textEdit_2->append("No Enough Movepoint");
}
});
//樱花节
connect(ui.toolButton_3, &QPushButton::clicked, [=]() {
if (mm->movepoint > 20)
{
ui.textEdit_2->setText(QStringLiteral("樱花节\n 前面有游客在人工制造樱花雨,你走上去提醒,游客连忙道歉并表示不会出现这种情况了!!\n 情商+2!!"));
mm->qinShang += 30;
mm->movepoint -= 20;
}
else
{
ui.textEdit_2->append("No Enough Movepoint");
}
});
//离开
connect(ui.pushButton, &QPushButton::clicked, [=]() {
emit back();
ui.textEdit_2->clear();
});
QTimer* t = new QTimer(this);
t->start(100);
connect(t, &QTimer::timeout, [=]() {
ui.move->setText(QString::number(mm->movepoint));
ui.hp->setText(QString::number(mm->HP));
/*ui.week->setText(QString("第 %1周").arg(this->week));
ui.day->setText(QString("星期%1").arg(this->day));*/
//ui.money->setText(QString::number(mm->money));
ui.zi->setText(QString::number(mm->zhiLI));
ui.qin->setText(QString::number(mm->qinShang));
ui.mei->setText(QString::number(mm->meiLi));
ui.ima->setText(QString::number(mm->img));
/*c->day = this->day;
c->week = this->week;*/
});
}
// void huo_dong_zhong_xin::meili(int* a, Maincharc * b)
//{
//if (*a == 0)
// {
// connect(ui.toolButton, &QPushButton::clicked, [=]() {
// //ui.secondChoice->close();
// //ui.teachingBuildingWords->close();
// ui.textEdit_2->setText(QStringLiteral(" 魅力 +2"));
// b->meili += 2;
// });
//}
// else if (*a == 1)
// {
// connect(ui.toolButton, &QPushButton::clicked, [=]() {
//ui.secondChoice->close();
//ui.teachingBuildingWords->close();
// ui.textEdit_2->setText(QStringLiteral(" 魅力 +1"));
// b->meili += 1;
// });
// }
//}
| [
"2797006545@qq.com"
] | 2797006545@qq.com |
82adf8338a18e340da5e2901b379cb23489cce5c | 653781b48f4d41b4c9ba3c3cb5fcc64ab332fdb3 | /Distinct Values.cpp | cd85355ecc517251b6ed4696f24fd9c0dbe9065a | [] | no_license | phyBrackets/CSES-PROBLEM-SET | 18d4f9741a436c8323521120b9bf941c50ac7da4 | 9042d5d398dc783261876b26760eb99443774cab | refs/heads/main | 2023-04-18T13:44:20.114447 | 2021-04-27T11:48:43 | 2021-04-27T11:48:43 | 359,926,944 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 280 | cpp | #include<bits/stdc++.h>
using namespace std;
int main(){
long long n,c=0;
cin>>n;
long long a[n];
for(int i=0;i<n;i++)
cin>>a[i];
set<int> s;
for(int i=0;i<n;i++){
s.insert(a[i]);
}
cout<<s.size()<<endl;
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
edc06e5cb52c0f41cd282a91567950f12da7b486 | 3f41676a5ae5a2db94c358cf9e36e838e4846e60 | /TeaProductionLine IMS/EditLinePopDlg.cpp | 655aabf702dc6e729f368962ce5e42b5cf8c826e | [] | no_license | zhouyu0615/TeaproductionIMS | 223d407e4c11cc9fbb5f2c12c0ada17dd221ce0d | 399fd0e2ef2c88bec04046efd8b1dfe178961f85 | refs/heads/master | 2021-01-10T01:47:36.826168 | 2016-03-31T06:34:14 | 2016-03-31T06:34:14 | 44,712,794 | 1 | 0 | null | null | null | null | GB18030 | C++ | false | false | 2,135 | cpp | // EditLinePopDlg.cpp : 实现文件
//
#include "stdafx.h"
#include "TeaProductionLine IMS.h"
#include "EditLinePopDlg.h"
#include "afxdialogex.h"
// CEditLinePopDlg 对话框
IMPLEMENT_DYNAMIC(CEditLinePopDlg, CDialogEx)
CEditLinePopDlg::CEditLinePopDlg(CWnd* pParent /*=NULL*/)
: CDialogEx(CEditLinePopDlg::IDD, pParent)
{
}
CEditLinePopDlg::~CEditLinePopDlg()
{
}
void CEditLinePopDlg::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Control(pDX, IDC_ED1_EDITLINE_POPDLG, m_editLineName);
DDX_Control(pDX, IDC_ED2_EDITLINE_POPDLG, m_editCapacity);
DDX_Control(pDX, IDC_ED3_EDITLINE_POPDLG, m_editDescription);
}
BEGIN_MESSAGE_MAP(CEditLinePopDlg, CDialogEx)
ON_BN_CLICKED(IDOK, &CEditLinePopDlg::OnBnClickedOk)
END_MESSAGE_MAP()
// CEditLinePopDlg 消息处理程序
void CEditLinePopDlg::OnBnClickedOk()
{
CString strLineName, strCapacity, strDescription;
m_editLineName.GetWindowText(strLineName);
m_editCapacity.GetWindowText(strCapacity);
m_editDescription.GetWindowText(strDescription);
m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_strLineName = strLineName;
m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_strCapacity = strCapacity;
m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_strDescription = strDescription;
int Id = m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_Id;
m_pDataProvider->UpdateTableItem(CDataProvider::tbProductionLine,Id);
m_pDataProvider->UpdateRelatedToLine(Id, strLineName);
CDialogEx::OnOK();
}
BOOL CEditLinePopDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
m_editLineName.SetWindowText(m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_strLineName);
m_editCapacity.SetWindowText(m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_strCapacity);
m_editDescription.SetWindowText(m_pDataProvider->m_vectProductionLine[m_nSelectedItem].m_strDescription);
return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
}
void CEditLinePopDlg::OnOK()
{
// TODO: 在此添加专用代码和/或调用基类
//CDialogEx::OnOK();
}
| [
"871211719@qq.com"
] | 871211719@qq.com |
995b127fba03071b88b2b32b7fc23454341d211c | 9963f25b075c73fc4e2759c7099304035fa85fc0 | /atcoder/edpc/k.cc | 94cee34787e6c6c02f4b92a02520bd21de4dbb11 | [
"BSD-2-Clause"
] | permissive | kyawakyawa/CompetitiveProgramingCpp | a0f1b00da4e2e2c8f624718a06688bdbfa1d86e1 | dd0722f4280cea29fab131477a30b3b0ccb51da0 | refs/heads/master | 2023-06-10T03:36:12.606288 | 2021-06-27T14:30:10 | 2021-06-27T14:30:10 | 231,919,225 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 5,974 | cc | #include <stdint.h>
#include <stdlib.h>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <vector>
using namespace std;
using default_counter_t = int64_t;
// macro
#define let auto const&
#define overload4(a, b, c, d, name, ...) name
#define rep1(n) \
for (default_counter_t i = 0, end_i = default_counter_t(n); i < end_i; ++i)
#define rep2(i, n) \
for (default_counter_t i = 0, end_##i = default_counter_t(n); i < end_##i; \
++i)
#define rep3(i, a, b) \
for (default_counter_t i = default_counter_t(a), \
end_##i = default_counter_t(b); \
i < end_##i; ++i)
#define rep4(i, a, b, c) \
for (default_counter_t i = default_counter_t(a), \
end_##i = default_counter_t(b); \
i < end_##i; i += default_counter_t(c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) \
for (default_counter_t i = default_counter_t(n) - 1; i >= 0; --i)
#define rrep2(i, n) \
for (default_counter_t i = default_counter_t(n) - 1; i >= 0; --i)
#define rrep3(i, a, b) \
for (default_counter_t i = default_counter_t(b) - 1, \
begin_##i = default_counter_t(a); \
i >= begin_##i; --i)
#define rrep4(i, a, b, c) \
for (default_counter_t \
i = (default_counter_t(b) - default_counter_t(a) - 1) / \
default_counter_t(c) * default_counter_t(c) + \
default_counter_t(a), \
begin_##i = default_counter_t(a); \
i >= begin_##i; i -= default_counter_t(c))
#define rrep(...) \
overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define ALL(f, c, ...) \
(([&](decltype((c)) cccc) { \
return (f)(std::begin(cccc), std::end(cccc), ##__VA_ARGS__); \
})(c))
// function
template <class C>
constexpr C& Sort(C& a) {
std::sort(std::begin(a), std::end(a));
return a;
}
template <class C>
constexpr auto& Min(C const& a) {
return *std::min_element(std::begin(a), std::end(a));
}
template <class C>
constexpr auto& Max(C const& a) {
return *std::max_element(std::begin(a), std::end(a));
}
template <class C>
constexpr auto Total(C const& c) {
return std::accumulate(std::begin(c), std::end(c), C(0));
}
template <typename T>
auto CumSum(std::vector<T> const& v) {
std::vector<T> a(v.size() + 1, T(0));
for (std::size_t i = 0; i < a.size() - size_t(1); ++i) a[i + 1] = a[i] + v[i];
return a;
}
template <typename T>
constexpr bool ChMax(T& a, T const& b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T>
constexpr bool ChMin(T& a, T const& b) {
if (b < a) {
a = b;
return true;
}
return false;
}
void In(void) { return; }
template <typename First, typename... Rest>
void In(First& first, Rest&... rest) {
cin >> first;
In(rest...);
return;
}
template <class T, typename I>
void VectorIn(vector<T>& v, const I n) {
v.resize(size_t(n));
rep(i, v.size()) cin >> v[i];
}
void Out(void) {
cout << "\n";
return;
}
template <typename First, typename... Rest>
void Out(First first, Rest... rest) {
cout << first << " ";
Out(rest...);
return;
}
constexpr auto yes(const bool c) { return c ? "yes" : "no"; }
constexpr auto Yes(const bool c) { return c ? "Yes" : "No"; }
constexpr auto YES(const bool c) { return c ? "YES" : "NO"; }
// http://koturn.hatenablog.com/entry/2018/08/01/010000
template <typename T, typename U>
inline std::vector<U> MakeNdVector(T n, U val) noexcept {
static_assert(std::is_integral<T>::value,
"[MakeNdVector] The 1st argument must be an integer");
return std::vector<U>(std::forward<T>(n), std::forward<U>(val));
}
template <typename T, typename... Args>
inline decltype(auto) MakeNdVector(T n, Args&&... args) noexcept {
static_assert(std::is_integral<T>::value,
"[MakeNdVector] The 1st argument must be an integer");
return std::vector<decltype(MakeNdVector(std::forward<Args>(args)...))>(
std::forward<T>(n), MakeNdVector(std::forward<Args>(args)...));
}
template <typename T, std::size_t N,
typename std::enable_if<(N > 0), std::nullptr_t>::type = nullptr>
struct NdvectorImpl {
using type = std::vector<typename NdvectorImpl<T, N - 1>::type>;
}; // struct ndvector_impl
template <typename T>
struct NdvectorImpl<T, 1> {
using type = std::vector<T>;
}; // struct ndvector_impl
template <typename T, std::size_t N>
using NdVector = typename NdvectorImpl<T, N>::type;
#ifdef USE_STACK_TRACE_LOGGER
#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#include <glog/logging.h>
#pragma clang diagnostic pop
#endif //__clang__
#endif // USE_STACK_TRACE_LOGGER
int64_t N, K;
vector<int64_t> a;
vector<vector<int64_t>> memo;
int64_t Solve(int64_t i, int64_t k) {
if (memo[i][k] >= 0) return memo[i][k];
bool flag = false;
bool ret = false;
rep(j, N) {
if (k - a[j] >= 0) {
int64_t tmp = Solve(!i, k - a[j]);
flag = true;
if (!tmp) {
ret = true;
}
}
}
if (flag) {
return memo[i][k] = ret;
}
return memo[i][k] = false;
}
signed main(int argc, char* argv[]) {
(void)argc;
#ifdef USE_STACK_TRACE_LOGGER
google::InitGoogleLogging(argv[0]);
google::InstallFailureSignalHandler();
#else
(void)argv;
#endif // USE_STACK_TRACE_LOGGER
In(N, K);
a.resize(N);
rep(i, N) In(a[i]);
memo.resize(2, vector<int64_t>(K + 1, -1));
if (Solve(0, K)) {
cout << "First" << endl;
} else {
cout << "Second" << endl;
}
return EXIT_SUCCESS;
}
| [
"kyawashell@gmail.com"
] | kyawashell@gmail.com |
6b1184c16e257e6a5436fde1081fa32c2269a27a | 97f8be92810bafdbf68b77c8a938411462d5be4b | /3rdParty/boost/1.71.0/libs/config/checks/std/cpp_impl_destroying_delete_20.cpp | 5e0aed9ecb41d1ebd904456090272c96f9138cd0 | [
"BSL-1.0",
"Apache-2.0",
"BSD-3-Clause",
"ICU",
"LGPL-2.1-or-later",
"BSD-4-Clause",
"GPL-1.0-or-later",
"Python-2.0",
"OpenSSL",
"Bison-exception-2.2",
"JSON",
"ISC",
"GPL-2.0-only",
"MIT",
"LicenseRef-scancode-public-domain",
"CC0-1.0",
"BSD-2-Clause",
"LicenseRef-scancode-autoco... | permissive | solisoft/arangodb | 022fefd77ca704bfa4ca240e6392e3afebdb474e | efd5a33bb1ad1ae3b63bfe1f9ce09b16116f62a2 | refs/heads/main | 2021-12-24T16:50:38.171240 | 2021-11-30T11:52:58 | 2021-11-30T11:52:58 | 436,619,840 | 2 | 0 | Apache-2.0 | 2021-12-09T13:05:46 | 2021-12-09T13:05:46 | null | UTF-8 | C++ | false | false | 776 | cpp | // This file was automatically generated on Sun Apr 21 09:13:03 2019
// by libs/config/tools/generate.cpp
// Copyright John Maddock 2002-4.
// Use, modification and distribution are subject to 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)
// See http://www.boost.org/libs/config for the most recent version.//
// Revision $Id$
//
#ifdef __has_include
#if __has_include(<version>)
#include <version>
#endif
#endif
#ifndef __cpp_impl_destroying_delete
#error "Macro << __cpp_impl_destroying_delete is not set"
#endif
#if __cpp_impl_destroying_delete < 201806
#error "Macro __cpp_impl_destroying_delete had too low a value"
#endif
int main( int, char *[] )
{
return 0;
}
| [
"jsteemann@users.noreply.github.com"
] | jsteemann@users.noreply.github.com |
1fab796099c6edbc2380e443078c48872ead2715 | ccae3c9b20fa3c895042a1c7aa0815fd0faec141 | /trunk/TestCode/QosTest/QosTestRecver/stdafx.cpp | 9afcffa0e65285b25d0847488dcee4c098b9ce2e | [] | no_license | 15831944/TxUIProject | 7beaf17eb3642bcffba2bbe8eaa7759c935784a0 | e90f3319ad0e57c0012e0e3a7e457851c2c6f0f1 | refs/heads/master | 2021-12-03T10:05:27.018212 | 2014-05-16T08:16:17 | 2014-05-16T08:16:17 | null | 0 | 0 | null | null | null | null | GB18030 | C++ | false | false | 168 | cpp |
// stdafx.cpp : 只包括标准包含文件的源文件
// QosTestRecver.pch 将作为预编译头
// stdafx.obj 将包含预编译类型信息
#include "stdafx.h"
| [
"tyxwgy@sina.com"
] | tyxwgy@sina.com |
8a80d8d98e132b2297d0a04e70a2c05e275d4783 | 04bed9ce69c1a51649e5ba01b4be3ce594f2e719 | /lecture_15/EditDistance.cc | efc51ad685a3fda849e850e76df051fa8ea4a11d | [] | no_license | OrsoBruno96/competitive-programming-exercises | 86049c886d1fb17f215a6e60034c883677fe3417 | b989cb56b23de327958a296ec89fd52a5800760f | refs/heads/master | 2020-08-04T12:59:48.302500 | 2019-12-26T14:40:04 | 2019-12-26T14:40:04 | 212,143,696 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,823 | cc |
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
// I use dynamic programming with a O(n^2) table of state that can be fillen in
// constant time for each entry, so O(n^2) time complexity.
// The subproblems can be identified in "do the same problem but for
// prefix strings". For convenience I start with the empty string, so our table
// will actually be (len1 + 1)*(len2 + 1).
// The recursion is the following:
// EDIT(i, j) = {
// i if j == 0
// j if i == 0
// EDIT(i - 1, j - 1) if I am adding an equal char to both,
// which means if s1[i] == s2[j]
// 1 + min(
// EDIT(i - 1, j - 1), // with replace operation
// EDIT(i - 1, j) // with insert operation
// EDIT(i, j - 1) // with delete operation
// }
// Actually the last two can be swapped, it depends on which string you want to
// modify, but the edit distance is symmetric in the arguments.
int main() {
int TC = 0;
cin >> TC;
while (TC--) {
int len1 = 0, len2 = 0;
cin >> len1 >> len2;
string s1, s2;
cin >> s1 >> s2;
vvi cache;
cache.reserve(len1 + 1);
for (int i = 0; i < len1 + 1; i++) {
cache.emplace_back(vi(len2 + 1, 0));
}
for (int i = 1; i < len1 + 1; i++) {
cache[i][0] = i;
}
for (int i = 1; i < len2 + 1; i++) {
cache[0][i] = i;
}
for (auto i = 1; i < len1 + 1; i++) {
for (auto j = 1; j < len2 + 1; j++) {
if (s1[i - 1] == s2[j - 1]) {
cache[i][j] = cache[i - 1][j - 1];
} else {
const auto minn = std::min(std::min(cache[i - 1][j], cache[i][j - 1]), cache[i - 1][j - 1]);
cache[i][j] = minn + 1;
}
}
}
cout << cache[len1][len2] << "\n";
}
return 0;
}
| [
"fabio.zoratti96@gmail.com"
] | fabio.zoratti96@gmail.com |
7b57f7b1a25726b8f19e095ea9cec8c83c7faef1 | bbdb14f877f14c9b48b2903a77e2c9b5df3027ae | /Spath/Spath/spath.cpp | 332410814c924ddcd9356009102fa04f8ae18a75 | [] | no_license | sarnecky/aod | 6572aa3ea6739aad55e3d12541065308741f78e3 | dd46367e40e5b419db78f7ae12dbce6a0a9bca9f | refs/heads/master | 2020-03-07T14:35:03.931536 | 2018-04-02T12:08:16 | 2018-04-02T12:08:16 | 127,530,070 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,721 | cpp | //#include <iostream>
//#include <fstream>
//#include <stdio.h>
//#include <stdlib.h>
//#include <string>
//#include<map>
//#include<list>
//#include<vector>
//#include <time.h> /* time */
//#define MAXVALUE 2147483647
//using namespace std;
//
//template <class T> void swapElements(T& a, T& b)
//{
// T c(a); a = b; b = c;
//}
//
//struct Point
//{
// int Distance;
// int Index; //index miasta
//};
//struct Path
//{
// int startCity;
// int targetCity;
// int distance;
// bool visited;
//};
//struct City {
//
// int Distance;
// bool Visited;
// vector<Point> Adjacets;
// int NumberOfAdjacet;
// int Index; //index miasta
//};
////mapowanie indexow https://pastebin.com/kkZn123m
////kolejka priorytetowa opara o pseudokod z książki Wprowadzenie do algorytmów Cormena. Kod pochodzi także z mojego projektu na AISD
////link https://github.com/sarnecky/Algorytmy-i-struktury-danych/blob/master/SpacerPoGorach/SpacerPoGorach/Source.cpp
//struct PriorityQueue
//{
// vector<Point> tab;
// map<int, int> mapper; //index miasta, index w kolejce
// int _numberOfElements;
//
// void init(int n)
// {
// _numberOfElements = n;
// for (int i = 0; i <= n; i++)
// {
// Point p;
// int indexCity = i - 1;
// p.Index = indexCity;
// if (i == 0)
// {
// tab.push_back(p);
// continue;
// }
// else if (i == 1) {
// p.Distance = 0;
// }
// else {
// p.Distance = MAXVALUE;
// }
// mapper.insert(pair<int, int>(indexCity, i));
// tab.push_back(p);
// }
// }
//
// void decreaseKey(int indexCity, int newDistance)
// {
// int indexInQueue = mapper.at(indexCity);
// if (tab[indexInQueue].Distance < newDistance)
// return;
//
// tab[indexInQueue].Distance = newDistance;
// heapyfiUp(indexInQueue);
// }
//
// void heapyfiUp(int i)
// {
// int P = (i+1) / 2;
//
// while (i > 1)
// {
// if (tab[P].Distance > tab[i].Distance)
// {
// swapCity(tab[P], tab[i]);
// }
// i = P;
// P = i / 2;
// }
// }
//
// void heapyfy(int i)
// {
// int L = 2 * i;
// int P = 2 * i + 1;
// int min;
//
// if (L <= _numberOfElements && tab[L].Distance < tab[i].Distance) // jezeli lewy element jest mniejszy od rodzica to trzeba go zamienic
// {
// min = L; //mniejszy stoi na lewej stronie
// }
// else min = i;
//
//
// if (P <= _numberOfElements && tab[P].Distance < tab[min].Distance) // jezeli prawy element jest mniejszy od rodzica to trzeba go zamienic
// {
// min = P; //mniejszy stoi na prawej stronie
// }
//
// if (min != i) //zamiana elementow i
// {
// swapCity(tab[i], tab[min]);
// heapyfy(min);
// }
// }
//
// void buildHeap()
// {
// for (int i = _numberOfElements / 2; i >= 1; i = i / 2)
// {
// heapyfy(i);
// }
// }
//
// void insertHeap(int indexOfCity, int pathTo) //trza dodac index
// {
// _numberOfElements++;
// Point p;
// p.Index = indexOfCity;
// p.Distance = pathTo;
// tab.push_back(p);
// buildHeap();
// }
//
// void swapCity(Point& a, Point& b)
// {
// int temp= mapper[a.Index];
// mapper[a.Index] = mapper[b.Index];
// mapper[b.Index] = temp;
// Point c(a); a = b; b = c;
// }
//
// Point removeHeap()
// {
// Point root;
// root.Distance = tab[1].Distance;
// root.Index = tab[1].Index;
// swapCity(tab[1], tab[_numberOfElements]);
// tab[_numberOfElements] = tab[0];
// _numberOfElements--;
// buildHeap();
// return root;
// }
//};
//
//
//int main()
//{
// PriorityQueue *p = new PriorityQueue();
// p->init(5);
// p->removeHeap();
// p->decreaseKey(1, 2);
// p->decreaseKey(2, 7);
// p->removeHeap();
// p->decreaseKey(2, 5);
// p->decreaseKey(3, 10);
// p->decreaseKey(4, 7);
// p->removeHeap();
// p->decreaseKey(3, 6);
// p->removeHeap();
// p->removeHeap();
// return 0;
//}
| [
"ssarnecki34@gmail.com"
] | ssarnecki34@gmail.com |
98b80d282090d6a37a10cfd45693cdd9506698c5 | 05348ad4aefeda239be68a9800cc93d2b9a1d334 | /main/ognconv.cpp | 5393e8a53a03a9e2b91c64ff88b06e138bea1c71 | [] | no_license | ggajoch/esp32-ogn-tracker | c05cfcef845b6a2b6d3d0fe8f8a4127f39b79cbf | 43d97fdc3ed96772606d7e7b2b801233bcaa1550 | refs/heads/master | 2021-08-08T03:07:25.494954 | 2021-04-04T03:37:28 | 2021-04-04T03:37:28 | 247,384,624 | 0 | 1 | null | 2020-03-15T01:58:07 | 2020-03-15T01:58:06 | null | UTF-8 | C++ | false | false | 13,738 | cpp | #include <stdint.h>
#include <string.h>
#include "format.h"
#include "ognconv.h"
// ==============================================================================================
int32_t FeetToMeters(int32_t Altitude) { return (Altitude*312+512)>>10; } // [feet] => [m]
int32_t MetersToFeet(int32_t Altitude) { return (Altitude*3360+512)>>10; } // [m] => [feet]
// ==============================================================================================
uint16_t EncodeUR2V8(uint16_t Value) // Encode unsigned 12bit (0..3832) as 10bit
{ if(Value<0x100) { }
else if(Value<0x300) Value = 0x100 | ((Value-0x100)>>1);
else if(Value<0x700) Value = 0x200 | ((Value-0x300)>>2);
else if(Value<0xF00) Value = 0x300 | ((Value-0x700)>>3);
else Value = 0x3FF;
return Value; }
uint16_t DecodeUR2V8(uint16_t Value) // Decode 10bit 0..0x3FF
{ uint16_t Range = Value>>8;
Value &= 0x0FF;
if(Range==0) return Value; // 000..0FF
if(Range==1) return 0x101+(Value<<1); // 100..2FE
if(Range==2) return 0x302+(Value<<2); // 300..6FC
return 0x704+(Value<<3); } // 700..EF8 // in 12bit (0..3832)
uint8_t EncodeUR2V5(uint16_t Value) // Encode unsigned 9bit (0..472) as 7bit
{ if(Value<0x020) { }
else if(Value<0x060) Value = 0x020 | ((Value-0x020)>>1);
else if(Value<0x0E0) Value = 0x040 | ((Value-0x060)>>2);
else if(Value<0x1E0) Value = 0x060 | ((Value-0x0E0)>>3);
else Value = 0x07F;
return Value; }
uint16_t DecodeUR2V5(uint16_t Value) // Decode 7bit as unsigned 9bit (0..472)
{ uint8_t Range = (Value>>5)&0x03;
Value &= 0x1F;
if(Range==0) { } // 000..01F
else if(Range==1) { Value = 0x021+(Value<<1); } // 020..05E
else if(Range==2) { Value = 0x062+(Value<<2); } // 060..0DC
else { Value = 0x0E4+(Value<<3); } // 0E0..1D8 => max. Value = 472
return Value; }
uint8_t EncodeSR2V5(int16_t Value) // Encode signed 10bit (-472..+472) as 8bit
{ uint8_t Sign=0; if(Value<0) { Value=(-Value); Sign=0x80; }
Value = EncodeUR2V5(Value);
return Value | Sign; }
int16_t DecodeSR2V5( int16_t Value) // Decode
{ int16_t Sign = Value&0x80;
Value = DecodeUR2V5(Value&0x7F);
return Sign ? -Value: Value; }
uint16_t EncodeUR2V6(uint16_t Value) // Encode unsigned 10bit (0..952) as 8 bit
{ if(Value<0x040) { }
else if(Value<0x0C0) Value = 0x040 | ((Value-0x040)>>1);
else if(Value<0x1C0) Value = 0x080 | ((Value-0x0C0)>>2);
else if(Value<0x3C0) Value = 0x0C0 | ((Value-0x1C0)>>3);
else Value = 0x0FF;
return Value; }
uint16_t DecodeUR2V6(uint16_t Value) // Decode 8bit as unsigned 10bit (0..952)
{ uint16_t Range = (Value>>6)&0x03;
Value &= 0x3F;
if(Range==0) { } // 000..03F
else if(Range==1) { Value = 0x041+(Value<<1); } // 040..0BE
else if(Range==2) { Value = 0x0C2+(Value<<2); } // 0C0..1BC
else { Value = 0x1C4+(Value<<3); } // 1C0..3B8 => max. Value = 952
return Value; }
uint16_t EncodeSR2V6(int16_t Value) // Encode signed 11bit (-952..+952) as 9bit
{ uint16_t Sign=0; if(Value<0) { Value=(-Value); Sign=0x100; }
Value = EncodeUR2V6(Value);
return Value | Sign; }
int16_t DecodeSR2V6( int16_t Value) // Decode 9bit as signed 11bit (-952..+952)
{ int16_t Sign = Value&0x100;
Value = DecodeUR2V6(Value&0x00FF);
return Sign ? -Value: Value; }
uint8_t EncodeUR2V4(uint8_t DOP)
{ if(DOP<0x10) { }
else if(DOP<0x30) DOP = 0x10 | ((DOP-0x10)>>1);
else if(DOP<0x70) DOP = 0x20 | ((DOP-0x30)>>2);
else if(DOP<0xF0) DOP = 0x30 | ((DOP-0x70)>>3);
else DOP = 0x3F;
return DOP; }
uint8_t DecodeUR2V4(uint8_t DOP)
{ uint8_t Range = DOP>>4;
DOP &= 0x0F;
if(Range==0) return DOP; // 00..0F
if(Range==1) return 0x11+(DOP<<1); // 10..2E
if(Range==2) return 0x32+(DOP<<2); // 30..6C
return 0x74+(DOP<<3); } // 70..E8 => max. DOP = 232*0.1=23.2
uint16_t EncodeUR2V12(uint16_t Value) // encode unsigned 16-bit (0..61432) as 14-bit
{ if(Value<0x1000) { }
else if(Value<0x3000) Value = 0x1000 | ((Value-0x1000)>>1);
else if(Value<0x7000) Value = 0x2000 | ((Value-0x3000)>>2);
else if(Value<0xF000) Value = 0x3000 | ((Value-0x7000)>>3);
else Value = 0x3FFF;
return Value; }
uint16_t DecodeUR2V12(uint16_t Value)
{ uint16_t Range = Value>>12;
Value &=0x0FFF;
if(Range==0) return Value; // 0000..0FFF
if(Range==1) return 0x1001+(Value<<1); // 1000..2FFE
if(Range==2) return 0x3002+(Value<<2); // 3000..6FFC
return 0x7004+(Value<<3); } // 7000..EFF8 => max: 61432
// ==============================================================================================
uint8_t EncodeGray(uint8_t Binary)
{ return Binary ^ (Binary>>1); }
uint8_t DecodeGray(uint8_t Gray)
{ Gray ^= (Gray >> 4);
Gray ^= (Gray >> 2);
Gray ^= (Gray >> 1);
return Gray; }
uint16_t EncodeGray(uint16_t Binary)
{ return Binary ^ (Binary>>1); }
uint16_t DecodeGray(uint16_t Gray)
{ Gray ^= (Gray >> 8);
Gray ^= (Gray >> 4);
Gray ^= (Gray >> 2);
Gray ^= (Gray >> 1);
return Gray; }
uint32_t EncodeGray(uint32_t Binary)
{ return Binary ^ (Binary>>1); }
uint32_t DecodeGray(uint32_t Gray)
{ Gray ^= (Gray >>16);
Gray ^= (Gray >> 8);
Gray ^= (Gray >> 4);
Gray ^= (Gray >> 2);
Gray ^= (Gray >> 1);
return Gray; }
// ==============================================================================================
// TEA encryption/decryption
// Data is 2 x 32-bit word
// Key is 4 x 32-bit word
void TEA_Encrypt (uint32_t* Data, const uint32_t *Key, int Loops)
{ uint32_t v0=Data[0], v1=Data[1]; // set up
const uint32_t delta=0x9e3779b9; uint32_t sum=0; // a key schedule constant
uint32_t k0=Key[0], k1=Key[1], k2=Key[2], k3=Key[3]; // cache key
for (int i=0; i < Loops; i++) // basic cycle start
{ sum += delta;
v0 += ((v1<<4) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1);
v1 += ((v0<<4) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3); } // end cycle
Data[0]=v0; Data[1]=v1;
}
void TEA_Decrypt (uint32_t* Data, const uint32_t *Key, int Loops)
{ uint32_t v0=Data[0], v1=Data[1]; // set up
const uint32_t delta=0x9e3779b9; uint32_t sum=delta*Loops; // a key schedule constant
uint32_t k0=Key[0], k1=Key[1], k2=Key[2], k3=Key[3]; // cache key
for (int i=0; i < Loops; i++) // basic cycle start */
{ v1 -= ((v0<<4) + k2) ^ (v0 + sum) ^ ((v0>>5) + k3);
v0 -= ((v1<<4) + k0) ^ (v1 + sum) ^ ((v1>>5) + k1);
sum -= delta; } // end cycle
Data[0]=v0; Data[1]=v1;
}
void TEA_Encrypt_Key0 (uint32_t* Data, int Loops)
{ uint32_t v0=Data[0], v1=Data[1]; // set up
const uint32_t delta=0x9e3779b9; uint32_t sum=0; // a key schedule constant
for (int i=0; i < Loops; i++) // basic cycle start
{ sum += delta;
v0 += (v1<<4) ^ (v1 + sum) ^ (v1>>5);
v1 += (v0<<4) ^ (v0 + sum) ^ (v0>>5); } // end cycle
Data[0]=v0; Data[1]=v1;
}
void TEA_Decrypt_Key0 (uint32_t* Data, int Loops)
{ uint32_t v0=Data[0], v1=Data[1]; // set up
const uint32_t delta=0x9e3779b9; uint32_t sum=delta*Loops; // a key schedule constant
for (int i=0; i < Loops; i++) // basic cycle start
{ v1 -= (v0<<4) ^ (v0 + sum) ^ (v0>>5);
v0 -= (v1<<4) ^ (v1 + sum) ^ (v1>>5);
sum -= delta; } // end cycle
Data[0]=v0; Data[1]=v1;
}
// ==============================================================================================
// XXTEA encryption/decryption
static uint32_t XXTEA_MX(uint8_t E, uint32_t Y, uint32_t Z, uint8_t P, uint32_t Sum, const uint32_t Key[4])
{ return ((((Z>>5) ^ (Y<<2)) + ((Y>>3) ^ (Z<<4))) ^ ((Sum^Y) + (Key[(P&3)^E] ^ Z))); }
void XXTEA_Encrypt(uint32_t *Data, uint8_t Words, const uint32_t Key[4], uint8_t Loops)
{ const uint32_t Delta = 0x9e3779b9;
uint32_t Sum = 0;
uint32_t Z = Data[Words-1]; uint32_t Y;
for( ; Loops; Loops--)
{ Sum += Delta;
uint8_t E = (Sum>>2)&3;
for (uint8_t P=0; P<(Words-1); P++)
{ Y = Data[P+1];
Z = Data[P] += XXTEA_MX(E, Y, Z, P, Sum, Key); }
Y = Data[0];
Z = Data[Words-1] += XXTEA_MX(E, Y, Z, Words-1, Sum, Key);
}
}
void XXTEA_Decrypt(uint32_t *Data, uint8_t Words, const uint32_t Key[4], uint8_t Loops)
{ const uint32_t Delta = 0x9e3779b9;
uint32_t Sum = Loops*Delta;
uint32_t Y = Data[0]; uint32_t Z;
for( ; Loops; Loops--)
{ uint8_t E = (Sum>>2)&3;
for (uint8_t P=Words-1; P; P--)
{ Z = Data[P-1];
Y = Data[P] -= XXTEA_MX(E, Y, Z, P, Sum, Key); }
Z = Data[Words-1];
Y = Data[0] -= XXTEA_MX(E, Y, Z, 0, Sum, Key);
Sum -= Delta;
}
}
// ==============================================================================================
void XorShift32(uint32_t &Seed) // simple random number generator
{ Seed ^= Seed << 13;
Seed ^= Seed >> 17;
Seed ^= Seed << 5; }
void xorshift64(uint64_t &Seed)
{ Seed ^= Seed >> 12;
Seed ^= Seed << 25;
Seed ^= Seed >> 27; }
// ==============================================================================================
const static unsigned char MapAscii85[86] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~";
const static uint8_t UnmapAscii85[128] =
{ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 62, 85, 63, 64, 65, 66, 85, 67, 68, 69, 70, 85, 71, 85, 85, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 85, 72, 73, 74, 75, 76,
77, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 85, 85, 85, 78, 79,
80, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 81, 82, 83, 84, 85 };
uint8_t EncodeAscii85(char *Ascii, uint32_t Word)
{ for( uint8_t Idx=5; Idx; )
{ uint32_t Div = Word/85;
Idx--;
Ascii[Idx]=MapAscii85[Word-Div*85];
Word=Div; }
Ascii[5]=0;
return 5; }
uint8_t DecodeAscii85(uint32_t &Word, const char *Ascii)
{ Word=0;
for( uint8_t Idx=0; Idx<5; Idx++)
{ char Char = Ascii[Idx]; if(Char<=0) return 0;
uint8_t Dig = UnmapAscii85[(uint8_t)Char];
if(Dig>=85) return 0;
Word = Word*85+Dig; }
return 5; }
// ==============================================================================================
int APRS2IGC(char *Out, const char *Inp, int GeoidSepar) // convert APRS positon message into IGC B-record
{ int Len=0;
const char *Msg = strchr(Inp, ':'); if(Msg==0) return 0; // colon: separates header and message
Msg++; // where message starts
if(Msg[0]!='/' || Msg[7]!='h') return 0;
const char *Pos = Msg+8; if(Pos[4]!='.' || Pos[14]!='.') return 0; // where position starts
const char *ExtPos = strstr(Pos+18, " !W"); if(ExtPos[5]=='!') ExtPos+=3; else ExtPos=0;
Out[Len++]='B'; // B-record
memcpy(Out+Len, Msg+1, 6); Len+=6; // copy UTC time
memcpy(Out+Len, Pos, 4); Len+=4; // copy DDMM
memcpy(Out+Len, Pos+5, 2); Len+=2; // copy fractional MM
Out[Len++] = ExtPos?ExtPos[0]:'0'; // extended precision
Out[Len++] = Pos[7]; // copy N/S sign
memcpy(Out+Len, Pos+9, 5); Len+=5; // copy DDMM
memcpy(Out+Len, Pos+15,2); Len+=2; // copy fractional MM
Out[Len++] = ExtPos?ExtPos[1]:'0'; // extended precision
Out[Len++] = Pos[17]; // copy E/W sign
Out[Len++] = 'A'; // GPS-valid flag
memcpy(Out+Len, " ", 10); // prefill pressure and GNSS altitude with spaces
const char *FL = strstr(Pos+18, " FL"); // search pressure altitude
int32_t AltH=0; int32_t AltL=0;
if(FL && FL[6]=='.' && Read_Int(AltH, FL+3)==3 && Read_Int(AltL, FL+7)==2) // pressure altitude
{ int Alt = AltH*100+AltL; Alt=FeetToMeters(Alt);
if(Alt<0) { Alt = (-Alt); Out[Len] = '-'; Format_UnsDec(Out+Len+1, (uint32_t)Alt, 4); }
else { Format_UnsDec(Out+Len, (uint32_t)Alt, 5); }
}
Len+=5;
int32_t Alt=0; //
if(Pos[27]=='A' && Pos[28]=='=' && Read_Int(Alt, Pos+29)==6) // geometrical altitude
{ Alt=FeetToMeters(Alt); Alt+=GeoidSepar; // convert to meters and add GeoidSepar for HAE
if(Alt<0) { Alt = (-Alt); Out[Len] = '-'; Format_UnsDec(Out+Len+1, (uint32_t)Alt, 4); }
else { Format_UnsDec(Out+Len, (uint32_t)Alt, 5); }
}
Len+=5;
Out[Len++]='\n'; Out[Len]=0; return Len; } // add NL, terminator and return length og the string
// ==============================================================================================
| [
"Pawel.Jalocha@gmail.com"
] | Pawel.Jalocha@gmail.com |
fd45fd67d286de9ccde099e8bbc9fd9808766053 | b60a2bf88ac531fd66b0adf730cfc7fae0a6d379 | /common_unittest/spd_tcp_client_test.h | 57c992078d45fdf6e1d0797d1a8222e111433e0b | [] | no_license | shepherd1013/shepherd | 0f0b54f2105c1bb2464420590cdf88ec3d3b980d | 6d989a0c79268d31415f164d5baca86f0de38945 | refs/heads/master | 2021-01-17T11:01:54.303252 | 2016-05-05T16:37:24 | 2016-05-05T16:37:24 | 38,727,930 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 282 | h | /*
* spd_tcp_client_test.h
*
* Created on: Mar 22, 2016
* Author: Jacken
*/
#ifndef SPD_TCP_CLIENT_TEST_H_
#define SPD_TCP_CLIENT_TEST_H_
class TcpClientTest
{
public:
TcpClientTest();
~TcpClientTest();
void Run();
private:
};
#endif /* SPD_TCP_CLIENT_TEST_H_ */
| [
"jacken1013@gmail.com"
] | jacken1013@gmail.com |
6e4126083e3c8d0315b9eb82f03879fac0b3ac61 | 3cf9e141cc8fee9d490224741297d3eca3f5feff | /C++ Benchmark Programs/Benchmark Files 1/classtester/autogen-sources/source-3736.cpp | 134594d7c0e96be4c96bab7ef394929ef70d1f58 | [] | 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,397 | 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 c2, c0
{
bool active3;
c3() : active3(true) {}
virtual ~c3()
{
tester3(this);
c0 *p0_0 = (c0*)(c3*)(this);
tester0(p0_0);
c2 *p2_0 = (c2*)(c3*)(this);
tester2(p2_0);
active3 = false;
}
virtual void f3(){}
};
void __attribute__ ((noinline)) tester3(c3* p)
{
p->f3();
if (p->active0)
p->f0();
if (p->active2)
p->f2();
}
struct c4;
void __attribute__ ((noinline)) tester4(c4* p);
struct c4 : c0, virtual c2, virtual c1
{
bool active4;
c4() : active4(true) {}
virtual ~c4()
{
tester4(this);
c0 *p0_0 = (c0*)(c4*)(this);
tester0(p0_0);
c1 *p1_0 = (c1*)(c4*)(this);
tester1(p1_0);
c2 *p2_0 = (c2*)(c4*)(this);
tester2(p2_0);
active4 = false;
}
virtual void f4(){}
};
void __attribute__ ((noinline)) tester4(c4* p)
{
p->f4();
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*)(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*)(c4*)(new c4());
for (int i=0;i<2;i=inc(i))
{
tester1(ptrs1[i]);
delete ptrs1[i];
}
c2* ptrs2[25];
ptrs2[0] = (c2*)(new c2());
ptrs2[1] = (c2*)(c3*)(new c3());
ptrs2[2] = (c2*)(c4*)(new c4());
for (int i=0;i<3;i=inc(i))
{
tester2(ptrs2[i]);
delete ptrs2[i];
}
c3* ptrs3[25];
ptrs3[0] = (c3*)(new c3());
for (int i=0;i<1;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 |
7448183b0ffac00c162b36d0a3142e61b9ce4e3d | 45d73de830a7030222f5f5c3278bfd88ff63dd09 | /src/test/scriptnum_tests.cpp | bc2001a2c9bdb4fe920c95a0c8d4d0be0cff020d | [
"MIT"
] | permissive | realcaesar/skicoinBeta | 36d84412e9c5ba62911abf27a417c0699de1ea51 | a35cbfda4f70cfa41daa3e80fba95d737ef64449 | refs/heads/master | 2023-03-11T22:07:59.964255 | 2021-03-04T19:27:23 | 2021-03-04T19:27:23 | 309,057,031 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,622 | cpp | // Copyright (c) 2012-2015 The Bitcoin Core developers
// Copyright (c) 2014-2020 The Skicoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "scriptnum10.h"
#include "script/script.h"
#include "test/test_skicoin.h"
#include <boost/test/unit_test.hpp>
#include <limits.h>
#include <stdint.h>
BOOST_FIXTURE_TEST_SUITE(scriptnum_tests, BasicTestingSetup)
/** A selection of numbers that do not trigger int64_t overflow
* when added/subtracted. */
static const int64_t values[] = { 0, 1, -2, 127, 128, -255, 256, (1LL << 15) - 1, -(1LL << 16), (1LL << 24) - 1, (1LL << 31), 1 - (1LL << 32), 1LL << 40 };
static const int64_t offsets[] = { 1, 0x79, 0x80, 0x81, 0xFF, 0x7FFF, 0x8000, 0xFFFF, 0x10000};
static bool verify(const CScriptNum10& bignum, const CScriptNum& scriptnum)
{
return bignum.getvch() == scriptnum.getvch() && bignum.getint() == scriptnum.getint();
}
static void CheckCreateVch(const int64_t& num)
{
CScriptNum10 bignum(num);
CScriptNum scriptnum(num);
BOOST_CHECK(verify(bignum, scriptnum));
std::vector<unsigned char> vch = bignum.getvch();
CScriptNum10 bignum2(bignum.getvch(), false);
vch = scriptnum.getvch();
CScriptNum scriptnum2(scriptnum.getvch(), false);
BOOST_CHECK(verify(bignum2, scriptnum2));
CScriptNum10 bignum3(scriptnum2.getvch(), false);
CScriptNum scriptnum3(bignum2.getvch(), false);
BOOST_CHECK(verify(bignum3, scriptnum3));
}
static void CheckCreateInt(const int64_t& num)
{
CScriptNum10 bignum(num);
CScriptNum scriptnum(num);
BOOST_CHECK(verify(bignum, scriptnum));
BOOST_CHECK(verify(CScriptNum10(bignum.getint()), CScriptNum(scriptnum.getint())));
BOOST_CHECK(verify(CScriptNum10(scriptnum.getint()), CScriptNum(bignum.getint())));
BOOST_CHECK(verify(CScriptNum10(CScriptNum10(scriptnum.getint()).getint()), CScriptNum(CScriptNum(bignum.getint()).getint())));
}
static void CheckAdd(const int64_t& num1, const int64_t& num2)
{
const CScriptNum10 bignum1(num1);
const CScriptNum10 bignum2(num2);
const CScriptNum scriptnum1(num1);
const CScriptNum scriptnum2(num2);
CScriptNum10 bignum3(num1);
CScriptNum10 bignum4(num1);
CScriptNum scriptnum3(num1);
CScriptNum scriptnum4(num1);
// int64_t overflow is undefined.
bool invalid = (((num2 > 0) && (num1 > (std::numeric_limits<int64_t>::max() - num2))) ||
((num2 < 0) && (num1 < (std::numeric_limits<int64_t>::min() - num2))));
if (!invalid)
{
BOOST_CHECK(verify(bignum1 + bignum2, scriptnum1 + scriptnum2));
BOOST_CHECK(verify(bignum1 + bignum2, scriptnum1 + num2));
BOOST_CHECK(verify(bignum1 + bignum2, scriptnum2 + num1));
}
}
static void CheckNegate(const int64_t& num)
{
const CScriptNum10 bignum(num);
const CScriptNum scriptnum(num);
// -INT64_MIN is undefined
if (num != std::numeric_limits<int64_t>::min())
BOOST_CHECK(verify(-bignum, -scriptnum));
}
static void CheckSubtract(const int64_t& num1, const int64_t& num2)
{
const CScriptNum10 bignum1(num1);
const CScriptNum10 bignum2(num2);
const CScriptNum scriptnum1(num1);
const CScriptNum scriptnum2(num2);
bool invalid = false;
// int64_t overflow is undefined.
invalid = ((num2 > 0 && num1 < std::numeric_limits<int64_t>::min() + num2) ||
(num2 < 0 && num1 > std::numeric_limits<int64_t>::max() + num2));
if (!invalid)
{
BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - scriptnum2));
BOOST_CHECK(verify(bignum1 - bignum2, scriptnum1 - num2));
}
invalid = ((num1 > 0 && num2 < std::numeric_limits<int64_t>::min() + num1) ||
(num1 < 0 && num2 > std::numeric_limits<int64_t>::max() + num1));
if (!invalid)
{
BOOST_CHECK(verify(bignum2 - bignum1, scriptnum2 - scriptnum1));
BOOST_CHECK(verify(bignum2 - bignum1, scriptnum2 - num1));
}
}
static void CheckCompare(const int64_t& num1, const int64_t& num2)
{
const CScriptNum10 bignum1(num1);
const CScriptNum10 bignum2(num2);
const CScriptNum scriptnum1(num1);
const CScriptNum scriptnum2(num2);
BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == scriptnum1));
BOOST_CHECK((bignum1 != bignum1) == (scriptnum1 != scriptnum1));
BOOST_CHECK((bignum1 < bignum1) == (scriptnum1 < scriptnum1));
BOOST_CHECK((bignum1 > bignum1) == (scriptnum1 > scriptnum1));
BOOST_CHECK((bignum1 >= bignum1) == (scriptnum1 >= scriptnum1));
BOOST_CHECK((bignum1 <= bignum1) == (scriptnum1 <= scriptnum1));
BOOST_CHECK((bignum1 == bignum1) == (scriptnum1 == num1));
BOOST_CHECK((bignum1 != bignum1) == (scriptnum1 != num1));
BOOST_CHECK((bignum1 < bignum1) == (scriptnum1 < num1));
BOOST_CHECK((bignum1 > bignum1) == (scriptnum1 > num1));
BOOST_CHECK((bignum1 >= bignum1) == (scriptnum1 >= num1));
BOOST_CHECK((bignum1 <= bignum1) == (scriptnum1 <= num1));
BOOST_CHECK((bignum1 == bignum2) == (scriptnum1 == scriptnum2));
BOOST_CHECK((bignum1 != bignum2) == (scriptnum1 != scriptnum2));
BOOST_CHECK((bignum1 < bignum2) == (scriptnum1 < scriptnum2));
BOOST_CHECK((bignum1 > bignum2) == (scriptnum1 > scriptnum2));
BOOST_CHECK((bignum1 >= bignum2) == (scriptnum1 >= scriptnum2));
BOOST_CHECK((bignum1 <= bignum2) == (scriptnum1 <= scriptnum2));
BOOST_CHECK((bignum1 == bignum2) == (scriptnum1 == num2));
BOOST_CHECK((bignum1 != bignum2) == (scriptnum1 != num2));
BOOST_CHECK((bignum1 < bignum2) == (scriptnum1 < num2));
BOOST_CHECK((bignum1 > bignum2) == (scriptnum1 > num2));
BOOST_CHECK((bignum1 >= bignum2) == (scriptnum1 >= num2));
BOOST_CHECK((bignum1 <= bignum2) == (scriptnum1 <= num2));
}
static void RunCreate(const int64_t& num)
{
CheckCreateInt(num);
CScriptNum scriptnum(num);
if (scriptnum.getvch().size() <= CScriptNum::nDefaultMaxNumSize)
CheckCreateVch(num);
else
{
BOOST_CHECK_THROW (CheckCreateVch(num), scriptnum10_error);
}
}
static void RunOperators(const int64_t& num1, const int64_t& num2)
{
CheckAdd(num1, num2);
CheckSubtract(num1, num2);
CheckNegate(num1);
CheckCompare(num1, num2);
}
BOOST_AUTO_TEST_CASE(creation)
{
for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i)
{
for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j)
{
RunCreate(values[i]);
RunCreate(values[i] + offsets[j]);
RunCreate(values[i] - offsets[j]);
}
}
}
BOOST_AUTO_TEST_CASE(operators)
{
for(size_t i = 0; i < sizeof(values) / sizeof(values[0]); ++i)
{
for(size_t j = 0; j < sizeof(offsets) / sizeof(offsets[0]); ++j)
{
RunOperators(values[i], values[i]);
RunOperators(values[i], -values[i]);
RunOperators(values[i], values[j]);
RunOperators(values[i], -values[j]);
RunOperators(values[i] + values[j], values[j]);
RunOperators(values[i] + values[j], -values[j]);
RunOperators(values[i] - values[j], values[j]);
RunOperators(values[i] - values[j], -values[j]);
RunOperators(values[i] + values[j], values[i] + values[j]);
RunOperators(values[i] + values[j], values[i] - values[j]);
RunOperators(values[i] - values[j], values[i] + values[j]);
RunOperators(values[i] - values[j], values[i] - values[j]);
}
}
}
BOOST_AUTO_TEST_SUITE_END()
| [
"63470989+caesar-ski@users.noreply.github.com"
] | 63470989+caesar-ski@users.noreply.github.com |
8d4d4c8824f16b96b395f9db3474e0fd7fb1638b | befaf0dfc5880d18f42e1fa7e39e27f8d2f8dde9 | /SDK/SCUM_UI_VitalsMonitor_structs.hpp | 796ff7888ceea564d774e34da12900cf5c283332 | [] | no_license | cpkt9762/SCUM-SDK | 0b59c99748a9e131eb37e5e3d3b95ebc893d7024 | c0dbd67e10a288086120cde4f44d60eb12e12273 | refs/heads/master | 2020-03-28T00:04:48.016948 | 2018-09-04T13:32:38 | 2018-09-04T13:32:38 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 283 | hpp | #pragma once
// SCUM (0.1.17.8320) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
#include "SCUM_Basic.hpp"
#include "SCUM_UMG_classes.hpp"
#include "SCUM_Engine_classes.hpp"
#include "SCUM_SlateCore_classes.hpp"
namespace SDK
{
}
#ifdef _MSC_VER
#pragma pack(pop)
#endif
| [
"igromanru@yahoo.de"
] | igromanru@yahoo.de |
1f718932aa7815e38a9fab4bbe70648e5e6e1bbd | 539eba3b73c81ebc52329604bcbce556a008fc92 | /MeshFrame/MeshFrame/core/TetMesh/_vertex.h | c80252bc9d52702751c6f7b433dbd0bb7856002d | [] | no_license | MeshFrame/MeshFrame | ad35f91c38cec9911a6c391214d8c8a9f9d7a003 | 84f3445238105e8df662c7e8049e577a0d858d48 | refs/heads/master | 2022-10-25T16:55:30.515839 | 2022-10-17T16:08:38 | 2022-10-17T16:08:38 | 137,697,615 | 40 | 6 | null | null | null | null | UTF-8 | C++ | false | false | 1,559 | h | /*!
* \file vertex.h
* \brief Base vertex Class for all types of Tetrahedron Mesh Classes
*
* This is the fundamental class for vertex
* \author David Gu
* \date 10/01/2011
*
*/
#ifndef _TMESHLIB_VERTEX_H_
#define _TMESHLIB_VERTEX_H_
#include <list>
#include "../Geometry/Point.h"
namespace MeshLib
{
namespace TMeshLib
{
class CTVertex;
class CHalfEdge;
class CEdge;
class CTEdge;
class CHalfFace;
class CFace;
class CTet;
class CVertexCore
{
public:
CVertex() { m_iID = 0; m_bIsBoundary = false; };
~CVertex(){ m_pTVertices.clear(); }
CPoint & position() { return m_vPosition; };
int & id() { return m_iID; };
bool & boundary() { return m_bIsBoundary; };
std::list<CEdge*> * edges() { return &m_pEdges; };
std::list<CTEdge*> * tedges(){ return &m_pTEdges; };
std::list<CHalfFace*> * HalfFaces(){ return &m_pHFaces; };
std::list<CTVertex*> * tvertices() { return &m_pTVertices; };
std::string& string(){ return m_string; };
virtual void _from_string() { };
virtual void _to_string() { };
protected:
CPoint m_vPosition;
int m_iID;
bool m_bIsBoundary;
std::list<CHalfFace*> m_pHFaces; //temporary HalfFace list, will be empty after loading the whole mesh
std::list<CTEdge*> m_pTEdges; //temporary TEdge list, will be empty after loading the whole mesh
std::list<CTVertex*> m_pTVertices; //adjacent TVertecies
std::list<CEdge*> m_pEdges; //adjacent Edges;
std::string m_string;
};
};
};
#endif | [
"ankachan92@gmail.com"
] | ankachan92@gmail.com |
7bd9e5f229ecc8fe46deab16c3b41404b4d339ae | 877fff5bb313ccd23d1d01bf23b1e1f2b13bb85a | /app/src/main/cpp/dir7941/dir7942/dir8062/dir8063/dir12766/dir12767/dir13029/dir13030/file13112.cpp | 311ee49c7e42e30d978b31a5fbaae6e2730aa118 | [] | no_license | tgeng/HugeProject | 829c3bdfb7cbaf57727c41263212d4a67e3eb93d | 4488d3b765e8827636ce5e878baacdf388710ef2 | refs/heads/master | 2022-08-21T16:58:54.161627 | 2020-05-28T01:54:03 | 2020-05-28T01:54:03 | 267,468,475 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 115 | cpp | #ifndef file13112
#error "macro file13112 must be defined"
#endif
static const char* file13112String = "file13112"; | [
"tgeng@google.com"
] | tgeng@google.com |
60b5dd49d652e80a1a90f1f77ae539167e7f44af | 73e4f26899bc560e17d098596ca4ae7eaa05f17d | /src/main.cpp | e6a607ef1b22d63d3e9255dbbb20a8efbbe23cac | [
"MIT"
] | permissive | BioInfoTools/fastp | 857bb07e1afcab2a8bff1b9f0da6b676b12ae040 | 6979ebc9959dedb6b421da774e46a0558dca9bb3 | refs/heads/master | 2021-05-07T00:14:55.655379 | 2017-11-09T02:24:48 | 2017-11-09T02:24:48 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 7,199 | cpp | #include <stdio.h>
#include "fastqreader.h"
#include "unittest.h"
#include <time.h>
#include "cmdline.h"
#include <sstream>
#include "util.h"
#include "options.h"
#include "processor.h"
#include "evaluator.h"
string command;
int main(int argc, char* argv[]){
if (argc == 2 && strcmp(argv[1], "test")==0){
UnitTest tester;
tester.run();
return 0;
}
cmdline::parser cmd;
// input/output
cmd.add<string>("in1", 'i', "read1 input file name", true, "");
cmd.add<string>("out1", 'o', "read1 output file name", false, "");
cmd.add<string>("in2", 'I', "read2 input file name", false, "");
cmd.add<string>("out2", 'O', "read2 output file name", false, "");
cmd.add("phred64", '6', "indicates the input is using phred64 scoring (it'll be converted to phred33, so the output will still be phred33)");
cmd.add<int>("compression", 'z', "compression level for gzip output (1 ~ 9). 1 is fastest, 9 is smallest, default is 2.", false, 2);
// adapter
cmd.add("disable_adapter_trimming", 'A', "adapter trimming is enabled by default. If this option is specified, adapter trimming is disabled");
cmd.add<string>("adapter_sequence", 'a', "for single end data, adapter sequence is required for adapter trimming", false, "");
// trimming
cmd.add<int>("trim_front1", 'f', "trimming how many bases in front for read1, default is 0", false, 0);
cmd.add<int>("trim_tail1", 't', "trimming how many bases in tail for read1, default is 0", false, 0);
cmd.add<int>("trim_front2", 'F', "trimming how many bases in front for read2. If it's not specified, it will follow read1's settings", false, 0);
cmd.add<int>("trim_tail2", 'T', "trimming how many bases in tail for read2. If it's not specified, it will follow read1's settings", false, 0);
// sliding window cutting for each reads
cmd.add("cut_by_quality5", '5', "enable per read cutting by quality in front (5'), default is disabled (WARNING: this will interfere deduplication for both PE/SE data)");
cmd.add("cut_by_quality3", '3', "enable per read cutting by quality in tail (3'), default is disabled (WARNING: this will interfere deduplication for SE data)");
cmd.add<int>("cut_window_size", 'W', "the size of the sliding window for sliding window trimming, default is 4", false, 4);
cmd.add<int>("cut_mean_quality", 'M', "the bases in the sliding window with mean quality below cutting_quality will be cut, default is Q20", false, 20);
// quality filtering
cmd.add("disable_quality_filtering", 'Q', "quality filtering is enabled by default. If this option is specified, quality filtering is disabled");
cmd.add<int>("qualified_quality_phred", 'q', "the quality value that a base is qualified. Default 15 means phred quality >=Q15 is qualified.", false, 15);
cmd.add<int>("unqualified_percent_limit", 'u', "how many percents of bases are allowed to be unqualified (0~100). Default 40 means 40%", false, 40);
cmd.add<int>("n_base_limit", 'n', "if one read's number of N base is >n_base_limit, then this read/pair is discarded. Default is 5", false, 5);
// length filtering
cmd.add("disable_length_filtering", 'L', "length filtering is enabled by default. If this option is specified, length filtering is disabled");
cmd.add<int>("length_required", 'l', "reads shorter than length_required will be discarded.", false, 30);
// reporting
cmd.add<string>("json", 'j', "the json format report file name", false, "fastp.json");
cmd.add<string>("html", 'h', "the html format report file name", false, "fastp.html");
// threading
cmd.add<int>("thread", 'w', "worker thread number, default is 3", false, 3);
// split the output
cmd.add<int>("split", 's', "if this option is specified, the output will be split to multiple (--split) files (i.e. 0001.out.fq, 0002.out.fq...). ", false, 0);
cmd.add<int>("split_prefix_digits", 'd', "the digits for the slice number padding (1~10), default is 4, so the filename will be padded as 0001.xxx, 0 to disable padding", false, 4);
cmd.parse_check(argc, argv);
Options opt;
// I/O
opt.in1 = cmd.get<string>("in1");
opt.in2 = cmd.get<string>("in2");
opt.out1 = cmd.get<string>("out1");
opt.out2 = cmd.get<string>("out2");
opt.compression = cmd.get<int>("compression");
opt.phred64 = cmd.exist("phred64");
// adapter cutting
opt.adapter.enabled = !cmd.exist("disable_adapter_trimming");
opt.adapter.sequence = cmd.get<string>("adapter_sequence");
// trimming
opt.trim.front1 = cmd.get<int>("trim_front1");
opt.trim.tail1 = cmd.get<int>("trim_tail1");
// read2 settings follows read1 if it's not specified
if(cmd.exist("trim_front2"))
opt.trim.front2 = cmd.get<int>("trim_front2");
else
opt.trim.front2 = opt.trim.front1;
if(cmd.exist("trim_tail2"))
opt.trim.tail2 = cmd.get<int>("trim_tail2");
else
opt.trim.tail2 = opt.trim.tail1;
// sliding window cutting by quality
opt.qualityCut.enabled5 = cmd.exist("cut_by_quality5");
opt.qualityCut.enabled3 = cmd.exist("cut_by_quality3");
opt.qualityCut.windowSize = cmd.get<int>("cut_window_size");
opt.qualityCut.quality = cmd.get<int>("cut_mean_quality");
// quality filtering
opt.qualfilter.enabled = !cmd.exist("disable_quality_filtering");
opt.qualfilter.qualifiedQual = num2qual(cmd.get<int>("qualified_quality_phred"));
opt.qualfilter.unqualifiedPercentLimit = cmd.get<int>("unqualified_percent_limit");
opt.qualfilter.nBaseLimit = cmd.get<int>("n_base_limit");
// length filtering
opt.lengthFilter.enabled = !cmd.exist("disable_length_filtering");
opt.lengthFilter.requiredLength = cmd.get<int>("length_required");
// threading
opt.thread = cmd.get<int>("thread");
// reporting
opt.jsonFile = cmd.get<string>("json");
opt.htmlFile = cmd.get<string>("html");
// splitting
opt.split.enabled = cmd.exist("split");
if(opt.split.enabled) {
opt.split.number = cmd.get<int>("split");
opt.split.digits = cmd.get<int>("split_prefix_digits");
}
stringstream ss;
for(int i=0;i<argc;i++){
ss << argv[i] << " ";
}
command = ss.str();
opt.validate();
time_t t1 = time(NULL);
// using evaluator to guess how many reads in total
if(opt.split.enabled) {
long readNum;
Evaluator eva(&opt);
eva.evaluateReads(readNum);
// one record per file at least
// We reduce it by half of PACI_SIZE due to we are processing data by pack
opt.split.size = readNum / opt.split.number - PACK_SIZE/2;
if(opt.split.size <= 0) {
opt.split.size = 1;
cerr << "WARNING: the input file has less reads than the number of files to split" << endl;
}
}
Processor p(&opt);
p.process();
time_t t2 = time(NULL);
cout << endl << "JSON report: " << opt.jsonFile << endl;
cout << "HTML report: " << opt.htmlFile << endl;
cout << endl << command << endl;
cout << "fastp v" << FASTP_VER << ", time used: " << (t2)-t1 << " seconds" << endl;
return 0;
} | [
"chen@haplox.com"
] | chen@haplox.com |
33810c1ddbf4e4eb9133b3c7b2baefa19961835c | 7f62f204ffde7fed9c1cb69e2bd44de9203f14c8 | /DboClient/Tool/ModelTool2/AnimSetPane.cpp | f45880dd3d06792b46d6a90326f22eab4affab6a | [] | no_license | 4l3dx/DBOGLOBAL | 9853c49f19882d3de10b5ca849ba53b44ab81a0c | c5828b24e99c649ae6a2953471ae57a653395ca2 | refs/heads/master | 2022-05-28T08:57:10.293378 | 2020-05-01T00:41:08 | 2020-05-01T00:41:08 | 259,094,679 | 3 | 3 | null | 2020-04-29T17:06:22 | 2020-04-26T17:43:08 | null | UHC | C++ | false | false | 18,337 | cpp | // AnimSetPane.cpp : implementation file
//
#include "stdafx.h"
#include "ModelTool2.h"
#include "AttackTypePane.h"
#include "AnimPlayPane.h"
#include "AnimSetPane.h"
#include "BoneEditPane.h"
#include "VehicleViewPane.h"
#include "PropertyPane.h"
CAnimSetPane* CAnimSetPane::m_pInstance = NULL;
// CAnimSetPane
IMPLEMENT_DYNCREATE(CAnimSetPane, CXTResizeFormView)
CAnimSetPane::CAnimSetPane()
: CXTResizeFormView(CAnimSetPane::IDD)
{
m_pInstance = this;
m_pCharacter = NULL;
m_pItem = NULL;
m_pAnimTable = NULL;
m_pObject = NULL;
m_eAnimSetMode = ANIMSET_CHARACTER;
}
CAnimSetPane::~CAnimSetPane()
{
}
void CAnimSetPane::DoDataExchange(CDataExchange* pDX)
{
CXTResizeFormView::DoDataExchange(pDX);
DDX_Control(pDX, IDC_CB_ANIM_SET, m_cbAnimSet);
DDX_Control(pDX, IDC_LT_ANIM_ITEM, m_ltAnimItem);
}
BEGIN_MESSAGE_MAP(CAnimSetPane, CXTResizeFormView)
ON_CBN_SELCHANGE(IDC_CB_ANIM_SET, &CAnimSetPane::OnCbnSelchangeCbAnimSet)
ON_NOTIFY(LVN_ITEMCHANGED, IDC_LT_ANIM_ITEM, &CAnimSetPane::OnLvnItemchangedLtAnimItem)
ON_NOTIFY(NM_RCLICK, IDC_LT_ANIM_ITEM, &CAnimSetPane::OnNMRclickLtAnimItem)
ON_COMMAND(ID_MENU_ANIM_SET, &CAnimSetPane::OnMenuAnimSet)
ON_COMMAND(ID_MENU_ANIM_DELETE, &CAnimSetPane::OnMenuAnimDelete)
END_MESSAGE_MAP()
// CAnimSetPane diagnostics
#ifdef _DEBUG
void CAnimSetPane::AssertValid() const
{
CXTResizeFormView::AssertValid();
}
#ifndef _WIN32_WCE
void CAnimSetPane::Dump(CDumpContext& dc) const
{
CXTResizeFormView::Dump(dc);
}
#endif
#endif //_DEBUG
// CAnimSetPane message handlers
void CAnimSetPane::OnInitialUpdate()
{
CXTResizeFormView::OnInitialUpdate();
SetResize(IDC_STATIC_GROUP, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT);
SetResize(IDC_CB_ANIM_SET, SZ_TOP_LEFT, SZ_TOP_RIGHT);
SetResize(IDC_LT_ANIM_ITEM, SZ_TOP_LEFT, SZ_BOTTOM_RIGHT);
m_ltAnimItem.SetExtendedStyle(m_ltAnimItem.GetExtendedStyle() | LVS_EX_FULLROWSELECT | LVS_EX_ONECLICKACTIVATE | LVS_EX_UNDERLINEHOT);
m_ltAnimItem.InsertColumn(0, "ID", 0, 30, 0);
m_ltAnimItem.InsertColumn(1, "Anim Name", 0, 160, 1);
m_ltAnimItem.InsertColumn(2, "Anim File", 0, 110, 2);
}
void CAnimSetPane::SetModel(CNtlPLAttach* pModel)
{
if(pModel == NULL)
{
m_pCharacter = NULL;
m_pItem = NULL;
SetEnable(FALSE);
m_ltAnimItem.DeleteAllItems();
}
else
{
SetEnable(TRUE);
switch(pModel->GetClassType())
{
case PLENTITY_CHARACTER:
{
if(m_pCharacter == pModel)
return;
// 기존 애니메이션은 정지 시킨다.
if(m_pCharacter)
{
m_pCharacter->SetAnimUpdate(FALSE);
}
m_pCharacter = (CMTCharacter*)pModel;
m_pItem = NULL;
m_pObject = NULL;
m_pAnimTable = m_pCharacter->GetProperty()->GetAnimTable();
// Animation Set을 초기화한다.
int nPrevSel = m_cbAnimSet.GetCurSel();
if(nPrevSel < 0)
{
nPrevSel = 0;
}
m_cbAnimSet.ResetContent();
if(CModelToolApplication::GetInstance()->GetAppMode() == MT_MODE_VEHICLE)
{
// 탈것용 Anim Set
m_cbAnimSet.AddString("Vehicle Animation Set");
m_cbAnimSet.SetCurSel(0);
m_eAnimSetMode = ANIMSET_VEHICLE;
}
else
{
m_cbAnimSet.InsertString(COMMON_ANIM_SET, "Common Animation Set");
m_cbAnimSet.InsertString(ATTACK_ANIM_SET, "Attack Animation Set");
m_cbAnimSet.InsertString(BATTLE_ANIM_SET, "Battle Animation Set");
m_cbAnimSet.InsertString(SKILL_ANIM_SET, "Skill Animation Set");
m_cbAnimSet.InsertString(HTB_ANIM_SET, "HTB Animation Set");
m_cbAnimSet.InsertString(SOCIAL_ANIM_SET, "Social Animation Set");
m_cbAnimSet.InsertString(TRIGGER_ANIM_SET, "Trigger Animation Set");
m_cbAnimSet.InsertString(TRANSFORM_ANIM_SET, "Transform Animation Set");
m_cbAnimSet.InsertString(VEHICLE_SRP1_ANIM_SET, "Vehicle SRP 1");
m_cbAnimSet.InsertString(VEHICLE_SRP2_ANIM_SET, "Vehicle SRP 2");
m_cbAnimSet.InsertString(ITEM_USE_ANIM_SET, "Item Use Animation Set");
m_cbAnimSet.SetCurSel(nPrevSel);
m_eAnimSetMode = ANIMSET_CHARACTER;
}
}
break;
case PLENTITY_ITEM:
if(m_pItem == pModel)
return;
m_pItem = (CMTItem*)pModel;
m_pCharacter = NULL;
m_pObject = NULL;
m_pAnimTable = m_pItem->GetProperty()->GetAnimTable();
m_eAnimSetMode = ANIMSET_ITEM;
m_cbAnimSet.ResetContent();
m_cbAnimSet.AddString("Item Animation Set");
m_cbAnimSet.SetCurSel(0);
break;
case PLENTITY_OBJECT:
if(m_pObject == pModel)
return;
m_pObject = (CMTObject*)pModel;
m_pCharacter = NULL;
m_pItem = NULL;
m_pAnimTable = m_pObject->GetProperty()->GetAnimTable();
m_eAnimSetMode = ANIMSET_OBJECT;
m_cbAnimSet.ResetContent();
m_cbAnimSet.AddString("Trigger Object Animation Set");
m_cbAnimSet.SetCurSel(0);
break;
}
OnCbnSelchangeCbAnimSet();
}
}
void CAnimSetPane::SetEnable(BOOL bEnable)
{
m_cbAnimSet.EnableWindow(bEnable);
m_ltAnimItem.EnableWindow(bEnable);
}
void CAnimSetPane::OnCbnSelchangeCbAnimSet()
{
// 콤보박스가 변경되었을때, 리스트의 아이템 항목을 변경한다.
USES_CONVERSION;
if(!m_pAnimTable)
return;
m_ltAnimItem.DeleteAllItems();
int nIndex = m_cbAnimSet.GetCurSel();
int nAnimKeyStart = 0;
int nCount = 0;
int nAnimKeyEnd = 0;
if(m_eAnimSetMode == ANIMSET_CHARACTER)
{
switch(nIndex)
{
case COMMON_ANIM_SET:
nAnimKeyStart = COMMON_ANIMATION_START;
nAnimKeyEnd = COMMON_ANIMATION_END + 1;
break;
case ATTACK_ANIM_SET:
nAnimKeyStart = ATTACK_ANIMATION_START;
nAnimKeyEnd = ATTACK_ANIMATION_END + 1;
break;
case BATTLE_ANIM_SET:
nAnimKeyStart = BATTLE_ANIMATION_START;
nAnimKeyEnd = BATTLE_ANIMATION_END + 1;
break;
case HTB_ANIM_SET:
nAnimKeyStart = HTB_ANIMATION_START;
nAnimKeyEnd = HTB_ANIMATION_END;
break;
case SKILL_ANIM_SET:
nAnimKeyStart = SKILL_ANIMATION_START;
nAnimKeyEnd = SKILL_ANIMATION_END;
break;
case SOCIAL_ANIM_SET:
nAnimKeyStart = SOCIAL_ANIMATION_START;
nAnimKeyEnd = SOCIAL_ANIMATION_END + 1;
break;
case TRIGGER_ANIM_SET:
nAnimKeyStart = PC_TRIGGER_ANIMATION_START;
nAnimKeyEnd = PC_TRIGGER_ANIMATION_END + 1;
break;
case TRANSFORM_ANIM_SET:
nAnimKeyStart = TRANSFORM_ANIMATION_START;
nAnimKeyEnd = TRANSFORM_ANIMATION_END + 1;
break;
case VEHICLE_SRP1_ANIM_SET:
nAnimKeyStart = VEHICLE_SRP1_ANIMATION_START;
nAnimKeyEnd = VEHICLE_SRP1_ANIMATION_END + 1;
break;
case VEHICLE_SRP2_ANIM_SET:
nAnimKeyStart = VEHICLE_SRP2_ANIMATION_START;
nAnimKeyEnd = VEHICLE_SRP2_ANIMATION_END + 1;
break;
case ITEM_USE_ANIM_SET:
nAnimKeyStart = ITEM_USE_ANIMATION_START;
nAnimKeyEnd = ITEM_USE_ANIMATION_END + 1;
break;
default:
NTL_ASSERTFAIL("Animation Set Select Error!");
break;
}
}
else if(m_eAnimSetMode == ANIMSET_ITEM)
{
switch(nIndex)
{
case ITEM_ANIM_SET:
nAnimKeyStart = ITEM_ANIMATION_START;
nAnimKeyEnd = ITEM_ANIMATION_END + 1;
}
}
else if(m_eAnimSetMode == ANIMSET_OBJECT)
{
nAnimKeyStart = OBJECT_ANIMATION_START;
nAnimKeyEnd = OBJECT_ANIMATION_END + 1;
}
else if(m_eAnimSetMode == ANIMSET_VEHICLE)
{
nAnimKeyStart = VEHICLE_ANIMATION_START;
nAnimKeyEnd = VEHICLE_ANIMATION_END;
}
for(int i = nAnimKeyStart; i < nAnimKeyEnd; ++i)
{
std::string* sAnimName = NULL;
std::string strTempObjectAnimName = "";
switch(CModelToolApplication::GetInstance()->GetAppMode())
{
case MT_MODE_PC:
sAnimName = m_CharacterPaser.GetPCMatchTable()->GetString(i);
if(!sAnimName)
sAnimName = &strTempObjectAnimName;
break;
case MT_MODE_MOB:
sAnimName = m_CharacterPaser.GetMobMatchTable()->GetString(i);
break;
case MT_MODE_NPC:
sAnimName = m_CharacterPaser.GetNPCMatchTable()->GetString(i);
break;
case MT_MODE_ITEM:
sAnimName = m_ItemParser.GetItemMatchTable()->GetString(i);
break;
case MT_MODE_OBJECT:
sAnimName = &strTempObjectAnimName;
break;
case MT_MODE_VEHICLE:
sAnimName = m_CharacterPaser.GetVehicleTable()->GetString(i);
break;
}
if(sAnimName)
{
CString sAnimID;
sAnimID.Format("%d ", i);
m_ltAnimItem.InsertItem(nCount, sAnimID);
m_ltAnimItem.SetItem(nCount, 1, LVIF_TEXT, (sAnimName->c_str()), 0, 0, 0, 0);
// 데이터가 있을경우에는 표시한다.
if(m_pAnimTable)
{
STypeAnimData* pAnimData = m_pAnimTable->Get(i);
if(pAnimData && pAnimData->strAnimName.size() > 0)
{
m_ltAnimItem.SetItem(nCount, 2, LVIF_TEXT, (pAnimData->strAnimName.c_str()), 0, 0, 0, 0);
}
}
++nCount;
}
}
}
void CAnimSetPane::OnLvnItemchangedLtAnimItem(NMHDR *pNMHDR, LRESULT *pResult)
{
LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR);
if(!m_pAnimTable)
return;
USES_CONVERSION;
static int nOldIndex = -1; // 중복 호출을 막기위한 변수
int nIndex = pNMLV->iItem;
if(nIndex == nOldIndex)
return;
nOldIndex = nIndex;
// 설정된 애니메이션이 있으면, 그 애니메이션으로 애니메이션을 변경한다.
CString sAnimFileName = m_ltAnimItem.GetItemText(nIndex, 2);
if(sAnimFileName != "")
{
CString sAnimID = m_ltAnimItem.GetItemText(nIndex, 0);
RwUInt32 uiAnimKey = (RwUInt32)atof(sAnimID);
SetAnimData(uiAnimKey);
}
else
{
if(m_eAnimSetMode == ANIMSET_CHARACTER || m_eAnimSetMode == ANIMSET_VEHICLE)
{
m_pCharacter->SetAnimUpdate(FALSE);
}
else if(m_eAnimSetMode == ANIMSET_ITEM)
{
m_pItem->SetAnimUpdate(FALSE);
}
// 설정된 애니메이션파일이 없으면 Edit UI를 Disable 시킨다.
GetSafeInstance(CAttackTypePane)->SetAnimEventData(NULL);
GetSafeInstance(CAnimPlayPane)->SetAnimData(NULL, NULL);
}
*pResult = 0;
}
void CAnimSetPane::OnNMRclickLtAnimItem(NMHDR *pNMHDR, LRESULT *pResult)
{
// 오른쪽 클릭시 팝업메뉴를 뛰운다.
int nIndex = m_ltAnimItem.GetSelectionMark();
if(nIndex >= 0)
{
POINT pos;
GetCursorPos(&pos);
CMenu menuPopup;
menuPopup.LoadMenu(IDR_MENU_POPUP);
CMenu* subMenu = menuPopup.GetSubMenu(2);
// 애니메이션파일 정보의 존재여부에 따라 메뉴를 설정한다.
CString sAnimFileName = m_ltAnimItem.GetItemText(nIndex, 2);
if(sAnimFileName == "")
{
subMenu->EnableMenuItem(ID_MENU_ANIM_SET, FALSE);
subMenu->EnableMenuItem(ID_MENU_ANIM_DELETE, TRUE);
}
else
{
subMenu->EnableMenuItem(ID_MENU_ANIM_SET, FALSE);
subMenu->EnableMenuItem(ID_MENU_ANIM_DELETE, FALSE);
}
subMenu->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, pos.x, pos.y, this);
}
*pResult = 0;
}
void CAnimSetPane::OnMenuAnimSet()
{
if(!m_pAnimTable)
return;
// 항목에 애니메이션 파일을 설정한다.
USES_CONVERSION;
int nIndex = m_ltAnimItem.GetSelectionMark();
CHAR szOpenFilter[] = "Animation File (*.anm)|*.anm||";
CFileDialog fileDlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, szOpenFilter);
if(fileDlg.DoModal() == IDOK)
{
// 기존에 Anim이 존재하면 없애준다.
CString strPrevAnimName = m_ltAnimItem.GetItemText(nIndex, 2);
if(strPrevAnimName != "")
{
OnMenuAnimDelete();
}
CString sLoadFilePath = fileDlg.GetPathName();
CString sLoadFileName = fileDlg.GetFileName();
m_ltAnimItem.SetItem(nIndex, 2, LVIF_TEXT, sLoadFileName, 0, 0, 0, 0);
// 절대경로를 상대경로로 바꾼다.
CString strWorkPath = (CModelToolApplication::GetInstance()->GetWorkDir());
strWorkPath = strWorkPath.MakeUpper();
sLoadFilePath = sLoadFilePath.MakeUpper();
sLoadFileName = sLoadFileName.MakeUpper();
sLoadFilePath.Replace(strWorkPath, ".");
sLoadFilePath.Replace(sLoadFileName, "");
std::string sAnimFilePath = (sLoadFilePath);
// property에 애니메이션 파일 정보를 추가한다.
CString sAnimID = m_ltAnimItem.GetItemText(nIndex, 0);
RwUInt32 uiAnimKey = (RwUInt32)atof(sAnimID);
std::string sAnimFileName = (sLoadFileName);
// Property에 Anim 폴더 경로를 지정한다. (상대 경로)
m_pAnimTable->SetAnimPath(sAnimFilePath);
STypeAnimData* pAnimData = m_pAnimTable->Add(uiAnimKey, sAnimFileName);
SetAnimData(uiAnimKey);
if(m_eAnimSetMode == ANIMSET_CHARACTER || m_eAnimSetMode == ANIMSET_VEHICLE)
{
// Play Time을 저장한다.
m_pCharacter->Update(0.1f);
pAnimData->fPlayTime = m_pCharacter->GetBaseDurationAnimTime();
}
else if(m_eAnimSetMode == ANIMSET_ITEM)
{
// Play Time을 저장한다.
m_pItem->Update(0.1f);
pAnimData->fPlayTime = m_pItem->GetBaseDurationAnimTime();
}
else if(m_eAnimSetMode == ANIMSET_OBJECT)
{
// PlayTime을 저장한다.
// m_pObject->Update(0.1f);
pAnimData->fPlayTime = m_pObject->GetBaseDurationAnimTime();
}
CModelToolApplication::GetInstance()->SetDataChanged();
}
}
void CAnimSetPane::OnMenuAnimDelete()
{
// 항목에 있는 애니메이션을 삭제한다.
if(!m_pAnimTable)
return;
USES_CONVERSION;
int nIndex = m_ltAnimItem.GetSelectionMark();
CString sAnimID = m_ltAnimItem.GetItemText(nIndex, 0);
RwUInt32 uiAnimKey = (RwUInt32)atof(sAnimID);
// 프로퍼티의 테이블에서 삭제한다.
m_pAnimTable->Remove(uiAnimKey);
// 리스트 목록에서 제거한다.
m_ltAnimItem.SetItemText(nIndex, 2, "");
if(m_eAnimSetMode == ANIMSET_CHARACTER || m_eAnimSetMode == ANIMSET_VEHICLE)
{
m_pCharacter->SetAnimUpdate(FALSE);
}
else if(m_eAnimSetMode == ANIMSET_OBJECT)
{
m_pObject->SetAnimUpdate(FALSE);
}
else if(m_eAnimSetMode == ANIMSET_ITEM)
{
m_pItem->SetAnimUpdate(FALSE);
}
GetSafeInstance(CAttackTypePane)->SetAnimEventData(NULL);
GetSafeInstance(CAnimPlayPane)->SetAnimData(NULL, NULL);
CModelToolApplication::GetInstance()->SetDataChanged();
}
void CAnimSetPane::SetAnimData(RwUInt32 uiKey)
{
if(!m_pAnimTable)
return;
::SetCurrentDirectoryA(CModelToolApplication::GetInstance()->GetWorkDir());
STypeAnimData* pAnimData = m_pAnimTable->Get(uiKey);
// 애니메이션을 모델에 적용한다.
if(m_eAnimSetMode == ANIMSET_CHARACTER || m_eAnimSetMode == ANIMSET_VEHICLE)
{
if(!m_pCharacter->SetAnim(uiKey))
{
MessageBox("Animation File is Not Exist\n Check Script File (*.xml)", "Anim Error", MB_ICONERROR);
return;
}
if(pAnimData)
{
// 데이터를 AttackType Pane에 적용한다.
GetSafeInstance(CAttackTypePane)->SetAnimEventData(pAnimData);
//// 애니메이션 플레이 툴뷰를 활성화 시킨다.
GetSafeInstance(CAnimPlayPane)->SetAnimData(m_pCharacter, pAnimData);
// 프로퍼티를 설정한다.
GetSafeInstance(CPropertyPane)->SetAnimation(pAnimData);
}
// 하단뷰의 Bone Edit를 활성화 시킨다.
GetSafeInstance(CBoneEditPane)->SetEnable(TRUE);
// 탈것의 애니메이션
if(CModelToolApplication::GetInstance()->GetAppMode() == MT_MODE_VEHICLE)
{
GetSafeInstance(CVehicleViewPane)->SetVehicleAnimation(uiKey);
}
}
else if(m_eAnimSetMode == ANIMSET_ITEM)
{
if(!m_pItem->SetAnimation(uiKey))
{
MessageBox("Animation File is Not Exist\n Check Script File (*.xml)", "Anim Error", MB_ICONERROR);
return;
}
}
else if(m_eAnimSetMode == ANIMSET_OBJECT)
{
if(m_pObject)
{
if(!m_pObject->SetTriggerAnimation(uiKey))
{
MessageBox("Animation File is Not Exist\n Check Script File (*.xml)", "Anim Error", MB_ICONERROR);
return;
}
// 애니메이션 플레이 툴뷰를 활성화 시킨다.
GetSafeInstance(CAnimPlayPane)->SetTriggerObjectAnimData(m_pObject, pAnimData);
// 프로퍼티를 설정한다.
GetSafeInstance(CPropertyPane)->SetAnimation(pAnimData);
}
}
}
| [
"64261665+dboguser@users.noreply.github.com"
] | 64261665+dboguser@users.noreply.github.com |
15e0c760b855bdd0e800d1742c33e37df84b716d | b796d917e50aef042fdcd912dac405cc805737b7 | /ArduinoExercises/Eman Mahmoud/sheet1-2.ino | 5f456b8b93bb87d4e0b251e7317cbb85d5eeb234 | [] | no_license | salma97/ASUMobiCarG50 | ab2e300f5a5eed9339351bde7abe47cf5e13442a | f5e194bfe7ca1da76365610ebbf2d41923b676b7 | refs/heads/master | 2020-03-26T17:36:13.197959 | 2018-07-05T15:18:06 | 2018-07-05T15:18:06 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 570 | ino | int led1=4;
int led2=5;
int led3=6;
int led4=7;
int ledOn=1000;
int ledOff=1000;
void setup() {
pinMode(led1,OUTPUT);
pinMode(led2,OUTPUT);
pinMode(led3,OUTPUT);
pinMode(led4,OUTPUT);
}
void loop() {
digitalWrite (led1,HIGH);
delay(ledOn);
digitalWrite(led1,LOW);
delay(ledOff);
digitalWrite (led2,HIGH);
delay(ledOn);
digitalWrite(led2,LOW);
delay(ledOff);
digitalWrite(led3,HIGH);
delay(ledOn);
digitalWrite(led3,LOW);
delay(ledOff);
digitalWrite(led4,HIGH);
delay(ledOn);
digitalWrite(led4,LOW);
delay(ledOff);
}
| [
"noreply@github.com"
] | noreply@github.com |
e281d2546eac5eccdb338261847c29fb125fd073 | 67566902e9301a8c8a288d07590406cf94a8bd9d | /MSMPI_test/custom_reduce3.cpp | 6434e9b8cbe520b16acb9769091378527887854d | [] | no_license | BuildSoftwareBetter/MSMPI_test | 9efbdcf2dab797c515c8be5c1079f869c9feb922 | 4b67d4f2428d4849666d58414e241e98270dbb06 | refs/heads/master | 2020-05-13T23:33:31.321993 | 2019-04-16T11:29:26 | 2019-04-16T11:29:26 | 181,674,415 | 0 | 0 | null | null | null | null | MacCentralEurope | C++ | false | false | 1,282 | cpp | ///*◊‘∂®“Średuce*/
//
//#include <iostream>
//#include "mpi.h"
//#include <Windows.h>
//
//using namespace std;
//
//#define FEATURE_LENGTH 1024;
//
//typedef struct {
// unsigned char fea[FEATURE_LENGTH];
// int score;
//} FeatureCompare;
///* the user-defined function
// */
//void MPIAPI myProd(FeatureCompare *in, FeatureCompare *inout, int *len,
// MPI_Datatype *dptr)
//{
// int i;
//
//
// //
//
//}
///* and, to call it...
// */
//
//int main_red(int argc, char *argv[]) {
//
// MPI_Init(&argc, &argv);
//
// /* each process has an array of 100 Complexes
// */
// Complex a[100], answer[100];
// MPI_Op myOp;
// MPI_Datatype ctype;
// /* explain to MPI how type Complex is defined
// */
// MPI_Type_contiguous(2, MPI_DOUBLE, &ctype);
// MPI_Type_commit(&ctype);
// /* create the complex-product user-op
// */
// MPI_Op_create((MPI_User_function *)myProd, TRUE, &myOp);
//
// int root = 0;
// MPI_Reduce(a, answer, 100, ctype, myOp, root, MPI_COMM_WORLD);
//
// cout << "answer " << endl;
// for (size_t i = 0; i < 100; i++)
// {
// cout << answer[i].real << " " << answer[i].imag << " ";
// }
// cout << endl;
//
// /* At this point, the answer, which consists of 100 Complexes,
// * resides on process root
// */
//
// MPI_Finalize();
//
// return 0;
//} | [
"469575628@qq.com"
] | 469575628@qq.com |
1c2586cbc1376fcc9ef2f7e81c068bab30b25514 | 33fd5786ddde55a705d74ce2ce909017e2535065 | /build/iOS/Debug/include/_root.iphod_iphodButt-f34cb6a4.h | 05df1bbe4029b8e2ad64f175da648aefb5cd38d4 | [] | no_license | frpaulas/iphodfuse | 04cee30add8b50ea134eb5a83e355dce886a5d5a | e8886638c4466b3b0c6299da24156d4ee81c9112 | refs/heads/master | 2021-01-23T00:48:31.195577 | 2017-06-01T12:33:13 | 2017-06-01T12:33:13 | 92,842,106 | 3 | 3 | null | 2017-05-30T17:43:28 | 2017-05-30T14:33:26 | C++ | UTF-8 | C++ | false | false | 1,725 | h | // This file was generated based on '.uno/ux11/iphod.unoproj.g.uno'.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.String.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace iphod{struct Button;}}
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno{namespace UX{struct Selector;}}}
namespace g{struct iphod_iphodButton_Text_Property;}
namespace g{
// internal sealed class iphod_iphodButton_Text_Property :224
// {
::g::Uno::UX::Property1_type* iphod_iphodButton_Text_Property_typeof();
void iphod_iphodButton_Text_Property__ctor_3_fn(iphod_iphodButton_Text_Property* __this, ::g::iphod::Button* obj, ::g::Uno::UX::Selector* name);
void iphod_iphodButton_Text_Property__Get1_fn(iphod_iphodButton_Text_Property* __this, ::g::Uno::UX::PropertyObject* obj, uString** __retval);
void iphod_iphodButton_Text_Property__New1_fn(::g::iphod::Button* obj, ::g::Uno::UX::Selector* name, iphod_iphodButton_Text_Property** __retval);
void iphod_iphodButton_Text_Property__get_Object_fn(iphod_iphodButton_Text_Property* __this, ::g::Uno::UX::PropertyObject** __retval);
void iphod_iphodButton_Text_Property__Set1_fn(iphod_iphodButton_Text_Property* __this, ::g::Uno::UX::PropertyObject* obj, uString* v, uObject* origin);
void iphod_iphodButton_Text_Property__get_SupportsOriginSetter_fn(iphod_iphodButton_Text_Property* __this, bool* __retval);
struct iphod_iphodButton_Text_Property : ::g::Uno::UX::Property1
{
uWeak< ::g::iphod::Button*> _obj;
void ctor_3(::g::iphod::Button* obj, ::g::Uno::UX::Selector name);
static iphod_iphodButton_Text_Property* New1(::g::iphod::Button* obj, ::g::Uno::UX::Selector name);
};
// }
} // ::g
| [
"frpaulas@gmail.com"
] | frpaulas@gmail.com |
5c5818a30fdc62eeb2249433474a1632842c7915 | ab2e97b3a87ddc5ce3d2a3ae63356b0457a3a4f2 | /Random/ran055.cpp | 3516d01a88a4c6d0202b3ffd0fab4a1461ebb492 | [] | no_license | victorsoyvictor/Biblioteca | 10ae944420e992b2c98dc88335ac79b6edf81730 | 4d6efd4dbf7039587b6ad36167d55da16706d8b2 | refs/heads/master | 2020-07-04T20:55:19.150287 | 2016-11-18T15:48:12 | 2016-11-18T15:48:12 | 74,142,539 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,424 | cpp | /*-----------------------------------------------------------------------------*\
| Matpack random generator class ran055.cpp |
| |
| Implementation of Ran055: lagged Fibonacci generator, lag=(55,24) |
| NOT RECOMENDED FOR SERIOUS APPLICATIONS |
| |
| Last change: Nov 5, 2005 |
| |
| Matpack Library Release 1.9.0 |
| Copyright (C) 1991-2005 by Berndt M. Gammel |
| |
| Permission to use, copy, and distribute Matpack in its entirety and its |
| documentation for non-commercial purpose and without fee is hereby granted, |
| provided that this license information and copyright notice appear unmodified |
| in all copies. This software is provided 'as is' without express or implied |
| warranty. In no event will the author be held liable for any damages arising |
| from the use of this software. |
| Note that distributing Matpack 'bundled' in with any product is considered to |
| be a 'commercial purpose'. |
| The software may be modified for your own purposes, but modified versions may |
| not be distributed without prior consent of the author. |
| |
| Read the COPYRIGHT and README files in this distribution about registration |
| and installation of Matpack. |
| |
\*-----------------------------------------------------------------------------*/
#include "mprandom.h"
#include <cassert>
namespace MATPACK {
//----------------------------------------------------------------------------//
// Ran055: Knuth's shift & add random generator //
//----------------------------------------------------------------------------//
//
// Returns integer random numbers uniformly distributed within [0,2147483647]
//
// Notes: - DON'T USE THIS GENERATOR IN SERIOUS APPLICATIONS BECAUSE
// IT HAS SERIOUS CORRELATIONS
//
// - The period is 2^55 = 36 028 797 018 963 968 > 3.6*10^16.
//
// - At least 32 bit long int is required, but works with any larger
// word lengths
// - This is a lagged Fibonacci generator:
// x(n) = ( x(n-55) - x(n-24) ) mod 2^31
// - Reference:
// A version of this pseudrandom number generator is described in
// J. Bentley's column, "The Software Exploratorium", Unix Review 1991.
// It is based on Algorithm A in D. E. Knuth, The Art of Computer-
// Programming, Vol 2, Section 3.2.2, pp. 172
//
//----------------------------------------------------------------------------//
const long MAX = 2147483647, // 2^31-1
MASK = 123459876;
//----------------------------------------------------------------------------//
Ran055::Ran055 (unsigned long the_seed) : RandomGenerator(the_seed)
{
int i, ii;
long j, k;
// requires at least 32 bit arithmetics
assert( sizeof(unsigned long) >= 4 );
max_val = MAX; // initialize the maximum value max_val
// initialize table
s55[0] = j = seed^MASK ; // XORing with MASK allows use of zero
// and other simple bit patterns for idum.
k = 1;
for (i = 1; i < 55; i++) {
ii = (21 * i) % 55;
s55[ii] = k;
k = j - k;
j = s55[ii] ;
}
j55 = 0; // invariance (b-a-24)%55 = 0
k55 = 24;
for (i = 0; i < 165; i++) Long(); // warm up table three times
}
//----------------------------------------------------------------------------//
unsigned long Ran055::Long (void)
{
// The mask 0x7fffffff assures that the result
// is a positive 32 bit signed long.
(k55) ? (k55--) : (k55 = 54);
(j55) ? (j55--) : (j55 = 54);
return ( s55[j55] -= s55[k55] ) & 0x7fffffff;
}
} // namespace MATPACK
//----------------------------------------------------------------------------//
| [
"victorsoyvictor@gmail.com"
] | victorsoyvictor@gmail.com |
f94604a5f6e310f806b6c56bdd588556d478f62e | 6319f7cb1c7ac7511be4cb6c1ce57d23118e2970 | /sat/core/StreamBuffer.cc | 0653a906bff91ebe4c8d7adb542992847d93b96b | [
"Apache-2.0"
] | permissive | hakan-metin/sat | b72daa02657750e8edf8e9df3cd37343285e16f4 | 45932860caeb55a1b2611d4d9aac1933c536341f | refs/heads/master | 2021-09-04T02:39:06.590029 | 2017-12-21T10:34:51 | 2017-12-21T10:34:51 | 110,162,360 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,810 | cc | // Copyright 2017 Hakan Metin
// 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.
#include "core/StreamBuffer.h"
#include "util/logging.h"
namespace sat {
namespace io {
StreamBuffer::StreamBuffer(const std::string& filename) :
StreamBuffer(filename.c_str()) {
}
StreamBuffer::StreamBuffer(const char* filename) :
_filename(filename),
_in(nullptr),
_index(0),
_size(0),
_error(SUCCESS) {
_in = gzopen(filename, "rb");
if (_in == nullptr)
_error = CANNOT_OPEN_FILE;
}
StreamBuffer::~StreamBuffer() {
if (_in != nullptr) {
gzclose(_in);
}
}
int StreamBuffer::readInt() {
bool negative = false;
int value = 0;
skipWhiteSpaces();
unsigned char c = read();
if (c == '-') {
negative = true;
++(*this);
} else if (c == '+') {
negative = false;
++(*this);
}
while ((c = read()) != '\0' && c >= '0' && c <= '9') {
value = (value * 10) + (_buffer[_index] - '0');
++(*this);
}
if (!std::isspace(c) && c != '\0') {
_error = ERROR_PARSE_INT;
return 0;
}
return negative ? -value : value;
}
void StreamBuffer::skipWhiteSpaces() {
unsigned char c;
while ((c = read()) != '\0' && std::isspace(c)) {
_index++;
}
}
void StreamBuffer::skipLine() {
unsigned char c;
while ((c = read()) != '\0' && c != '\n') {
_index++;
}
++(*this);
}
int StreamBuffer::operator*() {
return static_cast<int>(read());
}
void StreamBuffer::operator++() {
_index++;
read();
}
unsigned char StreamBuffer::read() {
if (_index >= _size) {
_size = gzread(_in, _buffer, sizeof(_buffer));
_index = 0;
}
return (_index >= _size) ? '\0' : _buffer[_index];
}
bool StreamBuffer::isValid() const {
return _error == SUCCESS;
}
StreamBufferError StreamBuffer::error() const {
return _error;
}
std::string StreamBuffer::errorMessage() const {
switch (_error) {
case SUCCESS: return std::string("Success");
case CANNOT_OPEN_FILE: return std::string("Cannot open file " + _filename);
case ERROR_PARSE_INT: return std::string("value is not an integer");
}
return std::string("Unknown error");
}
} // namespace io
} // namespace sat
| [
"hakan.metin@lip6.fr"
] | hakan.metin@lip6.fr |
c42e289a92a38b164acc10bae9730410275b1b5a | 0828458f2174e410c0b64a70c53c05d5498e38fc | /exercises/exercicio_um.cpp | 007ace1fdf8fc54881650c0b657ceb39d50b7c38 | [
"MIT"
] | permissive | Luke-arch-source/Exerc_C-- | 45693d9ee77f9ae7ba0d3e8629e9d6bd21fcca43 | bb686e6aebd0da6d87ad7c382ad0f33702845ab1 | refs/heads/main | 2023-01-19T19:36:16.731315 | 2020-11-29T03:26:12 | 2020-11-29T03:26:12 | 312,723,770 | 0 | 0 | null | null | null | null | ISO-8859-1 | C++ | false | false | 1,838 | cpp | #include <iostream>
#include <cstdlib>
#include <locale>
using namespace std;
int main(){
/*Exercício 1: Programa que calcula o módulo da força peso aplicada sobre um corpo
em um planeta específico. O usuário poderá escolher o planeta por meio de números.
*/
setlocale(LC_ALL, "portuguese");
//Variável para a escolha do planeta
int choice;
//Variáveis para a aceleração gravitacional do planeta, peso no corpo escolhido e massa do corpo atraído
double aceleracao_gravit = 0, peso, m;
//Exibição dos números de cada opção
cout << "[1] - Terra\n";
cout << "[2] - Marte\n";
cout << "[3] - Júpiter\n";
cout << "[4] - Netuno\n";
//Inserindo o valor da massa
cout << "Massa do corpo atraído pelo planeta, em kg: ";
cin >> m;
//Função deste laço de repetição: Impedir que m receba um valor nulo ou negativo
while(m <= 0){
cout << "Massa inválida! Digite outra: ";
cin >> m;
}
//Escolha do planeta
cout << "Escolha um planeta: ";
cin >> choice;
//Função deste laço de repetição: Impedir uma escolha inválida
while(choice > 4 || choice < 1){
cout << "Escolha inválida! Tente de novo: ";
cin >> choice;
}
//Estrutura condicional - Armazenar um valor na variável aceleracao_gravit
switch(choice){
case 1:
aceleracao_gravit = 10;
break;
case 2:
aceleracao_gravit = 3.7;
break;
case 3:
aceleracao_gravit = 24.79;
break;
case 4:
aceleracao_gravit = 11.15;
break;
}
//Cálculo do valor da força peso + Exibição do valor
peso = m * aceleracao_gravit;
/*Esse valor é o produto do valor da massa do corpo pelo módulo da aceleração gravitacional do
planeta escolhido, em m/s².
*/
cout << "Módulo da força peso aplicada sobre o corpo no planeta escolhido: " << peso << " N.";
return 0;
}
| [
"64232544+Luke-arch-source@users.noreply.github.com"
] | 64232544+Luke-arch-source@users.noreply.github.com |
d54b56bbc9b3e20ceb2dbaf5d5374f6058647a84 | 4b2bcee5ca2f9f283005f314e681ffa05edcecca | /baekjoon/5214.cpp | 69d24294034946357589bd79228cbf52364f445e | [] | no_license | mooksys/algorithm | 4fa041316fb1ccc41ecb7cb2d88b2536c0484e8e | f88215ab273b74142ad81cd42145c1a71a590d38 | refs/heads/master | 2020-05-16T01:47:35.931692 | 2019-01-14T14:26:07 | 2019-01-14T14:26:07 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,005 | cpp | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
using namespace std;
int N, K, M;
vector<vector<int>> node(102001);
bool visit[102001];
int dist[102001];
int main() {
memset(visit, 0, sizeof(visit));
scanf("%d %d %d", &N, &K, &M);
for(int i = 1; i <= M; i++) {
for(int j = 0; j < K; j++){
int num; scanf("%d",&num);
node[N+i].push_back(num);
node[num].push_back(N+i);
}
}
//입력정리
queue<int> q;
q.push(1);
while(!q.empty()){
int cur = q.front(); q.pop();
if(cur == N) {break;}
if(visit[cur] == 1) continue;
visit[cur] = 1;
for(int i = 0; i < node[cur].size(); i++){
int next = node[cur][i];
if(visit[next]) continue;
dist[next] = dist[cur] + 1;
q.push(next);
}
}
if (N != 1 && dist[N] == 0) cout << -1;
else cout << dist[N] /2 +1 << endl;
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
6c264791ca5fe394153bae33b82a2722726432ca | 78ca1921dd96c1d8e27d0a5eeca0a1f0756bcde3 | /upcl/c/expression.h | 01662decaf96df3568dd1bb22af13964661fcc13 | [
"BSD-2-Clause"
] | permissive | Schtee/libcpu | 9c6ffdd79efaabb88fae7663d5e613f26f8bd597 | c84a1656453440cbd3317acf0d81eb44da9cb1a3 | refs/heads/master | 2022-07-31T21:02:16.085715 | 2020-05-24T22:07:05 | 2020-05-24T22:07:05 | 266,625,206 | 0 | 0 | BSD-2-Clause | 2020-05-24T21:09:03 | 2020-05-24T21:09:02 | null | UTF-8 | C++ | false | false | 5,554 | h | #ifndef __upcl_c_expression_h
#define __upcl_c_expression_h
#include <sys/types.h>
#include <stdint.h>
#include <vector>
namespace upcl { namespace c {
class expression;
typedef std::vector<expression *> expression_vector;
class register_def;
class decoder_operand_def;
class temp_value_def;
class type;
class expression {
public:
enum operation {
INTEGER, // Integer Data Type
FLOAT, // Float Data Type
STRING, // String Data Type (used in assertions)
REGISTER, // Register
TMPVAL, // Temporary Value
DECOPR, // Decoder Operand
MEMREF, // Memory Reference
UNARY, // Unary Expression
BINARY, // Binary Expression
CAST, // Cast Expression
BITCAST, // BitCast Expression
BIT_COMBINE, // Bit Combine Expression
BIT_SLICE // Bit Slice Expression
};
enum flags {
SIGNED = 1,
FLOAT_ORDERED = 2
};
operation m_expr_op;
unsigned m_flags;
expression *m_trap; // trap code if OF_TRAP
unsigned m_ccf; // cc flags to be updated
protected:
expression(operation const &op);
public:
virtual ~expression();
public:
virtual void update_cc(unsigned ccflags);
virtual unsigned get_update_cc() const;
virtual void overflow_trap(expression *trap_code);
virtual expression *get_overflow_trap_code() const;
virtual bool make_signed();
virtual bool is_signed() const;
virtual bool make_float_ordered();
virtual bool is_float_ordered() const;
public:
static expression *fromFloat(double d, unsigned bits);
static expression *fromFloat(char const *string, unsigned bits);
static expression *fromString(char const *string);
static expression *fromInteger(uint64_t x, unsigned bits);
static expression *fromInteger(int64_t x, unsigned bits);
static expression *fromInteger(char const *string, unsigned bits);
static expression *fromRegister(register_def *reg);
static expression *fromDecoderOperand(decoder_operand_def *reg);
static expression *fromTempValue(temp_value_def *decopr);
public:
static expression *fromInteger(uint32_t x, unsigned bits)
{ return fromInteger(static_cast<uint64_t>(x), bits); }
static expression *fromInteger(int32_t x, unsigned bits)
{ return fromInteger(static_cast<int64_t>(x), bits); }
#if defined(__APPLE__) // XXX size_t results ambiguous on darwin, solve this!
static expression *fromInteger(size_t x, unsigned bits)
{ return fromInteger(static_cast<uint64_t>(x), bits); }
#endif
public:
static expression *Neg(expression *a);
static expression *Com(expression *a);
static expression *Not(expression *a);
public:
static expression *Add(expression *a, expression *b);
static expression *Sub(expression *a, expression *b);
static expression *Mul(expression *a, expression *b);
static expression *Div(expression *a, expression *b);
static expression *Rem(expression *a, expression *b);
static expression *Shl(expression *a, expression *b);
static expression *ShlC(expression *a, expression *b);
static expression *Shr(expression *a, expression *b);
static expression *ShrC(expression *a, expression *b);
static expression *Rol(expression *a, expression *b);
static expression *RolC(expression *a, expression *b);
static expression *Ror(expression *a, expression *b);
static expression *RorC(expression *a, expression *b);
static expression *And(expression *a, expression *b);
static expression *Or(expression *a, expression *b);
static expression *Xor(expression *a, expression *b);
public:
static expression *Eq(expression *a, expression *b);
static expression *Ne(expression *a, expression *b);
static expression *Le(expression *a, expression *b);
static expression *Lt(expression *a, expression *b);
static expression *Ge(expression *a, expression *b);
static expression *Gt(expression *a, expression *b);
public:
static expression *Cast(type *ty, expression *expr);
static expression *BitSlice(expression *expr, expression *first_bit,
expression *bit_count);
static expression *BitCombine(expression *expr, ...);
static expression *BitCombine(expression_vector const &exprs);
static expression *MemoryReference(type *type, expression *location);
public:
static expression *Signed(expression *expr);
static expression *UpdateCC(expression *expr, unsigned ccflags);
static expression *OverflowTrap(expression *expr, expression *trap_code);
public:
virtual bool is_constant() const = 0;
virtual expression *sub_expr(size_t index) const = 0;
virtual type *get_type() const = 0;
public:
virtual bool evaluate_as_integer(uint64_t &result, bool sign = false) const = 0;
virtual bool evaluate_as_float(double &result) const = 0;
virtual bool is_equal(expression const *expr) const;
public:
inline operation get_expression_operation() const
{ return m_expr_op; }
public:
inline bool evaluate(uint64_t &result, bool sign = false) const
{ return evaluate_as_integer(result, sign); }
inline bool evaluate(double &result, bool = false) const
{ return evaluate_as_float(result); }
public:
inline bool is_constant_value(bool accept_string = false) const {
switch (get_expression_operation()) {
case STRING: // XXX special case!
return accept_string;
case INTEGER:
case FLOAT:
return true;
default:
return false;
}
}
public:
virtual expression *simplify(bool sign = false) const;
virtual void replace_sub_expr(size_t index, expression *expr);
virtual bool is_zero() const;
protected:
bool is_compatible(expression const *expr) const;
protected:
friend class cast_expression;
virtual void replace_type(type *ty);
};
} }
#endif // !__upcl_c_expression_h
| [
"nextie@gmail.com"
] | nextie@gmail.com |
428eed2b1c892306c6965c096446aac0dde340c9 | 3012d039ee024671af92625abbb0b545e8b2bf2b | /program24.cpp | 285c238376630ceb362b04208429ef1c04cfcee8 | [] | no_license | aditigupta745/Charcoal | 3f5e1fe9441a8144deb69ddbf54e352ac3fcf34d | 1c95aadd468ac81a89fcb6e2658c380f9e7c50a5 | refs/heads/master | 2022-11-15T18:46:41.509220 | 2020-06-19T13:46:25 | 2020-06-19T13:46:25 | 273,262,605 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 797 | cpp | //Calculate Body Mass Index
#include<stdio.h>
int main()
{
double h,w,bmi;
printf("Enter weight in kg:- ");
scanf("%lf", &w);
printf("Enter height in m:- ");
scanf("%lf", &h);
bmi=w/(h*h);
printf("\nYour BMI is %lf", bmi);
if(bmi<=15)
printf("\nBMI Category:- Starvation\n");
else if(bmi<=17.5)
printf("\nBMI Category:- Anorexic\n");
else if(bmi<=18.5)
printf("\nBMI Category:- Underweight\n");
else if(bmi<=24.9)
printf("\nBMI Category:- Ideal\n");
else if(bmi<=25.9)
printf("\nBMI Category:- Overweight\n");
else if(bmi<=39.9)
printf("\nBMI Category:- Obese\n");
else
printf("\nBMI Category:- Morbidly Obese\n");
return 0;
}
| [
"noreply@github.com"
] | noreply@github.com |
4ce33be7b2425f6c951e26dff2000dd46dc9ca02 | b0e5102fb39ab1b740e80f61a2b114f645020673 | /Ch15/Disc_quote.cpp | f52e75e46efe36b44020dcde6494a509de0c1ea4 | [] | no_license | ironldk/CppPrimer | 2fa2fafe6c0ec579aac652bd9db71c2a5fb35573 | 7d3bbd07a88907700c42b5db8c6171242e1d0908 | refs/heads/master | 2022-05-05T00:41:51.866462 | 2022-04-21T16:00:11 | 2022-04-21T16:00:11 | 131,614,331 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 215 | cpp | #include "Disc_quote.h"
void Disc_quote::debug() const {
cout << "data members: \n";
cout << "\tbookNo: " << this->isbn() << "\tprice: " << price
<< "\tmin_qty" << quantity << "\tdiscount" << discount << endl;
} | [
"ldk953146716@126.com"
] | ldk953146716@126.com |
ef2580bebaadcbb0dab08e6b936255aa43ceb3fa | 31315e3a4d29eda95db818b32a78ddeff452ee04 | /SPOJ/P153SUMC.cpp | 1809b772726383db911cfa36d76b3d506dfc029f | [] | no_license | trunghai95/MyCPCodes | c3cb002308e522ab859fb8753f3b7c63cef29a6f | 4f7a339dd3841dfc54d18ec446effa8641d9bd37 | refs/heads/master | 2022-12-12T22:52:26.120067 | 2022-12-03T04:36:13 | 2022-12-03T04:36:13 | 47,124,575 | 1 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 177 | cpp | #include <bits/stdc++.h>
using namespace std;
int n, a, b;
int main()
{
cin >> a >> b >> n;
int f[] = {a,b,b-a,-a,-b,a-b};
cout << f[(n-1)%6];
return 0;
}
| [
"bthai.1995@gmail.com"
] | bthai.1995@gmail.com |
cb87a634c8387c1601e6b37ef95778dacec4aac2 | b677894966f2ae2d0585a31f163a362e41a3eae0 | /ns3/ns-3.26/src/uan/model/uan-transducer-hd.h | fad14f7cfbe10c3341b4d8ce838f23217b0b4701 | [
"LicenseRef-scancode-free-unknown",
"GPL-2.0-only",
"Apache-2.0"
] | permissive | cyliustack/clusim | 667a9eef2e1ea8dad1511fd405f3191d150a04a8 | cbedcf671ba19fded26e4776c0e068f81f068dfd | refs/heads/master | 2022-10-06T20:14:43.052930 | 2022-10-01T19:42:19 | 2022-10-01T19:42:19 | 99,692,344 | 7 | 3 | Apache-2.0 | 2018-07-04T10:09:24 | 2017-08-08T12:51:33 | Python | UTF-8 | C++ | false | false | 2,856 | h | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 University of Washington
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Leonard Tracy <lentracy@gmail.com>
*/
#ifndef UAN_TRANSDUCER_HD_H
#define UAN_TRANSDUCER_HD_H
#include "uan-transducer.h"
#include "ns3/simulator.h"
namespace ns3 {
/**
* \ingroup uan
*
* Half duplex implementation of transducer object
*
* This class will only allow attached Phy's to receive packets
* if not in TX mode.
*/
class UanTransducerHd : public UanTransducer
{
public:
/** Constructor */
UanTransducerHd ();
/** Dummy destructor, see DoDispose */
virtual ~UanTransducerHd ();
/**
* Register this type.
* \return The object TypeId.
*/
static TypeId GetTypeId (void);
// inherited methods
virtual State GetState (void) const;
virtual bool IsRx (void) const;
virtual bool IsTx (void) const;
virtual const ArrivalList &GetArrivalList (void) const;
virtual void Receive (Ptr<Packet> packet, double rxPowerDb, UanTxMode txMode, UanPdp pdp);
virtual void Transmit (Ptr<UanPhy> src, Ptr<Packet> packet, double txPowerDb, UanTxMode txMode);
virtual void SetChannel (Ptr<UanChannel> chan);
virtual Ptr<UanChannel> GetChannel (void) const;
virtual void AddPhy (Ptr<UanPhy>);
virtual const UanPhyList &GetPhyList (void) const;
virtual void Clear (void);
private:
State m_state; //!< Transducer state.
ArrivalList m_arrivalList; //!< List of arriving packets which overlap in time.
UanPhyList m_phyList; //!< List of physical layers attached above this tranducer.
Ptr<UanChannel> m_channel; //!< The attached channel.
EventId m_endTxEvent; //!< Event scheduled for end of transmission.
Time m_endTxTime; //!< Time at which transmission will be completed.
bool m_cleared; //!< Flab when we've been cleared.
/**
* Remove an entry from the arrival list.
*
* \param arrival The packet arrival to remove.
*/
void RemoveArrival (UanPacketArrival arrival);
/** Handle end of transmission event. */
void EndTx (void);
protected:
virtual void DoDispose ();
}; // class UanTransducerHd
} // namespace ns3
#endif /* UAN_TRANSDUCER_HD_H */
| [
"you@example.com"
] | you@example.com |
f1257db776b96ebf4a2f056278e1d78a0f81877e | ee1ad04e4743df2a09969d82cb281623cab5bc70 | /src/cmdenv/cmddefs.h | e6598d8c22f9275c1939697817b9fa72a98b3838 | [] | no_license | sksamal/omnetpp-5.0 | aea8fb3c63f59395addf611c14aadab3922c07c9 | 2aa86b33dc750dcc971e9c1a87f3f25bb7265734 | refs/heads/master | 2021-01-09T01:55:02.551530 | 2017-06-12T20:08:43 | 2017-06-12T20:08:43 | 242,204,571 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,071 | h | //==========================================================================
// CMDDEFS.H - part of
// OMNeT++/OMNEST
// Discrete System Simulation in C++
//
// General defines for the CMDENV library
//
// Author: Andras Varga
//
//==========================================================================
/*--------------------------------------------------------------*
Copyright (C) 1992-2015 Andras Varga
Copyright (C) 2006-2015 OpenSim Ltd.
This file is distributed WITHOUT ANY WARRANTY. See the file
`license' for details on this and other legal matters.
*--------------------------------------------------------------*/
#ifndef __OMNETPP_CMDENV_CMDDEFS_H
#define __OMNETPP_CMDENV_CMDDEFS_H
#include "omnetpp/platdep/platdefs.h"
namespace omnetpp {
namespace cmdenv {
#if defined(CMDENV_EXPORT)
# define CMDENV_API OPP_DLLEXPORT
#elif defined(CMDENV_IMPORT) || defined(OMNETPPLIBS_IMPORT)
# define CMDENV_API OPP_DLLIMPORT
#else
# define CMDENV_API
#endif
} // namespace cmdenv
} // namespace omnetpp
#endif
| [
"sksamal@gmail.com"
] | sksamal@gmail.com |
ecd2ca3a8c0d81ced7cb138040b7d34011af23c6 | ff2cf371645e633606550e9cb0a3260b0f9dde4c | /overloading/Mystring_OperatorFunction_FriendFunctions/src/Mystring.cpp | 9266922d3cc76b047fba52c40204755f68cb3071 | [] | no_license | ddzmitry/CPPLearninig | 6a817504cd1ad39cf40173432e0dc5d4b6fb911e | 16e89a5936445b894b0f8546d4840f36ed1522af | refs/heads/master | 2021-02-07T10:03:47.477605 | 2020-03-14T15:29:26 | 2020-03-14T15:29:26 | 244,012,343 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,356 | cpp | #include <iostream>
#include <cstring>
#include <cctype>
#include "Mystring.h"
// No-args constructor
Mystring::Mystring()
: str{nullptr} {
str = new char[1];
*str = '\0';
}
// Overloaded constructor
Mystring::Mystring(const char *s)
: str {nullptr} {
if (s==nullptr) {
str = new char[1];
*str = '\0';
} else {
str = new char[std::strlen(s)+1];
std::strcpy(str, s);
}
}
// Copy constructor
Mystring::Mystring(const Mystring &source)
: str{nullptr} {
str = new char[std::strlen(source.str)+ 1];
std::strcpy(str, source.str);
std::cout << "Copy constructor used" << std::endl;
}
// Move constructor
Mystring::Mystring( Mystring &&source)
:str(source.str) {
source.str = nullptr;
std::cout << "Move constructor used" << std::endl;
}
// Destructor
Mystring::~Mystring() {
delete [] str;
}
// Copy assignment operator
Mystring &Mystring::operator=(const Mystring &rhs) {
std::cout << "Using copy assignment" << std::endl;
if (this == &rhs)
return *this;
delete [] str;
str = new char[std::strlen(rhs.str) + 1];
std::strcpy(str, rhs.str);
return *this;
}
// Move assignment operator
Mystring &Mystring::operator=( Mystring &&rhs) {
std::cout << "Using move assignment" << std::endl;
if (this == &rhs)
return *this;
delete [] str;
str = rhs.str;
rhs.str = nullptr;
return *this;
}
// Display method
void Mystring::display() const {
std::cout << str << " : " << get_length() << std::endl;
}
// length getter
int Mystring::get_length() const { return std::strlen(str); }
// string getter
const char *Mystring::get_str() const { return str; }
// Equality
bool operator==(const Mystring &lhs, const Mystring &rhs) {
return (std::strcmp(lhs.str, rhs.str) == 0);
}
// Make lowercase
Mystring operator-(const Mystring &obj) {
// create buffer size of the string
char *buff = new char[std::strlen(obj.str) + 1];
// copy string to buffer
std::strcpy(buff, obj.str);
// make it small
for (size_t i=0; i<std::strlen(buff); i++)
buff[i] = std::tolower(buff[i]);
// create new string and return it
Mystring temp {buff};
delete [] buff;
// here we go
return temp;
}
// Concatenation
Mystring operator+(const Mystring &lhs, const Mystring &rhs) {
// create buffer of the lenght of two string
char *buff = new char[std::strlen(lhs.str) + std::strlen(rhs.str) + 1];
// copy and concatinate two strings to buffer
std::strcpy(buff, lhs.str);
std::strcat(buff, rhs.str);
// create new MYstring object
Mystring temp {buff};
// delete temp
delete [] buff;
// return it
return temp;
}
// friend std::ostream &operator<<(std::ostream &os, const Mystring &rhs); //output
// friend std::istream &operator>> (std::istream &os, Mystring &rhs);//extraction
//insertion operator
// overloaded insertion operator
std::ostream &operator<<(std::ostream &os, const Mystring &rhs) {
// if not const can use rhs.str
os << rhs.get_str();
return os;
}
// overloaded extraction operator
std::istream &operator>>(std::istream &in, Mystring &rhs) {
char *buff = new char[1000];
in >> buff;
rhs = Mystring{buff};
delete [] buff;
return in;
}
| [
"dzmitry.dubarau@gmail.com"
] | dzmitry.dubarau@gmail.com |
4036ea1084d732e5def818558fdd0e8147620010 | 1ffad3ae024e17fbfea7e754caf580dad346e1d6 | /gromacs/commandline/pargs.cpp | 0816b433daf23d0aa99ce100d72da3fa89d7c78b | [] | no_license | GregorySchwing/src | 1c0ab2bcdc9766de191e900b0b1af04573fb8d17 | 33dacc6e08d4d59b77bdcc70d808109eee4c27ac | refs/heads/master | 2020-04-05T17:09:40.441570 | 2018-11-11T04:32:09 | 2018-11-11T04:32:09 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 21,008 | cpp | /*
* This file is part of the GROMACS molecular simulation package.
*
* Copyright (c) 1991-2000, University of Groningen, The Netherlands.
* Copyright (c) 2001-2004, The GROMACS development team.
* Copyright (c) 2013,2014,2015,2016,2017, by the GROMACS development team, led by
* Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
* and including many others, as listed in the AUTHORS file in the
* top-level source directory and at http://www.gromacs.org.
*
* GROMACS is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* GROMACS is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with GROMACS; if not, see
* http://www.gnu.org/licenses, or write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* If you want to redistribute modifications to GROMACS, please
* consider that scientific software is very special. Version
* control is crucial - bugs must be traceable. We will be happy to
* consider code for inclusion in the official distribution, but
* derived work must not be called official GROMACS. Details are found
* in the README & COPYING files - if they are missing, get the
* official version at http://www.gromacs.org.
*
* To help us fund GROMACS development, we humbly ask that you cite
* the research papers on the package. Check out http://www.gromacs.org.
*/
#include "gmxpre.h"
#include "pargs.h"
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <list>
#include "gromacs/commandline/cmdlinehelpcontext.h"
#include "gromacs/commandline/cmdlinehelpwriter.h"
#include "gromacs/commandline/cmdlineparser.h"
#include "gromacs/fileio/oenv.h"
#include "gromacs/fileio/timecontrol.h"
#include "gromacs/options/basicoptions.h"
#include "gromacs/options/behaviorcollection.h"
#include "gromacs/options/filenameoption.h"
#include "gromacs/options/filenameoptionmanager.h"
#include "gromacs/options/options.h"
#include "gromacs/options/timeunitmanager.h"
#include "gromacs/utility/arrayref.h"
#include "gromacs/utility/basenetwork.h"
#include "gromacs/utility/classhelpers.h"
#include "gromacs/utility/cstringutil.h"
#include "gromacs/utility/exceptions.h"
#include "gromacs/utility/fatalerror.h"
#include "gromacs/utility/gmxassert.h"
#include "gromacs/utility/path.h"
#include "gromacs/utility/programcontext.h"
#include "gromacs/utility/smalloc.h"
#include "gromacs/utility/stringutil.h"
/* The source code in this file should be thread-safe.
Please keep it that way. */
int nenum(const char *const enumc[])
{
int i;
i = 1;
/* we *can* compare pointers directly here! */
while (enumc[i] && enumc[0] != enumc[i])
{
i++;
}
return i;
}
int opt2parg_int(const char *option, int nparg, t_pargs pa[])
{
int i;
for (i = 0; (i < nparg); i++)
{
if (strcmp(pa[i].option, option) == 0)
{
return *pa[i].u.i;
}
}
gmx_fatal(FARGS, "No integer option %s in pargs", option);
return 0;
}
gmx_bool opt2parg_bool(const char *option, int nparg, t_pargs pa[])
{
int i;
for (i = 0; (i < nparg); i++)
{
if (strcmp(pa[i].option, option) == 0)
{
return *pa[i].u.b;
}
}
gmx_fatal(FARGS, "No boolean option %s in pargs", option);
return FALSE;
}
real opt2parg_real(const char *option, int nparg, t_pargs pa[])
{
int i;
for (i = 0; (i < nparg); i++)
{
if (strcmp(pa[i].option, option) == 0)
{
return *pa[i].u.r;
}
}
gmx_fatal(FARGS, "No real option %s in pargs", option);
return 0.0;
}
const char *opt2parg_str(const char *option, int nparg, t_pargs pa[])
{
int i;
for (i = 0; (i < nparg); i++)
{
if (strcmp(pa[i].option, option) == 0)
{
return *(pa[i].u.c);
}
}
gmx_fatal(FARGS, "No string option %s in pargs", option);
return nullptr;
}
gmx_bool opt2parg_bSet(const char *option, int nparg, const t_pargs *pa)
{
int i;
for (i = 0; (i < nparg); i++)
{
if (strcmp(pa[i].option, option) == 0)
{
return pa[i].bSet;
}
}
gmx_fatal(FARGS, "No such option %s in pargs", option);
return FALSE; /* Too make some compilers happy */
}
const char *opt2parg_enum(const char *option, int nparg, t_pargs pa[])
{
int i;
for (i = 0; (i < nparg); i++)
{
if (strcmp(pa[i].option, option) == 0)
{
return pa[i].u.c[0];
}
}
gmx_fatal(FARGS, "No such option %s in pargs", option);
return nullptr;
}
/********************************************************************
* parse_common_args()
*/
namespace gmx
{
namespace
{
/*! \brief
* Returns the index of the default xvg format.
*
* \ingroup module_commandline
*/
int getDefaultXvgFormat(gmx::ConstArrayRef<const char *> xvgFormats)
{
const char *const select = getenv("GMX_VIEW_XVG");
if (select != nullptr)
{
ConstArrayRef<const char *>::const_iterator i =
std::find(xvgFormats.begin(), xvgFormats.end(), std::string(select));
if (i != xvgFormats.end())
{
return std::distance(xvgFormats.begin(), i);
}
else
{
return exvgNONE - 1;
}
}
/* The default is the first option */
return 0;
}
/*! \brief
* Conversion helper between t_pargs/t_filenm and Options.
*
* This class holds the necessary mapping between the old C structures and
* the new C++ options to allow copying values back after parsing for cases
* where the C++ options do not directly provide the type of value required for
* the C structures.
*
* \ingroup module_commandline
*/
class OptionsAdapter
{
public:
/*! \brief
* Initializes the adapter to convert from a specified command line.
*
* The command line is required, because t_pargs wants to return
* strings by reference to the original command line.
* OptionsAdapter creates a copy of the `argv` array (but not the
* strings) to make this possible, even if the parser removes
* options it has recognized.
*/
OptionsAdapter(int argc, const char *const argv[])
: argv_(argv, argv + argc)
{
}
/*! \brief
* Converts a t_filenm option into an Options option.
*
* \param options Options object to add the new option to.
* \param fnm t_filenm option to convert.
*/
void filenmToOptions(Options *options, t_filenm *fnm);
/*! \brief
* Converts a t_pargs option into an Options option.
*
* \param options Options object to add the new option to.
* \param pa t_pargs option to convert.
*/
void pargsToOptions(Options *options, t_pargs *pa);
/*! \brief
* Copies values back from options to t_pargs/t_filenm.
*/
void copyValues(bool bReadNode);
private:
struct FileNameData
{
//! Creates a conversion helper for a given `t_filenm` struct.
explicit FileNameData(t_filenm *fnm) : fnm(fnm), optionInfo(nullptr)
{
}
//! t_filenm structure to receive the final values.
t_filenm *fnm;
//! Option info object for the created FileNameOption.
FileNameOptionInfo *optionInfo;
//! Value storage for the created FileNameOption.
std::vector<std::string> values;
};
struct ProgramArgData
{
//! Creates a conversion helper for a given `t_pargs` struct.
explicit ProgramArgData(t_pargs *pa)
: pa(pa), optionInfo(nullptr), enumIndex(0), boolValue(false)
{
}
//! t_pargs structure to receive the final values.
t_pargs *pa;
//! Option info object for the created option.
OptionInfo *optionInfo;
//! Value storage for a non-enum StringOption (unused for other types).
std::string stringValue;
//! Value storage for an enum option (unused for other types).
int enumIndex;
//! Value storage for a BooleanOption (unused for other types).
bool boolValue;
};
std::vector<const char *> argv_;
// These are lists instead of vectors to avoid relocating existing
// objects in case the container is reallocated (the Options object
// contains pointes to members of the objects, which would get
// invalidated).
std::list<FileNameData> fileNameOptions_;
std::list<ProgramArgData> programArgs_;
GMX_DISALLOW_COPY_AND_ASSIGN(OptionsAdapter);
};
void OptionsAdapter::filenmToOptions(Options *options, t_filenm *fnm)
{
if (fnm->opt == nullptr)
{
// Existing code may use opt2fn() instead of ftp2fn() for
// options that use the default option name, so we need to
// keep the old behavior instead of fixing opt2fn().
// TODO: Check that this is not the case, remove this, and make
// opt2*() work even if fnm->opt is NULL for some options.
fnm->opt = ftp2defopt(fnm->ftp);
}
const bool bRead = ((fnm->flag & ffREAD) != 0);
const bool bWrite = ((fnm->flag & ffWRITE) != 0);
const bool bOptional = ((fnm->flag & ffOPT) != 0);
const bool bLibrary = ((fnm->flag & ffLIB) != 0);
const bool bMultiple = ((fnm->flag & ffMULT) != 0);
const bool bMissing = ((fnm->flag & ffALLOW_MISSING) != 0);
const char *const name = &fnm->opt[1];
const char * defName = fnm->fn;
int defType = -1;
if (defName == nullptr)
{
defName = ftp2defnm(fnm->ftp);
}
else if (Path::hasExtension(defName))
{
defType = fn2ftp(defName);
GMX_RELEASE_ASSERT(defType != efNR,
"File name option specifies an invalid extension");
}
fileNameOptions_.emplace_back(fnm);
FileNameData &data = fileNameOptions_.back();
data.optionInfo = options->addOption(
FileNameOption(name).storeVector(&data.values)
.defaultBasename(defName).defaultType(defType)
.legacyType(fnm->ftp).legacyOptionalBehavior()
.readWriteFlags(bRead, bWrite).required(!bOptional)
.libraryFile(bLibrary).multiValue(bMultiple)
.allowMissing(bMissing)
.description(ftp2desc(fnm->ftp)));
}
void OptionsAdapter::pargsToOptions(Options *options, t_pargs *pa)
{
const bool bHidden = startsWith(pa->desc, "HIDDEN");
const char *const name = &pa->option[1];
const char *const desc = (bHidden ? &pa->desc[6] : pa->desc);
programArgs_.emplace_back(pa);
ProgramArgData &data = programArgs_.back();
switch (pa->type)
{
case etINT:
data.optionInfo = options->addOption(
IntegerOption(name).store(pa->u.i)
.description(desc).hidden(bHidden));
return;
case etINT64:
data.optionInfo = options->addOption(
Int64Option(name).store(pa->u.is)
.description(desc).hidden(bHidden));
return;
case etREAL:
data.optionInfo = options->addOption(
RealOption(name).store(pa->u.r)
.description(desc).hidden(bHidden));
return;
case etTIME:
data.optionInfo = options->addOption(
RealOption(name).store(pa->u.r).timeValue()
.description(desc).hidden(bHidden));
return;
case etSTR:
{
const char *const defValue = (*pa->u.c != nullptr ? *pa->u.c : "");
data.optionInfo = options->addOption(
StringOption(name).store(&data.stringValue)
.defaultValue(defValue)
.description(desc).hidden(bHidden));
return;
}
case etBOOL:
data.optionInfo = options->addOption(
BooleanOption(name).store(&data.boolValue)
.defaultValue(*pa->u.b)
.description(desc).hidden(bHidden));
return;
case etRVEC:
data.optionInfo = options->addOption(
RealOption(name).store(*pa->u.rv).vector()
.description(desc).hidden(bHidden));
return;
case etENUM:
{
const int defaultIndex = (pa->u.c[0] != nullptr ? nenum(pa->u.c) - 1 : 0);
data.optionInfo = options->addOption(
EnumIntOption(name).store(&data.enumIndex)
.defaultValue(defaultIndex)
.enumValueFromNullTerminatedArray(pa->u.c + 1)
.description(desc).hidden(bHidden));
return;
}
}
GMX_THROW(NotImplementedError("Argument type not implemented"));
}
void OptionsAdapter::copyValues(bool bReadNode)
{
std::list<FileNameData>::const_iterator file;
for (file = fileNameOptions_.begin(); file != fileNameOptions_.end(); ++file)
{
if (!bReadNode && (file->fnm->flag & ffREAD))
{
continue;
}
if (file->optionInfo->isSet())
{
file->fnm->flag |= ffSET;
}
file->fnm->nfiles = file->values.size();
snew(file->fnm->fns, file->fnm->nfiles);
for (int i = 0; i < file->fnm->nfiles; ++i)
{
file->fnm->fns[i] = gmx_strdup(file->values[i].c_str());
}
}
std::list<ProgramArgData>::const_iterator arg;
for (arg = programArgs_.begin(); arg != programArgs_.end(); ++arg)
{
arg->pa->bSet = arg->optionInfo->isSet();
switch (arg->pa->type)
{
case etSTR:
{
if (arg->pa->bSet)
{
std::vector<const char *>::const_iterator pos =
std::find(argv_.begin(), argv_.end(), arg->stringValue);
GMX_RELEASE_ASSERT(pos != argv_.end(),
"String argument got a value not in argv");
*arg->pa->u.c = *pos;
}
break;
}
case etBOOL:
*arg->pa->u.b = arg->boolValue;
break;
case etENUM:
*arg->pa->u.c = arg->pa->u.c[arg->enumIndex + 1];
break;
default:
// For other types, there is nothing type-specific to do.
break;
}
}
}
} // namespace
} // namespace gmx
// Handle the flags argument, which is a bit field
// The FF macro returns whether or not the bit is set
#define FF(arg) ((Flags & arg) == arg)
gmx_bool parse_common_args(int *argc, char *argv[], unsigned long Flags,
int nfile, t_filenm fnm[], int npargs, t_pargs *pa,
int ndesc, const char **desc,
int nbugs, const char **bugs,
gmx_output_env_t **oenv)
{
/* This array should match the order of the enum in oenv.h */
const char *const xvg_formats[] = { "xmgrace", "xmgr", "none" };
try
{
double tbegin = 0.0, tend = 0.0, tdelta = 0.0;
bool bBeginTimeSet = false, bEndTimeSet = false, bDtSet = false;
bool bView = false;
int xvgFormat = 0;
gmx::OptionsAdapter adapter(*argc, argv);
gmx::Options options;
gmx::OptionsBehaviorCollection behaviors(&options);
gmx::FileNameOptionManager fileOptManager;
fileOptManager.disableInputOptionChecking(
FF(PCA_NOT_READ_NODE) || FF(PCA_DISABLE_INPUT_FILE_CHECKING));
options.addManager(&fileOptManager);
if (FF(PCA_CAN_SET_DEFFNM))
{
fileOptManager.addDefaultFileNameOption(&options, "deffnm");
}
if (FF(PCA_CAN_BEGIN))
{
options.addOption(
gmx::DoubleOption("b")
.store(&tbegin).storeIsSet(&bBeginTimeSet).timeValue()
.description("First frame (%t) to read from trajectory"));
}
if (FF(PCA_CAN_END))
{
options.addOption(
gmx::DoubleOption("e")
.store(&tend).storeIsSet(&bEndTimeSet).timeValue()
.description("Last frame (%t) to read from trajectory"));
}
if (FF(PCA_CAN_DT))
{
options.addOption(
gmx::DoubleOption("dt")
.store(&tdelta).storeIsSet(&bDtSet).timeValue()
.description("Only use frame when t MOD dt = first time (%t)"));
}
gmx::TimeUnit timeUnit = gmx::TimeUnit_Default;
if (FF(PCA_TIME_UNIT))
{
std::shared_ptr<gmx::TimeUnitBehavior> timeUnitBehavior(
new gmx::TimeUnitBehavior());
timeUnitBehavior->setTimeUnitStore(&timeUnit);
timeUnitBehavior->setTimeUnitFromEnvironment();
timeUnitBehavior->addTimeUnitOption(&options, "tu");
behaviors.addBehavior(timeUnitBehavior);
}
if (FF(PCA_CAN_VIEW))
{
options.addOption(
gmx::BooleanOption("w").store(&bView)
.description("View output [REF].xvg[ref], [REF].xpm[ref], "
"[REF].eps[ref] and [REF].pdb[ref] files"));
}
bool bXvgr = false;
for (int i = 0; i < nfile; i++)
{
bXvgr = bXvgr || (fnm[i].ftp == efXVG);
}
xvgFormat = gmx::getDefaultXvgFormat(xvg_formats);
if (bXvgr)
{
options.addOption(
gmx::EnumIntOption("xvg").enumValue(xvg_formats)
.store(&xvgFormat)
.description("xvg plot formatting"));
}
/* Now append the program specific arguments */
for (int i = 0; i < nfile; i++)
{
adapter.filenmToOptions(&options, &fnm[i]);
}
for (int i = 0; i < npargs; i++)
{
adapter.pargsToOptions(&options, &pa[i]);
}
const gmx::CommandLineHelpContext *context =
gmx::GlobalCommandLineHelpContext::get();
if (context != nullptr)
{
GMX_RELEASE_ASSERT(gmx_node_rank() == 0,
"Help output should be handled higher up and "
"only get called only on the master rank");
gmx::CommandLineHelpWriter(options)
.setHelpText(gmx::constArrayRefFromArray<const char *>(desc, ndesc))
.setKnownIssues(gmx::constArrayRefFromArray(bugs, nbugs))
.writeHelp(*context);
return FALSE;
}
/* Now parse all the command-line options */
gmx::CommandLineParser(&options).skipUnknown(FF(PCA_NOEXIT_ON_ARGS))
.parse(argc, argv);
behaviors.optionsFinishing();
options.finish();
/* set program name, command line, and default values for output options */
output_env_init(oenv, gmx::getProgramContext(),
(time_unit_t)(timeUnit + 1), bView,
(xvg_format_t)(xvgFormat + 1), 0);
/* Extract Time info from arguments */
if (bBeginTimeSet)
{
setTimeValue(TBEGIN, tbegin);
}
if (bEndTimeSet)
{
setTimeValue(TEND, tend);
}
if (bDtSet)
{
setTimeValue(TDELTA, tdelta);
}
adapter.copyValues(!FF(PCA_NOT_READ_NODE));
return TRUE;
}
GMX_CATCH_ALL_AND_EXIT_WITH_FATAL_ERROR;
#undef FF
}
| [
"gituser@visserv2.cs.uno.edu"
] | gituser@visserv2.cs.uno.edu |
d3fcb9bcdc478e9f877de9e0cb8e2433b5574e16 | 717e3b1d17fe34f35317b1e172c7f2806c7e7169 | /Codeforces/1352A.cpp | be5466ed12e245090ba6d5c1f6e4b06c09650669 | [] | no_license | codeCell01/Problem-Solving | ad744d0db0b4796572c6be5f4441dfab694ee28c | 2d9e2c3cb210dddcafb80eaa3a2d1dd275273c47 | refs/heads/main | 2023-06-11T18:25:46.550568 | 2021-07-04T10:49:57 | 2021-07-04T10:49:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 454 | cpp | #include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n, i, t=1;
cin>>n;
vector<int>a;
while(n)
{
int k = n%10;
if(k)
a.push_back(k*t);
t *= 10;
n /= 10;
}
cout<<a.size()<<endl;
for(auto it : a)
cout<<it<<' ';
cout<<endl;
}
return 0;
} | [
"devjewel.cou.ict10@gmail.com"
] | devjewel.cou.ict10@gmail.com |
884e94a7d6b8531ade67272bf705a7ea515ae563 | a0d6b817cb47b15923fa479d8452dae8c87089be | /src/environment/world/Coordinates.hpp | d5deb9cc31ac55a2a22444dde4f1ff06f756b507 | [] | no_license | EngineersBox/Wolfenstein-3D | 77c2d3a1306424081cace41618e2d83c63cb0569 | f090f37d2ee2b38877c1b03bc7146e5aaf8360e8 | refs/heads/master | 2023-02-28T00:30:58.302493 | 2021-02-05T00:24:17 | 2021-02-05T00:24:17 | 294,392,774 | 2 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 995 | hpp | #pragma once
#include <string>
#include <iostream>
using namespace std;
template <typename T>
struct Coordinates {
Coordinates(){};
Coordinates(T x, T y) {
this->x = x;
this->y = y;
};
Coordinates(const Coordinates& other) {
this->x = other.x;
this->y = other.y;
};
bool isLeft(Coordinates other) {
return other.x < this->x;
}
bool isAbove(Coordinates other) {
return other.y < this->y;
}
bool operator==(const Coordinates& other) const {
return this->x == other.x && this->y == other.y;
}
bool operator!=(const Coordinates& other) const {
return this->x != other.x || this->y != other.y;
}
friend ostream& operator<<(ostream& os, const Coordinates& c) {
return os << c.asString();
}
inline string asString() const {
return "(" + to_string(this->x) + "," + to_string(this->y) + ")";
}
T x;
T y;
};
typedef Coordinates<int> Coords; | [
"toastcraft.info@gmail.com"
] | toastcraft.info@gmail.com |
134dede9ed25c9d8f29ed3ffde966704b31deacb | 135da69f3fde49932690a787aaa044508304efd5 | /grpc/src/compiler/cpp_generator.h | 953ddfd569e0ccb1d2bc39d6dbe5d47b4e6f66eb | [
"Apache-2.0"
] | permissive | bog-dan-ro/flatbuffers | dc6d12c816dfb0e9c273f79166ca0f9b6fd9c477 | 326c4d384ff7fae29edcba6c1eec525bc1deed91 | refs/heads/master | 2020-04-09T01:23:03.466660 | 2017-04-10T17:09:56 | 2017-04-10T17:09:56 | 60,003,143 | 3 | 0 | null | 2016-05-30T10:56:01 | 2016-05-30T10:56:01 | null | UTF-8 | C++ | false | false | 5,111 | h | /*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* 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.
*
*/
#ifndef GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H
#define GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H
// cpp_generator.h/.cc do not directly depend on GRPC/ProtoBuf, such that they
// can be used to generate code for other serialization systems, such as
// FlatBuffers.
#include <memory>
#include <vector>
#ifndef GRPC_CUSTOM_STRING
#include <string>
#define GRPC_CUSTOM_STRING std::string
#endif
namespace grpc {
typedef GRPC_CUSTOM_STRING string;
} // namespace grpc
namespace grpc_cpp_generator {
// Contains all the parameters that are parsed from the command line.
struct Parameters {
// Puts the service into a namespace
grpc::string services_namespace;
// Use system includes (<>) or local includes ("")
bool use_system_headers;
// Prefix to any grpc include
grpc::string grpc_search_path;
};
// An abstract interface representing a method.
struct Method {
virtual ~Method() {}
virtual grpc::string name() const = 0;
virtual grpc::string input_type_name() const = 0;
virtual grpc::string output_type_name() const = 0;
virtual bool NoStreaming() const = 0;
virtual bool ClientOnlyStreaming() const = 0;
virtual bool ServerOnlyStreaming() const = 0;
virtual bool BidiStreaming() const = 0;
};
// An abstract interface representing a service.
struct Service {
virtual ~Service() {}
virtual grpc::string name() const = 0;
virtual int method_count() const = 0;
virtual std::unique_ptr<const Method> method(int i) const = 0;
};
struct Printer {
virtual ~Printer() {}
virtual void Print(const std::map<grpc::string, grpc::string> &vars,
const char *template_string) = 0;
virtual void Print(const char *string) = 0;
virtual void Indent() = 0;
virtual void Outdent() = 0;
};
// An interface that allows the source generated to be output using various
// libraries/idls/serializers.
struct File {
virtual ~File() {}
virtual grpc::string filename() const = 0;
virtual grpc::string filename_without_ext() const = 0;
virtual grpc::string message_header_ext() const = 0;
virtual grpc::string service_header_ext() const = 0;
virtual grpc::string package() const = 0;
virtual std::vector<grpc::string> package_parts() const = 0;
virtual grpc::string additional_headers() const = 0;
virtual int service_count() const = 0;
virtual std::unique_ptr<const Service> service(int i) const = 0;
virtual std::unique_ptr<Printer> CreatePrinter(grpc::string *str) const = 0;
};
// Return the prologue of the generated header file.
grpc::string GetHeaderPrologue(File *file, const Parameters ¶ms);
// Return the includes needed for generated header file.
grpc::string GetHeaderIncludes(File *file, const Parameters ¶ms);
// Return the includes needed for generated source file.
grpc::string GetSourceIncludes(File *file, const Parameters ¶ms);
// Return the epilogue of the generated header file.
grpc::string GetHeaderEpilogue(File *file, const Parameters ¶ms);
// Return the prologue of the generated source file.
grpc::string GetSourcePrologue(File *file, const Parameters ¶ms);
// Return the services for generated header file.
grpc::string GetHeaderServices(File *file, const Parameters ¶ms);
// Return the services for generated source file.
grpc::string GetSourceServices(File *file, const Parameters ¶ms);
// Return the epilogue of the generated source file.
grpc::string GetSourceEpilogue(File *file, const Parameters ¶ms);
} // namespace grpc_cpp_generator
#endif // GRPC_INTERNAL_COMPILER_CPP_GENERATOR_H
| [
"wvo@google.com"
] | wvo@google.com |
07aa952e2a1adf76e410a943728b4692feb42efa | 77f3038198874dfe7f7ae78af9289300cc5acdfe | /Sort/BubbleSort.cpp | 4fc73c0a8058159f0e0c160c6a7d98f1bd1a26d8 | [] | no_license | LupinLeo/PersonalPractice | ab857a21b19c13de94fe11239def139acf25ad2a | 126713d119bd24d4c0ffc73507414914cb378fe7 | refs/heads/master | 2020-06-26T23:23:17.758925 | 2019-08-19T08:23:30 | 2019-08-19T08:23:30 | 199,786,538 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 447 | cpp | #include<iostream>
#include<vector>
using namespace std;
void bubbleSort(vector<int>&arr){
if(arr.size()<2)
return;
for(int i =arr.size()-1;i>=1;i--){
for(int j =0;j<i;j++){
if(arr[j]>arr[j+1])
swap(arr[j],arr[j+1]);
}
}
}
int main(){
vector<int>arr = {5,2,9,4,2,3,1,-5,4,8};
bubbleSort(arr);
for(int i =0;i<arr.size();i++)
cout<<arr[i]<<" ";
return 0;
}
| [
"505636762@qq.com"
] | 505636762@qq.com |
a31cfa8f64626721909760137fc22ebdecd8f2a0 | 17a537b8bcb79e379511e27266b074121f768736 | /config.h | 0cabe51037646b01bb9b909f5cb69f19506dd0f0 | [] | no_license | flatcap/dparted | aaa59eec8b46d3300b732cebdb96ab861b7e512f | 5a358eb865959e7e07de5d9c649476f13c33723d | refs/heads/main | 2022-11-18T19:06:50.964130 | 2022-06-12T19:23:17 | 2022-06-12T19:23:17 | 149,684,837 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,434 | h | /* Copyright (c) 2014 Richard Russon (FlatCap)
*
* This file is part of DParted.
*
* DParted is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DParted is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DParted. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CONFIG_H_
#define _CONFIG_H_
#include <string>
#include <cstdint>
#include <memory>
//XXX static_assert : sizeof (d_value) == sizeof (l_value)
typedef std::shared_ptr<class Config> ConfigPtr;
class Config
{
public:
Config (void) = default;
virtual ~Config() = default;
Config (std::string value); // typed constructors
Config (const char* value);
Config (double value);
Config (bool value);
Config (uint8_t value);
Config ( int8_t value);
Config (uint16_t value);
Config ( int16_t value);
Config (uint32_t value);
Config ( int32_t value);
Config (uint64_t value);
Config ( int64_t value);
Config (const Config& v) = default;
Config ( Config&& v) = default;
Config& operator= (const Config& v);
Config& operator= ( Config&& v);
Config& operator= (std::string);
Config& operator= (double);
Config& operator= (bool);
Config& operator= (uint8_t);
Config& operator= ( int8_t);
Config& operator= (uint16_t);
Config& operator= ( int16_t);
Config& operator= (uint32_t);
Config& operator= ( int32_t);
Config& operator= (uint64_t);
Config& operator= ( int64_t);
operator std::string (void); // cast Config to type
operator double (void);
operator bool (void);
operator uint8_t (void);
operator int8_t (void);
operator uint16_t (void);
operator int16_t (void);
operator uint32_t (void);
operator int32_t (void);
operator uint64_t (void);
operator int64_t (void);
enum class Tag {
t_unset, // Empty
t_string, // Text
t_double, // Floating point
t_bool, // 1 bit
t_u8, // 8 bit unsigned integer
t_s8, // signed
t_u16, // 16 bit unsigned integer
t_s16, // signed
t_u32, // 32 bit unsigned integer
t_s32, // signed
t_u64, // 64 bit unsigned integer
t_s64 // signed
} type = Tag::t_unset;
protected:
friend std::ostream& operator<< (std::ostream& os, const Config* v);
friend std::ostream& operator<< (std::ostream& os, const Config& v);
friend bool operator== (const Config& lhs, const Config& rhs);
friend bool operator< (const Config& lhs, const Config& rhs);
inline friend bool operator!= (const Config& lhs, const Config& rhs) { return !operator== (lhs, rhs); }
inline friend bool operator> (const Config& lhs, const Config& rhs) { return operator< (rhs, lhs); }
inline friend bool operator<= (const Config& lhs, const Config& rhs) { return !operator> (lhs, rhs); }
inline friend bool operator>= (const Config& lhs, const Config& rhs) { return !operator< (lhs, rhs); }
union {
double d_value;
uint64_t l_value = 0;
};
std::string s_value;
};
#endif // _CONFIG_H_
| [
"richard.russon@gmail.com"
] | richard.russon@gmail.com |
d0e56b2e757fea267e695d866658fe37c51f8426 | b33a9177edaaf6bf185ef20bf87d36eada719d4f | /qtsvg/src/svg/qsvghandler.cpp | d373a99dded00d23749c4ada54d4c1a0d97d92b7 | [
"Qt-LGPL-exception-1.1",
"LGPL-2.1-only",
"LGPL-2.0-or-later",
"LGPL-3.0-only",
"GPL-3.0-only",
"LGPL-2.1-or-later",
"GPL-1.0-or-later",
"LicenseRef-scancode-unknown-license-reference",
"GPL-2.0-only",
"GFDL-1.3-only",
"LicenseRef-scancode-digia-qt-preview",
"LicenseRef-scancode-warranty-discl... | permissive | wgnet/wds_qt | ab8c093b8c6eead9adf4057d843e00f04915d987 | 8db722fd367d2d0744decf99ac7bafaba8b8a3d3 | refs/heads/master | 2021-04-02T11:07:10.181067 | 2020-06-02T10:29:03 | 2020-06-02T10:34:19 | 248,267,925 | 1 | 0 | Apache-2.0 | 2020-04-30T12:16:53 | 2020-03-18T15:20:38 | null | UTF-8 | C++ | false | false | 132,356 | cpp | /****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the Qt SVG module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 or version 3 as published by the Free
** Software Foundation and appearing in the file LICENSE.LGPLv21 and
** LICENSE.LGPLv3 included in the packaging of this file. Please review the
** following information to ensure the GNU Lesser General Public License
** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception, The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "qplatformdefs.h"
#include "qsvghandler_p.h"
#include "qsvgtinydocument_p.h"
#include "qsvgstructure_p.h"
#include "qsvggraphics_p.h"
#include "qsvgnode_p.h"
#include "qsvgfont_p.h"
#include "qpen.h"
#include "qpainterpath.h"
#include "qbrush.h"
#include "qcolor.h"
#include "qtextformat.h"
#include "qvector.h"
#include "qfileinfo.h"
#include "qfile.h"
#include "qdebug.h"
#include "qmath.h"
#include "qnumeric.h"
#include "qvarlengtharray.h"
#include "private/qmath_p.h"
#include "float.h"
QT_BEGIN_NAMESPACE
static const char *qt_inherit_text = "inherit";
#define QT_INHERIT QLatin1String(qt_inherit_text)
// ======== duplicated from qcolor_p
static inline int qsvg_h2i(char hex)
{
if (hex >= '0' && hex <= '9')
return hex - '0';
if (hex >= 'a' && hex <= 'f')
return hex - 'a' + 10;
if (hex >= 'A' && hex <= 'F')
return hex - 'A' + 10;
return -1;
}
static inline int qsvg_hex2int(const char *s)
{
return (qsvg_h2i(s[0]) << 4) | qsvg_h2i(s[1]);
}
static inline int qsvg_hex2int(char s)
{
int h = qsvg_h2i(s);
return (h << 4) | h;
}
bool qsvg_get_hex_rgb(const char *name, QRgb *rgb)
{
if(name[0] != '#')
return false;
name++;
int len = qstrlen(name);
int r, g, b;
if (len == 12) {
r = qsvg_hex2int(name);
g = qsvg_hex2int(name + 4);
b = qsvg_hex2int(name + 8);
} else if (len == 9) {
r = qsvg_hex2int(name);
g = qsvg_hex2int(name + 3);
b = qsvg_hex2int(name + 6);
} else if (len == 6) {
r = qsvg_hex2int(name);
g = qsvg_hex2int(name + 2);
b = qsvg_hex2int(name + 4);
} else if (len == 3) {
r = qsvg_hex2int(name[0]);
g = qsvg_hex2int(name[1]);
b = qsvg_hex2int(name[2]);
} else {
r = g = b = -1;
}
if ((uint)r > 255 || (uint)g > 255 || (uint)b > 255) {
*rgb = 0;
return false;
}
*rgb = qRgb(r, g ,b);
return true;
}
bool qsvg_get_hex_rgb(const QChar *str, int len, QRgb *rgb)
{
if (len > 13)
return false;
char tmp[16];
for(int i = 0; i < len; ++i)
tmp[i] = str[i].toLatin1();
tmp[len] = 0;
return qsvg_get_hex_rgb(tmp, rgb);
}
// ======== end of qcolor_p duplicate
static bool parsePathDataFast(const QStringRef &data, QPainterPath &path);
static inline QString someId(const QXmlStreamAttributes &attributes)
{
QString id = attributes.value(QLatin1String("id")).toString();
if (id.isEmpty())
id = attributes.value(QLatin1String("xml:id")).toString();
return id;
}
struct QSvgAttributes
{
QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHandler *handler);
QString id;
QStringRef color;
QStringRef colorOpacity;
QStringRef fill;
QStringRef fillRule;
QStringRef fillOpacity;
QStringRef stroke;
QStringRef strokeDashArray;
QStringRef strokeDashOffset;
QStringRef strokeLineCap;
QStringRef strokeLineJoin;
QStringRef strokeMiterLimit;
QStringRef strokeOpacity;
QStringRef strokeWidth;
QStringRef vectorEffect;
QStringRef fontFamily;
QStringRef fontSize;
QStringRef fontStyle;
QStringRef fontWeight;
QStringRef fontVariant;
QStringRef textAnchor;
QStringRef transform;
QStringRef visibility;
QStringRef opacity;
QStringRef compOp;
QStringRef display;
QStringRef offset;
QStringRef stopColor;
QStringRef stopOpacity;
#ifndef QT_NO_CSSPARSER
QVector<QSvgCssAttribute> m_cssAttributes;
#endif
};
QSvgAttributes::QSvgAttributes(const QXmlStreamAttributes &xmlAttributes, QSvgHandler *handler)
{
#ifndef QT_NO_CSSPARSER
QStringRef style = xmlAttributes.value(QLatin1String("style"));
if (!style.isEmpty()) {
handler->parseCSStoXMLAttrs(style.toString(), &m_cssAttributes);
for (int j = 0; j < m_cssAttributes.count(); ++j) {
const QSvgCssAttribute &attribute = m_cssAttributes.at(j);
QStringRef name = attribute.name;
QStringRef value = attribute.value;
if (name.isEmpty())
continue;
switch (name.at(0).unicode()) {
case 'c':
if (name == QLatin1String("color"))
color = value;
else if (name == QLatin1String("color-opacity"))
colorOpacity = value;
else if (name == QLatin1String("comp-op"))
compOp = value;
break;
case 'd':
if (name == QLatin1String("display"))
display = value;
break;
case 'f':
if (name == QLatin1String("fill"))
fill = value;
else if (name == QLatin1String("fill-rule"))
fillRule = value;
else if (name == QLatin1String("fill-opacity"))
fillOpacity = value;
else if (name == QLatin1String("font-family"))
fontFamily = value;
else if (name == QLatin1String("font-size"))
fontSize = value;
else if (name == QLatin1String("font-style"))
fontStyle = value;
else if (name == QLatin1String("font-weight"))
fontWeight = value;
else if (name == QLatin1String("font-variant"))
fontVariant = value;
break;
case 'o':
if (name == QLatin1String("opacity"))
opacity = value;
else if (name == QLatin1String("offset"))
offset = value;
break;
case 's':
if (name.length() > 5 && QStringRef(name.string(), name.position() + 1, 5) == QLatin1String("troke")) {
QStringRef strokeRef(name.string(), name.position() + 6, name.length() - 6);
if (strokeRef.isEmpty())
stroke = value;
else if (strokeRef == QLatin1String("-dasharray"))
strokeDashArray = value;
else if (strokeRef == QLatin1String("-dashoffset"))
strokeDashOffset = value;
else if (strokeRef == QLatin1String("-linecap"))
strokeLineCap = value;
else if (strokeRef == QLatin1String("-linejoin"))
strokeLineJoin = value;
else if (strokeRef == QLatin1String("-miterlimit"))
strokeMiterLimit = value;
else if (strokeRef == QLatin1String("-opacity"))
strokeOpacity = value;
else if (strokeRef == QLatin1String("-width"))
strokeWidth = value;
}
else if (name == QLatin1String("stop-color"))
stopColor = value;
else if (name == QLatin1String("stop-opacity"))
stopOpacity = value;
break;
case 't':
if (name == QLatin1String("text-anchor"))
textAnchor = value;
else if (name == QLatin1String("transform"))
transform = value;
break;
case 'v':
if (name == QLatin1String("vector-effect"))
vectorEffect = value;
else if (name == QLatin1String("visibility"))
visibility = value;
break;
default:
break;
}
}
}
#endif // QT_NO_CSSPARSER
for (int i = 0; i < xmlAttributes.count(); ++i) {
const QXmlStreamAttribute &attribute = xmlAttributes.at(i);
QStringRef name = attribute.qualifiedName();
if (name.isEmpty())
continue;
QStringRef value = attribute.value();
switch (name.at(0).unicode()) {
case 'c':
if (name == QLatin1String("color"))
color = value;
else if (name == QLatin1String("color-opacity"))
colorOpacity = value;
else if (name == QLatin1String("comp-op"))
compOp = value;
break;
case 'd':
if (name == QLatin1String("display"))
display = value;
break;
case 'f':
if (name == QLatin1String("fill"))
fill = value;
else if (name == QLatin1String("fill-rule"))
fillRule = value;
else if (name == QLatin1String("fill-opacity"))
fillOpacity = value;
else if (name == QLatin1String("font-family"))
fontFamily = value;
else if (name == QLatin1String("font-size"))
fontSize = value;
else if (name == QLatin1String("font-style"))
fontStyle = value;
else if (name == QLatin1String("font-weight"))
fontWeight = value;
else if (name == QLatin1String("font-variant"))
fontVariant = value;
break;
case 'i':
if (name == QLatin1String("id"))
id = value.toString();
break;
case 'o':
if (name == QLatin1String("opacity"))
opacity = value;
if (name == QLatin1String("offset"))
offset = value;
break;
case 's':
if (name.length() > 5 && QStringRef(name.string(), name.position() + 1, 5) == QLatin1String("troke")) {
QStringRef strokeRef(name.string(), name.position() + 6, name.length() - 6);
if (strokeRef.isEmpty())
stroke = value;
else if (strokeRef == QLatin1String("-dasharray"))
strokeDashArray = value;
else if (strokeRef == QLatin1String("-dashoffset"))
strokeDashOffset = value;
else if (strokeRef == QLatin1String("-linecap"))
strokeLineCap = value;
else if (strokeRef == QLatin1String("-linejoin"))
strokeLineJoin = value;
else if (strokeRef == QLatin1String("-miterlimit"))
strokeMiterLimit = value;
else if (strokeRef == QLatin1String("-opacity"))
strokeOpacity = value;
else if (strokeRef == QLatin1String("-width"))
strokeWidth = value;
}
else if (name == QLatin1String("stop-color"))
stopColor = value;
else if (name == QLatin1String("stop-opacity"))
stopOpacity = value;
break;
case 't':
if (name == QLatin1String("text-anchor"))
textAnchor = value;
else if (name == QLatin1String("transform"))
transform = value;
break;
case 'v':
if (name == QLatin1String("vector-effect"))
vectorEffect = value;
else if (name == QLatin1String("visibility"))
visibility = value;
break;
case 'x':
if (name == QLatin1String("xml:id") && id.isEmpty())
id = value.toString();
break;
default:
break;
}
}
}
static const char * QSvgStyleSelector_nodeString[] = {
"svg",
"g",
"defs",
"switch",
"animation",
"arc",
"circle",
"ellipse",
"image",
"line",
"path",
"polygon",
"polyline",
"rect",
"text",
"textarea",
"tspan",
"use",
"video"
};
#ifndef QT_NO_CSSPARSER
class QSvgStyleSelector : public QCss::StyleSelector
{
public:
QSvgStyleSelector()
{
nameCaseSensitivity = Qt::CaseInsensitive;
}
virtual ~QSvgStyleSelector()
{
}
inline QString nodeToName(QSvgNode *node) const
{
return QLatin1String(QSvgStyleSelector_nodeString[node->type()]);
}
inline QSvgNode *svgNode(NodePtr node) const
{
return (QSvgNode*)node.ptr;
}
inline QSvgStructureNode *nodeToStructure(QSvgNode *n) const
{
if (n &&
(n->type() == QSvgNode::DOC ||
n->type() == QSvgNode::G ||
n->type() == QSvgNode::DEFS ||
n->type() == QSvgNode::SWITCH)) {
return (QSvgStructureNode*)n;
}
return 0;
}
inline QSvgStructureNode *svgStructure(NodePtr node) const
{
QSvgNode *n = svgNode(node);
QSvgStructureNode *st = nodeToStructure(n);
return st;
}
virtual bool nodeNameEquals(NodePtr node, const QString& nodeName) const
{
QSvgNode *n = svgNode(node);
if (!n)
return false;
QString name = nodeToName(n);
return QString::compare(name, nodeName, Qt::CaseInsensitive) == 0;
}
virtual QString attribute(NodePtr node, const QString &name) const
{
QSvgNode *n = svgNode(node);
if ((!n->nodeId().isEmpty() && (name == QLatin1String("id") ||
name == QLatin1String("xml:id"))))
return n->nodeId();
if (!n->xmlClass().isEmpty() && name == QLatin1String("class"))
return n->xmlClass();
return QString();
}
virtual bool hasAttributes(NodePtr node) const
{
QSvgNode *n = svgNode(node);
return (n &&
(!n->nodeId().isEmpty() || !n->xmlClass().isEmpty()));
}
virtual QStringList nodeIds(NodePtr node) const
{
QSvgNode *n = svgNode(node);
QString nid;
if (n)
nid = n->nodeId();
QStringList lst; lst.append(nid);
return lst;
}
virtual QStringList nodeNames(NodePtr node) const
{
QSvgNode *n = svgNode(node);
if (n)
return QStringList(nodeToName(n));
return QStringList();
}
virtual bool isNullNode(NodePtr node) const
{
return !node.ptr;
}
virtual NodePtr parentNode(NodePtr node) const
{
QSvgNode *n = svgNode(node);
NodePtr newNode;
newNode.ptr = 0;
newNode.id = 0;
if (n) {
QSvgNode *svgParent = n->parent();
if (svgParent) {
newNode.ptr = svgParent;
}
}
return newNode;
}
virtual NodePtr previousSiblingNode(NodePtr node) const
{
NodePtr newNode;
newNode.ptr = 0;
newNode.id = 0;
QSvgNode *n = svgNode(node);
if (!n)
return newNode;
QSvgStructureNode *svgParent = nodeToStructure(n->parent());
if (svgParent) {
newNode.ptr = svgParent->previousSiblingNode(n);
}
return newNode;
}
virtual NodePtr duplicateNode(NodePtr node) const
{
NodePtr n;
n.ptr = node.ptr;
n.id = node.id;
return n;
}
virtual void freeNode(NodePtr node) const
{
Q_UNUSED(node);
}
};
#endif // QT_NO_CSSPARSER
// '0' is 0x30 and '9' is 0x39
static inline bool isDigit(ushort ch)
{
static quint16 magic = 0x3ff;
return ((ch >> 4) == 3) && (magic >> (ch & 15));
}
static qreal toDouble(const QChar *&str)
{
const int maxLen = 255;//technically doubles can go til 308+ but whatever
char temp[maxLen+1];
int pos = 0;
if (*str == QLatin1Char('-')) {
temp[pos++] = '-';
++str;
} else if (*str == QLatin1Char('+')) {
++str;
}
while (isDigit(str->unicode()) && pos < maxLen) {
temp[pos++] = str->toLatin1();
++str;
}
if (*str == QLatin1Char('.') && pos < maxLen) {
temp[pos++] = '.';
++str;
}
while (isDigit(str->unicode()) && pos < maxLen) {
temp[pos++] = str->toLatin1();
++str;
}
bool exponent = false;
if ((*str == QLatin1Char('e') || *str == QLatin1Char('E')) && pos < maxLen) {
exponent = true;
temp[pos++] = 'e';
++str;
if ((*str == QLatin1Char('-') || *str == QLatin1Char('+')) && pos < maxLen) {
temp[pos++] = str->toLatin1();
++str;
}
while (isDigit(str->unicode()) && pos < maxLen) {
temp[pos++] = str->toLatin1();
++str;
}
}
temp[pos] = '\0';
qreal val;
if (!exponent && pos < 10) {
int ival = 0;
const char *t = temp;
bool neg = false;
if(*t == '-') {
neg = true;
++t;
}
while(*t && *t != '.') {
ival *= 10;
ival += (*t) - '0';
++t;
}
if(*t == '.') {
++t;
int div = 1;
while(*t) {
ival *= 10;
ival += (*t) - '0';
div *= 10;
++t;
}
val = ((qreal)ival)/((qreal)div);
} else {
val = ival;
}
if (neg)
val = -val;
} else {
val = QByteArray::fromRawData(temp, pos).toDouble();
}
return val;
}
static qreal toDouble(const QString &str, bool *ok = NULL)
{
const QChar *c = str.constData();
qreal res = toDouble(c);
if (ok) {
*ok = ((*c) == QLatin1Char('\0'));
}
return res;
}
static qreal toDouble(const QStringRef &str, bool *ok = NULL)
{
const QChar *c = str.constData();
qreal res = toDouble(c);
if (ok) {
*ok = (c == (str.constData() + str.length()));
}
return res;
}
static QVector<qreal> parseNumbersList(const QChar *&str)
{
QVector<qreal> points;
if (!str)
return points;
points.reserve(32);
while (str->isSpace())
++str;
while (isDigit(str->unicode()) ||
*str == QLatin1Char('-') || *str == QLatin1Char('+') ||
*str == QLatin1Char('.')) {
points.append(toDouble(str));
while (str->isSpace())
++str;
if (*str == QLatin1Char(','))
++str;
//eat the rest of space
while (str->isSpace())
++str;
}
return points;
}
static inline void parseNumbersArray(const QChar *&str, QVarLengthArray<qreal, 8> &points)
{
while (str->isSpace())
++str;
while (isDigit(str->unicode()) ||
*str == QLatin1Char('-') || *str == QLatin1Char('+') ||
*str == QLatin1Char('.')) {
points.append(toDouble(str));
while (str->isSpace())
++str;
if (*str == QLatin1Char(','))
++str;
//eat the rest of space
while (str->isSpace())
++str;
}
}
static QVector<qreal> parsePercentageList(const QChar *&str)
{
QVector<qreal> points;
if (!str)
return points;
while (str->isSpace())
++str;
while ((*str >= QLatin1Char('0') && *str <= QLatin1Char('9')) ||
*str == QLatin1Char('-') || *str == QLatin1Char('+') ||
*str == QLatin1Char('.')) {
points.append(toDouble(str));
while (str->isSpace())
++str;
if (*str == QLatin1Char('%'))
++str;
while (str->isSpace())
++str;
if (*str == QLatin1Char(','))
++str;
//eat the rest of space
while (str->isSpace())
++str;
}
return points;
}
static QString idFromUrl(const QString &url)
{
QString::const_iterator itr = url.constBegin();
while ((*itr).isSpace())
++itr;
if ((*itr) == QLatin1Char('('))
++itr;
while ((*itr).isSpace())
++itr;
if ((*itr) == QLatin1Char('#'))
++itr;
QString id;
while ((*itr) != QLatin1Char(')')) {
id += *itr;
++itr;
}
return id;
}
static inline QStringRef trimRef(const QStringRef &str)
{
if (str.isEmpty())
return QStringRef();
const QChar *s = str.string()->constData() + str.position();
int end = str.length() - 1;
if (!s[0].isSpace() && !s[end].isSpace())
return str;
int start = 0;
while (start<=end && s[start].isSpace()) // skip white space from start
start++;
if (start <= end) { // only white space
while (s[end].isSpace()) // skip white space from end
end--;
}
int l = end - start + 1;
if (l <= 0)
return QStringRef();
return QStringRef(str.string(), str.position() + start, l);
}
/**
* returns true when successfuly set the color. false signifies
* that the color should be inherited
*/
static bool resolveColor(const QStringRef &colorStr, QColor &color, QSvgHandler *handler)
{
QStringRef colorStrTr = trimRef(colorStr);
if (colorStrTr.isEmpty())
return false;
switch(colorStrTr.at(0).unicode()) {
case '#':
{
// #rrggbb is very very common, so let's tackle it here
// rather than falling back to QColor
QRgb rgb;
bool ok = qsvg_get_hex_rgb(colorStrTr.unicode(), colorStrTr.length(), &rgb);
if (ok)
color.setRgb(rgb);
return ok;
}
break;
case 'r':
{
// starts with "rgb(", ends with ")" and consists of at least 7 characters "rgb(,,)"
if (colorStrTr.length() >= 7 && colorStrTr.at(colorStrTr.length() - 1) == QLatin1Char(')')
&& QStringRef(colorStrTr.string(), colorStrTr.position(), 4) == QLatin1String("rgb(")) {
const QChar *s = colorStrTr.constData() + 4;
QVector<qreal> compo = parseNumbersList(s);
//1 means that it failed after reaching non-parsable
//character which is going to be "%"
if (compo.size() == 1) {
s = colorStrTr.constData() + 4;
compo = parsePercentageList(s);
for (int i = 0; i < compo.size(); ++i)
compo[i] *= (qreal)2.55;
}
if (compo.size() == 3) {
color = QColor(int(compo[0]),
int(compo[1]),
int(compo[2]));
return true;
}
return false;
}
}
break;
case 'c':
if (colorStrTr == QLatin1String("currentColor")) {
color = handler->currentColor();
return true;
}
break;
case 'i':
if (colorStrTr == QT_INHERIT)
return false;
break;
default:
break;
}
color = QColor(colorStrTr.toString());
return color.isValid();
}
static bool constructColor(const QStringRef &colorStr, const QStringRef &opacity,
QColor &color, QSvgHandler *handler)
{
if (!resolveColor(colorStr, color, handler))
return false;
if (!opacity.isEmpty()) {
bool ok = true;
qreal op = qMin(qreal(1.0), qMax(qreal(0.0), toDouble(opacity, &ok)));
if (!ok)
op = 1.0;
color.setAlphaF(op);
}
return true;
}
static qreal parseLength(const QString &str, QSvgHandler::LengthType &type,
QSvgHandler *handler, bool *ok = NULL)
{
QString numStr = str.trimmed();
if (numStr.endsWith(QLatin1Char('%'))) {
numStr.chop(1);
type = QSvgHandler::LT_PERCENT;
} else if (numStr.endsWith(QLatin1String("px"))) {
numStr.chop(2);
type = QSvgHandler::LT_PX;
} else if (numStr.endsWith(QLatin1String("pc"))) {
numStr.chop(2);
type = QSvgHandler::LT_PC;
} else if (numStr.endsWith(QLatin1String("pt"))) {
numStr.chop(2);
type = QSvgHandler::LT_PT;
} else if (numStr.endsWith(QLatin1String("mm"))) {
numStr.chop(2);
type = QSvgHandler::LT_MM;
} else if (numStr.endsWith(QLatin1String("cm"))) {
numStr.chop(2);
type = QSvgHandler::LT_CM;
} else if (numStr.endsWith(QLatin1String("in"))) {
numStr.chop(2);
type = QSvgHandler::LT_IN;
} else {
type = handler->defaultCoordinateSystem();
//type = QSvgHandler::LT_OTHER;
}
qreal len = toDouble(numStr, ok);
//qDebug()<<"len is "<<len<<", from '"<<numStr << "'";
return len;
}
static inline qreal convertToNumber(const QString &str, QSvgHandler *handler, bool *ok = NULL)
{
QSvgHandler::LengthType type;
qreal num = parseLength(str, type, handler, ok);
if (type == QSvgHandler::LT_PERCENT) {
num = num/100.0;
}
return num;
}
static bool createSvgGlyph(QSvgFont *font, const QXmlStreamAttributes &attributes)
{
QStringRef uncStr = attributes.value(QLatin1String("unicode"));
QStringRef havStr = attributes.value(QLatin1String("horiz-adv-x"));
QStringRef pathStr = attributes.value(QLatin1String("d"));
QChar unicode = (uncStr.isEmpty()) ? 0 : uncStr.at(0);
qreal havx = (havStr.isEmpty()) ? -1 : toDouble(havStr);
QPainterPath path;
path.setFillRule(Qt::WindingFill);
parsePathDataFast(pathStr, path);
font->addGlyph(unicode, path, havx);
return true;
}
// this should really be called convertToDefaultCoordinateSystem
// and convert when type != QSvgHandler::defaultCoordinateSystem
static qreal convertToPixels(qreal len, bool , QSvgHandler::LengthType type)
{
switch (type) {
case QSvgHandler::LT_PERCENT:
break;
case QSvgHandler::LT_PX:
break;
case QSvgHandler::LT_PC:
break;
case QSvgHandler::LT_PT:
return len * 1.25;
break;
case QSvgHandler::LT_MM:
return len * 3.543307;
break;
case QSvgHandler::LT_CM:
return len * 35.43307;
break;
case QSvgHandler::LT_IN:
return len * 90;
break;
case QSvgHandler::LT_OTHER:
break;
default:
break;
}
return len;
}
static void parseColor(QSvgNode *,
const QSvgAttributes &attributes,
QSvgHandler *handler)
{
QColor color;
if (constructColor(attributes.color, attributes.colorOpacity, color, handler)) {
handler->popColor();
handler->pushColor(color);
}
}
static QSvgStyleProperty *styleFromUrl(QSvgNode *node, const QString &url)
{
return node ? node->styleProperty(idFromUrl(url)) : 0;
}
static void parseBrush(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *handler)
{
if (!attributes.fill.isEmpty() || !attributes.fillRule.isEmpty() || !attributes.fillOpacity.isEmpty()) {
QSvgFillStyle *prop = new QSvgFillStyle;
//fill-rule attribute handling
if (!attributes.fillRule.isEmpty() && attributes.fillRule != QT_INHERIT) {
if (attributes.fillRule == QLatin1String("evenodd"))
prop->setFillRule(Qt::OddEvenFill);
else if (attributes.fillRule == QLatin1String("nonzero"))
prop->setFillRule(Qt::WindingFill);
}
//fill-opacity atttribute handling
if (!attributes.fillOpacity.isEmpty() && attributes.fillOpacity != QT_INHERIT) {
prop->setFillOpacity(qMin(qreal(1.0), qMax(qreal(0.0), toDouble(attributes.fillOpacity))));
}
//fill attribute handling
if ((!attributes.fill.isEmpty()) && (attributes.fill != QT_INHERIT) ) {
if (attributes.fill.length() > 3 &&
QStringRef(attributes.fill.string(), attributes.fill.position(), 3) == QLatin1String("url")) {
QStringRef urlRef(attributes.fill.string(), attributes.fill.position() + 3, attributes.fill.length() - 3);
QString value = urlRef.toString();
QSvgStyleProperty *style = styleFromUrl(node, value);
if (style) {
if (style->type() == QSvgStyleProperty::SOLID_COLOR || style->type() == QSvgStyleProperty::GRADIENT)
prop->setFillStyle(reinterpret_cast<QSvgFillStyleProperty *>(style));
} else {
QString id = idFromUrl(value);
prop->setGradientId(id);
prop->setGradientResolved(false);
}
} else if (attributes.fill != QLatin1String("none")) {
QColor color;
if (resolveColor(attributes.fill, color, handler))
prop->setBrush(QBrush(color));
} else {
prop->setBrush(QBrush(Qt::NoBrush));
}
}
node->appendStyleProperty(prop, attributes.id);
}
}
static QMatrix parseTransformationMatrix(const QStringRef &value)
{
if (value.isEmpty())
return QMatrix();
QMatrix matrix;
const QChar *str = value.constData();
const QChar *end = str + value.length();
while (str < end) {
if (str->isSpace() || *str == QLatin1Char(',')) {
++str;
continue;
}
enum State {
Matrix,
Translate,
Rotate,
Scale,
SkewX,
SkewY
};
State state = Matrix;
if (*str == QLatin1Char('m')) { //matrix
const char *ident = "atrix";
for (int i = 0; i < 5; ++i)
if (*(++str) != QLatin1Char(ident[i]))
goto error;
++str;
state = Matrix;
} else if (*str == QLatin1Char('t')) { //translate
const char *ident = "ranslate";
for (int i = 0; i < 8; ++i)
if (*(++str) != QLatin1Char(ident[i]))
goto error;
++str;
state = Translate;
} else if (*str == QLatin1Char('r')) { //rotate
const char *ident = "otate";
for (int i = 0; i < 5; ++i)
if (*(++str) != QLatin1Char(ident[i]))
goto error;
++str;
state = Rotate;
} else if (*str == QLatin1Char('s')) { //scale, skewX, skewY
++str;
if (*str == QLatin1Char('c')) {
const char *ident = "ale";
for (int i = 0; i < 3; ++i)
if (*(++str) != QLatin1Char(ident[i]))
goto error;
++str;
state = Scale;
} else if (*str == QLatin1Char('k')) {
if (*(++str) != QLatin1Char('e'))
goto error;
if (*(++str) != QLatin1Char('w'))
goto error;
++str;
if (*str == QLatin1Char('X'))
state = SkewX;
else if (*str == QLatin1Char('Y'))
state = SkewY;
else
goto error;
++str;
} else {
goto error;
}
} else {
goto error;
}
while (str < end && str->isSpace())
++str;
if (*str != QLatin1Char('('))
goto error;
++str;
QVarLengthArray<qreal, 8> points;
parseNumbersArray(str, points);
if (*str != QLatin1Char(')'))
goto error;
++str;
if(state == Matrix) {
if(points.count() != 6)
goto error;
matrix = matrix * QMatrix(points[0], points[1],
points[2], points[3],
points[4], points[5]);
} else if (state == Translate) {
if (points.count() == 1)
matrix.translate(points[0], 0);
else if (points.count() == 2)
matrix.translate(points[0], points[1]);
else
goto error;
} else if (state == Rotate) {
if(points.count() == 1) {
matrix.rotate(points[0]);
} else if (points.count() == 3) {
matrix.translate(points[1], points[2]);
matrix.rotate(points[0]);
matrix.translate(-points[1], -points[2]);
} else {
goto error;
}
} else if (state == Scale) {
if (points.count() < 1 || points.count() > 2)
goto error;
qreal sx = points[0];
qreal sy = sx;
if(points.count() == 2)
sy = points[1];
matrix.scale(sx, sy);
} else if (state == SkewX) {
if (points.count() != 1)
goto error;
const qreal deg2rad = qreal(0.017453292519943295769);
matrix.shear(qTan(points[0]*deg2rad), 0);
} else if (state == SkewY) {
if (points.count() != 1)
goto error;
const qreal deg2rad = qreal(0.017453292519943295769);
matrix.shear(0, qTan(points[0]*deg2rad));
}
}
error:
return matrix;
}
static void parsePen(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *handler)
{
//qDebug()<<"Node "<<node->type()<<", attrs are "<<value<<width;
if (!attributes.stroke.isEmpty() || !attributes.strokeDashArray.isEmpty() || !attributes.strokeDashOffset.isEmpty() || !attributes.strokeLineCap.isEmpty()
|| !attributes.strokeLineJoin.isEmpty() || !attributes.strokeMiterLimit.isEmpty() || !attributes.strokeOpacity.isEmpty() || !attributes.strokeWidth.isEmpty()
|| !attributes.vectorEffect.isEmpty()) {
QSvgStrokeStyle *prop = new QSvgStrokeStyle;
//stroke attribute handling
if ((!attributes.stroke.isEmpty()) && (attributes.stroke != QT_INHERIT) ) {
if (attributes.stroke.length() > 3 &&
QStringRef(attributes.stroke.string(), attributes.stroke.position(), 3) == QLatin1String("url")) {
QStringRef urlRef(attributes.stroke.string(), attributes.stroke.position() + 3, attributes.stroke.length() - 3);
QString value = urlRef.toString();
QSvgStyleProperty *style = styleFromUrl(node, value);
if (style) {
if (style->type() == QSvgStyleProperty::SOLID_COLOR || style->type() == QSvgStyleProperty::GRADIENT)
prop->setStyle(reinterpret_cast<QSvgFillStyleProperty *>(style));
} else {
QString id = idFromUrl(value);
prop->setGradientId(id);
prop->setGradientResolved(false);
}
} else if (attributes.stroke != QLatin1String("none")) {
QColor color;
if (resolveColor(attributes.stroke, color, handler))
prop->setStroke(QBrush(color));
} else {
prop->setStroke(QBrush(Qt::NoBrush));
}
}
//stroke-width handling
if (!attributes.strokeWidth.isEmpty() && attributes.strokeWidth != QT_INHERIT) {
QSvgHandler::LengthType lt;
prop->setWidth(parseLength(attributes.strokeWidth.toString(), lt, handler));
}
//stroke-dasharray
if (!attributes.strokeDashArray.isEmpty() && attributes.strokeDashArray != QT_INHERIT) {
if (attributes.strokeDashArray == QLatin1String("none")) {
prop->setDashArrayNone();
} else {
QString dashArray = attributes.strokeDashArray.toString();
const QChar *s = dashArray.constData();
QVector<qreal> dashes = parseNumbersList(s);
// if the dash count is odd the dashes should be duplicated
if ((dashes.size() & 1) != 0)
dashes << QVector<qreal>(dashes);
prop->setDashArray(dashes);
}
}
//stroke-linejoin attribute handling
if (!attributes.strokeLineJoin.isEmpty()) {
if (attributes.strokeLineJoin == QLatin1String("miter"))
prop->setLineJoin(Qt::SvgMiterJoin);
else if (attributes.strokeLineJoin == QLatin1String("round"))
prop->setLineJoin(Qt::RoundJoin);
else if (attributes.strokeLineJoin == QLatin1String("bevel"))
prop->setLineJoin(Qt::BevelJoin);
}
//stroke-linecap attribute handling
if (!attributes.strokeLineCap.isEmpty()) {
if (attributes.strokeLineCap == QLatin1String("butt"))
prop->setLineCap(Qt::FlatCap);
else if (attributes.strokeLineCap == QLatin1String("round"))
prop->setLineCap(Qt::RoundCap);
else if (attributes.strokeLineCap == QLatin1String("square"))
prop->setLineCap(Qt::SquareCap);
}
//stroke-dashoffset attribute handling
if (!attributes.strokeDashOffset.isEmpty() && attributes.strokeDashOffset != QT_INHERIT)
prop->setDashOffset(toDouble(attributes.strokeDashOffset));
//vector-effect attribute handling
if (!attributes.vectorEffect.isEmpty()) {
if (attributes.vectorEffect == QLatin1String("non-scaling-stroke"))
prop->setVectorEffect(true);
else if (attributes.vectorEffect == QLatin1String("none"))
prop->setVectorEffect(false);
}
//stroke-miterlimit
if (!attributes.strokeMiterLimit.isEmpty() && attributes.strokeMiterLimit != QT_INHERIT)
prop->setMiterLimit(toDouble(attributes.strokeMiterLimit));
//stroke-opacity atttribute handling
if (!attributes.strokeOpacity.isEmpty() && attributes.strokeOpacity != QT_INHERIT)
prop->setOpacity(qMin(qreal(1.0), qMax(qreal(0.0), toDouble(attributes.strokeOpacity))));
node->appendStyleProperty(prop, attributes.id);
}
}
static void parseFont(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *handler)
{
if (attributes.fontFamily.isEmpty() && attributes.fontSize.isEmpty() && attributes.fontStyle.isEmpty() &&
attributes.fontWeight.isEmpty() && attributes.fontVariant.isEmpty() && attributes.textAnchor.isEmpty())
return;
QSvgTinyDocument *doc = node->document();
QSvgFontStyle *fontStyle = 0;
if (!attributes.fontFamily.isEmpty()) {
QSvgFont *svgFont = doc->svgFont(attributes.fontFamily.toString());
if (svgFont)
fontStyle = new QSvgFontStyle(svgFont, doc);
}
if (!fontStyle)
fontStyle = new QSvgFontStyle;
if (!attributes.fontFamily.isEmpty() && attributes.fontFamily != QT_INHERIT)
fontStyle->setFamily(attributes.fontFamily.toString().trimmed());
if (!attributes.fontSize.isEmpty() && attributes.fontSize != QT_INHERIT) {
// TODO: Support relative sizes 'larger' and 'smaller'.
QSvgHandler::LengthType dummy; // should always be pixel size
qreal size = 0;
static const qreal sizeTable[] = { qreal(6.9), qreal(8.3), qreal(10.0), qreal(12.0), qreal(14.4), qreal(17.3), qreal(20.7) };
enum AbsFontSize { XXSmall, XSmall, Small, Medium, Large, XLarge, XXLarge };
switch (attributes.fontSize.at(0).unicode()) {
case 'x':
if (attributes.fontSize == QLatin1String("xx-small"))
size = sizeTable[XXSmall];
else if (attributes.fontSize == QLatin1String("x-small"))
size = sizeTable[XSmall];
else if (attributes.fontSize == QLatin1String("x-large"))
size = sizeTable[XLarge];
else if (attributes.fontSize == QLatin1String("xx-large"))
size = sizeTable[XXLarge];
break;
case 's':
if (attributes.fontSize == QLatin1String("small"))
size = sizeTable[Small];
break;
case 'm':
if (attributes.fontSize == QLatin1String("medium"))
size = sizeTable[Medium];
break;
case 'l':
if (attributes.fontSize == QLatin1String("large"))
size = sizeTable[Large];
break;
default:
size = parseLength(attributes.fontSize.toString(), dummy, handler);
break;
}
fontStyle->setSize(size);
}
if (!attributes.fontStyle.isEmpty() && attributes.fontStyle != QT_INHERIT) {
if (attributes.fontStyle == QLatin1String("normal")) {
fontStyle->setStyle(QFont::StyleNormal);
} else if (attributes.fontStyle == QLatin1String("italic")) {
fontStyle->setStyle(QFont::StyleItalic);
} else if (attributes.fontStyle == QLatin1String("oblique")) {
fontStyle->setStyle(QFont::StyleOblique);
}
}
if (!attributes.fontWeight.isEmpty() && attributes.fontWeight != QT_INHERIT) {
bool ok = false;
int weightNum = attributes.fontWeight.toString().toInt(&ok);
if (ok) {
fontStyle->setWeight(weightNum);
} else {
if (attributes.fontWeight == QLatin1String("normal")) {
fontStyle->setWeight(400);
} else if (attributes.fontWeight == QLatin1String("bold")) {
fontStyle->setWeight(700);
} else if (attributes.fontWeight == QLatin1String("bolder")) {
fontStyle->setWeight(QSvgFontStyle::BOLDER);
} else if (attributes.fontWeight == QLatin1String("lighter")) {
fontStyle->setWeight(QSvgFontStyle::LIGHTER);
}
}
}
if (!attributes.fontVariant.isEmpty() && attributes.fontVariant != QT_INHERIT) {
if (attributes.fontVariant == QLatin1String("normal"))
fontStyle->setVariant(QFont::MixedCase);
else if (attributes.fontVariant == QLatin1String("small-caps"))
fontStyle->setVariant(QFont::SmallCaps);
}
if (!attributes.textAnchor.isEmpty() && attributes.textAnchor != QT_INHERIT) {
if (attributes.textAnchor == QLatin1String("start"))
fontStyle->setTextAnchor(Qt::AlignLeft);
if (attributes.textAnchor == QLatin1String("middle"))
fontStyle->setTextAnchor(Qt::AlignHCenter);
else if (attributes.textAnchor == QLatin1String("end"))
fontStyle->setTextAnchor(Qt::AlignRight);
}
node->appendStyleProperty(fontStyle, attributes.id);
}
static void parseTransform(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *)
{
if (attributes.transform.isEmpty())
return;
QMatrix matrix = parseTransformationMatrix(trimRef(attributes.transform));
if (!matrix.isIdentity()) {
node->appendStyleProperty(new QSvgTransformStyle(QTransform(matrix)), attributes.id);
}
}
static void parseVisibility(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *)
{
QSvgNode *parent = node->parent();
if (parent && (attributes.visibility.isEmpty() || attributes.visibility == QT_INHERIT))
node->setVisible(parent->isVisible());
else if (attributes.visibility == QLatin1String("hidden") || attributes.visibility == QLatin1String("collapse")) {
node->setVisible(false);
} else
node->setVisible(true);
}
static void pathArcSegment(QPainterPath &path,
qreal xc, qreal yc,
qreal th0, qreal th1,
qreal rx, qreal ry, qreal xAxisRotation)
{
qreal sinTh, cosTh;
qreal a00, a01, a10, a11;
qreal x1, y1, x2, y2, x3, y3;
qreal t;
qreal thHalf;
sinTh = qSin(xAxisRotation * (Q_PI / 180.0));
cosTh = qCos(xAxisRotation * (Q_PI / 180.0));
a00 = cosTh * rx;
a01 = -sinTh * ry;
a10 = sinTh * rx;
a11 = cosTh * ry;
thHalf = 0.5 * (th1 - th0);
t = (8.0 / 3.0) * qSin(thHalf * 0.5) * qSin(thHalf * 0.5) / qSin(thHalf);
x1 = xc + qCos(th0) - t * qSin(th0);
y1 = yc + qSin(th0) + t * qCos(th0);
x3 = xc + qCos(th1);
y3 = yc + qSin(th1);
x2 = x3 + t * qSin(th1);
y2 = y3 - t * qCos(th1);
path.cubicTo(a00 * x1 + a01 * y1, a10 * x1 + a11 * y1,
a00 * x2 + a01 * y2, a10 * x2 + a11 * y2,
a00 * x3 + a01 * y3, a10 * x3 + a11 * y3);
}
// the arc handling code underneath is from XSVG (BSD license)
/*
* Copyright 2002 USC/Information Sciences Institute
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice
* appear in supporting documentation, and that the name of
* Information Sciences Institute not be used in advertising or
* publicity pertaining to distribution of the software without
* specific, written prior permission. Information Sciences Institute
* makes no representations about the suitability of this software for
* any purpose. It is provided "as is" without express or implied
* warranty.
*
* INFORMATION SCIENCES INSTITUTE DISCLAIMS ALL WARRANTIES WITH REGARD
* TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL INFORMATION SCIENCES
* INSTITUTE BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA
* OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*
*/
static void pathArc(QPainterPath &path,
qreal rx,
qreal ry,
qreal x_axis_rotation,
int large_arc_flag,
int sweep_flag,
qreal x,
qreal y,
qreal curx, qreal cury)
{
qreal sin_th, cos_th;
qreal a00, a01, a10, a11;
qreal x0, y0, x1, y1, xc, yc;
qreal d, sfactor, sfactor_sq;
qreal th0, th1, th_arc;
int i, n_segs;
qreal dx, dy, dx1, dy1, Pr1, Pr2, Px, Py, check;
rx = qAbs(rx);
ry = qAbs(ry);
sin_th = qSin(x_axis_rotation * (Q_PI / 180.0));
cos_th = qCos(x_axis_rotation * (Q_PI / 180.0));
dx = (curx - x) / 2.0;
dy = (cury - y) / 2.0;
dx1 = cos_th * dx + sin_th * dy;
dy1 = -sin_th * dx + cos_th * dy;
Pr1 = rx * rx;
Pr2 = ry * ry;
Px = dx1 * dx1;
Py = dy1 * dy1;
/* Spec : check if radii are large enough */
check = Px / Pr1 + Py / Pr2;
if (check > 1) {
rx = rx * qSqrt(check);
ry = ry * qSqrt(check);
}
a00 = cos_th / rx;
a01 = sin_th / rx;
a10 = -sin_th / ry;
a11 = cos_th / ry;
x0 = a00 * curx + a01 * cury;
y0 = a10 * curx + a11 * cury;
x1 = a00 * x + a01 * y;
y1 = a10 * x + a11 * y;
/* (x0, y0) is current point in transformed coordinate space.
(x1, y1) is new point in transformed coordinate space.
The arc fits a unit-radius circle in this space.
*/
d = (x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0);
sfactor_sq = 1.0 / d - 0.25;
if (sfactor_sq < 0) sfactor_sq = 0;
sfactor = qSqrt(sfactor_sq);
if (sweep_flag == large_arc_flag) sfactor = -sfactor;
xc = 0.5 * (x0 + x1) - sfactor * (y1 - y0);
yc = 0.5 * (y0 + y1) + sfactor * (x1 - x0);
/* (xc, yc) is center of the circle. */
th0 = qAtan2(y0 - yc, x0 - xc);
th1 = qAtan2(y1 - yc, x1 - xc);
th_arc = th1 - th0;
if (th_arc < 0 && sweep_flag)
th_arc += 2 * Q_PI;
else if (th_arc > 0 && !sweep_flag)
th_arc -= 2 * Q_PI;
n_segs = qCeil(qAbs(th_arc / (Q_PI * 0.5 + 0.001)));
for (i = 0; i < n_segs; i++) {
pathArcSegment(path, xc, yc,
th0 + i * th_arc / n_segs,
th0 + (i + 1) * th_arc / n_segs,
rx, ry, x_axis_rotation);
}
}
static bool parsePathDataFast(const QStringRef &dataStr, QPainterPath &path)
{
qreal x0 = 0, y0 = 0; // starting point
qreal x = 0, y = 0; // current point
char lastMode = 0;
QPointF ctrlPt;
const QChar *str = dataStr.constData();
const QChar *end = str + dataStr.size();
while (str != end) {
while (str->isSpace())
++str;
QChar pathElem = *str;
++str;
QChar endc = *end;
*const_cast<QChar *>(end) = 0; // parseNumbersArray requires 0-termination that QStringRef cannot guarantee
QVarLengthArray<qreal, 8> arg;
parseNumbersArray(str, arg);
*const_cast<QChar *>(end) = endc;
if (pathElem == QLatin1Char('z') || pathElem == QLatin1Char('Z'))
arg.append(0);//dummy
const qreal *num = arg.constData();
int count = arg.count();
while (count > 0) {
qreal offsetX = x; // correction offsets
qreal offsetY = y; // for relative commands
switch (pathElem.unicode()) {
case 'm': {
if (count < 2) {
num++;
count--;
break;
}
x = x0 = num[0] + offsetX;
y = y0 = num[1] + offsetY;
num += 2;
count -= 2;
path.moveTo(x0, y0);
// As per 1.2 spec 8.3.2 The "moveto" commands
// If a 'moveto' is followed by multiple pairs of coordinates without explicit commands,
// the subsequent pairs shall be treated as implicit 'lineto' commands.
pathElem = QLatin1Char('l');
}
break;
case 'M': {
if (count < 2) {
num++;
count--;
break;
}
x = x0 = num[0];
y = y0 = num[1];
num += 2;
count -= 2;
path.moveTo(x0, y0);
// As per 1.2 spec 8.3.2 The "moveto" commands
// If a 'moveto' is followed by multiple pairs of coordinates without explicit commands,
// the subsequent pairs shall be treated as implicit 'lineto' commands.
pathElem = QLatin1Char('L');
}
break;
case 'z':
case 'Z': {
x = x0;
y = y0;
count--; // skip dummy
num++;
path.closeSubpath();
}
break;
case 'l': {
if (count < 2) {
num++;
count--;
break;
}
x = num[0] + offsetX;
y = num[1] + offsetY;
num += 2;
count -= 2;
path.lineTo(x, y);
}
break;
case 'L': {
if (count < 2) {
num++;
count--;
break;
}
x = num[0];
y = num[1];
num += 2;
count -= 2;
path.lineTo(x, y);
}
break;
case 'h': {
x = num[0] + offsetX;
num++;
count--;
path.lineTo(x, y);
}
break;
case 'H': {
x = num[0];
num++;
count--;
path.lineTo(x, y);
}
break;
case 'v': {
y = num[0] + offsetY;
num++;
count--;
path.lineTo(x, y);
}
break;
case 'V': {
y = num[0];
num++;
count--;
path.lineTo(x, y);
}
break;
case 'c': {
if (count < 6) {
num += count;
count = 0;
break;
}
QPointF c1(num[0] + offsetX, num[1] + offsetY);
QPointF c2(num[2] + offsetX, num[3] + offsetY);
QPointF e(num[4] + offsetX, num[5] + offsetY);
num += 6;
count -= 6;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 'C': {
if (count < 6) {
num += count;
count = 0;
break;
}
QPointF c1(num[0], num[1]);
QPointF c2(num[2], num[3]);
QPointF e(num[4], num[5]);
num += 6;
count -= 6;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 's': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c1;
if (lastMode == 'c' || lastMode == 'C' ||
lastMode == 's' || lastMode == 'S')
c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c1 = QPointF(x, y);
QPointF c2(num[0] + offsetX, num[1] + offsetY);
QPointF e(num[2] + offsetX, num[3] + offsetY);
num += 4;
count -= 4;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 'S': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c1;
if (lastMode == 'c' || lastMode == 'C' ||
lastMode == 's' || lastMode == 'S')
c1 = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c1 = QPointF(x, y);
QPointF c2(num[0], num[1]);
QPointF e(num[2], num[3]);
num += 4;
count -= 4;
path.cubicTo(c1, c2, e);
ctrlPt = c2;
x = e.x();
y = e.y();
break;
}
case 'q': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c(num[0] + offsetX, num[1] + offsetY);
QPointF e(num[2] + offsetX, num[3] + offsetY);
num += 4;
count -= 4;
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 'Q': {
if (count < 4) {
num += count;
count = 0;
break;
}
QPointF c(num[0], num[1]);
QPointF e(num[2], num[3]);
num += 4;
count -= 4;
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 't': {
if (count < 2) {
num += count;
count = 0;
break;
}
QPointF e(num[0] + offsetX, num[1] + offsetY);
num += 2;
count -= 2;
QPointF c;
if (lastMode == 'q' || lastMode == 'Q' ||
lastMode == 't' || lastMode == 'T')
c = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c = QPointF(x, y);
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 'T': {
if (count < 2) {
num += count;
count = 0;
break;
}
QPointF e(num[0], num[1]);
num += 2;
count -= 2;
QPointF c;
if (lastMode == 'q' || lastMode == 'Q' ||
lastMode == 't' || lastMode == 'T')
c = QPointF(2*x-ctrlPt.x(), 2*y-ctrlPt.y());
else
c = QPointF(x, y);
path.quadTo(c, e);
ctrlPt = c;
x = e.x();
y = e.y();
break;
}
case 'a': {
if (count < 7) {
num += count;
count = 0;
break;
}
qreal rx = (*num++);
qreal ry = (*num++);
qreal xAxisRotation = (*num++);
qreal largeArcFlag = (*num++);
qreal sweepFlag = (*num++);
qreal ex = (*num++) + offsetX;
qreal ey = (*num++) + offsetY;
count -= 7;
qreal curx = x;
qreal cury = y;
pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag),
int(sweepFlag), ex, ey, curx, cury);
x = ex;
y = ey;
}
break;
case 'A': {
if (count < 7) {
num += count;
count = 0;
break;
}
qreal rx = (*num++);
qreal ry = (*num++);
qreal xAxisRotation = (*num++);
qreal largeArcFlag = (*num++);
qreal sweepFlag = (*num++);
qreal ex = (*num++);
qreal ey = (*num++);
count -= 7;
qreal curx = x;
qreal cury = y;
pathArc(path, rx, ry, xAxisRotation, int(largeArcFlag),
int(sweepFlag), ex, ey, curx, cury);
x = ex;
y = ey;
}
break;
default:
return false;
}
lastMode = pathElem.toLatin1();
}
}
return true;
}
static bool parseStyle(QSvgNode *node,
const QXmlStreamAttributes &attributes,
QSvgHandler *);
static bool parseStyle(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *);
#ifndef QT_NO_CSSPARSER
static void parseCSStoXMLAttrs(const QVector<QCss::Declaration> &declarations,
QXmlStreamAttributes &attributes)
{
for (int i = 0; i < declarations.count(); ++i) {
const QCss::Declaration &decl = declarations.at(i);
if (decl.d->property.isEmpty())
continue;
QCss::Value val = decl.d->values.first();
QString valueStr;
if (decl.d->values.count() != 1) {
for (int i=0; i<decl.d->values.count(); ++i) {
const QString &value = decl.d->values[i].toString();
if (value.isEmpty())
valueStr += QLatin1Char(',');
else
valueStr += value;
}
} else {
valueStr = val.toString();
}
if (val.type == QCss::Value::Uri) {
valueStr.prepend(QLatin1String("url("));
valueStr.append(QLatin1Char(')'));
} else if (val.type == QCss::Value::Function) {
QStringList lst = val.variant.toStringList();
valueStr.append(lst.at(0));
valueStr.append(QLatin1Char('('));
for (int i = 1; i < lst.count(); ++i) {
valueStr.append(lst.at(i));
if ((i +1) < lst.count())
valueStr.append(QLatin1Char(','));
}
valueStr.append(QLatin1Char(')'));
} else if (val.type == QCss::Value::KnownIdentifier) {
switch (val.variant.toInt()) {
case QCss::Value_None:
valueStr = QLatin1String("none");
break;
default:
break;
}
}
attributes.append(QString(), decl.d->property, valueStr);
}
}
void QSvgHandler::parseCSStoXMLAttrs(QString css, QVector<QSvgCssAttribute> *attributes)
{
// preprocess (for unicode escapes), tokenize and remove comments
m_cssParser.init(css);
QString key;
attributes->reserve(10);
while (m_cssParser.hasNext()) {
m_cssParser.skipSpace();
if (!m_cssParser.hasNext())
break;
m_cssParser.next();
QStringRef name;
if (m_cssParser.hasEscapeSequences) {
key = m_cssParser.lexem();
name = QStringRef(&key, 0, key.length());
} else {
const QCss::Symbol &sym = m_cssParser.symbol();
name = QStringRef(&sym.text, sym.start, sym.len);
}
m_cssParser.skipSpace();
if (!m_cssParser.test(QCss::COLON))
break;
m_cssParser.skipSpace();
if (!m_cssParser.hasNext())
break;
QSvgCssAttribute attribute;
attribute.name = QXmlStreamStringRef(name);
const int firstSymbol = m_cssParser.index;
int symbolCount = 0;
do {
m_cssParser.next();
++symbolCount;
} while (m_cssParser.hasNext() && !m_cssParser.test(QCss::SEMICOLON));
bool canExtractValueByRef = !m_cssParser.hasEscapeSequences;
if (canExtractValueByRef) {
int len = m_cssParser.symbols.at(firstSymbol).len;
for (int i = firstSymbol + 1; i < firstSymbol + symbolCount; ++i) {
len += m_cssParser.symbols.at(i).len;
if (m_cssParser.symbols.at(i - 1).start + m_cssParser.symbols.at(i - 1).len
!= m_cssParser.symbols.at(i).start) {
canExtractValueByRef = false;
break;
}
}
if (canExtractValueByRef) {
const QCss::Symbol &sym = m_cssParser.symbols.at(firstSymbol);
attribute.value = QXmlStreamStringRef(QStringRef(&sym.text, sym.start, len));
}
}
if (!canExtractValueByRef) {
QString value;
for (int i = firstSymbol; i < m_cssParser.index - 1; ++i)
value += m_cssParser.symbols.at(i).lexem();
attribute.value = QXmlStreamStringRef(QStringRef(&value, 0, value.length()));
}
attributes->append(attribute);
m_cssParser.skipSpace();
}
}
static void cssStyleLookup(QSvgNode *node,
QSvgHandler *handler,
QSvgStyleSelector *selector)
{
QCss::StyleSelector::NodePtr cssNode;
cssNode.ptr = node;
QVector<QCss::Declaration> decls = selector->declarationsForNode(cssNode);
QXmlStreamAttributes attributes;
parseCSStoXMLAttrs(decls, attributes);
parseStyle(node, attributes, handler);
}
#endif // QT_NO_CSSPARSER
static inline QStringList stringToList(const QString &str)
{
QStringList lst = str.split(QLatin1Char(','), QString::SkipEmptyParts);
return lst;
}
static bool parseCoreNode(QSvgNode *node,
const QXmlStreamAttributes &attributes)
{
QStringList features;
QStringList extensions;
QStringList languages;
QStringList formats;
QStringList fonts;
QString xmlClassStr;
for (int i = 0; i < attributes.count(); ++i) {
const QXmlStreamAttribute &attribute = attributes.at(i);
QStringRef name = attribute.qualifiedName();
if (name.isEmpty())
continue;
QStringRef value = attribute.value();
switch (name.at(0).unicode()) {
case 'c':
if (name == QLatin1String("class"))
xmlClassStr = value.toString();
break;
case 'r':
if (name == QLatin1String("requiredFeatures"))
features = stringToList(value.toString());
else if (name == QLatin1String("requiredExtensions"))
extensions = stringToList(value.toString());
else if (name == QLatin1String("requiredFormats"))
formats = stringToList(value.toString());
else if (name == QLatin1String("requiredFonts"))
fonts = stringToList(value.toString());
break;
case 's':
if (name == QLatin1String("systemLanguage"))
languages = stringToList(value.toString());
break;
default:
break;
}
}
node->setRequiredFeatures(features);
node->setRequiredExtensions(extensions);
node->setRequiredLanguages(languages);
node->setRequiredFormats(formats);
node->setRequiredFonts(fonts);
node->setNodeId(someId(attributes));
node->setXmlClass(xmlClassStr);
return true;
}
static void parseOpacity(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *)
{
if (attributes.opacity.isEmpty())
return;
const QString value = attributes.opacity.toString().trimmed();
bool ok = false;
qreal op = value.toDouble(&ok);
if (ok) {
QSvgOpacityStyle *opacity = new QSvgOpacityStyle(qBound(qreal(0.0), op, qreal(1.0)));
node->appendStyleProperty(opacity, attributes.id);
}
}
static QPainter::CompositionMode svgToQtCompositionMode(const QString &op)
{
#define NOOP qDebug()<<"Operation: "<<op<<" is not implemented"
if (op == QLatin1String("clear")) {
return QPainter::CompositionMode_Clear;
} else if (op == QLatin1String("src")) {
return QPainter::CompositionMode_Source;
} else if (op == QLatin1String("dst")) {
return QPainter::CompositionMode_Destination;
} else if (op == QLatin1String("src-over")) {
return QPainter::CompositionMode_SourceOver;
} else if (op == QLatin1String("dst-over")) {
return QPainter::CompositionMode_DestinationOver;
} else if (op == QLatin1String("src-in")) {
return QPainter::CompositionMode_SourceIn;
} else if (op == QLatin1String("dst-in")) {
return QPainter::CompositionMode_DestinationIn;
} else if (op == QLatin1String("src-out")) {
return QPainter::CompositionMode_SourceOut;
} else if (op == QLatin1String("dst-out")) {
return QPainter::CompositionMode_DestinationOut;
} else if (op == QLatin1String("src-atop")) {
return QPainter::CompositionMode_SourceAtop;
} else if (op == QLatin1String("dst-atop")) {
return QPainter::CompositionMode_DestinationAtop;
} else if (op == QLatin1String("xor")) {
return QPainter::CompositionMode_Xor;
} else if (op == QLatin1String("plus")) {
return QPainter::CompositionMode_Plus;
} else if (op == QLatin1String("multiply")) {
return QPainter::CompositionMode_Multiply;
} else if (op == QLatin1String("screen")) {
return QPainter::CompositionMode_Screen;
} else if (op == QLatin1String("overlay")) {
return QPainter::CompositionMode_Overlay;
} else if (op == QLatin1String("darken")) {
return QPainter::CompositionMode_Darken;
} else if (op == QLatin1String("lighten")) {
return QPainter::CompositionMode_Lighten;
} else if (op == QLatin1String("color-dodge")) {
return QPainter::CompositionMode_ColorDodge;
} else if (op == QLatin1String("color-burn")) {
return QPainter::CompositionMode_ColorBurn;
} else if (op == QLatin1String("hard-light")) {
return QPainter::CompositionMode_HardLight;
} else if (op == QLatin1String("soft-light")) {
return QPainter::CompositionMode_SoftLight;
} else if (op == QLatin1String("difference")) {
return QPainter::CompositionMode_Difference;
} else if (op == QLatin1String("exclusion")) {
return QPainter::CompositionMode_Exclusion;
} else {
NOOP;
}
return QPainter::CompositionMode_SourceOver;
}
static void parseCompOp(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *)
{
if (attributes.compOp.isEmpty())
return;
QString value = attributes.compOp.toString().trimmed();
if (!value.isEmpty()) {
QSvgCompOpStyle *compop = new QSvgCompOpStyle(svgToQtCompositionMode(value));
node->appendStyleProperty(compop, attributes.id);
}
}
static inline QSvgNode::DisplayMode displayStringToEnum(const QString &str)
{
if (str == QLatin1String("inline")) {
return QSvgNode::InlineMode;
} else if (str == QLatin1String("block")) {
return QSvgNode::BlockMode;
} else if (str == QLatin1String("list-item")) {
return QSvgNode::ListItemMode;
} else if (str == QLatin1String("run-in")) {
return QSvgNode::RunInMode;
} else if (str == QLatin1String("compact")) {
return QSvgNode::CompactMode;
} else if (str == QLatin1String("marker")) {
return QSvgNode::MarkerMode;
} else if (str == QLatin1String("table")) {
return QSvgNode::TableMode;
} else if (str == QLatin1String("inline-table")) {
return QSvgNode::InlineTableMode;
} else if (str == QLatin1String("table-row")) {
return QSvgNode::TableRowGroupMode;
} else if (str == QLatin1String("table-header-group")) {
return QSvgNode::TableHeaderGroupMode;
} else if (str == QLatin1String("table-footer-group")) {
return QSvgNode::TableFooterGroupMode;
} else if (str == QLatin1String("table-row")) {
return QSvgNode::TableRowMode;
} else if (str == QLatin1String("table-column-group")) {
return QSvgNode::TableColumnGroupMode;
} else if (str == QLatin1String("table-column")) {
return QSvgNode::TableColumnMode;
} else if (str == QLatin1String("table-cell")) {
return QSvgNode::TableCellMode;
} else if (str == QLatin1String("table-caption")) {
return QSvgNode::TableCaptionMode;
} else if (str == QLatin1String("none")) {
return QSvgNode::NoneMode;
} else if (str == QT_INHERIT) {
return QSvgNode::InheritMode;
}
return QSvgNode::BlockMode;
}
static void parseOthers(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *)
{
if (attributes.display.isEmpty())
return;
QString displayStr = attributes.display.toString().trimmed();
if (!displayStr.isEmpty()) {
node->setDisplayMode(displayStringToEnum(displayStr));
}
}
static bool parseStyle(QSvgNode *node,
const QSvgAttributes &attributes,
QSvgHandler *handler)
{
parseColor(node, attributes, handler);
parseBrush(node, attributes, handler);
parsePen(node, attributes, handler);
parseFont(node, attributes, handler);
parseTransform(node, attributes, handler);
parseVisibility(node, attributes, handler);
parseOpacity(node, attributes, handler);
parseCompOp(node, attributes, handler);
parseOthers(node, attributes, handler);
#if 0
value = attributes.value("audio-level");
value = attributes.value("color-rendering");
value = attributes.value("display-align");
value = attributes.value("image-rendering");
value = attributes.value("line-increment");
value = attributes.value("pointer-events");
value = attributes.value("shape-rendering");
value = attributes.value("solid-color");
value = attributes.value("solid-opacity");
value = attributes.value("text-rendering");
value = attributes.value("vector-effect");
value = attributes.value("viewport-fill");
value = attributes.value("viewport-fill-opacity");
#endif
return true;
}
static bool parseStyle(QSvgNode *node,
const QXmlStreamAttributes &attrs,
QSvgHandler *handler)
{
return parseStyle(node, QSvgAttributes(attrs, handler), handler);
}
static bool parseAnchorNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseAnimateNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseAnimateColorNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString typeStr = attributes.value(QLatin1String("type")).toString();
QStringRef fromStr = attributes.value(QLatin1String("from"));
QStringRef toStr = attributes.value(QLatin1String("to"));
QString valuesStr = attributes.value(QLatin1String("values")).toString();
QString beginStr = attributes.value(QLatin1String("begin")).toString();
QString durStr = attributes.value(QLatin1String("dur")).toString();
QString targetStr = attributes.value(QLatin1String("attributeName")).toString();
QString repeatStr = attributes.value(QLatin1String("repeatCount")).toString();
QString fillStr = attributes.value(QLatin1String("fill")).toString();
QList<QColor> colors;
if (valuesStr.isEmpty()) {
QColor startColor, endColor;
resolveColor(fromStr, startColor, handler);
resolveColor(toStr, endColor, handler);
colors.reserve(2);
colors.append(startColor);
colors.append(endColor);
} else {
QStringList str = valuesStr.split(QLatin1Char(';'));
colors.reserve(str.count());
QStringList::const_iterator itr;
for (itr = str.constBegin(); itr != str.constEnd(); ++itr) {
QColor color;
QString str = *itr;
resolveColor(QStringRef(&str), color, handler);
colors.append(color);
}
}
int ms = 1000;
beginStr = beginStr.trimmed();
if (beginStr.endsWith(QLatin1String("ms"))) {
beginStr.chop(2);
ms = 1;
} else if (beginStr.endsWith(QLatin1String("s"))) {
beginStr.chop(1);
}
durStr = durStr.trimmed();
if (durStr.endsWith(QLatin1String("ms"))) {
durStr.chop(2);
ms = 1;
} else if (durStr.endsWith(QLatin1String("s"))) {
durStr.chop(1);
}
int begin = static_cast<int>(toDouble(beginStr) * ms);
int end = static_cast<int>((toDouble(durStr) + begin) * ms);
QSvgAnimateColor *anim = new QSvgAnimateColor(begin, end, 0);
anim->setArgs((targetStr == QLatin1String("fill")), colors);
anim->setFreeze(fillStr == QLatin1String("freeze"));
anim->setRepeatCount(
(repeatStr == QLatin1String("indefinite")) ? -1 :
(repeatStr == QLatin1String("")) ? 1 : toDouble(repeatStr));
parent->appendStyleProperty(anim, someId(attributes));
parent->document()->setAnimated(true);
handler->setAnimPeriod(begin, end);
return true;
}
static bool parseAimateMotionNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static void parseNumberTriplet(QVector<qreal> &values, const QChar *&s)
{
QVector<qreal> list = parseNumbersList(s);
values << list;
for (int i = 3 - list.size(); i > 0; --i)
values.append(0.0);
}
static bool parseAnimateTransformNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString typeStr = attributes.value(QLatin1String("type")).toString();
QString values = attributes.value(QLatin1String("values")).toString();
QString beginStr = attributes.value(QLatin1String("begin")).toString();
QString durStr = attributes.value(QLatin1String("dur")).toString();
QString targetStr = attributes.value(QLatin1String("attributeName")).toString();
QString repeatStr = attributes.value(QLatin1String("repeatCount")).toString();
QString fillStr = attributes.value(QLatin1String("fill")).toString();
QString fromStr = attributes.value(QLatin1String("from")).toString();
QString toStr = attributes.value(QLatin1String("to")).toString();
QString byStr = attributes.value(QLatin1String("by")).toString();
QString addtv = attributes.value(QLatin1String("additive")).toString();
QSvgAnimateTransform::Additive additive = QSvgAnimateTransform::Replace;
if (addtv == QLatin1String("sum"))
additive = QSvgAnimateTransform::Sum;
QVector<qreal> vals;
if (values.isEmpty()) {
const QChar *s;
if (fromStr.isEmpty()) {
if (!byStr.isEmpty()) {
// By-animation.
additive = QSvgAnimateTransform::Sum;
vals.append(0.0);
vals.append(0.0);
vals.append(0.0);
parseNumberTriplet(vals, s = byStr.constData());
} else {
// To-animation not defined.
return false;
}
} else {
if (!toStr.isEmpty()) {
// From-to-animation.
parseNumberTriplet(vals, s = fromStr.constData());
parseNumberTriplet(vals, s = toStr.constData());
} else if (!byStr.isEmpty()) {
// From-by-animation.
parseNumberTriplet(vals, s = fromStr.constData());
parseNumberTriplet(vals, s = byStr.constData());
for (int i = vals.size() - 3; i < vals.size(); ++i)
vals[i] += vals[i - 3];
} else {
return false;
}
}
} else {
const QChar *s = values.constData();
while (s && *s != QLatin1Char(0)) {
parseNumberTriplet(vals, s);
if (*s == QLatin1Char(0))
break;
++s;
}
}
int ms = 1000;
beginStr = beginStr.trimmed();
if (beginStr.endsWith(QLatin1String("ms"))) {
beginStr.chop(2);
ms = 1;
} else if (beginStr.endsWith(QLatin1String("s"))) {
beginStr.chop(1);
}
int begin = static_cast<int>(toDouble(beginStr) * ms);
durStr = durStr.trimmed();
if (durStr.endsWith(QLatin1String("ms"))) {
durStr.chop(2);
ms = 1;
} else if (durStr.endsWith(QLatin1String("s"))) {
durStr.chop(1);
ms = 1000;
}
int end = static_cast<int>(toDouble(durStr)*ms) + begin;
QSvgAnimateTransform::TransformType type = QSvgAnimateTransform::Empty;
if (typeStr == QLatin1String("translate")) {
type = QSvgAnimateTransform::Translate;
} else if (typeStr == QLatin1String("scale")) {
type = QSvgAnimateTransform::Scale;
} else if (typeStr == QLatin1String("rotate")) {
type = QSvgAnimateTransform::Rotate;
} else if (typeStr == QLatin1String("skewX")) {
type = QSvgAnimateTransform::SkewX;
} else if (typeStr == QLatin1String("skewY")) {
type = QSvgAnimateTransform::SkewY;
} else {
return false;
}
QSvgAnimateTransform *anim = new QSvgAnimateTransform(begin, end, 0);
anim->setArgs(type, additive, vals);
anim->setFreeze(fillStr == QLatin1String("freeze"));
anim->setRepeatCount(
(repeatStr == QLatin1String("indefinite"))? -1 :
(repeatStr == QLatin1String(""))? 1 : toDouble(repeatStr));
parent->appendStyleProperty(anim, someId(attributes));
parent->document()->setAnimated(true);
handler->setAnimPeriod(begin, end);
return true;
}
static QSvgNode * createAnimationNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return 0;
}
static bool parseAudioNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgNode *createCircleNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QString cx = attributes.value(QLatin1String("cx")).toString();
QString cy = attributes.value(QLatin1String("cy")).toString();
QString r = attributes.value(QLatin1String("r")).toString();
qreal ncx = toDouble(cx);
qreal ncy = toDouble(cy);
qreal nr = toDouble(r);
QRectF rect(ncx-nr, ncy-nr, nr*2, nr*2);
QSvgNode *circle = new QSvgCircle(parent, rect);
return circle;
}
static QSvgNode *createDefsNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(attributes);
QSvgDefs *defs = new QSvgDefs(parent);
return defs;
}
static bool parseDescNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseDiscardNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgNode *createEllipseNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QString cx = attributes.value(QLatin1String("cx")).toString();
QString cy = attributes.value(QLatin1String("cy")).toString();
QString rx = attributes.value(QLatin1String("rx")).toString();
QString ry = attributes.value(QLatin1String("ry")).toString();
qreal ncx = toDouble(cx);
qreal ncy = toDouble(cy);
qreal nrx = toDouble(rx);
qreal nry = toDouble(ry);
QRectF rect(ncx-nrx, ncy-nry, nrx*2, nry*2);
QSvgNode *ellipse = new QSvgEllipse(parent, rect);
return ellipse;
}
static QSvgStyleProperty *createFontNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QString hax = attributes.value(QLatin1String("horiz-adv-x")).toString();
QString myId = someId(attributes);
qreal horizAdvX = toDouble(hax);
while (parent && parent->type() != QSvgNode::DOC) {
parent = parent->parent();
}
if (parent) {
QSvgTinyDocument *doc = static_cast<QSvgTinyDocument*>(parent);
QSvgFont *font = new QSvgFont(horizAdvX);
font->setFamilyName(myId);
if (!font->familyName().isEmpty()) {
if (!doc->svgFont(font->familyName()))
doc->addSvgFont(font);
}
return new QSvgFontStyle(font, doc);
}
return 0;
}
static bool parseFontFaceNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
if (parent->type() != QSvgStyleProperty::FONT) {
return false;
}
QSvgFontStyle *style = static_cast<QSvgFontStyle*>(parent);
QSvgFont *font = style->svgFont();
QString name = attributes.value(QLatin1String("font-family")).toString();
QString unitsPerEmStr = attributes.value(QLatin1String("units-per-em")).toString();
qreal unitsPerEm = toDouble(unitsPerEmStr);
if (!unitsPerEm)
unitsPerEm = 1000;
if (!name.isEmpty())
font->setFamilyName(name);
font->setUnitsPerEm(unitsPerEm);
if (!font->familyName().isEmpty())
if (!style->doc()->svgFont(font->familyName()))
style->doc()->addSvgFont(font);
return true;
}
static bool parseFontFaceNameNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
if (parent->type() != QSvgStyleProperty::FONT) {
return false;
}
QSvgFontStyle *style = static_cast<QSvgFontStyle*>(parent);
QSvgFont *font = style->svgFont();
QString name = attributes.value(QLatin1String("name")).toString();
if (!name.isEmpty())
font->setFamilyName(name);
if (!font->familyName().isEmpty())
if (!style->doc()->svgFont(font->familyName()))
style->doc()->addSvgFont(font);
return true;
}
static bool parseFontFaceSrcNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseFontFaceUriNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseForeignObjectNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgNode *createGNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(attributes);
QSvgG *node = new QSvgG(parent);
return node;
}
static bool parseGlyphNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
if (parent->type() != QSvgStyleProperty::FONT) {
return false;
}
QSvgFontStyle *style = static_cast<QSvgFontStyle*>(parent);
QSvgFont *font = style->svgFont();
createSvgGlyph(font, attributes);
return true;
}
static bool parseHandlerNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseHkernNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgNode *createImageNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString x = attributes.value(QLatin1String("x")).toString();
QString y = attributes.value(QLatin1String("y")).toString();
QString width = attributes.value(QLatin1String("width")).toString();
QString height = attributes.value(QLatin1String("height")).toString();
QString filename = attributes.value(QLatin1String("xlink:href")).toString();
qreal nx = toDouble(x);
qreal ny = toDouble(y);
QSvgHandler::LengthType type;
qreal nwidth = parseLength(width, type, handler);
nwidth = convertToPixels(nwidth, true, type);
qreal nheight = parseLength(height, type, handler);
nheight = convertToPixels(nheight, false, type);
filename = filename.trimmed();
if (filename.isEmpty()) {
qWarning() << "QSvgHandler: Image filename is empty";
return 0;
}
if (nwidth <= 0 || nheight <= 0) {
qWarning() << "QSvgHandler: Width or height for" << filename << "image was not greater than 0";
return 0;
}
QImage image;
if (filename.startsWith(QLatin1String("data"))) {
int idx = filename.lastIndexOf(QLatin1String("base64,"));
if (idx != -1) {
idx += 7;
QString dataStr = filename.mid(idx);
QByteArray data = QByteArray::fromBase64(dataStr.toLatin1());
image = QImage::fromData(data);
} else {
qDebug()<<"QSvgHandler::createImageNode: Unrecognized inline image format!";
}
} else
image = QImage(filename);
if (image.isNull()) {
qDebug()<<"couldn't create image from "<<filename;
return 0;
}
if (image.format() == QImage::Format_ARGB32)
image = image.convertToFormat(QImage::Format_ARGB32_Premultiplied);
QSvgNode *img = new QSvgImage(parent,
image,
QRect(int(nx),
int(ny),
int(nwidth),
int(nheight)));
return img;
}
static QSvgNode *createLineNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QString x1 = attributes.value(QLatin1String("x1")).toString();
QString y1 = attributes.value(QLatin1String("y1")).toString();
QString x2 = attributes.value(QLatin1String("x2")).toString();
QString y2 = attributes.value(QLatin1String("y2")).toString();
qreal nx1 = toDouble(x1);
qreal ny1 = toDouble(y1);
qreal nx2 = toDouble(x2);
qreal ny2 = toDouble(y2);
QLineF lineBounds(nx1, ny1, nx2, ny2);
QSvgNode *line = new QSvgLine(parent, lineBounds);
return line;
}
static void parseBaseGradient(QSvgNode *node,
const QXmlStreamAttributes &attributes,
QSvgGradientStyle *gradProp,
QSvgHandler *handler)
{
QString link = attributes.value(QLatin1String("xlink:href")).toString();
QStringRef trans = attributes.value(QLatin1String("gradientTransform"));
QString spread = attributes.value(QLatin1String("spreadMethod")).toString();
QString units = attributes.value(QLatin1String("gradientUnits")).toString();
QStringRef colorStr = attributes.value(QLatin1String("color"));
QStringRef colorOpacityStr = attributes.value(QLatin1String("color-opacity"));
QColor color;
if (constructColor(colorStr, colorOpacityStr, color, handler)) {
handler->popColor();
handler->pushColor(color);
}
QMatrix matrix;
QGradient *grad = gradProp->qgradient();
if (!link.isEmpty()) {
QSvgStyleProperty *prop = node->styleProperty(link);
//qDebug()<<"inherited "<<prop<<" ("<<link<<")";
if (prop && prop->type() == QSvgStyleProperty::GRADIENT) {
QSvgGradientStyle *inherited =
static_cast<QSvgGradientStyle*>(prop);
if (!inherited->stopLink().isEmpty()) {
gradProp->setStopLink(inherited->stopLink(), handler->document());
} else {
grad->setStops(inherited->qgradient()->stops());
gradProp->setGradientStopsSet(inherited->gradientStopsSet());
}
matrix = inherited->qmatrix();
} else {
gradProp->setStopLink(link, handler->document());
}
}
if (!trans.isEmpty()) {
matrix = parseTransformationMatrix(trans);
gradProp->setMatrix(matrix);
} else if (!matrix.isIdentity()) {
gradProp->setMatrix(matrix);
}
if (!spread.isEmpty()) {
if (spread == QLatin1String("pad")) {
grad->setSpread(QGradient::PadSpread);
} else if (spread == QLatin1String("reflect")) {
grad->setSpread(QGradient::ReflectSpread);
} else if (spread == QLatin1String("repeat")) {
grad->setSpread(QGradient::RepeatSpread);
}
}
if (units.isEmpty() || units == QLatin1String("objectBoundingBox")) {
grad->setCoordinateMode(QGradient::ObjectBoundingMode);
}
}
static QSvgStyleProperty *createLinearGradientNode(QSvgNode *node,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString x1 = attributes.value(QLatin1String("x1")).toString();
QString y1 = attributes.value(QLatin1String("y1")).toString();
QString x2 = attributes.value(QLatin1String("x2")).toString();
QString y2 = attributes.value(QLatin1String("y2")).toString();
qreal nx1 = 0.0;
qreal ny1 = 0.0;
qreal nx2 = 1.0;
qreal ny2 = 0.0;
if (!x1.isEmpty())
nx1 = convertToNumber(x1, handler);
if (!y1.isEmpty())
ny1 = convertToNumber(y1, handler);
if (!x2.isEmpty())
nx2 = convertToNumber(x2, handler);
if (!y2.isEmpty())
ny2 = convertToNumber(y2, handler);
QSvgNode *itr = node;
while (itr && itr->type() != QSvgNode::DOC) {
itr = itr->parent();
}
QLinearGradient *grad = new QLinearGradient(nx1, ny1, nx2, ny2);
grad->setInterpolationMode(QGradient::ComponentInterpolation);
QSvgGradientStyle *prop = new QSvgGradientStyle(grad);
parseBaseGradient(node, attributes, prop, handler);
return prop;
}
static bool parseMetadataNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseMissingGlyphNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
if (parent->type() != QSvgStyleProperty::FONT) {
return false;
}
QSvgFontStyle *style = static_cast<QSvgFontStyle*>(parent);
QSvgFont *font = style->svgFont();
createSvgGlyph(font, attributes);
return true;
}
static bool parseMpathNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgNode *createPathNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QStringRef data = attributes.value(QLatin1String("d"));
QPainterPath qpath;
qpath.setFillRule(Qt::WindingFill);
//XXX do error handling
parsePathDataFast(data, qpath);
QSvgNode *path = new QSvgPath(parent, qpath);
return path;
}
static QSvgNode *createPolygonNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QString pointsStr = attributes.value(QLatin1String("points")).toString();
//same QPolygon parsing is in createPolylineNode
const QChar *s = pointsStr.constData();
QVector<qreal> points = parseNumbersList(s);
QPolygonF poly(points.count()/2);
for (int i = 0; i < poly.size(); ++i)
poly[i] = QPointF(points.at(2 * i), points.at(2 * i + 1));
QSvgNode *polygon = new QSvgPolygon(parent, poly);
return polygon;
}
static QSvgNode *createPolylineNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
QString pointsStr = attributes.value(QLatin1String("points")).toString();
//same QPolygon parsing is in createPolygonNode
const QChar *s = pointsStr.constData();
QVector<qreal> points = parseNumbersList(s);
QPolygonF poly(points.count()/2);
for (int i = 0; i < poly.size(); ++i)
poly[i] = QPointF(points.at(2 * i), points.at(2 * i + 1));
QSvgNode *line = new QSvgPolyline(parent, poly);
return line;
}
static bool parsePrefetchNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgStyleProperty *createRadialGradientNode(QSvgNode *node,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString cx = attributes.value(QLatin1String("cx")).toString();
QString cy = attributes.value(QLatin1String("cy")).toString();
QString r = attributes.value(QLatin1String("r")).toString();
QString fx = attributes.value(QLatin1String("fx")).toString();
QString fy = attributes.value(QLatin1String("fy")).toString();
qreal ncx = 0.5;
qreal ncy = 0.5;
qreal nr = 0.5;
if (!cx.isEmpty())
ncx = toDouble(cx);
if (!cy.isEmpty())
ncy = toDouble(cy);
if (!r.isEmpty())
nr = toDouble(r);
qreal nfx = ncx;
if (!fx.isEmpty())
nfx = toDouble(fx);
qreal nfy = ncy;
if (!fy.isEmpty())
nfy = toDouble(fy);
QRadialGradient *grad = new QRadialGradient(ncx, ncy, nr, nfx, nfy);
grad->setInterpolationMode(QGradient::ComponentInterpolation);
QSvgGradientStyle *prop = new QSvgGradientStyle(grad);
parseBaseGradient(node, attributes, prop, handler);
return prop;
}
static QSvgNode *createRectNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString x = attributes.value(QLatin1String("x")).toString();
QString y = attributes.value(QLatin1String("y")).toString();
QString width = attributes.value(QLatin1String("width")).toString();
QString height = attributes.value(QLatin1String("height")).toString();
QString rx = attributes.value(QLatin1String("rx")).toString();
QString ry = attributes.value(QLatin1String("ry")).toString();
QSvgHandler::LengthType type;
qreal nwidth = parseLength(width, type, handler);
nwidth = convertToPixels(nwidth, true, type);
qreal nheight = parseLength(height, type, handler);
nheight = convertToPixels(nheight, true, type);
qreal nrx = toDouble(rx);
qreal nry = toDouble(ry);
QRectF bounds(toDouble(x), toDouble(y),
nwidth, nheight);
//9.2 The 'rect' element clearly specifies it
// but the case might in fact be handled because
// we draw rounded rectangles differently
if (nrx > bounds.width()/2)
nrx = bounds.width()/2;
if (nry > bounds.height()/2)
nry = bounds.height()/2;
if (!rx.isEmpty() && ry.isEmpty())
nry = nrx;
else if (!ry.isEmpty() && rx.isEmpty())
nrx = nry;
//we draw rounded rect from 0...99
//svg from 0...bounds.width()/2 so we're adjusting the
//coordinates
nrx *= (100/(bounds.width()/2));
nry *= (100/(bounds.height()/2));
QSvgNode *rect = new QSvgRect(parent, bounds,
int(nrx),
int(nry));
return rect;
}
static bool parseScriptNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static bool parseSetNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgStyleProperty *createSolidColorNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
QStringRef solidColorStr = attributes.value(QLatin1String("solid-color"));
QStringRef solidOpacityStr = attributes.value(QLatin1String("solid-opacity"));
if (solidOpacityStr.isEmpty())
solidOpacityStr = attributes.value(QLatin1String("opacity"));
QColor color;
if (!constructColor(solidColorStr, solidOpacityStr, color, handler))
return 0;
QSvgSolidColorStyle *style = new QSvgSolidColorStyle(color);
return style;
}
static bool parseStopNode(QSvgStyleProperty *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
if (parent->type() != QSvgStyleProperty::GRADIENT)
return false;
QString nodeIdStr = someId(attributes);
QString xmlClassStr = attributes.value(QLatin1String("class")).toString();
//### nasty hack because stop gradients are not in the rendering tree
// we force a dummy node with the same id and class into a rendering
// tree to figure out whether the selector has a style for it
// QSvgStyleSelector should be coded in a way that could avoid it
QSvgAnimation anim;
anim.setNodeId(nodeIdStr);
anim.setXmlClass(xmlClassStr);
QXmlStreamAttributes xmlAttr = attributes;
#ifndef QT_NO_CSSPARSER
QCss::StyleSelector::NodePtr cssNode;
cssNode.ptr = &anim;
QVector<QCss::Declaration> decls = handler->selector()->declarationsForNode(cssNode);
for (int i = 0; i < decls.count(); ++i) {
const QCss::Declaration &decl = decls.at(i);
if (decl.d->property.isEmpty())
continue;
if (decl.d->values.count() != 1)
continue;
QCss::Value val = decl.d->values.first();
QString valueStr = val.toString();
if (val.type == QCss::Value::Uri) {
valueStr.prepend(QLatin1String("url("));
valueStr.append(QLatin1Char(')'));
}
xmlAttr.append(QString(), decl.d->property, valueStr);
}
#endif
QSvgAttributes attrs(xmlAttr, handler);
QSvgGradientStyle *style =
static_cast<QSvgGradientStyle*>(parent);
QString offsetStr = attrs.offset.toString();
QStringRef colorStr = attrs.stopColor;
QColor color;
bool ok = true;
qreal offset = convertToNumber(offsetStr, handler, &ok);
if (!ok)
offset = 0.0;
QString black = QString::fromLatin1("#000000");
if (colorStr.isEmpty()) {
colorStr = QStringRef(&black);
}
constructColor(colorStr, attrs.stopOpacity, color, handler);
QGradient *grad = style->qgradient();
offset = qMin(qreal(1), qMax(qreal(0), offset)); // Clamp to range [0, 1]
QGradientStops stops;
if (style->gradientStopsSet()) {
stops = grad->stops();
// If the stop offset equals the one previously added, add an epsilon to make it greater.
if (offset <= stops.back().first)
offset = stops.back().first + FLT_EPSILON;
}
// If offset is greater than one, it must be clamped to one.
if (offset > 1.0) {
if ((stops.size() == 1) || (stops.at(stops.size() - 2).first < 1.0 - FLT_EPSILON)) {
stops.back().first = 1.0 - FLT_EPSILON;
grad->setStops(stops);
}
offset = 1.0;
}
grad->setColorAt(offset, color);
style->setGradientStopsSet(true);
return true;
}
static bool parseStyleNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
Q_UNUSED(parent);
#ifdef QT_NO_CSSPARSER
Q_UNUSED(attributes)
Q_UNUSED(handler)
#else
QString type = attributes.value(QLatin1String("type")).toString();
type = type.toLower();
if (type == QLatin1String("text/css")) {
handler->setInStyle(true);
}
#endif
return true;
}
static QSvgNode *createSvgNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
QString baseProfile = attributes.value(QLatin1String("baseProfile")).toString();
#if 0
if (baseProfile.isEmpty() && baseProfile != QLatin1String("tiny")) {
qWarning("Profile is %s while we only support tiny!",
qPrintable(baseProfile));
}
#endif
QSvgTinyDocument *node = new QSvgTinyDocument();
QString widthStr = attributes.value(QLatin1String("width")).toString();
QString heightStr = attributes.value(QLatin1String("height")).toString();
QString viewBoxStr = attributes.value(QLatin1String("viewBox")).toString();
QSvgHandler::LengthType type = QSvgHandler::LT_PX; // FIXME: is the default correct?
qreal width = 0;
if (!widthStr.isEmpty()) {
width = parseLength(widthStr, type, handler);
if (type != QSvgHandler::LT_PT)
width = convertToPixels(width, true, type);
node->setWidth(int(width), type == QSvgHandler::LT_PERCENT);
}
qreal height = 0;
if (!heightStr.isEmpty()) {
height = parseLength(heightStr, type, handler);
if (type != QSvgHandler::LT_PT)
height = convertToPixels(height, false, type);
node->setHeight(int(height), type == QSvgHandler::LT_PERCENT);
}
QStringList viewBoxValues;
if (!viewBoxStr.isEmpty()) {
viewBoxStr = viewBoxStr.replace(QLatin1Char(' '), QLatin1Char(','));
viewBoxStr = viewBoxStr.replace(QLatin1Char('\r'), QLatin1Char(','));
viewBoxStr = viewBoxStr.replace(QLatin1Char('\n'), QLatin1Char(','));
viewBoxStr = viewBoxStr.replace(QLatin1Char('\t'), QLatin1Char(','));
viewBoxValues = viewBoxStr.split(QLatin1Char(','), QString::SkipEmptyParts);
}
if (viewBoxValues.count() == 4) {
QString xStr = viewBoxValues.at(0).trimmed();
QString yStr = viewBoxValues.at(1).trimmed();
QString widthStr = viewBoxValues.at(2).trimmed();
QString heightStr = viewBoxValues.at(3).trimmed();
QSvgHandler::LengthType lt;
qreal x = parseLength(xStr, lt, handler);
qreal y = parseLength(yStr, lt, handler);
qreal w = parseLength(widthStr, lt, handler);
qreal h = parseLength(heightStr, lt, handler);
node->setViewBox(QRectF(x, y, w, h));
} else if (width && height) {
if (type == QSvgHandler::LT_PT) {
width = convertToPixels(width, false, type);
height = convertToPixels(height, false, type);
}
node->setViewBox(QRectF(0, 0, width, height));
}
handler->setDefaultCoordinateSystem(QSvgHandler::LT_PX);
return node;
}
static QSvgNode *createSwitchNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(attributes);
QSvgSwitch *node = new QSvgSwitch(parent);
return node;
}
static bool parseTbreakNode(QSvgNode *parent,
const QXmlStreamAttributes &,
QSvgHandler *)
{
if (parent->type() != QSvgNode::TEXTAREA)
return false;
static_cast<QSvgText*>(parent)->addLineBreak();
return true;
}
static QSvgNode *createTextNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString x = attributes.value(QLatin1String("x")).toString();
QString y = attributes.value(QLatin1String("y")).toString();
//### editable and rotate not handled
QSvgHandler::LengthType type;
qreal nx = parseLength(x, type, handler);
qreal ny = parseLength(y, type, handler);
QSvgNode *text = new QSvgText(parent, QPointF(nx, ny));
return text;
}
static QSvgNode *createTextAreaNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QSvgText *node = static_cast<QSvgText *>(createTextNode(parent, attributes, handler));
if (node) {
QSvgHandler::LengthType type;
qreal width = parseLength(attributes.value(QLatin1String("width")).toString(), type, handler);
qreal height = parseLength(attributes.value(QLatin1String("height")).toString(), type, handler);
node->setTextArea(QSizeF(width, height));
}
return node;
}
static QSvgNode *createTspanNode(QSvgNode *parent,
const QXmlStreamAttributes &,
QSvgHandler *)
{
return new QSvgTspan(parent);
}
static bool parseTitleNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return true;
}
static QSvgNode *createUseNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *handler)
{
QString linkId = attributes.value(QLatin1String("xlink:href")).toString().remove(0, 1);
QString xStr = attributes.value(QLatin1String("x")).toString();
QString yStr = attributes.value(QLatin1String("y")).toString();
QSvgStructureNode *group = 0;
if (linkId.isEmpty())
linkId = attributes.value(QLatin1String("href")).toString().remove(0, 1);
switch (parent->type()) {
case QSvgNode::DOC:
case QSvgNode::DEFS:
case QSvgNode::G:
case QSvgNode::SWITCH:
group = static_cast<QSvgStructureNode*>(parent);
break;
default:
break;
}
if (group) {
QSvgNode *link = group->scopeNode(linkId);
if (link) {
QPointF pt;
if (!xStr.isNull() || !yStr.isNull()) {
QSvgHandler::LengthType type;
qreal nx = parseLength(xStr, type, handler);
nx = convertToPixels(nx, true, type);
qreal ny = parseLength(yStr, type, handler);
ny = convertToPixels(ny, true, type);
pt = QPointF(nx, ny);
}
//delay link resolving till the first draw call on
//use nodes, link 2might have not been created yet
QSvgUse *node = new QSvgUse(pt, parent, link);
return node;
}
}
qWarning("link %s hasn't been detected!", qPrintable(linkId));
return 0;
}
static QSvgNode *createVideoNode(QSvgNode *parent,
const QXmlStreamAttributes &attributes,
QSvgHandler *)
{
Q_UNUSED(parent); Q_UNUSED(attributes);
return 0;
}
typedef QSvgNode *(*FactoryMethod)(QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *);
static FactoryMethod findGroupFactory(const QString &name)
{
if (name.isEmpty())
return 0;
QStringRef ref(&name, 1, name.length() - 1);
switch (name.at(0).unicode()) {
case 'd':
if (ref == QLatin1String("efs")) return createDefsNode;
break;
case 'g':
if (ref.isEmpty()) return createGNode;
break;
case 's':
if (ref == QLatin1String("vg")) return createSvgNode;
if (ref == QLatin1String("witch")) return createSwitchNode;
break;
default:
break;
}
return 0;
}
static FactoryMethod findGraphicsFactory(const QString &name)
{
if (name.isEmpty())
return 0;
QStringRef ref(&name, 1, name.length() - 1);
switch (name.at(0).unicode()) {
case 'a':
if (ref == QLatin1String("nimation")) return createAnimationNode;
break;
case 'c':
if (ref == QLatin1String("ircle")) return createCircleNode;
break;
case 'e':
if (ref == QLatin1String("llipse")) return createEllipseNode;
break;
case 'i':
if (ref == QLatin1String("mage")) return createImageNode;
break;
case 'l':
if (ref == QLatin1String("ine")) return createLineNode;
break;
case 'p':
if (ref == QLatin1String("ath")) return createPathNode;
if (ref == QLatin1String("olygon")) return createPolygonNode;
if (ref == QLatin1String("olyline")) return createPolylineNode;
break;
case 'r':
if (ref == QLatin1String("ect")) return createRectNode;
break;
case 't':
if (ref == QLatin1String("ext")) return createTextNode;
if (ref == QLatin1String("extArea")) return createTextAreaNode;
if (ref == QLatin1String("span")) return createTspanNode;
break;
case 'u':
if (ref == QLatin1String("se")) return createUseNode;
break;
case 'v':
if (ref == QLatin1String("ideo")) return createVideoNode;
break;
default:
break;
}
return 0;
}
typedef bool (*ParseMethod)(QSvgNode *, const QXmlStreamAttributes &, QSvgHandler *);
static ParseMethod findUtilFactory(const QString &name)
{
if (name.isEmpty())
return 0;
QStringRef ref(&name, 1, name.length() - 1);
switch (name.at(0).unicode()) {
case 'a':
if (ref.isEmpty()) return parseAnchorNode;
if (ref == QLatin1String("nimate")) return parseAnimateNode;
if (ref == QLatin1String("nimateColor")) return parseAnimateColorNode;
if (ref == QLatin1String("nimateMotion")) return parseAimateMotionNode;
if (ref == QLatin1String("nimateTransform")) return parseAnimateTransformNode;
if (ref == QLatin1String("udio")) return parseAudioNode;
break;
case 'd':
if (ref == QLatin1String("esc")) return parseDescNode;
if (ref == QLatin1String("iscard")) return parseDiscardNode;
break;
case 'f':
if (ref == QLatin1String("oreignObject")) return parseForeignObjectNode;
break;
case 'h':
if (ref == QLatin1String("andler")) return parseHandlerNode;
if (ref == QLatin1String("kern")) return parseHkernNode;
break;
case 'm':
if (ref == QLatin1String("etadata")) return parseMetadataNode;
if (ref == QLatin1String("path")) return parseMpathNode;
break;
case 'p':
if (ref == QLatin1String("refetch")) return parsePrefetchNode;
break;
case 's':
if (ref == QLatin1String("cript")) return parseScriptNode;
if (ref == QLatin1String("et")) return parseSetNode;
if (ref == QLatin1String("tyle")) return parseStyleNode;
break;
case 't':
if (ref == QLatin1String("break")) return parseTbreakNode;
if (ref == QLatin1String("itle")) return parseTitleNode;
break;
default:
break;
}
return 0;
}
typedef QSvgStyleProperty *(*StyleFactoryMethod)(QSvgNode *,
const QXmlStreamAttributes &,
QSvgHandler *);
static StyleFactoryMethod findStyleFactoryMethod(const QString &name)
{
if (name.isEmpty())
return 0;
QStringRef ref(&name, 1, name.length() - 1);
switch (name.at(0).unicode()) {
case 'f':
if (ref == QLatin1String("ont")) return createFontNode;
break;
case 'l':
if (ref == QLatin1String("inearGradient")) return createLinearGradientNode;
break;
case 'r':
if (ref == QLatin1String("adialGradient")) return createRadialGradientNode;
break;
case 's':
if (ref == QLatin1String("olidColor")) return createSolidColorNode;
break;
default:
break;
}
return 0;
}
typedef bool (*StyleParseMethod)(QSvgStyleProperty *,
const QXmlStreamAttributes &,
QSvgHandler *);
static StyleParseMethod findStyleUtilFactoryMethod(const QString &name)
{
if (name.isEmpty())
return 0;
QStringRef ref(&name, 1, name.length() - 1);
switch (name.at(0).unicode()) {
case 'f':
if (ref == QLatin1String("ont-face")) return parseFontFaceNode;
if (ref == QLatin1String("ont-face-name")) return parseFontFaceNameNode;
if (ref == QLatin1String("ont-face-src")) return parseFontFaceSrcNode;
if (ref == QLatin1String("ont-face-uri")) return parseFontFaceUriNode;
break;
case 'g':
if (ref == QLatin1String("lyph")) return parseGlyphNode;
break;
case 'm':
if (ref == QLatin1String("issing-glyph")) return parseMissingGlyphNode;
break;
case 's':
if (ref == QLatin1String("top")) return parseStopNode;
break;
default:
break;
}
return 0;
}
QSvgHandler::QSvgHandler(QIODevice *device) : xml(new QXmlStreamReader(device))
, m_ownsReader(true)
{
init();
}
QSvgHandler::QSvgHandler(const QByteArray &data) : xml(new QXmlStreamReader(data))
, m_ownsReader(true)
{
init();
}
QSvgHandler::QSvgHandler(QXmlStreamReader *const reader) : xml(reader)
, m_ownsReader(false)
{
init();
}
void QSvgHandler::init()
{
m_doc = 0;
m_style = 0;
m_animEnd = 0;
m_defaultCoords = LT_PX;
m_defaultPen = QPen(Qt::black, 1, Qt::SolidLine, Qt::FlatCap, Qt::SvgMiterJoin);
m_defaultPen.setMiterLimit(4);
parse();
}
void QSvgHandler::parse()
{
xml->setNamespaceProcessing(false);
#ifndef QT_NO_CSSPARSER
m_selector = new QSvgStyleSelector;
m_inStyle = false;
#endif
bool done = false;
while (!xml->atEnd() && !done) {
switch (xml->readNext()) {
case QXmlStreamReader::StartElement:
// he we could/should verify the namespaces, and simply
// call m_skipNodes(Unknown) if we don't know the
// namespace. We do support http://www.w3.org/2000/svg
// but also http://www.w3.org/2000/svg-20000303-stylable
// And if the document uses an external dtd, the reported
// namespaceUri is empty. The only possible strategy at
// this point is to do what everyone else seems to do and
// ignore the reported namespaceUri completely.
if (!startElement(xml->name().toString(), xml->attributes())) {
delete m_doc;
m_doc = 0;
return;
}
break;
case QXmlStreamReader::EndElement:
endElement(xml->name());
// if we are using somebody else's qxmlstreamreader
// we should not read until the end of the stream
done = !m_ownsReader && (xml->name() == QLatin1String("svg"));
break;
case QXmlStreamReader::Characters:
characters(xml->text());
break;
case QXmlStreamReader::ProcessingInstruction:
processingInstruction(xml->processingInstructionTarget().toString(), xml->processingInstructionData().toString());
break;
default:
break;
}
}
resolveGradients(m_doc);
}
bool QSvgHandler::startElement(const QString &localName,
const QXmlStreamAttributes &attributes)
{
QSvgNode *node = 0;
pushColorCopy();
/* The xml:space attribute may appear on any element. We do
* a lookup by the qualified name here, but this is namespace aware, since
* the XML namespace can only be bound to prefix "xml." */
const QStringRef xmlSpace(attributes.value(QLatin1String("xml:space")));
if (xmlSpace.isNull()) {
// This element has no xml:space attribute.
m_whitespaceMode.push(m_whitespaceMode.isEmpty() ? QSvgText::Default : m_whitespaceMode.top());
} else if (xmlSpace == QLatin1String("preserve")) {
m_whitespaceMode.push(QSvgText::Preserve);
} else if (xmlSpace == QLatin1String("default")) {
m_whitespaceMode.push(QSvgText::Default);
} else {
qWarning() << QString::fromLatin1("\"%1\" is an invalid value for attribute xml:space. "
"Valid values are \"preserve\" and \"default\".").arg(xmlSpace.toString());
m_whitespaceMode.push(QSvgText::Default);
}
if (!m_doc && localName != QLatin1String("svg"))
return false;
if (FactoryMethod method = findGroupFactory(localName)) {
//group
node = method(m_doc ? m_nodes.top() : 0, attributes, this);
Q_ASSERT(node);
if (!m_doc) {
Q_ASSERT(node->type() == QSvgNode::DOC);
m_doc = static_cast<QSvgTinyDocument*>(node);
} else {
switch (m_nodes.top()->type()) {
case QSvgNode::DOC:
case QSvgNode::G:
case QSvgNode::DEFS:
case QSvgNode::SWITCH:
{
QSvgStructureNode *group =
static_cast<QSvgStructureNode*>(m_nodes.top());
group->addChild(node, someId(attributes));
}
break;
default:
break;
}
}
parseCoreNode(node, attributes);
#ifndef QT_NO_CSSPARSER
cssStyleLookup(node, this, m_selector);
#endif
parseStyle(node, attributes, this);
} else if (FactoryMethod method = findGraphicsFactory(localName)) {
//rendering element
Q_ASSERT(!m_nodes.isEmpty());
node = method(m_nodes.top(), attributes, this);
if (node) {
switch (m_nodes.top()->type()) {
case QSvgNode::DOC:
case QSvgNode::G:
case QSvgNode::DEFS:
case QSvgNode::SWITCH:
{
QSvgStructureNode *group =
static_cast<QSvgStructureNode*>(m_nodes.top());
group->addChild(node, someId(attributes));
}
break;
case QSvgNode::TEXT:
case QSvgNode::TEXTAREA:
if (node->type() == QSvgNode::TSPAN) {
static_cast<QSvgText *>(m_nodes.top())->addTspan(static_cast<QSvgTspan *>(node));
} else {
qWarning("\'text\' or \'textArea\' element contains invalid element type.");
delete node;
node = 0;
}
break;
default:
qWarning("Could not add child element to parent element because the types are incorrect.");
delete node;
node = 0;
break;
}
if (node) {
parseCoreNode(node, attributes);
#ifndef QT_NO_CSSPARSER
cssStyleLookup(node, this, m_selector);
#endif
parseStyle(node, attributes, this);
if (node->type() == QSvgNode::TEXT || node->type() == QSvgNode::TEXTAREA) {
static_cast<QSvgText *>(node)->setWhitespaceMode(m_whitespaceMode.top());
} else if (node->type() == QSvgNode::TSPAN) {
static_cast<QSvgTspan *>(node)->setWhitespaceMode(m_whitespaceMode.top());
}
}
}
} else if (ParseMethod method = findUtilFactory(localName)) {
Q_ASSERT(!m_nodes.isEmpty());
if (!method(m_nodes.top(), attributes, this)) {
qWarning("Problem parsing %s", qPrintable(localName));
}
} else if (StyleFactoryMethod method = findStyleFactoryMethod(localName)) {
QSvgStyleProperty *prop = method(m_nodes.top(), attributes, this);
if (prop) {
m_style = prop;
m_nodes.top()->appendStyleProperty(prop, someId(attributes));
} else {
qWarning("Could not parse node: %s", qPrintable(localName));
}
} else if (StyleParseMethod method = findStyleUtilFactoryMethod(localName)) {
if (m_style) {
if (!method(m_style, attributes, this)) {
qWarning("Problem parsing %s", qPrintable(localName));
}
}
} else {
//qWarning()<<"Skipping unknown element!"<<namespaceURI<<"::"<<localName;
m_skipNodes.push(Unknown);
return true;
}
if (node) {
m_nodes.push(node);
m_skipNodes.push(Graphics);
} else {
//qDebug()<<"Skipping "<<localName;
m_skipNodes.push(Style);
}
return true;
}
bool QSvgHandler::endElement(const QStringRef &localName)
{
CurrentNode node = m_skipNodes.top();
m_skipNodes.pop();
m_whitespaceMode.pop();
popColor();
if (node == Unknown) {
return true;
}
#ifdef QT_NO_CSSPARSER
Q_UNUSED(localName)
#else
if (m_inStyle && localName == QLatin1String("style"))
m_inStyle = false;
#endif
if (node == Graphics)
m_nodes.pop();
else if (m_style && !m_skipNodes.isEmpty() && m_skipNodes.top() != Style)
m_style = 0;
return true;
}
void QSvgHandler::resolveGradients(QSvgNode *node)
{
if (!node || (node->type() != QSvgNode::DOC && node->type() != QSvgNode::G
&& node->type() != QSvgNode::DEFS && node->type() != QSvgNode::SWITCH)) {
return;
}
QSvgStructureNode *structureNode = static_cast<QSvgStructureNode *>(node);
QList<QSvgNode *> ren = structureNode->renderers();
for (QList<QSvgNode *>::iterator it = ren.begin(); it != ren.end(); ++it) {
QSvgFillStyle *fill = static_cast<QSvgFillStyle *>((*it)->styleProperty(QSvgStyleProperty::FILL));
if (fill && !fill->isGradientResolved()) {
QString id = fill->gradientId();
QSvgFillStyleProperty *style = structureNode->styleProperty(id);
if (style) {
fill->setFillStyle(style);
} else {
qWarning("Could not resolve property : %s", qPrintable(id));
fill->setBrush(Qt::NoBrush);
}
}
QSvgStrokeStyle *stroke = static_cast<QSvgStrokeStyle *>((*it)->styleProperty(QSvgStyleProperty::STROKE));
if (stroke && !stroke->isGradientResolved()) {
QString id = stroke->gradientId();
QSvgFillStyleProperty *style = structureNode->styleProperty(id);
if (style) {
stroke->setStyle(style);
} else {
qWarning("Could not resolve property : %s", qPrintable(id));
stroke->setStroke(Qt::NoBrush);
}
}
resolveGradients(*it);
}
}
bool QSvgHandler::characters(const QStringRef &str)
{
#ifndef QT_NO_CSSPARSER
if (m_inStyle) {
QString css = str.toString();
QCss::StyleSheet sheet;
QCss::Parser(css).parse(&sheet);
m_selector->styleSheets.append(sheet);
return true;
}
#endif
if (m_skipNodes.isEmpty() || m_skipNodes.top() == Unknown || m_nodes.isEmpty())
return true;
if (m_nodes.top()->type() == QSvgNode::TEXT || m_nodes.top()->type() == QSvgNode::TEXTAREA) {
static_cast<QSvgText*>(m_nodes.top())->addText(str.toString());
} else if (m_nodes.top()->type() == QSvgNode::TSPAN) {
static_cast<QSvgTspan*>(m_nodes.top())->addText(str.toString());
}
return true;
}
QSvgTinyDocument * QSvgHandler::document() const
{
return m_doc;
}
QSvgHandler::LengthType QSvgHandler::defaultCoordinateSystem() const
{
return m_defaultCoords;
}
void QSvgHandler::setDefaultCoordinateSystem(LengthType type)
{
m_defaultCoords = type;
}
void QSvgHandler::pushColor(const QColor &color)
{
m_colorStack.push(color);
m_colorTagCount.push(1);
}
void QSvgHandler::pushColorCopy()
{
if (m_colorTagCount.count())
++m_colorTagCount.top();
else
pushColor(Qt::black);
}
void QSvgHandler::popColor()
{
if (m_colorTagCount.count()) {
if (!--m_colorTagCount.top()) {
m_colorStack.pop();
m_colorTagCount.pop();
}
}
}
QColor QSvgHandler::currentColor() const
{
if (!m_colorStack.isEmpty())
return m_colorStack.top();
else
return QColor(0, 0, 0);
}
#ifndef QT_NO_CSSPARSER
void QSvgHandler::setInStyle(bool b)
{
m_inStyle = b;
}
bool QSvgHandler::inStyle() const
{
return m_inStyle;
}
QSvgStyleSelector * QSvgHandler::selector() const
{
return m_selector;
}
#endif // QT_NO_CSSPARSER
bool QSvgHandler::processingInstruction(const QString &target, const QString &data)
{
#ifdef QT_NO_CSSPARSER
Q_UNUSED(target)
Q_UNUSED(data)
#else
if (target == QLatin1String("xml-stylesheet")) {
QRegExp rx(QLatin1String("type=\\\"(.+)\\\""));
rx.setMinimal(true);
bool isCss = false;
int pos = 0;
while ((pos = rx.indexIn(data, pos)) != -1) {
QString type = rx.cap(1);
if (type.toLower() == QLatin1String("text/css")) {
isCss = true;
}
pos += rx.matchedLength();
}
if (isCss) {
QRegExp rx(QLatin1String("href=\\\"(.+)\\\""));
rx.setMinimal(true);
pos = 0;
pos = rx.indexIn(data, pos);
QString addr = rx.cap(1);
QFileInfo fi(addr);
//qDebug()<<"External CSS file "<<fi.absoluteFilePath()<<fi.exists();
if (fi.exists()) {
QFile file(fi.absoluteFilePath());
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
return true;
}
QByteArray cssData = file.readAll();
QString css = QString::fromUtf8(cssData);
QCss::StyleSheet sheet;
QCss::Parser(css).parse(&sheet);
m_selector->styleSheets.append(sheet);
}
}
}
#endif
return true;
}
void QSvgHandler::setAnimPeriod(int start, int end)
{
Q_UNUSED(start);
m_animEnd = qMax(end, m_animEnd);
}
int QSvgHandler::animationDuration() const
{
return m_animEnd;
}
QSvgHandler::~QSvgHandler()
{
#ifndef QT_NO_CSSPARSER
delete m_selector;
m_selector = 0;
#endif
if(m_ownsReader)
delete xml;
}
QT_END_NAMESPACE
| [
"p_pavlov@wargaming.net"
] | p_pavlov@wargaming.net |
7446cd3a8f98c057ab5674775e050ca90b4849e1 | 9830e9eb5eda7a24182622b18cc0cdce030c6aa2 | /model/ActionType.h | 27e9e70fc7660785e8a160ec34ec0033b31422d1 | [] | no_license | EgorZarubin/myWizards | 12bfaa3ce6c72ca0e45847db50f9c9c08627e706 | 3ecc8235e18299ab12997a0821900d3f9835fc70 | refs/heads/master | 2020-06-17T16:52:34.764902 | 2017-07-03T09:06:49 | 2017-07-03T09:06:49 | 74,986,889 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 376 | h | #pragma once
#ifndef _ACTION_TYPE_H_
#define _ACTION_TYPE_H_
namespace model {
enum ActionType {
_ACTION_UNKNOWN_ = -1,
ACTION_NONE = 0,
ACTION_STAFF = 1,
ACTION_MAGIC_MISSILE = 2,
ACTION_FROST_BOLT = 3,
ACTION_FIREBALL = 4,
ACTION_HASTE = 5,
ACTION_SHIELD = 6,
_ACTION_COUNT_ = 7
};
}
#endif
| [
"ze@cimco.com"
] | ze@cimco.com |
2ae467ad4eef5bf99e07a03dcdac4b5fa0695e28 | 83c7256f6127b29f78e93f5b6c58d1a214afd062 | /Sources/Parser3/Parser.cpp | bf96563229cf1eba73634ef7f641297a43fae6fb | [] | no_license | TheGreatV/Nu | 6a394e676df28151a48673313df8037663a61b48 | 181c62409eb7f9b242fe5f16eb0ed33fe61505c8 | refs/heads/master | 2021-01-20T03:49:47.041469 | 2018-03-22T19:45:52 | 2018-03-22T19:45:52 | 89,591,708 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 141 | cpp | #include "Parser.hpp"
#pragma region Nu
#pragma region Parsing3
#pragma endregion
#pragma endregion
#pragma region
#pragma endregion
| [
"GreatV@email.ua"
] | GreatV@email.ua |
d4ebfd994dece6c83170f929ca6d335f0ee96c41 | 8eea0097f368764fb9b443b8a90873e09f48bb24 | /jianzhiOffer/singleton.cpp | bb876b32b8e58f19ee3e30ee115a05a6b98ba711 | [] | no_license | cfs6/DSandAlgorithm | 4fb5156527b77908b9fce885ed214969f85e8e5b | f792f9308c241ba49828d108eb830a7382a2277b | refs/heads/master | 2021-07-03T22:49:28.431195 | 2020-12-13T13:27:03 | 2020-12-13T13:27:03 | 205,761,720 | 2 | 0 | null | null | null | null | GB18030 | C++ | false | false | 523 | cpp | //单例模式
//考虑线程安全
class CSingleton {
public:
static CSingleton* GetInstance() {
if (m_Instance == nullptr) {
Lock();
if (m_Instance == nullptr) {
m_Instance = new CSingleton();
}
Unlock();
}
return m_Instance;
}
static void DestoryInstance() {
if (m_Instance != nullptr) {
delete m_Instance;
m_Instance = nullptr;
}
}
private:
CSingleton() {};
static CSingleton* m_Instance;
};
CSingleton* CSingleton::m_Instance = nullptr;
| [
"2766607313@qq.com"
] | 2766607313@qq.com |
837643755221c7815a53deb0fd989af9f0a302b1 | 55d560fe6678a3edc9232ef14de8fafd7b7ece12 | /libs/thread/test/sync/mutual_exclusion/synchronized_value/synchronize_pass.cpp | 6044ea200c33787dac84c127025bba34d31f9606 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | stardog-union/boost | ec3abeeef1b45389228df031bf25b470d3d123c5 | caa4a540db892caa92e5346e0094c63dea51cbfb | refs/heads/stardog/develop | 2021-06-25T02:15:10.697006 | 2020-11-17T19:50:35 | 2020-11-17T19:50:35 | 148,681,713 | 0 | 0 | BSL-1.0 | 2020-11-17T19:50:36 | 2018-09-13T18:38:54 | C++ | UTF-8 | C++ | false | false | 963 | cpp | // Copyright (C) 2013 Vicente J. Botet Escriba
//
// 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)
// <boost/thread/synchronized_value.hpp>
// class synchronized_value<T,M>
// strict_lock_ptr<T,M> synchronize();
// const_strict_lock_ptr<T,M> synchronize() const;
#define BOOST_THREAD_VERSION 4
#include <boost/thread/synchronized_value.hpp>
#include <boost/detail/lightweight_test.hpp>
struct S {
int f() const {return 1;}
int g() {return 1;}
};
int main()
{
{
boost::synchronized_value<S> v;
boost::strict_lock_ptr<S> ptr = v.synchronize();
BOOST_TEST(ptr->f()==1);
BOOST_TEST(ptr->g()==1);
}
{
const boost::synchronized_value<S> v;
boost::const_strict_lock_ptr<S> ptr = v.synchronize();
BOOST_TEST(ptr->f()==1);
}
return boost::report_errors();
}
| [
"james.pack@stardog.com"
] | james.pack@stardog.com |
6f03e950602a98323f3e6772bdf358ae9bdcf953 | e02563fb0f3f4c5d35c9a8f49ee7e47a1eeabfef | /src/interpolationutils.cpp | 5a7de454d54300c382c3bd26b4837d164bb6ff7b | [] | no_license | cran/meteoland | 2928a6de898f5ad251287e6abf08e0aa36a1691f | bb6f87a5169ba835a7c2a6fd5dfc11acadeaf65a | refs/heads/master | 2023-08-31T07:46:39.898503 | 2023-08-21T09:22:39 | 2023-08-21T11:30:47 | 69,889,248 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,204 | cpp | #include <Rcpp.h>
#include <numeric>
using namespace Rcpp;
double gaussianFilter(double r, double Rp, double alpha) {
if(r>Rp) return(0.0);
return(exp(-alpha*pow(r/Rp,2.0))-exp(-alpha));
}
NumericVector gaussianFilter(NumericVector r, double Rp, double alpha) {
int n = r.size();
NumericVector w(n);
for(int i=0;i<n;i++) {
w[i] = gaussianFilter(r[i], Rp, alpha);
}
return(w);
}
double estimateRp(NumericVector r, double iniRp, double alpha, int N, int iterations = 3) {
//Initialize with initial value
double Rpest = iniRp;
NumericVector wIni;
double Dp;
double Wmean = ((1.0-exp(-alpha))/alpha)-exp(-alpha);
double Nstar = (double) 2.0*N;
double Wsum;
for(int it = 0;it<iterations;it++) {
//Estimate weights and station density
wIni = gaussianFilter(r,Rpest,alpha);
Wsum = std::accumulate(wIni.begin(), wIni.end(), 0.0);
Dp = (Wsum/Wmean)/(3.141592*pow(Rpest,2.0));
if(it==(iterations-1)) Nstar = (double) N;
Rpest = sqrt(Nstar/(Dp*3.141592));
// Rcout<<Dp<< " "<<Wsum<<" "<< Wmean<<" "<<Rpest<<"\n";
}
return(Rpest);
}
NumericVector weightedRegression(NumericVector Y, NumericVector X, NumericVector W) {
NumericVector XW = X*W;
NumericVector YW = Y*W;
int n = X.size();
double Wsum = std::accumulate(W.begin(), W.end(), 0.0);
W = (((double) n)/Wsum)*W; //Normalize weights to sum n
double wMeanX = std::accumulate(XW.begin(), XW.end(), 0.0)/((double)n);
double wMeanY = std::accumulate(YW.begin(), YW.end(), 0.0)/((double)n);
double cov = 0.0, var = 0.0;
for (int k = 0; k < n; k++) {
var = var + W[k] * X[k] * X[k];
cov = cov + W[k] * X[k] * Y[k];
}
cov = cov -((double)n)*wMeanX*wMeanY;
var = var - ((double) n)*wMeanX*wMeanX;
double b = cov/var;
// Rcout<<" Xsum: "<< std::accumulate(X.begin(), X.end(), 0.0)<<"Wsum:"<<std::accumulate(W.begin(), W.end(), 0.0)<<" wMeanX: "<< wMeanX<<" wMeanY: "<<wMeanY<<" cov: "<< cov<<" var: "<< var<<"\n";
double a = wMeanY-b*wMeanX;
return(NumericVector::create(a,b));
}
// [[Rcpp::export(".temporalSmoothing")]]
NumericMatrix temporalSmoothing(NumericMatrix input, int numDays, bool prec) {
int nrows = input.nrow();
int ncols = input.ncol();
int vec_size = (2*numDays) + 1;
NumericVector filter(vec_size, 0.0), weights(vec_size,0.0);
NumericMatrix output(nrows,ncols);
for(int r = 0;r<nrows;r++) { //Station loop
for(int c = 0;c<ncols;c++) { //Day loop
for(int fpos = -numDays;fpos<=numDays;fpos++) {
if((c+fpos>-1) & (c+fpos<ncols)) {
if(!NumericVector::is_na(input(r,c+fpos))) {
filter[fpos+numDays] = input(r,c+fpos);
weights[fpos+numDays] = 1.0;
if(prec & (filter[fpos+numDays]==0.0)) weights[fpos+numDays] = 0.0;
} else {
filter[fpos+numDays] = 0.0;
weights[fpos+numDays] = 0.0;
}
} else {
filter[fpos+numDays] = 0.0;
weights[fpos+numDays] = 0.0;
}
}
double den = std::accumulate(weights.begin(), weights.end(), 0.0);
if(den>0.0) output(r,c) = std::accumulate(filter.begin(), filter.end(), 0.0)/den;
else output(r,c) = R_NaReal;
}
}
return(output);
}
| [
"csardi.gabor+cran@gmail.com"
] | csardi.gabor+cran@gmail.com |
5d416ab5028eba5095a00dfa1416f774d0b46ee0 | 17497a801f30622d0a4d9eb8772379e54143917c | /LISTA.cpp | ec404f7874e07d4d3d3a8abd90ff0a2f7252b231 | [] | no_license | yahairacastelho/tutoria-estructuras | b54c4bf152593a46dc8704d8904a7f9bdf9cc909 | 2f255cb5609fbea8b9a04251ba25f47ac57d6bc0 | refs/heads/master | 2020-03-28T17:45:03.871481 | 2018-10-16T13:41:35 | 2018-10-16T13:41:35 | 148,819,079 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 1,803 | cpp | #include "StdAfx.h"
#include "LISTA.h"
LISTA::LISTA(void)
{
int i=0;
while(i<N)
{
lista[i].Set_ap(i+1);
i++;
}
lista[i].Set_ap(-1);
list=-1;
disponible=0;
}
int LISTA::Buscarnodo()
{
int y;
y=disponible;
disponible=lista[y].Get_ap();
return y;
}
void LISTA::Liberarnodo(int y)
{
lista[y].Set_ap(disponible);
disponible=y;
}
NODO LISTA::Get_lista(int p)
{
return lista[p];
}
void LISTA::Set_lista(int p, NODO x)
{
lista[p]=x;
}
bool LISTA::Lista_vacia()
{
if(list==-1) {return true;}
else {return false;}
}
bool LISTA::Lista_llena()
{
if(disponible==-1) {return true;}
else return false;
}
bool LISTA::Insertar(NODO x, int despues)
{ int y;
if(Lista_llena()==true) {return false;}
else
{ y=Buscarnodo();
lista[y].Set_inf(x.Get_inf());
if(despues==-1) {
lista[y].Set_ap(list);
list=y;
}
else
{
lista[y].Set_ap(lista[despues].Get_ap());
lista[despues].Set_ap(y);
}
return true;
}
}
bool LISTA::Eliminar(NODO &x, int despues)
{
int eli;
if(Lista_vacia()==true) {return false;}
else
{
if (despues==-1) {
eli=list;
x=lista[list];
list=lista[list].Get_ap();
Liberarnodo(eli);
return true;
}
else
{
eli=lista[despues].Get_ap();
if(eli!=-1) {
lista[despues].Set_ap(lista[eli].Get_ap());
Liberarnodo(eli);
return true;
}
else { return false;}
}
}
}
int LISTA::Primero()
{
return list;
}
int LISTA::Proximo(int q)
{
return lista[q].Get_ap();
}
int LISTA::Ultimo()
{
int i=Primero();
while(Get_lista(i).Get_ap()!=-1)
{
i=Proximo(i);
}
return i;
} | [
"noreply@github.com"
] | noreply@github.com |
c6f6135452e45503a27f599206857227dc411e92 | 45074cc0edde439faa782146c9a11ea40148b3b5 | /src/renderergl/RendererProto.h | 6b131d16dec82e2c1ad5339c72f60bec07f795b3 | [
"Zlib"
] | permissive | modificus/gaen | 246b91cb4e1bc535a27bab91f119c5f144fc8a89 | c8368942acb3c61f1e38e8f3acf93c9ae3af5786 | refs/heads/master | 2021-01-15T11:44:30.165220 | 2016-08-27T10:08:29 | 2016-08-27T10:08:29 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 4,531 | h | //------------------------------------------------------------------------------
// RendererProto.h - Prototype and experimental rendering code
//
// Gaen Concurrency Engine - http://gaen.org
// Copyright (c) 2014-2016 Lachlan Orr
//
// This software is provided 'as-is', without any express or implied
// warranty. In no event will the authors be held liable for any damages
// arising from the use of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it
// freely, subject to the following restrictions:
//
// 1. The origin of this software must not be misrepresented; you must not
// claim that you wrote the original software. If you use this software
// in a product, an acknowledgment in the product documentation would be
// appreciated but is not required.
//
// 2. Altered source versions must be plainly marked as such, and must not be
// misrepresented as being the original software.
//
// 3. This notice may not be removed or altered from any source
// distribution.
//------------------------------------------------------------------------------
#ifndef GAEN_RENDERERGL_RENDERERPROTO_H
#define GAEN_RENDERERGL_RENDERERPROTO_H
#include <glm/mat4x4.hpp>
#include "core/List.h"
#include "core/HashMap.h"
#include "engine/Message.h"
#include "engine/MessageAccessor.h"
#include "engine/ModelMgr.h"
#include "engine/renderer_structs.h"
// LORRTODO: probably a temp include only until we get voxel stuff more defined
#include "engine/voxel_proto.h"
#include "engine/RaycastCamera.h"
#include "renderergl/gaen_opengl.h"
#include "renderergl/ShaderRegistry.h"
#define RENDERTYPE_MESH 0
#define RENDERTYPE_CPUFRAGVOXEL 1
#define RENDERTYPE_CPUCOMPVOXEL 2
#define RENDERTYPE_GPUFRAGVOXEL 3
#define RENDERTYPE_GPUCOMPVOXEL 4
#define RENDERTYPE_VOXEL27 5
#define RENDERTYPE RENDERTYPE_MESH
//#define RENDERTYPE RENDERTYPE_CPUFRAGVOXEL
//#define RENDERTYPE RENDERTYPE_CPUCOMPVOXEL
//#define RENDERTYPE RENDERTYPE_GPUFRAGVOXEL
//#define RENDERTYPE RENDERTYPE_GPUCOMPVOXEL
//#define RENDERTYPE RENDERTYPE_VOXEL27
namespace gaen
{
class RendererProto
{
public:
enum MeshReservedIndex
{
kMSHR_VAO = 0,
kMSHR_VertBuffer = 1,
kMSHR_PrimBuffer = 2
};
void init(device_context deviceContext,
render_context renderContext,
u32 screenWidth,
u32 screenHeight);
void fin();
void initRenderDevice();
void initViewport();
void render();
void endFrame();
template <typename T>
MessageResult message(const T& msgAcc);
void loadMaterialMesh(Model::MaterialMesh & matMesh);
private:
void setActiveShader(u32 nameHash);
shaders::Shader * getShader(u32 nameHash);
bool mIsInit = false;
device_context mDeviceContext = 0;
render_context mRenderContext = 0;
u32 mScreenWidth = 0;
u32 mScreenHeight = 0;
// GPU capabilities
GLint mMaxCombinedTextureImageUnits = 0;
GLint mMaxTextureImageUnits = 0;
GLint mMaxTextureSize = 0;
// GPU custom renderer presentation support
// I.E. a surface to render our GPU generated texture upon for display.
shaders::Shader * mpVoxelCast;
GLuint mPresentVAO;
GLuint mPresentVertexBuffer;
GLuint mPresentImage;
GLuint mPresentImageLocation;
shaders::Shader * mpPresentShader;
GLuint mVoxelDataImage;
GLuint mVoxelDataImageLocation;
GLuint mVoxelData;
GLuint mVoxelRootsImage;
GLuint mVoxelRootsImageLocation;
GLuint mVoxelRoots;
glm::mat4 mProjection;
glm::mat4 mGuiProjection;
ModelMgr<RendererProto> * mpModelMgr;
List<kMEM_Renderer, DirectionalLight> mDirectionalLights;
List<kMEM_Renderer, PointLight> mPointLights;
shaders::Shader * mpActiveShader = nullptr;
ShaderRegistry mShaderRegistry;
HashMap<kMEM_Renderer, u32, shaders::Shader*> mShaders;
// LORRTODO: temp voxel experiment stuff
#if RENDERTYPE == RENDERTYPE_CPUFRAGVOXEL
FragmentShaderSimulator mShaderSim;
#elif RENDERTYPE == RENDERTYPE_CPUCOMPVOXEL
ComputeShaderSimulator mShaderSim;
#endif
#if RENDERTYPE == RENDERTYPE_CPUFRAGVOXEL || RENDERTYPE == RENDERTYPE_CPUCOMPVOXEL || RENDERTYPE == RENDERTYPE_GPUFRAGVOXEL || RENDERTYPE == RENDERTYPE_GPUCOMPVOXEL
RaycastCamera mRaycastCamera;
VoxelWorld mVoxelWorld;
VoxelRoot mVoxelRoot;
#endif
};
} // namespace gaen
#endif // #ifndef GAEN_RENDERERGL_RENDERERPROTO_H
| [
"lorr@gaen.org"
] | lorr@gaen.org |
e06e81a6741eb95516fe31a5939b00108fdf6c0c | 7a92cfe4f12c3eda0cb1e30e770e42fde1342873 | /Source/MyProject/Trap.h | 231ca3f309950f5ebf098a97d9f03a8b25b682a9 | [] | no_license | Tzarski/TGP-Group-Project | e2d5a9dfb48eff7cf343026fe05e21fe793a208b | f729543aad2115cd150206a2999ce1196fb00e8a | refs/heads/master | 2022-01-14T02:35:38.040097 | 2019-04-30T07:37:36 | 2019-04-30T07:37:36 | 167,528,818 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 784 | h | // Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include <EngineGlobals.h>
#include <Runtime/Engine/Classes/Engine/Engine.h>
#include "../Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperSprite.h"
#include "../Plugins/2D/Paper2D/Source/Paper2D/Classes/PaperSpriteComponent.h"
#include "GameFramework/Actor.h"
#include "Trap.generated.h"
UCLASS()
class MYPROJECT_API ATrap : public AActor
{
GENERATED_BODY()
public:
// Sets default values for this actor's properties
ATrap(const FObjectInitializer& PCIP);
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
class UPaperSpriteComponent* BallComponent;
};
| [
"luke.burtos@outlook.com"
] | luke.burtos@outlook.com |
ba9a05f36159e15ba90d762cf4efced7e140ee47 | e4d601b0750bd9dcc0e580f1f765f343855e6f7a | /kaldi-wangke/src/lat/phone-align-lattice.cc | a8da7b76a0fa2f78fd67de59c286bda45b4cefc1 | [
"MIT",
"Apache-2.0",
"LicenseRef-scancode-public-domain"
] | permissive | PeiwenWu/Adaptation-Interspeech18 | 01b426cd6d6a2d7a896aacaf4ad01eb3251151f7 | 576206abf8d1305e4a86891868ad97ddfb2bbf84 | refs/heads/master | 2021-03-03T04:16:43.146100 | 2019-11-25T05:44:27 | 2019-11-25T05:44:27 | 245,930,967 | 1 | 0 | MIT | 2020-03-09T02:57:58 | 2020-03-09T02:57:57 | null | UTF-8 | C++ | false | false | 17,365 | cc | // lat/phone-align-lattice.cc
// Copyright 2012-2013 Microsoft Corporation
// Johns Hopkins University (Author: Daniel Povey)
// See ../../COPYING for clarification regarding multiple authors
//
// 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
//
// THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
// WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
// MERCHANTABLITY OR NON-INFRINGEMENT.
// See the Apache 2 License for the specific language governing permissions and
// limitations under the License.
#include "lat/phone-align-lattice.h"
#include "hmm/transition-model.h"
#include "util/stl-utils.h"
namespace kaldi {
class LatticePhoneAligner {
public:
typedef CompactLatticeArc::StateId StateId;
typedef CompactLatticeArc::Label Label;
class ComputationState { /// The state of the computation in which,
/// along a single path in the lattice, we work out the phone
/// boundaries and output phone-aligned arcs. [These may or may not have
/// words on them; the word symbols are not aligned with anything.
public:
/// Advance the computation state by adding the symbols and weights
/// from this arc. Gets rid of the weight and puts it in "weight" which
/// will be put on the output arc; this keeps the state-space small.
void Advance(const CompactLatticeArc &arc, const PhoneAlignLatticeOptions &opts,
LatticeWeight *weight) {
const std::vector<int32> &string = arc.weight.String();
transition_ids_.insert(transition_ids_.end(),
string.begin(), string.end());
if (arc.ilabel != 0 && !opts.replace_output_symbols) // note: arc.ilabel==arc.olabel (acceptor)
word_labels_.push_back(arc.ilabel);
*weight = Times(weight_, arc.weight.Weight());
weight_ = LatticeWeight::One();
}
/// If it can output a whole phone, it will do so, will put it in arc_out,
/// and return true; else it will return false. If it detects an error
/// condition and *error = false, it will set *error to true and print
/// a warning. In this case it will still output phone arcs, they will
/// just be inaccurate. Of course once *error is set, something has gone
/// wrong so don't trust the output too fully.
/// Note: the "next_state" of the arc will not be set, you have to do that
/// yourself.
bool OutputPhoneArc(const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLatticeArc *arc_out,
bool *error);
/// This will succeed (and output the arc) if we have >1 word in words_;
/// the arc won't have any transition-ids on it. This is intended to fix
/// a particular pathology where too many words were pending and we had
/// blowup.
bool OutputWordArc(const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLatticeArc *arc_out,
bool *error);
bool IsEmpty() { return (transition_ids_.empty() && word_labels_.empty()); }
/// FinalWeight() will return "weight" if both transition_ids
/// and word_labels are empty, otherwise it will return
/// Weight::Zero().
LatticeWeight FinalWeight() { return (IsEmpty() ? weight_ : LatticeWeight::Zero()); }
/// This function may be called when you reach the end of
/// the lattice and this structure hasn't voluntarily
/// output words using "OutputArc". If IsEmpty() == false,
/// then you can call this function and it will output
/// an arc. The only
/// non-error state in which this happens, is when a word
/// (or silence) has ended, but we don't know that it's
/// ended because we haven't seen the first transition-id
/// from the next word. Otherwise (error state), the output
/// will consist of partial words, and this will only
/// happen for lattices that were somehow broken, i.e.
/// had not reached the final state.
void OutputArcForce(const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLatticeArc *arc_out,
bool *error);
size_t Hash() const {
VectorHasher<int32> vh;
return vh(transition_ids_) + 90647 * vh(word_labels_);
// 90647 is an arbitrary largish prime number.
// We don't bother including the weight in the hash--
// we don't really expect duplicates with the same vectors
// but different weights, and anyway, this is only an
// efficiency issue.
}
// Just need an arbitrary complete order.
bool operator == (const ComputationState &other) const {
return (transition_ids_ == other.transition_ids_
&& word_labels_ == other.word_labels_
&& weight_ == other.weight_);
}
ComputationState(): weight_(LatticeWeight::One()) { } // initial state.
ComputationState(const ComputationState &other):
transition_ids_(other.transition_ids_), word_labels_(other.word_labels_),
weight_(other.weight_) { }
private:
std::vector<int32> transition_ids_;
std::vector<int32> word_labels_;
LatticeWeight weight_; // contains two floats.
};
struct Tuple {
Tuple(StateId input_state, ComputationState comp_state):
input_state(input_state), comp_state(comp_state) {}
StateId input_state;
ComputationState comp_state;
};
struct TupleHash {
size_t operator() (const Tuple &state) const {
return state.input_state + 102763 * state.comp_state.Hash();
// 102763 is just an arbitrary prime number
}
};
struct TupleEqual {
bool operator () (const Tuple &state1, const Tuple &state2) const {
// treat this like operator ==
return (state1.input_state == state2.input_state
&& state1.comp_state == state2.comp_state);
}
};
typedef unordered_map<Tuple, StateId, TupleHash, TupleEqual> MapType;
StateId GetStateForTuple(const Tuple &tuple, bool add_to_queue) {
MapType::iterator iter = map_.find(tuple);
if (iter == map_.end()) { // not in map.
StateId output_state = lat_out_->AddState();
map_[tuple] = output_state;
if (add_to_queue)
queue_.push_back(std::make_pair(tuple, output_state));
return output_state;
} else {
return iter->second;
}
}
void ProcessFinal(Tuple tuple, StateId output_state) {
// ProcessFinal is only called if the input_state has
// final-prob of One(). [else it should be zero. This
// is because we called CreateSuperFinal().]
if (tuple.comp_state.IsEmpty()) { // computation state doesn't have
// anything pending.
std::vector<int32> empty_vec;
CompactLatticeWeight cw(tuple.comp_state.FinalWeight(), empty_vec);
lat_out_->SetFinal(output_state, Plus(lat_out_->Final(output_state), cw));
} else {
// computation state has something pending, i.e. input or
// output symbols that need to be flushed out. Note: OutputArc() would
// have returned false or we wouldn't have been called, so we have to
// force it out.
CompactLatticeArc lat_arc;
tuple.comp_state.OutputArcForce(tmodel_, opts_, &lat_arc, &error_);
lat_arc.nextstate = GetStateForTuple(tuple, true); // true == add to queue.
// The final-prob stuff will get called again from ProcessQueueElement().
// Note: because we did CreateSuperFinal(), this final-state on the input
// lattice will have no output arcs (and unit final-prob), so there will be
// no complications with processing the arcs from this state (there won't
// be any).
KALDI_ASSERT(output_state != lat_arc.nextstate);
lat_out_->AddArc(output_state, lat_arc);
}
}
void ProcessQueueElement() {
KALDI_ASSERT(!queue_.empty());
Tuple tuple = queue_.back().first;
StateId output_state = queue_.back().second;
queue_.pop_back();
// First thing is-- we see whether the computation-state has something
// pending that it wants to output. In this case we don't do
// anything further. This is a chosen behavior similar to the
// epsilon-sequencing rules encoded by the filters in
// composition.
CompactLatticeArc lat_arc;
Tuple tuple2(tuple); // temp
if (tuple.comp_state.OutputPhoneArc(tmodel_, opts_, &lat_arc, &error_) ||
tuple.comp_state.OutputWordArc(tmodel_, opts_, &lat_arc, &error_)) {
// note: this function changes the tuple (when it returns true).
lat_arc.nextstate = GetStateForTuple(tuple, true); // true == add to queue,
// if not already present.
KALDI_ASSERT(output_state != lat_arc.nextstate);
lat_out_->AddArc(output_state, lat_arc);
} else {
// when there's nothing to output, we'll process arcs from the input-state.
// note: it would in a sense be valid to do both (i.e. process the stuff
// above, and also these), but this is a bit like the epsilon-sequencing
// stuff in composition: we avoid duplicate arcs by doing it this way.
if (lat_.Final(tuple.input_state) != CompactLatticeWeight::Zero()) {
KALDI_ASSERT(lat_.Final(tuple.input_state) == CompactLatticeWeight::One());
// ... since we did CreateSuperFinal.
ProcessFinal(tuple, output_state);
}
// Now process the arcs. Note: final-state shouldn't have any arcs.
for(fst::ArcIterator<CompactLattice> aiter(lat_, tuple.input_state);
!aiter.Done(); aiter.Next()) {
const CompactLatticeArc &arc = aiter.Value();
Tuple next_tuple(tuple);
LatticeWeight weight;
next_tuple.comp_state.Advance(arc, opts_, &weight);
next_tuple.input_state = arc.nextstate;
StateId next_output_state = GetStateForTuple(next_tuple, true); // true == add to queue,
// if not already present.
// We add an epsilon arc here (as the input and output happens
// separately)... the epsilons will get removed later.
KALDI_ASSERT(next_output_state != output_state);
lat_out_->AddArc(output_state,
CompactLatticeArc(0, 0,
CompactLatticeWeight(weight, std::vector<int32>()),
next_output_state));
}
}
}
LatticePhoneAligner(const CompactLattice &lat,
const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLattice *lat_out):
lat_(lat), tmodel_(tmodel), opts_(opts), lat_out_(lat_out),
error_(false) {
fst::CreateSuperFinal(&lat_); // Creates a super-final state, so the
// only final-probs are One().
}
// Removes epsilons; also removes unreachable states...
// not sure if these would exist if original was connected.
// This also replaces the temporary symbols for the silence
// and partial-words, with epsilons, if we wanted epsilons.
void RemoveEpsilonsFromLattice() {
RmEpsilon(lat_out_, true); // true = connect.
}
bool AlignLattice() {
lat_out_->DeleteStates();
if (lat_.Start() == fst::kNoStateId) {
KALDI_WARN << "Trying to word-align empty lattice.";
return false;
}
ComputationState initial_comp_state;
Tuple initial_tuple(lat_.Start(), initial_comp_state);
StateId start_state = GetStateForTuple(initial_tuple, true); // True = add this to queue.
lat_out_->SetStart(start_state);
while (!queue_.empty())
ProcessQueueElement();
if (opts_.remove_epsilon)
RemoveEpsilonsFromLattice();
return !error_;
}
CompactLattice lat_;
const TransitionModel &tmodel_;
const PhoneAlignLatticeOptions &opts_;
CompactLattice *lat_out_;
std::vector<std::pair<Tuple, StateId> > queue_;
MapType map_; // map from tuples to StateId.
bool error_;
};
bool LatticePhoneAligner::ComputationState::OutputPhoneArc(
const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLatticeArc *arc_out,
bool *error) {
if (transition_ids_.empty()) return false;
int32 phone = tmodel.TransitionIdToPhone(transition_ids_[0]);
// we assume the start of transition_ids_ is the start of the phone;
// this is a precondition.
size_t len = transition_ids_.size(), i;
// Keep going till we reach a "final" transition-id; note, if
// reorder==true, we have to go a bit further after this.
for (i = 0; i < len; i++) {
int32 tid = transition_ids_[i];
int32 this_phone = tmodel.TransitionIdToPhone(tid);
if (this_phone != phone && ! *error) { // error condition: should have
// reached final transition-id first.
*error = true;
KALDI_WARN << phone << " -> " << this_phone;
KALDI_WARN << "Phone changed before final transition-id found "
"[broken lattice or mismatched model or wrong --reorder option?]";
}
if (tmodel.IsFinal(tid))
break;
}
if (i == len) return false; // fell off loop.
i++; // go past the one for which IsFinal returned true.
if (opts.reorder) // we have to consume the following self-loop transition-ids.
while (i < len && tmodel.IsSelfLoop(transition_ids_[i])) i++;
if (i == len) return false; // we don't know if it ends here... so can't output arc.
// interpret i as the number of transition-ids to consume.
std::vector<int32> tids_out(transition_ids_.begin(),
transition_ids_.begin()+i);
Label output_label = 0;
if (!word_labels_.empty()) {
output_label = word_labels_[0];
word_labels_.erase(word_labels_.begin(), word_labels_.begin()+1);
}
if (opts.replace_output_symbols)
output_label = phone;
*arc_out = CompactLatticeArc(output_label, output_label,
CompactLatticeWeight(weight_, tids_out),
fst::kNoStateId);
transition_ids_.erase(transition_ids_.begin(), transition_ids_.begin()+i);
weight_ = LatticeWeight::One(); // we just output the weight.
return true;
}
bool LatticePhoneAligner::ComputationState::OutputWordArc(
const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLatticeArc *arc_out,
bool *error) {
// output a word but no phones.
if (word_labels_.size() < 2) return false;
int32 output_label = word_labels_[0];
word_labels_.erase(word_labels_.begin(), word_labels_.begin()+1);
*arc_out = CompactLatticeArc(output_label, output_label,
CompactLatticeWeight(weight_, std::vector<int32>()),
fst::kNoStateId);
weight_ = LatticeWeight::One(); // we just output the weight, so set it to one.
return true;
}
void LatticePhoneAligner::ComputationState::OutputArcForce(
const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLatticeArc *arc_out,
bool *error) {
KALDI_ASSERT(!IsEmpty());
int32 phone = -1; // This value -1 will never be used,
// although it might not be obvious from superficially checking
// the code. IsEmpty() would be true if we had transition_ids_.empty()
// and opts.replace_output_symbols, so we would already die by assertion;
// in fact, this function would neve be called.
if (!transition_ids_.empty()) { // Do some checking here.
int32 tid = transition_ids_[0];
phone = tmodel.TransitionIdToPhone(tid);
int32 num_final = 0;
for (int32 i = 0; i < transition_ids_.size(); i++) { // A check.
int32 this_tid = transition_ids_[i];
int32 this_phone = tmodel.TransitionIdToPhone(this_tid);
bool is_final = tmodel.IsFinal(this_tid); // should be exactly one.
if (is_final) num_final++;
if (this_phone != phone && ! *error) {
KALDI_WARN << "Mismatch in phone: error in lattice or mismatched transition model?";
*error = true;
}
}
if (num_final != 1 && ! *error) {
KALDI_WARN << "Problem phone-aligning lattice: saw " << num_final
<< " final-states in last phone in lattice (forced out?) "
<< "Producing partial lattice.";
*error = true;
}
}
Label output_label = 0;
if (!word_labels_.empty()) {
output_label = word_labels_[0];
word_labels_.erase(word_labels_.begin(), word_labels_.begin()+1);
}
if (opts.replace_output_symbols)
output_label = phone;
*arc_out = CompactLatticeArc(output_label, output_label,
CompactLatticeWeight(weight_, transition_ids_),
fst::kNoStateId);
transition_ids_.clear();
weight_ = LatticeWeight::One(); // we just output the weight.
}
bool PhoneAlignLattice(const CompactLattice &lat,
const TransitionModel &tmodel,
const PhoneAlignLatticeOptions &opts,
CompactLattice *lat_out) {
LatticePhoneAligner aligner(lat, tmodel, opts, lat_out);
return aligner.AlignLattice();
}
} // namespace kaldi
| [
"wangkenpu@foxmail.com"
] | wangkenpu@foxmail.com |
c942ee41bf50892948987bfb87b7918ac1bda56d | f1e573b5067f824c61e39ac241740b38b242adb7 | /comp/compressedfespace.cpp | 41e41a9bb5921c12c6c3177dc093bbd8503cd4db | [] | no_license | adrianschroeter/ngsolve | 698cc3a0c916ed9e40f63d8a768ac495c1960592 | 10dd2fa45dfd5fde72027eb22af2c7488feb2252 | refs/heads/master | 2020-03-27T10:15:16.395630 | 2018-08-27T14:04:33 | 2018-08-27T15:15:50 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,809 | cpp | #include <comp.hpp>
#include "compressedfespace.hpp"
namespace ngcomp
{
CompressedFESpace::CompressedFESpace (shared_ptr<FESpace> bfes)
: FESpace (bfes->GetMeshAccess(), bfes->GetFlags()), space(bfes)
{
type = "wrapped-" + space->type;
for (auto vb : {VOL, BND, BBND, BBBND})
{
evaluator[vb] = space->GetEvaluator(vb);
flux_evaluator[vb] = space->GetFluxEvaluator(vb);
integrator[vb] = space->GetIntegrator(vb);
}
iscomplex = space->IsComplex();
}
void CompressedFESpace::Update(LocalHeap & lh)
{
//space->Update(lh); // removed as it may override changed doftypes
const int ndofall = space->GetNDof();
all2comp.SetSize(ndofall);
comp2all.SetSize(ndofall);
if (active_dofs && active_dofs->Size() != ndofall)
throw Exception("active_dofs size doesn't match FESpace (anymore?).");
int ndof = 0;
for (int i : Range(ndofall))
{
if ( ( active_dofs && (active_dofs->Test(i)))
|| ( (!active_dofs) && ((space->GetDofCouplingType(i) & VISIBLE_DOF))))
{
comp2all[ndof] = i;
all2comp[i] = ndof++;
}
else
{
all2comp[i] = -1;
}
}
comp2all.SetSize(ndof);
ctofdof.SetSize(ndof);
for (int i : Range(ndof))
ctofdof[i] = space->GetDofCouplingType(comp2all[i]);
(*testout) << "dof mapping of the wrapper space:" << endl;
for (int i : Range(ndof))
(*testout) << i << " -> " << comp2all[i] << endl;
SetNDof(ndof);
FESpace::FinalizeUpdate (lh);
}
FiniteElement & CompressedFESpace::GetFE (ElementId ei, Allocator & lh) const
{
return space->GetFE(ei,lh);
}
void CompressedFESpace::GetDofNrs (ElementId ei, Array<DofId> & dnums) const
{
space->GetDofNrs(ei,dnums);
WrapDofs(dnums);
}
void CompressedFESpace::GetElementDofsOfType (ElementId ei, Array<DofId> & dnums, COUPLING_TYPE ctype) const
{
space->GetElementDofsOfType(ei,dnums,ctype);
}
void CompressedFESpace::GetDofNrs (NodeId ni, Array<DofId> & dnums) const
{
space->GetDofNrs(ni,dnums);
WrapDofs(dnums);
}
void CompressedFESpace::GetVertexDofNrs (int vnr, Array<DofId> & dnums) const
{
space->GetVertexDofNrs(vnr,dnums);
WrapDofs(dnums);
}
/// get dofs on edge enr
void CompressedFESpace::GetEdgeDofNrs (int ednr, Array<DofId> & dnums) const
{
space->GetEdgeDofNrs(ednr,dnums);
WrapDofs(dnums);
}
/// get dofs on face fnr
void CompressedFESpace::GetFaceDofNrs (int fanr, Array<DofId> & dnums) const
{
space->GetFaceDofNrs(fanr,dnums);
WrapDofs(dnums);
}
/// get dofs on element (=cell) elnr
void CompressedFESpace::GetInnerDofNrs (int elnr, Array<DofId> & dnums) const
{
space->GetInnerDofNrs(elnr,dnums);
WrapDofs(dnums);
}
}
| [
"christoph.lehrenfeld@gmail.com"
] | christoph.lehrenfeld@gmail.com |
71b21b5263e99ce0e860888a1d9dcc8ba95b50d3 | 712e30a644d5251eb0b7ba29476e9c3b7b575a01 | /tests/unittests/lit_cases/test_dnnl/test_dequantizelinear_axis_dnnl.cc | 3a11d2abadfa1192b974400c923467f3c2a85dc9 | [
"Apache-2.0"
] | permissive | dj176050/heterogeneity-aware-lowering-and-optimization | 9baee6e75777e87d277e209e811bd69d903aae6a | 5ca73754671fa595436fe32b69fe96145b6164b0 | refs/heads/master | 2023-04-01T11:14:51.544266 | 2021-04-13T05:12:14 | 2021-04-13T05:12:14 | 313,488,852 | 0 | 3 | Apache-2.0 | 2021-04-13T05:12:15 | 2020-11-17T02:49:06 | C++ | UTF-8 | C++ | false | false | 2,237 | cc | //===-test_dequantizelinear_axis_dnnl.cc-----------------------------------------------------------===//
//
// Copyright (C) 2019-2020 Alibaba Group Holding Limited.
//
// 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.
// =============================================================================
// clang-format off
// Testing CXX Code Gen using ODLA API on dnnl
// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_0.pb
// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/output_0.pb
// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_1.pb
// RUN: %halo_compiler -target cxx -o %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.cc -x onnx -emit-data-as-c %data_path/test_dequantizelinear_axis/test_data_set_0/input_2.pb
// RUN: %halo_compiler -target cxx -batch-size 1 %halo_compile_flags %data_path/test_dequantizelinear_axis/model.onnx -o %t.cc
// RUN: %cxx -c -fPIC -o %t.o %t.cc -I%odla_path/include
// RUN: %cxx -g %s %t.o %t.bin -I%T -I%odla_path/include -I%unittests_path -I%data_path/test_dequantizelinear_axis/test_data_set_0 %odla_link %device_link -lodla_dnnl -o %t_dnnl.exe -Wno-deprecated-declarations
// RUN: %t_dnnl.exe 0.0001 0 dnnl %data_path/test_dequantizelinear_axis | FileCheck %s
// CHECK: Result Pass
// clang-format on
// XFAIL: *
#include "test_dequantizelinear_axis_dnnl.cc.tmp.main.cc.in"
| [
"74580362+xuhongyao@users.noreply.github.com"
] | 74580362+xuhongyao@users.noreply.github.com |
78cb243400a10c2b1037aee377195609a7bb1765 | ff5b427352226fc308b8f10ebce3f563c51cf9bd | /Algorithms/Implementation/Flatland Space Stations.cpp | 67c8e297d19421bdca61cac4bd7b7277991173b0 | [] | no_license | davidffa/HackerRank-Cpp | 622520cab05764abde301ce44e2a8730aa28e83c | 9bcbbcea8a66811d182915eedfb6965d7907ea01 | refs/heads/master | 2022-11-05T11:00:42.827861 | 2020-06-21T20:45:42 | 2020-06-21T20:45:42 | 272,500,629 | 3 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 551 | cpp | #include <bits/stdc++.h>
using namespace std;
int getMax(int l, int r) {
int ans = 0;
if (r - l == 1) return 0;
for (int i=l+1; i<r; i++)
ans = max(ans, min(i-l, r-i));
return ans;
}
int main() {
int n, m, l = 0, r = 0;
cin >> n >> m;
int arr[m];
for (int i=0; i<m; i++)
cin >> arr[i];
sort(arr, arr+m);
int ans = arr[0];
for (int i=1; i<m; i++) {
l = arr[i-1];
r = arr[i];
ans = max(ans, getMax(l, r));
}
cout << max(ans, n-arr[m-1]-1);
return 0;
}
| [
"davidfilipeamorim@gmail.com"
] | davidfilipeamorim@gmail.com |
e3a9d45ab0fbc66f7631349506b6c83296caf9b9 | 1b234767e1cebf78d5d27a1bc60ec6c21b5f2f85 | /c++/src/tree.cpp | 7497e57e4c7d51bb80d7dd353d8e3a146c070b83 | [] | no_license | tudang/diversity | e97206d1afb72aa893b2d310878f763aa561776b | fa91c7dfb21e479111792477985c3daaeb7417a7 | refs/heads/master | 2020-05-22T01:11:36.776328 | 2019-02-18T16:19:18 | 2019-02-18T16:19:18 | 56,982,723 | 0 | 1 | null | null | null | null | UTF-8 | C++ | false | false | 2,836 | cpp | #include <iostream>
using namespace std;
struct node {
int data;
struct node *left;
struct node *right;
};
class Tree {
private:
struct node *root;
public:
Tree() { root = NULL; }
struct node* getRoot() {
return root;
}
void insert(int data) {
struct node *tmp_node = (struct node*) malloc(sizeof(struct node));
tmp_node->data = data;
tmp_node->left = NULL;
tmp_node->right = NULL;
if (root == NULL) {
root = tmp_node;
return;
}
struct node *current = root;
struct node *parent = NULL;
while (1) {
parent = current;
if (parent->data < data) {
current = current->right;
if (current == NULL) {
parent->right = tmp_node;
return;
}
}
else if (parent->data > data) {
current = current->left;
if (current == NULL) {
parent->left = tmp_node;
return;
}
}
else
return;
}
}
struct node* search(int data) {
struct node *current = root;
while (current != NULL) {
if (current->data == data)
return current;
else if (current->data < data)
current = current->right;
else
current = current->left;
}
return NULL;
}
void preorder(struct node* current) {
if (current == NULL)
return;
cout << current->data << " ";
preorder(current->left);
preorder(current->right);
}
void preorderTraversal() {
preorder(root);
}
void inorder(struct node* current) {
if (current == NULL)
return;
inorder(current->left);
cout << current->data << " ";
inorder(current->right);
}
void inorderTraversal() {
inorder(root);
}
void postOrder(struct node* current) {
if (current == NULL)
return;
postOrder(current->left);
postOrder(current->right);
cout << current->data << " ";
}
void postorderTraversal() {
postOrder(root);
}
};
int main() {
Tree tree = Tree();
tree.insert(5);
tree.insert(3);
tree.insert(2);
tree.insert(4);
tree.insert(8);
tree.insert(7);
tree.insert(10);
cout << "PreOrder Traversal: ";
tree.preorderTraversal();
cout << endl << "InOrder Traversal: ";
tree.inorderTraversal();
cout << endl << "Postorder Traversal: ";
tree.postorderTraversal();
struct node* r = tree.search(4);
cout << endl << "Found r->data " << r->data << endl;
return 0;
} | [
"huynh.tu.dang@usi.ch"
] | huynh.tu.dang@usi.ch |
6b93e3ef88bcd463ca2f9cdb10e54867a1013199 | 6a749cb3e6da88883636e02cd420d96235884470 | /c++/red_belt/third_week/linked_list.cpp | 54b3c2a8fd1ec59e1d91dc19837f3638f1022d0b | [] | no_license | sAusk3/coursera | beaba906c8addcdfd8c3ee687b72c86a61f0d1f0 | 0520326fda908eac98b08c6361929c120c694d5b | refs/heads/master | 2020-08-23T18:05:10.448645 | 2019-10-21T15:45:57 | 2019-10-21T15:45:57 | null | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 3,394 | cpp | #include "test_runner.h"
#include <vector>
using namespace std;
template <typename T>
class LinkedList {
public:
struct Node {
T value;
Node* next = nullptr;
Node(const T& value_, Node* next_) {
value = value_;
next = next_;
}
};
~LinkedList() {
while (head != nullptr) {
Node* obj = head;
head = head->next;
delete obj;
}
}
void PushFront(const T& value) {
Node* obj = new Node(value, head);
head = obj;
}
void InsertAfter(Node* node, const T& value) {
if (node == nullptr) {
PushFront(value);
} else {
Node* obj = new Node(value, node->next);
node->next = obj;
}
}
void RemoveAfter(Node* node) {
if (node == nullptr) {
PopFront();
} else {
if (node->next != nullptr) {
Node* obj = node->next;
node->next = node->next->next;
delete obj;
}
}
}
void PopFront() {
if (head != nullptr) {
Node* obj = head;
head = head->next;
delete obj;
}
}
Node* GetHead() { return head; }
const Node* GetHead() const { return head; }
private:
Node* head = nullptr;
};
template <typename T>
vector<T> ToVector(const LinkedList<T>& list) {
vector<T> result;
for (auto node = list.GetHead(); node; node = node->next) {
result.push_back(node->value);
}
return result;
}
void TestPushFront() {
LinkedList<int> list;
list.PushFront(1);
ASSERT_EQUAL(list.GetHead()->value, 1);
list.PushFront(2);
ASSERT_EQUAL(list.GetHead()->value, 2);
list.PushFront(3);
ASSERT_EQUAL(list.GetHead()->value, 3);
const vector<int> expected = {3, 2, 1};
ASSERT_EQUAL(ToVector(list), expected);
}
void TestInsertAfter() {
LinkedList<string> list;
list.PushFront("a");
auto head = list.GetHead();
ASSERT(head);
ASSERT_EQUAL(head->value, "a");
list.InsertAfter(head, "b");
const vector<string> expected1 = {"a", "b"};
ASSERT_EQUAL(ToVector(list), expected1);
list.InsertAfter(head, "c");
const vector<string> expected2 = {"a", "c", "b"};
ASSERT_EQUAL(ToVector(list), expected2);
}
void TestRemoveAfter() {
LinkedList<int> list;
for (int i = 1; i <= 5; ++i) {
list.PushFront(i);
}
const vector<int> expected = {5, 4, 3, 2, 1};
ASSERT_EQUAL(ToVector(list), expected);
auto next_to_head = list.GetHead()->next;
list.RemoveAfter(next_to_head); // удаляем 3
list.RemoveAfter(next_to_head); // удаляем 2
const vector<int> expected1 = {5, 4, 1};
ASSERT_EQUAL(ToVector(list), expected1);
while (list.GetHead()->next) {
list.RemoveAfter(list.GetHead());
}
ASSERT_EQUAL(list.GetHead()->value, 5);
}
void TestPopFront() {
LinkedList<int> list;
for (int i = 1; i <= 5; ++i) {
list.PushFront(i);
}
for (int i = 1; i <= 5; ++i) {
list.PopFront();
}
ASSERT(list.GetHead() == nullptr);
}
int main() {
TestRunner tr;
RUN_TEST(tr, TestPushFront);
RUN_TEST(tr, TestInsertAfter);
RUN_TEST(tr, TestRemoveAfter);
RUN_TEST(tr, TestPopFront);
return 0;
}
| [
"sergei.strizhenok@yandex.ru"
] | sergei.strizhenok@yandex.ru |
f16da77fed8fe42623ba143649ad4df892463b21 | 188fb8ded33ad7a2f52f69975006bb38917437ef | /Fluid/processor2/0.5/cellDisplacement | 166f3cd0d7673442fa1ad0fb892d19ce65d506b4 | [] | no_license | abarcaortega/Tuto_2 | 34a4721f14725c20471ff2dc8d22b52638b8a2b3 | 4a84c22efbb9cd2eaeda92883343b6910e0941e2 | refs/heads/master | 2020-08-05T16:11:57.674940 | 2019-10-04T09:56:09 | 2019-10-04T09:56:09 | 212,573,883 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 14,428 | /*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0.5";
object cellDisplacement;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [0 1 0 0 0 0 0];
internalField nonuniform List<vector>
465
(
(0.0789588 0 0.0692764)
(0.0786837 0 0.0657074)
(0.0780434 0 0.0748973)
(0.0778285 0 0.0707785)
(0.0773746 0 0.0670433)
(0.0766802 0 0.0635903)
(0.077234 0 0.0797681)
(0.0770382 0 0.0752792)
(0.0766131 0 0.0711742)
(0.0759505 0 0.0673694)
(0.075042 0 0.0637909)
(0.0765334 0 0.0837713)
(0.0763196 0 0.0791233)
(0.0758936 0 0.0747949)
(0.0752417 0 0.0707359)
(0.074349 0 0.0669068)
(0.0732017 0 0.0632493)
(0.0717812 0 0.059715)
(0.075928 0 0.0868797)
(0.0756688 0 0.0822309)
(0.0752184 0 0.0778305)
(0.0745563 0 0.0736411)
(0.073664 0 0.0696406)
(0.0725251 0 0.0658013)
(0.0711169 0 0.0620837)
(0.0694185 0 0.0584504)
(0.0674054 0 0.0548662)
(0.0753915 0 0.0891658)
(0.0750727 0 0.084616)
(0.0745815 0 0.0802363)
(0.073894 0 0.0760196)
(0.0729907 0 0.0719476)
(0.0718478 0 0.0679985)
(0.0704427 0 0.0641459)
(0.0687528 0 0.0603743)
(0.0667534 0 0.0566501)
(0.0644157 0 0.0529409)
(0.0748984 0 0.0907097)
(0.0745136 0 0.0863255)
(0.073973 0 0.0820389)
(0.073251 0 0.0778576)
(0.0723243 0 0.0737783)
(0.0711691 0 0.0697929)
(0.0697595 0 0.0658727)
(0.0680712 0 0.0620058)
(0.0660812 0 0.0581772)
(0.0637569 0 0.0543587)
(0.0610682 0 0.0505232)
(0.0579809 0 0.0466429)
(0.0744262 0 0.0915886)
(0.0739744 0 0.08741)
(0.0733802 0 0.083266)
(0.0726174 0 0.0791727)
(0.0716608 0 0.0751365)
(0.0704855 0 0.0711557)
(0.0690653 0 0.06722)
(0.0673775 0 0.0633163)
(0.0653912 0 0.0594258)
(0.0630761 0 0.055527)
(0.0604027 0 0.0516066)
(0.0573372 0 0.0476376)
(0.0538428 0 0.0435893)
(0.0739566 0 0.0918711)
(0.07344 0 0.0879184)
(0.0727916 0 0.0839486)
(0.0719851 0 0.0799814)
(0.0709951 0 0.0760285)
(0.0697958 0 0.0720946)
(0.0683613 0 0.0681773)
(0.0666658 0 0.0642694)
(0.0646812 0 0.060361)
(0.0623745 0 0.056426)
(0.0597134 0 0.052448)
(0.0566678 0 0.0484161)
(0.053201 0 0.0443011)
(0.0492711 0 0.0400701)
(0.0448342 0 0.0356884)
(0.0734731 0 0.0916048)
(0.0728974 0 0.087893)
(0.072197 0 0.0841177)
(0.0713467 0 0.0803024)
(0.0703214 0 0.0764634)
(0.0690956 0 0.0726095)
(0.067643 0 0.0687435)
(0.065937 0 0.0648629)
(0.0639492 0 0.0609607)
(0.0616495 0 0.0570248)
(0.0590019 0 0.0530295)
(0.0559739 0 0.0489612)
(0.052535 0 0.0448046)
(0.0486394 0 0.0405258)
(0.0442457 0 0.0360921)
(0.0393076 0 0.0314627)
(0.0729657 0 0.0908406)
(0.0723372 0 0.0873756)
(0.0715884 0 0.0838028)
(0.0706958 0 0.0801553)
(0.0696352 0 0.0764515)
(0.0683816 0 0.072703)
(0.066909 0 0.0689156)
(0.0651905 0 0.0650903)
(0.0631975 0 0.0612231)
(0.0608997 0 0.0573048)
(0.0582638 0 0.0533205)
(0.0552607 0 0.0492564)
(0.0518485 0 0.0450866)
(0.0479858 0 0.0407827)
(0.043635 0 0.0363205)
(0.0387504 0 0.0316604)
(0.0332829 0 0.0267563)
(0.0271789 0 0.0215538)
(0.0724261 0 0.0896166)
(0.0717519 0 0.0863902)
(0.0709603 0 0.0830295)
(0.0700273 0 0.079557)
(0.0689326 0 0.0760031)
(0.0676514 0 0.0723792)
(0.0661582 0 0.0686927)
(0.064426 0 0.0649469)
(0.0624268 0 0.0611403)
(0.0601306 0 0.0572667)
(0.0575057 0 0.0533157)
(0.0545199 0 0.0492735)
(0.0511372 0 0.0451218)
(0.0473129 0 0.0408276)
(0.0430047 0 0.0363615)
(0.0381742 0 0.0316954)
(0.0327735 0 0.0267839)
(0.0267507 0 0.0215736)
(0.0200495 0 0.0159993)
(0.0718504 0 0.0879648)
(0.0711369 0 0.0849629)
(0.0703059 0 0.0818067)
(0.0693376 0 0.0785196)
(0.0682112 0 0.0751266)
(0.0669035 0 0.0716419)
(0.0653898 0 0.0680743)
(0.0636439 0 0.0644285)
(0.0616379 0 0.060705)
(0.0593426 0 0.0569001)
(0.0567267 0 0.0530055)
(0.0537577 0 0.0490093)
(0.0504001 0 0.0448945)
(0.046616 0 0.0406382)
(0.0423579 0 0.0362038)
(0.0375817 0 0.0315575)
(0.0322487 0 0.0266656)
(0.026309 0 0.0214758)
(0.0197084 0 0.015925)
(0.0123874 0 0.00993663)
(0.0712369 0 0.0858997)
(0.0704883 0 0.0831056)
(0.069625 0 0.0801537)
(0.0686265 0 0.0770571)
(0.0674702 0 0.0738289)
(0.0661376 0 0.0704938)
(0.0646044 0 0.0670595)
(0.062845 0 0.0635313)
(0.0608322 0 0.0599108)
(0.0585373 0 0.0561959)
(0.0559296 0 0.0523805)
(0.0529769 0 0.0484539)
(0.0496445 0 0.044401)
(0.0458951 0 0.0402009)
(0.0416892 0 0.0358267)
(0.0369764 0 0.0312372)
(0.0317114 0 0.0263928)
(0.0258562 0 0.0212537)
(0.0193587 0 0.0157585)
(0.0121606 0 0.0098314)
(0.0041964 0 0.00337957)
(0.0705871 0 0.0834319)
(0.0698093 0 0.0808362)
(0.0689179 0 0.0780795)
(0.0678909 0 0.0751653)
(0.0667097 0 0.0721116)
(0.0653546 0 0.0689352)
(0.0638034 0 0.0656463)
(0.0620313 0 0.0622507)
(0.060012 0 0.058751)
(0.0577175 0 0.0551461)
(0.0551178 0 0.0514313)
(0.0521811 0 0.0475975)
(0.0488736 0 0.043631)
(0.045159 0 0.0395129)
(0.0409987 0 0.0352183)
(0.0363514 0 0.0307154)
(0.0311644 0 0.0259573)
(0.0253949 0 0.0209004)
(0.0190037 0 0.015496)
(0.01193 0 0.00966598)
(0.00411465 0 0.00332281)
(0.0699039 0 0.0805618)
(0.0691012 0 0.0781533)
(0.0681841 0 0.0755802)
(0.067135 0 0.0728521)
(0.0659334 0 0.0699784)
(0.0645573 0 0.0669648)
(0.0629895 0 0.0638309)
(0.0612059 0 0.0605813)
(0.0591808 0 0.0572185)
(0.0568869 0 0.0537423)
(0.0542952 0 0.0501487)
(0.0513745 0 0.0464303)
(0.0480919 0 0.0425747)
(0.0444121 0 0.0385646)
(0.0402974 0 0.034377)
(0.0357075 0 0.0299818)
(0.0305977 0 0.0253396)
(0.0249301 0 0.0204118)
(0.0186486 0 0.015135)
(0.0116984 0 0.00943837)
(0.00403233 0 0.00324449)
(0.0691927 0 0.0772837)
(0.0683692 0 0.0750539)
(0.0674311 0 0.072661)
(0.0663626 0 0.0701149)
(0.0651413 0 0.0674147)
(0.0637489 0 0.0645754)
(0.0621668 0 0.0616067)
(0.0603731 0 0.0585155)
(0.058343 0 0.0553049)
(0.0560503 0 0.0519751)
(0.0534667 0 0.0485232)
(0.0505621 0 0.0449424)
(0.0473043 0 0.0412221)
(0.0436592 0 0.0373465)
(0.0395905 0 0.0332944)
(0.0350597 0 0.0290382)
(0.0300256 0 0.0245429)
(0.0244478 0 0.0197676)
(0.0182818 0 0.0146599)
(0.0114678 0 0.0091461)
(0.00395039 0 0.00314396)
(0.0684605 0 0.0735843)
(0.0676195 0 0.0715261)
(0.0666633 0 0.0693083)
(0.0655765 0 0.0669376)
(0.0643412 0 0.0644195)
(0.0629367 0 0.061762)
(0.0613412 0 0.058965)
(0.0595385 0 0.0560437)
(0.0575045 0 0.053)
(0.0552135 0 0.0498342)
(0.0526383 0 0.0465439)
(0.0497497 0 0.0431233)
(0.0465166 0 0.0395629)
(0.0429061 0 0.0358486)
(0.0388832 0 0.031961)
(0.034411 0 0.0278748)
(0.0294506 0 0.023558)
(0.0239621 0 0.0189709)
(0.0179026 0 0.0140641)
(0.0112269 0 0.00877638)
(0.0038702 0 0.00302086)
(0.067716 0 0.0694438)
(0.0668607 0 0.0675525)
(0.0658895 0 0.0655077)
(0.064788 0 0.0633149)
(0.0635404 0 0.0609805)
(0.0621236 0 0.0585017)
(0.060519 0 0.0558912)
(0.0587091 0 0.0531529)
(0.0566721 0 0.0502912)
(0.0543835 0 0.0473071)
(0.051817 0 0.0441988)
(0.0489444 0 0.0409612)
(0.0457357 0 0.037586)
(0.0421593 0 0.0340605)
(0.0381814 0 0.0303673)
(0.0337669 0 0.0264832)
(0.0288787 0 0.0223788)
(0.0234783 0 0.0180171)
(0.017525 0 0.0133518)
(0.0109756 0 0.00832556)
(0.00377781 0 0.00286307)
(0.0669699 0 0.0648356)
(0.0661026 0 0.0631087)
(0.0651189 0 0.0612362)
(0.0640048 0 0.0592223)
(0.0627448 0 0.0570711)
(0.0613208 0 0.0547855)
(0.059711 0 0.0523729)
(0.0578938 0 0.0498277)
(0.0558544 0 0.0471632)
(0.0535687 0 0.0443792)
(0.051011 0 0.041474)
(0.0481542 0 0.0384431)
(0.0449695 0 0.0352793)
(0.0414263 0 0.0319712)
(0.0374924 0 0.0285033)
(0.0331341 0 0.0248548)
(0.0283162 0 0.0209987)
(0.0230022 0 0.0169012)
(0.0171539 0 0.0125199)
(0.0107318 0 0.00780272)
(0.00369038 0 0.00268252)
(0.0662343 0 0.0597263)
(0.0653572 0 0.0581638)
(0.0643632 0 0.0564656)
(0.0632389 0 0.054635)
(0.0619696 0 0.0526757)
(0.0605391 0 0.0505923)
(0.058923 0 0.0483816)
(0.0571015 0 0.0460461)
(0.0550611 0 0.0435967)
(0.0527788 0 0.0410329)
(0.05023 0 0.0383532)
(0.0473887 0 0.0355541)
(0.0442271 0 0.0326291)
(0.0407158 0 0.0295685)
(0.0368242 0 0.0263585)
(0.03252 0 0.0229804)
(0.02777 0 0.0194103)
(0.0225398 0 0.0156177)
(0.0167938 0 0.0115644)
(0.010496 0 0.00720379)
(0.003606 0 0.00247599)
(0.0655232 0 0.0540749)
(0.0646381 0 0.0526795)
(0.0636355 0 0.05116)
(0.0625027 0 0.0495189)
(0.0612255 0 0.0477591)
(0.0597885 0 0.0458841)
(0.0581677 0 0.0438875)
(0.0563446 0 0.0417836)
(0.054304 0 0.0395694)
(0.0520254 0 0.0372476)
(0.0494853 0 0.0348178)
(0.0466587 0 0.0322771)
(0.0435189 0 0.0296203)
(0.040038 0 0.0268389)
(0.0361863 0 0.023921)
(0.0319335 0 0.0208503)
(0.0272479 0 0.0176057)
(0.0220974 0 0.0141604)
(0.0164492 0 0.0104808)
(0.0102705 0 0.00652566)
(0.00352532 0 0.00224233)
(0.0648523 0 0.047833)
(0.0639606 0 0.0466103)
(0.0629509 0 0.0452768)
(0.0618109 0 0.0438344)
(0.0605266 0 0.0422851)
(0.0590827 0 0.0406307)
(0.0574612 0 0.0388714)
(0.0556395 0 0.0370171)
(0.0535973 0 0.0350565)
(0.0513217 0 0.0329998)
(0.0487897 0 0.030846)
(0.0459767 0 0.0285927)
(0.0428572 0 0.0262356)
(0.0394042 0 0.0237674)
(0.0355896 0 0.0211781)
(0.0313843 0 0.0184538)
(0.0267586 0 0.0155765)
(0.0216824 0 0.012523)
(0.0161256 0 0.00926449)
(0.0100585 0 0.00576542)
(0.0034494 0 0.00198054)
(0.0642393 0 0.0409432)
(0.063342 0 0.0399022)
(0.0623265 0 0.0387656)
(0.0611806 0 0.037535)
(0.0598909 0 0.0362121)
(0.0584427 0 0.034799)
(0.0568197 0 0.0332984)
(0.0549968 0 0.0317077)
(0.0529548 0 0.0300258)
(0.0506825 0 0.0282612)
(0.0481578 0 0.0264128)
(0.0453572 0 0.0244789)
(0.0422558 0 0.0224556)
(0.0388279 0 0.0203373)
(0.0350464 0 0.0181156)
(0.0308839 0 0.0157793)
(0.0263122 0 0.0133133)
(0.0213032 0 0.0106983)
(0.0158294 0 0.00791051)
(0.00986421 0 0.00492017)
(0.0033796 0 0.00168965)
(0.0637032 0 0.0333391)
(0.0628015 0 0.0324924)
(0.0617812 0 0.0315675)
(0.0606306 0 0.0305654)
(0.0593365 0 0.0294876)
(0.0578848 0 0.0283361)
(0.0562597 0 0.0271131)
(0.0544358 0 0.0258146)
(0.0523943 0 0.024441)
(0.0501251 0 0.0229996)
(0.0476068 0 0.02149)
(0.0448167 0 0.0199107)
(0.0417308 0 0.0182589)
(0.0383243 0 0.0165303)
(0.0345713 0 0.0147184)
(0.0304455 0 0.0128143)
(0.0259204 0 0.0108063)
(0.0209698 0 0.00867911)
(0.0155683 0 0.00641382)
(0.00969233 0 0.00398697)
(0.00331764 0 0.0013687)
(0.0632652 0 0.0249437)
(0.06236 0 0.0243084)
(0.0613359 0 0.0236141)
(0.0601815 0 0.0228618)
(0.0588839 0 0.0220526)
(0.0574293 0 0.0211879)
(0.0558022 0 0.0202695)
(0.0539773 0 0.0192941)
(0.0519362 0 0.0182622)
(0.0496695 0 0.0171796)
(0.0471562 0 0.0160462)
(0.0443744 0 0.014861)
(0.0413008 0 0.0136222)
(0.0379114 0 0.0123268)
(0.0341811 0 0.0109701)
(0.0300849 0 0.00954577)
(0.0255974 0 0.00804533)
(0.020694 0 0.00645778)
(0.0153515 0 0.00476931)
(0.00954889 0 0.00296287)
(0.00326564 0 0.00101673)
(0.0629482 0 0.0156689)
(0.0620403 0 0.0152671)
(0.0610135 0 0.0148279)
(0.0598562 0 0.0143521)
(0.058556 0 0.0138404)
(0.0570991 0 0.0132937)
(0.0554704 0 0.0127133)
(0.0536445 0 0.0120971)
(0.0516036 0 0.0114455)
(0.0493384 0 0.0107623)
(0.0468285 0 0.0100474)
(0.0440524 0 0.00930063)
(0.0409874 0 0.00852078)
(0.0376099 0 0.00770612)
(0.0338957 0 0.00685393)
(0.0298204 0 0.00596036)
(0.0253597 0 0.00502028)
(0.0204903 0 0.004027)
(0.0151904 0 0.00297209)
(0.00944148 0 0.00184514)
(0.00322633 0 0.000632885)
(0.0627764 0 0.00540362)
(0.0618671 0 0.005264)
(0.0608387 0 0.00511145)
(0.0596798 0 0.0049462)
(0.058378 0 0.00476855)
(0.0569197 0 0.00457886)
(0.0552899 0 0.00437756)
(0.0534634 0 0.00416394)
(0.0514224 0 0.00393817)
(0.0491578 0 0.00370163)
(0.0466496 0 0.00345432)
(0.0438764 0 0.00319616)
(0.0408158 0 0.00292682)
(0.0374445 0 0.00264572)
(0.0337388 0 0.00235197)
(0.0296745 0 0.00204429)
(0.0252281 0 0.00172095)
(0.0203768 0 0.00137971)
(0.0150999 0 0.00101773)
(0.00938032 0 0.000631479)
(0.00320359 0 0.000216508)
)
;
boundaryField
{
inlet
{
type cellMotion;
value nonuniform 0();
}
outlet
{
type cellMotion;
value uniform (0 0 0);
}
flap
{
type cellMotion;
value nonuniform 0();
}
upperWall
{
type slip;
}
lowerWall
{
type slip;
}
frontAndBack
{
type empty;
}
procBoundary2to1
{
type processor;
value nonuniform List<vector>
17
(
(0.0730039 0 0.0926901)
(0.072468 0 0.0908039)
(0.0718885 0 0.0885225)
(0.071267 0 0.0858539)
(0.0706075 0 0.0827972)
(0.0699159 0 0.079344)
(0.0691998 0 0.0754787)
(0.0684687 0 0.071179)
(0.0677335 0 0.0664158)
(0.0670068 0 0.0611529)
(0.0663031 0 0.0553467)
(0.0656383 0 0.0489458)
(0.0650302 0 0.0418897)
(0.0644983 0 0.0341083)
(0.0640636 0 0.0255207)
(0.063749 0 0.016034)
(0.0635787 0 0.00553048)
)
;
}
procBoundary2to4
{
type processor;
value nonuniform List<vector>
11
(
(0.0789865 0 0.0733162)
(0.078014 0 0.0795309)
(0.0772063 0 0.0847194)
(0.0765525 0 0.0887772)
(0.0760183 0 0.0917866)
(0.0755639 0 0.0938766)
(0.0751546 0 0.09517)
(0.0747624 0 0.0957729)
(0.0743657 0 0.0957611)
(0.0739478 0 0.0952083)
(0.0734963 0 0.0941664)
)
;
}
procBoundary2to5
{
type processor;
value nonuniform List<vector>
34
(
(0.0799671 0 0.0630235)
(0.0795899 0 0.0601729)
(0.0781716 0 0.0624707)
(0.0781716 0 0.0624707)
(0.0774237 0 0.0594638)
(0.0757391 0 0.0603397)
(0.0757391 0 0.0603397)
(0.0738747 0 0.060377)
(0.0738747 0 0.060377)
(0.0724324 0 0.0570753)
(0.0700668 0 0.056262)
(0.0700668 0 0.056262)
(0.0680348 0 0.0528531)
(0.0650498 0 0.0512979)
(0.0650498 0 0.0512979)
(0.0617081 0 0.0492185)
(0.0617081 0 0.0492185)
(0.0585969 0 0.0454525)
(0.0544579 0 0.042687)
(0.0544579 0 0.042687)
(0.0498779 0 0.0394305)
(0.0498779 0 0.0394305)
(0.045398 0 0.0351243)
(0.0398431 0 0.031115)
(0.0398431 0 0.031115)
(0.0337745 0 0.0265925)
(0.0337745 0 0.0265925)
(0.0275913 0 0.0214253)
(0.02038 0 0.0159874)
(0.02038 0 0.0159874)
(0.0126087 0 0.00998478)
(0.0126087 0 0.00998478)
(0.00427673 0 0.00341562)
(0.00427673 0 0.00341562)
)
;
}
}
// ************************************************************************* //
| [
"aldo.abarca.ortega@gmail.com"
] | aldo.abarca.ortega@gmail.com | |
2ce25c1d94e53ab2a1308029f9eba96dd48e5970 | 8b47af4eed4a1b6c2b9150c5740fa849daf98b6e | /ExercicisExamen/Ex15/MyGLWidget.h | 30e0ea79150612d7b65e0b85016e01641a294440 | [] | no_license | QuimMarset/IDI-Labs | 3326014e071a7a62bc3e1a2b9cfb95a7091e3e79 | ffc7d3f21335f9e85b3481682884c3dc3f7be101 | refs/heads/master | 2023-05-13T06:57:48.032155 | 2017-06-05T20:20:58 | 2017-06-05T20:20:58 | 93,197,553 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,610 | h | #define GLM_FORCE_RADIANS
#include <QOpenGLFunctions_3_3_Core>
#include <QOpenGLWidget>
#include <QOpenGLShader>
#include <QOpenGLShaderProgram>
#include <QKeyEvent>
#include <QMouseEvent>
#include "glm/glm.hpp"
#include "glm/gtc/matrix_transform.hpp"
#include "model.h"
class MyGLWidget : public QOpenGLWidget, protected QOpenGLFunctions_3_3_Core
{
Q_OBJECT
public:
MyGLWidget (QWidget *parent=0);
~MyGLWidget ();
protected:
// initializeGL - Aqui incluim les inicialitzacions del contexte grafic.
virtual void initializeGL ( );
// paintGL - Mètode cridat cada cop que cal refrescar la finestra.
// Tot el que es dibuixa es dibuixa aqui.
virtual void paintGL ( );
// resizeGL - És cridat quan canvia la mida del widget
virtual void resizeGL (int width, int height);
// keyPressEvent - Es cridat quan es prem una tecla
virtual void keyPressEvent (QKeyEvent *event);
// mouse{Press/Release/Move}Event - Són cridades quan es realitza l'event
// corresponent de ratolí
virtual void mousePressEvent (QMouseEvent *event);
virtual void mouseReleaseEvent (QMouseEvent *event);
virtual void mouseMoveEvent (QMouseEvent *event);
private:
void createBuffers ();
void carregaShaders ();
void projectTransform ();
void viewTransform ();
void modelTransformTerra ();
void modelTransformPatricio1 ();
void modelTransformPatricio2 ();
void calculaCapsaModel ();
void iniCamera();
void enviaParametresIlum();
void enviaPosFocus();
// VAO i VBO names
GLuint VAO_Patr, VBO_PatrPos, VBO_PatrNorm, VBO_PatrMatamb, VBO_PatrMatdiff, VBO_PatrMatspec, VBO_PatrMatshin;
GLuint VAO_Terra, VBO_TerraPos, VBO_TerraNorm, VBO_TerraMatamb, VBO_TerraMatdiff, VBO_TerraMatspec, VBO_TerraMatshin;
// Program
QOpenGLShaderProgram *program;
// uniform locations
GLuint transLoc, projLoc, viewLoc;
// attribute locations
GLuint vertexLoc, normalLoc, matambLoc, matdiffLoc, matspecLoc, matshinLoc;
GLuint posFocusLoc,colFocusLoc,llumAmbLoc;
// model
Model patr;
// paràmetres calculats a partir de la capsa contenidora del model
glm::vec3 centrePatr,centreBaseCapsaPatr;
float escalaPatr1,escalaPatr2;
// radi de l'escena
float radiEsc;
float posX;
glm::mat4 View;
float angleCamera,zN,zF,rav,dist;
float l,r,b,t;
bool canviCamera;
glm::vec3 OBS,VRP,UP;
typedef enum {NONE, ROTATE} InteractiveAction;
InteractiveAction DoingInteractive;
int xClick, yClick;
float angleY,angleX;
bool perspectiva;
};
| [
"quim1996@hotmail.es"
] | quim1996@hotmail.es |
f232e3a5425734495187b489bb1ade547296fc41 | 752a176b0c4b2a75d78fbd6002e97a25d3ad4a34 | /Statement.hpp | 001effccfed5f9f650a0d010358eda7e26eabd09 | [] | no_license | haoyu0918/DBMS-in-Cpp | 15e07b25ce84bcfbc023ca22ac04fd0c305782a7 | bd42fd35a77c99996f16fe91639ae40d6f16f70a | refs/heads/master | 2022-11-13T21:13:16.620274 | 2020-06-29T06:36:42 | 2020-06-29T06:36:42 | 275,750,264 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 802 | hpp | //
// Statement.hpp
// Database
//
// Created by rick gessner on 3/20/19.
// Copyright © 2019 rick gessner. All rights reserved.
//
#ifndef Statement_hpp
#define Statement_hpp
#include "keywords.hpp"
#include <iostream>
namespace ECE141 {
class Tokenizer;
class Statement {
public:
Statement(Keywords aStatementType=Keywords::unknown_kw);
Statement(const Statement &aCopy);
virtual ~Statement();
virtual StatusResult parse(Tokenizer &aTokenizer);
Keywords getType() const {return stmtType;}
virtual const char* getStatementName() const {return "statement";}
virtual StatusResult run(std::ostream &aStream) const;
protected:
Keywords stmtType;
};
}
#endif /* Statement_hpp */
| [
"noreply@github.com"
] | noreply@github.com |
5d524d37d833ca85cbb85dd5b276834455089727 | 49105aa35b6373b9138c462c471f91cc91340791 | /MainUnit.cpp | 930399e31a1ffcc700ee12e8feeee58f834d9d82 | [] | no_license | PC-Contol/Window-Agent | 01d39482b2b2a2443498fa4c368a0463800501c6 | 82e9db7077d3a7c7be2e4c2d90d057a9bab55438 | refs/heads/master | 2021-01-19T15:02:44.003051 | 2015-04-05T17:51:20 | 2015-04-05T17:51:20 | 33,023,762 | 1 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 2,461 | cpp | //---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "MainUnit.h"
#include "WebServerThread.h"
#include "SystemInfoThread.h"
#include "About.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TMainForm *MainForm;
WebServerThread *wst;
SystemInfoThread *sit;
//---------------------------------------------------------------------------
__fastcall TMainForm::TMainForm(TComponent* Owner)
: TForm(Owner)
{
Application->ShowMainForm = False;
this->Visible = True;
Application->Minimize();
ShowWindow(Application->Handle, SW_HIDE);
Application->OnMinimize = OnAppMinimize;
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N41Click(TObject *Sender)
{
this->Close();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N11Click(TObject *Sender)
{
wst->MyShutDownSystem(EWX_REBOOT);
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::N21Click(TObject *Sender)
{
wst->MyShutDownSystem(EWX_SHUTDOWN);
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::About1Click(TObject *Sender)
{
AboutBox->Show();
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::TrayIcon1DblClick(TObject *Sender)
{
bool bCtrlKeyDown = GetAsyncKeyState( VK_CONTROL )>>((sizeof(SHORT)*8)-1);
if(bCtrlKeyDown)
{
ShowWindow(Application->Handle, SW_SHOW);
Application->NormalizeAllTopMosts();
Application->Restore();
}
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::OnAppMinimize(TObject *Sender)
{
ShowWindow(Application->Handle, SW_HIDE);
Application->Minimize();
}
void __fastcall TMainForm::LogMemoAdd(String str)
{
String time = FormatDateTime("[yyyy/mm/dd hh:nn:ss]", Now());
Memo1->Lines->Add(time + " " + str);
if(Memo1->Lines->Count > 4000) Memo1->Clear();
}
void __fastcall TMainForm::FormCreate(TObject *Sender)
{
LogMemoAdd("FormCreate()");
sit = new SystemInfoThread(&si);
wst = new WebServerThread(&si);
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::WMDiaplayChange(TMessage& Msg)
{
}
| [
"bokjjang@gmail.com"
] | bokjjang@gmail.com |
78cc956bc507aab8d7cb2d04263fb5f417c4c142 | a33f80193a7cbacce3ad22e09194c4b2139cae8d | /library.cpp | 59c6f83eba8d290b5dcd8a3126ee6d434d9d3f35 | [] | no_license | TheCatTree/NGspice_interface | 22743f8d93f9e44234f7b9237db53a4e3ea2edeb | bf889cbfc7935914a7c6418e3915cdfd53752ffd | refs/heads/master | 2020-04-04T10:35:42.103979 | 2018-11-02T12:01:34 | 2018-11-02T12:01:34 | 155,860,352 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 13,294 | cpp | #include "library.h"
#include "tests/catch.hpp"
#include <fstream>
#include <string>
#include <cstring>
#include <cerrno>
#include <sstream>
#include <iostream>
#include <list>
bool errorflag = false;
bool no_bg = false;
int no_of_interrupts = 0;
int
ciprefix(const char *p, const char *s);
int
cieq(register char *p, register char *s);
void Motor_Emulator::PORTD_Interrupt() {
raise(SIGINT);
}
void Motor_Emulator::Start_Emulation(int Voltage, int PWM) {
}
void Motor_Emulator::SetHallPattern(std::vector<int> &A_pattern, std::vector<int> &B_pattern) {
this->A_Hall_pattern = A_pattern;
this->B_Hall_pattern = B_pattern;
}
void Motor_Emulator::Pause_Emulation() {
}
void Motor_Emulator::Stop_Emulation() {
}
void Motor_Emulator::Place_Load_on_motor() {
}
void Motor_Emulator::Change_Voltage(int Voltage) {
}
void Motor_Emulator::Setup_Interrupts() {
}
int
ng_getchar(char* outputreturn, int ident, void* userdata);
int
ng_getstat(char* outputreturn, int ident, void* userdata);
int
ng_exit(int, bool, bool, int ident, void*);
int
ng_thread_runs(bool noruns, int ident, void* userdata);
int
ng_initdata(pvecinfoall intdata, int ident, void* userdata);
int
ng_data(pvecvaluesall vdata, int numvecs, int ident, void* userdata);
void Ng_spice_set_up(){
int ret;
ret = ngSpice_Init(ng_getchar, ng_getstat, ng_exit, ng_data, ng_initdata, ng_thread_runs, NULL);
};
std::list<std::string> Ng_spice_load_net(const char *filename);
std::list<std::string> Ng_spice_load_net(const char *filename) {
int ret;
std::ifstream in(filename, std::ios::in | std::ios::binary);
if (in)
{
std::string contents;
in.seekg(0, std::ios::end);
contents.resize(in.tellg());
in.seekg(0, std::ios::beg);
in.read(&contents[0], contents.size());
in.close();
std::list<std::string> command_set;
std::string line;
std::istringstream f(contents);
while (std::getline(f, line)) {
command_set.push_back(line);
}
return(command_set);
}
throw(errno);
}
double Ng_spice_run(std::list<std::string> &commandset);
double Ng_spice_run(std::list<std::string> &commandset) {
int ret;
//Loading net
std::string circ ="circbyline " ;
std::string out;
std::list<std::string>::iterator i;
for( i = commandset.begin(); i!= commandset.end(); ++i){
out = circ + *i;
auto * cstr = new char [out.length()+1];
std::strcpy(cstr, out.c_str());
ret = ngSpice_Command(cstr);
printf("%s \n",cstr);
delete[] cstr;
}
ret = ngSpice_Command((char*)"options ACCT");
// ret = ngSpice_Command((char*)"options opts");
unsigned long time = micros();
printf("run started \n");
ret = ngSpice_Command((char*)"run");
printf("run was %d ms long \n",(int)( micros() - time ) );
return ((double)time/1000000.0);
}
void Ng_spice_print_last_run();
void Ng_spice_print_last_run(){
char** allplots = ngSpice_AllPlots();
char **vecnames;
pvector_info vecinfo;
int sizeofvec = 0;
for (auto x = 0; allplots[x]!=NULL; x++ ){
printf("Plot name: %s \n", allplots[x]);
}
char* plotname = ngSpice_CurPlot();
printf("Cur plot name: %s \n", plotname);
vecnames = ngSpice_AllVecs(plotname);
for (auto i = 0; vecnames[i]!=NULL; i++) {
printf("%s \n", vecnames[i]);
vecinfo = ngGet_Vec_Info(vecnames[i]);
sizeofvec = vecinfo->v_length;
printf("%d \n", sizeofvec);
printf("Type: %d \n", vecinfo->v_type);
printf("value of first, 2 ,10, 100 ,middle, last: %f ,%f ,%f ,%f ,%f ,%f\n", vecinfo->v_realdata[0],vecinfo->v_realdata[1],vecinfo->v_realdata[9],vecinfo->v_realdata[99],
vecinfo->v_realdata[sizeofvec / 2 -1], vecinfo->v_realdata[sizeofvec - 1]);
}
}
Time_line Ng_spice_get_last_run();
Time_line Ng_spice_get_last_run(){
char **vecnames;
pvector_info vecinfo;
int sizeofvec = 0;
Time_line out;
char* plotname = ngSpice_CurPlot();
printf("Cur plot name: %s \n", plotname);
vecnames = ngSpice_AllVecs(plotname);
for (auto i = 0; vecnames[i]!=NULL; i++) {
vecinfo = ngGet_Vec_Info(vecnames[i]);
out.v_info[vecinfo->v_name]=*vecinfo;
}
out.Time_line_length_points = out.v_info["time"].v_length;
out.Time_line_length_S = out.v_info["time"].v_realdata[out.Time_line_length_points-1];
return out;
};
std::list<std::string> Ng_command_edit(std::list<std::string> &command, std::string &find, std::string &replacement);
std::list<std::string> Ng_command_edit(std::list<std::string> &command, std::string &find, std::string &replacement){
std::list<std::string> commands = command;
std::list<std::string>::iterator c;
for( c = commands.begin(); c != commands.end(); ++c ){
std::string str = *c;
if(str.find(find) != std::string::npos){ (*c)=replacement;break;}
}
return commands;
}
std::string Ng_PWM_Pulse_command(int Hz, int dutyCycle, int voltage);
std::string Ng_PWM_Pulse_command(int Hz, int dutyCycle, int voltage){
double TotaluS = 1000000.0 / (double)Hz;
double OnuS = (TotaluS / 100.0) * (double)dutyCycle;
char buff[256];
snprintf(buff, sizeof(buff),"V_drive vtop 0 PULSE(0 %d 0 180N 160N %fU %fU)", voltage , OnuS, TotaluS);
std::string out = buff;
return out;
};
std::list<std::string> Ng_Change_PWM(std::list<std::string> &command,int Hz, int dutyCycle, int voltage);
std::list<std::string> Ng_Change_PWM(std::list<std::string> &command,int Hz, int dutyCycle, int voltage){
std::string x ="PULSE(";
std::string y = Ng_PWM_Pulse_command(Hz, dutyCycle,voltage);
return Ng_command_edit(command,x,y);
}
std::list<std::string> ArduinoStylePWM(byte PWM,std::list<std::string> &command);
std::list<std::string> ArduinoStylePWM(byte PWM,std::list<std::string> &command){
return Ng_Change_PWM(command,62500,(int)(100.0/256.0*(float)PWM),12);
}
std::list<std::string> Ng_command_inital_values(std::list<std::string> command, Time_line &line, long line_position);
std::list<std::string> Ng_command_inital_values(std::list<std::string> command, Time_line &line, long line_position){
//Clean out any original .ic command
for( auto c = command.begin(); c != command.end(); ++c ){
std::string str = *c;
if(str.find(".ic") != std::string::npos){ command.erase(c);break;}
}
//Get data Values
double vtop = line.v_info["vtop"].v_realdata[line_position];
double n001 = line.v_info["n001"].v_realdata[line_position];
double n002 = line.v_info["n002"].v_realdata[line_position];
double n003 = line.v_info["n003"].v_realdata[line_position];
double n004 = line.v_info["n004"].v_realdata[line_position];
double n005 = line.v_info["n005"].v_realdata[line_position];
double n006 = line.v_info["n006"].v_realdata[line_position];
double n007 = line.v_info["n007"].v_realdata[line_position];
double p001 = line.v_info["p001"].v_realdata[line_position];
double angularsum = line.v_info["angularsum"].v_realdata[line_position];
double v_sense_1 = line.v_info["v_sense_1#branch"].v_realdata[line_position];
double V_SENSE_2 = line.v_info["v_sense_2#branch"].v_realdata[line_position];
double L_Motor = line.v_info["l_motor#branch"].v_realdata[line_position];
double Lrotor_Inertia = line.v_info["lbrotor_inertia#branch"].v_realdata[line_position];
//setting voltage intial values
char buff[512];
snprintf(buff, sizeof(buff),".ic "
"V(vtop)=%f "
"V(N001)=%f "
"V(N001)=%f "
"V(N003)=%f "
"V(N004)=%f "
"V(N005)=%f "
"V(N006)=%f "
"V(N007)=%f "
"V(P001)=%f "
"V(AngularSum)=%f ",
vtop,
n001,
n002,
n003,
n004,
n005,
n006,
n007,
p001,
angularsum
);
std::string ic = buff;
for( auto c = command.begin(); c != command.end(); ++c ){
std::string str = *c;
if(str.find(".end") != std::string::npos){ command.insert(c,ic);break;}
}
/*"I(V_SENSE_1)=%f "
"I(V_SENSE_2)=%f "
"I(L_Motor)=%f "
"I(rotor_Inertia)=%f ",*/
/*,v_sense_1,V_SENSE_2,L_Motor,Lrotor_Inertia*/
//IC on inductors
for( auto c = command.begin(); c != command.end(); ++c ){
std::string str (*c);
if(str.find("L_Motor") != std::string::npos){
std::string tstr (*c) ;
//clean string
tstr.erase(std::remove(tstr.begin(),tstr.end(), '\r'),tstr.end());
tstr += " ic=";
tstr += std::to_string(L_Motor);
printf("%s \n", tstr.c_str());
std::cout << "String length: " << str.size();
std::cout << str ;
std::cout << tstr<<"\n";
*c = tstr;
}
if(str.find("rotor_Inertia") != std::string::npos){
std::string tstr = *c;
//clean string
tstr.erase(std::remove(tstr.begin(),tstr.end(), '\r'),tstr.end());
tstr += " ic=";
tstr += std::to_string(Lrotor_Inertia);
printf("%s \n", tstr.c_str());
*c = tstr;
}
}
return command;
}
/*************************/
/* UNIT TESTS */
/************************/
TEST_CASE( "NG Spice asynchronous data structure" , "[NG Asynch]")
{
Ng_spice_set_up();
auto x = Ng_spice_load_net("C:\\Users\\TCT\\Dropbox\\Hand_code_Advance\\Motor_Emulator\\motors\\DSX10smotor.net");
x = ArduinoStylePWM(240,x);
auto time_start = Ng_spice_run(x);
Ng_spice_print_last_run();
auto runinfo = Ng_spice_get_last_run();
runinfo.Start_Time_S = time_start;
//print all map, keys and value
for (auto i : runinfo.v_info){
std::string tmp_str = i.first;
int tmp_int= i.second.v_length;
double tmp_doub = i.second.v_realdata[(tmp_int/2) -1];
double tmp_doub_2 = i.second.v_realdata[tmp_int -1];
printf("Map: Name: %s, Middle real value: %f , Middle last value %f \n", tmp_str.c_str(),tmp_doub, tmp_doub_2);
}
//set .ic to runinfo values then run with new pwm and print.
x = Ng_command_inital_values(x,runinfo,runinfo.Time_line_length_points -1);
time_start = Ng_spice_run(x);
Ng_spice_print_last_run();
}
/* Callback function called from bg thread in ngspice once upon intialization
of the simulation vectors)*/
int
ng_data(pvecvaluesall vdata, int numvecs, int ident, void* userdata)
{
int *ret;
no_of_interrupts ++;
//printf("No of ng data interrupts: %d \n", no_of_interrupts);
return 0;
}
int
ng_initdata(pvecinfoall intdata, int ident, void* userdata)
{
int i;
int vn = intdata->veccount;
for (i = 0; i < vn; i++) {
printf("Vector: %s\n", intdata->vecs[i]->vecname);
}
return 0;
}
/* Callback function called from bg thread in ngspice if fcn controlled_exit()
is hit. Do not exit, but unload ngspice. */
int
ng_exit(int exitstatus, bool immediate, bool quitexit, int ident, void* userdata)
{
if(quitexit) {
printf("DNote: Returned form quit with exit status %d\n", exitstatus);
exit(exitstatus);
}
if(immediate) {
printf("DNote: Unloading ngspice inmmediately is not possible\n");
printf("DNote: Can we recover?\n");
}
else {
printf("DNote: Unloading ngspice is not possible\n");
printf("DNote: Can we recover? Send 'quit' command to ngspice.\n");
errorflag = true;
ngSpice_Command((char*)"quit 5");
// raise(SIGINT);
}
return exitstatus;
}
/* Callback function called from bg thread in ngspice to transfer
any string created by printf or puts. Output to stdout in ngspice is
preceded by token stdout, same with stderr.*/
int
ng_getchar(char* outputreturn, int ident, void* userdata)
{
printf("%s\n", outputreturn);
/* setting a flag if an error message occurred */
if (ciprefix("stderr Error:", outputreturn))
errorflag = true;
return 0;
}
int
ng_getstat(char* outputreturn, int ident, void* userdata)
{
printf("%s\n", outputreturn);
return 0;
}
int
ng_thread_runs(bool noruns, int ident, void* userdata)
{
no_bg = noruns;
if (noruns)
printf("bg not running\n");
else
printf("bg running\n");
return 0;
}
int ciprefix(const char *p, const char *s) {
while (*p) {
if ((isupper(*p) ? tolower(*p) : *p) != //clever
(isupper(*s) ? tolower(*s) : *s))
return(false);
p++;
s++;
}
return (true);
}
int cieq(register char *p, register char *s) {
while (*p) {
if ((isupper(*p) ? tolower(*p) : *p) !=
(isupper(*s) ? tolower(*s) : *s))
return(false);
p++;
s++;
}
return (*s ? false : true);
}
/* Case insensitive prefix. */
| [
"Steven.C.Hartley@gmail.com"
] | Steven.C.Hartley@gmail.com |
421e1d1c39c67d1cec31d3f0f9d57183cf7e85b4 | 0ade9811c6a82ccddb90278cc5f567f5720ad432 | /main.cpp | 2c1e5741e118211f0aaead26f2977db9be5fcb5a | [] | no_license | yoshihollez/linked-list | 3a3addb5d4068cac8e2bf8ce55cf994e08245583 | 71f770c139f598b7d9008d560202ffb1b1f879e2 | refs/heads/master | 2020-04-28T04:51:11.671904 | 2019-03-11T14:34:11 | 2019-03-11T14:34:11 | 174,996,715 | 0 | 0 | null | null | null | null | UTF-8 | C++ | false | false | 483 | cpp | #include <iostream>
#include "Bull.h"
#include "Node.h"
using namespace std;
void print(Node *node){
cout << std::to_string(node->get_data()) << " " << endl;
if (node->get_next() != nullptr) {
print(node->get_next());
}
}
int main(){
Bull yeet(21, 66, "yeet");
cout << yeet.to_string() << endl;
Node start(0);
Node second(1);
Node last(2);
second.set_next(&last);
start.set_next(&second);
print(&start);
return 0;
} | [
"yoshi.hollez@student.vives.be"
] | yoshi.hollez@student.vives.be |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.