blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
4b536d9f5f4b695242d4431799f67b053abd9cde | C++ | afeer123/c- | /表达式函数.cpp | GB18030 | 972 | 2.5625 | 3 | [] | no_license | #include"tcp.h";
int wsa()
{
WSADATA wsadata;
WORD wVersionRequested = MAKEWORD(1, 1);
int nResult = WSAStartup(wVersionRequested, &wsadata);
return nResult;
}
BOOL SOCKET_Select(SOCKET hSocket, int nTimeOut, BOOL bRead)
{
fd_set fdset;
timeval tv;
FD_ZERO(&fdset);
FD_SET(hSocket, &fdset);
nTimeOut = nTimeOut > 1000 ? 1000 : nTimeOut;
tv.tv_sec = 0;
tv.tv_usec = nTimeOut;
int iRet = 0;
if (bRead)
{
iRet = select(0, &fdset, NULL, NULL, &tv);
}
else
{
iRet = select(0, NULL, &fdset, NULL, &tv);
}
if (iRet <= 0)
{
return FALSE;
}
else if(FD_ISSET(hSocket,&fdset))
{
return TRUE;
}
return FALSE;
}
void menu()
{
cout << "**********************" << endl;
cout << "* 1 *" << endl;
cout << "**********************" << endl;
cout << "* 2ӷ *" << endl;
cout << "*** 0 ********" << endl;
cout << "**********************" << endl;
} | true |
52fe7a481356cf44bbc8e9fe783169b303f1535f | C++ | cristiancristea00/tic-tac-toe | /src/BoardManager.cpp | UTF-8 | 5,290 | 2.953125 | 3 | [
"GPL-3.0-only"
] | permissive | /*******************************************************************************
* @file BoardManager.cpp
* @author Cristian Cristea
* @date September 17, 2021
* @brief Source file for the BoardManager class.
*
* @copyright Copyright (C) 2021 Cristian Cristea. All rights reserved.
******************************************************************************/
#include "BoardManager.hpp"
using Utility::Board;
using Utility::BOARD_SIZE;
using Utility::PlayerSymbol;
BoardManager * BoardManager::instance = nullptr;
BoardManager::BoardManager() noexcept
{
#pragma GCC unroll 3
for (size_t row = 0; row < BOARD_SIZE; ++row)
{
#pragma GCC unroll 3
for (size_t column = 0; column < BOARD_SIZE; ++column)
{
game_board[row][column] = PlayerSymbol::UNK;
}
}
}
auto BoardManager::Instance() noexcept -> BoardManager *
{
if (instance == nullptr)
{
instance = new BoardManager;
}
return instance;
}
BoardManager::~BoardManager() noexcept
{
delete instance;
}
auto BoardManager::GetGameBoard() noexcept -> Board &
{
return game_board;
}
auto BoardManager::IsWinner(PlayerSymbol player, Board const & current_board) noexcept -> bool
{
return (current_board[0][0] == player && current_board[0][1] == player && current_board[0][2] == player) ||
(current_board[1][0] == player && current_board[1][1] == player && current_board[1][2] == player) ||
(current_board[2][0] == player && current_board[2][1] == player && current_board[2][2] == player) ||
(current_board[0][0] == player && current_board[1][0] == player && current_board[2][0] == player) ||
(current_board[0][1] == player && current_board[1][1] == player && current_board[2][1] == player) ||
(current_board[0][2] == player && current_board[1][2] == player && current_board[2][2] == player) ||
(current_board[0][0] == player && current_board[1][1] == player && current_board[2][2] == player) ||
(current_board[0][2] == player && current_board[1][1] == player && current_board[2][0] == player);
}
auto BoardManager::IsBoardFull(Board const & current_board) noexcept -> bool
{
#pragma GCC unroll 3
for (size_t row = 0; row < BOARD_SIZE; ++row)
{
#pragma GCC unroll 3
for (size_t column = 0; column < BOARD_SIZE; ++column)
{
if (current_board[row][column] == PlayerSymbol::UNK)
{
return false;
}
}
}
return true;
}
auto BoardManager::GetCurrentPlayer(Board const & current_board) noexcept -> PlayerSymbol
{
uint8_t moves = 0;
#pragma GCC unroll 3
for (size_t row = 0; row < BOARD_SIZE; ++row)
{
#pragma GCC unroll 3
for (size_t column = 0; column < BOARD_SIZE; ++column)
{
if (current_board[row][column] != PlayerSymbol::UNK)
{
++moves;
}
}
}
return (moves % 2 == 0) ? PlayerSymbol::X : PlayerSymbol::O;
}
auto BoardManager::GetActions(Board const & current_board) noexcept -> std::vector<Move>
{
static std::vector<Move> actions;
actions.reserve(BOARD_SIZE * BOARD_SIZE);
actions.clear();
#pragma GCC unroll 3
for (size_t row = 0; row < BOARD_SIZE; ++row)
{
#pragma GCC unroll 3
for (size_t column = 0; column < BOARD_SIZE; ++column)
{
if (current_board[row][column] == PlayerSymbol::UNK)
{
actions.emplace_back(row, column);
}
}
}
return actions;
}
auto BoardManager::GetWinner(Board const & current_board) noexcept -> PlayerSymbol
{
if (IsWinner(PlayerSymbol::X, current_board))
{
return PlayerSymbol::X;
}
if (IsWinner(PlayerSymbol::O, current_board))
{
return PlayerSymbol::O;
}
return PlayerSymbol::UNK;
}
auto BoardManager::IsTerminal(Board const & current_board) noexcept -> bool
{
return IsBoardFull(current_board) || IsWinner(PlayerSymbol::X, current_board)
|| IsWinner(PlayerSymbol::O, current_board);
}
auto BoardManager::IsValidAction(Board const & current_board, Move const & action) noexcept -> bool
{
return action.GetRow() >= 0 && action.GetColumn() >= 0 && action.GetRow() < BOARD_SIZE
&& action.GetColumn() < BOARD_SIZE
&& current_board[action.GetRow()][action.GetColumn()] == PlayerSymbol::UNK;
}
auto BoardManager::GetBoardValue(Board const & current_board) noexcept -> Utility::Value
{
if (IsWinner(PlayerSymbol::X, current_board))
{
return 1;
}
if (IsWinner(PlayerSymbol::O, current_board))
{
return -1;
}
return 0;
}
auto BoardManager::GetResultBoard(Board const & current_board, Move const & action, PlayerSymbol player)
noexcept -> Board
{
auto action_board = current_board;
action_board.at(action.GetRow()).at(action.GetColumn()) = player;
return action_board;
}
void BoardManager::ResetBoard() noexcept
{
#pragma GCC unroll 3
for (size_t row = 0; row < BOARD_SIZE; ++row)
{
#pragma GCC unroll 3
for (size_t column = 0; column < BOARD_SIZE; ++column)
{
game_board[row][column] = PlayerSymbol::UNK;
}
}
}
| true |
5aae0c084e22cfa7114b64da2719fb14fd1a8396 | C++ | wwuhn/wwuhn.github.io | /witisoPC/32cpp/贺利坚/类相关/立方柱类.cpp | GB18030 | 1,305 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std; //
class Bulk
{
public:
void get_value();
void display();
private:
void get_volume(); //ڲģΪ˽кϢ
void get_area();
float lengh;
float width;
float height;
float volume;
float area;
};
void Bulk::get_value()
{
cout<<"please input lengh, width, height:";
cin>>lengh;
cin>>width;
cin>>height;
get_volume(); //ֵԺԼ㣬Ҳdisplayǰ㣬ۺ϶ԣ˴
get_area();
}
void Bulk::get_volume()
{
volume=lengh*width*height;
}
void Bulk::get_area()
{
area=2*(lengh*width+lengh*height+width*height);
}
void Bulk::display()
{
//get_volume()get_area()Ҳڴ˴ãм㹤ڳȷ̽
cout<<"The volume is: "<<volume<<endl;
cout<<"The surface area is: "<<area<<endl;
}
int main()
{
Bulk b1,b2,b3;
b1.get_value();
cout<<"For bulk1: "<<endl;
b1.display();
b2.get_value();
cout<<"For bulk2: "<<endl;
b2.display();
b3.get_value();
cout<<"For bulk3: "<<endl;
b3.display();
return 0;
} | true |
47a6d8f48a568cdda14c68cbd9e6e0c08d49d59d | C++ | sympiler/sympiler | /sparse_blas/dense_blas/test_main.cpp | UTF-8 | 1,395 | 2.71875 | 3 | [
"MIT"
] | permissive | //
// Created by George Huang on 2019-11-21.
//
#include <cmath>
#include <iostream>
#include <chrono>
#include "testBLAS.cpp"
#include "BLAS.cpp"
std::chrono::time_point<std::chrono::system_clock> start, end;
int main() {
/// Benchmark for dot product
int N = 1000000;
auto x0 = new double[N]();
auto x1 = new double[N]();
for(int i = 0; i < N; i++) {
x0[i] = ((double) random() / (RAND_MAX));
x1[i] = ((double) random() / (RAND_MAX));
}
int num_test = 100;
// test basic dot_prod
double result0;
start = std::chrono::system_clock::now();
for(int i = 0; i < num_test; i++)
result0 = dot_prod(N, x0, x1);
end = std::chrono::system_clock::now();
auto elapsed_seconds = end - start;
std::cout << elapsed_seconds.count() << std::endl;
// test dotprod01
double result1;
start = std::chrono::system_clock::now();
for(int i = 0; i < num_test; i++)
result1 = dotprod01(N, x0, x1);
end = std::chrono::system_clock::now();
elapsed_seconds = end - start;
std::cout << elapsed_seconds.count() << std::endl;
double result2;
start = std::chrono::system_clock::now();
for(int i = 0; i < num_test; i++)
result2 = dotprod02(N, x0, x1);
end = std::chrono::system_clock::now();
elapsed_seconds = end - start;
std::cout << elapsed_seconds.count() << std::endl;
std::cout << std::fabs(result0 - result1) << std::endl;
std::cout << std::fabs(result1 - result2) << std::endl;
} | true |
f42e93a2a32ca1b045732bb3fdbeff7b5329c727 | C++ | lethanhtam1604/SNY | /Algorithm & Data Structure/Algorithm/BellmanFord.cpp | UTF-8 | 1,568 | 3.171875 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
#define MAX 100
const int INF=1e9;
struct triad {
int source;
int target;
int weight;
};
vector<int> dist(MAX, INF);
vector<triad> graph;
int n, m;
int path[MAX];
//SPFA là thuật toán cải tiến của Bellman
bool BellmanFord(int source, vector<triad> &graph, vector<int> &dist) {
int u, v, w;
dist[source] = 0;
for(int i=1;i<=n-1;i++) {
for(int j=0;j<m;j++) {
u = graph[j].source;
v = graph[j].target;
w = graph[j].weight;
if(dist[u] != INF && (dist[u] + w < dist[v])) {
dist[v] = dist[u] + w;
path[v] = u;
}
}
}
for(int i=0;i<m;i++) {
u = graph[i].source;
v = graph[i].target;
w = graph[i].weight;
if(dist[u] != INF && (dist[u] + w < dist[v])) {
return false;
}
}
return true;
}
int main() {
freopen("/Users/d/Documents/INPUT.TXT", "rt", stdin);
int s, t, u, v, w;
cin >> n >> m;
dist = vector<int> (n, INF);
for(int i=0;i<m;i++) {
triad temp;
cin >> u >> v >> w;
temp.source=u;
temp.target=v;
temp.weight=w;
graph.push_back(temp);
}
s=0;
t=4;
bool res = BellmanFord(s, graph, dist);
if(res == false) {
cout << "Graph contains negative weight cycle" << endl;
} else {
cout << dist[t] << endl;
}
return 0;
}
| true |
55860ef7819f58a593e826279ec9a72b77302e17 | C++ | neonmag/Dates | /Project18/main.cpp | UTF-8 | 4,118 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include "CDate.h"
using namespace std;
class InputOuptut
{
private:
char m_charackter;
int m_data;
public:
InputOuptut();
InputOuptut(const char m_charackter, const int m_data);
void SetMCharactrer(const char m_charackter)
{
this->m_charackter = m_charackter;
}
void SetMData(const int m_data)
{
this->m_data = m_data;
}
const char GetMCharackter()
{
return this->m_charackter;
}
const int GetMData()
{
return this->m_data;
}
~InputOuptut();
};
InputOuptut::InputOuptut()
{
this->m_charackter = 0;
this->m_data = 0;
}
InputOuptut::InputOuptut(const char m_charackter, const int m_data)
{
this->m_charackter = m_charackter;
this->m_data = m_data;
}
InputOuptut::~InputOuptut()
{
}
ostream& operator<<(ostream& os, CDate& obj) // Overloading operator of output
{
os << obj.GetDay() << endl << obj.GetMonth() << endl << obj.GetYear() << endl;
return os;
}
istream& operator>>(istream& is, CDate& obj) // Overloading operator of input
{
int a;
cout << "\nEnter day: ";
is >> a;
obj.SetDay(a);
cout << "\nEnter month: ";
is >> a;
obj.SetMonth(a);
cout << "\nEnter year: ";
is >> a;
obj.SetYear(a);
while (obj.GetYear() < 0)
{
cout << "\nEnter year: ";
is >> a;
obj.SetYear(a);
}
while (obj.GetMonth() < 0 || obj.GetMonth() > 12)
{
cout << "\nEnter month: ";
is >> a;
obj.SetMonth(a);
}
while (obj.GetMonth() == 2 && obj.GetYear() % 4 == 0 && obj.GetDay() < 0 ||
obj.GetMonth() == 2 && obj.GetYear() % 4 == 0 && obj.GetDay() > 29)
{
cout << "\nEnter day: ";
is >> a;
obj.SetDay(a);
}
while (obj.GetMonth() == 2 && obj.GetYear() % 4 != 0 && obj.GetDay() < 0 ||
obj.GetMonth() == 2 && obj.GetYear() % 4 != 0 && obj.GetDay() > 28)
{
cout << "\nEnter day: ";
is >> a;
obj.SetDay(a);
}
if (obj.GetMonth() == 1 || obj.GetMonth() == 3 || obj.GetMonth() == 5 || obj.GetMonth() == 7 ||
obj.GetMonth() == 8 || obj.GetMonth() == 10 || obj.GetMonth() == 12)
{
while (obj.GetDay() < 0 || obj.GetDay() > 31)
{
cout << "\nEnter day: ";
is >> a;
obj.SetDay(a);
}
}
else if (obj.GetMonth() == 1 || obj.GetMonth() == 4 || obj.GetMonth() == 6 || obj.GetMonth() == 9 ||
obj.GetMonth() == 11)
{
while (obj.GetDay() < 0 || obj.GetDay() > 30)
{
cout << "\nEnter day: ";
is >> a;
obj.SetDay(a);
}
}
return is;
}
void EnterYear(int& year) // Enter year
{
cout << "Enter year: ";
cin >> year;
while (year < 0)
{
cout << "\nEnter year: ";
cin >> year;
}
}
void EnterMonth(int& month) //Enter month
{
cout << "\nEnter month: ";
cin >> month;
while (month < 0 || month > 12)
{
cout << "\nEnter month: ";
cin >> month;
}
}
void EnterDay(int& day, int month, int year) // Enter day with check on Leap Year
{
cout << "\nEnter day: ";
cin >> day;
if (year % 4 == 0 && month == 2)
{
while (day > 29 || day < 0)
{
cout << "\nEnter day: ";
cin >> day;
}
}
else if (year % 4 != 0 || month == 2)
{
while (day > 28 || day < 0)
{
cout << "\nEnter day: ";
cin >> day;
}
}
else if (month == 1 || month == 3 || month == 5 || month == 7 || month == 8 || month == 10 || month == 12)
{
while (day > 31 || day < 0)
{
cout << "\nEnter day: ";
cin >> day;
}
}
else
{
while (day > 30 || day < 0)
{
cout << "\nEnter day: ";
cin >> day;
}
}
}
int main()
{
/*int day;
int month;
int year;
EnterYear(year);
EnterMonth(month);
EnterDay(day, month, year);
system("cls");*/
// CDate date(day, month, year);
/*CDate date(23, 3, 2000);
date.PrintDate();
CDate date2(22, 2, 2020);
date2.PrintDate();
cout << "\n";
int degree = date2 - date;
cout << "\nDegree: " << degree;
CDate date3 = date2 + 45;
date3.PrintDate();
CDate date4 = date3++;
date4.PrintDate();
CDate date5 = date4--;
date5.PrintDate();
if (date5 > date4)
{
cout << "\nDate 5 bigger than 4";
}
else if (date5 < date4)
{
cout << "\nDate 4 bigger than 5";
}
if (date5 == date3)
{
cout << "\nThey are equal";
}
if (date5 != date4)
{
cout << "\nThey aren't equal";
}
cout << date5.DayOfWeek();*/
CDate obj;
cin >> obj;
cout << obj;
} | true |
c446f9a6b3cd017907900d944d3d1bb31197bdb2 | C++ | mkulagowski/Voronoi | /src/Vector.hpp | UTF-8 | 327 | 2.859375 | 3 | [] | no_license | #pragma once
#include <cstdint>
class Vector {
public:
Vector();
Vector(uint8_t x, uint8_t y, uint8_t z);
Vector(uint8_t x);
Vector avg(const Vector& other) const;
uint8_t operator[] (uint8_t index) const;
bool operator== (const Vector& b) const;
bool operator!= (const Vector& b) const;
private:
uint8_t mVal[3];
}; | true |
9a0f1161a60cebcf5ab550c9650cb6c749aea0dd | C++ | Marco2018/leetcode | /leetcode752.cpp | UTF-8 | 2,061 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <math.h>
#include <algorithm>
#include <string>
#include <queue>
#include <limits.h>
using namespace std;
struct point {
int a;
int b;
int c;
int d;
point(int a, int b, int c, int d) :a(a), b(b), c(c), d(d) {}
};
class Solution {
public:
int openLock(vector<string>& deadends, string target) {
int dp[10][10][10][10];
memset(dp, -1, sizeof(dp));
point tar = point(target[0] - '0', target[1] - '0', target[2] - '0', target[3] - '0');
queue<point> que;
int a, b, c, d;
int da[8] = { 1,-1,0,0,0,0,0,0 };
int db[8] = { 0,0,1,-1,0,0,0,0 };
int dc[8] = { 0,0,0,0,1,-1,0,0 };
int dd[8] = { 0,0,0,0,0,0,1,-1 };
int i, n = deadends.size();
dp[0][0][0][0] = 0;
for (i = 0; i < n; i++) {
a = deadends[i][0] - '0';
b = deadends[i][1] - '0';
c = deadends[i][2] - '0';
d = deadends[i][3] - '0';
dp[a][b][c][d] = INT_MAX;
}
if (dp[0][0][0][0] != 0)return -1;
que.push(point(0, 0, 0, 0));
while (que.size()) {
point tmp = que.front();
que.pop();
if (tmp.a == tar.a&&tmp.b == tar.b&&tmp.c == tar.c&&tmp.d == tar.d)
break;
for (i = 0; i < 8; i++) {
int na = (tmp.a + da[i]) % 10, nb = (tmp.b + db[i]) % 10, nc = (tmp.c + dc[i]) % 10, nd = (tmp.d + dd[i]) % 10;
if (na < 0) na += 10;
if (nb < 0) nb += 10;
if (nc < 0) nc += 10;
if (nd < 0) nd += 10;
if (dp[na][nb][nc][nd] == -1) {
que.push(point(na, nb, nc, nd));
dp[na][nb][nc][nd] = dp[tmp.a][tmp.b][tmp.c][tmp.d] + 1;
}
}
}
return dp[tar.a][tar.b][tar.c][tar.d];
}
};
int main() {
Solution s1;
int nums[2][2] = {-1};
memset(nums, -1, sizeof(nums));
//fill(nums, nums + 2, -1);
vector<string> deadends = { "0201", "0101","0102","1212","2002" };
string target = "0202";
//vector<string> deadends = { "8888"};
//string target = "0009";
//cout << 10 % 10;
int res=s1.openLock(deadends, target);
cout << res;
system("pause");
return 0;
}; | true |
4b7d86057a998daed6401e8056ce4e82fe5cf57b | C++ | XiaoXiaoLui/LeetCode | /Create_Maximum_Number.cpp | UTF-8 | 2,081 | 3.109375 | 3 | [] | no_license | /******************************************************************************************
Create Maximum Number
******************************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define mp make_pair
#define INIT_UNORDER(mm) \
{\
mm.max_load_factor(0.25);\
mm.reserve(512);\
}
typedef long long ll;
class Solution {
public:
vector<int> maxNumber(vector<int>& nums1, vector<int>& nums2, int k) {
int len1, len2, i, j;
len1 = nums1.size();
len2 = nums2.size();
vector<int> res;
for (i = max(0, k - len2); i <= k && i <= len1; i++)
{
j = k - i;
auto const &res1 = maxVec(nums1, i);
auto const &res2 = maxVec(nums2, j);
res = max(res, merge(res1, res2));
}
return res;
}
vector<int> maxVec(const vector<int> &a, int k)
{
vector<int> res;
for (int i = 0; i < a.size(); i++)
{
while (!res.empty() && a.size() - i + res.size() > k && a[i] > res.back())
{
res.pop_back();
}
res.push_back(a[i]);
}
while (res.size() > k)
{
res.pop_back();
}
return res;
}
bool notLess(const vector<int> &a, const vector<int> &b, int i, int j)
{
for (; i < a.size() && j < b.size(); i++, j++)
{
if (a[i] != b[j])
{
return a[i] >= b[j];
}
}
return j == b.size();
}
vector<int> merge(const vector<int> &a, const vector<int> &b)
{
vector<int> res;
int i, j;
for (i = j = 0; i < a.size() && j < b.size(); )
{
if (notLess(a, b, i, j))
{
res.push_back(a[i++]);
}
else
{
res.push_back(b[j++]);
}
}
for (; i < a.size(); i++)
{
res.push_back(a[i]);
}
for (; j < b.size(); j++)
{
res.push_back(b[j]);
}
return res;
}
};
int main()
{
vector<int> a{6, 7};
vector<int> b{6, 0, 4};
Solution S;
vector<int> ans = S.maxNumber(a, b, 5);
for (auto num : ans)
{
cout << num << endl;
}
return 0;
} | true |
a6c9361eb7a945fd5ad959f78e1a68ab80773b77 | C++ | vincentchauau/Real-Time-Gaming | /Source.cpp | UTF-8 | 4,091 | 2.734375 | 3 | [] | no_license | #include <windows.h>
// Global variables
const int ID_TIMER = 1; // timer id
HDC hdc; // memory
HBITMAP *hImages = new HBITMAP[8]; // frames
int time = 0; // time
int x = 0, y = 0, dx = 2, dy = 3; // location(x,y), velocity(2,3)
bool bContinue = true; // continue flag
// Check whether continue or not
bool CanWeContinue()
{
return bContinue;
}
// Render a frame at location(x,y), screen memory to draw on hdc, list of frames hImages, running time, frame velocity (dx,dy)
void Render(HDC &hdc, int &time, HBITMAP* hImages, int &x, int &y, int& dx, int& dy)
{
// Check continue flag
if (CanWeContinue())
{
// Get screen rectangle
RECT rect;
GetClientRect(WindowFromDC(hdc), &rect);
// Change frame location by adding velocity
x += dx;
y += dy;
// Create a buffer memory for screen memory
HDC hdcMem = CreateCompatibleDC(hdc);
BITMAP bm;
// Get the frame object information: width, height in bm object
GetObject(hImages[(time / 100) % 8], sizeof(bm), &bm);
// Draw the frame object on the buffer memory
SelectObject(hdcMem, hImages[(time / 100) % 8]);
// Draw the buffer memory on the screen memory
BitBlt(hdc, x, y, bm.bmHeight, bm.bmHeight, hdcMem, 0, 0, SRCCOPY);
// Delete the buffere memory
DeleteDC(hdcMem);
// Change velocity based on location(x,y), velocity(dx,dy), screensize(rect)
if (dx > 0 && x + bm.bmWidth > rect.right)
{
dx *= -1;
}
if (dx < 0 && x < rect.left)
{
dx *= -1;
}
if (dy > 0 && y + bm.bmHeight > rect.bottom)
{
dy *= -1;
}
if (dy < 0 && y < rect.top)
{
dy *= -1;
}
}
else
{
TextOut(hdc, 0, 0, TEXT("Please enter coins or press any key to continue."), 48);
}
}
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_CREATE:
{
hImages[0] = (HBITMAP)LoadImage(NULL, "1.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[1] = (HBITMAP)LoadImage(NULL, "2.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[2] = (HBITMAP)LoadImage(NULL, "3.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[3] = (HBITMAP)LoadImage(NULL, "4.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[4] = (HBITMAP)LoadImage(NULL, "5.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[5] = (HBITMAP)LoadImage(NULL, "6.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[6] = (HBITMAP)LoadImage(NULL, "7.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
hImages[7] =(HBITMAP)LoadImage(NULL, "8.bmp", IMAGE_BITMAP, 128, 128, LR_LOADFROMFILE);
SetTimer(hwnd, ID_TIMER, 10, NULL);
}
break;
case WM_CLOSE:
DestroyWindow(hwnd);
break;
case WM_PAINT:
{
PAINTSTRUCT ps;
hdc = BeginPaint(hwnd, &ps);
Render(hdc, time, hImages, x, y, dx, dy);
EndPaint(hwnd, &ps);
}
break;
case WM_TIMER:
{
++time;
hdc = GetDC(hwnd);
Render(hdc, time, hImages, x, y, dx, dy);
ReleaseDC(hwnd, hdc);
}
break;
case WM_KEYDOWN:
switch (wParam)
{
case VK_ESCAPE:
KillTimer(hwnd, ID_TIMER);
break;
default:
if (bContinue == false)
bContinue = true;
else
bContinue = false;
break;
}
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, wParam, lParam);
}
return 0;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
WNDCLASSEX wc;
HWND hwnd;
MSG Msg;
wc.cbSize = sizeof(WNDCLASSEX);
wc.style = 0;
wc.lpfnWndProc = WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "My Win32 API";
wc.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
RegisterClassEx(&wc);
hwnd = CreateWindow(
"My Win32 API",
"Waiting screen", WS_TILEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT, 320, 240,
NULL, NULL, hInstance, NULL);
ShowWindow(hwnd, SW_MAXIMIZE);
UpdateWindow(hwnd);
while (GetMessage(&Msg, NULL, 0, 0) > 0)
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
return Msg.wParam;
}
| true |
437fb49737714f9d031d15b3a92b27138fc3bbe8 | C++ | Cuda-Chen/DCP3573 | /Assignment8/main.cpp | UTF-8 | 1,998 | 3.53125 | 4 | [
"MIT"
] | permissive | // https://www.geeksforgeeks.org/find-four-elements-that-sum-to-a-given-value-set-2/
#include <bits/stdc++.h>
using namespace std;
class pairSum
{
public:
int first;
int second;
int sum;
};
int compare(const void *a, const void *b)
{
const int ia = (*(const pairSum *)a).sum;
const int ib = (*(const pairSum *)b).sum;
return (ia > ib) - (ia < ib);
}
/*
bool noCommon(pairSum a, pairSum b)
{
if(a.first != b.first && a.first != b.second &&
a.second != b.first && a.second != b.second)
{
return true;
}
return false;
}
*/
bool noCommon(pairSum a, pairSum b)
{
if (a.first == b.first || a.first == b.second ||
a.second == b.first || a.second == b.second)
return false;
return true;
}
bool fourSum(int array[], int n, int X)
{
int i, j;
int size = (n * (n - 1)) / 2;
pairSum aux[size];
int k = 0;
for(i = 0; i < n - 1; i++)
{
for(j = i + 1; j < n; j++)
{
aux[k].sum = array[i] + array[j];
aux[k].first = i;
aux[k].second = j;
k++;
}
}
qsort(aux, size, sizeof(pairSum), compare);
//sort(aux, aux + size, [](pairSum const &a, pairSum const &b) -> bool{return a.sum < b.sum;});
i = 0;
j = size - 1;
while(i < size && j >= 0)
{
if((aux[i].sum + aux[j].sum == X) &&
noCommon(aux[i], aux[j]))
{
return true;
}
else if(aux[i].sum + aux[j].sum < X)
{
i++;
}
else
{
j--;
}
}
return false;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int numSize;
cin >> numSize;
int num[numSize];
for(int i = 0; i < numSize; i++)
{
cin >> num[i];
}
if(fourSum(num, numSize, 0))
{
cout << 1 << endl;
}
else
{
cout << 0 << endl;
}
return 0;
}
| true |
c9571fcb455f2cddcb6a89397c93813e64561135 | C++ | 980f/safely | /pileup/main.cpp | UTF-8 | 3,367 | 2.625 | 3 | [] | no_license | //(C) 2017 Andrew Heilveil
#include <iostream>
#include <random>
#include "minimath.h"
/** simulation of deatime tracking amptek DP5 SCA signals on a tiny3.0 class controller */
class CounterIsr {
public:
double quantum;//processor clock rate, 1 / Hz
/** time from event to isr acknowledges it*/
unsigned latency;
/** time from event to can interrupt again */
unsigned cycle;
/** stats on events converted and lost */
unsigned events=0;
unsigned rejected=0;
unsigned detected=0;
/** whether a count will generate an interrupt soon*/
unsigned deferred=0;
/** time left in period between last event and isr acknowldege, computed from latency */
double vectoring=0;
/** time left in period between last event and isr return/can interrupt again, computed from cycle */
double storing=0;
CounterIsr(unsigned latency=32, unsigned cycle=70,double MHz=96.0):
quantum(1e-6/MHz),
latency(latency),
cycle(cycle){
//#nada
}
/** event is latched in irq stuff, but not evaluted yet */
void defer(){
++events;
if(!deferred){
++deferred;
} else {
++rejected;
}
}
/** event lost */
void lost(){
++events;
++rejected;
}
void detect(){
++events;
++detected; //one for the event that triggered the isr
detected+=deferred; //and a retriggered one
deferred=0;
}
/** compute timers */
void trigger(){
vectoring=quantum*latency;
storing=quantum*cycle;
}
/** feed this the time since previous event */
void next(double event){
if(vectoring>0){
if(event<vectoring){//occured before ack of previous
vectoring-=event;//shift time base
storing-=event;
lost();
return;
}
vectoring=0;
}
if(storing>0){
if(event<storing){//still storing previous
storing-=event;//shift time base
defer();
return;
}
if(event<storing+quantum*cycle){//still interacting with previous cycle
//at event-storing we started vectoring again
event-=storing;
trigger();
next(event);//recurse at most once or twice
return;
}
storing=0;
}
detect();
trigger();
}
double deadness()const{
return ratio(100.0f*rejected,events);
}
double liveness()const{
return ratio(100.0f*detected,events);
}
/** should be zero if code is correct */
int sanitycheck()const{
return rejected+detected-events;
}
};
#include "poissonfeeder.h"
int main(int argc, char *argv[]){
double cps=10000;
unsigned latency=18;
unsigned cycle=36;
double MHz=96.0;
printf("\nEstimate Isr pileup");
while(argc-->0){
double arg=atof(argv[argc]);
switch (argc) {
case 4:
MHz=arg;
break;
case 3:
cycle=unsigned(arg);
break;
case 2:
latency=unsigned(arg);
break;
case 1: //rate
cps=arg;
break;
}
}
CounterIsr sim(latency,cycle,MHz);
PoissonFeeder pfeeder(cps);
printf("\nArguments: cps:%g latency:%u cycle:%u osc:%g ",cps,latency,cycle,MHz);
/** run simulation */
for(int trials=10000; trials-->0;){
double randy=pfeeder();
sim.next(randy);
}
printf("\nAfter %u trials dead time was %g%% ",sim.events,sim.deadness());
printf("\nRaw counts: %u %u %u \n",sim.events,sim.detected,sim.rejected);
return 0;
}
| true |
81f29ae965bb5d065a5d72513b22314fd84b4f1b | C++ | kukaro/KamangBlogData | /ZZZ-MyStudy/멀티미디어응용-김종남/20180430/4_4_1.cpp | UTF-8 | 1,713 | 3 | 3 | [] | no_license | /*
이미지 로딩해서 데이터 확인
*/
#include <iostream>
#include <opencv/cv.hpp>
using namespace std;
using namespace cv;
void print_matInfo(string name, Mat img) {
string mat_type;
switch (img.depth()) {
case CV_8U:
mat_type = "CV_8U";
break;
case CV_8S:
mat_type = "CV_8S";
break;
case CV_16U:
mat_type = "CV_16U";
break;
case CV_16S:
mat_type = "CV_16S";
break;
case CV_32S:
mat_type = "CV_32S";
break;
case CV_32F:
mat_type = "CV_32F";
break;
case CV_64F:
mat_type = "CV_64F";
break;
default:
break;
}
cout << name;
cout << format(": depth(%d) channels(%d) -> 자료형: ", img.depth(), img.channels());
cout << mat_type << "C" << img.channels() << endl;
}
int main(int argc, const char *argv[]) {
string filename = "/Users/kukaro/KamangBlogData/ZZZ-MyStudy/멀티미디어응용-김종남/20180430/ex_color.jpg";
Mat gray2gray = imread(filename, IMREAD_GRAYSCALE);
Mat gray2color = imread(filename, IMREAD_COLOR);
CV_Assert(gray2gray.data && gray2color.data);
Rect roi(100, 100, 1, 1);
cout << "행렬 좌표 (100,100) 화소값 " << endl;
cout << "gray2gray " << gray2gray(roi) << endl;
cout << "gray2color" << gray2color(roi) << endl;
print_matInfo("gray2gray", gray2gray);
print_matInfo("gray2color", gray2color);
imshow("gray2gray", gray2gray);
imshow("gray2color", gray2color);
waitKey();
return 0;
}
| true |
8b4fa9f744a88b71141d9d8248747e350993baed | C++ | rajeshkumarblr/datastructures | /LinkedList/addlists.cpp | UTF-8 | 1,274 | 3.34375 | 3 | [
"MIT"
] | permissive | #include "LinkedList.h"
#include <stack>
static Node* addLinkedList(Node* list1, Node* list2) {
stack<Node*> stack1;
Node* tmp = list1;
while (tmp) {
stack1.push(tmp);
tmp = tmp->next;
}
stack<Node*> stack2;
Node* nd = list2;
while (nd) {
stack2.push(nd);
nd = nd->next;
}
Node* tmp1 = stack1.top();
Node* tmp2 = stack2.top();
Node* prev = NULL;
Node* node = NULL;
int carry = 0;
while (tmp1 || tmp2) {
int total = carry + (tmp1 ? tmp1->data : 0) + ((tmp2 ? tmp2->data : 0));
carry = (total >= 10) ? 1:0;
Node* node = new Node(total % 10);
node->next = prev;
stack1.pop();
if (!stack1.empty()) {
tmp1 = stack1.top();
} else {
tmp1 = NULL;
}
stack2.pop();
if (!stack2.empty()) {
tmp2 = stack2.top();
} else {
tmp2 = NULL;
}
prev = node;
}
if (carry) {
node = new Node(carry);
node->next = prev;
}
return node;
}
LinkedList* LinkedList::addList(LinkedList* list2) {
head = addLinkedList(getHead(), list2->getHead());
}
LinkedList* createListDriverHelper();
void addListDriver() {
cout << "Add two Linked lists together:" << endl;
LinkedList* list2 = createListDriverHelper();
list2->printList("second list");
list->addList(list2);
} | true |
db554dd29dfe17b86826a8b24f993027c68ea66e | C++ | dingyaguang117/AOJ | /511 车队/main.cpp | UTF-8 | 744 | 2.75 | 3 | [] | no_license | #include <stdio.h>
#include <algorithm>
#include <string.h>
using namespace std;
struct Pair
{
int a,b;
};
int N;
Pair A[5001];
bool steped[5001];
bool cmp(const Pair &a,const Pair &b)
{
if (a.a==b.a)
{
return a.b<b.b;
}
return a.a<b.a;
}
int main()
{
int T,i,j,num,count=0;
Pair one;
scanf("%d",&T);
while(T--)
{
scanf("%d",&N);
for (i=0;i<N;++i)
{
scanf("%d%d",&((A+i)->a),&((A+i)->b));
}
sort(A,A+N,cmp);
memset(steped,0,sizeof(bool)*N);
num=0;
count=0;
while (count!=N)
{
one.a=one.b=0;
for (i=0;i<N;++i)
{
if(!steped[i] && A[i].a>=one.a && A[i].b>=one.b)
{
steped[i]=true;
count++;
one.a=A[i].a;
one.b=A[i].b;
}
}
num++;
}
printf("%d\n",num);
}
} | true |
b2c523f11fab9d0f062c085fffe8c5f11ca0823e | C++ | jstarw/practice | /random/heap.cpp | UTF-8 | 3,191 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class MinHeap {
int *arr;
int capacity;
int heapSize;
public:
MinHeap(int);
void minHeapify(int i);
int parent(int i) { return (i-1)/2; }
int left(int i) { return 2*i+1; }
int right(int i) { return 2*i+2; }
int getMin() { return arr[0]; }
void swap(int* a, int* b);
void print();
int deleteMin();
int deleteKey(int i);
void insertKey(int k);
};
void MinHeap::swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
MinHeap::MinHeap(int i) {
arr = new int[i];
capacity = i;
heapSize = 0;
}
void MinHeap::minHeapify(int i) {
int l = left(i);
int r = right(i);
int smallest = i;
if (l < heapSize && arr[l] < arr[i])
smallest = l;
if (r < heapSize && arr[r] < arr[smallest])
smallest = r;
if (smallest != i)
{
swap(&arr[i], &arr[smallest]);
minHeapify(smallest);
}
}
int MinHeap::deleteMin() {
if (heapSize==0) {
cout<<"empty array!\n";
return -1;
} else if (heapSize==1) {
heapSize--;
return arr[0];
}
int root = arr[0];
arr[0] = arr[heapSize-1];
heapSize--;
minHeapify(0);
return root;
}
void MinHeap::insertKey(int k) {
if (heapSize == capacity) {
cout<<"Max size hit!\n";
return;
}
heapSize++;
int i = heapSize-1;
arr[i] = k;
while (i!=0 && arr[parent(i)] > arr[i]) {
swap(&arr[parent(i)], &arr[i]);
i = parent(i);
}
}
int MinHeap::deleteKey(int i) {
if (i >= heapSize) {
cout<<"the heck\n";
return -1;
}
int key = arr[i];
arr[i] = arr[heapSize-1];
heapSize--;
minHeapify(i);
return key;
}
void MinHeap::print() {
for (int i=0; i<heapSize; i++) {
cout<<arr[i]<< " ";
}
cout<<endl;
}
class MaxHeap {
int* arr;
int heapSize;
int capacity;
public:
MaxHeap(int);
int parent(int i) { return (i-1)/2; }
int left(int i) { return 2*i+1; }
int right(int i) { return 2*i+2; }
int getMax() { return arr[0]; }
void swap(int* a, int* b);
void print();
void heapify(int i);
void insert(int k);
int extractMax();
};
MaxHeap::MaxHeap(int cap) {
arr = new int[cap];
capacity = cap;
heapSize = 0;
}
void MaxHeap::swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
void MaxHeap::insert(int k) {
if (heapSize==capacity) {
cout<<"Max capacity!!!\n";
return;
}
heapSize++;
int i = heapSize-1;
arr[i] = k;
while(i>0 && arr[parent(i)] < arr[i]) {
swap(&arr[parent(i)], &arr[i]);
i = parent(i);
}
}
void MaxHeap::heapify(int i) {
int l = left(i);
int r = right(i);
int biggest = i;
if (l < heapSize && arr[l] > arr[i]) {
biggest = l;
} if (r < heapSize && arr[r] > biggest) {
biggest = r;
} if (biggest!=i) {
swap(&arr[biggest], &arr[i]);
heapify(biggest);
}
}
int MaxHeap::extractMax() {
if (heapSize==0) {
cout<<"heap is empty!\n";
} else if (heapSize==1){
heapSize--;
return arr[0];
}
int key = arr[0];
arr[0] = arr[heapSize-1];
heapSize--;
heapify(0);
return key;
}
void MaxHeap::print() {
for (int i=0; i<heapSize; i++) {
cout<<arr[i]<< " ";
}
cout<<endl;
}
int main() {
MaxHeap m(11);
m.insert(3);
m.insert(2);
m.insert(15);
m.insert(5);
m.insert(4);
m.insert(45);
// m.deleteKey(3);
m.print();
return 0;
} | true |
dbf6ab3f1d67e36e299ea3a94f1d34a112326b69 | C++ | vtudio/PhoneWarsDemo | /Engine/Source/Rendering/CCFrameBufferManager.h | UTF-8 | 3,175 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | /*-----------------------------------------------------------
* 2c - Cross Platform 3D Application Framework
*-----------------------------------------------------------
* Copyright © 2010 – 2011 France Telecom
* This software is distributed under the Apache 2.0 license.
* http://www.apache.org/licenses/LICENSE-2.0.html
*-----------------------------------------------------------
* File Name : CCFrameBufferManager.h
* Description : Manages the creating and switching of frame buffers.
*
* Created : 01/08/11
* Author(s) : Chris Wilson, Ashraf Samy Hegab
*-----------------------------------------------------------
*/
#ifndef __CCFRAMEBUFFERMANAGER_H__
#define __CCFRAMEBUFFERMANAGER_H__
#ifdef QT
#include <QGLFramebufferObject>
#define FBOType QGLFramebufferObject*
#else
#define FBOType GLuint
#endif
class CCFrameBufferObject
{
public:
CCFrameBufferObject();
CCFrameBufferObject(const char *inName, const int inWidth, const int inHeight);
void setFrameBuffer(FBOType fbo) { frameBuffer = fbo; }
FBOType getFrameBuffer() { return frameBuffer; }
GLuint getRenderTexture() { return renderTexture; }
void setRenderTexture(GLuint inTexture) { renderTexture = inTexture; }
void bindRenderTexture();
const CCText& getName() { return name; }
GLuint getFrameBufferHandle();
#ifndef QT
GLuint renderBuffer, depthBuffer, stencilBuffer;
#endif
int width;
int height;
private:
CCText name;
GLuint renderTexture;
FBOType frameBuffer;
};
class CCFrameBufferManager
{
friend class CCRenderer;
friend class CCDeviceRenderer;
public:
CCFrameBufferManager();
~CCFrameBufferManager();
void setup();
float getWidth(const int fboIndex);
float getHeight(const int fboIndex);
int getNumberOfFBOs() { return fbos.length; }
// Creates framebuffer and returns index of frame buffer object to be used with other calls
int findFrameBuffer(const char *name);
int newFrameBuffer(const char *name, const int size, const bool depthBuffer, const bool stencilBuffer);
void deleteFrameBuffer(const int fboIndex);
protected:
void createFrameBuffer(CCFrameBufferObject &fbo, const bool useDepthBuffer, const bool useStencilBuffer);
void destroyFrameBuffer(CCFrameBufferObject &fbo);
void destoryAllFrameBuffers();
public:
// Sets the currently active framebuffer
void bindFrameBuffer(const int fboIndex);
void bindDefaultFrameBuffer();
// Sets the active texture to the texture bound to the given frame buffer
void bindFrameBufferTexture(const int fboIndex);
#ifndef QT
// Returns the renderbuffer attached to the default framebuffer
const GLuint getDefaultRenderBuffer() { return defaultFBO.renderBuffer; }
#endif
// Returns the OpenGL handle of the texture attached to the given frame buffer
GLuint getFrameBufferTexture(const int fboIndex);
// Returns the OpenGL handle for given frame buffer
GLuint getFrameBufferHandle(const int fboIndex);
private:
CCFrameBufferObject defaultFBO;
int currentFBOIndex;
CCList<CCFrameBufferObject> fbos;
};
#endif // __CCFRAMEBUFFERMANAGER_H__
| true |
1519d38b7c6b6f321e75d9473ce8ab4858d9d454 | C++ | EskAere/EpicMonsterTruckSimulator | /PetitMoteur3D/AnimationComponent.h | UTF-8 | 680 | 2.734375 | 3 | [] | no_license | #pragma once
#include "GameObject.h"
#include "AnimationManager.h"
namespace PM3D
{
class AnimationComponent : public Component
{
public:
static constexpr char* typeId = "AnimationComponent";
virtual const char* GetTypeId() { return "AnimationComponent"; }
private:
GameObject* owner;
public:
virtual GameObject* GetOwner() const { return owner; }
public:
virtual void OnAttached(GameObject* _owner) override
{
owner = _owner;
AnimationManager::GetInstance().CreateComponent(this);
}
virtual void OnDetached() override
{
owner = nullptr;
AnimationManager::GetInstance().RemoveComponent(this);
}
public:
virtual void Anime() = 0;
};
}
| true |
dae31e658e9b0baeab27cae26bc60ff7bb3fde6a | C++ | Hugo-Marques-work/WizardsChess | /server/Player.h | UTF-8 | 603 | 2.9375 | 3 | [] | no_license | #ifndef PLAYER_H
#define PLAYER_H
#include <string>
#include <list>
#include <map>
#include "Game.h"
class Player
{
private:
std::string _userId, _password;
std::map<int, Game*> _games;
public:
Player (const std::string& userId, const std::string& password);
const std::string& user() {return _userId;}
const std::string& pass () {return _password;}
const std::map <int, Game*> & games () {return _games;}
bool validatePassword (const std::string& guess);
void addGame (Game* game);
void removeGame (int gameId);
Game* searchGame (int gameId);
};
#endif
| true |
c23ddf2b0d701d7db3467e0c162f26abf6e202f3 | C++ | eduherminio/UVa_OnlineJudge | /10420_Conquests.cpp | UTF-8 | 1,568 | 3.53125 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include <vector>
using namespace std;
class lovers
{
public:
string _country;
int _n_women;
lovers(string country, int n);
lovers(string country);
};
lovers::lovers(string country, int n)
{
_country= country;
_n_women= n;
}
lovers::lovers(string country)
{
_country= country;
_n_women= 1;
}
int main()
{
bool coincidence;
int n_lines;
vector <lovers> women;
cin>> n_lines;
for(int i=0; i<n_lines; i++)
{
string country;
cin>> country;
string crap_name; // Useless :D
getline(cin, crap_name);
coincidence= false;
for(int j=0; j< women.size(); j++) // Calculates number of women
{
if(women[j]._country != country)
coincidence= false;
else
{
women[j]._n_women+= 1;
coincidence= true;
break;
}
}
if(!coincidence) // Adds new country
{
lovers objeto(country, 1);
women.push_back(objeto);
}
// Orders alphabetically the elements according to its country
for(int k=0; k<women.size(); k++) // element k
{
int l= k-1; // previous element
if(l<0)
continue;
if(women[k]._country < women[l]._country)
{
lovers objeto_aux(women[k]._country, women[k]._n_women);
women[k]= women[l];
women[l]= objeto_aux;
k-=2; // k++ de inmediato con el for, y hay que comprobar si el número que hemos
// desplazado hacia la izq. es menor que el que están aún más a la izq.
}
}
}
for(int i=0; i<women.size(); i++)
{
cout<<women[i]._country<<" "<<women[i]._n_women<<endl;
}
} | true |
c8810af4750a5d66510d9eed6204d73ad6f41880 | C++ | InfoTeddy/SSVOpenHexagon | /src/SSVOpenHexagon/Utils/Timeline2.cpp | UTF-8 | 3,452 | 2.703125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"AFL-3.0",
"AFL-2.1"
] | permissive | // Copyright (c) 2013-2020 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: https://opensource.org/licenses/AFL-3.0
#include "SSVOpenHexagon/Utils/Timeline2.hpp"
#include "SSVOpenHexagon/Utils/Match.hpp"
#include <type_traits>
#include <variant>
#include <utility>
#include <chrono>
#include <optional>
#include <functional>
#include <cassert>
namespace hg::Utils
{
void timeline2::clear()
{
_actions.clear();
}
void timeline2::append_do(const std::function<void()>& func)
{
_actions.emplace_back(action{action_do{func}});
}
void timeline2::append_wait_for(const duration d)
{
_actions.emplace_back(action{action_wait_for{d}});
}
void timeline2::append_wait_for_seconds(const double s)
{
append_wait_for(std::chrono::milliseconds(static_cast<int>(s * 1000.0)));
}
void timeline2::append_wait_for_sixths(const double s)
{
append_wait_for_seconds(s / 60.0);
}
void timeline2::append_wait_until(const time_point tp)
{
_actions.emplace_back(action{action_wait_until{tp}});
}
void timeline2::append_wait_until_fn(const std::function<time_point()>& tp_fn)
{
_actions.emplace_back(action{action_wait_until_fn{tp_fn}});
}
[[nodiscard]] std::size_t timeline2::size() const noexcept
{
return _actions.size();
}
[[nodiscard]] timeline2::action& timeline2::action_at(
const std::size_t i) noexcept
{
assert(i < size());
return _actions[i];
}
timeline2_runner::outcome timeline2_runner::update(
timeline2& timeline, const time_point tp)
{
if(_current_idx >= timeline.size())
{
// Empty timeline or reached the end.
return outcome::finished;
}
while(_current_idx < timeline.size())
{
timeline2::action& a = timeline.action_at(_current_idx);
const outcome o = match(
a._inner, //
[&](const timeline2::action_do& x) {
x._func();
return outcome::proceed;
},
[&](const timeline2::action_wait_for& x) {
if(!_wait_start_tp.has_value())
{
// Just started waiting.
_wait_start_tp = tp;
}
const auto elapsed = tp - _wait_start_tp.value();
if(elapsed < x._duration)
{
// Still waiting.
return outcome::waiting;
}
// Finished waiting.
_wait_start_tp.reset();
return outcome::proceed;
},
[&](const timeline2::action_wait_until& x) {
if(tp < x._time_point)
{
// Still waiting.
return outcome::waiting;
}
// Finished waiting.
return outcome::proceed;
}, //
[&](const timeline2::action_wait_until_fn& x) {
if(tp < x._time_point_fn())
{
// Still waiting.
return outcome::waiting;
}
// Finished waiting.
return outcome::proceed;
} //
);
if(o == outcome::proceed)
{
++_current_idx;
continue;
}
if(o == outcome::waiting)
{
return o;
}
assert(false);
}
return outcome::finished;
}
} // namespace hg::Utils
| true |
daf4ba38f811a488900d84dc226fd11513555ac0 | C++ | TheMediocritist/MemoryLCD-2 | /main.cpp | UTF-8 | 1,006 | 2.609375 | 3 | [] | no_license | /*
* STM32F4 Sharp Memory LCD test
*
* Copyright 2014 <b@Zi.iS>
* License GPLv2
*/
#include "stm32f4xx.h"
#include "MemoryLCD.h"
MemoryLCD lcd;
void setup() {
lcd.begin();
lcd.setTextColor(0);
lcd.setTextSize(1);
lcd.setTextWrap(1);
}
void loop() {
puts("Loop");
lcd.fillScreen(1);
lcd.setCursor(0, 0);
lcd.println("\n Adafruit GFX for\n Sharp Memory LCD\n");
lcd.flush();
delay(2000);
lcd.fillScreen(1);
for(int x=0;x<lcd.width()/2;x=x+4) {
lcd.drawRect(x, x, lcd.width() - 2 * x, lcd.height() - 2 * x, 0);
lcd.drawCircle(lcd.width() /2 , lcd.height() /2, x, 0);
lcd.flush();
}
delay(1000);
}
int main(int argc, char* argv[]) {
SystemInit();
setup();
while (1) {
loop();
}
}
#ifdef USE_FULL_ASSERT
void assert_failed(uint8_t* file, uint32_t line) {
printf("Wrong parameters value: file %s on line %lu\r\n", file, line);
}
#endif
| true |
a3eee192ef3f6a547bb634c5309a422059b159fc | C++ | climoge/moteur_physique | /apps/project/PMat.cpp | UTF-8 | 995 | 2.5625 | 3 | [] | no_license | #include "PMat.hpp"
PMat::PMat(glm::vec3 _pos, float _m, bool _isFix) {
pos = glm::vec3(_pos.x, _pos.y, _pos.z);
m = _m;
vit = glm::vec3(0, 0, 0);
frc = glm::vec3(0, 0, 0);
isFix = _isFix;
}
void PMat::UpdateLeapFrog(double h)
{
if(isFix) return;
vit.x += h / m * frc.x;
vit.y += h / m * frc.y;
vit.z += h / m * frc.z;
if(pos.x + h * vit.x > 620 && pos.x + h * vit.x < 0){
vit.x *= -1;
}
pos.x += h * vit.x;
if(pos.y + h * vit.y > 620 && pos.y + h * vit.y < 0){
pos.y = 620;
vit.y *= -1;
}
pos.y += h * vit.y;
//else pos.y -= h * vit.y;
if(pos.z + h * vit.z > 50 && pos.z + h * vit.z < -50){
vit.z *= -1;
}
pos.z += h * vit.z;
//else pos.z -= h * vit.z;
frc = glm::vec3(0, 0, 0);
}
glm::vec3& PMat::getPos(){
return pos;
}
void PMat::setPos(glm::vec3 pos){
pos = pos;
}
glm::vec3& PMat::getFrc(){
return frc;
}
void PMat::setFrc(glm::vec3 frc){
frc = frc;
}
glm::vec3& PMat::getVit(){
return vit;
}
void PMat::setVit(glm::vec3 vit){
vit = vit;
}
| true |
fe317a82e71806c6c0621bd5e203a275fe86bcfd | C++ | naelmansi/cpptraining2 | /GradeBook.cpp | UTF-8 | 1,836 | 3.5625 | 4 | [] | no_license | //GradBook.cpp - Grade Book class implementation
//This is the GradeBook class implementation
//ver 1.0 . by Nael
#include <iostream>
// #include "GradeBook.h" // Import class header. I still have problem with VSC, that I have to put all the files in the
//working directory. I will search and fix this later
// I commented the "#include "GradeBook.h" directive This is not standard way, however, I had to put it here because I faced the following error while executing
//undefined reference to `GradeBook::GradeBook(std::string)'
using namespace std; // so we do not have to use std::cout << , instead, we use cout << without the std::
//below are the memeber functions implementation of the class
//constructor initilization
GradeBook::GradeBook (string aCourseName)
{
setCourseName (aCourseName); // use the setCourseName member function to initilize the course with its name
}//end GradeBook::GradeBook // the constructor
// the setCourseName gives the course its name and controls it according to the definition of the univesity standatds.
void GradeBook::setCourseName(string aCourseName)
{
courseName = aCourseName; // the "courseName" (private member class) will be set as the argument varila "aCourseName"
}//GradeBook::setCourseName
//keep two spaces after block ends.
//This member function returns the course name as string
string GradeBook::getCourseName ()
{
return courseName; // return the private meber variable
}//end GradeBook::getCourseName
//this member function print out the course name
void GradeBook::displayMessage()
{
cout << "Welcome to grade book for\n" << getCourseName() << " !" << endl; // just print this
}//end void GradeBook::displayMessage
////////////// end of file ///////////////////// | true |
7a832903ced647c9c0a6068895bbff564013cde9 | C++ | alexwalterbos/brick-plane-razor | /col.h | UTF-8 | 1,295 | 3.609375 | 4 | [
"MIT"
] | permissive | #pragma once
#include "glm/glm.hpp"
#include <algorithm>
struct Rect {
glm::vec2 min, max;
};
struct Circle {
//Center position
glm::vec2 center;
float radius;
};
class Collision {
public :
static bool intersects(const Rect & rect, const Circle & circle)
{
// Find the closest point to the circle within the rectangle
float closestX = clamp(circle.center.x, rect.min.x, rect.max.x);
float closestY = clamp(circle.center.y, rect.min.y, rect.max.y);
// Calculate the distance between the circle's center and this closest point
float distanceX = circle.center.x - closestX;
float distanceY = circle.center.y - closestY;
// If the distance is less than the circle's radius, an intersection occurs
float distanceSquared = (distanceX * distanceX) + (distanceY * distanceY);
return distanceSquared < (circle.radius * circle.radius);
}
//Checks whether any part of the Obstacle's collider is inside the Rect argument
static bool intersects(const Rect & rect1, const Rect & rect2)
{
return !(rect1.max.x < rect2.min.x
|| rect2.max.x < rect1.min.x
|| rect1.max.y < rect2.min.y
|| rect2.max.y < rect1.min.y);
}
private :
static float clamp(float n, float lower, float upper) {
return std::max(lower, std::min(n, upper));
}
};
| true |
40051fa5892c112d604cae2cf5844b6c99be9a06 | C++ | b00n3r/oostubs-1 | /working_dir/object/strbuf.h | UTF-8 | 2,331 | 3.328125 | 3 | [] | no_license | /*****************************************************************************
* Operating Systems I *
*---------------------------------------------------------------------------*
* *
* S T R I N G B U F F E R *
* *
*---------------------------------------------------------------------------*/
#ifndef __strbuf_include__
#define __strbuf_include__
#include <cstdlib>
#include <cstddef>
/**
* Stringbuffer implements a buffer gathering characters that have to be
* outputed on the screen or a differenct output device. If the buffer is full
* or the user wishes to print the content of the buffer on the output device
* method flush() is called. To enable Stringbuffer to work with different
* output devices method flush() has to be implemented by the subclasses of
* Stringbuffer.
* Since every subclass needs access to the variables and methods of the
* Stringbuffer every variable and method of Stringbuffer is declared
* 'protected'.
*/
class Stringbuffer {
public:
/**
* Method put() inserts a character into the buffer. If the buffer is full
* after the insertion the buffer has to be emptied by calling the method
* flush().
*
* @param c character to be inserted into the buffer
*/
virtual void put(char c);
/**
* Method flush() prints the curent content of the buffer. It is called
* automaticaly as soon as the buffer is full or manualy if an output is
* forced. After printing the buffer content the buffer pointer is reseted.
* To enalbe the Stringbuffer to work with different output mechanisms the
* method has to be implemented in a subclass of Stringbuffer.
*/
virtual void flush() = 0;
protected:
/** buffer containing the characters of the Stringbuffer */
char buffer[16];
/** buffer pointer saving the position of the next insertion */
char* end;
static const size_t size = 16;
/** Default constructor of Stringbuffer setting the buffer empty. */
Stringbuffer();
/** Default desctructor of Stringbuffer. Nothing has to be done here. */
virtual ~Stringbuffer();
};
#endif
| true |
774212040a28a0b3bc0bd8d857ae72e8c9d02f83 | C++ | Mayank-Parasar/leetcode | /count_unival_subtrees.cpp | UTF-8 | 2,018 | 3.921875 | 4 | [] | no_license | //
// Created by Mayank Parasar on 2020-01-11.
//
/*
* A unival tree is a tree where all the nodes have the same value. Given a binary tree,
* return the number of unival subtrees in the tree.
For example, the following tree should return 5:
0
/ \
1 0
/ \
1 0
/ \
1 1
The 5 trees are:
- The three single '1' leaf nodes. (+3)
- The single '0' leaf node. (+1)
- The [1, 1, 1] tree at the bottom. (+1)
*/
#include <iostream>
#include <vector>
#include <assert.h>
using namespace std;
struct node {
int val;
node* left;
node* right;
node(int x) : val(x), left(nullptr), right(nullptr)
{}
};
bool is_unival(node* node_) {
if (node_->left == nullptr &&
node_->right == nullptr)
return true;
if (is_unival(node_->left) && is_unival(node_->right) &&
node_->val == node_->left->val &&
node_->val == node_->right->val)
return true;
if(node_->left == nullptr) {
if(is_unival(node_->right) && node_->val == node_->right->val)
return true;
}
if(node_->right == nullptr) {
if(is_unival(node_->left) && node_->val == node_->left->val)
return true;
}
}
int total_count = 0;
int count_univals(node* node_) {
if(node_ == nullptr)
return 0;
total_count = count_univals(node_->left) + count_univals(node_->right);
if(is_unival(node_))
total_count +=1;
return total_count;
}
int main() {
node* node1 = new node(0);
node* node2 = new node(1);
node* node3 = new node(0);
node* node4 = new node(1);
node* node5 = new node(0);
node* node6 = new node(1);
node* node7 = new node(1);
// connect them
node1->left = node2;
node1->right = node3;
node3->left = node4;
node3->right = node5;
node4->left = node6;
node4->right = node7;
cout << boolalpha;
cout << is_unival(node2);
cout << endl;
cout << "number of unival trees present: " << count_univals(node1);
return 0;
} | true |
ee4f83f1d3d2aa6cf797d425c85e5cccb788308e | C++ | razmik1996/JustExercises | /AbstractEmployeePolimorph/AbstractEmployeePolimorph/HourlyEmployee.h | UTF-8 | 491 | 3.0625 | 3 | [] | no_license | #pragma once
#ifndef HOURLY_H
#define HOURLY_H
#include "Employee.h"
class HourlyEmployee : public Employee
{
public:
HourlyEmployee(const string& first, const string& last,
const string& ssn, double wage = 0.0, double hours = 0.0);
void setWage(double wage);
double getWage() const;
void setHours(double hour);
double getHours() const;
virtual double earnings() const;
virtual void print() const;
~HourlyEmployee();
private:
double wage;
double hours;
};
#endif // HOURLY_H | true |
ae796fc7fe26672a2d608516a33525f864970d60 | C++ | dlx-designlab/Aura | /Aura_8/LightCount.cpp | UTF-8 | 1,022 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "Arduino.h"
#include "LightCount.h"
#include "FastLED.h"
/*———————————————— Constructer ————————————————*/
LightCount::LightCount() {}
/*———————————————— Initialize ————————————————*/
void LightCount::setup(int _index) {
index = _index;
//randomSeed(analogRead(0));
setTime();
}
/*———————————————— Update ————————————————*/
bool LightCount::update() {
if (currOnStep < 180) {
currOnStep += lightingStep;
} else if (currOffStep < 180) {
currOffStep += waitingStep;
} else
setTime();
}
/*———————————————— set lighting time randomly ————————————————*/
void LightCount::setTime() {
currOnStep = 0;
currOffStep = 0;
lightingStep = 180 / random(minSteps, maxSteps);
waitingStep = 180 / random(minSteps, maxSteps);
}
| true |
1c650e93b3112451e9c6691078fdc070fbbcadc6 | C++ | LLLLOREN/Courseworks | /数据结构/作业/5_28.cpp | UTF-8 | 1,025 | 3.296875 | 3 | [] | no_license | //Determine whether it is a complete binary tree
bool isCompleteBTree(bTree* tree){
queue<bTreeNode*> allnode;
bTreeNode* temp = tree;
bool isleaf = false;
if(tree == NULL){
return false;
}
if(tree->lChild == NULL && tree->rChild == NULL){
return true;
}else{
allnode.enQueue(temp);
while (!allnode.empty()) {
if(!isleaf){
if(temp->lChild == NULL && temp->rChild != NULL){
return false;
}else{
allnode.get_front(temp);
allnode.deQueue();
if(temp->rChild == NULL){
isleaf = tree;
}
}
}else{
if(temp->lChild != NULL || temp->rChild != NULL){
return false;
}else{
allnode.get_front(temp);
allnode.deQueue();
}
}
}
return true;
}
}
| true |
482f0fc44c6e8c3994aa9ef9c26d6249c78c6eec | C++ | MichaelRiccardi/TigerZone | /Core/BoardManager/Move.h | UTF-8 | 1,928 | 3.078125 | 3 | [] | no_license | #ifndef __MOVE_H
#define __MOVE_H
#include "../Tiles/Tile.h"
#include "Coord.h"
class Move {
public:
Tile& getTile() const;
const Coord& getCoord() const;
unsigned int getRotation() const;
int getMeepleLocation() const;
bool getHasCrocodile() const;
bool getPlacesTile() const;
bool getPickupMeeple() const;
bool getPlacesExtraMeeple() const;
friend std::ostream &operator<<(std::ostream &out, Move move);
~Move();
Move(const Move& other);
Move& operator=(const Move& other);
// Coord object
Move(Tile& tile, const Coord& coord); // No rotation, meeple, or crocodile
Move(Tile& tile, const Coord& coord, unsigned int rotation); // No meeple or crocodile
Move(Tile& tile, const Coord& coord, unsigned int rotation, unsigned int meepleLocation); // Meeple
Move(Tile& tile, const Coord& coord, unsigned int rotation, bool hasCrocodile); // Crocodile
// No Coord object
Move(Tile& tile, unsigned int x, unsigned int y); // No rotation, meeple, or crocodile
Move(Tile& tile, unsigned int x, unsigned int y, unsigned int rotation); // No meeple or crocodile
Move(Tile& tile, unsigned int x, unsigned int y, unsigned int rotation, unsigned int meepleLocation); // Meeple
Move(Tile& tile, unsigned int x, unsigned int y, unsigned int rotation, bool hasCrocodile); // Crocodile
//Special Cases for no placeable tile
Move(bool throwaway); // passes
Move(Tile& tile, bool pickupMeeple); // pickup or place extra meeple
Move()=delete;
private:
Tile* tile;
const Coord* coord;
unsigned int rotation;
int meepleLocation; // -1 = no meeple/tiger
bool hasCrocodile;
bool placesTile;
bool pickupMeeple;
bool placesExtraMeeple;
};
#endif
| true |
01040174c8abba5076cc03dc8460918b305d97d6 | C++ | rkbjunior/pubkcrypto | /helpers.cpp | UTF-8 | 505 | 3.328125 | 3 | [
"MIT"
] | permissive | #include <fstream>
#include <sstream>
#include <vector>
#include <cstdint>
#include <iostream>
#include <iomanip>
#include "helpers.h"
using namespace std;
/*
Converts a uint64_t into an ascii equivalent string
Param: value - a uint64_t value to be converted
Returns: An ascii representation of a uint64_t
*/
string helpers::Convert32ToString(uint32_t value) {
string result;
for (int i = 3; i >= 0; i--) {
result.push_back(value >> (i * 8) & 0x000000FF);
}
return result;
} | true |
7bf4d7b09c4c285907865be958c6728ad413286e | C++ | cszawisza/riscv-vm | /riscv_vm/elf.cpp | UTF-8 | 2,695 | 2.640625 | 3 | [
"MIT"
] | permissive | #include <memory>
#include <stdio.h>
#include <stdlib.h>
#include "elf.h"
#include "memory.h"
#include "../riscv_core/riscv.h"
elf_t::elf_t()
: hdr(nullptr)
, raw_size(0)
{
}
bool elf_t::upload(struct riscv_t *rv, memory_t &mem) const {
// set the entry point
rv_set_pc(rv, hdr->e_entry);
// loop over all of the program headers
for (int p = 0; p < hdr->e_phnum; ++p) {
// find next program header
uint32_t offset = hdr->e_phoff + (p * hdr->e_phentsize);
const ELF::Elf32_Phdr *phdr = (const ELF::Elf32_Phdr*)(data() + offset);
// check this section should be loaded
if (phdr->p_type != ELF::PT_LOAD) {
continue;
}
// memcpy required range
const int to_copy = std::min(phdr->p_memsz, phdr->p_filesz);
if (to_copy) {
mem.write(phdr->p_vaddr, data() + phdr->p_offset, to_copy);
}
// zero fill required range
const int to_zero = std::max(phdr->p_memsz, phdr->p_filesz) - to_copy;
if (to_zero) {
mem.fill(phdr->p_vaddr + to_copy, to_zero, 0);
}
}
// success
return true;
}
bool elf_t::load(const char *path) {
// free previous memory
if (raw_data) {
release();
}
// open the file handle
FILE *fd = fopen(path, "rb");
if (!fd) {
return false;
}
// get file size
fseek(fd, 0, SEEK_END);
raw_size = ftell(fd);
fseek(fd, 0, SEEK_SET);
if (raw_size == 0) {
fclose(fd);
return false;
}
// allocate memory
raw_data.reset(new uint8_t[raw_size]);
// read data into memory
const size_t read = fread(raw_data.get(), 1, raw_size, fd);
// close file handle
fclose(fd);
if (read != raw_size) {
release();
return false;
}
// point to the header
hdr = (const ELF::Elf32_Ehdr*)data();
// check it is a valid ELF file
if (!is_valid()) {
release();
return false;
}
// success
return true;
}
void elf_t::fill_symbols() {
// init the symbol table
symbols.clear();
symbols[0] = "NULL";
// get the string table
const char *strtab = get_strtab();
if (!strtab) {
return;
}
// get the symbol table
const ELF::Elf32_Shdr *shdr = get_section_header(".symtab");
if (!shdr) {
return;
}
// find symbol table range
const ELF::Elf32_Sym *sym = (const ELF::Elf32_Sym *)(data() + shdr->sh_offset);
const ELF::Elf32_Sym *end = (const ELF::Elf32_Sym *)(data() + shdr->sh_offset + shdr->sh_size);
// try to find the symbol
for (; sym < end; ++sym) {
const char *sym_name = strtab + sym->st_name;
// add to the symbol table
switch (ELF_ST_TYPE(sym->st_info)) {
case ELF::STT_NOTYPE:
case ELF::STT_OBJECT:
case ELF::STT_FUNC:
symbols[uint32_t(sym->st_value)] = sym_name;
}
}
}
| true |
2741bfb03c0555cd96ecccfe42cc26eb780b7f02 | C++ | jerryhanhuan/test-code-backup | /TEST_DIR/test_ctors/test/ctors.cpp | GB18030 | 2,470 | 3.734375 | 4 | [] | no_license | #include "stdafx.h"
#include <iostream>
using namespace std;
//һ 캯ĵ˳
// 1 Ӳܼ̳иĹ
// 2 ִ˳:
// a) Ķ캯ִкûйϵ
// b) Ķ캯ִ˳
// i. ִиĹ캯
// ii. dzԱĹ캯
// iii.ִĹ캯
// iv. ִ˳캯෴
//
//
//
class Base
{
public:
Base()
{ cout<<"Ĺ캯ִ!"<<endl; }
~Base()
{ cout<<"ִ!"<<endl ;}
};
//ijԱ
class Member
{
public:
Member()
{ cout<<"MemberĹ캯"<<endl; }
~Member()
{ cout<<"Member"<<endl; }
};
//
class Son:public Base
{
private:
Member m_clsMember;
public:
Son()
{ cout<<"Ĺ캯 " <<endl;}
~Son()
{ cout<<" "<<endl; }
};
void test1()
{
Son clsSon;
cout<<endl<<"#####ʼ"<<endl;
}
// 캯ĸʽ
// 1 ֻεĹ캯ҪøĹ캯
// 2 дĹ캯ҪøĹ캯ഫݲ
// 3 ݲĸʽĹ캯캯(б)
// 4 һĹ캯ĸ=̳ijԱ+ԼԱ
class Person
{
protected:
int m_iage;
char m_szName[128];
public:
Person(char* pNameInput,int iage)
{
strcpy(m_szName, pNameInput);
m_iage = iage;
}
void ShowPerson()
{ cout<<""<<m_szName<<" 䣺"<<m_iage<<endl;}
};
//Student: Աnameageg
class Student:public Person
{
protected:
int m_iResult;
public:
Student(char* pNameInput,int iage, int iResult):Person(pNameInput, iage)
{
this->m_iResult = iResult;
}
void ShowStudent()
{
cout<<""<<m_szName<<" 䣺"<<m_iage
<<" ɼ"<<m_iResult<<endl;
}
};
void test2()
{
Student clsStudent("", 33, 89);
clsStudent.ShowStudent();
}
void main()
{
test1();
cout<<endl<<"#####캯ʼ"<<endl;
test2();
system("pause");
}
| true |
6555133aadde185d940b24e9c3741cf184f618d3 | C++ | maheshvele/DataDrivenGameEngine | /Tetris/source/Library/Datum.h | UTF-8 | 14,370 | 3.671875 | 4 | [] | no_license | #pragma once
#include <cstdint>
#include <string>
#include <iostream>
#include <sstream>
#include "glm/glm.hpp"
#include "RTTI.H"
namespace Library
{
//Forward declaration
class Scope;
/**
Datum class. Run-time polymorphic array of values
*/
class Datum
{
public:
/**
Enum used to keep track of the type of the data values being held
*/
enum DatumType
{
UNKNOWN,
INTEGER,
FLOAT,
VECTOR,
MATRIX,
STRING,
POINTER,
TABLE,
MAX
};
/**
Union used to hold different types of values
*/
union DatumValues
{
int* i;
float* f;
glm::vec4* v;
glm::mat4* m;
std::string* s;
RTTI** p;
Scope** sc;
DatumValues() { i = nullptr; };
};
/**
Default constructor. Initializes datum to be empty. Doesn't allocated any memory
*/
Datum();
/**
Constructor with a initial type and size
@param type the type of the datum
@param size the size of the datum
*/
Datum(DatumType type, std::uint32_t size);
/**
Default destructor.
*/
~Datum();
/**
Copy constructor
@param rhs a reference to the datum to copy
*/
Datum(const Datum& rhs);
/**
Assignment operator
@param rhs a reference to the datum to copy
*/
Datum& operator=(const Datum& rhs);
/**
Scalar assignment (int)
@param rhs a reference to the int to copy
*/
Datum& operator=(const int& rhs);
/**
Scalar assignment (float)
@param rhs a reference to the float to copy
*/
Datum& operator=(const float& rhs);
/**
Scalar assingment (vector)
@param rhs a reference to the vector to copy
*/
Datum& operator=(const glm::vec4& rhs);
/**
Scalar assingment (matrix)
@param rhs a reference to the matrix to copy
*/
Datum& operator=(const glm::mat4& rhs);
/**
Scalar assignment (string)
@param rhs a reference to the string to copy
*/
Datum& operator=(const std::string& rhs);
/**
Scalar assignemnt (pointers)
@param rhs a reference to the pointer to copy
*/
Datum& Datum::operator=(RTTI* rhs);
/**
Scalar assignment (scope)
@param rhs a reference to the pointer to copy
*/
Datum& Datum::operator=(Scope* rhs);
/**
Bracket operator for syntactically simplified access to nested scopes
@param index the index of the item to retrieve
@return the item at the supplied index
*/
Scope& Datum::operator[](std::uint32_t index);
/**
Equality operator
@param rhs a reference to the datum to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const Datum& rhs);
/**
Scalar equality operator (int)
@param rhs a reference to the int to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const int& rhs);
/**
Scalar equality operator (float)
@param rhs a reference to the floaat to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const float& rhs);
/**
Scalar equality operator (vector)
@param rhs a reference to the vector to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const glm::vec4& rhs);
/**
Scalar equality operator (matrix)
@param rhs a reference to the matrix to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const glm::mat4& rhs);
/**
Scalar equality operator (string)
@param rhs a reference to the string to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const std::string& rhs);
/**
Scalar equality operator (pointer)
@param rhs a reference to the pointer to compare with
@return true if the values are equal. False otherwise
*/
bool operator==(const RTTI* rhs);
/**
Inequality operator
@param rhs a reference to the datum to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(const Datum& rhs);
/**
Scalar inequality operator (int)
@param rhs a reference to the int to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(const int& rhs);
/**
Scalar inequality operator (float)
@param rhs a reference to the float to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(const float& rhs);
/**
Scalar inequality operator (vector)
@param rhs a reference to the vector to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(const glm::vec4& rhs);
/**
Scalar inequality operator (matrxi)
@param rhs a reference to the matrix to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(const glm::mat4& rhs);
/**
Scalar inequality operator (string)
@param rhs a reference to the string to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(const std::string& rhs);
/**
Scalar inequality operator (pointer)
@param rhs a reference to the pointer to compare with
@return flase if the values are equal. True otherwise
*/
bool operator!=(RTTI* rhs);
/**
Check the current type of data being stored
@return the type of the data being stored
*/
DatumType GetType() const;
/**
Chech the current number of elements
@return the size of the array
*/
std::uint32_t Size() const;
/**
Set the type of data stored
@param newType the new type to set the data to
*/
void SetType(DatumType newType);
/**
Set the number of values and reserve memory if needed
@param newSize the size to be set to
*/
void SetSize(std::uint32_t newSize);
/**
Set the datum to store external data (int version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(int *newData, std::uint32_t newSize);
/**
Set the datum to store external data (float version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(float *newData, std::uint32_t newSize);
/**
Set the datum to store external data (vector version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(glm::vec4 *newData, std::uint32_t newSize);
/**
Set the datum to store external data (matrix version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(glm::mat4 *newData, std::uint32_t newSize);
/**
Set the dadtum to store external data (string version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(std::string *newData, std::uint32_t newSize);
/**
Set the dadtum to store external data (Pointer version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(RTTI **newData, std::uint32_t newSize);
/**
Set the dadtum to store external data (Scope version)
@param newData the external data
@param newSize the size of the external data
*/
void SetStorage(Scope **newData, std::uint32_t newSize);
/**
Set a value at an index in the array (int version)
@param newInt the new integer to be used
@param index the index to be set (default zero)
*/
void Set(int newInt, std::uint32_t index = 0);
/**
Set a value at an index in the array (float version)
@param newFloat the new value to be used
@param index the index to be set (default zero)
*/
void Set(float newFloat, std::uint32_t index = 0);
/**
Set a value at an index in the array (vector version)
@param newVec the new value to be used
@param index the index to be set (default zero)
*/
void Set(glm::vec4 newVec, std::uint32_t index = 0);
/**
Set a value at an index in the array (matrix version)
@param newMat the new value to be used
@param index the index to be set (default zero)
*/
void Set(glm::mat4 newMat, std::uint32_t index = 0);
/**
Set a value at an index in the array (string version)
@param newString the new value to be used
@param index the index to be set (default zero)
*/
void Set(std::string newString, std::uint32_t index = 0);
/**
Set a value at an index in the array (RTTI version)
@param newPointer the new value to be used
@param index the index to be set (default zero)
*/
void Set(RTTI* newPointer, std::uint32_t index = 0);
/**
Set a value at an index in the array (Scope version)
@param newPointer the new value to be used
@param index the index to be set (default zero)
*/
void Set(Scope* newScope, std::uint32_t index = 0);
/**
Get a value at an index in the array (templated)
@param index the index of the item to retrieve
*/
template <typename T>
T& Get(std::uint32_t index = 0);
/**
Clear the array. Does not actually shrink the capacity of the array
*/
void Clear();
/**
Set the value of an element at a given index (default zero) to the value represented by the given string
@param stringValue the string to get the data from
@param index the index of the item to set (default 0)
*/
void SetFromString(std::string stringValue, std::uint32_t index = 0);
/**
Get a string representation of an element
@param index the index of the item to set (default 0)
@return the string representation of the data
*/
std::string ToString(std::uint32_t index = 0);
/**
Check to see if the datum in question is storing external data
@return true if data is external. False otherwise
*/
bool IsExternal();
/**
Get the size of the datum
@return the size of the datum
*/
std::uint32_t GetSize();
private:
/**
Variable that holds the current type of the datum
*/
DatumType mType;
/**
Variable that stores the actual values
*/
DatumValues mValues;
/**
The current number of elements in the datum
*/
std::uint32_t mSize;
/**
The maximum number of elements in the datum
*/
std::uint32_t mCapacity;
/**
Track internal vs external storage
*/
bool mIsExternal;
/**
Typedef of memory reserve and copy functions
*/
typedef DatumValues(*reserveMemoryFP)(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Typedef of memory delete functions
*/
typedef void(*deleteMemoryFP)(DatumValues& toDelete);
/**
Static array of function pointers for reserving memory initialized to a copy of another datumValues
*/
static reserveMemoryFP reservePointers[9];
/**
Static array of function pointers for deleting memory
*/
static deleteMemoryFP deletionPointers[9];
/**
Function for allocating memory for ints, filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues IntReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Function for allocating memory for floats, filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues FloatReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Funciton for allocating memory for vec4s filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues VecReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Funciton for allocating memory for mat4s filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues MatReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Funciton for allocating memory for strings filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues StringReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Function for allocating memorry for pointers filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues PointerReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Function for allocating memorry for scopes filled with copies from an old array
@param size the size of the array
@param oldSize the size of the array to copy from
@param toCopy the DatumValues to copy from
@return DatumValues the newly allocated copy
*/
static DatumValues ScopeReserveCopy(std::uint32_t size, std::uint32_t oldSize, const DatumValues& toCopy);
/**
Function for deleting memory for ints
@param toDelete the DatumValues to deletes
*/
static void IntDelete(DatumValues& toDelete);
/**
Function for deleting memory for floats
@param toDelete the DatumValues to deletes
*/
static void FloatDelete(DatumValues& toDelete);
/**
Function for deleting memory for vec4s
@param toDelete the DatumValues to deletes
*/
static void VecDelete(DatumValues& toDelete);
/**
Function for deleting memory for mat4s
@param toDelete the DatumValues to deletes
*/
static void MatDelete(DatumValues& toDelete);
/**
Function for deleting memory for strings
@param toDelete the DatumValues to deletes
*/
static void StringDelete(DatumValues& toDelete);
/**
Function for dleeting memory for RTTI pointers
@param toDelete the DatumValues to deletes
*/
static void PointerDelete(DatumValues& toDelete);
/**
Function for deleting memory for scopes pointers
@param toDelete the DatumValues to deletes
*/
static void ScopeDelete(DatumValues& toDelete);
};
} | true |
7846cc67f20991930b916726dbdda3295e5500cc | C++ | shivam04/codes | /leetcode-questions/score-after-flipping-matrix.cpp | UTF-8 | 1,021 | 2.84375 | 3 | [] | no_license | class Solution {
public:
int power(int m, vector<int> g) {
int ans = 0;
int n = g.size();
for(int i=0;i<n;i++) {
ans += i*pow(2,n-i-1);
}
return ans;
}
int matrixScore(vector<vector<int>>& grid) {
int m = grid.size();
int n = grid[0].size();
for(int i=0;i<m;i++) {
if(grid[i][0]==0) {
for(int j=0;j<n;j++) {
grid[i][j] = 1 - grid[i][j];
}
}
}
for(int j=1;j<n;j++) {
int cnt = 0;
for(int i=0;i<m;i++) {
cnt += (grid[i][j]==0);
}
if(m-cnt < cnt) {
for(int i=0;i<m;i++) {
grid[i][j] = 1 - grid[i][j];
}
}
}
int ans = 0;
for(int i=0;i<m;i++) {
for(int j=0;j<n;j++) {
ans = ans + grid[i][j]*pow(2,n-j-1);
}
}
return ans;
}
}; | true |
53e1846161aa08fd348158fc7534c55d09cf26a3 | C++ | stevester94/CppExamples | /_unsorted/toodleDoAPI/toodleDoAPI.cpp | UTF-8 | 2,767 | 2.828125 | 3 | [] | no_license | //Toodledo API access
#include "md5.h"
#include <string>
#include <iostream>
#include <curl/curl.h>
#include "json.hpp"
using namespace std;
using json = nlohmann::json;
#define APP_TOKEN "api56d886468fd70"
#define APP_ID "ssmackeyTDAPI"
#define USER_ID "td52d2442ce2e79"
#define CACHED_SESSION_TOKEN "td56dc219d4a09d"
string curlData;
string* generateSignature(string userID, string appToken) {
string* signature = new string(md5(userID + appToken));
return signature;
}
string* generateKey(string* appToken, string* userPassword, string* sessionToken) {
string* key = new string(md5(md5(*userPassword) + *appToken + *sessionToken));
return key;
}
size_t writeCallback(char* buf, size_t size, size_t nmemb, void* up) { //callback must have this declaration
//buf is a pointer to the data that curl has for us
//size*nmemb is the size of the buffer
for (int c = 0; c < size*nmemb; c++) {
curlData.push_back(buf[c]);
}
return size*nmemb; //tell curl how many bytes we handled
}
string* getURL(string & URL) {
CURL* curl;
curl_global_init(CURL_GLOBAL_ALL); //pretty obvious
curl = curl_easy_init();
curl_easy_setopt(curl, CURLOPT_URL, URL.c_str());
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &writeCallback);
// curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); //tell curl to output its progress
curl_easy_perform(curl);
cout << "CURL DATA:" << curlData << endl;
curl_easy_cleanup(curl);
curl_global_cleanup();
return &curlData;
}
string* getTasks(string* key) {
string url("http://api.toodledo.com/2/tasks/get.php?key=");
url = url + *key;
string response = *getURL(url);
cout << "response: " << response << endl;
json j = json::parse(response);
for(auto it = j.begin(); it != j.end(); it++) {
cout << (*it)["title"].dump() << endl;
}
}
string* getSessionToken(string* userID, string* signature) {
string requestURL = "http://api.toodledo.com/2/account/token.php?userid=";
requestURL = requestURL + *userID + ";appid=" + APP_ID + ";sig=" + *signature;
string* sessionToken;
string* response;
response = getURL(requestURL);
json j = json::parse(*response);
sessionToken = new string(j["token"].dump());
return sessionToken;
}
int main() {
string userID(USER_ID);
string appToken(APP_TOKEN);
string* signature; //MD5 hash of userID and appToken
string* sessionToken;
string* key;
string* password = new string("!");
signature = generateSignature(userID, appToken);
cout << *signature << endl;
sessionToken = getSessionToken(&userID, signature);
*sessionToken = (CACHED_SESSION_TOKEN); //Because fuck toodledo tokens limiting
key = generateKey(&appToken, password, sessionToken);
cout << "key: " << *key << endl;
getTasks(key);
}
| true |
d1f7e64d7ec7e509861fc6f80ff2237da84ed955 | C++ | toffaletti/libten | /tests/test_task.cc | UTF-8 | 10,812 | 2.765625 | 3 | [
"Apache-2.0"
] | permissive | #include "gtest/gtest.h"
#include <thread>
#include "ten/descriptors.hh"
#include "ten/semaphore.hh"
#include "ten/channel.hh"
#include "ten/task.hh"
using namespace ten;
using namespace std::chrono;
static void bar(std::thread::id p) {
// cant use EXPECT_TRUE in multi-threaded tests :(
EXPECT_NE(std::this_thread::get_id(), p);
this_task::yield();
}
static void foo(std::thread::id p) {
EXPECT_NE(std::this_thread::get_id(), p);
task::spawn([p]{
bar(p);
});
this_task::yield();
}
TEST(Task, Constructor) {
task::main([]{
std::thread::id main_id = std::this_thread::get_id();
std::thread t = task::spawn_thread([=]{
foo(main_id);
});
t.join();
});
}
static void co1(int &count) {
count++;
this_task::yield();
count++;
}
TEST(Task, Schedule) {
int count = 0;
task::main([&]{
for (int i=0; i<10; ++i) {
task::spawn([&]{ co1(count); });
}
});
EXPECT_EQ(20, count);
}
static void pipe_write(pipe_fd &p) {
EXPECT_EQ(p.write("test", 4), 4);
}
static void pipe_wait(size_t &bytes) {
pipe_fd p{O_NONBLOCK};
task::spawn([&] {
pipe_write(p);
});
fdwait(p.r.fd, 'r');
char buf[64];
bytes = p.read(buf, sizeof(buf));
}
TEST(Task, Fdwait) {
size_t bytes = 0;
task::main([&] {
task::spawn([&] { pipe_wait(bytes); });
});
EXPECT_EQ(bytes, 4u);
}
static void connect_to(address addr) {
socket_fd s{AF_INET, SOCK_STREAM};
s.setnonblock();
if (s.connect(addr) == 0) {
// connected!
} else if (errno == EINPROGRESS) {
// poll for writeable
EXPECT_TRUE(fdwait(s.fd, 'w'));
} else {
throw errno_error();
}
}
static void listen_co(bool multithread) {
socket_fd s{AF_INET, SOCK_STREAM};
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1);
address addr{"127.0.0.1", 0};
s.bind(addr);
s.getsockname(addr);
s.listen();
std::thread connect_thread;
if (multithread) {
connect_thread = task::spawn_thread([=] {
connect_to(addr);
});
} else {
task::spawn([=] {
connect_to(addr);
});
}
EXPECT_TRUE(fdwait(s.fd, 'r'));
address client_addr;
socket_fd cs{s.accept(client_addr, SOCK_NONBLOCK)};
fdwait(cs.fd, 'r');
char buf[2];
ssize_t nr = cs.recv(buf, 2);
if (connect_thread.joinable()) {
connect_thread.join();
}
// socket should be disconnected because
// when connect_to task is finished
// close was called on its socket
EXPECT_EQ(nr, 0);
}
TEST(Task, Socket) {
task::main([] {
task::spawn([]{ listen_co(false); });
});
}
TEST(Task, SocketThreaded) {
task::main([] {
task::spawn([]{ listen_co(true); });
});
}
static void sleeper() {
auto start = steady_clock::now();
this_task::sleep_for(milliseconds{10});
auto end = steady_clock::now();
// check that at least 10 milliseconds passed
EXPECT_NEAR(duration_cast<milliseconds>(end-start).count(), 10.0, 2.0);
}
TEST(Task, Sleep) {
task::main([] {
task::spawn([]{ sleeper(); });
});
}
static void listen_timeout_co() {
socket_fd s{AF_INET, SOCK_STREAM};
s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1);
address addr{"127.0.0.1", 0};
s.bind(addr);
s.getsockname(addr);
s.listen();
bool timeout = !fdwait(s.fd, 'r', std::chrono::milliseconds{5});
EXPECT_TRUE(timeout);
}
TEST(Task, PollTimeout) {
task::main([] {
listen_timeout_co();
});
}
static void sleep_many(uint64_t &count) {
++count;
this_task::sleep_for(milliseconds{5});
++count;
this_task::sleep_for(milliseconds{10});
++count;
}
TEST(Task, ManyTimeouts) {
uint64_t count(0);
task::main([&] {
for (int i=0; i<1000; i++) {
task::spawn([&] {
sleep_many(count);
});
}
});
EXPECT_EQ(count, 3000u);
}
static void long_sleeper() {
this_task::sleep_for(seconds{10});
EXPECT_TRUE(false);
}
static void cancel_sleep() {
auto t = task::spawn(long_sleeper);
this_task::sleep_for(milliseconds{10});
t.cancel();
}
TEST(Task, CancelSleep) {
task::main([] {
cancel_sleep();
});
}
static void long_sleeper_yield() {
try {
this_task::sleep_for(seconds{10});
} catch (task_interrupted &) {
// make sure yield doesn't throw again
this_task::yield();
EXPECT_TRUE(true);
this_task::yield();
EXPECT_TRUE(true);
throw;
}
EXPECT_TRUE(false);
}
static void cancel_once() {
auto t = task::spawn(long_sleeper_yield);
this_task::sleep_for(milliseconds{10});
t.cancel();
}
TEST(Task, CancelOnlyOnce) {
task::main([] {
cancel_once();
});
}
static void channel_wait() {
channel<int> c;
int a = c.recv();
(void)a;
EXPECT_TRUE(false);
}
static void cancel_channel() {
auto t = task::spawn(channel_wait);
this_task::sleep_for(milliseconds{10});
t.cancel();
}
TEST(Task, CancelChannel) {
task::main([] {
cancel_channel();
});
}
static void io_wait() {
pipe_fd p;
fdwait(p.r.fd, 'r');
EXPECT_TRUE(false);
}
static void cancel_io() {
auto t = task::spawn(io_wait);
this_task::sleep_for(milliseconds{10});
t.cancel();
}
TEST(Task, CancelIO) {
task::main([] {
cancel_io();
});
}
static void yield_loop(uint64_t &counter) {
for (;;) {
this_task::yield();
++counter;
}
}
static void yield_timer() {
uint64_t counter = 0;
auto t = task::spawn([&]{ yield_loop(counter); });
this_task::sleep_for(seconds{1});
t.cancel();
// tight yield loop should take less than microsecond
// this test depends on hardware and will probably fail
// when run under debugging tools like valgrind/gdb
EXPECT_GT(counter, 100000u);
}
TEST(Task, YieldTimer) {
task::main([]{
yield_timer();
});
}
static void deadline_timer() {
try {
deadline dl{milliseconds{100}};
this_task::sleep_for(milliseconds{200});
EXPECT_TRUE(false);
} catch (deadline_reached &e) {
EXPECT_TRUE(true);
}
}
static void deadline_not_reached() {
try {
deadline dl{milliseconds{100}};
this_task::sleep_for(milliseconds{50});
EXPECT_TRUE(true);
} catch (deadline_reached &e) {
EXPECT_TRUE(false);
}
this_task::sleep_for(milliseconds{100});
EXPECT_TRUE(true);
}
TEST(Task, DeadlineTimer) {
task::main([] {
task::spawn(deadline_timer);
task::spawn(deadline_not_reached);
});
}
static void deadline_cleared() {
auto start = steady_clock::now();
try {
deadline dl{milliseconds{10}};
this_task::sleep_for(seconds{20});
EXPECT_TRUE(false);
} catch (deadline_reached &e) {
EXPECT_TRUE(true);
// if the deadline or timeout aren't cleared,
// this yield will sleep or throw again
this_task::yield();
auto end = steady_clock::now();
EXPECT_TRUE(true);
EXPECT_NEAR((float)duration_cast<milliseconds>(end-start).count(), 10.0, 2.0);
}
}
TEST(Task, DeadlineCleared) {
task::main([] {
task::spawn(deadline_cleared);
});
}
static void deadline_cleared_not_reached() {
try {
if (true) {
deadline dl{milliseconds{100}};
this_task::sleep_for(milliseconds{20});
// deadline should be removed at this point
EXPECT_TRUE(true);
}
this_task::sleep_for(milliseconds{100});
EXPECT_TRUE(true);
} catch (deadline_reached &e) {
EXPECT_TRUE(false);
}
}
TEST(Task, DeadlineClearedNotReached) {
task::main([] {
task::spawn(deadline_cleared_not_reached);
});
}
static void deadline_yield() {
auto start = steady_clock::now();
try {
deadline dl{milliseconds{5}};
for (;;) {
this_task::yield();
}
EXPECT_TRUE(false);
} catch (deadline_reached &e) {
EXPECT_TRUE(true);
// if the deadline or timeout aren't cleared,
// this yield will sleep or throw again
this_task::yield();
auto end = steady_clock::now();
EXPECT_TRUE(true);
EXPECT_NEAR((float)duration_cast<milliseconds>(end-start).count(), 5.0, 2.0);
}
}
TEST(Task, DeadlineYield) {
task::main([]{
task::spawn(deadline_yield);
});
}
TEST(Task, DeadlineRecentTime) {
// test to make sure we're using a recent time
// to create the deadline. if cached time wasn't
// updated recently enough this test can fail
task::main([] {
pipe_fd p{O_NONBLOCK};
// must use a thread to trigger this
// otherwise we might update cached time
auto pipe_thread = std::thread([&] {
std::this_thread::sleep_for(milliseconds{20});
size_t nw = p.write("foo", 3);
(void)nw;
std::this_thread::sleep_for(milliseconds{5});
nw = p.write("foo", 3);
(void)nw;
});
bool got_to_deadline = false;
try {
char buf[10];
fdwait(p.r.fd, 'r'); // this will wait ~20ms
size_t nr = p.read(buf, sizeof(buf));
(void)nr;
deadline dl{milliseconds{10}};
fdwait(p.r.fd, 'r'); // this will wait ~5ms
} catch (deadline_reached) {
got_to_deadline = true;
}
pipe_thread.join();
EXPECT_TRUE(!got_to_deadline);
});
}
TEST(Task, NewApi) {
task::main([]{
int i = 1;
task t = task::spawn([&] {
++i;
});
this_task::yield();
EXPECT_EQ(2, i);
auto start = kernel::now();
std::thread th = task::spawn_thread([&] {
// yield to nothing
this_task::yield();
++i;
this_task::sleep_for(milliseconds{20});
std::this_thread::sleep_for(milliseconds{20});
});
th.join();
this_task::yield(); // allow cached time to update
auto stop = kernel::now();
EXPECT_EQ(3, i);
EXPECT_NEAR((float)duration_cast<milliseconds>(stop-start).count(), 40.0, 10.0);
});
}
TEST(Task, Join) {
task::main([]{
task t;
EXPECT_TRUE(t.joinable() == false);
int foo = 0;
t = task::spawn([&]{
this_task::sleep_for(milliseconds{5});
foo = 42;
});
EXPECT_TRUE(t.joinable());
EXPECT_TRUE(foo == 0);
t.join();
EXPECT_TRUE(t.joinable());
EXPECT_TRUE(foo == 42);
t.join();
EXPECT_TRUE(t.joinable());
});
}
| true |
1bba6d5dacda6191288694f3ed63bcea2204f055 | C++ | kiseop91/OpenRPG | /OpenRPG/States/State.h | UTF-8 | 1,413 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
class State {
private:
protected:
sf::RenderWindow* window;
std::map<std::string, int>* supportedKeys;
std::map<std::string, int> keybinds;
bool paused;
float keyTime;
float keyTimeMax;
sf::Vector2i mousePosScreen;
sf::Vector2i mousePosWindow;
sf::Vector2f mousePosView;
// Resources
std::map<std::string, sf::Texture> textures;
std::map<std::string, sf::SoundBuffer> sounds;
//함수
virtual void initKeybinds() = 0;
void initSounds();
public:
State(sf::RenderWindow* window, std::map<std::string, int>* supportedKeys);
virtual ~State();
const bool& getQuit() const;
const bool getKeytime();
void endState();
void pauseState();
void unpauseState();
/// <summary>장면이 화면의 최상단에 위치할 때 호출됩니다.</summary>
virtual void onActivated() = 0;
/// <summary>장면이 화면의 최상단에 위치하지 않게될 때 호출됩니다.</summary>
virtual void onDeactivated() = 0;
/// <summary>장면이 화면 스택에 진입한 후에 호출됩니다.</summary>
virtual void onEnter() = 0;
/// <summary>장면이 화면 스택에서 제거된 후에 호출됩니다.</summary>
virtual void onLeave() = 0;
virtual void updateInput(const float& dt) = 0;
virtual void updateKeytime(const float& dt);
virtual void updateMousePositions();
virtual void update() = 0;
virtual void render(sf::RenderTarget* target = NULL) = 0;
};
| true |
81d44471207701ad2b0390f3a5869bd1976674bc | C++ | GeorgeBely/Arduino | /Lesson/RadioReceiver/RadioReceiver.ino | UTF-8 | 1,388 | 3.046875 | 3 | [] | no_license | #include <VirtualWire.h>
/** Подключаем приёмник к пину 11 */
#define RADIO_RX_PI 11
void setup() {
Serial.begin(9600);
vw_set_ptt_inverted(true); // Необходимо для DR3100
vw_set_rx_pin(RADIO_RX_PI);
vw_setup(2000); // Задаем скорость приема
vw_rx_start(); // Начинаем мониторинг эфира
}
void loop() {
String result = readMessageByRadio();
if (result != "") {
Serial.println(result);
}
}
/**
* Принимает сообщение по радио. Сообщение должно начинаться и заканчиваться символом '$'
*
* @return строка принятая радио приёмником
*/
String readMessageByRadio() {
uint8_t buf[VW_MAX_MESSAGE_LEN]; // Буфер для сообщения
uint8_t buflen = VW_MAX_MESSAGE_LEN; // Длина буфера
// Если принято сообщение
if (vw_get_message(buf, &buflen)) {
// Если сообщение адресовано не нам, выходим
if (buf[0] != '$') {
return "";
}
int i = 1;
String result = "";
while (buf[i] != '$') {
char ch = buf[i];
result += ch;
i++;
}
return result;
}
return "";
}
| true |
17715c5b2d7be93115a15e4d90b3784681636909 | C++ | deniskoronchik/sc-machine | /tools/builder/src/main.cpp | UTF-8 | 2,326 | 2.53125 | 3 | [
"MIT"
] | permissive | /*
* This source file is part of an OSTIS project. For the latest info, see http://ostis.net
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "builder.h"
#include <iostream>
#include <boost/program_options.hpp>
int main(int argc, char *argv[])
{
boost::program_options::options_description options_description("Builder usage");
options_description.add_options()
("help", "Display this message")
("version", "Displays version number")
("input-path,i", boost::program_options::value<std::string>(), "Path to directory with sources")
("output-path,o", boost::program_options::value<std::string>(), "Path to output directory (repository)")
("extension-path,e", boost::program_options::value<std::string>(), "Path to extensions directory")
("clear-output,c", "Clear output directory (repository) before build")
("settings,s", boost::program_options::value<std::string>(), "Path to configuration file for sc-memory")
("auto-formats,f", "Enable automatic formats info generation")
("show-filenames,v", "Enable processing filnames printing");
boost::program_options::variables_map vm;
boost::program_options::store(boost::program_options::command_line_parser(argc, argv).options(options_description).run(), vm);
boost::program_options::notify(vm);
if (vm.count("help") || !vm.count("input-path") || !vm.count("output-path"))
{
std::cout << options_description;
return 0;
}
BuilderParams params;
params.clearOutput = false;
params.autoFormatInfo = false;
if (vm.count("input-path"))
params.inputPath = vm["input-path"].as<std::string>();
if (vm.count("output-path"))
params.outputPath = vm["output-path"].as<std::string>();
if (vm.count("extension-path"))
params.extensionsPath = vm["extension-path"].as<std::string>();
if (vm.count("clear-output"))
params.clearOutput = true;
if (vm.count("auto-formats"))
params.autoFormatInfo = true;
if (vm.count("settings"))
params.configFile = vm["settings"].as<std::string>();
if (vm.count("show-filenames"))
params.showFileNames = true;
Builder builder;
builder.initialize();
builder.run(params);
return builder.hasErrors() ? EXIT_SUCCESS : EXIT_FAILURE;
}
| true |
401bea3bf380aae7fc3c85ed99dca13e4614d3c7 | C++ | FMock/College_Work | /CS144/Assignment_02/main_employee_database.cpp | UTF-8 | 7,699 | 3.75 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <cctype>
using namespace std;
#include "employee.h"
/*
CS144 Assignment #2
Frank Mock
This program uses a text file called "data.txt" This file is included
with the source code. Some names in data.txt are Frank Mock, Debbie Mock,
Fred Flintstone, Fred Rogers, Debbie Hunter and more (10 total employees).
This program also uses the employee class from
the textbook. Program 9.6 was used as a starting point for this
assignment.
First the program asks the user for the employee data file.
Next, the program asks the user for a first and last name of an employee
to search for. If found the program will ask if you wish to search again.
If the user does not want to search again, a menu of options is displayed
to the user as per the assignment instructions.
When option 2 is chosen and you are viewing the last employee in the file,
the last employee will be re-displayed to the user.
*/
const int NEWLINE_LENGTH = 2;
//name field is 30 characters
const int NAME_SIZE = 30;
//salary field is 10
const int SALARY_SIZE = 10;
//total length of a single employee record
const int RECORD_SIZE = NAME_SIZE + SALARY_SIZE + NEWLINE_LENGTH;
//Number of records in file
int num_records = 0;
/**
Converts a string number into a double value
@param s is the string to be converted
@return the double representation of the string number
*/
double string_to_double(string s)
{
istringstream instr(s);
double x;
instr >> x;
return x;
}
/*
Raises an employee salary
@param e reference to employee variable
@param percent the percentage to raise employee salary
*/
void raise_salary(Employee& e, double percent)
{
double new_salary = e.get_salary() * (1 + percent / 100);
e.set_salary(new_salary);
}
/*
Reads an employee record from a file at the current
position of the get pointer.
@param e Employee ready to be instantiated
@param in the stream to be read from
*/
void read_employee(Employee& e, istream& in)
{
string line;
getline(in, line);
if(in.fail())
return;
string name = line.substr(0,NAME_SIZE);
double salary = string_to_double(line.substr(NAME_SIZE, SALARY_SIZE));
e = Employee(name, salary);
}
/*
Writes an Employee record to a stream
@param e the employee record to write
@param out the stream to write to
*/
void write_employee(Employee& e, ostream& os)
{
os << e.get_name()
<< setw(SALARY_SIZE + (NAME_SIZE - e.get_name().length()))
<< fixed << setprecision(2)
<< e.get_salary();
}
/*
Performs a case insensitive comparison of two C strings
@param *s1 C string on the left
@param *s2 C string on the right
@return -1 if left is greater and 1 other wise. 0 if equal
*/
int strcmp_ignore_case(const char *s1, const char *s2)
{
while(*s1 && *s2)
{
if(tolower(*s1) != tolower(*s2))
break;
++s1;
++s2;
}
return tolower(*s1) - tolower(*s2);
}
/*
Searches a file for a record that matches the first and last name
@param fs a reference to a fstream object
@param first employee first name to be searched for
@param last employee last name to be searched for
@return record number that matches employee or -1 if not found
*/
int get_record_num(fstream& fs, string first, string last)
{
char input[RECORD_SIZE]; //to hold the input from the file
int counter = 0;
fs.seekg(0 * RECORD_SIZE, ios::beg);
while(!fs.eof())
{
string f_name, l_name;
fs.getline(input, RECORD_SIZE);
string fullname(input,0, NAME_SIZE);
int k = fullname.find(",");
int r = fullname.find(" ",k + 2);
int l = fullname.length();
if(l > 0)
{
l_name = fullname.substr(0,k);
f_name = fullname.substr(k+2, r - (k+2));
if(strcmp_ignore_case(first.c_str(), f_name.c_str()) == 0
&& strcmp_ignore_case(last.c_str(), l_name.c_str()) == 0)
return counter;
}
counter++;
}
fs.clear(); //clear EOF flag
return -1; //not found
}
int main()
{
Employee e; //to hold an employee object
const double SALARY_CHANGE = 5.0;//percent to change salary
int num_records;//number of employee records
int position;//current position on file position pointer
bool tryAgain = true;//for loop control top
bool more = true;//for loop control bottom
fstream fs;//input and output
string dataFile;
string first, last, again;
do{
cout << "Please enter the data file name: ";
cin >> dataFile;
//try to open the file
fs.open(dataFile.c_str());
if(fs.fail())
{
string again;
cout << "Problem opening data file or it does not exist. Try Again? (y/n)";
cin >> again;
if(again != "y")
tryAgain = false;
}
else
{
cout << "Data file opened successfully." << endl;
tryAgain = false;
}
}while(tryAgain);
top://return here from lower menu case: 3
//determine the number of records in the data file
fs.seekg(0, ios::end);
num_records = static_cast<int>(fs.tellg()) / RECORD_SIZE;
//position get pointer at the begining of the file
fs.seekg(0, ios::beg);
bool query = true; //used forthe following do-while loop
do{
//Ask the user for an employee to display
cout << "Enter employee First name: ";
cin >> first;
cout << "Enter employee Last name: ";
cin >> last;
//search for employee record number
position = get_record_num(fs, first, last);
if(position < 0)
{
cout << first << " " << last << " was not found." << endl;
query = true;
}
else
{
fs.clear();
//position the get pointer at the begining of the employee record
fs.seekg(position * RECORD_SIZE, ios::beg);
//reads employee record and instantiates Employee object using this record
read_employee(e, fs);
cout << endl;
cout << "Record #" << position << " " << e.get_name() << " " << e.get_salary() << endl;
cout << endl;
}
//clear the cin buffer
string remainder;
getline(cin, remainder);
cout << "Search Again? (y/n)";
cin >> again;
if(again != "y")
query = false;
}while(query);
/*
At this point an employee record the user wants to work with has been found.
Now show menu with further options. Each option is a different case.
*/
query = true; // for do-while loop control
do
{
int choice;
cout << "Please choose [1 -4]" << endl;
cout << "[1] Change salary of this record" << endl;
cout << "[2] View next record" << endl;
cout << "[3] Find another employee" << endl;
cout << "[4] Quit" << endl;
cin >> choice;
switch(choice)
{
case 1: fs.clear();
//position the get pointer at the employee record
fs.seekg(position * RECORD_SIZE, ios::beg);
//reads employee record and instantiates Employee object using this record
read_employee(e, fs);
//raise the salary of the employee by a certain percent
raise_salary(e, SALARY_CHANGE);
//update the employee data file
fs.seekp(position * RECORD_SIZE, ios::beg);
write_employee(e, fs);
//display the new salary of the employee
cout << endl;
cout << "The new salary is: " << e.get_salary() << endl;
cout << endl;
query = true;
break;
case 2: fs.clear();
if(position != num_records)//check to ensure we don't go past EOF
position = position + 1;
//position the get pointer at the begining of the employee record
fs.seekg(position * RECORD_SIZE, ios::beg);
//reads employee record and instantiates Employee object using this record
read_employee(e, fs);
cout << endl;
cout << "Record #" << position << " " << e.get_name() << " " << e.get_salary() << endl;
cout << endl;
query = true;
break;
case 3: goto top;
case 4: query = false;
break;
}
string remainder;
getline(cin, remainder);
}while(query);
//Close the data file
fs.close();
return 0;
} | true |
ceea480763c5520f15a09c10b8968ba232f2a57c | C++ | WhiZTiM/coliru | /Archive2/88/dd8ae5b1885521/main.cpp | UTF-8 | 1,645 | 3.015625 | 3 | [] | no_license | #include <sstream>
#include <iostream>
#include <typeindex>
#include <wiertlo/enum_enable.hpp>
struct Base { virtual void print() const { std::cout << "Base\n"; } };
struct A : Base { virtual void print() const { std::cout << "A\n"; } };
struct B : Base { virtual void print() const { std::cout << "B\n"; } };
struct C : Base { virtual void print() const { std::cout << "C\n"; } };
struct D : Base { virtual void print() const { std::cout << "D\n"; } };
struct E : Base { virtual void print() const { std::cout << "E\n"; } };
struct F : Base { virtual void print() const { std::cout << "F\n"; } };
struct G : Base { virtual void print() const { std::cout << "G\n"; } };
struct H : Base { virtual void print() const { std::cout << "H\n"; } };
struct I : Base { virtual void print() const { std::cout << "I\n"; } };
bool operator<(const Base& lhs, const Base& rhs)
{
return std::type_index(typeid(lhs)) < std::type_index(typeid(rhs));
}
#define WIERTLO_ENUM_TYPE Base
#define WIERTLO_ENUM_NAME stuff
#define WIERTLO_ENUM_LIST \
WIERTLO_ENUM_VALUE(a, A()) \
WIERTLO_ENUM_VALUE(b, B()) \
WIERTLO_ENUM_VALUE(c, C()) \
WIERTLO_ENUM_VALUE(d, D()) \
WIERTLO_ENUM_VALUE(e, E()) \
WIERTLO_ENUM_VALUE(f, F()) \
WIERTLO_ENUM_VALUE(g, G()) \
WIERTLO_ENUM_VALUE(h, H()) \
WIERTLO_ENUM_VALUE(i, I())
#include <wiertlo/enum.hpp>
int main()
{
std::cout << "This is the output, but I don't know how to put multiple headers on coliru\n";
std::stringstream ss("ababacgihf");
char z;
while(ss.get(z))
{
std::string str(1, z);
const Base& asdf = stuff::from_string(str);
asdf.print();
}
}
| true |
84d66e3a7dec17068771615483fa9fe53a19fadd | C++ | zerocity/Neurocid | /src/placer.hpp | UTF-8 | 10,086 | 2.75 | 3 | [] | no_license | /*
* placer.hpp
*
* Created on: Mar 7, 2014
* Author: elchaschab
*/
#ifndef PLACER_HPP_
#define PLACER_HPP_
#include <vector>
#include "util.hpp"
#include "2d.hpp"
#include "population.hpp"
#include "ship.hpp"
#include <functional>
#include <iostream>
namespace neurocid {
using std::vector;
using std::function;
class RandomRot {
public:
Coord operator()(size_t tick) {
return fRand(M_PI, -M_PI);
}
};
class IterRot {
Coord startInRad_;
Coord iterateByInRad_;
public:
IterRot(Coord startInRad, Coord iterateByInRad) :
startInRad_(startInRad),
iterateByInRad_(iterateByInRad){
};
Coord operator()(size_t tick) {
return normRotation(startInRad_ + (iterateByInRad_ * ((tick % ((size_t)(round(M_PI/iterateByInRad_) + 1))))));
}
};
class RandomFacer {
public:
Coord operator()(size_t tick, size_t side, Coord rotation) {
return fRand(-M_PI, M_PI);
}
};
class OppositeFacer {
Coord relativeRotation_;
public:
OppositeFacer(Coord relativeRotation) : relativeRotation_(relativeRotation) {
}
Coord operator()(size_t tick, size_t side, Coord rotation) {
assert(side < 2);
return normRotation(radFromDir(dirFromRad(rotation) * (side == 0 ? 1 : -1)) + (relativeRotation_));
}
};
struct SpacerLayout {
Vector2D center_;
Coord distance_;
Coord spacing_;
};
class Spacer {
SpacerLayout layout_;
public:
Spacer(const SpacerLayout& layout) :
layout_(layout){
}
SpacerLayout operator()(size_t tick, size_t side) {
return {layout_.center_, layout_.distance_, layout_.spacing_};
}
};
class Placer {
size_t tick_ = 0;
public:
virtual ~Placer() {
}
size_t tick() {
return tick_;
}
virtual void place(vector<Population>& teams) {
tick_++;
}
};
template <typename Trotator, typename Tfacer, typename Tspacer> class OppositePlacer : public Placer {
Trotator rotator_;
Tfacer facer_;
Tspacer spacer_;
public:
OppositePlacer(Trotator rotator, Tfacer facer, Tspacer layouter) :
rotator_(rotator),
facer_(facer),
spacer_(layouter) {
}
virtual void place(vector<Population>& teams) {
assert(teams.size() == 2);
Coord rotation = rotator_(tick());
SpacerLayout gl = spacer_(tick(), 0);
Vector2D axisDir = dirFromRad(rotation);
Vector2D sideDirA = axisDir;
Vector2D sideDirB = axisDir;
sideDirA.rotate(90);
sideDirB = sideDirA * -1;
Vector2D centerA = gl.center_;
Vector2D centerB = gl.center_;
centerA += (axisDir * (gl.distance_/2));
centerB -= (axisDir * (gl.distance_/2));
Coord lengthA = (((teams[0][0].range_ + gl.spacing_) * (teams[0].size() - 1)) / 2);
Coord lengthB = (((teams[1][0].range_ + gl.spacing_) * (teams[1].size() - 1)) / 2);
Vector2D startA = centerA;
startA += (sideDirA * lengthA);
Vector2D startB = centerB;
startB += (sideDirB * lengthB);
for(size_t i = 0; i < teams[0].size(); i++) {
teams[0][i].loc_ = startA;
teams[0][i].loc_ -= (sideDirA * ((teams[0][i].range_ + gl.spacing_) * i));
teams[0][i].rotation_ = facer_(tick(), 0, rotation);
}
for(size_t i = 0; i < teams[1].size(); i++) {
teams[1][i].loc_ = startB;
teams[1][i].loc_ -= (sideDirB * ((teams[1][i].range_ + gl.spacing_) * i));
teams[1][i].rotation_ = facer_(tick(), 1, rotation);
}
Placer::place(teams);
}
};
template <typename Trotator, typename Tfacer, typename Tspacer> class OppositePlacerTwoRows : public Placer {
Trotator rotator_;
Tfacer facer_;
Tspacer spacer_;
public:
OppositePlacerTwoRows(Trotator rotator, Tfacer facer, Tspacer layouter) :
rotator_(rotator),
facer_(facer),
spacer_(layouter) {
}
virtual void place(vector<Population>& teams) {
assert(teams.size() == 2);
Coord rotation = rotator_(tick());
SpacerLayout gl = spacer_(tick(), 0);
Vector2D axisDir = dirFromRad(rotation);
Vector2D sideDirA = axisDir;
Vector2D sideDirB = axisDir;
sideDirA.rotate(90);
sideDirB = sideDirA * -1;
Vector2D centerA = gl.center_;
Vector2D centerB = gl.center_;
centerA += (axisDir * (gl.distance_/2));
centerB -= (axisDir * (gl.distance_/2));
Coord lengthA = (((teams[0][0].range_ + gl.spacing_) * (teams[0].size() - 1)) / 2);
Coord lengthB = (((teams[1][0].range_ + gl.spacing_) * (teams[1].size() - 1)) / 2);
Vector2D startA = centerA;
startA += (sideDirA * lengthA);
Vector2D startB = centerB;
startB += (sideDirB * lengthB);
size_t s = teams[0].size();
size_t firstRow = s/2;
size_t secondRow = firstRow + s%2;
assert(s == (firstRow + secondRow));
for(size_t i = 0; i < firstRow; i++) {
teams[0][i].loc_ = startA;
teams[0][i].loc_ -= (sideDirA * ((teams[0][i].range_ + gl.spacing_) * i));
teams[0][i].rotation_ = facer_(tick(), 0, rotation);
}
for(size_t i = 0; i < secondRow; i++) {
teams[0][firstRow + i].loc_ = startA;
teams[0][firstRow + i].loc_ += (axisDir * ((gl.spacing_ + teams[0][firstRow + i].range_) * 3));
teams[0][firstRow + i].loc_ -= (sideDirA * ((teams[0][firstRow + i].range_ + gl.spacing_) * i));
teams[0][firstRow + i].rotation_ = facer_(tick(), 0, rotation);
}
s = teams[1].size();
firstRow = s/2;
secondRow = firstRow + s%2;
assert(s == (firstRow + secondRow));
for(size_t i = 0; i < firstRow; i++) {
teams[1][i].loc_ = startB;
teams[1][i].loc_ -= (sideDirB * ((teams[1][i].range_ + gl.spacing_) * i));
teams[1][i].rotation_ = facer_(tick(), 1, rotation);
}
for(size_t i = 0; i < secondRow; i++) {
teams[1][firstRow + i].loc_ = startB;
teams[1][firstRow + i].loc_ -= (axisDir * ((gl.spacing_ + teams[1][firstRow + i].range_) * 3));
teams[1][firstRow + i].loc_ -= (sideDirB * ((teams[1][firstRow + i].range_ + gl.spacing_) * i));
teams[1][firstRow + i].rotation_ = facer_(tick(), 1, rotation);
}
Placer::place(teams);
}
};
template <typename Trotator, typename Tfacer, typename Tspacer> class CrossPlacerTwoRows : public Placer {
Trotator rotator_;
Tfacer facer_;
Tspacer spacer_;
public:
CrossPlacerTwoRows(Trotator rotator, Tfacer facer, Tspacer layouter) :
rotator_(rotator),
facer_(facer),
spacer_(layouter) {
}
virtual void place(vector<Population>& teams) {
assert(teams.size() == 2);
assert(teams[0].size() == teams[1].size());
Coord rotation = rotator_(tick());
SpacerLayout gl = spacer_(tick(), 0);
Vector2D axisDir = dirFromRad(rotation);
Vector2D sideDirA = axisDir;
Vector2D sideDirB = axisDir;
sideDirA.rotate(90);
sideDirB = sideDirA * -1;
Vector2D centerA = gl.center_;
Vector2D centerB = gl.center_;
centerA += (axisDir * (gl.distance_/2));
centerB -= (axisDir * (gl.distance_/2));
Coord lengthA = gl.distance_ / 2;
Coord lengthB = gl.distance_ / 2;
Vector2D startA = centerA;
Vector2D startA2 = centerA;
startA += (sideDirA * lengthA);
startA2 += (sideDirA * -lengthA);
Vector2D startB = centerB;
Vector2D startB2 = centerB;
startB += (sideDirB * lengthB);
startB2 += (sideDirB * -lengthB);
size_t s = teams[0].size();
size_t firstHalf = s/2;
size_t secondHalf = firstHalf + s%2;
assert(s == (firstHalf + secondHalf));
Vector2D halfDirA = sideDirA;
Vector2D halfDirA2 = sideDirA;
Vector2D halfDirB = sideDirB;
Vector2D halfDirB2 = sideDirB;
halfDirA = dirFromRad(fRand(0, M_PI));
halfDirA2 = dirFromRad(fRand(0, M_PI));
halfDirB = dirFromRad(fRand(0, M_PI));
halfDirB2 = dirFromRad(fRand(0, M_PI));
size_t tA = iRand(0,1);
size_t tB = tA == 0 ? 1 : 0;
for(size_t i = 0; i < firstHalf; i++) {
teams[tA][i].loc_ = startA;
Vector2D shift = (halfDirA * ((teams[0][i].range_ + gl.spacing_) * (i)));
teams[tA][i].loc_ += shift;
teams[tA][i].rotation_ = facer_(tick(), 0, rotation);
teams[tB][i].loc_ = startA2;
shift = (halfDirA2 * ((teams[1][i].range_ + gl.spacing_) * (i)));
teams[tB][i].loc_ -= shift;
teams[tB][i].rotation_ = facer_(tick(), 1, rotation);
}
tA = iRand(0,1);
tB = tA == 0 ? 1 : 0;
for(size_t i = 0; i < secondHalf; i++) {
teams[tA][firstHalf + i].loc_ = startB;
Vector2D shift = (halfDirB * ((teams[0][firstHalf + i].range_ + gl.spacing_) * (i)));
teams[tA][firstHalf + i].loc_ += shift;
teams[tA][firstHalf + i].rotation_ = facer_(tick(), 0, rotation);
teams[tB][firstHalf + i].loc_ = startB2;
shift = (halfDirB2 * ((teams[1][firstHalf + i].range_ + gl.spacing_) * (i)));
teams[tB][firstHalf + i].loc_ -= shift;
teams[tB][firstHalf + i].rotation_ = facer_(tick(), 1, rotation);
}
Placer::place(teams);
}
};
template <typename Trotator, typename Tfacer, typename Tspacer> class FuzzyOppositePlacer : public Placer {
Trotator rotator_;
Tfacer facer_;
Tspacer spacer_;
public:
FuzzyOppositePlacer(Trotator rotator, Tfacer facer, Tspacer layouter) :
rotator_(rotator),
facer_(facer),
spacer_(layouter) {
}
virtual void place(vector<Population>& teams) {
assert(teams.size() == 2);
Coord rotation = rotator_(tick());
SpacerLayout gl = spacer_(tick(), 0);
Vector2D axisDir = dirFromRad(rotation);
Vector2D sideDirA = axisDir;
Vector2D sideDirB = axisDir;
sideDirA.rotate(90);
sideDirB = sideDirA * -1;
Vector2D centerA = gl.center_;
Vector2D centerB = gl.center_;
centerA += (axisDir * (gl.distance_/2));
centerB -= (axisDir * (gl.distance_/2));
Coord lengthA = (((teams[0][0].range_ + gl.spacing_) * (teams[0].size() - 1)) / 2);
Coord lengthB = (((teams[1][0].range_ + gl.spacing_) * (teams[1].size() - 1)) / 2);
Vector2D startA = centerA;
startA += (sideDirA * lengthA);
Vector2D startB = centerB;
startB += (sideDirB * lengthB);
for(size_t i = 0; i < teams[0].size(); i++) {
teams[0][i].loc_ = startA;
teams[0][i].loc_ -= (sideDirA * ((teams[0][i].range_ + gl.spacing_) * i));
teams[0][i].loc_ += (axisDir * fRand(-50, 50));
teams[0][i].rotation_ = facer_(tick(), 0, rotation);
}
for(size_t i = 0; i < teams[1].size(); i++) {
teams[1][i].loc_ = startB;
teams[1][i].loc_ -= (sideDirB * ((teams[1][i].range_ + gl.spacing_) * i));
teams[1][i].loc_ += (axisDir * fRand(-50, 50));
teams[1][i].rotation_ = facer_(tick(), 1, rotation);
}
Placer::place(teams);
}
};
} /* namespace neurocid */
#endif /* PLACER_HPP_ */
| true |
20cde6476d2928f716efd08ad6b8e84bd3fdb6f0 | C++ | Rurril/IT-DA-3rd | /study/Ace/Week1/BOJ_1405_이정혁.cpp | UHC | 1,654 | 3.3125 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int movement[4][2] = { {1,0},{-1,0} ,{0,1},{0,-1} };
int n, L, R, U, D;
bool visit[33][33]; //˳ 33
double result;
vector<double> v;
/*
bfs Ϸٰ dfs ȯ , Žؼ ö° .
湮ó,,, ȹԵ,,, n Ȯ ؼ ָ
,,, length n϶ return ϸ ȵǷ... ->̰ ƴϰ Ҽ ...
*/
void dfs(int x, int y,int length, double value) {
if (length == 0) { // length ̸ return
result += value;
return;
}
visit[x][y] = true;
for (int i = 0; i < 4; i++) {
int nx = x + movement[i][0];
int ny = y + movement[i][1];
if (visit[nx][ny] == false) { // ʾ
dfs(nx, ny, --length, value * v[i]); //1 ̴ ̴ --length , value ٰ Ȯ v[i] ϱ , ũ ̵ Ȯ ˾Ƽ ɰ.
length++; // dfs °Ŵ ٽ ++
visit[nx][ny] = false; // ̾ϴ falseó
}
}
}
int main(void) {
cin >> n >> L >> R >> D >> U;
v.emplace_back(L * 0.01);
v.emplace_back(R * 0.01);
v.emplace_back(D * 0.01);
v.emplace_back(U * 0.01);
dfs(15, 15, n, 1.0); //߰ 15 (15,15)
cout<<fixed; // ƿ ̰ Ҽ
cout.precision(10); //10 9ڸ ´ٰ .
cout << result;
return 0;
} | true |
c39f46a5a007ad95345b887c00e87e90c9ac7e80 | C++ | brookswithrow/RPG | /RPG/BattleMenu.cpp | UTF-8 | 1,768 | 2.90625 | 3 | [] | no_license | //
// BattleMenu.cpp
// RPG
//
// Created by Brooks Withrow on 7/7/16.
// Copyright © 2016 Brooks Withrow. All rights reserved.
//
#include "BattleMenu.h"
BattleMenu::BattleMenu() {
}
BattleMenu::BattleMenu(BattleInfo* aInfo, SDL_Renderer* aRenderer) {
init(aInfo, aRenderer);
}
void BattleMenu::init(BattleInfo* aInfo, SDL_Renderer* aRenderer) {
info = aInfo;
renderer = aRenderer;
init();
}
void BattleMenu::init() {
int (*func)(BattleInfo *, int);
func = &BattleMenu::returnPos;
MenuOption attack = MenuOption("Attack", 0, func, renderer);
MenuOption doNothing = MenuOption("Do Nothing", 1, func, renderer);
options.push_back(attack);
options.push_back(doNothing);
current = 0;
SDL_Color black = {0, 0, 0};
SDL_Color red = {255, 0, 0};
for (int i = 0; i < numOptions; i++) {
SDL_Color color = i == current ? red : black;
options[i].changeColor(color);
options[i].renderText();
}
}
void BattleMenu::moveCursor(int direction) {
SDL_Color black = {0, 0, 0};
SDL_Color red = {255, 0, 0};
options[current].changeColor(black);
options[current].renderText();
if (direction == -1) {
current--;
if (current == -1) {
current = numOptions - 1;
}
} else {
current++;
if (current == numOptions) {
current = 0;
}
}
options[current].changeColor(red);
options[current].renderText();
}
int BattleMenu::select(BattleInfo* info) {
if (current == 0) {
return true;
}
return false;
}
int BattleMenu::returnPos(BattleInfo* info, int pos) {
return 0;
}
void BattleMenu::updateText() {
for (int i = 0; i < numOptions; i++) {
options[i].renderText();
}
}
| true |
9c58f610bc9f82091c77bd16afe22cd83474651d | C++ | compilepeace/DS_AND_ALGORITHMS | /DS_with_C++/recursion_challenges/practice/replace_pi.cpp | UTF-8 | 829 | 3.421875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <cstdlib>
using namespace std;
#define MY_STRING "apibpicpidddddpie"
void shift2places(char *s, int n)
{
for (int i = n - 1; i >= 0; --i)
s[i + 2] = s[i];
}
// Replace "apibcpiee" --> "a3.14bc3.14ee"
void replacePi(char *s, int n)
{
// base case: if length of string is 0;
if (n == 0)
return;
// If we encounter consecutive 'p' and 'i'
if (s[0] == 'p' and s[1] == 'i'){
shift2places(s, n);
s[0] = '3';
s[1] = '.';
s[2] = '1';
s[3] = '4';
replacePi(s + 4, n - 2);
}
else{
replacePi(s + 1, n - 1);
}
}
int main()
{
char *s = (char *)malloc(10000);
strncpy(s, MY_STRING, strlen(MY_STRING));
replacePi(s, strlen(s));
cout << s << endl;
}
| true |
dc3e5cf120e30c528b3c39aebb8d752482a09c33 | C++ | mikislidstrom/Mikis | /C++ stuff/ShapesLibrary/ShapesLibrary/Cone.h | UTF-8 | 403 | 3 | 3 | [] | no_license | #pragma once
#include "Shape.h"
class Cone : public Shape
{
public:
Cone(double height, double radius);
double getVolume() const override;
double getSurface() const override;
const std::string& getTypeName() const override;
void setDimensions(double height, double radius);
const Dimensions& getDimensions() const override;
~Cone();
private:
Dimensions m_dimensions;
std::string m_type;
}; | true |
30c214d4a060c03ecee41406e7abfe166f7ecf6c | C++ | jackytck/topcoder | /DocumentSearch.cxx | UTF-8 | 3,143 | 3.359375 | 3 | [
"MIT"
] | permissive | // BEGIN CUT HERE
// PROBLEM STATEMENT
// You have been tasked with writing a function that will scan through a given document, and determine how many times a given word or phrase appears in that document. However, it is important that your function does not count overlapping occurrences. For instance, if the document were "abababa", and the search keyword was "ababa", you could find the keyword starting at index 0, or at index 2, but not both, since they would overlap.
You must concatenate the elements of the given vector <string> doc into a single string. Then, return the maximum number of non-overlapping occurrences of the string search.
To find a maximal set of non-overlapping occurrences, perform the following procedure. Starting from the left, find the first occurrence of the search string. Then, continuing with the character immediately following the search string, continue looking for the next occurrence. Repeat until no new occurrences can be found. By continuing immediately following each found occurrence, we guarantee that we will not count overlaps.
DEFINITION
Class:DocumentSearch
Method:nonIntersecting
Parameters:vector <string>, string
Returns:int
Method signature:int nonIntersecting(vector <string> doc, string search)
CONSTRAINTS
-doc will contain between 1 and 50 elements, inclusive.
-Each element of doc will contain between 1 and 50 characters, inclusive.
-Each character of each element of doc will be a lowercase letter ('a'-'z') or a space (' ').
-search will contain between 1 and 50 characters, inclusive.
-Each character of search will be a lowercase letter ('a'-'z') or a space (' ').
EXAMPLES
0)
{"ababababa"}
"ababa"
Returns: 1
The example from the problem statement.
1)
{"ababababa"}
"aba"
Returns: 2
There are multiple ways to find the string twice, but it doesn't matter how we do it.
2)
{"abcdefghijklmnop",
"qrstuvwxyz"}
"pqrs"
Returns: 1
Be sure to concatenate the document first.
3)
{"aaa", "aa", "a", "a"}
"aa"
Returns: 3
// END CUT HERE
#line 64 "DocumentSearch.cxx"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#define sz size()
#define PB push_back
#define clr(x) memset(x, 0, sizeof(x))
#define forn(i,n) for(__typeof(n) i = 0; i < (n); i++)
#define ford(i,n) for(int i = (n) - 1; i >= 0; i--)
#define forv(i,v) forn(i, v.sz)
#define For(i, st, en) for(__typeof(en) i = (st); i < (en); i++)
using namespace std;
class DocumentSearch {
public:
int nonIntersecting(vector <string> doc, string search)
{
int cnt = 0;
string docs;
forv(i, doc)
docs += doc[i];
while(docs.find(search) != string::npos)
{
int i = docs.find(search);
docs = docs.substr(i + search.sz, docs.sz - i - search.sz);
cnt++;
}
return cnt;
}
};
| true |
71d8399143524e30fd76a9f67cddbeb5ff9c9c61 | C++ | stetre/moonfonts | /src/fonts/stb_font_consolas_26_latin_ext.inl | UTF-8 | 98,365 | 2.828125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // Font generated by stb_font_inl_generator.c (4/1 bpp)
//
// Following instructions show how to use the only included font, whatever it is, in
// a generic way so you can replace it with any other font by changing the include.
// To use multiple fonts, replace STB_SOMEFONT_* below with STB_FONT_consolas_26_latin_ext_*,
// and separately install each font. Note that the CREATE function call has a
// totally different name; it's just 'stb_font_consolas_26_latin_ext'.
//
/* // Example usage:
static stb_fontchar fontdata[STB_SOMEFONT_NUM_CHARS];
static void init(void)
{
// optionally replace both STB_SOMEFONT_BITMAP_HEIGHT with STB_SOMEFONT_BITMAP_HEIGHT_POW2
static unsigned char fontpixels[STB_SOMEFONT_BITMAP_HEIGHT][STB_SOMEFONT_BITMAP_WIDTH];
STB_SOMEFONT_CREATE(fontdata, fontpixels, STB_SOMEFONT_BITMAP_HEIGHT);
... create texture ...
// for best results rendering 1:1 pixels texels, use nearest-neighbor sampling
// if allowed to scale up, use bilerp
}
// This function positions characters on integer coordinates, and assumes 1:1 texels to pixels
// Appropriate if nearest-neighbor sampling is used
static void draw_string_integer(int x, int y, char *str) // draw with top-left point x,y
{
... use texture ...
... turn on alpha blending and gamma-correct alpha blending ...
glBegin(GL_QUADS);
while (*str) {
int char_codepoint = *str++;
stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR];
glTexCoord2f(cd->s0, cd->t0); glVertex2i(x + cd->x0, y + cd->y0);
glTexCoord2f(cd->s1, cd->t0); glVertex2i(x + cd->x1, y + cd->y0);
glTexCoord2f(cd->s1, cd->t1); glVertex2i(x + cd->x1, y + cd->y1);
glTexCoord2f(cd->s0, cd->t1); glVertex2i(x + cd->x0, y + cd->y1);
// if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct
x += cd->advance_int;
}
glEnd();
}
// This function positions characters on float coordinates, and doesn't require 1:1 texels to pixels
// Appropriate if bilinear filtering is used
static void draw_string_float(float x, float y, char *str) // draw with top-left point x,y
{
... use texture ...
... turn on alpha blending and gamma-correct alpha blending ...
glBegin(GL_QUADS);
while (*str) {
int char_codepoint = *str++;
stb_fontchar *cd = &fontdata[char_codepoint - STB_SOMEFONT_FIRST_CHAR];
glTexCoord2f(cd->s0f, cd->t0f); glVertex2f(x + cd->x0f, y + cd->y0f);
glTexCoord2f(cd->s1f, cd->t0f); glVertex2f(x + cd->x1f, y + cd->y0f);
glTexCoord2f(cd->s1f, cd->t1f); glVertex2f(x + cd->x1f, y + cd->y1f);
glTexCoord2f(cd->s0f, cd->t1f); glVertex2f(x + cd->x0f, y + cd->y1f);
// if bilerping, in D3D9 you'll need a half-pixel offset here for 1:1 to behave correct
x += cd->advance;
}
glEnd();
}
*/
#ifndef STB_FONTCHAR__TYPEDEF
#define STB_FONTCHAR__TYPEDEF
typedef struct
{
// coordinates if using integer positioning
float s0,t0,s1,t1;
signed short x0,y0,x1,y1;
int advance_int;
// coordinates if using floating positioning
float s0f,t0f,s1f,t1f;
float x0f,y0f,x1f,y1f;
float advance;
} stb_fontchar;
#endif
#define STB_FONT_consolas_26_latin_ext_BITMAP_WIDTH 512
#define STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT 192
#define STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT_POW2 256
#define STB_FONT_consolas_26_latin_ext_FIRST_CHAR 32
#define STB_FONT_consolas_26_latin_ext_NUM_CHARS 560
#define STB_FONT_consolas_26_latin_ext_LINE_SPACING 17
static unsigned int stb__consolas_26_latin_ext_pixels[]={
0x4c3b61db,0x001aaaaa,0x000c8000,0x30000000,0x4b8007db,0x00000640,
0x220066a0,0x402aaaaa,0xf0000a98,0x0000003f,0x04d887aa,0x0007ff30,
0x7fb0d54c,0xf9374000,0xfffff503,0x3fee0009,0x03ff9803,0x0007ff30,
0x88000000,0x01cdeecb,0x98013026,0x360004c0,0x0000c00f,0x00000000,
0x0054c000,0x99700ee6,0x99999999,0x74ffe619,0x3f21fd0f,0x5004ffff,
0x7e4009ff,0x80bfa205,0xfe882fe8,0x02ff9802,0xf7037c40,0x7ecc001d,
0xfff103df,0x7ffd403d,0xff9106ff,0x3fe8805f,0x220007fe,0xdff002fe,
0x2600ffdc,0x8003feff,0x1fec4ff9,0xf9bf9000,0x3fbbaa0d,0xffb8004f,
0xfeff9801,0x7f7fcc03,0x17fee003,0xf30efc80,0xffff909f,0x3e209fff,
0xf880bee5,0xf000bee5,0x1fffd40f,0x0bff203b,0x017fee00,0x0ef88bf2,
0x400fd800,0x7ff404fc,0xffffffff,0x3a5ff11f,0x3f21fd0f,0xa801aaad,
0x400a9aff,0x3ee01ffb,0x1bff205f,0x3201bff2,0x3fb8000c,0x4017fa20,
0xdfebcefc,0x06ffda80,0x1beeaaa2,0x005effe4,0x1ff9ffea,0x06ffb800,
0x37cc5f90,0x3623be60,0x3fe6003f,0x0003fd82,0x007bff62,0x2e0027e4,
0xef9800df,0xf303fd88,0x007fb11d,0x007f57f3,0x3fe61df7,0x9acffc82,
0x3f602b99,0x6c00efff,0x000effff,0xbdf9837c,0x201ffffe,0x32002ffa,
0x200efcdf,0x07fea4fe,0x3201be00,0x5555404f,0xaaaacffa,0x3fa5ff10,
0x0ff21fd0,0x36199100,0x0ffe600f,0x5407ff30,0x5ffa85ff,0x000b3260,
0x3e600ff4,0x42fe404f,0x3fe205fb,0x10df3002,0x7c4003ff,0x0007fe5f,
0x00013fea,0x33026200,0xd8055400,0x0100003f,0x4004fc80,0x02620019,
0x30262033,0x3a1f5003,0x70664404,0x07ff1039,0x05eedc00,0x00bddb80,
0x8502fc40,0xc8801cdb,0x23c9800c,0x032603ca,0xd9710077,0x9f9007fb,
0x403ff000,0x21fd2ff8,0x007f90fe,0xfe80df00,0x50031005,0xf3015405,
0x30007f9b,0x07fee003,0x1fb02fd4,0x98027ec0,0x007f986f,0x00ffc288,
0x00002980,0x2e000000,0x07fb04ff,0x32000000,0x0000004f,0x88000000,
0x0002fdef,0x000ffa80,0x00000000,0x02fbf6e6,0x00000000,0x54000000,
0x86ffffff,0xefffeee8,0x3e01eeee,0x4bfe201f,0x321fd0fe,0x65c4003f,
0x3ee03fde,0x0000000f,0x0bb3dc00,0xdfb00000,0xfa803fa0,0x4013ee03,
0x05fa86f9,0x2e3ff000,0x00002dfd,0x774405db,0xe880bb61,0xf59f301e,
0xb107fb09,0x7f6d409d,0x901eeeee,0x0176c09f,0xeec83dd1,0x203eeeee,
0xeeeefeda,0x0b72601e,0x32602ca8,0x0017fcc4,0x264c0595,0x02cdcb88,
0x7ffffec4,0x980b2a3f,0x980b2a4c,0x980b2a4c,0x9b97104c,0xacffb805,
0x7cc4fff9,0xffffffff,0x07fe01ff,0x1fd2ff88,0x01fe43fa,0xffffff50,
0x4017fc0d,0xeeeefeda,0x6c07b61e,0xf7bf301e,0x7f6d4007,0x881eeeee,
0x027d41ff,0x09f502fc,0x3ea1be60,0x3bbbb205,0x27fe3eee,0x23fffffe,
0x03eeeeea,0xdf7037e4,0x3ee06fc8,0x86c9ee06,0x77f443fd,0xfdbffb00,
0x3203ffff,0x81bf204f,0xfffe86fb,0xfb04ffff,0xfffffdbf,0x93016543,
0xf5027e49,0x005ffd0f,0x7fa813f2,0xffffffa8,0xbefe880e,0x3f22bbfd,
0xfc9fea04,0xfc9fea04,0x2a1fea04,0x0effffff,0x6fcc9ff0,0x6cccc3ff,
0x019999cf,0x3fe00ffc,0x43fa1fd1,0xff7003fc,0x09fff359,0xfd801ff3,
0xfffffedf,0x7fc07fe1,0x00f76a01,0xffedffd8,0x9fd01fff,0x336a0fd8,
0x7d40dd4b,0x50df3004,0x7fff40bf,0x3fe4ffff,0x1ff913ff,0x13ffffea,
0x3a03ff30,0x80ffcc3f,0x2fea03fe,0x23fd84e9,0xf700efe8,0x01ffc41d,
0xff9813f2,0x4007fd01,0x0efb84fc,0x3f20ffe2,0xfc9fea04,0x261fea04,
0x200befff,0x1fea04fc,0xf7359ff7,0x0efc81df,0x09f901fb,0x09f93fd4,
0x09f93fd4,0x3fee3fd4,0x0effb9ac,0x2bee37dc,0x13f206fc,0xf007fe00,
0x7f43fa3f,0x3e007f90,0x3ff7e64f,0x2e037e43,0x0ffe20ef,0x0ffc07fe,
0x20079930,0x3fe20efb,0x3e3fe403,0x57ffff65,0x017ea07d,0x27d437cc,
0xff27e400,0x207fd03f,0x4fe804fc,0xfe80ff98,0x400ff984,0xfd80dffc,
0x401dfd13,0x06fb82fe,0x3fa027e4,0x000ff984,0x0bfa13f2,0x13f21bee,
0x13f27fa8,0xf9107fa8,0xf9019fff,0x3e3fd409,0x43ff984f,0x641fa2ff,
0xc9fea04f,0xc9fea04f,0xf1fea04f,0x87ff309f,0xf8bec3fe,0x0013f207,
0x3ff007fe,0xc87f43fa,0x46fb803f,0x746fcafb,0x417f404f,0x01ff86fb,
0x7fec03ff,0x82fe800f,0x7fd406fb,0x57ea7f30,0x440fb4fb,0x0df3006f,
0xf90005f9,0xfb817fc9,0x7009f905,0x20bf70ff,0x05fb87fb,0x8bfd8020,
0x1ff805fe,0x7e406fa8,0x5c3fdc04,0x27e4005f,0x37d40ffc,0xff5027e4,
0xff5027e4,0xffffb880,0xf5027e41,0xf7037dcf,0x1be3fccd,0xff5027e4,
0xff5027e4,0xff5027e4,0xdf7037dc,0x97e21ff8,0x09f901ff,0xf803ff00,
0x3fa1971f,0xfd007f90,0x8ff17d87,0x0ffc03ff,0x0ffc37d4,0xff101ff8,
0x3ff005ff,0xf880df50,0x3f65f71f,0x03f65f91,0x201adfd8,0xdf7336f9,
0x49f90001,0x0df501ff,0x3e2013f2,0x8817f42f,0x017f42ff,0x19dffd95,
0x05fecfd8,0xbf707fd0,0x4404fc80,0x017f42ff,0x3fa13f20,0xfc85fb83,
0xfc9fea04,0x801fea04,0x3f20fffa,0xfe9fea04,0x547fe203,0x6417e27f,
0xc9fea04f,0xc9fea04f,0xe9fea04f,0x47fe203f,0x8fea0ff8,0x09f902fe,
0xf803ff00,0x321fd01f,0x21ff803f,0x447fe5f8,0x1ff401ff,0x0ffc2fdc,
0xbf501ff8,0x7fd00bf9,0xff00bf70,0x9be23f25,0x500fb1fd,0x3e603fff,
0x0007fff6,0x03ff27e4,0x27e41bea,0x3e65fd80,0xf32fec07,0x7fffcc0f,
0x3f61ffff,0xf7003ffd,0x017fd43f,0x3f6013f2,0x2001fe65,0x1ffb84fc,
0x3f20bfea,0xfc9fea04,0x001fea04,0x27e45ff1,0x0ffcff50,0x7fccbfe0,
0x3f209f30,0xfc9fea04,0xfc9fea04,0xff9fea04,0xf997fc01,0xfd83f60f,
0x0009f903,0x0ff803ff,0x0ff21fd0,0x7d41ff10,0x7fc4bfa3,0x50ffdc00,
0x03ff05ff,0x5fec07fe,0x7dc00ff9,0x00bfea1f,0x4c7ecffa,0x3ec3fa5f,
0x0337faa0,0xffdcb7cc,0x49f90004,0x0bf701ff,0x7cc013f2,0x9809f90f,
0x409f90ff,0xfd5109c9,0x7fd5fecd,0xffff9803,0xfc803fff,0x90ff9804,
0x9f90009f,0xffffff30,0x813f207f,0x813f27fa,0xfd8007fa,0xfa813f24,
0xe801ff17,0x2a5ff13f,0x409f903f,0x813f27fa,0x813f27fa,0x01ff17fa,
0x1ff13fe8,0x40ffa37c,0xff8004fc,0xe807f401,0x9807f90f,0xd83f60ff,
0x300bfe3f,0x7fffffff,0x7fc07fe0,0xff0ff881,0xffff9805,0xff003fff,
0xf27d5f65,0x3fe0374f,0x446f9800,0xfc8001fe,0x7e407fe4,0x4009f904,
0x003ff3fe,0x007fe7fd,0x7fb3fd40,0xfd00bfee,0x0039bd95,0x7f4013f2,
0x90003ff3,0xd95fd09f,0x27e4039b,0x27e4ff50,0xd000ff50,0x5027e45f,
0x003fe6ff,0x46ff47fb,0x09f902fb,0x09f93fd4,0x09f93fd4,0x0ff9bfd4,
0x3ff1fec0,0x05ff13e6,0x3e001bee,0xd00c401f,0x100ff21f,0x3a37c1ff,
0xd013fe3f,0x039bd95f,0x1ff80ffc,0x17f26fa8,0x9bd95fd0,0x47fe6003,
0x3e29f57e,0x7cc09f16,0x70df3005,0x9f90007f,0x7fc40ffc,0x4009f901,
0x006faefb,0x00df5df7,0x7fb1ff80,0xf880ffe4,0x27e40006,0x6faefb80,
0x889f9000,0x4fc8006f,0x4fc9fea0,0x0331fea0,0xfc83ff22,0x7cdfea04,
0x51ff400f,0x533fbdff,0xf5027e45,0xf5027e4f,0xf5027e4f,0xd003fe6f,
0xfc97f47f,0x5403fe21,0x7fc002ff,0xe8554001,0xf007f90f,0xff13e63f,
0xf102ff45,0x03ff000d,0x8ff607fe,0xdf100ffa,0x27fb8000,0x3f2bf37d,
0x7d403f76,0x50df3005,0x9f9000bf,0x3f620ffc,0x8013f205,0x003feff8,
0x007fdff1,0x3eaaaa62,0xfd87fb1f,0x9cff981f,0x3f200199,0xfdff1004,
0x13f20007,0x33339ff3,0x2a04fc80,0xa813f27f,0x777fe47f,0x642fffee,
0x45fea04f,0x17f401ff,0x3fffffea,0xa813f23f,0xa813f27f,0xa813f27f,
0x803ff17f,0x757f22fe,0x3a03fdc7,0x01fedfff,0xff8807fe,0x43fa1fd2,
0x2fe803fc,0x07fc43f9,0x7fcc0ff7,0x7c01999c,0x883ff01f,0x817fc1ff,
0x1999cff9,0xfd97f600,0x7fbf9ff0,0x04fa80df,0xbf50df30,0x7c9f9000,
0xeffdceff,0x0013f200,0x4001fffb,0xc800fffd,0xffffffff,0xffd07fb1,
0xfffffb01,0xeec87dff,0x2eeefffe,0x003fff60,0x7ec27e40,0x3effffff,
0x3ea04fc8,0xfa813f27,0x7ffff5c6,0x4fc81cff,0x2ff9bea0,0x2207fe20,
0x20acdffb,0x9bea04fc,0x9bea04fc,0x9bea04fc,0x3fe202ff,0x13ebfee1,
0xfc8807fd,0x3e01ffff,0x57fee01f,0x321fd0fe,0xd5fc803f,0x7c47fb8f,
0x3fff601f,0xf83effff,0xa83ff01f,0x205fd86f,0xfffffffd,0x917f403e,
0x26ffee1f,0x7d400eff,0x50df3004,0x9f9000bf,0x77fffffc,0xffeeec83,
0x5402eeef,0x7d4004ff,0xbffc804f,0xb1ff9999,0x1dfd107f,0xeedcefb8,
0x3ffa4fff,0x2fffffff,0x0013fea0,0xefb84fc8,0x4fffeedc,0xdf5027e4,
0xbf902fdc,0x5c00ccc0,0xe97f205f,0x01fea05f,0x02fdc0df,0x02fdcbf9,
0x02fdcbf9,0x02ff4bf9,0xfffb0ff5,0x001ff625,0x20000131,0x21fd2ff9,
0x007f90fe,0xe89f5ff7,0x205fd83f,0xfeedcefb,0x80ffc4ff,0x427ec1ff,
0x3bee07fa,0x4fffeedc,0x2fb8df50,0x4fa80040,0xf50df300,0x49f9000b,
0x740189ff,0xffffffff,0x07fd402f,0x003fea00,0x3fe05ff1,0x7fd40001,
0x000ff900,0x000ffa80,0xff50ff60,0xf71ff201,0xf52fe40b,0x401ffc0f,
0x1fea01cb,0x3fea3ff8,0x4407fd00,0x81fea05f,0x81fea3ff,0x81fea3ff,
0x03fea3ff,0x7f441ff4,0x01effeef,0x5c003970,0xfd04401c,0x1fe43fa1,
0x12fffd80,0x3fe60ffb,0x900ffa83,0x7fc400ff,0x3337fe20,0xa82ffccc,
0x0ff900ff,0x5f985ff1,0x09f50000,0x3ea1be60,0x23fd8005,0x880001ff,
0x2ff400ee,0x402ff400,0x3ff307f9,0xf90072e0,0x807fcc09,0x3fa001cb,
0x3fe20005,0xf3027e42,0xf03fd41f,0xb84ff87f,0x0fe800ff,0x7dc27fc0,
0x10f7fc0f,0x3fa80ffb,0x7dc27fc0,0x5c27fc0f,0x427fc0ff,0x77fc0ffb,
0x981ff621,0x00dfffff,0xe8003fa0,0x87f4000f,0x007f90fe,0x3fbbffa2,
0x3ff201ef,0xf3027e41,0x1fea001f,0xfffffff5,0x9f90bfff,0x3a07fcc0,
0x001fd06f,0x2009fb00,0x0ff986f9,0xf8bfe200,0xfd80001f,0x03bf6201,
0x00efd880,0x7dc2ff88,0x01fd01ff,0xf900ffd8,0x4007f40d,0x8800efd8,
0x6c0ffb80,0x0df900ff,0x1ff709ff,0xeddfffa8,0x6f8802ff,0xddfffa80,
0xfe982ffe,0x01effeef,0x3ea017dc,0x2ffeddff,0xeddfffa8,0xfffa82ff,
0x982ffedd,0xeffeeffe,0x026fea01,0x801be200,0xfe8006f8,0x0ff21fd0,
0xfffff980,0x46fe800d,0xdf900ffd,0xb17f6200,0x555555bf,0x1ffb0ff9,
0xff91bf20,0x403bea01,0x02ff8800,0xff10df30,0xff701107,0x0000ffc1,
0x7ee4c3fc,0xdc9801ff,0x36001fff,0xedffddff,0x806f881f,0xcbbdeffa,
0xdf101ffe,0x7ffee4c0,0x99bf5001,0xff505fff,0xffd977bd,0xbbfff503,
0x36605ffd,0x001dffff,0x366009f5,0x201dffff,0x0dffffd8,0x9801fc80,
0x01dffffd,0x37ffff66,0x3fff6601,0x3f6201df,0x6c00dfff,0x3ea0000f,
0x013ea004,0x87f43fa0,0x02cccdfc,0x00026fea,0x7fd49fd1,0xffecbbde,
0xffb9b901,0x201ff81f,0x7fd42ff8,0xffecbbde,0x9007fe61,0xbd7559df,
0x037ff640,0x0dfb9993,0x5473ffee,0x2fffccdf,0x40000ffc,0x3fe64efd,
0xff3000df,0xd88001bf,0x3fb3efff,0x2a009f50,0xcffffffd,0x9813ea00,
0x2000dfff,0x1efffff9,0x3ffff6a0,0x36600cff,0x001dffff,0x13100011,
0x00011000,0x01880011,0x88000880,0x00088000,0x17600088,0x00131000,
0x740004c4,0x3f21fd0f,0x3604ffff,0x3e20000f,0x7fffed43,0x3f200cff,
0x7d40efff,0xa84fd807,0xcffffffd,0xb8017cc0,0x02dffffe,0x4019fff1,
0x06fffffa,0x7ccbffee,0x981effff,0xd7300001,0x3000198d,0x02600003,
0x40009880,0x10009998,0x00198013,0x0004ccc0,0x00013331,0x00000011,
0x00000000,0x00000000,0x00000000,0x00000000,0x20000000,0x221fd0fe,
0x20099999,0x0080005d,0x80026662,0x9fb00998,0x440ff700,0x00400999,
0x9800cc40,0x33331000,0x81310013,0x00000999,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0xfe87f400,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x44000000,0x00000621,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x0000004c,
0x00031062,0x44000000,0x00acedca,0x66665c00,0x599300ab,0x0000f220,
0x00cc8000,0x00000797,0x90000000,0x00000019,0x01800260,0xcc980000,
0x0c079101,0x33332600,0x000003cc,0x00000000,0x04c09800,0x00000000,
0x00000000,0x26027fec,0x03fd89ff,0x7009ffb0,0x05fd31df,0x2003ff50,
0xf5005ffb,0x88007ec9,0x7dc00efe,0x7fdc005f,0x005fffff,0x7ff49ff3,
0xb83fffff,0x0bf306ff,0x2002ffdc,0x3ff05ffb,0x3201ff70,0x003be22f,
0x3fe61df9,0x1dfd1004,0x80003ff0,0xa800efe8,0x7fd401ff,0xfc80763f,
0x6ffb802f,0xff50bf30,0xfb80ec7f,0x405fffff,0x03be22fc,0x900bff70,
0x440005ff,0xbf100efe,0xff9817dc,0x3203fd89,0x3f6002ff,0x8001df54,
0x2000efe8,0x404fdcfd,0x003ffff9,0x009fb9fb,0x003ffff5,0x3200fff2,
0x800efcdf,0x005ffffe,0xf3009fd1,0xd1007f57,0xb5537bff,0x85ff300b,
0xfecaacfe,0x17ffdc2f,0xdfc82fcc,0xfc800efc,0x7fc0efcd,0xd00ffd41,
0x00ffd49f,0x3fe61df7,0x09fd1002,0x10000ffc,0x7e4009fd,0x2f7e603f,
0x401ffffe,0x7dc02ffa,0x45f982ff,0xfffebdf9,0x3333101f,0x4fe80133,
0xfc807fea,0x5400efcd,0xe88002ff,0xfffd804f,0x3fe600ef,0xffa803ff,
0x3fff2002,0x7f44000e,0x71654004,0x2cc88059,0x65c59500,0x01cca802,
0x30037620,0x401e5479,0x2003ddb8,0x1f5002cb,0x3ff2013a,0x33200202,
0xfe82fe81,0x437f7dc6,0x23c985f9,0x1e4c03ca,0x21ff8795,0x64c02ff8,
0x99101dc0,0x7000e5c1,0x01ff8059,0x000b2e00,0x42801bb1,0x91001cdb,
0x7f7dc019,0x4285f986,0x00001cdb,0x03b81930,0x03ca8f26,0x4000cc88,
0x36e002cb,0xcc8800bd,0x03322002,0x000ccb80,0x00002cb8,0x00000000,
0x00000000,0x00000000,0xfdef8800,0x017fc402,0x0bfa0000,0xd9f71fee,
0x005f985f,0x3fe00000,0x00013fa1,0x00000000,0x00003ff0,0x00000000,
0x67dc0000,0x02fcc3fe,0x372e2000,0x0000002c,0x00000000,0x00000000,
0x00000000,0x65440000,0x7100aced,0x8039bdd9,0x02cddca8,0x166ee544,
0x33b72a20,0xdd97100a,0xca88039b,0x7100aced,0x8039bdd9,0xfc802dc9,
0x65440006,0x0bfa2cdd,0x79f71fea,0x105f98df,0x98059b97,0xcccccccc,
0x2fe47fe0,0xc980b2a0,0x59b97104,0x66e5c400,0x4007fe02,0x132602ca,
0x2cddca88,0x0b372e20,0x166e5c40,0x47facfb8,0x0b3265f9,0x7fd41e44,
0x700effff,0x99999999,0x99999709,0x99709999,0x89999999,0x79102cc9,
0xcccccc98,0x0b3264cc,0x33261e44,0x84cccccc,0x0abccccb,0x666665c0,
0xf7004ccc,0x0bffffff,0xfffffff9,0x7fffdc09,0xff704fff,0x209fffff,
0xfffffffb,0xfffffc85,0x3fee04ff,0xc85fffff,0x4fffffff,0x401e64c0,
0x2e0003fd,0x4fffffff,0x8bfb05fd,0x21ff8cfb,0xfffa85f9,0xf700efff,
0x1fffffff,0x077dcffc,0xfa813f20,0xfffffa87,0x7fd400ef,0xf80effff,
0x09f9001f,0xffb83fd4,0xa84fffff,0x0effffff,0x3ffffea0,0xea7dc0ef,
0xfb97e63f,0xb8bf306f,0xffb9acff,0xffffe80e,0x740fffff,0xffffffff,
0x7ffff40f,0x2e0fffff,0x8bf306ff,0xfffffffb,0x41bfee7f,0x7ffdc5f9,
0xe87fffff,0x3fffffff,0x3fffffa0,0x2200ffff,0xaa9bdffe,0x567fe45d,
0xf902b999,0x9b7537bf,0x537bff90,0xffe889b7,0x45daa9bd,0x999acffc,
0xdffe882b,0x645daa9b,0xb999acff,0x07ffec02,0x3310bfe0,0xbff90133,
0x3a9b7537,0xffda99bf,0x5fca7dc0,0x9ff717e6,0x01dff735,0xf7555553,
0x7fdffc1f,0x204fc800,0x67fdc7fa,0x00effb9a,0xf7359ff7,0x01ff81df,
0x7d409f90,0x9bdffc87,0x7fdc4dba,0x0effb9ac,0xb9acffb8,0x53ee0eff,
0x4bf30ffa,0xf982fffb,0x7cc27fc5,0xfaaaa83f,0xaa82aacf,0x2aacffaa,
0xcffaaaa8,0x7ffdc2aa,0x7dc5f982,0x2aaaaaae,0x260bffee,0x5577dc5f,
0xfe82aaaa,0x2ffecaac,0x9ff55550,0xffc80555,0x3ff88202,0x01ffd400,
0x203ffa81,0x1017fe40,0x2001ffc4,0x88202ffc,0xf10003ff,0x7c405fff,
0x7fffec1f,0x101ffd46,0x3ffffffa,0xf14fb80d,0xff17e63f,0x007ff309,
0xfff07fc4,0x13f200bf,0x27fc7fa8,0xff81ffcc,0x7c3ff984,0x09f9001f,
0x3fea3fd4,0x09ff0203,0x9ff07ff3,0x7dc7ff30,0x2fcd3fa4,0xf30dfdf7,
0xf7037dcb,0x003ff00d,0x7c001ff8,0x3fbee01f,0x7dc5f986,0xdfdf7006,
0x6fb8bf30,0x7417f400,0x03ff006f,0x800bfe20,0x74000ffa,0x27f4004f,
0x005ff100,0x10007fd4,0x7d4005ff,0xbf50000f,0x7fc40bf9,0x37ee65c1,
0x7f4013fa,0x701efdcd,0xf9afe49f,0xfb81bee5,0x83fe2006,0x802ffbff,
0x9fea04fc,0x1bee06fb,0x6fb81bee,0xfc800ffc,0xfd1fea04,0x037dc009,
0x06fb8df7,0x24fb9bee,0x25f98ff9,0x4c2fecfb,0x880ffa5f,0x0ffc01ff,
0x0007fe00,0x67dc03ff,0x22fcc2fe,0x9f7006fb,0x45f985fd,0x7f4006fb,
0xf007fb82,0x1bf2003f,0x005ff300,0x50007fd4,0x7e4001ff,0x17fcc006,
0x800df900,0xb0002ff9,0x401ff37f,0x9bea02ff,0xfd000ffa,0x5c07fdc5,
0x263fe64f,0x880ffa5f,0xff1001ff,0x7fdcffc1,0x5027e401,0x101ff4ff,
0x03fe83ff,0x1ff87fe2,0x5409f900,0x003fea7f,0x3e203fe8,0x880ffa1f,
0xd89f71ff,0x3ee5f9cf,0x2fcc6fbc,0x2ff803ff,0x2000ffc0,0x7fc001ff,
0x3ef3ee01,0x3ee2fcc6,0xf79f7006,0x7dc5f98d,0x417f4006,0x3ff007fa,
0x000ff600,0x5c00bffa,0x37dc006f,0x000ff600,0x6c00bffa,0xffe8003f,
0x87fc4002,0x0ffa02ff,0x1bee6fa8,0x7ec2fe80,0x7ec4fb84,0x07fe5f9c,
0x22005ff0,0x6c7fe0ff,0x13f200ef,0x07fe7fa8,0x1ff85ff0,0x3ff17fc0,
0xa813f200,0x001bee7f,0x2ff803ff,0x5ff007fe,0x5ff313ee,0x7c67dcbf,
0x7c57e61f,0x01ff400f,0xff0007fe,0x01ff8003,0x87fe33ee,0x037dc5f9,
0x1ff8cfb8,0x0df717e6,0xfd82fe80,0x003ff005,0x33310bfe,0xefff9813,
0x017f200b,0xf800bf90,0x4cccc42f,0x5f7ffcc0,0x310bfe00,0xff981333,
0xfa800bef,0xfc817f26,0xfc9bea07,0x30bfa005,0x44fb81ff,0xf15faff9,
0x03fe801f,0x7fc1ff10,0x640bfd11,0x45fea04f,0x1ff400ff,0xfe801ff1,
0x64007fe3,0xc9fea04f,0x3fe2005f,0xf89ff400,0xb9ff400f,0x5fefd84f,
0x32fe53ee,0x003fe6bf,0x1ff807fb,0x000ffc00,0x4fb807fe,0x22fccbf9,
0xcccccffb,0x7e53ee2c,0xff717e65,0x05999999,0xfb5337fd,0x07fe001f,
0xfb07fe20,0xf910dfff,0xfb019fff,0x04fd8009,0xfb07fe20,0xf910dfff,
0xf8819fff,0x7fffec1f,0xffffc886,0xa8ff600c,0x7ff100ff,0x4fd9bea0,
0x3a0bfa00,0x7427dc4f,0x1ff35fdf,0x1003fd80,0x30ffc1ff,0x13f207ff,
0x1ff37fa8,0x3e63fd80,0xf1fec00f,0x13f2003f,0x13f67fa8,0x400ff980,
0x01ff33fd,0x09f73fd8,0x7dcbfff3,0x3e63ff14,0xe801ff35,0x00ffc03f,
0xf0007fe0,0x8a7dc03f,0xb8bf31ff,0xffffffff,0x7fc53ee5,0xffb8bf31,
0x85ffffff,0xdffffffe,0x007fe000,0x99707fe2,0x7dc40dfb,0x27ec1fff,
0x8013f600,0x665c1ff8,0x3ee206fd,0x3fe21fff,0x37ee65c1,0x3ffff710,
0xff83ff10,0x037fee02,0x027ecdf5,0xff505fd0,0x7d427dc1,0x01ff35ff,
0xf1003fe8,0x2e0ffc1f,0x04fc81ff,0x07fcdfea,0xff98ffa0,0xff1ff400,
0x813f2003,0x013f67fa,0x7400ff98,0x801ff33f,0x209f73fe,0x93ee5ffd,
0x22bf35fc,0x17f401ff,0xf0007fe0,0x1ff8003f,0x5fc93ee0,0xaefb8bf3,
0x2e1aaaaa,0x7cd7f24f,0x55577dc5,0xdfe81aaa,0x4001efdc,0x5ff001ff,
0xa8037d40,0x17f20fff,0x800bf900,0x1bea02ff,0xf07ffd40,0x037d405f,
0x540fffa8,0x405fd86f,0xfeeffffc,0x8017f26f,0x49fd02fe,0xbffd04fb,
0xfd007fe2,0x83fe2005,0x0ffd81ff,0xff5027e4,0xfd007fe2,0x200ffc45,
0x3fffe2fe,0x323fffff,0xc9fea04f,0x3fe2005f,0xf897f401,0xb97f401f,
0x4bff104f,0x23fe64fb,0x80bfe5f9,0x7fc01ff8,0x00ffc001,0xfb807fe0,
0x3e63fe64,0xb8037dc5,0x263fe64f,0x0037dc5f,0x0ffb8bfa,0x4007fe00,
0x1bea03fe,0x2e2ff880,0x37dc006f,0xa80ffa00,0x3fe2006f,0xfa80ffa2,
0x0bfe2006,0x0ff509fb,0xfffffb30,0x0037dc5b,0x3fee05fd,0x3ea09f70,
0x880bfe5f,0xff1001ff,0x7440ffc1,0x5027e46f,0x1017fcdf,0x02ff83ff,
0xfff87fe2,0x23ffffff,0x9bea04fc,0x7fc006fb,0xf87fe202,0x47fe202f,
0x97f204fb,0x4e7ec4fb,0xa817fa5f,0x01ff807f,0x2000ffc0,0x13ee01ff,
0xb8bf39fb,0x89f7006f,0x5c5f9cfd,0x17f4006f,0xff8013f6,0x40ff9001,
0x7ec006fa,0x800bfea4,0x32002ffa,0x01bea07f,0x3fe49fb0,0xd800df50,
0x337fe24f,0x02ffcccc,0x7d402620,0x0000002f,0x205fe800,0x3ea007fa,
0xbf700007,0xbfd2fe40,0x7f43fd40,0x001fea05,0x7e40bf70,0x800bfea5,
0x1fea05fe,0x3fd40bfd,0xfb97f200,0x2fd7fcc4,0x3fa01ff5,0x001ff803,
0x3e000ffc,0x313ee01f,0xfb8bf5ff,0x989f7006,0x7dc5faff,0x217f4006,
0xff000ff9,0x0ffe2003,0x3a0037d4,0x0077f42f,0x2001dfd0,0xdf503ff8,
0x222fe800,0x0df503ff,0x3ea2fe80,0xffffffff,0x0397005f,0x8000efe8,
0x65c001cb,0x403fea01,0x3f2003fe,0x200e5c06,0x8ffe07fa,0x7fd00ffa,
0x3a01ff50,0x8072e03f,0x0ffe07fa,0x2a001dfd,0x87fd00ff,0x7fd00ffa,
0x2e3fe800,0x5fdfe84f,0xfb10f7fc,0x007fe00f,0xf8003ff0,0x213ee01f,
0x7dc5fdfe,0xd09f7006,0x6fb8bfbf,0x7417f400,0x03ff004f,0x206ffdc0,
0x440666fa,0x7fcc0ffc,0x7cc2a81e,0x5c2a81ef,0x37d40dff,0x3ff22033,
0x206ffdc0,0x440666fa,0x37f60ffc,0xfcaaaaaa,0x801fd007,0x2a81eff9,
0xe8001fd0,0x0f7fc00f,0x0b20ffb1,0xfe807ff5,0xb84ff800,0x0f7fc0ff,
0x7fc0ffb1,0x01ff621e,0x4ff801fd,0x7cc0ffb8,0x7c2a81ef,0x1ff621ef,
0xfb10f7fc,0x1ffa800f,0x3fea13ee,0x77ff4c5f,0xf001effe,0x1ff8003f,
0x700ffc00,0xbfff509f,0xf7006fb8,0x8bfff509,0x7f4006fb,0x800ffa82,
0x7e4001ff,0x6ffeefff,0x3bbbbff2,0xff502fff,0x09fffdff,0xffdffff5,
0xffff909f,0x7e4dffdd,0xfffeeeef,0xdffff902,0x7fe4dffd,0x2fffeeee,
0xff100ffc,0x006f8805,0xffdffff5,0x00df109f,0xe9806f88,0x1effeeff,
0xfffdffb0,0x006f880d,0xfdbbfff5,0xdffd305f,0x4c03dffd,0xeffeeffe,
0x201be201,0xfeddfffa,0xffff502f,0xe989fffd,0x1effeeff,0xfddffd30,
0x3a2003df,0x827dc4ff,0xfd885ffe,0x3a00dfff,0xffffffff,0x7ffff40f,
0x740fffff,0xffffffff,0x7413ee0f,0x7ffdc5ff,0x2e7fffff,0x8bffd04f,
0xfffffffb,0xd02fe87f,0xffffd09f,0x001fffff,0xbfffffb3,0x7ffff5c5,
0x6c401cff,0x01cefffe,0x9dfffdb1,0x3fff6603,0x3fae2dff,0x01cfffff,
0x7ffffecc,0x3fffae2d,0x7d41cfff,0x404fd807,0x362004fa,0x81cefffe,
0x7d4004fa,0xfffb1004,0x7ecc01bf,0xfa804eff,0x3ff66004,0x36201dff,
0x800dffff,0x0dffffd8,0x98027d40,0x01dffffd,0x77fff6c4,0xfffd881c,
0x7ec400df,0x2000dfff,0x4fb83ffa,0x880bff50,0xffffd000,0xe81fffff,
0xffffffff,0x7ffff40f,0x2e0fffff,0x8bff504f,0xfffffffb,0x5413ee7f,
0x7ffdc5ff,0xe87fffff,0x81ff702f,0xfffffffe,0x4c4000ff,0x00199800,
0x018000c0,0x98009880,0x26200019,0x40199800,0x7fb804fd,0x00004c40,
0x00131003,0x88000988,0x00098000,0x44000262,0x00088000,0x98800220,
0x00088000,0x01100060,0x40002200,0x00000018,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x95000000,0x00264c05,0x07dd5000,0x00000000,0x00000000,0x00000000,
0x00000000,0x20006200,0x3332e018,0x204ccccc,0x002cdcb8,0x00013026,
0x26000000,0x030004c0,0x00f32600,0xb3000060,0x0000007d,0x00000000,
0x00000000,0x99993000,0x3ee00799,0xd8800001,0x205dd11e,0x01df54fd,
0x3fd409f9,0x1df117e4,0x007ff300,0x20077f44,0xf7005ffb,0x7dc000bf,
0xbff7003f,0x77f44000,0x3e22fc80,0x7f44000e,0x7f44000e,0x1ffcc00e,
0x207ff300,0xfffffffe,0xfffa80ff,0x4400efff,0x980bee5f,0x03fd89ff,
0x0ef88bf2,0x5f72fc40,0x47fff500,0x7ffec01d,0x7fff5000,0x7fcc00ec,
0xff7003ff,0x3faa000b,0x2ffdc07f,0x27fcc000,0x01dfd100,0xfd89ff98,
0x7fffdc03,0x1f9005ff,0x002ffc80,0x3ff6bff7,0x3bfff207,0x5409f900,
0x2a4fe87f,0x6ec401ff,0x13fa2001,0x3bf37f20,0x3f37f200,0x77dc000e,
0xf9bf9001,0xfe88001d,0xfa93fa04,0x3fa2001f,0x4fe88004,0x00bff500,
0xaa82ffd4,0x2aacffaa,0xb9adffa8,0x7ec00eff,0x4c00efff,0x7403ffff,
0x007fea4f,0x03bffff6,0xffd7bf30,0x7fc403ff,0xdf9802ff,0x01ffffeb,
0x7ec4f7d4,0x7e6fe404,0x3ff2000e,0x37f207ef,0x30000efc,0x744005ff,
0x3fe6004f,0x998803ff,0x4c009999,0x200abfeb,0xf9802ffa,0x80fffb4f,
0x3f200ccb,0x261fea04,0x0001dc0c,0x30059700,0x981e5479,0x800f2a3c,
0x93000cc9,0x2001e547,0x064c02cb,0x597000ee,0x00b2e000,0xd8003db0,
0x03ff001e,0xff984ff8,0x0bddb803,0x00599100,0x003b8193,0x4002f76e,
0x200e6dc2,0x005fcdfa,0x001cdb85,0xa8f26000,0x7ff3003c,0x2a3c9801,
0x3990003c,0x002cb800,0x0002cc88,0x3fffea00,0x64404fff,0x2228800c,
0x900002ed,0x03fd409f,0x7fffd400,0x0000004f,0x00000000,0x00000000,
0x00000000,0x00000000,0x07fe0000,0x3ee06fb8,0x00000007,0x00000000,
0x7fb00000,0x00001ff3,0x0001ff80,0x0df70000,0x00000000,0x00000000,
0x99301654,0x77df7fdc,0x000003cb,0x33332a00,0x13f201ab,0x664c7fa8,
0x44cccccc,0x04ffeeea,0x26000cc8,0xcccccccc,0x91007934,0x79999705,
0x00f2e015,0x99303326,0x29999999,0xcc9803cb,0x93007970,0x66664c19,
0x42cccccc,0xcccccccb,0x66664c4c,0x02cccccc,0x1ff403ff,0x9703ff30,
0x99999999,0xcccccc98,0x2602cccc,0xc98003cc,0x9997003c,0x20999999,
0x05ff0ff8,0x801e64c0,0x32a001ff,0xb00f2602,0xcc98007f,0x332e0003,
0x2602cccc,0xccb803cc,0xcccccccc,0xa813f20c,0x265ff17f,0x3326004f,
0x800ec803,0xfffffffc,0x204fc81e,0x7ffdc7fa,0x407fffff,0x1ff804fc,
0x3fffee00,0xbf57ffff,0xfd09f500,0x07ffffff,0xfe805ff5,0xfffffb85,
0x5ff57fff,0x3ea5fe80,0x22ff402f,0xfffffffa,0x7ff45fff,0x0fffffff,
0x3fffffea,0xff05ffff,0x200ffc03,0xfffe82ff,0x20ffffff,0xfffffffa,
0x3f605fff,0x7ec000ff,0xffe800ff,0x0fffffff,0x17f26fa8,0x00fffd80,
0x32001ff8,0x01bea04f,0xfd8005ff,0xf98000ff,0x04ffffff,0xd003fff6,
0xffffffff,0x27e43fff,0x9feaff50,0x3f6003fa,0x07f400ff,0x5556fe40,
0x7e42fffc,0xf71fea04,0x5555555d,0xf804fc80,0x3bee001f,0x32aaaaaa,
0x09f500df,0xfd9559fd,0x40dfd05f,0xefb80ffa,0x22aaaaaa,0x3fea06fe,
0xf5037f40,0xaaaa881f,0x43ffbaaa,0xacffaaaa,0x5555442a,0x03ffbaaa,
0x3fe203ff,0x541ff400,0xaacffaaa,0x55555442,0x103ffbaa,0x4005ffff,
0x802ffff8,0xacffaaaa,0x547fb02a,0xff8800ff,0x1ff802ff,0xa813f200,
0x07fe206f,0x2ffff880,0xcfefc800,0xff100999,0xaaa805ff,0xaaacffaa,
0xa813f20a,0x2e3ff57f,0xfff1002f,0x01fe805f,0xfc884fc8,0xa813f20f,
0x0037dc7f,0xff009f90,0x037dc003,0x7dc037cc,0xfe82fe83,0xd02ff986,
0x01bee07f,0xfe817fcc,0xd02ff983,0xdfb0007f,0x0003ff00,0x3ff037ec,
0xb003fe60,0x03ff009f,0x5037ec00,0x400bf9bf,0x005fcdfa,0x7c401ff8,
0x4017fc1f,0x805fcdfa,0x3f2001ff,0x981bea04,0x3ea000ff,0x44005fcd,
0x5003fcef,0x000bf9bf,0x4fc803ff,0x7fc5fea0,0x5001fcae,0xe80bf9bf,
0x04fc801f,0x04fc93fa,0x0df71fea,0x4027e400,0x3ee001ff,0x807f8806,
0x82fe83fb,0x0dfb07fb,0x3ee01ff7,0x21bf6006,0xdfb00ffb,0x8001ff70,
0xff800ffa,0x1ff50001,0xf980ffc0,0x01ff400f,0xa8000ffc,0x2ff600ff,
0xfb000ff9,0x8001ff37,0x37d401ff,0x7ec02fec,0x7c00ff9b,0x2dfec89f,
0x3ea04fc8,0x3fbbba66,0x200eeeef,0x00ff9bfd,0x0ff2fee0,0x7fcdfec0,
0x00ffc000,0x7fa813f2,0x03ffffe6,0x7fcdfec0,0xcb87fe00,0xf7027e40,
0xf5027e4f,0x0006fb8f,0x3fe013f2,0x01bee001,0x3f201fe2,0xfa82fe82,
0xf87ff107,0x01bee02f,0x7fc3ff88,0xf0ffe202,0xff88005f,0x003ff003,
0xf807ff10,0x03ff101f,0xff802fe8,0x3ff88001,0x7fc3fe20,0xf0ff8802,
0x1ff8005f,0x7d427ec0,0xf87fc407,0x757fc02f,0x642fffff,0x99bea04f,
0xffffffff,0x1ff101ff,0xfe800bfe,0xf8803fc8,0x8005ff0f,0x27e401ff,
0xfc88ff50,0x2200cfff,0x405ff0ff,0x8dff91ff,0x3fe604fc,0x7d409f90,
0x00037dc6,0x3ff009f9,0x8037dc00,0xf907f47f,0xfb05fd05,0xb87fe40b,
0x037dc06f,0x7dc3ff20,0x70ffc806,0xdfb000df,0x000ffc00,0x7fc037ec,
0x880bfe01,0x1ff801ff,0x406fd800,0x017f26fa,0x05fc9bea,0xf100ffc0,
0xf99999bf,0x937d405f,0xffff80bf,0xfc8dfb32,0xc81bea04,0x9bea005f,
0xbf3005fc,0x3ea00ff2,0xf0017f26,0x04fc803f,0x7fc41fea,0xdf501fff,
0x5ff02fe4,0x9f91fff6,0xfb8ffc40,0xf717f205,0x5999999f,0xf804fc80,
0x3fee001f,0x22cccccc,0x45ff10ff,0x9bfe81fc,0x200ffda9,0x1ff8bff8,
0x6667fdc0,0xff882ccc,0x8801ff8b,0x01ff8bff,0x000ffd40,0xfa8003ff,
0x01ff801f,0x7fa817fa,0x8003ff00,0x7ec01ffa,0xb003fea3,0x007fd47f,
0x7d403ff0,0xffffffff,0xa8ff605f,0x3ffe00ff,0xf907fcc1,0xb999999d,
0x027ec0df,0x7fd47fb0,0xf92fc800,0xfb01555b,0x0007fd47,0x4fc803ff,
0x7c41fea0,0xd80ffead,0x403fea3f,0x89ff52ff,0x97fc04fc,0x0ffe07fa,
0xfffffff7,0x04fc80bf,0x2e001ff8,0xffffffff,0x7fdc3fa5,0x3fa07f65,
0x00dfffff,0x05fcffb8,0xffffffb8,0x9ff705ff,0x7fdc00bf,0x7c4005fc,
0x0ffc003f,0x007ff100,0xffa807fe,0x2007fd00,0x3e2001ff,0x0ffc403f,
0xff880bfe,0xf0017fc1,0x56fec03f,0x7fcaaaaa,0xff83ff10,0x7c0bfe02,
0x3ffff21f,0x06ffffff,0x7c400bfa,0x2017fc1f,0x3fff27f8,0x0ffc42ff,
0xff800bfe,0x5027e401,0x44fe60ff,0x0ffc43fe,0x17fc0bfe,0x409f9011,
0x13fe1ff8,0xdf703fee,0x03555555,0xff804fc8,0x2bbee001,0x3a1aaaaa,
0x21fdfb0f,0xcdfe80fd,0x3a001efd,0xfb801fff,0x1aaaaaae,0x007fffa0,
0x003fffd0,0xf8006fd8,0x1bf6001f,0x7c01ff80,0x3ff621ef,0x003ff000,
0x7d4037ec,0x2a05fd86,0x005fd86f,0x1ff807fe,0x2a0bfe20,0x205fd86f,
0x43ff01ff,0xaaaaaefc,0x3fe06fca,0xb0df5001,0x24fb80bf,0x40aaadfc,
0x05fd86fa,0xf9007fe0,0xa83fd409,0xf517f62f,0x3e0bfb0d,0x04fc802f,
0xffa87fe6,0x82ffeddf,0x320006fb,0x01ff804f,0x6c01bee0,0x3fccf89f,
0x45fd01fd,0xf5000ffb,0x1bee009f,0x027fd400,0x0027fd40,0x20007fea,
0xff5001ff,0x7ffff403,0x4c0fffff,0xfffeffff,0x007fe001,0x6c00ffd4,
0x207fa84f,0x07fa84fd,0x7d407fe0,0xd84fd807,0x207fa84f,0x43ff01ff,
0x1bea04fc,0xd8007fc4,0x407fa84f,0x00ff21fe,0x0ff509fb,0x3200ffc0,
0x41bea04f,0x87ff11fb,0x87fa84fd,0x0bf63ff8,0x3fd409f9,0x6ffffecc,
0x000df701,0x7fc027e4,0x01bee001,0x4d7d57e4,0x3fa0fd6f,0xf0027ec2,
0x1bee003f,0x001ff800,0x44003ff0,0xff0003ff,0x07ff1003,0xffffffe8,
0xfc980fff,0x4000cfff,0xff8801ff,0xcdff8803,0x82ffcccc,0xccccdff8,
0xff002ffc,0x2013f603,0x6ffc47fb,0x2ffccccc,0x3fe03ff0,0xfa813f21,
0x200ff306,0xccccdff8,0xff302ffc,0x407fb555,0xccccdff8,0xff002ffc,
0x205fb803,0x323555fc,0x20ffda9f,0xccccdff8,0x7fc42ffc,0x9f903fe3,
0x3202ff40,0x037dc03f,0xf009f900,0x37dc003f,0x27dafc80,0xfd07f8fe,
0x000ff985,0x3ee003ff,0x07fe0006,0x000ffc00,0x7c000dfb,0x06fd801f,
0x4027d400,0xff0001ff,0x00dfb003,0x3fffffea,0xfa85ffff,0xffffffff,
0x03ff005f,0xa83fb000,0xffffffff,0x03ff05ff,0x04fc87fe,0x37dc1bea,
0xfffffa80,0xb05fffff,0x7fffffff,0x7ffffd40,0x005fffff,0x7fa803ff,
0x7fe4ffe0,0x1fffffff,0x7fffffd4,0x7c45ffff,0xf90df13f,0x807ff209,
0x6fb805f9,0x013f2000,0xfb8007fe,0xbf7f7006,0xe837dfdc,0x004fe82f,
0x3ee003ff,0x07fe0006,0x800ffc00,0x20001ffa,0x7fd401ff,0x1be20001,
0x0042fec0,0x3ea00ffc,0x5bfb001f,0xff955555,0x5555bfb0,0x200ff955,
0x5c0001ff,0xaadfd83f,0x07fcaaaa,0x87fe03ff,0x1bea04fc,0xfd8027f4,
0xcaaaaaad,0xaaff887f,0x3603fdaa,0xaaaaaadf,0x3ff007fc,0xf709ff00,
0x3ffb261f,0xbfb03def,0xf9555555,0x3661330f,0x2624fc83,0x7dc03ffe,
0x006fb804,0x3e013f20,0x1bee001f,0x317f7dc0,0x3fa0dfdf,0x800ffa82,
0xdf7001ff,0x00ffc000,0x8801ff80,0x99999cff,0x0ffc0099,0x3339ff10,
0xa8013333,0xdff3005f,0xff00bd77,0x4e7fc403,0x20999999,0x3fe201ff,
0xf100ffc2,0x03ff005f,0xf82fd800,0x0bfe201f,0x0ffc07fe,0x37d409f9,
0x4007fee2,0x3fe201ff,0x7e427dc2,0x8807fe03,0x1ff802ff,0xddfffa80,
0xbf102ffe,0x4403ff00,0x320002ff,0xffffffff,0x2dff9802,0x3ffffee0,
0x77647fff,0x2eeefffe,0xfffffff8,0x7ffdc3ff,0x2a7fffff,0x7ff40fff,
0x3a05fd05,0x01ff804f,0xffffff70,0x1ff80fff,0x003ff000,0xfffffff7,
0xffe8dfff,0x0fffffff,0x3fffffee,0x4406ffff,0xfb803dff,0x740dffff,
0xffffffff,0x3fffee0f,0x56ffffff,0x49fb00ff,0x4fd807fa,0xffffffe8,
0x5c000fff,0x0ff51cef,0x3ff09fb0,0x4fc87fe0,0x7fddbea0,0xff5005ff,
0xfe89fb00,0xeeeefc81,0xfb00ff54,0x003ff009,0x37ffff66,0x5013e601,
0x09fb00ff,0x7fffe400,0x2a000ade,0x3fee03ed,0x47ffffff,0xfffffffe,
0xffff82ff,0x5c3fffff,0xffffffff,0x2e17fea7,0x05fd05ff,0xff003fee,
0x3ffee003,0x407fffff,0xff0001ff,0xffff9003,0x8dffffff,0xfffffffe,
0x3fff20ff,0x6fffffff,0x004ec980,0x3a037751,0xffffffff,0x3ffff20f,
0xb6ffffff,0x4ff7009f,0x7fb804fd,0xffffffe8,0x44000fff,0x09fb1edb,
0x3ff0ff70,0x4fc87fe0,0x7fd5bea0,0x13f6003d,0x6fa9fee0,0xbfffff90,
0x3ee013f6,0x001ff807,0x7f500088,0xb804fd80,0x0000007f,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x40000310,0xccccccc9,0x7fe4004c,
0x7765c403,0x999301cd,0x00007999,0x664c0000,0x3f63cccc,0xccc98002,
0x20003ccc,0xb95100ff,0x3722059b,0x004ffffe,0x0000e5c0,0x01db8000,
0x00000000,0x01970000,0x303bfa20,0x01bdffd9,0x07fb27e4,0x401fc9ba,
0x00999999,0x7403fcc0,0x64007f26,0x37ea00ef,0xf300bf70,0x3ee0007f,
0x05ff983f,0x8802a800,0x7cc01aca,0x3ffae03f,0x7fcc00ef,0x44ffcc03,
0x3ffee3fd,0x007fffff,0xf9007bf2,0x09ffffff,0x3fffffee,0x04ffb805,
0x2013fee0,0x5ffffffb,0x2e0017ea,0x05ffffff,0x2e09f500,0x4fffffff,
0x777fffe4,0x7e4004fe,0x74401ff4,0x2fdc002f,0x44006ff8,0xfa80dffd,
0x9fffd505,0xff100001,0x213fa200,0xfffefffb,0x7f6fe401,0x3f37f203,
0x7fffc406,0x999803ff,0x32019ffa,0x9006fcdf,0x5401dfdf,0x9805fdef,
0x4003feff,0x36201ffb,0x37c0005f,0x3ffffee0,0x20ffe603,0xfeeeffe8,
0x02ffd400,0x21ffffcc,0xaaaaaefb,0x1bf7002a,0x33ff2055,0x102b999a,
0x01333333,0x04facf98,0x04facf98,0x4cccccc4,0x20007f40,0x09999998,
0x903fd000,0xb7537bff,0x7ffffe49,0xc8009f92,0x5c05f9cf,0x7fc005ff,
0x007fc81f,0x22fee7f4,0xffd80ff8,0x000fffee,0x04fa8773,0xf982fe88,
0xc800982f,0x7ec403ff,0x554401ef,0xf801aaaa,0x1fffffff,0x03dffb10,
0x3bea9f90,0x017fea00,0x3f623be6,0x01bf7003,0x40017ee0,0x3fe603fa,
0x102ffcac,0x1bf907ff,0x007b6000,0x7dc16644,0x21980006,0x03ff886f,
0x3dc00000,0x64f700d9,0x3ee00006,0x00000004,0x7fd437cc,0x7ffcc203,
0x09f92fff,0x2fbcfc80,0x001ffcc0,0x3e203ff6,0xe93ea006,0x2e0ff20f,
0x13fa20ef,0x3f227e40,0x70098801,0x130000bf,0x00000800,0xffb99900,
0x00100199,0x0026204c,0x02620031,0x00660033,0x2a002620,0x201fffec,
0x827ec4fc,0x2fe82ff8,0x00000000,0x00001bee,0x1ff507f5,0xccccb800,
0x2a04cccc,0xa804e9bf,0x2604e9bf,0xcccccccc,0x4001fe24,0x20003cc9,
0x04fe82fd,0xffffff70,0x90013f25,0x2200319f,0x20130001,0x3ee003fb,
0x2fcc7f22,0x5fb82fe8,0x1889f900,0x3ff50000,0x00000000,0x26000000,
0x0000007f,0x00000000,0x00000000,0xdffdfffb,0xf90ff601,0x6c17fc09,
0x3326005f,0x44cccccc,0xccccccc9,0x000df74c,0x1fffeca8,0x4002ff98,
0xfffffffe,0x3ff200ff,0xbff9000d,0x7fffdc01,0x7ec7ffff,0xfffd8002,
0x87f88000,0xf9000ffa,0x325fffff,0x27e4004f,0x40000000,0x7d4004ff,
0x07f43f63,0x4fd80ff8,0x0009f900,0x0f7bb726,0x0017bffd,0x1ef76e4c,
0x03dfec98,0x677ff654,0x37b72600,0x765407fd,0x9800ceff,0x303deedc,
0x6c07bfd9,0xd83db01e,0xd83db01e,0x643db01e,0xdfdf51ef,0xfe89f901,
0x2607fe03,0xfb801eff,0x7fffffff,0x7fffffdc,0x00df77ff,0x7f7ffec0,
0x2ffe80ef,0x3eaaaa00,0x1002aacf,0x2e002000,0xaaaaaaef,0x20037cc2,
0x002ffff8,0x6fb84fb8,0x3fffea00,0x409f92ff,0x4fedeeca,0x7bfd9300,
0x3bb72600,0x3000373d,0x32df55df,0x81ff103f,0xdd100ffc,0xddddfffd,
0x7ffe403d,0x7e447fff,0x6401dfff,0x87ffffff,0xeffefffa,0xfffff981,
0xffb81fff,0x207fffff,0xfffffff9,0x3fff201f,0xffa87fff,0xf81effef,
0xf83ff01f,0xf83ff01f,0x223ff01f,0x3a7f60ff,0x90ffa83f,0x7ec000df,
0x2e00cfff,0xaaaaaaef,0x55577dc2,0x9ff72aaa,0x40599999,0xfdf51efc,
0xefff981d,0x0ffc000b,0x76c07b60,0xeffeca81,0x00df700c,0x2a001fe8,
0x8005fcdf,0x05fc80ff,0x3ffffe60,0xd109f92f,0x9fffffff,0xfdfff500,
0x7fe403df,0x7647ffff,0x707dfd71,0xdf33dfff,0xfb07fc40,0x7ffcc01d,
0xffffffff,0x417ff901,0xffb71049,0x2fff205f,0x5ff31260,0x64c37ec4,
0x8dfd5109,0x3ee22ffb,0x44272607,0xff906fea,0x3e624c17,0x21bf622f,
0x83ff01ff,0x83ff01ff,0x23ff01ff,0x5dbe25fb,0xfddfd05f,0x3f20001d,
0x01effc8d,0x7dc00df7,0xffffb806,0xf105ffff,0x7f4fec1f,0xffffc883,
0x03ff000c,0x3ff01ff8,0xffffff98,0x06fb81ff,0xb002fd40,0x001ff37f,
0x4fd82fd4,0x7fffe400,0xfd09f92f,0x027ec43b,0xfd88bfe6,0x417ff906,
0x7ed7ec49,0xa984ffff,0x4403fd0a,0x01df70ff,0x39fb3330,0x3e603333,
0x3620002f,0x02ff987f,0x3fe07fb0,0x89fea002,0x07f981ff,0xf30ff500,
0x0ff6005f,0x07fe17fc,0x07fe0ffc,0x07fe0ffc,0x23fc8ffc,0x20df33fa,
0x1003fffa,0x74c1ff03,0x06fb82ff,0x2e01bee0,0xaaaaaaef,0x7c4bf701,
0x5c40bf76,0xf801ffff,0x80ffc01f,0x84e4c1ff,0xfb86fea8,0x00ff8006,
0x5ff0ff88,0xd80fec00,0xffb8004f,0xb89f92ff,0x809f906f,0x85ff03fd,
0xfb002ff9,0x3ff227ff,0x2027dc00,0x09fb0ff8,0x4009f900,0x980005fc,
0x02fe40ff,0x3f207f88,0xa8ffc004,0x00ff306f,0x3f20ffc0,0x40ff1005,
0x80ffc4fc,0x80ffc1ff,0x80ffc1ff,0x6c5fb1ff,0xa81ff10f,0x3223ffff,
0xf12ffd44,0x703ff60f,0x37dc00df,0x40037dc0,0x4cfea3fc,0xfff5006f,
0x401ff801,0x03ff01ff,0x7dc3fd40,0x03fc8006,0x17f26fa8,0xf9037cc0,
0x2ea2000b,0xfe89f91c,0x4409f902,0x913f207f,0x7fec00bf,0x2602ff82,
0x0ff8806f,0xc8001df7,0x0ff6004f,0x0ff90040,0x3ea007fb,0xdaaaaaaf,
0x5553105f,0x13ee3ff5,0x4c403fcc,0x41ffaaaa,0xff5003fd,0xfb555555,
0xff01ff8b,0xff01ff83,0xff01ff83,0x37c4ff23,0xaff98ff1,0x8df51ffc,
0x3fe0fffe,0xfb85fd02,0x01bee006,0x36001bee,0x7c43f62f,0x5ff1000f,
0x7c01ff80,0x003ff01f,0x7fdc1ff8,0x02cccccc,0x7fb00df1,0x64007fd4,
0x01bee03f,0xf89f9000,0x409f900f,0xaaaaaffa,0x1fec5fda,0x3609fb00,
0x4c7fa03f,0x10ff881a,0x64003dff,0x0bfe004f,0x6e6f7ec0,0x2ff82fff,
0xfffff700,0x90bfffff,0xffffffff,0x7cc0ff63,0x7fffe407,0x7fc1ffff,
0xffff7002,0x8bffffff,0x83ff01ff,0x83ff01ff,0x23ff01ff,0x547f54fb,
0xfd1ff46f,0xfd8bf71f,0x0bfee0ff,0x9ff70ff2,0xb8599999,0xccccccff,
0x9000df72,0xf89be27f,0x027ec007,0x3ff007fe,0x4c407fe0,0x41ffaaaa,
0xfffffffb,0x80bf605f,0x17fc1ff8,0x9803fe20,0x200002ff,0x81fe24fc,
0x3fee04fc,0xffffffff,0xb0017fc5,0x40ff207f,0xbfffb4fb,0x3a60ff88,
0x9f9002ff,0x8017f400,0xdffffffc,0x2005fd01,0xaaaaaefa,0x7fe41aaa,
0x1ff9999b,0x1fe609fb,0x999bffc8,0x17f41ff9,0xaaaefa80,0x7c1aaaaa,
0xf83ff01f,0xf83ff01f,0x263ff01f,0x360fd8ff,0x883fe24f,0x444fdeff,
0x4ffd82ed,0x3fee17f4,0x45ffffff,0xfffffffb,0x000df75f,0xa8fea9f7,
0x17f4006f,0xff007fe0,0x3207fe03,0xffffffff,0x55577dc1,0x3ea01aaa,
0x361bea05,0x027dc05f,0x000077f4,0x3fe24fc8,0x5409f900,0xaaaaaaef,
0x017f41aa,0x3f207fb0,0x9f76f883,0x7fc47fb3,0x00ffec40,0xfb0027e4,
0x19988009,0x3004fd80,0xff8800ff,0x3f23ff02,0x220ff706,0x83ff02ff,
0xff3004fd,0x203ff000,0x80ffc1ff,0x80ffc1ff,0x3f7fa1ff,0xf983fee6,
0x7fffcc0f,0xeffb8001,0xefb86fca,0x41aaaaaa,0xaaaaaefb,0x000df71a,
0x41fb1ff3,0x440664fd,0x7fc00ffc,0xf80ffc01,0x4dffe41f,0x5c1ff999,
0x3fa0006f,0xf509fb01,0x801fe80f,0x2a81effa,0xff13f200,0x9813f605,
0x4fd8007f,0x640ff600,0xfd1fd83f,0x1ff12fcc,0x32017f60,0x3fee004f,
0x01cb8000,0x44007fdc,0x3e6002ff,0x2e3ff307,0x07ff987f,0x3fe60ff3,
0x4007fdc1,0x74002ff8,0x41ffc83f,0x1ffc83fe,0x7fe41ff4,0x37bffa21,
0x7fc42ffe,0x306ffb81,0x3f6205dd,0x6fb80eff,0x201bee00,0xfffffffb,
0x3f7fa07f,0xfc83fee6,0xfffeeeef,0x401ff802,0x43ff01ff,0x3ff02ff8,
0x20006fb8,0xdff884fb,0x2ffccccc,0x5400bf50,0xfffeffff,0xf13f2004,
0x09ff907f,0x20017fc4,0xfb000ffb,0xf70ff207,0x4bf13fc9,0xff500ff8,
0x400df700,0x0280eff8,0xff1003fa,0xffc8501d,0x85ff1001,0xff11fffb,
0x83ff7d49,0x7fdc2ff8,0x077fc41f,0x007ff214,0x3f20efd8,0x077ec1ff,
0xfd83fff9,0x07fff20e,0x1bffffd1,0xd983bfa0,0xffe81fff,0x82ffd407,
0x3ee006fb,0xffffb806,0x2207ffff,0xffedeffe,0x7ffff5c2,0xff001bef,
0xc83fe803,0x41fe61ff,0x37dc1ff9,0x81ff1000,0xfffffffa,0x5fb05fff,
0xfffc9800,0x3a001cef,0x8977dc3f,0x6404fefc,0x3e2001ff,0x7ec280ef,
0x7c47f903,0x7cc3fa0f,0x6403fe24,0x2ffa805f,0x3bffea00,0xdf107fee,
0x3bffea00,0x7f447fee,0x0fedcdef,0x7feeffec,0x3ff21fed,0x07f9efee,
0x3ff77ff6,0xffa81fed,0x447feeef,0xedcdeffe,0x6fffcc0f,0x4c1fdcfe,
0xdcfedfff,0x6fffcc1f,0x441fdcfe,0xf98009ef,0xefffeeff,0x3fffc0ff,
0x5c0ffcc0,0x1bee006f,0x807f7000,0x0dffffe8,0x0037d4c0,0x3f600ffc,
0x87fff20e,0x7fdc2ff8,0x0037dc1f,0xbfb0ff20,0xf9555555,0x000ff10f,
0x880027e4,0x7ffc42ff,0x04fbcffe,0x66f7ff44,0xffa80fed,0x6c7feeef,
0x6c7f903f,0x75f7dc2f,0x643fe21f,0x001ffedd,0x3fdbfffd,0x7fff6440,
0x009f504f,0x7ffff644,0xffffd704,0xfffb10bf,0xf907f67d,0x81fe1bff,
0xb3efffd8,0x3fb2203f,0xfd704fff,0x2a0bffff,0x3fb3ffff,0x27ffff50,
0xfffa81fd,0xfa83fb3f,0x7fec4003,0x6ff88cef,0x4401ffdc,0x06fb80ff,
0x8001bee0,0xef8806f8,0x27dc0009,0x200ffc00,0xcfedfff9,0x6ffec1fd,
0x41fedffd,0x4c0006fb,0x100ffc6f,0x03fc85ff,0x7007fa00,0x1bfaa15d,
0xa9f7ff44,0xffd7004f,0x6440bfff,0x6c4ffffe,0x2a7f903f,0x5fff905f,
0xffb0ff88,0x644003bf,0x001fffff,0x00262006,0x4cc00180,0x80013000,
0x004c0001,0x33000600,0x00062001,0x06200062,0x000075c0,0x98110001,
0xb837ecc0,0x1bee006f,0x804fb800,0xfb0003fa,0xffffd003,0x501fffff,
0x3f67ffff,0x77ffec41,0xffb83fb3,0x07ffffff,0x1fea3fd0,0x1ff13f60,
0x01be2000,0x3ffffff6,0x0004401e,0x00013300,0xc81fec03,0x0004003f,
0x22000026,0x00000009,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x3f600000,0x00ffffff,0xfffffff7,0xffffb8ff,0x4c07ffff,
0x3ae02dff,0x00db0000,0x3ffffffa,0x06200fff,0x5c002600,0xffffffff,
0x367d5007,0x27fb804f,0x260004e9,0xfd95003e,0x0000007b,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x17bdfdd7,0x7ffffdc0,0x7fdc7fff,0x07ffffff,
0x0003eda8,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x026c43d5,0x0b877b66,0x003ff980,0x4c0ffee0,0xea8005ff,
0xfc813621,0xf300620f,0xb000007f,0x01dd103d,0x04d887aa,0x0003ff98,
0xff307ff7,0xff70000b,0x26002007,0x402e1ded,0x813621ea,0x02e1ded9,
0x09999998,0x41ffdc00,0xe8005ff9,0x3a207f26,0xeda802de,0x01eeeeef,
0x95000000,0x1e4c0003,0x09999998,0xeeb89f54,0x000ffc0d,0x76c3ff00,
0x807ba202,0x4ffea5fd,0x5bfd916d,0xff800000,0x4407fee6,0xfddffeff,
0x7f7fcc03,0x1ffb8003,0x002fec40,0x1ffb9bfe,0x3ff7bfa0,0x3fbfe603,
0x7ff54003,0x103ff1ef,0x9bfe01ff,0x3e601ffb,0x5c003fef,0x3f6201ff,
0x3fee0005,0x7ffed401,0xfeff886f,0xff03fddf,0x440ffdcd,0xfddffeff,
0xfffff103,0x7fdc007f,0x017f6201,0x0df9bf90,0x0bbfffe2,0x7ff6ffec,
0x3a201fff,0x7400002f,0xffff500f,0x441fe49f,0x43ffffff,0xfffe9cfb,
0x007fe0ff,0x321ff800,0x81bee06f,0x8bfe65fc,0xffffe9ff,0x07fe442f,
0x3f205fa8,0x1b01be62,0x3013ffa6,0x07fb11df,0x0006fdc0,0x7e400bf7,
0x7641be62,0x01ceffff,0x7fb11df3,0x3bfff600,0x103ff2fe,0x8bf201ff,
0x3be606f9,0x7003fd88,0x3ee001bf,0x0dfb8005,0x777ffec0,0x3a61b07e,
0x8bf204ff,0x4c3606f9,0x2a204ffe,0x001aaaaa,0x2e001bf7,0x3f62005f,
0x2a6201ef,0x77dc2ffe,0x200ffe20,0xc8005ffb,0x5037c40c,0x749ffddd,
0xaaaa880f,0x7f7dc1aa,0x7c9fd31e,0x3e00001f,0x407fe61f,0x4bf703fe,
0x7ffc1ff9,0x54dfb32f,0xf880ffff,0x0000000f,0x4c098800,0x00066001,
0x000004c4,0x3ff9bff0,0x0cc09880,0x8057fd40,0x0ff881ff,0x04c40000,
0x00cc0066,0x20004c40,0xbffb8019,0x00000000,0x00000000,0x88001980,
0x00080009,0x3fa0ffd8,0x9806fb82,0xff8003ff,0x9001fdc1,0x0017e29f,
0x703bfee0,0x000ffcdf,0xfe83ff00,0x300ff984,0xff809883,0x987fcc1f,
0xfc80fe9d,0x00000003,0x00000000,0x00000000,0x003bf204,0x06fc8000,
0x7fc40ffc,0x00000000,0x00000000,0x00bfe000,0x00000000,0x00000000,
0x00000000,0xff1ffc00,0x200df503,0x3ff00018,0x7e400188,0x00001314,
0xff501ff7,0x00000ffc,0x87fb83ff,0x200005fb,0x03ff02ff,0x05f981fd,
0x19bfd930,0x9bfd9300,0xbfd93001,0xfd930019,0xd930019b,0x76c019bf,
0x7303db01,0x5409ffdb,0x00ceffec,0x7fc03fe8,0x200ff881,0x803dfec9,
0x803dfec9,0x803dfec9,0x503dfec9,0x3ae5bfdb,0x03fe20ce,0xdb01ed80,
0xdffd9503,0x7f654019,0x64c00cef,0x65403dfe,0x200ceffe,0x0ceffeca,
0x66ff64c0,0xe93f6000,0x005fb83f,0x01ff8000,0x804fc800,0x23db01ed,
0xf86605fb,0x05bfb71f,0x7ef76dc4,0x217fc41f,0x03db02fe,0x01ff87b6,
0x81fd03ff,0xffc800fe,0x201fffff,0xfffffffc,0x3ffff201,0x3f201fff,
0x01ffffff,0x3ffffff2,0x203ff01f,0x7ffd41ff,0xf980ffff,0x1fffffff,
0x3e017f40,0x00ff881f,0xdffdfff5,0x3bffea03,0xff501eff,0x203dffdf,
0xeffefffa,0x7fffff41,0x266ffffd,0x0ffc007f,0x7fcc1ff8,0x81ffffff,
0xfffffff9,0xdfff501f,0xff303dff,0x03ffffff,0xfffffff3,0x3fff203f,
0xb001ffff,0x50ffdc9f,0x3bb205ff,0x05eeeeee,0x00003ff0,0x3ff009f9,
0x2fdc7fe0,0xffd3ff00,0xff507fff,0x03ffffff,0x03fccbfb,0x87fe03ff,
0x03ff01ff,0x01fe41fd,0xfd317fdc,0x45ff701f,0xfb80ffe9,0x03ffa62f,
0xfe98bfee,0x22ffb80f,0xff80ffe9,0x7d43ff01,0x0bfb10bf,0x3aa21393,
0x017f406f,0x3fe207fe,0x222ff980,0x2ff986fd,0x3e61bf62,0x21bf622f,
0x3f622ff9,0xdff705c6,0x07fa8ff4,0xff80ffc0,0xa884e4c1,0x09c986fe,
0xf30dfd51,0x437ec45f,0xfd5109c9,0x2213930d,0xffb86fea,0x003ffa62,
0x7fcc5ff3,0x203fffff,0xfffffffd,0x03ff007f,0x009f9000,0x47fe03ff,
0x3fe005fb,0x1ff913ff,0xf505ffcc,0x21ff303f,0x07fe04fc,0x03ff0ffc,
0x43fa07fe,0xff8806f9,0xf889fd01,0x889fd01f,0x89fd01ff,0x9fd01ff8,
0xfd01ff88,0x3e03ff09,0x2a0ffa1f,0x3ea000ff,0x7ff776c7,0x3e5eeeee,
0x80ff881f,0x85ff03fd,0x85ff03fd,0x85ff03fd,0x05ff03fd,0x9f717fc4,
0xff001fea,0x8007fe03,0x7d4007fa,0xff03fd87,0x03fd4005,0xff11fea0,
0x3613fa03,0x7f45ffee,0x401cdeca,0xf9999998,0x03ff003f,0x009f9000,
0x47fe03ff,0x3fe005fb,0x3a3fe81f,0x203ff03f,0x403ff3fe,0x43ff01ff,
0x03ff01ff,0x400ff431,0x1bee05fb,0x37dc0bf7,0x6fb817ee,0xdf702fdc,
0x3ee05fb8,0xff01ff86,0xfe81fea3,0xf0ffc002,0xffffffff,0x41ffcfff,
0x3fc40ffd,0x3fc49f90,0x3fc49f90,0x3fc49f90,0xfe809f90,0x3fd57ea1,
0x7c07fe00,0x0ffc001f,0xf887fe00,0x0013f207,0xff8003ff,0xfb817ee1,
0x41cffe86,0x400006f8,0x3fe005fd,0x4fc80001,0xff01ff80,0xf8017ee3,
0x26bf702f,0x407fe07f,0x406faefb,0x43ff01ff,0x03ff01ff,0xf9004fb8,
0x323fcc09,0x91fe604f,0x23fcc09f,0x1fe604fc,0x3fcc09f9,0x1ff80ffc,
0x27ec0bf7,0xfaaaa988,0x00bfa01f,0x7fe41dff,0x557fd42f,0x25fdaaaa,
0xaaaaaffa,0x3fea5fda,0xfdaaaaaa,0x2aabfea5,0x445fdaaa,0xaabfeaa9,
0x00ff55fc,0x3ff01ff8,0x2aaaa620,0x553101ff,0x7d43ff55,0xdaaaaaaf,
0x5553105f,0x26203ff5,0x21ffaaaa,0x1fe604fc,0x7fcc07fa,0x0001999c,
0x7c001df9,0xfc80001f,0xf01ff804,0x8017ee3f,0x2df501ff,0x07fe05fa,
0x01ff7fc4,0x0ffc07fe,0x07fe03ff,0x36006f98,0x83fe203f,0x3fe203fd,
0xf880ff60,0x880ff60f,0x80ff60ff,0x0ffc0ff8,0x09f91ff8,0x7fe42fe4,
0x01ffffff,0xfff00bfa,0xff99ffbf,0x7ffffdc7,0x2e5fffff,0xffffffff,
0x3ffee5ff,0x5fffffff,0x3fffffee,0x3ea5ffff,0xffffffff,0x00ff55ff,
0x3ff01ff8,0xffffff90,0xfff903ff,0x5c3fffff,0xffffffff,0xfffc85ff,
0xc81fffff,0xffffffff,0xf880ff61,0xb00ff40f,0xdfffffff,0x07fea007,
0x0003ff00,0xff009f90,0x7dc7fe03,0x407fe005,0x40bf76fa,0x3ff601ff,
0x80ffc00f,0x407fe1ff,0x47fa01ff,0x7fb00998,0x3f63fcc0,0xfb1fe603,
0x363fcc07,0xb1fe603f,0x43fcc07f,0x23ff01ff,0x17f204fc,0x33337ff9,
0x17f403ff,0x3fff3fe0,0x7d49fd13,0xaaaaaaae,0x2abbea1a,0x21aaaaaa,
0xaaaaaefa,0x3bea1aaa,0xaaaaaaaa,0xd339ff11,0x2133335f,0x7fc007fa,
0xfc83ff01,0xff9999bf,0x4cdffe41,0x3ea1ff99,0xaaaaaaae,0x4dffe41a,
0x641ff999,0xf9999bff,0x980ff61f,0x200fd87f,0xfeedcefb,0x7fc404ff,
0x01ff8003,0x804fc800,0x23ff01ff,0x3fe005fb,0x3eebf701,0xa807fe05,
0x1ff804ff,0x0ffc3ff0,0x9f701ff8,0xfc81fff4,0xf91bea04,0x3237d409,
0x91bea04f,0x237d409f,0x1bea04fc,0x8ffc07fe,0x8ff605fb,0x3ff02ff8,
0x3e017f40,0xf302030f,0x07f9800f,0x2003fcc0,0x3ee007f9,0xf5017f45,
0x01ff800f,0x17fc43ff,0x3fe21ff8,0x7cc3ff02,0x17fc4007,0x3fe21ff8,
0x7e43ff02,0x221bea04,0x403fea01,0x27f407fc,0x001ff800,0xf804fc80,
0x003ff01f,0xfc80ffc0,0x3e60ff74,0x03fea01f,0x7fc07fe0,0xdf100001,
0xa81fefdc,0x87fd00ff,0x7fd00ffa,0xfd00ffa8,0xd00ffa87,0x00ffa87f,
0x07fd07fd,0x3fea3ff9,0x261ff880,0x03ff307f,0x3fe017f4,0x17fc4001,
0x005ff100,0x10017fc4,0x3f2005ff,0xf501ff43,0x83fe800f,0x1fe61ffc,
0xff30ffcc,0xf887fe60,0x1fe6002f,0xff30ffcc,0xfa87fe60,0x007fd00f,
0x7cc09f90,0x00df900f,0x0000ffc0,0x7f4027e4,0x701ffc83,0x40ffc039,
0x1ff31ff8,0x201ffe88,0x7fd005fe,0x5c03ff90,0x31fd801c,0x7407f5bf,
0x07fe40df,0x3f206ff4,0x40dfe80f,0xdfe80ffc,0x7407fe40,0x07fe40df,
0xff9077ec,0x1077f43f,0x2ff88dfb,0xd00fffdc,0x01ff805f,0x001ffc80,
0xc8007ff2,0x3f2001ff,0x25fa801f,0xf501effd,0x0efd800f,0xf887fff2,
0x0fffdc2f,0xffb85ff1,0x00ffe41f,0x7dc2ff88,0x0bfe21ff,0xfe83fff7,
0x207fe40d,0xffb02fe8,0x541bf201,0x3e0000ff,0xfc80001f,0x20efd804,
0xfd01fffc,0x220ffc01,0x86ff45fd,0x881fffe9,0xfb000efd,0x0fffe41d,
0xfb801fd0,0x0fea3fa4,0xfddfff98,0xfff302ff,0x205fffbb,0xffddfff9,
0xbfff302f,0x2605fffb,0xfffddfff,0xdbfff302,0x7cc3fb9f,0x0fffddff,
0xffddffd8,0x3fa01fed,0x000ffc02,0x66f7ff44,0x7f440fed,0x0fedcdef,
0x66f7ff44,0x7f440fed,0x0fedcdef,0x3abfb7fe,0xf52ecdff,0xfff9800f,
0x41fdcfed,0xdffddffd,0x6ffec1fe,0x41fedffd,0xdcdeffe8,0x6ffec0fe,
0x41fedffd,0xdffddffd,0x7ffcc1fe,0xa82fffdd,0xdff505ff,0x3ffd977b,
0x0005ff30,0x80001ff8,0xff9804fc,0x1fdcfedf,0x7fc06f88,0x0effdcef,
0x7ff7ffd4,0xfb931fe9,0x7cc003ff,0xfdcfedff,0x880df101,0xffff30ff,
0x7ec409ff,0x4400dfff,0x00dffffd,0x6ffffec4,0x7ffec400,0x7ec400df,
0x5400dfff,0x3fb3ffff,0xcffffd88,0xdfffb100,0xfe807f67,0x000ffc02,
0xfffffd70,0x7fff5c0b,0x3fae05ff,0x2e05ffff,0x45fffffe,0xfb12efea,
0x1fea3fff,0x3fffea00,0xfd883fb3,0x83fb3eff,0xb3efffd8,0x3ffae03f,
0xfd885fff,0x83fb3eff,0xb3efffd8,0xfffb103f,0x3fe201bf,0x3fff6a03,
0xfd00cfff,0xdddddddf,0xfffff003,0x3207ffff,0xeefffeee,0xffff502e,
0x3ea07f67,0x7ffed404,0x3fea03ef,0x263fd1df,0x8000dfff,0xfb3ffffa,
0xb013ea03,0x6e66445f,0x011002ef,0x40002200,0x01100008,0x20002200,
0x00880018,0x740004c0,0x000cc02f,0x80013300,0x4cc00099,0x004cc000,
0x7d409802,0x00620007,0x26000260,0x02660000,0x4c0004c0,0x00110000,
0x4cc40022,0xfffe8009,0x02ffffff,0xfffffff8,0xfffd03ff,0x05ffffff,
0x26200188,0x20004000,0x00033000,0x31000620,0x202fd401,0x000003fa,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x645b6000,0x4cc02dfe,
0x88009999,0x2fec01ee,0xbf507ff5,0x70017ee1,0x937407ff,0x76dc403f,
0x2601ecce,0x5cdb03ff,0x00002dfd,0x6666ee54,0x0dfa83cc,0xed980bf7,
0x3e602e1d,0x3b2a005f,0x4000ceff,0xbf503ffb,0x70017ee1,0x7ffd47ff,
0x0ffc04ff,0x2602ca80,0xfffff13c,0x4ccc000d,0x37400999,0x764c03f9,
0xfb8003df,0x37b6603f,0xff3002e1,0x443d5007,0x6e5c404d,0xb951001b,
0x3b2e2059,0xcc980bce,0x01cccccc,0x222cba98,0xbf500ffc,0x500dffd8,
0x7f4ffcbf,0xf102ffff,0x007fffff,0x7e40bff7,0xa80bfe65,0x4005fdef,
0x7e401ffb,0x3ea06fcd,0x1fffffff,0x07fdff30,0xffffb1ff,0x0bfa207f,
0xfffffb10,0x2a0dffff,0x4405fdef,0xfddffeff,0x00bfb103,0xfffffff3,
0x3fee003f,0x7ef7d401,0x0ffdc005,0x13ffbbaa,0x4cd7fccc,0xa813f201,
0xfdddd16f,0x3fe2000d,0x6403ffff,0x2a06fcdf,0x1effefff,0x403ff700,
0xddffeff8,0x3bfe603f,0x737fc03f,0x3fee03ff,0x200dffff,0x4ffffff9,
0xffffffb8,0x7fffdc3f,0x7103ffff,0x2abfffff,0xf880ffff,0x27ed540f,
0xfff07fc4,0x41bf665f,0x1aaaaaa8,0x703ffa80,0x00ffccbf,0x2002ffd4,
0xd8800dfb,0xff501eff,0x40ffcc17,0x3fd88ef9,0xc89ff7fc,0x6ffb80ff,
0x64577f40,0x200999df,0x1b005ffa,0x2013ffa6,0x4e4c05fb,0x00dfd510,
0x2a001bf7,0x7dc005ff,0x04fc800d,0xffffffff,0xa813f203,0x00df506f,
0x2aaaaa20,0x7fec401a,0x45ff301e,0xfb806fd8,0xd30d800d,0x77cc09ff,
0x3203fd88,0x6c1be62f,0x3bf261df,0x89cff980,0x4dd44ffa,0x21ffdb99,
0xaaaaadfb,0xcffe881a,0xd3b31aac,0x107f901f,0x7f909f93,0x7cc1fff8,
0x3000000f,0x2620cc03,0x00062000,0x00400066,0x0ffc0ffa,0xf06604c4,
0x07fd03ff,0x7d409ff5,0x0017ee0e,0x00000031,0x50000988,0x003300ff,
0x33000310,0xc827e400,0x0cccdffc,0x7d409f90,0x000df506,0x40080000,
0x05ff03fd,0x00000198,0x00cc0988,0x40bf5000,0x84fd85fb,0xf8800ff9,
0x0013ee3f,0x3a001bfd,0xb82fcc0f,0x2fcc1fff,0x1ff817fc,0x00000000,
0x00000000,0x3fcc0000,0x80003ff0,0x0bf702ff,0x85fd00a6,0x000005fb,
0x00000000,0x00003ff0,0x80000000,0x3fe044fc,0x409f9001,0x0df506fa,
0x00000000,0x9f903fc4,0x00000000,0xe8000000,0x742aea0f,0x403fe21f,
0x9fb004fd,0xf50027dc,0x40fe800d,0xf75100fe,0xff80fe8f,0x2603ff01,
0x000cdfec,0xfec980db,0xec9800cd,0x2600deff,0x80deffec,0x23db01ed,
0x07fe05fa,0x6f7ff64c,0x7d407fe0,0x1ff10006,0x75405fb8,0x01bdd713,
0x6ff645b6,0xddddd502,0x55531007,0xeea83ff5,0xb6c03eee,0xb02dfec8,
0x0b7fb22d,0x07ee9f90,0x4054c3ff,0x1bea04fc,0x540037d4,0x403eeeee,
0x03eeeeea,0x55555ff5,0x3ea8bfb5,0x201bdd71,0x03eeeeea,0x1f777754,
0x3bbbbaa0,0x3a29f503,0x49f55fff,0xdff505fb,0xfb87fa00,0x00bfa004,
0x1fe41fd0,0x643fea10,0x203ff03f,0xfffc81ff,0xe801ffff,0x3ffff207,
0x3ee01fff,0x01fffeff,0xfffdfff7,0x3e03ff03,0x7c0bf71f,0xefffb81f,
0x07fe1fff,0xeeeab7d4,0x0df303ee,0xcfb80bf7,0x0fffffe9,0xfffe9ff8,
0xfffa82ff,0x7fe404ff,0x41ffffff,0x04fffffa,0x7fff4ffc,0xe9ff82ff,
0x202fffff,0x40fffefc,0xffffa9ff,0xa813f20d,0x00df506f,0x9fffff50,
0xfffffa80,0xfffff704,0xb8bfffff,0xffffe9cf,0xffffa80f,0x7ffd404f,
0x7fd404ff,0x5f704fff,0xf8a277f2,0x3f213f26,0x6fa807ff,0xff0027dc,
0x3fa004c1,0xfe80df30,0x40df33ff,0x83ff01ff,0x3fa62ffb,0x407fc00f,
0x3fa62ffb,0x82ff980f,0x82ff9809,0xf01ff809,0xf817f23f,0x417fcc1f,
0x5c07fe09,0xfffff55f,0x2e17ea09,0x5c2cccef,0xfd31efef,0x25ffff09,
0xfc806fd9,0x26fff204,0x401ff999,0x7ffc04fc,0xf0dfb32f,0x3f665fff,
0x2ffff606,0xcffcff80,0x13f24ffe,0xdf506fa8,0x09f90000,0xf504fc80,
0x5555555d,0xefefb835,0x9009fd31,0x4fc8009f,0xc827e400,0x3a01ff1f,
0xfe88ff67,0xbaa87fbf,0x7fdc0dfd,0xf982deff,0x4ffffebe,0x00ff4310,
0x1fe82aaa,0x7fc07fe0,0x7407fe21,0x1ff9304f,0xfd01ff88,0x800bf709,
0x7fc005fb,0x3ee3ff01,0xb83ff305,0x03ff005f,0x27e413f2,0xffb85fb8,
0x7fdc4fff,0x7c37dc0e,0x07fcc1ff,0x7c413f20,0x803ff02f,0x7ffc04fc,
0x3e07fcc1,0x07fcc1ff,0x8037ffee,0x3ee0dfff,0xfa813f27,0xb30df506,
0x09f9001b,0xf304fc80,0xdff7000f,0xc806fb81,0x27e4004f,0x6c13f200,
0x3606f88f,0x3ea5fd0f,0x40ff88ef,0x41cffffe,0xffffeeea,0x3fffea0e,
0x406ffdcd,0xf70004fb,0xf01ff809,0x702fdc3f,0xfffe98df,0x702fdc0f,
0x03ff50df,0x000ffd40,0x47fe03ff,0x7f440ff9,0x00ffd41f,0x7fc40ffc,
0x2e09f902,0xaaefb85f,0x407fdc1a,0x02ff87fa,0x4fc803ff,0x3e60ff30,
0x027e401f,0x0ffc0bfe,0x8ffc0bfe,0x04fefff8,0x7fc437fc,0x7d409f90,
0xfd0df506,0x09f900df,0xf104fc80,0xffb8005f,0xc807fa80,0x27e4004f,
0x6c13f200,0x3a07f88f,0x3ff2bf67,0x5503fe24,0x405ffd75,0x2a5ffb98,
0x3ff982ff,0x2000df30,0x1ff806f9,0x27e43ff0,0xdfe8ff30,0x9813f200,
0x7bffd07f,0x7bffd001,0xf01ff801,0xd327f43f,0xffd03fff,0x07fe017b,
0x7e40bfb1,0xf70df704,0x205fb80b,0xf01ff819,0x04fc803f,0xffb85ff1,
0x027e401f,0x0ffc07fe,0x8ffc07fe,0x04fc8cf9,0x1ff80ffc,0x37d409f9,
0xfff86fa8,0x004fc807,0xff9027e4,0x02fdc003,0x09f90033,0x4004fc80,
0x23f904fc,0x6cdf01ff,0x7cc2ffff,0x01ff7007,0x3ea1ff50,0x741bf206,
0x2003531f,0x813311fe,0x43ff01ff,0x3fe203fd,0xd801ff30,0x03fe203f,
0x37ffff22,0x3fff2201,0x03ff01df,0xeffa87fe,0x81ff9ffd,0x1dffffc8,
0x7ee77ffc,0x13f200ef,0x2fdc37d4,0x20017ee0,0x03ff01ff,0x3f604fc8,
0xfedffddf,0x2027e401,0x83ff01ff,0x23ff01ff,0xf013f208,0x647fe03f,
0x41bea04f,0x4ffd86fa,0x4004fc80,0x3fa204fc,0x0fedcdef,0x40002fdc,
0x7e4004fc,0x827e4004,0xbdff73fb,0xffc97e2b,0x006fa80e,0x3e200bfe,
0x540ff31f,0xf94fb87f,0x4fb80dff,0x3ff0fffa,0x3fd87fe0,0x7fa9fe60,
0x2603fd80,0x7edc407f,0x6dc402ff,0x1ff82fff,0xffb83ff0,0x403ff1df,
0x22fffdb8,0x3effffff,0xf104fc80,0x405fb83f,0xff8005fb,0xc803ff01,
0x3ff6204f,0x803fb3ef,0x0ffc04fc,0x0ffc1ff8,0x9f901ff8,0xff01ff80,
0xfa813f23,0x2a0df506,0x009f9002,0xeb804fc8,0xb85fffff,0xfc80005f,
0x027e4004,0x7c413f20,0x64f7faa6,0xc81fee3f,0x0bfa004f,0x7c43fe20,
0x88df500f,0x3f66ea6f,0x7dcdf102,0x3e2003fd,0xa813f20f,0x007fe66f,
0x37d409f9,0x00ffb100,0x7fc3fec4,0x0203ff01,0x6c4007fe,0x0627fe7f,
0x6c09f900,0x202fdc4f,0xff8005fb,0xc803ff01,0x4c13004f,0x04fc805f,
0x1ff80ffc,0x1ff80ffc,0xff809f90,0x3f23ff01,0x5417f604,0xfc80006f,
0x027e4004,0x5c03fe60,0xfc80005f,0x027e4004,0xfc813f20,0xf11be202,
0x03ff105f,0x2003fe60,0x81ff47fb,0x80fec4fc,0x23fb02fc,0x003fadf9,
0x1ff51fea,0xbfd0ffa0,0xd00ffa80,0xff98007f,0x03fe6000,0x3ff907fd,
0x000ffc00,0x07fe1ff3,0x5027e400,0x02fdc7ff,0x3e0017ee,0x803ff01f,
0xfd0004fc,0x809f9001,0x83ff01ff,0x03ff01ff,0x3ff013f2,0x27e47fe0,
0xa81ffcc1,0xfc80006f,0x027e4004,0xfb80bf20,0x4fc80005,0x0027e400,
0xff8813f2,0xc82fe983,0x1bfa20ef,0x4027f4c0,0x7fdc2ffb,0xf70ffd41,
0x5c1bee09,0x3ea3fa4f,0x0bfb1003,0xffc81bfd,0x00effd40,0xffc81bfd,
0x1ff20080,0xd87fc802,0x3fff20ef,0x107fe001,0x3ff3fe40,0x013f2000,
0xffdbfff9,0x5fb8bddd,0xf01ff800,0x04fc803f,0x9006f980,0x01ff809f,
0x01ff83ff,0x13f203ff,0x3fe03ff0,0x777c9f91,0x1bea06ff,0x013f2000,
0xf8009f90,0x017ee00f,0x0013f200,0xfc8009f9,0x677f4c04,0xb102ffdb,
0x1dffbbff,0xfeedeee8,0x76f76c5f,0xffd03fff,0x447ffd9b,0x05fd80ff,
0x3fe61ff1,0x6404ffff,0xff980fff,0x02fffddf,0x85dffff5,0xffddfff9,
0x9bdfb02f,0xfb05fffb,0x5fffb9bd,0xfdbfff30,0x7c003fb9,0x66f7ec1f,
0x3fe2fffd,0x09f90001,0xfffffb50,0x5fb8dfff,0xf01ff800,0xfeeec83f,
0x002eeeff,0xeec87bff,0x2eeefffe,0x1ff80ffc,0x1ff80ffc,0xdfffddd9,
0x01ff85dd,0xe93f23ff,0x3ae0cfff,0xeeeffeee,0xfeeec803,0x642eeeff,
0xeefffeee,0x677e402e,0x8005fb80,0xefffeeec,0x777642ee,0x42eeefff,
0xefffeeec,0xfec882ee,0xfc801def,0xfe80ceff,0xd81dffff,0x00cfffff,
0x0effffe4,0x3ff60bf6,0x117ec2cc,0x05dfb999,0x2200efe8,0x00dffffd,
0x417ff5c4,0x0dffffd8,0x3fffff20,0xfff901df,0x5403bfff,0x3fb3ffff,
0x320ffc00,0x1dffffff,0xec800ffc,0xeeefffee,0xb8004c02,0x1ff8005f,
0xffe83ff0,0x2fffffff,0xe8bd9300,0xffffffff,0xf80ffc2f,0xf80ffc1f,
0xfffffd1f,0xff85ffff,0x1003ff01,0x3fffff20,0xe804ffff,0xffffffff,
0x7ffff42f,0x402fffff,0xfb80edb8,0xfffe8005,0x42ffffff,0xfffffffe,
0x7fff42ff,0x02ffffff,0x08800044,0x80099980,0x31000198,0x7f417ea0,
0x17ea5fff,0x13007f50,0x00008800,0x00110026,0x20019988,0x44001998,
0x01980001,0x19806662,0x3ffffa00,0x002fffff,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x5e76e4c0,0x205dd100,0x0bf70dfa,0x2cddca88,0x3000ee60,0xcb880077,
0xcb8802cd,0x3ea1cdee,0x2004ffff,0x0acedca8,0x99999993,0x980b2a19,
0x0ffe604c,0x36003fd8,0x3e3db01e,0xf700001f,0x66665c7f,0x0ccccccc,
0x99999997,0x00019999,0x6401cc88,0x33b2e01c,0x200f260b,0x0332a2c8,
0x99991e64,0x32201579,0x26072e04,0x00deffec,0x4001e64c,0xdba804ca,
0x654000cd,0xcccca83c,0x82cccccc,0x001cddb9,0x6666665c,0x57999992,
0x40599103,0x33221cc8,0x3001abcc,0x6c7bddb9,0x2fffffff,0x2a07ffd8,
0x5c05fdef,0x4fffffff,0xc8009f90,0x3fea004f,0x900effff,0x9fffffff,
0x27ff7754,0xfffffb80,0xffff75ff,0x3f21ffff,0x4c1fea04,0xfb03feff,
0x80ffc007,0x003ff1ff,0xe83ff700,0xffffffff,0x99bd1fff,0xf9999999,
0xe880b621,0xf5037e41,0xfffd301f,0x17ea3fff,0xffc93ea0,0x3e6ff983,
0xcfffffff,0xfb03fcc0,0xfefffb87,0x7fec01ff,0xffd5000f,0x7ffec40f,
0xf1003fff,0xfff70bff,0xbfffffff,0xffffffc8,0xffff3003,0x3ffe9fff,
0x40dfffff,0xdfb00ffc,0xffffff98,0x3ff201ef,0xff97ffff,0x1ffd5117,
0x5407ffd8,0x7fe405ff,0x04dba9bd,0xfc8009f9,0x59ff7004,0xc81dff73,
0xb999acff,0x1013f202,0x5537bffd,0x2aaaa6bb,0x9f90ffba,0x7cc3fd40,
0xd83fd88e,0x07fe003f,0x01ff8ffc,0x406fdc00,0xcffaaaaa,0x23d0aaaa,
0x7e43e018,0x88df900f,0x2ff883ff,0x3263bfd0,0x500df31f,0x437fe49f,
0x2bfe7ffc,0x45ffeb99,0x8ff607f9,0x00982ff9,0x00bfffe2,0x0fffffd3,
0x6ccd6ff4,0xffd801ff,0xaaaa985f,0x24feaaaa,0xff512efc,0x9fdf9005,
0x33fe1333,0x45ffcaaa,0xff984ff8,0x5557fcc1,0xfc83ffec,0x7fd260bf,
0x441ff983,0x018802ed,0x0101ffd4,0xf90013f2,0x213fe009,0x3fe23ff9,
0x09f90003,0x0202ffc8,0x3f21ff10,0x221fea04,0x7ec0cc09,0x407fe003,
0x003ff1ff,0x7c001980,0x7e47a01f,0xfd07c1df,0xff559959,0xb81ff703,
0x00df706f,0x7f700df3,0xf10fefec,0x40ffcffb,0xffd73ffa,0xffdddddd,
0x0017eebd,0x02fe6fd4,0xff75dff1,0x4fe81c40,0x2fdf7d40,0x98ffc400,
0x06fa80ff,0x81fe77c4,0x0ffa81ff,0x3fa0ffd4,0xf907f984,0x017fcc1f,
0x0ffc07fe,0x7f400000,0xfddd1004,0x3dddddff,0x3fffbba2,0x2e1eeeee,
0xa9bee06f,0xf90000ff,0x017fc409,0x643fe200,0x01fea04f,0x800ff600,
0x23ff01ff,0x000001ff,0x3a01ff80,0xf8bf6621,0x3ffffe20,0x3fa02fff,
0x6407fe24,0x07f8804f,0x2bf63fb8,0x9febea4f,0x2bfd01ff,0xfffffffc,
0xf56fffff,0x7fb0003f,0x1e401ff3,0x32000ff7,0x27fe206f,0xfc8005fb,
0xff817ee5,0x3f2fee01,0xf103ff03,0x5cdfb03f,0x07f980ef,0x05fc93fa,
0x7fa84fd8,0xeeeec800,0x3ea5eeee,0xfff3000f,0xffffffff,0x3ffffe63,
0x21ffffff,0x3fe203fe,0x0005ff31,0x6fc813f2,0x0ff88000,0xbfd409f9,
0x4e9803ea,0x9db107fb,0x1ff80ffc,0xbfd913ff,0x3bbbb205,0x7c05eeee,
0x6c07a01f,0x7ffb03e7,0x4c03ffd7,0x409fb0ff,0x7f8803fd,0x3fa2fc80,
0x7f5f66f8,0x3ee03ff0,0xfd81fe66,0x05efff43,0xff87fc40,0x01fee002,
0xf9037dc0,0x10017ee9,0x027ec3ff,0x47f405fb,0x03ff03fc,0x3fe20ff3,
0xf302ff8a,0xfb3fdc0f,0x1bff5007,0x2000ffea,0xfffffffd,0x001bee7f,
0x339fb333,0xd9998333,0x419999cf,0x17fc01ff,0x90005ffd,0x01fec09f,
0xc87fc400,0x55fea04f,0xb4fb805f,0x0efe887f,0x8ffc07fe,0xffffeaff,
0xffffd82f,0x7c07ffff,0x5c07a01f,0x7fcc1f0f,0x36027f41,0x200ff9df,
0x8ff003fd,0xe8bf20fe,0x29f13f97,0x203ff0fe,0x81fe65fc,0x7fe443fd,
0x3ea01dff,0xb8017f26,0xbf90007f,0x5fb9be60,0x322fdc00,0x40ff605f,
0x207f95f9,0x05fd81ff,0x817f7fee,0x3fe607f9,0x2a005ff0,0x02ffefff,
0x33333100,0x2fe47ff3,0x009f9000,0x7c404fc8,0x31ff400f,0x0017dfff,
0x2ff813f2,0x004cccc4,0x27e43fe2,0x1be6ff50,0x1fecff20,0xff81dfd1,
0x3fe3ff01,0x0dfb32ff,0xf3333331,0xf999887f,0x0f4099af,0x5c1f3744,
0x406fc86f,0x102feff8,0x33339fd3,0x3e21ff03,0x7e87f22f,0x3a3f79f3,
0xd103ff0f,0x4cffcc7f,0x03fe9999,0x05fffb71,0x0ffa8ff6,0x000ff700,
0x3fa03ff1,0x88017ee1,0x07fd41ff,0x5f904fc8,0x42aab7f2,0xfecbacff,
0x0fffe803,0x799ffb90,0x5fd1ff88,0x7fffd400,0x6c00000d,0x0027ec5f,
0xc8009f90,0x07fcc04f,0xf910ff60,0xc8019fff,0x83ff104f,0x406ffffd,
0x09f90ff8,0x47f8bfd4,0xfd97ec4b,0xf01dfd13,0x7c7fe03f,0x07fcc1ff,
0xfa85fd80,0x4fffffff,0x3dfd90f4,0x50bf907c,0xdff700df,0x7fffff40,
0x0fe87fff,0x0fecbff7,0xd377f4ff,0xb987fe3f,0x7ffcc6fe,0x3fffffff,
0x887fd880,0x017fc1ff,0xd8007fb8,0xb89f905f,0x1bee005f,0x5ccd77f4,
0x7f884ffe,0x4bfffff2,0xffffffff,0x04ffa803,0x1bfffffe,0x027ecbfe,
0xffddffa8,0x02ff981e,0xfd81df90,0x13f20004,0x3bfb32a0,0x3e62cccc,
0x81ff400f,0x01ffffb8,0x7fc413f2,0x37ee65c1,0x7e43fe20,0xff9fea04,
0x1fe87fe0,0x0bfd17fb,0x7fe41ff4,0x3fe05ff1,0x80efc801,0xcdffccc9,
0x3db0f42c,0x437dc1f0,0x333105fb,0xb83337ff,0xccccdffc,0xdfb0fe84,
0x7f83f61f,0x1fd8fff2,0xffffddff,0xeeff981d,0x03ffeeee,0xfa81ff30,
0x7005fd86,0xffc800ff,0x5c0ff980,0x5ff1005f,0x3ffffa60,0xfb83feff,
0x2aab7f24,0xb7559ff0,0xffe80dff,0x5ff7500f,0x71ff8855,0xffb801ff,
0x903ffe62,0xff500fff,0x000bf903,0x7e4027e4,0xffffffff,0xd007fe23,
0xfff5005f,0xf813f201,0x01bea02f,0x13f21ff1,0x47f67fa8,0x43fe4ffa,
0x405fecfd,0x3ff20efd,0x3e03ff1f,0x0ffd401f,0x3a01ff80,0x507c1321,
0x04fd81ff,0xfffffffd,0x07fb03ff,0x33e27f60,0x7c1fd3fc,0xfd83fe67,
0xbdfffff2,0xd81fe605,0x6fc8023f,0x7fa84fd8,0x400ff700,0x5fd01ffc,
0x2e00bf70,0xbcba806f,0x3fd05fb2,0x1ff81fe4,0xf703ff98,0x7cc0bfbd,
0x447fe607,0xff280eff,0xa87ff105,0x3e201fff,0x00df703f,0x44027e40,
0x999cfd99,0x1017fc09,0x3e2003ff,0x409f902f,0x1bea03fe,0x3f21ff10,
0xfc9bea04,0x3fcfdf92,0x807ffbfb,0xcfedfff9,0x203ff1fd,0x3fe201ff,
0x807fe003,0x07c0661e,0x3f22bbfe,0xf555500f,0xb015559f,0x2bf2007f,
0xfd6f9afa,0xb0ee3fc4,0x8007fe5f,0x8ff607f9,0xffdcdefd,0x66ffc42f,
0x02ffcccc,0xf9007fb8,0x33fea03f,0xcffdcccc,0x00bfe02c,0x7cc1ff80,
0x03fdaaaf,0x17f203ff,0x3fe6bfe6,0x540ff303,0x77ffcc7f,0x07f9ffee,
0x3ff617f6,0xa813fa01,0xf90002ff,0x04fc8009,0x3ea05fe8,0x827ec007,
0x1ff204fc,0x7d406fa8,0xfc817ee7,0x66fcfee5,0x3f66f8af,0x5403ffab,
0x3fb3ffff,0x0ffc07fe,0xf8009fd0,0x1987a01f,0x7ff441f0,0x001fffff,
0x7fb003ff,0x9f6bf200,0x3e27f8fe,0xff2fd806,0x03fcc003,0x7ffe47fb,
0xfa81dfff,0xffffffff,0x07fb805f,0x2e01ffc8,0xffffffff,0xf704ffff,
0x2fd4000d,0x7fffffec,0x203ff03f,0x25fe85fc,0x7f980ffc,0x32617fa0,
0xfacfffff,0x2e13f607,0x01bf207f,0x20003bfa,0x7dc006fb,0x00ffa806,
0xfe8007fd,0x4409f902,0x0df503ff,0x1fea6fc8,0x33ea3ff8,0xf9df9af9,
0x7fdcff64,0x3e618802,0x7fc07fe5,0x000df901,0xf0f403ff,0xdfd83e0f,
0x0ffccedc,0xdffcccb8,0x3fd80ccc,0x4bf7f700,0x3e66fbfb,0xff3fc806,
0x03fcc003,0xff3107fb,0x556fec03,0x07fcaaaa,0x7e407fb8,0x5554401f,
0xaefdaaaa,0x005ff01a,0xf107fe60,0x7fb5555f,0x3e207fe0,0x107fdc4f,
0x0ff30bfd,0xfc807fee,0x213fe20c,0x7f442ffa,0x001ff504,0x5503dff3,
0x800bfea0,0xff802ffa,0x31ff621e,0x03ff2203,0x3ee027e4,0xcb7d40df,
0x3e1ffd42,0x20ffb84f,0xfd0fcdf9,0x91fec7f7,0xfe8003ff,0x7fc07fe0,
0x000ffa81,0x87a01ff8,0x3ee1f03b,0xd0bfd00f,0xffffffff,0x007fb03f,
0xf98bfbee,0x01be66fe,0x00ffcff2,0x7ec0ff30,0xf80df103,0x0bfe201f,
0x7e40ff70,0x999999af,0x80bf7000,0x4c4006fb,0x4fb84ffc,0x3ff03fc8,
0x107fed44,0x5ff509ff,0x36627f98,0x0ff404ff,0x76efffdc,0x3fb2a4ff,
0x005ff306,0x7f7fffd4,0x3ffa04ff,0x3a01fedf,0x41fedfff,0xffeeffe9,
0x777fe41e,0x202fffee,0xffc804fc,0xb6ffeeff,0x0dfffdff,0xfdbbfff5,
0x5fef885f,0xfd8bfbf2,0x800ffec3,0x80ffc6f9,0x17fcc1ff,0x201ff800,
0x999999ae,0x7d50f999,0x4c41fcc0,0x199aff99,0x7777ff64,0x3ea3eeee,
0x2fff40ff,0x7f900df3,0xf98007fe,0x540ff607,0x01fea04f,0xfffb13f6,
0x29ffffff,0xfffffff8,0xf7005fff,0x803ff80b,0x2efffffd,0xdf903fd0,
0x3ffe9ddd,0x41ffffff,0x3ff606fd,0x3ffffe60,0x7c403fff,0x3fffaa07,
0x1fff42ef,0xddddffd0,0xdb103ddd,0x4039dfff,0x1fffffc8,0x3ffff220,
0xfffd881f,0xffeb80df,0x641cffff,0xeefffeee,0xfffb302e,0x3f665bff,
0x36604eff,0xf01dffff,0x7ffcc5ff,0x3fa0ff61,0x9bfd000f,0x0ffc07fe,
0x3bbbbffa,0x3fe01eee,0x3ffffa01,0x0fffffff,0x3ff00000,0x7fffff40,
0x2a4fffff,0x5ffb85ff,0x3f201bea,0x4c003ff4,0x40ff607f,0x13f601eb,
0xffb1fee0,0x9fffffff,0x3fffffe2,0x7005ffff,0x03fdc0bf,0x03cdefd8,
0x7fe41bea,0xffff5fff,0xff507bdf,0x327fcc05,0x17bdffff,0x2007d300,
0x20026019,0xfffffffe,0x001802ff,0x88001310,0x00110009,0x3fa00ccc,
0xffffffff,0x40098802,0x00440009,0x3fa07fec,0x220ff60f,0xc9800efe,
0x3e03ff5e,0x7ffff41f,0x002fffff,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x97000000,0x99999999,0x640072e0,
0x5479700c,0x0cc8003c,0x79999100,0x00664035,0x32602ca8,0x99999933,
0x0b326999,0xccc99e44,0x2ccccccc,0x99300797,0x2f3332e1,0x4195000a,
0x6664c1c9,0x974ccccc,0x21991005,0x1abcccca,0x333332e0,0x00cccccc,
0x2a000000,0x00ea000a,0xea86f6cc,0x3fb2604f,0x3b2600cd,0xca80deff,
0x200ceffe,0xb3deedc9,0x207b603d,0x503dfec9,0x3ae5bfdb,0xc80000ce,
0x44ed882e,0xbd700eeb,0x3bbbbaa1,0xddddd903,0x8b6cbddd,0xa6c2dfec,
0x19d70cfb,0x3a202ed8,0x3fffa00e,0x80ffffff,0x3ff003fd,0x7dc1ff70,
0x01ff8005,0xffffff30,0x03ff03df,0xfa813f20,0xffffff76,0x1bfeefff,
0xfffaafcc,0x5fffffff,0xfe805ff5,0x3fffffa5,0x1fc803ff,0xfff50bee,
0x32ffffff,0x26fb807f,0xfffffffc,0xffffe81e,0x1fffffff,0x5400012e,
0x800ff405,0x7cc04ffa,0xfff9efff,0xffffc85f,0xffb81fff,0x4c1fffef,
0xffffffff,0xfffffc81,0x3e03ff7f,0x77ffd41f,0x7ff41eff,0xffffdfff,
0xb00ffc06,0x0efe887f,0x7cc2ff44,0x3fffea2f,0xffffb04f,0x7fcfffff,
0x2fffffe9,0x2fffebba,0x7e44fffb,0x501bee06,0x559ff555,0x400ff605,
0x0ffd41ff,0x3e0017ee,0x5ff3001f,0x87ffd955,0x64009aff,0x5dbea04f,
0xaaaaaaef,0x305fff72,0x2aaaa2bf,0x23ffbaaa,0x3fea06fe,0x32ab3fa0,
0x7ec02ffe,0xff507f20,0x25555555,0x7f401ff9,0x2aab7f23,0x5542fffc,
0xaacffaaa,0x1bff10aa,0x17fe4000,0x2e003fd0,0x97ec05ff,0x3fd2fffc,
0xfd317fdc,0x417fcc1f,0x884e4c09,0x7fe46fea,0x0ffd260b,0x3fe61ff8,
0x171bf622,0x3fd37fdc,0xfb00ffc0,0x8077f447,0x27f43ff9,0x4c413f20,
0x3ff99999,0x6ccbfffe,0x7cfffa6f,0xf98df3fe,0x007fd00f,0xfd801ff8,
0x443ff003,0x05fb82ff,0x3001ff80,0x83ff20ff,0xceffffff,0xf5027e40,
0x2e01beed,0x5f986fef,0xf98dfb00,0xe87fd02f,0x406fe82f,0x2a07ec7e,
0x09fd006f,0x9f90ffc4,0x801ff910,0x7f4401ff,0xffd8000e,0x000ff402,
0x3fc401b9,0xa7dcbff1,0x9fd01ff8,0x80002fdc,0x0bfe67fa,0x3fe03ff0,
0x7fc0ff61,0xb8bfe202,0x807fe04f,0x1dfd13fd,0xf90ffb80,0x009f900d,
0x7ffc5fd8,0xfe87fcc1,0x0fe9bfa6,0x7fcc1ff4,0x00ffc000,0x01d31fec,
0x827f43ff,0xff8005fb,0x40ff3001,0x3bbfe4fe,0x322fffee,0x5dbea04f,
0xecfb806f,0x402fcc2f,0x6fd80ffa,0x7f40ffb8,0xaa87fb82,0xfeaaaffa,
0x00df51ab,0x6fb81bf2,0x9fd027e4,0xb001ff80,0x3a2003ff,0x1fe800ef,
0x2fcc0000,0x75f993fe,0x537dc0bf,0x200003ff,0x00bf91ff,0x47fe03ff,
0x13f207f8,0x2fd43fd0,0x7ec03ff0,0x2005fe8b,0x00ff9efd,0x32004fc8,
0x817fc0ef,0x745fd1ff,0xf703fa1f,0x000bf90d,0x7fb003ff,0xff01ffd3,
0xfb817f23,0x01ff8005,0x7dc0ff30,0xfb107fe7,0xa813f23f,0x700df76f,
0xf98df79f,0x81ffc405,0x17fc3ff8,0x3fd417f4,0x7ffffff4,0xf55fffff,
0x07fe600d,0x13f21fec,0x7fc07fb8,0x0fff2001,0x501bff30,0x9bff9999,
0xa8000999,0x556ff44f,0x409f95fb,0x6fff47f9,0xaa98800b,0x7fb1ffaa,
0x3e03ff00,0x555ff51f,0x88bfb555,0xaabfeaa9,0x07fe05fc,0x05fecfd8,
0x17fffc40,0x5004fc80,0x03ff03ff,0xd07f47fe,0x2207f41f,0x017fc1ff,
0x6c00ffc0,0xf01dffff,0x401df73f,0xff8005fb,0x40ff3001,0x03ff0ff9,
0x027e53fa,0x01beedf5,0x87fe33ee,0x37ec05f9,0x7dc3ff20,0xfb05fd06,
0x3bf5310b,0x2133df33,0x3fa006fa,0x640ff883,0x03fe604f,0x54001ff8,
0x9ff504ff,0x7ffffe40,0xdb7fffff,0xdddddddd,0xd13ee1dd,0x2dffffff,
0x3fe203fd,0x3ffff220,0xffff901d,0x3fe3ffff,0xf01ff802,0x3fffee3f,
0x25ffffff,0xfffffffa,0xddb5ffff,0xddddffdd,0x3ff7f61d,0x5ffa8003,
0x2013f200,0x3ff03ff8,0x07f47fe0,0x407f41fd,0x01bea4fd,0x2600ffc0,
0x7c01dffe,0x5c00ffbf,0x83bb105f,0xfdc801ff,0x7fc43ccf,0x3f203ff1,
0x9999df95,0x3eedfb99,0x2ccccccf,0x997f29f7,0x07fea05f,0xff17ff10,
0x266ffa03,0x2600ffda,0x2a17e24f,0x999999ff,0x7d437e40,0x2204fc86,
0x07fe01ff,0x837fe600,0x54c02ffb,0xaabffaaa,0xffffff2a,0x23ffffff,
0x4e7f44fb,0x07fb0999,0xdb883fcc,0x7fe42fff,0x1ff9999b,0x3ff005fd,
0x77d47fe0,0xaaaaaaaa,0xd339ff11,0x2133335f,0xffffffff,0x7fb1ffff,
0xe8007ff5,0xf9001fff,0x409fd009,0x23ff01ff,0xe83fa0fe,0x367fa80f,
0x3ff0003f,0x0ffff620,0x02ffffc0,0xffe82fdc,0x7c00ffc7,0xf86fffff,
0x3203ff2f,0xfffff96f,0x2edfffff,0xffffffff,0x3fe29f75,0x3e20bf31,
0x9ff7003f,0x7fff40bf,0x5400dfff,0x2a13e63f,0xffffffff,0x3607fcc4,
0x404fc83f,0x07fe02ff,0x83bfa200,0xe8001ffd,0x5400001f,0x9027fc4f,
0x037d409f,0xff13fec4,0x7ec7fe05,0xf01ff804,0x801fe63f,0x017f45fb,
0xfd807fe0,0x2005ff73,0x00efcefc,0x7e404fc8,0xf80ffc06,0x7f41fd1f,
0x7fc03fa0,0x0000ff8a,0x37ea03ff,0x7ff003fe,0x5fb805ff,0x7c1ffff0,
0xffba801f,0x8ffc42aa,0x29ff01ff,0xaaaaaefc,0x5df76fca,0x2e355555,
0x7cd7f24f,0x800dfb05,0x3a01fffe,0x01efdcdf,0x0fea2fb8,0x33333fea,
0x23fe82cc,0x4fc80ff8,0xf807fe20,0x7f4c001f,0x03ffb80d,0x0000ff40,
0xff89be60,0x403fea06,0xff3003fe,0x7cc1fe61,0x801ff71f,0x1ffc83fe,
0x32005ff1,0x001ff43f,0x3fd807fe,0xf5007ff2,0x2017fa3f,0x3fea04fc,
0xf80ffc00,0x7f41fd1f,0x7e403fa0,0x20005fbd,0x363301ff,0x73ff003f,
0x2fdc03ff,0x7fc5ffc8,0x40ff3001,0x03ff1ff9,0x13f23ff5,0x0df76fa8,
0x7fcc9f70,0xffa85f98,0x27fd4001,0xffb8bfa0,0xcfdaa880,0x22adfcaa,
0x7e4006fa,0x7e41bea6,0x807fe604,0x3ea001ff,0x27fd404f,0x4003fd00,
0x87fc00cb,0x3a02fffc,0x07fe40df,0xf13fe401,0x1fffb85f,0x2501dff1,
0x3ff20efd,0x007ff21f,0xeffd97ea,0x807fe001,0x0ffec3fd,0x3e63ff98,
0x827e403f,0xff802ff9,0x3fa3ff01,0x0fe83fa0,0x05fdff10,0x400ffc00,
0x3ff003fd,0x7dc03bf6,0x3fe0a605,0x40ff3001,0x26bfe7fa,0x324ffeb9,
0x5dbea04f,0x44fb806f,0x445f9cfd,0xff0003ff,0x6c2fe803,0xffffb84f,
0x7fffffff,0xf3001bea,0x640ff61f,0x01fea04f,0x3ee003ff,0xbff3003f,
0x003fd001,0xf9013fea,0xdff5dfbf,0x7ffcc5db,0x6c2fffdd,0xfffdcdef,
0x7eeffec2,0x3ea1fedf,0x37feeeff,0xb9fdbfff,0x77ff443f,0x3e0fedcd,
0xffeafedf,0x3fe02ecd,0x3a0ff601,0x2ff440ff,0xdd917fdc,0x5dddfffd,
0x3bbbbffa,0x03ff1eee,0xd07f47fe,0xb007f41f,0xf8000fff,0x03fd801f,
0x3fa23ff0,0x000bf705,0x3e6003ff,0xff97fa07,0x43ffffff,0x5bea04fc,
0x4fb806fb,0x22fd7fcc,0x3e0006fd,0x217f401f,0x55440ff9,0xbfeaabfe,
0x001bea2a,0x03fe2ffe,0xbfd027e4,0xd801ff80,0x744001ff,0x00c400ef,
0x9009ff70,0x3fee3dff,0x7fec41ff,0xffc80dff,0x881dffff,0xfb3efffd,
0xfffec883,0x3fffea4f,0xfd703fb3,0xea8bffff,0xfffb12ef,0x00ffc03f,
0xdfd107fb,0xd807fec1,0xffffd0ff,0x3a5fffff,0xffffffff,0x3e03ff2f,
0x7f41fd1f,0xfa803fa0,0x7fc0004f,0x003fd801,0x1ffcc3ff,0x7c002fdc,
0x0ff3001f,0xeff87fee,0xfc80acde,0x7ddbea04,0xe84fb806,0x3fea5fdf,
0x07fe0001,0x9fd05fd0,0x03f63f40,0x32001bea,0x3206fadf,0x03ff904f,
0x3a201ff8,0x360000ef,0x400001ff,0x402000cb,0x00088008,0x4c003331,
0x88030000,0x01330001,0x20026008,0x00000019,0x00000000,0x00000000,
0x3ff00000,0x2007fb00,0x0ffdc1ff,0x3e0017ee,0x4ff3001f,0x7c4ffd98,
0x09f9001f,0x06fbb7d4,0xffa84fb8,0x339ff15f,0x80133333,0x17f401ff,
0x6f807fd4,0x06fa83f4,0x3fdff980,0xe9893f20,0x1ff803ff,0x00006e40,
0xeee98764,0x3eeeeeee,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0xfffffe80,0xfd80ffff,0x3fffffff,
0x3ff607fe,0x3ffffee0,0xfff07fff,0x47ffffff,0xfffffff9,0x001ff83f,
0xb7d409f9,0xfffffffb,0x3a09f77f,0xffff75ff,0x0dffffff,0x7f401ff8,
0x3e09fd02,0x6fa83fc6,0x1ffff000,0x7ffffe40,0xff002fff,0x00000003,
0x7fffffcc,0x0004ffff,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0xe8000000,0xffffffff,0xffffd80f,0x3fe3ffff,
0x2e6fe881,0xffffffff,0xffffff07,0x7fcc7fff,0xf00bdeff,0x13f2003f,
0xfff76fa8,0x2effffff,0x2bff504f,0xfffffffc,0x7fc06fff,0xb817f401,
0x22fc40ff,0x00df506f,0x901bff20,0x15bdffff,0x000ffc00,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x3ea80000,
0xca84e980,0xbb9501cd,0x713ea819,0x00001bdd,0x00000018,0x0803ec00,
0x00000000,0x00019900,0xdfb3fe40,0x4cccccc0,0xdddddd50,0xb503dddd,
0x54426c43,0x7f4c002b,0x2ffb8005,0x3ffffff2,0x99999996,0x19999999,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x36a00000,0x5fa83eff,0x3a24fb80,0x4c2fffff,0x20fffeff,0xfffe9cfb,
0x807540ff,0x3fffe64c,0xc83d302d,0x79106d43,0xec80f900,0x3aa02eff,
0x07fea04f,0x00fbff62,0x3e609ff7,0xffffffff,0x7ecff94f,0xfffff106,
0x3fffee7f,0x81ffffff,0x87fee5ff,0x40efffe8,0x5fd882eb,0x907fee00,
0x2fffffff,0xffffffff,0x01ffffff,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0xacfd8000,0x3e60efb9,0x323fc806,
0x0ffb88df,0x5c7fb062,0xfd31efef,0x640efe89,0xd9bd30ff,0xa8bfa0ff,
0xf127e46f,0x9b24a81f,0x3fbfee4b,0x7ff541ff,0x1bff604f,0xbffbbff3,
0x07fbbe20,0x3bbbbba6,0xdf93eeee,0xbb8837e4,0x2221bbbb,0xfe888888,
0x3a22fc81,0x7f5f7e46,0xb807f60e,0x0dfb805f,0x88888888,0x33333330,
0x03333333,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x93f70000,0x44dd1379,0x3f625c7f,0x5ff03fe2,0xf727dc40,
0x46fb81df,0xff90efe8,0x5c2ff801,0x207fe25f,0x917ee2fe,0xfb1d73df,
0x0ffe228d,0x409fb9fd,0x3fa0fffb,0x3207fa22,0x0006f99f,0x2fe4df70,
0x3fa00000,0x07fc0001,0x0ff97ffb,0x01100110,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x3e5f1000,
0x23f88fcc,0xe87fe0ff,0xf90ff11f,0xffffdb87,0x2a03fee4,0xcefe887f,
0x7fcc00ff,0xfd83fe20,0x741ff303,0x7f7ecc3f,0x3fe802ef,0x404fc84c,
0x21be27fe,0x92fc43fc,0xf700007f,0x0002fdcd,0x0007fa00,0xffd86f88,
0x000002ff,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x3e7a8000,0xfd9765f2,0x7fc9ff51,0xfd81ff10,
0x2e677ea2,0x9817ee4f,0x1fffd101,0x20ffffc0,0x017ea3fd,0x07fccbf7,
0xa802ffdc,0x13f201ff,0x37ccdfb0,0x83f61fe4,0x33220ff8,0xcccccccc,
0x2fdcbf52,0x3b200000,0x26000001,0x000001bc,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x7cd90000,
0xfc9b24ee,0x3fcfdf92,0x0ff88ffa,0x24fb87f6,0x320005fb,0x37200eff,
0x8bfa2ffe,0x37d404fc,0x7f543ff1,0x2e03feee,0x27e403ff,0x7c45ff10,
0xf30ff40f,0x7cc9f709,0xffffffff,0x0000004f,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0xdbf9ee00,0xf3fb9724,0x8df15f9b,0x3ffceffa,0x7fedefe4,
0x40017ee4,0x00efeffc,0x3be66fc8,0x7c40bfa0,0xfd93f61f,0x0df96b8d,
0xf9005ff9,0x0bff9509,0xbfd75df9,0x3fd00fe8,0x4ccccccc,0x00000999,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x47e60000,0x49d1f9af,0xf9af9cfa,
0xffa84f9d,0xffd882ef,0x17ee4f9d,0x223ff200,0x7ec00efe,0xff327e46,
0x7d47fb01,0x4cd91cc6,0x007bfa23,0x7ffc27e4,0xffffb102,0x30164c1b,
0x00000079,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0xbd000000,0x07de6cbe,
0x3a1f9bf3,0x02203fbf,0x0bf70020,0x220ffc80,0x99950efe,0xff885ffd,
0xdf717ee1,0x3e402fe8,0xffffffd0,0x7ff75c3f,0x00130eef,0x00002aa2,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x37e20000,0xf10bf220,
0x7f7e4bfd,0x4cccccc2,0x26666099,0xbf709999,0x880fb800,0x3fffee5e,
0xe87f502e,0xe983ee0d,0x3a06c805,0x1fffffff,0x3ffffff2,0x0000000f,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0xb1000000,0x203dfdff,
0x3fe62fff,0x3fffe21f,0xff13ffff,0x27ffffff,0x008005fb,0x40026202,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x01aa8800,0x3fa07fec,0x5555540f,0x2aaa0aaa,0xf70aaaaa,
0x0000000b,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
0x00000000,0x00000000,0x00000000,0x00000000,0x00000000,
};
static signed short stb__consolas_26_latin_ext_x[560]={ 0,5,3,0,1,0,0,5,3,3,2,1,3,3,
4,1,1,1,1,2,0,2,1,1,1,1,5,3,1,1,2,3,0,0,2,1,1,2,2,0,1,2,2,1,
2,0,1,0,2,0,2,1,1,1,0,0,0,0,1,4,2,3,1,0,0,1,2,2,1,1,0,1,2,2,
1,2,2,1,2,1,2,1,2,2,0,2,0,0,0,0,2,2,6,2,0,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,5,1,1,1,0,
6,1,0,0,2,1,1,3,1,0,2,1,3,3,0,2,1,5,5,2,2,1,0,0,0,2,0,0,0,0,
0,0,-1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,2,1,0,0,
0,0,0,0,0,2,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,2,0,
0,0,0,0,0,1,0,0,0,0,0,0,0,0,-1,-1,0,1,0,0,0,0,0,0,2,1,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,0,2,1,1,0,0,1,2,2,0,0,2,
2,-4,-2,2,1,0,2,0,0,1,2,0,0,0,1,2,0,0,0,0,0,0,0,0,-1,0,2,2,-1,0,
0,0,0,0,1,2,0,0,1,0,0,-3,1,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,0,0,
0,0,0,0,0,0,0,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,0,0,-1,0,-2,-2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,1,1,1,1,1, };
static signed short stb__consolas_26_latin_ext_y[560]={ 19,1,1,2,0,0,1,1,0,0,1,5,14,11,
15,1,2,2,2,2,2,2,2,2,2,2,6,6,4,8,4,1,0,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,0,2,22,1,6,1,6,1,6,0,6,1,0,
0,1,1,6,6,6,6,6,6,6,2,6,6,6,6,6,6,0,-2,0,9,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,19,6,0,2,2,2,
-2,0,1,2,2,6,11,11,0,1,0,3,0,0,1,6,1,9,19,0,2,6,0,0,0,6,-3,-3,-3,-3,
-3,-4,2,2,-3,-3,-3,-3,-3,-3,-3,-3,2,-3,-3,-3,-3,-3,-3,6,-1,-3,-3,-3,-3,-3,2,0,1,1,
1,1,1,-1,6,6,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,3,1,1,1,1,1,1,1,
-2,1,-3,1,2,6,-3,1,-3,1,-3,0,-3,1,-3,0,2,1,-2,1,-3,1,-3,0,2,6,-3,1,-3,1,
-3,1,-3,0,2,0,-3,-3,2,1,-3,1,-2,1,-3,1,2,0,-3,6,2,0,-3,1,2,1,6,-3,-3,2,
1,0,0,2,1,2,1,-3,1,2,6,-3,1,-1,2,6,-2,1,-3,1,-3,1,2,6,-3,1,2,6,-3,1,
-3,1,-3,1,2,6,-3,1,2,2,-3,0,2,2,-3,1,-2,1,-3,1,-4,-1,-3,1,2,6,-3,1,-3,1,
-3,-3,1,-3,0,-3,1,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,-6,-4,-3,1,-3,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,6,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
2,2,2,2,2,2, };
static unsigned short stb__consolas_26_latin_ext_w[560]={ 0,4,9,14,12,15,15,4,8,8,11,13,7,8,
6,12,13,12,12,11,14,11,12,12,12,12,5,7,11,12,11,9,15,15,11,12,13,10,10,13,12,11,10,13,
11,14,12,14,11,15,12,12,13,12,15,14,14,15,12,7,11,7,12,15,9,12,11,10,12,12,14,13,11,11,
11,12,11,13,11,13,11,12,12,11,13,11,14,14,14,14,11,10,3,11,14,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,0,4,11,12,13,14,
3,12,12,15,10,12,12,8,12,11,10,12,9,8,13,12,12,5,4,10,10,12,15,15,15,9,15,15,15,15,
15,15,15,12,12,12,12,12,13,13,13,13,14,13,14,14,14,14,14,12,14,13,13,13,13,15,11,12,13,13,
13,13,13,13,14,10,13,13,13,13,13,13,13,13,12,13,14,14,14,14,14,13,13,13,13,13,13,14,11,14,
15,13,15,13,15,12,13,13,13,12,13,12,13,12,15,17,14,14,12,13,12,13,12,13,11,12,12,13,13,14,
13,14,13,14,13,14,13,13,14,13,13,13,13,13,13,13,11,12,13,11,12,12,12,12,13,12,12,13,13,11,
11,17,16,13,16,13,11,13,13,12,11,13,13,13,12,11,14,14,14,14,15,14,14,14,15,14,12,12,15,14,
13,13,13,13,12,11,13,13,13,13,14,17,13,13,13,13,13,13,13,13,13,13,15,14,12,11,14,14,15,14,
15,13,13,13,13,13,13,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,14,13,13,13,
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13,13,13,13,13,15,13,15,14,16,16,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13,13,13,13,13,12,11,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,
13,13,13,13,13,13, };
static unsigned short stb__consolas_26_latin_ext_h[560]={ 0,19,7,17,22,20,19,7,25,25,11,14,10,3,
5,21,18,17,17,18,17,18,18,17,18,17,14,18,16,8,16,19,25,17,17,18,17,17,17,18,17,17,18,17,
17,17,17,18,17,22,17,18,17,18,17,17,17,17,17,25,21,25,9,3,6,14,19,14,19,14,19,19,18,19,
25,18,18,13,13,14,19,19,13,14,18,14,13,13,13,19,13,25,27,25,6,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,0,19,23,17,17,17,
27,22,6,18,13,12,6,3,13,6,10,16,11,12,6,19,21,5,4,11,13,12,19,19,19,19,22,22,22,22,
22,23,17,21,22,22,22,22,22,22,22,22,17,22,23,23,23,23,23,12,23,23,23,23,23,22,17,20,19,19,
19,19,19,21,14,17,19,19,19,19,18,18,18,18,19,18,19,19,19,19,19,14,19,19,19,19,19,24,24,24,
21,19,22,19,22,18,23,19,23,19,23,20,23,19,22,20,17,19,21,19,22,19,22,20,22,18,22,19,23,24,
23,24,23,25,23,25,22,22,17,18,22,18,21,18,22,18,22,24,22,13,18,25,23,24,23,24,13,22,22,23,
24,19,19,17,18,17,18,22,18,23,19,22,18,20,23,19,22,19,23,19,23,19,18,14,22,18,23,19,22,18,
23,19,23,19,21,17,23,19,23,23,22,20,17,18,23,19,22,19,23,19,24,21,23,19,22,18,22,18,22,24,
22,22,18,22,19,22,18,19,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,22,17,17,17,
17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,17,17,17,25,24,22,19,25,21,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,17,17,17,23,19,23,23,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,
17,17,17,17,17,17, };
static unsigned short stb__consolas_26_latin_ext_s[560]={ 511,506,190,173,472,263,489,505,34,102,112,
399,145,277,505,165,461,376,389,475,402,487,499,417,1,430,506,14,255,177,243,
327,111,360,459,36,215,107,188,117,94,1,131,27,55,306,118,77,321,230,160,
92,229,142,199,291,471,144,131,9,137,139,164,286,253,335,427,348,439,371,117,
337,195,166,158,170,105,477,465,309,154,127,51,323,49,359,491,14,426,452,453,
147,5,127,238,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,511,501,394,
278,249,263,1,1,225,445,40,86,212,277,1,200,153,267,124,77,263,132,191,
505,506,134,29,99,494,1,17,60,485,427,395,336,274,113,443,178,465,131,71,
30,410,494,396,382,486,353,325,255,183,310,448,64,463,420,282,434,225,160,82,
279,298,284,103,256,242,110,384,501,187,173,159,145,222,249,417,431,90,208,61,
46,31,16,1,280,475,461,447,433,76,279,170,195,149,363,290,392,320,236,143,
310,29,406,296,236,43,336,1,204,67,377,124,270,438,349,14,222,40,375,27,
419,1,307,85,252,57,43,129,87,366,352,333,303,306,403,82,347,246,361,218,
182,190,441,317,58,198,294,211,239,413,57,43,270,267,365,383,41,330,13,291,
424,277,170,482,451,263,249,340,33,367,45,379,312,239,70,178,294,99,388,157,
414,478,193,99,99,71,140,69,348,15,85,492,478,443,292,221,63,406,228,458,
400,365,113,322,96,336,467,17,183,84,155,115,210,144,176,207,204,351,260,22,
216,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,380,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,71,225,411,201,17,52,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,352,324,492,478,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,235,
235,235,235,235,235,235,235,235,235, };
static unsigned short stb__consolas_26_latin_ext_t[560]={ 1,1,176,158,53,76,76,76,1,1,176,
158,176,176,90,76,119,139,139,119,139,119,119,139,139,139,53,139,158,176,158,
99,1,139,139,139,158,158,158,139,158,158,139,158,158,139,158,139,139,53,158,
139,158,139,158,139,139,158,158,1,76,1,176,176,176,158,99,158,99,158,99,
99,139,119,1,139,139,158,158,158,119,119,176,158,139,158,158,176,158,99,158,
1,1,1,176,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,1,53,1,
139,139,139,1,76,176,119,176,176,176,176,176,176,176,158,176,176,176,99,76,
84,68,176,176,176,99,119,119,119,53,53,53,53,53,29,139,76,29,53,53,
53,29,29,29,29,139,29,29,29,29,29,1,176,1,1,29,1,29,53,158,
76,99,99,99,99,99,76,158,139,99,99,99,99,119,119,119,119,99,119,99,
99,99,99,99,158,76,76,76,76,99,1,1,1,76,76,53,76,53,119,29,
76,29,76,29,76,29,76,53,76,158,76,76,99,29,76,76,76,76,119,76,
76,29,1,29,1,29,1,29,1,53,53,139,119,53,119,76,119,53,119,53,
1,53,158,119,1,29,1,29,1,158,53,53,29,1,99,99,158,119,158,119,
29,119,29,99,29,119,76,29,119,29,119,1,99,29,119,119,158,53,119,29,
99,29,119,29,119,29,119,76,139,29,119,1,1,53,76,139,139,1,99,53,
99,1,119,1,76,1,99,53,139,53,139,53,1,53,53,139,53,99,53,139,
99,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,53,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,1,1,53,99,1,76,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,1,76,1,1,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,139,
139,139,139,139,139,139,139,139,139, };
static unsigned short stb__consolas_26_latin_ext_a[560]={ 229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,229,
229,229,229,229,229,229,229,229, };
// Call this function with
// font: NULL or array length
// data: NULL or specified size
// height: STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT or STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT_POW2
// return value: spacing between lines
static void stb_font_consolas_26_latin_ext(stb_fontchar font[STB_FONT_consolas_26_latin_ext_NUM_CHARS],
unsigned char data[STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT][STB_FONT_consolas_26_latin_ext_BITMAP_WIDTH],
int height)
{
int i,j;
if (data != 0) {
unsigned int *bits = stb__consolas_26_latin_ext_pixels;
unsigned int bitpack = *bits++, numbits = 32;
for (i=0; i < STB_FONT_consolas_26_latin_ext_BITMAP_WIDTH*height; ++i)
data[0][i] = 0; // zero entire bitmap
for (j=1; j < STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT-1; ++j) {
for (i=1; i < STB_FONT_consolas_26_latin_ext_BITMAP_WIDTH-1; ++i) {
unsigned int value;
if (numbits==0) bitpack = *bits++, numbits=32;
value = bitpack & 1;
bitpack >>= 1, --numbits;
if (value) {
if (numbits < 3) bitpack = *bits++, numbits = 32;
data[j][i] = (bitpack & 7) * 0x20 + 0x1f;
bitpack >>= 3, numbits -= 3;
} else {
data[j][i] = 0;
}
}
}
}
// build font description
if (font != 0) {
float recip_width = 1.0f / STB_FONT_consolas_26_latin_ext_BITMAP_WIDTH;
float recip_height = 1.0f / height;
for (i=0; i < STB_FONT_consolas_26_latin_ext_NUM_CHARS; ++i) {
// pad characters so they bilerp from empty space around each character
font[i].s0 = (stb__consolas_26_latin_ext_s[i]) * recip_width;
font[i].t0 = (stb__consolas_26_latin_ext_t[i]) * recip_height;
font[i].s1 = (stb__consolas_26_latin_ext_s[i] + stb__consolas_26_latin_ext_w[i]) * recip_width;
font[i].t1 = (stb__consolas_26_latin_ext_t[i] + stb__consolas_26_latin_ext_h[i]) * recip_height;
font[i].x0 = stb__consolas_26_latin_ext_x[i];
font[i].y0 = stb__consolas_26_latin_ext_y[i];
font[i].x1 = stb__consolas_26_latin_ext_x[i] + stb__consolas_26_latin_ext_w[i];
font[i].y1 = stb__consolas_26_latin_ext_y[i] + stb__consolas_26_latin_ext_h[i];
font[i].advance_int = (stb__consolas_26_latin_ext_a[i]+8)>>4;
font[i].s0f = (stb__consolas_26_latin_ext_s[i] - 0.5f) * recip_width;
font[i].t0f = (stb__consolas_26_latin_ext_t[i] - 0.5f) * recip_height;
font[i].s1f = (stb__consolas_26_latin_ext_s[i] + stb__consolas_26_latin_ext_w[i] + 0.5f) * recip_width;
font[i].t1f = (stb__consolas_26_latin_ext_t[i] + stb__consolas_26_latin_ext_h[i] + 0.5f) * recip_height;
font[i].x0f = stb__consolas_26_latin_ext_x[i] - 0.5f;
font[i].y0f = stb__consolas_26_latin_ext_y[i] - 0.5f;
font[i].x1f = stb__consolas_26_latin_ext_x[i] + stb__consolas_26_latin_ext_w[i] + 0.5f;
font[i].y1f = stb__consolas_26_latin_ext_y[i] + stb__consolas_26_latin_ext_h[i] + 0.5f;
font[i].advance = stb__consolas_26_latin_ext_a[i]/16.0f;
}
}
}
#ifndef STB_SOMEFONT_CREATE
#define STB_SOMEFONT_CREATE stb_font_consolas_26_latin_ext
#define STB_SOMEFONT_BITMAP_WIDTH STB_FONT_consolas_26_latin_ext_BITMAP_WIDTH
#define STB_SOMEFONT_BITMAP_HEIGHT STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT
#define STB_SOMEFONT_BITMAP_HEIGHT_POW2 STB_FONT_consolas_26_latin_ext_BITMAP_HEIGHT_POW2
#define STB_SOMEFONT_FIRST_CHAR STB_FONT_consolas_26_latin_ext_FIRST_CHAR
#define STB_SOMEFONT_NUM_CHARS STB_FONT_consolas_26_latin_ext_NUM_CHARS
#define STB_SOMEFONT_LINE_SPACING STB_FONT_consolas_26_latin_ext_LINE_SPACING
#endif
| true |
bef6ddb8f607b3caf95d6c1ccb2d1dcb8781e267 | C++ | pinkslot/myf4k | /Algorithms/Detection/detection.h | UTF-8 | 1,078 | 2.859375 | 3 | [] | no_license | // Interface for a generic motion detection class.
#ifndef ALG_DETECTION_H
#define ALG_DETECTION_H
#include <cv.h>
#include <context.h>
#include "../algorithm.h"
namespace alg
{
class Detection : public Algorithm
{
public:
// Analyze next frame and return motion mask
virtual cv::Mat nextFrame(Context& context) = 0;
// Required by Algorithm interface
std::string name() const = 0;
inline std::string type() const { return "detection"; }
std::string description() const = 0;
std::string version() const = 0;
int executionTime() const = 0;
std::string descriptionExecutionTime() const { return "Average time to process a 640x480 frame"; }
int ram() const = 0;
inline std::string input() const { return "cv::Mat"; }
inline std::string output() const { return "cv::Mat"; }
virtual ~Detection() {}
// Check if algorithm is ready to return meaningful output
virtual bool isReady() { return true; }
virtual void adaptToVideo(int frame_width, int frame_height, int frame_rate) {}
};
}
#endif
| true |
ed47639623a8af8739b42f4b5fd3058c8a8f56cb | C++ | amundada2310/SFND_Lidar_Obstacle_Detection | /processPointClouds.cpp | UTF-8 | 13,365 | 2.84375 | 3 | [] | no_license | // PCL lib Functions for processing point clouds
#include "processPointClouds.h"
#include <unordered_set>
//constructor:
template<typename PointT>
ProcessPointClouds<PointT>::ProcessPointClouds() {}
//de-constructor:
template<typename PointT>
ProcessPointClouds<PointT>::~ProcessPointClouds() {}
template<typename PointT>
void ProcessPointClouds<PointT>::numPoints(typename pcl::PointCloud<PointT>::Ptr cloud)
{
std::cout << cloud->points.size() << std::endl;
}
template<typename PointT>
typename pcl::PointCloud<PointT>::Ptr ProcessPointClouds<PointT>::FilterCloud(typename pcl::PointCloud<PointT>::Ptr cloud, float filterRes, Eigen::Vector4f minPoint, Eigen::Vector4f maxPoint)
{
// Time segmentation process
auto startTime = std::chrono::steady_clock::now();
// TODO:: Fill in the function to do voxel grid point reduction// this will provide for 1 single point for each voxelgrid cube defined by the filterRes
pcl::VoxelGrid<PointT> vg;
typename pcl::PointCloud<PointT>::Ptr cloudFiltered (new pcl::PointCloud<PointT>);
vg.setInputCloud (cloud);
vg.setLeafSize (filterRes, filterRes, filterRes);
vg.filter (*cloudFiltered);
//TO DO::fill in function for region based filtering //cropbox filtering only the region left where we want lidar to look at
typename pcl::PointCloud<PointT>::Ptr cloudRegion (new pcl::PointCloud<PointT>);
pcl::CropBox<PointT> region(true);
region.setMin(minPoint);
region.setMax(maxPoint);
region.setInputCloud(cloudFiltered);
region.filter(*cloudRegion);
//TO DO:: fill in function to reomve roofs
std::vector<int> indices;
pcl::CropBox<PointT> roof(true);
roof.setMin(Eigen::Vector4f (-1.5, -1.7, -1, 1));
roof.setMax(Eigen::Vector4f (2.6, 1.7, -0.4, 1));
roof.setInputCloud(cloudRegion);
roof.filter(indices);
pcl::PointIndices::Ptr inliers {new pcl::PointIndices};
for(int point : indices)
inliers->indices.push_back(point);
pcl::ExtractIndices<PointT> extract;
extract.setInputCloud (cloudRegion);
extract.setIndices (inliers);
extract.setNegative (true);
extract.filter (*cloudRegion);
auto endTime = std::chrono::steady_clock::now();
auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
std::cout << "filtering took " << elapsedTime.count() << " milliseconds" << std::endl;
return cloudRegion;
}
template<typename PointT>
std::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> ProcessPointClouds<PointT>::SeparateClouds(pcl::PointIndices::Ptr inliers, typename pcl::PointCloud<PointT>::Ptr cloud)
{
//TO DO: Create 2 different clouds 1 Obstacles, 2 Ground
typename pcl::PointCloud<PointT>::Ptr obstacleCloud (new pcl::PointCloud<PointT> ());//create obstacle point cloud on heap
typename pcl::PointCloud<PointT>::Ptr groundCloud (new pcl::PointCloud<PointT> ());//create ground(road) point cloud on heap
for(int index : inliers->indices)
{
groundCloud->points.push_back(cloud->points[index]);//all inliers are plane/ground point cloud
}
pcl::ExtractIndices<PointT> extract;//extracts the obstacle point cloud from the ground point cloud
extract.setInputCloud (cloud);
extract.setIndices (inliers);
extract.setNegative (true);
extract.filter (*obstacleCloud);//everything besides the inliers are kept and are assigned to obstacle point cloud
std::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> segResult(obstacleCloud, groundCloud);
return segResult;//returns everything to SegmentPlane function
}
template<typename PointT>
std::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> ProcessPointClouds<PointT>::SegmentPlane(typename pcl::PointCloud<PointT>::Ptr cloud, int maxIterations, float distanceThreshold)
{
// Time segmentation process
auto startTime = std::chrono::steady_clock::now();
pcl::SACSegmentation<PointT> seg;
pcl::ModelCoefficients::Ptr coefficients {new pcl::ModelCoefficients()};
pcl::PointIndices::Ptr inliers {new pcl::PointIndices()};
// TODO:: Fill in this function to find inliers for the cloud.
seg.setOptimizeCoefficients (true);
seg.setModelType(pcl::SACMODEL_PLANE);
//seg.setMethodType(pcl::SAC_RANSAC);
seg.setMaxIterations(maxIterations);
seg.setDistanceThreshold(distanceThreshold);
seg.setInputCloud(cloud);
//seg.segment (*inliers, *coefficients);
std::unordered_set<int> inliersResult; //inliersResult initialized as 0
srand(time(NULL));
// TODO: Fill in this function
// For max iterations
// Randomly sample subset and fit line
// Measure distance between every point and fitted line
// If distance is smaller than threshold count it as inlier
// Return indicies of inliers from fitted line with most inliers
while(maxIterations--)
{
//randomly select 3 points from the cloud
std::unordered_set<int> inliers;
while(inliers.size() < 3)
inliers.insert(rand()%(cloud->points.size()));
//rand function will randomly select values from (%) '0' to max point.size(max no. of points) and values are stored (inserted) in inliers
//x1,y1,z1,x2,y2,z2,x3,y3,z3 holding values of the 3 randomly selected points
float x1,y1,z1,x2,y2,z2,x3,y3,z3;
auto itr = inliers.begin(); //itr is a pointer pointing to the first location of inliers (first point)
x1 = cloud->points[*itr].x;
y1 = cloud->points[*itr].y;
z1 = cloud->points[*itr].z;
itr++;
x2 = cloud->points[*itr].x;
y2 = cloud->points[*itr].y;
z2 = cloud->points[*itr].z;
itr++;
x3 = cloud->points[*itr].x;
y3 = cloud->points[*itr].y;
z3 = cloud->points[*itr].z;
float a = (((y2-y1)*(z3-z1))-((z2-z1)*(y3-y1)));
float b = (((z2-z1)*(x3-x1))-((x2-x1)*(z3-z1)));
float c = (((x2-x1)*(y3-y1))-((y2-y1)*(x3-x1)));
float d = -(a*x1+b*y1+c*z1);
//Iterate through all the points to calcualte the tolerance and find the np. of inliers and select the best model
for(int index = 0; index < cloud->points.size(); index++)
{
//If the index is pointing to a point which is already part of plane we have to continue (not consider the point)
//There are 3 such points.
if(inliers.count(index)>0)
continue;
//if it is not the 3 points then do as below
//pointing the point values in x4 and y4, z4
pcl::PointXYZI point;
point = cloud->points[index];
float x4 = point.x;
float y4 = point.y;
float z4 = point.z;
//now calculating distance from plane to that point
float e = fabs(a*x4+b*y4+c*z4+d)/sqrt(a*a+b*b+c*c);
if(e<distanceThreshold)
inliers.insert(index);
}
//when the tolerance is calculated for all the points for 1 particular point combination selected
//then its size is compared with size of inlierResult (which is initialized as 0). If the inliers size is >
//then store that value in result
if(inliers.size()>inliersResult.size())
{
inliersResult = inliers;
}
}
for(int point : inliersResult)
inliers->indices.push_back(point);
//OR//
/*for(int i = 0; i <= cloud->points.size(); i++)
{
if(inliersResult.count(i))
inliers->indices.push_back(cloud->points(i));//push back points index in inliers
}*/
if (inliers->indices.size() == 0)
{
std::cout << "Could not estimate a planar model for the given dataset." << std::endl;
}
std::pair<typename pcl::PointCloud<PointT>::Ptr, typename pcl::PointCloud<PointT>::Ptr> segResult = SeparateClouds(inliers, cloud);
auto endTime = std::chrono::steady_clock::now();
auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
std::cout << "plane segmentation took " << elapsedTime.count() << " milliseconds" << std::endl;
return segResult;
}
template<typename PointT>
void ProcessPointClouds<PointT>::clusterHelper(int indice, const std::vector<std::vector<float>> points, std::vector<int>& cluster, std::vector<bool>& processed, KdTree* tree, float distanceTol)
{
processed[indice] = true;
cluster.push_back(indice);
std::vector<int> nearest = tree->search(points[indice],distanceTol);
for(int id : nearest)
{
if (!processed[id])
clusterHelper(id, points, cluster, processed, tree, distanceTol);
}
}
template<typename PointT>
std::vector<std::vector<int>> ProcessPointClouds<PointT>::euclideanCluster(const std::vector<std::vector<float>>& points, KdTree* tree, float distanceTol)
{
// TODO: Fill out this function to return list of indices for each cluster
std::vector<std::vector<int>> clusters;
std::vector<bool> processed(points.size(),false);//initialised all points as boolean "0" not processed.
int i=0;
while (i < points.size())
{
if(processed[i])
{
i++;
continue;
}
std::vector<int> cluster;
clusterHelper(i, points, cluster, processed, tree, distanceTol);
clusters.push_back(cluster);
i++;
}
return clusters;
}
template<typename PointT>
std::vector<typename pcl::PointCloud<PointT>::Ptr> ProcessPointClouds<PointT>::Clustering(typename pcl::PointCloud<PointT>::Ptr cloud, float clusterTolerance, int minSize, int maxSize)
{
// Time clustering process
auto startTime = std::chrono::steady_clock::now();
// TODO:: Fill in the function to perform euclidean clustering to group detected obstacles
std::vector<typename pcl::PointCloud<PointT>::Ptr> clusters;
/*typename pcl::search::KdTree<PointT>:: Ptr tree (new pcl::search::KdTree<PointT>);
tree->setInputCloud (cloud);
std::vector<pcl::PointIndices> clusterIndices;
pcl::EuclideanClusterExtraction<PointT> ec;
ec.setClusterTolerance (clusterTolerance);
ec.setMinClusterSize (minSize);
ec.setMaxClusterSize (maxSize);
ec.setSearchMethod (tree);
ec.setInputCloud (cloud);
ec.extract (clusterIndices);*/
std::vector<std::vector<float>> points;
std::vector<float> point_each;
KdTree* tree = new KdTree;
for (int i=0; i<cloud->points.size(); i++)
{
point_each = {cloud->points[i].x, cloud->points[i].y, cloud->points[i].z};
points.push_back(point_each);
tree->insert(points[i],i);
}
std::vector<std::vector<int>> cluster = euclideanCluster(points, tree, clusterTolerance);
std::vector<pcl::PointIndices> clusterIndices;
for(std::vector<int> clusters1 : cluster)
{
typename pcl::PointCloud<PointT>::Ptr cloudCluster (new pcl::PointCloud<PointT>);
for(int index :clusters1)
cloudCluster->points.push_back (cloud->points[index]);
cloudCluster->width = cloudCluster->points.size ();
cloudCluster->height = 1;
cloudCluster->is_dense = true;
if((clusters1.size() >= minSize) && (clusters1.size() <= maxSize))
clusters.push_back(cloudCluster);
}
/*for(pcl::PointIndices getIndices : clusterIndices)
{
typename pcl::PointCloud<PointT>::Ptr cloudCluster (new pcl::PointCloud<PointT>);
for(int index :getIndices.indices)
cloudCluster->points.push_back (cloud->points[index]);
cloudCluster->width = cloudCluster->points.size ();
cloudCluster->height = 1;
cloudCluster->is_dense = true;
clusters.push_back(cloudCluster);
}*/
auto endTime = std::chrono::steady_clock::now();
auto elapsedTime = std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime);
std::cout << "clustering took " << elapsedTime.count() << " milliseconds and found " << clusters.size() << " clusters" << std::endl;
return clusters;
}
template<typename PointT>
Box ProcessPointClouds<PointT>::BoundingBox(typename pcl::PointCloud<PointT>::Ptr cluster)
{
// Find bounding box for one of the clusters
PointT minPoint, maxPoint;
pcl::getMinMax3D(*cluster, minPoint, maxPoint);
Box box;
box.x_min = minPoint.x;
box.y_min = minPoint.y;
box.z_min = minPoint.z;
box.x_max = maxPoint.x;
box.y_max = maxPoint.y;
box.z_max = maxPoint.z;
return box;
}
template<typename PointT>
void ProcessPointClouds<PointT>::savePcd(typename pcl::PointCloud<PointT>::Ptr cloud, std::string file)
{
pcl::io::savePCDFileASCII (file, *cloud);
std::cerr << "Saved " << cloud->points.size () << " data points to "+file << std::endl;
}
template<typename PointT>
typename pcl::PointCloud<PointT>::Ptr ProcessPointClouds<PointT>::loadPcd(std::string file)
{
typename pcl::PointCloud<PointT>::Ptr cloud (new pcl::PointCloud<PointT>);
if (pcl::io::loadPCDFile<PointT> (file, *cloud) == -1) //* load the file
{
PCL_ERROR ("Couldn't read file \n");
}
std::cerr << "Loaded " << cloud->points.size () << " data points from "+file << std::endl;
return cloud;
}
template<typename PointT>
std::vector<boost::filesystem::path> ProcessPointClouds<PointT>::streamPcd(std::string dataPath)
{
std::vector<boost::filesystem::path> paths(boost::filesystem::directory_iterator{dataPath}, boost::filesystem::directory_iterator{});
// sort files in accending order so playback is chronological
sort(paths.begin(), paths.end());
return paths;
}
| true |
1d1e1abcdc624e44dd23d207f0321f5f5fb1da77 | C++ | uvazke/AtCoder | /ABC/ABC230/Dans.cpp | UTF-8 | 855 | 2.5625 | 3 | [] | no_license |
#include <algorithm>
#include <float.h>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <vector>
#define myfor(i, N) for (i = 0; i < N; i++)
#define myforFL(i, f, l) for (i = f; i < l; i++)
#define myforInv(i, N) for (i = N; i >= 0; i--)
#define myforFLInv(i, f, l) for (i = f; i > l; i--)
using namespace std;
int main() {
int N, D;
cin >> N >> D;
int i;
vector<pair<int, int>> spans;
myfor(i, N) {
int l, r;
cin >> l >> r;
spans.emplace_back(l, r);
}
sort(spans.begin(), spans.end(), [](pair<int, int>& a, pair<int, int>& b) { return a.second < b.second; });
auto ans = 0, x = -D;
for(auto &[l1, r1] : spans) {
if(x+D-1<l1){
ans++;
x = r1;
}
}
cout << ans << endl;
return 0;
} | true |
5725ea98a443dd1ea4aa27e94851d05fd41434ac | C++ | stef52/Game-Dev-Class | /Physics for Students - VS12 LEAN/Game/Source/frameBuffers.cpp | UTF-8 | 7,156 | 2.609375 | 3 | [] | no_license | //*****************************************************************************************//
// Includes //
//*****************************************************************************************//
#include "includes.all"
//*****************************************************************************************//
// RAW Routines for building frame, depth, and color buffers //
//*****************************************************************************************//
void buildRawFrameBuffers (long howMany, GLuint *frameBufferIDs) {
glGenFramebuffers (howMany, frameBufferIDs);
}
void buildRawDepthBuffers (long howMany, GLuint *depthBufferIDs, long width, long height) {
glGenRenderbuffers (howMany, depthBufferIDs);
for (long index = 0; index < howMany; index++) {
GLuint depthBufferID = depthBufferIDs [index];
glBindRenderbuffer (GL_RENDERBUFFER, depthBufferID);
glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT, width, height);
}
::log ("\nBuild raw depth buffer %dx%d.", width, height);
}
void buildRawShadowMapDepthBuffer(long howMany, GLuint* textureIDs, long format, long width, long height){
glGenTextures(howMany, textureIDs);
GLenum kind = GL_TEXTURE_2D;
for (long index = 0; index < howMany; index++) {
GLuint textureID = textureIDs[index];
glBindTexture(kind, textureID);
glTexImage2D(kind, 0, GL_DEPTH_COMPONENT32F, width, height, 0, GL_DEPTH_COMPONENT, GL_FLOAT, NULL);
glTexParameterf(kind, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(kind, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(kind, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); //GL_NEAREST or GL_LINEAR
glTexParameteri(kind, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); //GL_NEAREST or GL_LINEAR
::log("\nBuild RawShadowMapDepthBuffer %dx%d.", width, height);
}
}
void buildRawCubeMapFromFile(GLuint &textureID, const char *folder, const char *fileName) {
//Builds a cube map from 6 textures with prefixes "p_x_", "n_x_", ..y.., ..z..; Currently, only handles RGBA8 textures...
long width, height;
if (!Texture::readTextureExtent(asString("%s%s%s", folder, "p_x_", fileName), width, height)) {//Not able to get the extent.
halt("\nCould not find file \"%s\"...", asString("%s%s%s", folder, "p_x_", fileName)); textureID = 0; return;
}
//Load the 6 cube map textures into individual texture object (in memory, not on the graphics card).
Texture *textures[6]; const char *prefixes[] = { "p_x_", "n_x_", "p_y_", "n_y_", "p_z_", "n_z_" };
for (long index = 0; index < 6; index++) {
textures[index] = Texture::readTexture(asString("%s%s%s", folder, prefixes[index], fileName));
}
//Build the cube map and upload the texture bytes onto the graphics card.
//Build the cube map: Like buildRawTextures but without executing glTexImage2D...
long howMany = 1; GLuint *textureIDs = &textureID;
long kind = GL_TEXTURE_CUBE_MAP; long format = GL_RGBA8; long components = GL_RGBA; long filter = GL_LINEAR;
glGenTextures(howMany, textureIDs);
for (long index = 0; index < howMany; index++) {
GLuint textureID = textureIDs[index];
glBindTexture(kind, textureID);
glTexParameterf(kind, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(kind, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameterf(kind, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
glTexParameteri(kind, GL_TEXTURE_MAG_FILTER, filter); //GL_NEAREST or GL_LINEAR
glTexParameteri(kind, GL_TEXTURE_MIN_FILTER, filter); //GL_NEAREST or GL_LINEAR
::log("\nBuild raw texture %dx%d.", width, height);
}
//Upload the 6 sets of texture bytes...
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP, GL_FALSE);
for (long kind = GL_TEXTURE_CUBE_MAP_POSITIVE_X; kind <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z; kind++) {
glTexImage2D(kind, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE,
textures[kind - GL_TEXTURE_CUBE_MAP_POSITIVE_X]->bytes);
}
//Discard the textures that were temporarily built...
for (long index = 0; index < 6; index++) {
delete textures[index];
}
}
//Variables kind, format, components are intended to provide a few variations....
// 1. Kind must be one of GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE which determines how
// the shader accesses texture coordinates; i.e. in the 0.0/1.0 float range or 0/width-1 (or height-1) integer range.
// 2. Format must be something like
// GL_RGBA32F or GL_RGBA8
// 3. Components must indicate which of RGBA are used and is normally
// GL_RGBA
void buildRawTextures (long howMany, GLuint* textureIDs, long kind, long format, long components, long width, long height, long filter) {
glGenTextures (howMany, textureIDs);
for (long index = 0; index < howMany; index++) {
GLuint textureID = textureIDs [index];
glBindTexture (kind, textureID);
glTexImage2D (kind, 0, format, width, height, 0, components, format == GL_RGBA8 ? GL_UNSIGNED_BYTE : GL_FLOAT, NULL);
glTexParameterf (kind, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf (kind, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri (kind, GL_TEXTURE_MAG_FILTER, filter); //GL_NEAREST or GL_LINEAR
glTexParameteri (kind, GL_TEXTURE_MIN_FILTER, filter); //GL_NEAREST or GL_LINEAR
::log ("\nBuild raw texture %dx%d.", width, height);
}
}
//After binding a frame buffer, you can then attach depth and color buffers via the following...
void attachDepthTexture (GLuint depthBufferID) {
glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBufferID);
}
void attachShadowMapDepthTexture(GLuint depthBufferID) {
long mipmap = 0; //Like attachColorTexture below but //as a DEPTH attachment...
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, depthBufferID, mipmap);
}
//Variable "whichAttachment" must be one of GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, ...
//Variable "textureType" must be one of GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE
void attachColorTexture (long whichAttachment, long textureType, GLuint textureID) {
glFramebufferTexture2D (GL_FRAMEBUFFER, whichAttachment, textureType, textureID, 0);
}
void attachColorTexture(long whichAttachment, long textureType, GLuint textureID, long mipmap) {
glFramebufferTexture2D(GL_FRAMEBUFFER, whichAttachment, textureType, textureID, mipmap);
}
//Finally, when you use a frame buffer with a number of color buffer attachments, you
//need to indicate which subset of the attachments you are using... If that never
//changes, you can do it ONCE at attachment time BUT if you need to use the buffer
//twice in the same tick with different attachments, you need to do it just before
//you draw as follows:
// Suppose, you provided 3 color buffers attached to GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1,
// and GL_COLOR_ATTACHMENT2...
// One draw might need only attachement 0, so
// GLenum drawBuffers [] = {GL_COLOR_ATTACHMENT0}; glDrawBuffers (1, drawBuffers);
// Another draw might need only attachements 1 and 2, so
// GLenum drawBuffers [] = {GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2}; glDrawBuffers (2, drawBuffers);
| true |
44f980761748cc26a70827ca7cb888313634f7c9 | C++ | nicknick1945/melonoma | /semion/SLib/Processing/sgaussfilter.h | UTF-8 | 3,307 | 3.21875 | 3 | [] | no_license | #ifndef SGAUSSFILTER_H
#define SGAUSSFILTER_H
#include "../Core/smatrix.h"
#include "../Processing/sprocessing.h"
/*!
* \ingroup Processing
* \brief Размеры Фильтра.
*/
enum SIZE
{
THREE,
FIVE
};
/*!
* \ingroup Processing
* \brief Класс для фильтра Гаусса.
* \details Вид усредняющего фильтра, в котором соседствующие пиксели штрафуются за удаленность от центрального.
* При этом маска выглядит следующим образом:
* \code
* //При SIZE=THREE
* int mask_3x3 [3][3] = { {1,2,1},
* {2,4,2},
* {1,2,1} };
* //При SIZE=FIVE
* int mask_5x5 [5][5] = { {1,4,6,4,1},
* {4,16,24,16,4},
* {6,24,36,24,6},
* {4,16,24,16,4},
* {1,4,6,4,1} };
* \endcode
* Класс зашаблонен по размерам (см SIZE).
*/
template <SIZE size>
class SGaussFilter: public SProcessing
{
private:
int mask_3x3 [3][3] = { {1,2,1},
{2,4,2},
{1,2,1} };
int mask_5x5 [5][5] = { {1,4,6,4,1},
{4,16,24,16,4},
{6,24,36,24,6},
{4,16,24,16,4},
{1,4,6,4,1} };
public:
///\brief Пустой конструктор.
SGaussFilter(){}
/*!
* \brief Обход изображения.
* \details Осуществляет обход изображения фильтром Гаусса по указанному изображению с заданным размером маски.
* Обращаем внимание что обработка идет по всему изображению (включая граничные). При выпадении яркость считается нулевой.
* \param src - полутоновое изображение
* \return обработанную копию изображения
* \todo Обеспечить более осмысленную обработку граничных пикселей.
*/
SMatrix bypass (const SMatrix &src)
{
int xn, yn, temp, radius, w;
SMatrix ret(src.width(), src.height());
if (size == THREE)
{
radius = 1;
w = 16;
}
else if (size == FIVE)
{
radius = 2;
w = 256;
}
for (int x=0; x<src.width(); ++x)
for (int y=0; y<src.height(); ++y)
{
temp = 0;
for (int i=-radius; i<=radius; ++i)
for (int j=-radius; j<=radius; ++j)
{
xn = x+i; yn = y+j;
if (size == THREE)
temp += src.get(xn,yn) * mask_3x3[i+radius][j+radius];
else if (size == FIVE)
temp += src.get(xn,yn) * mask_5x5[i+radius][j+radius];
}
ret(x,y) = temp/w;
}
return ret;
}
};
#endif // SGAUSSFILTER_H
| true |
1e5a715ba4595a80034553d727c13837713f095e | C++ | Xu-Sir/Project2 | /Project2/test.cpp | GB18030 | 3,224 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <string>
//#include "myArrays.cpp"
//#include "conntect.cpp"
#include <fstream>
#include <Windows.h>
using namespace std;
class Person12 {
public :
int age;
string name;
int id;
};
HMODULE hm = LoadLibrary(L"F:\\dll̬ӿ\\Dll1\\Debug\\Dll1.dll");
typedef int (*_Hello)(int a, int b);
typedef int (*_Hell)(int a);
int main() {
//MyArray<Person> mya(5);
//Person p1 = {1,"1"};
//Person p2 = {2,"2"};
//Person p3 = {3,"3"};
//Person p4 = {4,"4"};
//Person p5 = {5,"5"};
//Person p6 = {6,"6"};
//Person p7 = {7,"7"};
/*mya.add(p1);
mya.add(p2);
mya.add(p3);
mya.add(p4);
mya.add(p5);
mya.add(p6);
mya.add(p7);*/
//mya.addP(p1);
//mya.addP(p2);
//mya.addP(p3);
//mya.addP(p4);
//mya.addP(p5);
//mya.addP(p6);
//mya.addP(p7);
//mya.printArray();
//cout << "" << mya.getCapcity() << endl;
//cout << "" << mya.getNum() << endl;
//mya.remove();
//cout << mya[6].age << endl;
//cout << mya[6].name << endl;
//MyArray<Person> myaa(20);
//myaa = mya;
//myaa.printArray();
//Connecter* conn = new Connecter [1000];
//string name;
//string sex;
//int *age = new int(10);
//string tel;
//string address;
//int size;
//int capacity;
//cin >> name;
//conn[0].setParam(name, sex, age, tel, address);
//conn[0].printConn();
//int* arr = new int[7];
//arr[0] = 241;
//arr[1] = 2;
//arr[2] = 3;
//arr[3] = 4;
//arr[4] = 5;
//arr[5] = 6;
//arr[6] = 7;
//cout << arr << endl;
//cout << "" << endl;
//Person12 person;
//person.age = 30;
//person.name="";
//person.id = 32;
//Person *person = new Person();
//person->name = "ǰ ";
//person->age = 30;
//ofstream ofs;
//ofs.open("F:/write.txt");
//
//ofs << person.name << " "
// << person.age << " "
// << person.id << endl;
//ofs.write((const char*) &person, sizeof(Person12));
//ofs.close();
//ifstream ifs;
//ifs.open("f:/write.txt");
//char name[1024] = {0};
//int age;
//int id;
//string name;
//ifs >> name;
//ifs >> age;
//ifs >> id;
//cout << name << endl;
//cout << age << endl;
//cout << id << endl;
//ifs.close();
//Person12* per = new Person12();
//per->age = 8;
//per->id = 12;
//per->name = "zhangsan";
//Person12** arr;
//arr = new Person12*[20];
//arr[0] = per;
//cout << sizeof(Person12) << endl;
//ifstream ifs;
//ifs.open("f:/workerBook.txt");
//while (ifs >> id >> name >> age)
//{
// cout << " id: "<< id << " name: "<< name<< " age: " << age << endl;
//
//}
//char arr[] = { "zhangsana" };
// //int arr[] = {10,15,2,56,4,88,55,6};
//
//
//for (int i = 0; i < sizeof(arr) / sizeof(char); i++ )
//{
// for (int j = i+1; j < sizeof(arr) / sizeof(char); j++)
// {
// char temp;
// if (arr[i] < arr[j]) {
//
// temp = arr[j];
// arr[j] = arr[i];
// arr[i] = temp;
//
// }
//
// }
//
//}
//cout << arr << endl;
if (hm == NULL) {
cout << "dllʧ ûҵ" << endl;
return 0;
}
_Hello hel = (_Hello)GetProcAddress(hm, "Hello");
_Hell hel2 = (_Hell)GetProcAddress(hm, "getNum");
int c = (*hel)(3, 5);
int b = (*hel2)(3);
cout << c << endl;
cout << b << endl;
return 0;
} | true |
151a741db1c9167175a523b7355e32a02041a091 | C++ | raebex/twitter-roboplush | /roboplush-twitter-arduino/roboplush-twitter-arduino.ino | UTF-8 | 3,403 | 2.828125 | 3 | [] | no_license | #include <Servo.h>
//servos
Servo myservo;
Servo myservoTwo;
int pos1 = 0;
int pos2 = 30;
long interval = 15;
int t = 0; //iterator for servo delay
int motorSteps = 0;
//capture incoming serial data from node server
char incomingByte = 0;
//matrix
int outTop = 13;
int outBottom = 12;
int in1 = 11;
int in2 = 10;
int in3 = 9;
int in4 = 8;
int in5 = 7;
//eyes
const int eyes = 6;
void setup() {
//eyes
pinMode(eyes, OUTPUT);
//matrix
pinMode(outTop, OUTPUT);
pinMode(outBottom, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
pinMode(in5, OUTPUT);
//servos
myservo.attach(3);
myservo.write(30);
myservoTwo.attach(5);
myservoTwo.write(0);
//plushie starts off with neutral expression
//and eyes on
neutral();
digitalWrite(eyes, HIGH);
//start serial
Serial.begin(9600);
}
void loop() {
//check if serial is available
if (Serial.available() > 0) {
incomingByte = Serial.read();
if(incomingByte == 49) {
//if tag is '1'
happy();
}else if(incomingByte == 50) {
//if tag is '2'
sad();
}else if(incomingByte == 51) {
//if tag is '3' or something else
for(int i = 0; i<3; i++) {
meh();
}
}
} else {
//otherwise, neutral
neutral();
}
}
void neutral(){
digitalWrite(in1, HIGH);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, HIGH);
digitalWrite(in5, HIGH);
digitalWrite(outTop, LOW);
digitalWrite(outBottom, HIGH);
}
void happy(){
for (int i = 0; i < 3000; i++) {
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
digitalWrite(in5, HIGH);
digitalWrite(outTop, LOW);
digitalWrite(outBottom, HIGH);
delay(1);
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, HIGH);
digitalWrite(in5, LOW);
digitalWrite(outTop, HIGH);
digitalWrite(outBottom, LOW);
delay(1);
}
}
void sad(){
for (int i = 0; i < 2000; i++) {
digitalWrite(in1, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
digitalWrite(in5, HIGH);
digitalWrite(outTop, HIGH);
digitalWrite(outBottom, LOW);
delay(1);
digitalWrite(in1, LOW); // turn the LED on (HIGH is the voltage level)
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, HIGH);
digitalWrite(in5, LOW);
digitalWrite(outTop, LOW);
digitalWrite(outBottom, HIGH);
delay(1);
}
}
void meh(){
digitalWrite(in1, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, HIGH);
digitalWrite(in5, HIGH);
digitalWrite(outTop, LOW);
digitalWrite(outBottom, HIGH);
t = 0;
motorSteps = 0;
for (int i = 0; i < 30; i++) {
while(motorSteps < 30) {
pos1 = 0 + motorSteps; // servo1 from 30 to 0 degrees
pos2 = 30 - motorSteps; // servo2 from 0 to 30 degrees
if(t == 0){
myservo.write(pos1);
myservoTwo.write(pos2);
motorSteps = motorSteps +1;
}
t = (t+1) % 10;
delay(2);
}
}
}
| true |
1650ad70de55692ed47ba5b07ab12a1202d9fe21 | C++ | hohaidang/CPP_Basic2Advance | /Learning/WriteTxt/Source.cpp | UTF-8 | 450 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <time.h>
#include <random>
#include <sstream>
#include <string>
#include <iomanip>
using namespace std;
int main() {
random_device rd;
mt19937 gen(rd());
uniform_real_distribution<> distribution(1000000000, 2000000000);
ofstream myFile;
myFile.open("LargeData.txt");
for (int i = 0; i < 10000000; ++i) {
int ids = distribution(gen);
myFile << ids << " " << rand() << endl;
}
return 0;
} | true |
8daf8b20bf76febd898dafd99f5fcf52a3ac9197 | C++ | csellsword/Asteroids | /WinMgr.cpp | UTF-8 | 563 | 2.53125 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <GL/glfw.h>
#include "WinMgr.h"
//default constructor
//creates asteroid window
WinMgr::WinMgr(){
//start glfw
if(!glfwInit()){
fprintf(stderr,"Call to glfwInit() failed\n");
exit(-1);
}
//creates default glfw window
if(!glfwOpenWindow(0,0,0,0,0,0,0,0,GLFW_WINDOW)){
fprintf(stderr,"Call to glfwOpenWindow() failed\n");
glfwTerminate();
exit(-1);
}
glfwSetWindowTitle("Asteroids");
glClearColor(0,0,0,0);
gluOrtho2D(0,640,0,480);
}
WinMgr::~WinMgr(){
glfwCloseWindow();
glfwTerminate();
}
| true |
579ef66febad95d7d5c66519dcd71be18c13cd6f | C++ | LucasVB-TheyCallMeAPoro/Graphics-Programming | /RayTracer/PerspectiveCamera.cpp | UTF-8 | 1,752 | 2.890625 | 3 | [] | no_license | #include "pch.h"
#include "PerspectiveCamera.h"
#include "Ray.h"
#include <cmath>
using namespace Elite;
PerspectiveCamera::PerspectiveCamera()
:m_Position{ 0,0,0 }
, m_FOV{ 0 }
, m_AspectRatio{ 0 }
, m_WorldUp{ 0,1,0 }
, m_Pitch{ 0.f }
, m_Yaw{ 0.f }
{
}
PerspectiveCamera::PerspectiveCamera(const Elite::FPoint3& Pos, float FOV, float AspectR)
:m_Position{Pos}
,m_FOV{FOV}
,m_AspectRatio{AspectR}
,m_WorldUp{0,1,0}
,m_Pitch{0.f}
,m_Yaw{0.f}
{
}
void PerspectiveCamera::CalcRay(Ray& ray, int c, int r, int width, int height) const
{
ray.direction = GetNormalized(FVector3{ (float)(2 * ((c + 0.5) / width) - 1) * m_AspectRatio * m_FOV,(float)(1 - 2 * ((r + 0.5) / height)) * m_FOV, -1 });
ray.origin = m_Position;
}
void PerspectiveCamera::Update()
{
m_CameraControl.Update(*this);
}
Elite::FMatrix4 PerspectiveCamera::CalculateMatrix() const
{
FVector3 direction{ GetDirection() };
FVector3 right = GetNormalized(Cross(m_WorldUp, direction));
FVector3 up = Cross(direction, right);
return Elite::FMatrix4{ FVector4{right},FVector4{up},FVector4{direction},FVector4{m_Position} };
}
const Elite::FPoint3& PerspectiveCamera::GetPosition() const
{
return m_Position;
}
void PerspectiveCamera::SetPosition(const Elite::FPoint3& pos)
{
m_Position = pos;
}
Elite::FVector3 PerspectiveCamera::GetDirection() const
{
FVector3 direction{};
direction.x = sin(-m_Yaw) * cos(m_Pitch);
direction.y = -sin(m_Pitch);
direction.z = cos(-m_Yaw) * cos(m_Pitch);
return direction;
}
float PerspectiveCamera::GetYaw() const
{
return m_Yaw;
}
void PerspectiveCamera::SetYaw(float yaw)
{
m_Yaw = yaw;
}
float PerspectiveCamera::GetPitch() const
{
return m_Pitch;
}
void PerspectiveCamera::SetPitch(float pitch)
{
m_Pitch = pitch;
}
| true |
e86c7fa0b9c7d1262046348c846fa369a42c46a6 | C++ | zrss/LeetCode | /Subsets.cpp | UTF-8 | 993 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<vector<int>> subsets(vector<int>& nums) {
sort(nums.begin(), nums.end());
vector<vector<int>> rel;
rel.push_back(vector<int>());
vector<int> tmp;
aux(rel, tmp, nums, 0);
return rel;
}
void aux(vector<vector<int>>& rel, vector<int>& tmp, vector<int>& nums, int curIndex) {
for (int i = curIndex; i < nums.size(); ++i) {
tmp.push_back(nums[i]);
rel.push_back(tmp);
aux(rel, tmp, nums, i + 1);
tmp.pop_back();
}
}
};
int main() {
vector<int> nums = {1,2,3};
Solution solution;
vector<vector<int>> rel = solution.subsets(nums);
for (auto itr = rel.begin(); itr != rel.end(); ++itr) {
for (auto each = itr->begin(); each != itr->end(); ++each) {
cout << *each << " ";
}
cout << endl;
}
return 0;
} | true |
2a3fc4a02c76e158ed37d9b49807ff0b94c00141 | C++ | csy-59/C-Study | /7~9/9-2.cpp | UTF-8 | 470 | 3.125 | 3 | [] | no_license | #include <iostream>
#include "Fan.h"
using namespace std;
int main() {
Fan f1, f2;
f1.setSpeed(3);
f1.setOn(true);
f1.setRadius(10);
f2.setSpeed(2);
f2.setOn(false);
f2.setRadius(5);
cout << "f1 is..." << endl;
cout << "Speed: " << f1.getSpeed() << " On: " << f1.getOn() << " Radius: " << f1.getRadius() << endl;
cout << "f2 is..." << endl;
cout << "Speed: " << f2.getSpeed() << " On: " << f2.getOn() << " Radius: " << f2.getRadius() << endl;
return 0;
} | true |
12330fae7e671c549e92624e82c4fadb976b8062 | C++ | eigenbom/SDS | /SDSMath/src/basis.cpp | UTF-8 | 23,219 | 2.75 | 3 | [] | no_license | #include "basis.h"
#include "hmath.h"
#include <iostream>
using namespace Math;
using std::string;
// Basis
std::vector<Parameter> Basis::mParameters;
bool Basis::mInit = false;
Basis::Basis()
:pContrast(1),pXScale(1),pYScale(1),pZScale(1)
{
if (!mInit)
{
mParameters.push_back(Parameter("contrast",0.0f,10.0,1.f));
mParameters.push_back(Parameter("xscale",0.0f,10.0,1.f));
mParameters.push_back(Parameter("yscale",0.0f,10.0,1.f));
mParameters.push_back(Parameter("zscale",0.0f,10.0,1.f));
mInit = true;
}
}
const Parameter*
Basis::getParameter(string name)
{
std::vector<Parameter>::const_iterator it = getParameters().begin();
while (it!=mParameters.end())
{
if (it->name == name) return &(*it);
it++;
}
return NULL;
}
void
Basis::
setParameter(string name, double f)
{
if (name=="contrast") pContrast = f;
else if (name=="xscale") pXScale = f;
else if (name=="yscale") pYScale = f;
else if (name=="zscale") pZScale = f;
}
void
Basis::
setParameter(string name, int i)
{
}
double
Basis::
getParameterf(string name)
{
if (name=="contrast") return pContrast;
else if (name=="xscale") return pXScale;
else if (name=="yscale") return pYScale;
else if (name=="zscale") return pZScale;
return 0;
}
int
Basis::
getParameteri(string name)
{
return 0;
}
// Checker
double
Checker::
operator()(double x, double y, double z)
{
// determine which block I'm in
int ix = (int)(x*xs());
int iy = (int)(y*ys());
int iz = (int)(z*zs());
return applyParams((double)((((ix+iy)&1) + iz)&1));
}
// Sphere
double
Sphere::
operator()(double x, double y, double z)
{
// determine which block I'm in
int ix = (int)(x*xs()); double dx = x - ix - 0.5;
int iy = (int)(y*ys()); double dy = y - iy - 0.5;
int iz = (int)(z*zs()); double dz = z - iz - 0.5;
double sq_dist = sqrt(dx*dx + dy*dy + dz*dz) * 2;
return applyParams(Math::clamp(0,1,1 - sq_dist));
}
// Noise
const int Noise::SZ = 256;
const int Noise::SZM = Noise::SZ - 1;
Noise::Noise(int repeat):mRNG(),REPEAT(repeat),REPEATM(repeat-1){_init();}
Noise::Noise(unsigned long seed,int repeat):mRNG(seed),REPEAT(repeat),REPEATM(repeat-1){_init();}
Noise::~Noise(){delete[]P;}
void
Noise::
_init()
{
P = new byte[SZ*2];
// P[] = [0..255];
int i;
for(i=0;i<SZ;i++)
P[i] = i;
// permute P
for(i=0;i<SZ;i++){
byte j = (byte)(256*mRNG.getFloat());
byte tmp = P[j];
P[j] = P[i];
P[i] = tmp;
}
for (i=0;i<SZ;i++)
{
P[i+SZ] = P[i];
}
}
double Noise::snoise(double x, double y, double z)
{
// compute which cell we are in
int i = (int)floor(x); int ii = i&REPEATM; int ii1 = (i+1)&REPEATM;
int j = (int)floor(y); int jj = j&REPEATM; int jj1 = (j+1)&REPEATM;
int k = (int)floor(z); int kk = k&REPEATM; int kk1 = (k+1)&REPEATM;
fvec rel = {x-i,y-j,z-k};
double u = smoothstep(rel.x);
double v = smoothstep(rel.y);
double w = smoothstep(rel.z);
double x1 = grad(ii,jj,kk,rel);
rel.x -= 1;
double x2 = grad(ii1,jj,kk,rel);
double y1 = lerp(x1,x2,u);
rel.x = x - i;
rel.y = y - j - 1;
x1 = grad(ii,jj1,kk,rel);
rel.x -= 1;
x2 = grad(ii1,jj1,kk,rel);
double y2 = lerp(x1,x2,u);
double z1 = lerp(y1,y2,v);
rel.x = x - i;
rel.y = y - j;
rel.z = z - k - 1;
x1 = grad(ii,jj,kk1,rel);
rel.x -= 1;
x2 = grad(ii1,jj,kk1,rel);
y1 = lerp(x1,x2,u);
rel.x = x - i;
rel.y = y - j - 1;
x1 = grad(ii,jj1,kk1,rel);
rel.x -= 1;
x2 = grad(ii1,jj1,kk1,rel);
y2 = lerp(x1,x2,u);
double z2 = lerp(y1,y2,v);
return lerp(z1,z2,w);
}
double
Noise::
operator()(double x, double y, double z)
{
return applyParams((1+snoise(x*xs(),y*ys(),z*zs()))/2);
}
inline int Noise::fold(int i, int j, int k)
{
return P[ P[ P[i]+j ]+k ];
}
inline int Noise::fold(vec& v)
{
return P[ P[ P[v[0]]+v[1] ]+v[2] ];
}
inline double Noise::grad(int i, int j, int k, fvec& r)
{
/* adapted from Perlin's improved noise java implementation
http://mrl.nyu.edu/~perlin/noise/
*/
int h = fold(i,j,k) & 15; // CONVERT LO 4 BITS OF HASH CODE
double u = h<8 ? r.x : r.y; // INTO 12 GRADIENT DIRECTIONS.
double v = h<4 ? r.y : h==12||h==14 ? r.x : r.z;
return ((h&1) == 0 ? u : -u) + ((h&2) == 0 ? v : -v);
}
inline double Noise::smoothstep (double t)
{
return t*t*t*(10-t*(15-6*t)); //a smoother C^2 interpolation function
}
inline double Noise::dot(fvec& a, fvec& b)
{
return a.x*b.x + a.y*b.y + a.z*b.z;
}
// Turbulence
const int Turbulence::OCTAVES = 8;
std::vector<Parameter> Turbulence::mParameters;
Turbulence::Turbulence(int numOctaves)
:mNoise(),mOctaves(numOctaves),mLacunarity(2.0)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("octaves",1,16,OCTAVES));
mParameters.push_back(Parameter("lacunarity",0.01,4.0,2.0f));
}
}
Turbulence::Turbulence(unsigned long seed, int numOctaves)
:mNoise(seed),mOctaves(numOctaves),mLacunarity(2.0)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("octaves",1,16,OCTAVES));
mParameters.push_back(Parameter("lacunarity",0.01,4.0,2.0f));
}
}
double
Turbulence::
operator()(double x, double y, double z)
{
x*=xs();
y*=ys();
z*=zs();
// 1/f fractal (using impr. noise)
double val = 0;
int i;
double f = 1;
for(i=0;i<mOctaves;i++)
{
val += fabs(mNoise.snoise(x,y,z))*f;
x *= mLacunarity; y *= mLacunarity; z *= mLacunarity;
f /= mLacunarity;
}
return applyParams(val);
}
void Turbulence::setParameter(string name, double f)
{
if (name=="lacunarity") mLacunarity = f;
else Basis::setParameter(name,f);
}
void Turbulence::setParameter(string name, int i)
{
if (name=="octaves") mOctaves = i;
else
Basis::setParameter(name,i);
}
double Turbulence::getParameterf(string name)
{
if (name=="lacunarity") return mLacunarity;
else return Basis::getParameterf(name);
}
int Turbulence::getParameteri(string name)
{
if (name=="octaves") return mOctaves;
else
return Basis::getParameteri(name);
}
// FBM
const int FBM::OCTAVES = 8;
std::vector<Parameter> FBM::mParameters;
FBM::FBM()
:mBasis(0),mLacunarity(2),mOctaves(OCTAVES)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("octaves",1,16,OCTAVES));
mParameters.push_back(Parameter("lacunarity",0.01,4.0,2.0f));
}
}
FBM::~FBM()
{
}
double
FBM::
operator()(double x, double y, double z)
{x*=xs();
y*=ys();
z*=zs();
double val = 0;
int i;
double f = 1;
for(i=0;i<mOctaves;i++)
{
val += (*mBasis)(x,y,z)*f;
x *= mLacunarity; y *= mLacunarity; z *= mLacunarity;
f /= mLacunarity;
}
return applyParams(val/2);
}
void FBM::setParameter(string name, double f)
{
if (name=="lacunarity") mLacunarity = f;
else Basis::setParameter(name,f);
}
void FBM::setParameter(string name, int i)
{
if (name=="octaves") mOctaves = i;
else
Basis::setParameter(name,i);
}
double FBM::getParameterf(string name)
{
if (name=="lacunarity") return mLacunarity;
else return Basis::getParameterf(name);
}
int FBM::getParameteri(string name)
{
if (name=="octaves") return mOctaves;
else
return Basis::getParameteri(name);
}
// Voronoi
Voronoi::Voronoi(unsigned int repeat, double lambda)
:mRandom(),mLambda(lambda),mRepeat(repeat),mRepeatM(repeat-1)
{
_init();
}
Voronoi::Voronoi(unsigned long seed, unsigned int repeat, double lambda)
:mRandom(seed),mLambda(lambda),mRepeat(repeat),mRepeatM(repeat-1)
{
_init();
}
void Voronoi::_init()
{
// setup a table of the cdf up to m = 5
// P(lambda,0) = e^-lambda
// P(lambda,m) = lambda/m * P(lambda,m-1)
static double P[5];
P[0] = exp(-mLambda);
int i;
for(i=1;i<5;i++)
{
P[i] = (1 + (mLambda/i)) * P[i-1];
}
// initialise num pts table
for(i=0;i<256;i++)
{
double p = mRandom.getFloat(); // a num in [0,1]
// find out where p exists in the cdf
int j;
for(j=0;j<5;j++)
{
if (p < P[j]) break;
}
// j pts
mTable[i] = j;
}
}
double
Voronoi::
operator()(double x, double y, double z)
{x*=xs();
y*=ys();
z*=zs();
// Based on Worley's implementation in T&M.
// i = floor x, j = floor y, k = floor z
int i = (int)floor(x); double fx = x-i;
int j = (int)floor(y); double fy = y-j;
int k = (int)floor(z); double fz = z-k;
double closest = 999999;
double tmp = closestInCube(i,j,k,x,y,z);
if (tmp<closest) closest = tmp;
// sm = smallest n'th dist
// figure out if any neighbouring cubes are closer than sm (by comparing squared distances)
double xx = fx*fx; double xx1 = 1 + xx - 2*fx;
double yy = fy*fy; double yy1 = 1 + yy - 2*fy;
double zz = fz*fz; double zz1 = 1 + zz - 2*fz;
int ii,jj,kk;
for(ii=-1;ii<=1;ii++)
for(jj=-1;jj<=1;jj++)
for(kk=-1;kk<=1;kk++)
{
if (ii==0 && jj==0 && kk==0) continue;
double dist = closest;
bool t = false;
if (ii<0 && xx<dist) t = true;
else if (ii>0 && xx1<dist) t = true;
if (jj<0 && yy<dist) t = true;
else if (jj>0 && yy1<dist) t = true;
if (kk<0 && zz<dist) t = true;
else if (kk>0 && zz1<dist) t = true;
if (t) // then we have a possible cuboid
{
// else the cube is closer than the closest point so we have to check its points
double tmp = closestInCube(ii+i,jj+j,kk+k,x,y,z);
if (tmp<closest) closest = tmp;
}
}
return applyParams(sqrt(closest));
}
double
Voronoi::
operator()(double x, double y, double z, int n) // specify n
{x*=xs();
y*=ys();
z*=zs();
// this returns the distance to the n'th closest point (for n=1 use the other version)
// Based on Worley's implementation in T&M.
// i = floor x, j = floor y, k = floor z
int i = (int)floor(x); double fx = x-i;
int j = (int)floor(y); double fy = y-j;
int k = (int)floor(z); double fz = z-k;
double* closest = new double[n];
int it;
for(it=0;it<n;it++) closest[it] = 999999; //some large number
closestNthInCube(i,j,k,x,y,z,n,closest);
// sm = smallest n'th dist
// figure out if any neighbouring cubes are closer than sm (by comparing squared distances)
double xx = fx*fx; double xx1 = 1 + xx - 2*fx;
double yy = fy*fy; double yy1 = 1 + yy - 2*fy;
double zz = fz*fz; double zz1 = 1 + zz - 2*fz;
int ii,jj,kk;
for(ii=-1;ii<=1;ii++)
for(jj=-1;jj<=1;jj++)
for(kk=-1;kk<=1;kk++)
{
if (ii==0 && jj==0 && kk==0) continue;
double dist = closest[n-1];
bool t = false;
if (ii<0 && xx<dist) t = true;
else if (ii>0 && xx1<dist) t = true;
if (jj<0 && yy<dist) t = true;
else if (jj>0 && yy1<dist) t = true;
if (kk<0 && zz<dist) t = true;
else if (kk>0 && zz1<dist) t = true;
if (t) // then we have a possible cuboid
{
// else the cube is closer than the closest point so we have to check its points
closestNthInCube(ii+i,jj+j,kk+k,x,y,z,n,closest);
}
}
double nth = closest[n-1];
delete[]closest;
return sqrt(nth);
}
double
Voronoi::
n2n1(double x, double y, double z) // specify n
{
// this returns n2 - n1
// Based on Worley's implementation in T&M.
// i = floor x, j = floor y, k = floor z
int i = (int)floor(x); double fx = x-i;
int j = (int)floor(y); double fy = y-j;
int k = (int)floor(z); double fz = z-k;
double* closest = new double[2];
int it;
for(it=0;it<2;it++) closest[it] = 999999; //some large number
closestNthInCube(i,j,k,x,y,z,2,closest);
// sm = smallest n'th dist
// figure out if any neighbouring cubes are closer than sm (by comparing squared distances)
double xx = fx*fx; double xx1 = 1 + xx - 2*fx;
double yy = fy*fy; double yy1 = 1 + yy - 2*fy;
double zz = fz*fz; double zz1 = 1 + zz - 2*fz;
int ii,jj,kk;
for(ii=-1;ii<=1;ii++)
for(jj=-1;jj<=1;jj++)
for(kk=-1;kk<=1;kk++)
{
if (ii==0 && jj==0 && kk==0) continue;
double dist = closest[1];
bool t = false;
if (ii<0 && xx<dist) t = true;
else if (ii>0 && xx1<dist) t = true;
if (jj<0 && yy<dist) t = true;
else if (jj>0 && yy1<dist) t = true;
if (kk<0 && zz<dist) t = true;
else if (kk>0 && zz1<dist) t = true;
if (t) // then we have a possible cuboid
{
// else the cube is closer than the closest point so we have to check its points
closestNthInCube(ii+i,jj+j,kk+k,x,y,z,2,closest);
}
}
double sum = sqrt(closest[1]) - sqrt(closest[0]);
delete[]closest;
return sum;
}
unsigned long
Voronoi::
getCell(double x, double y, double z)
{
// Based on Worley's implementation in T&M.
// i = floor x, j = floor y, k = floor z
int i = (int)floor(x); double fx = x-i;
int j = (int)floor(y); double fy = y-j;
int k = (int)floor(z); double fz = z-k;
double closest = 999999;
unsigned long ref = 0;
double tmp = closestInCube(i,j,k,x,y,z,ref);
if (tmp<closest) closest = tmp;
// sm = smallest n'th dist
// figure out if any neighbouring cubes are closer than sm (by comparing squared distances)
double xx = fx*fx; double xx1 = 1 + xx - 2*fx;
double yy = fy*fy; double yy1 = 1 + yy - 2*fy;
double zz = fz*fz; double zz1 = 1 + zz - 2*fz;
int ii,jj,kk;
for(ii=-1;ii<=1;ii++)
for(jj=-1;jj<=1;jj++)
for(kk=-1;kk<=1;kk++)
{
if (ii==0 && jj==0 && kk==0) continue;
double dist = closest;
bool t = false;
if (ii<0 && xx<dist) t = true;
else if (ii>0 && xx1<dist) t = true;
if (jj<0 && yy<dist) t = true;
else if (jj>0 && yy1<dist) t = true;
if (kk<0 && zz<dist) t = true;
else if (kk>0 && zz1<dist) t = true;
if (t) // then we have a possible cuboid
{
// else the cube is closer than the closest point so we have to check its points
unsigned long tmpRef;
double tmp = closestInCube(ii+i,jj+j,kk+k,x,y,z,tmpRef);
if (tmp<closest)
{
closest = tmp;
ref = tmpRef;
}
}
}
return ref;
}
inline
void
Voronoi::
insert(double el, double* arr, int sz) // insertion sort
{
int i = sz - 1;
if (el>=arr[i]) return;
for(;el<arr[i-1] && i>0;i--)
{
arr[i] = arr[i-1];
}
arr[i] = el;
}
inline
void
Voronoi::
closestNthInCube(int i, int j, int k, double x, double y, double z, int n, double* closest)
{
// seed = hash i,j,k
unsigned long seed = hash(i&mRepeatM,j&mRepeatM,k&mRepeatM);
// use seed to hash into table of 256 precomputed values for the number of pts in the cell
// use upper 8 bits
int numPts = mTable[seed >> 24];
// use seed to seed rng and get the x,y,z coords of each pt (relative to i,j,k)
// as we generate each pt we keep a sorted list of the nearest n points (i.e. insertion sort)
// for voronoi (n=1) just store the closest distance^2
//seed = 1402024253*seed + 586950981;
mRandom.seed(seed);
int ii;
for(ii=0;ii<numPts;ii++)
{
double x0,y0,z0;
/*
x0 = (i + (seed+0.5)*(1.0/42944967296.0)) - x; // was mRandom.getFloat()
seed = 1402024253*seed + 586950981;
y0 = (j + (seed+0.5)*(1.0/42944967296.0)) - y;
seed = 1402024253*seed + 586950981;
z0 = (k + (seed+0.5)*(1.0/42944967296.0)) - z;
seed = 1402024253*seed + 586950981;
*/
x0 = (i + mRandom.getFloat()) - x;
y0 = (j + mRandom.getFloat()) - y;
z0 = (k + mRandom.getFloat()) - z;
double tmp = x0*x0 + y0*y0 + z0*z0;
insert(tmp,closest,n);
}
}
inline
double
Voronoi::
closestInCube(int i, int j, int k, double x, double y, double z)
{
// seed = hash i,j,k
unsigned long seed = hash(i&mRepeatM,j&mRepeatM,k&mRepeatM);
// use seed to hash into table of 256 precomputed values for the number of pts in the cell
// use upper 8 bits
int numPts = mTable[seed >> 24];
// use seed to seed rng and get the x,y,z coords of each pt (relative to i,j,k)
// as we generate each pt we keep a sorted list of the nearest n points (i.e. insertion sort)
// for voronoi (n=1) just store the closest distance^2
//seed = 1402024253*seed + 586950981;
mRandom.seed(seed); //<- wow this is slow!!! use a simple lcm method instead
double closest = 999999;
int ii;
for(ii=0;ii<numPts;ii++)
{
double x0,y0,z0;
/*
x0 = (i + seed*(1.0/42944967296.0)) - x; // was mRandom.getFloat()
seed = 1402024253*seed + 586950981;
y0 = (j + seed*(1.0/42944967296.0)) - y;
seed = 1402024253*seed + 586950981;
z0 = (k + seed*(1.0/42944967296.0)) - z;
seed = 1402024253*seed + 586950981;
seed = 1402024253*seed + 586950981;
*/
x0 = (i + mRandom.getFloat()) - x;
y0 = (j + mRandom.getFloat()) - y;
z0 = (k + mRandom.getFloat()) - z;
double tmp = x0*x0 + y0*y0 + z0*z0;
if (tmp < closest) closest = tmp;
}
return closest;
}
inline
double
Voronoi::
closestInCube(int i, int j, int k, double x, double y, double z, unsigned long& ref)
{
// seed = hash i,j,k
unsigned long seed = hash(i&mRepeatM,j&mRepeatM,k&mRepeatM);
// use seed to hash into table of 256 precomputed values for the number of pts in the cell
// use upper 8 bits
int numPts = mTable[seed >> 24];
// use seed to seed rng and get the x,y,z coords of each pt (relative to i,j,k)
// as we generate each pt we keep a sorted list of the nearest n points (i.e. insertion sort)
// for voronoi (n=1) just store the closest distance^2
//seed = 1402024253*seed + 586950981;
mRandom.seed(seed);
double closest = 999999;
int ii;
for(ii=0;ii<numPts;ii++)
{
unsigned long currentRef = mRandom.seed();
double x0,y0,z0;
/*
x0 = (i + (seed+0.5)*(1.0/42944967296.0)) - x; // was mRandom.getFloat()
seed = 1402024253*seed + 586950981;
y0 = (j + (seed+0.5)*(1.0/42944967296.0)) - y;
seed = 1402024253*seed + 586950981;
z0 = (k + (seed+0.5)*(1.0/42944967296.0)) - z;
seed = 1402024253*seed + 586950981;
*/
x0 = (i + mRandom.getFloat()) - x;
y0 = (j + mRandom.getFloat()) - y;
z0 = (k + mRandom.getFloat()) - z;
currentRef += mRandom.seed();
double tmp = x0*x0 + y0*y0 + z0*z0;
if (tmp < closest)
{
closest = tmp;
ref = currentRef;
}
}
return closest;
}
inline
unsigned long
Voronoi::
hash(long i, long j, long k)
{
// from Worley T&M pg.143
return (702395077*i + 915488749*j + 2120969693*k);
}
// BPerturber
std::vector<Parameter> BPerturber::mParameters;
BPerturber::BPerturber() // :mBasis(b),mVar(var){}
:mBasis(0),mPerturb(0),mX(0.1),mY(0.1),mZ(0.1)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("xperturb",-10.0f,10.0f,0.1f));
mParameters.push_back(Parameter("yperturb",-10.0f,10.0f,0.1f));
mParameters.push_back(Parameter("zperturb",-10.0f,10.0f,0.1f));
}
}
void
BPerturber::
setParameter(string name, double f)
{
if (name=="xperturb") mX = f;
else if (name=="yperturb") mY = f;
else if (name=="zperturb") mZ = f;
else Basis::setParameter(name,f);
}
double
BPerturber::
getParameterf(string name)
{
if (name=="xperturb") return mX;
else if (name=="yperturb") return mY;
else if (name=="zperturb") return mZ;
else return Basis::getParameterf(name);
}
double
BPerturber::
operator()(double x, double y, double z)
{x*=xs();
y*=ys();
z*=zs();
double am = (*mPerturb)(x,y,z);
return applyParams((*mBasis)(x+am*mX,y+am*mY,z+am*mZ));
}
// BStepper
std::vector<Parameter> BStepper::mParameters;
BStepper::BStepper() // :mBasis(b),mVar(var){}
:mBasis(0),mVar(0.5)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("step",0.0f,1.0f,0.5f));
}
}
void
BStepper::
setParameter(string name, double f)
{
if (name=="step") mVar = f;
else Basis::setParameter(name,f);
}
double
BStepper::
getParameterf(string name)
{
if (name=="step") return mVar;
else return Basis::getParameterf(name);
}
// BGainer
std::vector<Parameter> BGainer::mParameters;
BGainer::BGainer() // :mBasis(b),mVar(var){}
:mBasis(0),mVar(0.5)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("gain",0.0f,1.0f,0.5f));
}
}
void
BGainer::
setParameter(string name, double f)
{
if (name=="gain") mVar = f;
else Basis::setParameter(name,f);
}
double
BGainer::
getParameterf(string name)
{
if (name=="gain") return mVar;
else return Basis::getParameterf(name);
}
// BLerper
ParamList BLerper::mParameters;
BLerper::BLerper() //Basis* one, Basis* two, double amount)
:mOne(0),mTwo(0),mAmount(0.5)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("amount",0.0,1.0,0.5f));
}
}
double
BLerper::
operator()(double x, double y, double z) // returns a single double in the range [0,1]
{x*=xs();
y*=ys();
z*=zs();
return applyParams(Math::lerp((*mOne)(x,y,z),(*mTwo)(x,y,z),mAmount));
}
void BLerper::setParameter(string name, double f)
{
if (name=="amount") mAmount = f;
else
Basis::setParameter(name,f);
}
double BLerper::getParameterf(string name)
{
if (name=="amount") return mAmount;
else
return Basis::getParameterf(name);
}
// BScaler
std::vector<Parameter> BScaler::mParameters;
BScaler::BScaler() // :mBasis(b),mVar(var){}
:mBasis(0),mX(1),mY(1),mZ(1)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("x",-5.0f,5.0f,1.f));
mParameters.push_back(Parameter("y",-5.0f,5.0f,1.f));
mParameters.push_back(Parameter("z",-5.0f,5.0f,1.f));
}
}
void
BScaler::
setParameter(string name, double f)
{
if (name=="x") mX = f;
else if (name=="y") mY = f;
else if (name=="z") mZ = f;
else Basis::setParameter(name,f);
}
double
BScaler::
getParameterf(string name)
{
if (name=="x") return mX;
else if (name=="y") return mY;
else if (name=="z") return mZ;
else return Basis::getParameterf(name);
}
double
BDarken::
operator()(double x, double y, double z) // returns a single double in the range [0,1]
{x*=xs();
y*=ys();
z*=zs();
return applyParams((*mOne)(x,y,z) * Math::lerp(1,(*mTwo)(x,y,z),mAmount));
}
// BDarken
ParamList BDarken::mParameters;
BDarken::BDarken() //Basis* one, Basis* two, double amount)
:mOne(0),mTwo(0),mAmount(0.5)
{
if (mParameters.size()==0)
{
mParameters = Basis::mParameters;
mParameters.push_back(Parameter("amount",0.0,1.0,0.5f));
}
}
void BDarken::setParameter(string name, double f)
{
if (name=="amount") mAmount = f;
else
Basis::setParameter(name,f);
}
double BDarken::getParameterf(string name)
{
if (name=="amount") return mAmount;
else
return Basis::getParameterf(name);
}
| true |
d40091704808ec74a1d2cf001bf6bf11c1ceb8ca | C++ | eschipellite/GamePhysics | /GamePhysics_EvanSchipellite_ForceGame/GamePhysics_EvanSchipellite/Contact.h | UTF-8 | 1,121 | 2.796875 | 3 | [] | no_license | //=============================================================================
// Contact
//
// Written by Evan Schipellite
//
// Stores and resolves collisions
//=============================================================================
#ifndef CONTACT_H
#define CONTACT_H
//=============================================================================
#include "Vector3D.h"
class PhysicsObject;
//=============================================================================
class Contact
{
private:
PhysicsObject* mp_ContactOne;
PhysicsObject* mp_ContactTwo;
float m_Restitution;
float m_Penetration;
Vector3D m_ContactNormal;
private:
void resolveVelocity(float deltaTime);
void resolveInterpenetration(float deltaTime);
float calculateSeparatingVelocity();
public:
Contact(float restitution, float penetration, Vector3D contactNormal, PhysicsObject* contactOne, PhysicsObject* contactTwo = nullptr);
~Contact();
void Resolve(float deltaTime);
};
//=============================================================================
#endif // CONTACT_H | true |
f65381bc0e153a8d485be36159a63339a69f7bfa | C++ | pickjd1/BITCourseWork-Year3 | /3rd Year IN613 C++ Programming/Practicals7-12/JoelPickworthWeek09ScrollingTileMap/pickjd1TileMapLab/TileMap.cpp | UTF-8 | 1,369 | 3.046875 | 3 | [] | no_license | #include "StdAfx.h"
#include "TileMap.h"
using namespace System::IO;
//tile map constructor
TileMap::TileMap(TileList^ startTileList, Graphics^ startCanvas)
{
tileList = startTileList;
canvas = startCanvas;
map = gcnew array<int,2>(COLS,ROWS);
}
//set the values of the map grid
void TileMap::setMapValue(int col, int row, int tileValue)
{
map[col,row] = tileValue;
}
//return the value of a grid square
int TileMap::getMapValue(int col, int row)
{
int currentTileIndex = map[col,row];
return currentTileIndex;
}
//draw the map
void TileMap::drawMap()
{
for (int col = 0; col < COLS; col++)
{
for (int row = 0; row < ROWS; row++)
{
int curIndex = map[col,row];
Bitmap^ curBitmap = tileList->getTileBitmap(curIndex);
int xLoc = col * curBitmap->Width;
int yLoc = row * curBitmap->Height;
canvas->DrawImage(curBitmap,xLoc, yLoc);
}
}
}
void TileMap::loadFromFile(String^ fileName)
{
array<String^>^ indexHolder = gcnew array<String^>(COLS);
int r = 0;
StreamReader^ file = gcnew StreamReader(fileName);
String^ line;
while (line = file->ReadLine())
{
array<String^>^ indexHolder = line->Split(',');
for (int c = 0; c < COLS; c++)
{
int tileValue = Convert::ToInt16(indexHolder[c]);
map[c,r] = tileValue;
}
r++;
}
file->Close();
}
| true |
6d7385d0a40c1c406e38783a41eee2fb3abd9d72 | C++ | DaDaMrX/ACM | /Code/General/CodeForces Gym100971K Palindromization (字符串).cpp | UTF-8 | 937 | 3.140625 | 3 | [] | no_license | // CodeForces Gym100971K Palindromization (字符串)
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 10;
char s[N], t[N];
void del(char s[], int t)
{
int len = strlen(s);
for (int i = t; i < len - 1; i++) s[i] = s[i + 1];
s[len - 1] = '\0';
}
void reverse(char s[])
{
int len = strlen(s);
for (int i = 0; i < len / 2; i++) swap(s[i], s[len - 1 - i]);
}
char str[N];
bool pal(char s[])
{
strcpy(str, s);
reverse(str);
return strcmp(str, s) == 0;
}
int main()
{
scanf("%s", s);
int len = strlen(s);
if (pal(s)) return printf("YES\n%d\n", len / 2 + 1), 0;
int i = 0;
while (i < len / 2 && s[i] == s[len - 1 - i]) i++;
strcpy(t, s);
del(t, i);
if (pal(t)) return printf("YES\n%d\n", i + 1), 0;
strcpy(t, s);
del(t, len - 1 - i);
if (pal(t)) return printf("YES\n%d\n", len - i), 0;
printf("NO\n");
return 0;
}
| true |
8de243984d2fcfc00c4543f4483bb6e4b17fb370 | C++ | MarioStoev99/Data-Structures-and-Algorithms-2019-2020 | /Homeworks/HW3/FindProteins.cpp | UTF-8 | 2,711 | 2.734375 | 3 | [] | no_license | #include "FindProteins.h"
const int FindProteins::notExistInSequence = -1;
const int FindProteins::notExistInFile = -2;
void FindProteins::inputLogic(string& filenameSequence,string& filenameCodonToAminoacids) {
getline(cin, filenameSequence);
getline(cin, proteinsFilename);
getline(cin, filenameCodonToAminoacids);
int numberOfProteints;
cin >> numberOfProteints;
for (int i = 0; i < numberOfProteints; ++i) {
ProteinInfo protein;
cin >> protein.id;
findRequests.push_back(protein);
}
}
void FindProteins::deserializeProteins() {
ifstream file(proteinsFilename.c_str());
if (!file) {
FileNotFoundException();
}
while (!file.eof()) {
unsigned long key;
string protein;
file >> key;
file.get();
getline(file, protein);
proteins.put(key, protein);
}
}
void FindProteins::deserializeAminoacids(const string& filename) {
ifstream file(filename.c_str());
if (!file) {
FileNotFoundException();
}
while (!file.eof()) {
string word;
char key;
getline(file, word, ' ');
file >> key;
file.get();
aminoacids.put(word, key);
}
}
void FindProteins::deserializeDNASequence(const string& filename) {
ifstream file(filename.c_str());
if (!file) {
throw FileNotFoundException();
}
getline(file, dna_sequence);
}
void FindProteins::takeOutAminoacidsFromProtein(ProteinInfo& protein,const string& prot) {
string amino;
for (char nucleotideBase : prot) {
amino += nucleotideBase;
if (amino.size() == 3) {
protein.aminoacidsInProtein.push_back(amino);
amino.clear();
}
}
}
void FindProteins::findTheBeginningOfEveryProteinInTheSequence() {
for (ProteinInfo& protein : findRequests) {
string prot = proteins.get(protein.id);
if (prot.empty()) {
protein.posInSequence = -2;
}
else {
protein.posInSequence = dna_sequence.find(prot);
if (protein.posInSequence > 0) {
takeOutAminoacidsFromProtein(protein, prot);
}
}
}
}
FindProteins::FindProteins() {
string dnaSequence, codonToAminoacids;
inputLogic(dnaSequence, codonToAminoacids);
deserializeDNASequence(dnaSequence);
deserializeProteins();
deserializeAminoacids(codonToAminoacids);
}
void FindProteins::findProteins() {
findTheBeginningOfEveryProteinInTheSequence();
for (const ProteinInfo& protein : findRequests) {
if (protein.posInSequence == notExistInFile) {
cout << "No protein in " << proteinsFilename << " with id " << protein.id << endl;
}
else if (protein.posInSequence == notExistInSequence) {
cout << "No" << endl;
}
else {
cout << "Yes " << protein.posInSequence << " ";
for (const string& amino : protein.aminoacidsInProtein) {
char c = aminoacids.get(amino);
if (c != '*') {
cout << c;
}
}
cout << endl;
}
}
}
| true |
2eb720567eb1c0dd633806f7570391204b09fa4f | C++ | cekaem/chess | /PgnCreator.h | UTF-8 | 534 | 2.6875 | 3 | [] | no_license | #ifndef PGN_CREATOR_H
#define PGN_CREATOR_H
#include <ostream>
#include <sstream>
#include "Board.h"
class PgnCreator : public BoardDrawer {
public:
PgnCreator(std::ostream& ostr) : ostr_(ostr) {}
void onFigureAdded(Figure::Type type, Figure::Color color, Field field) override {}
void onFigureRemoved(Field field) override {}
void onFigureMoved(Figure::Move move) override;
void onGameFinished(Board::GameStatus status) override;
private:
std::ostream& ostr_;
std::stringstream ss_;
};
#endif // PGN_CREATOR_H
| true |
14bc3f4e259662503448bf0282f89d1157d369cf | C++ | StefanRRachkov/SVG-Library | /source/CommandTypes/Erase.cpp | UTF-8 | 694 | 2.90625 | 3 | [] | no_license | //
// Created by User on 3.6.2019 г..
//
#include "../../headers/SVG_CommandTypes/Erase.h"
#include <iostream>
void Erase::Execute(const std::string& elementIndex)
{
auto index = new unsigned int;
*index = std::stoi(elementIndex);
if(*index > this -> figureContainer -> GetFigures().size())
{
this -> message = "There is no figure number " + std::to_string(*index) + "!\n";
}
else
{
this -> figureContainer -> DeleteFigures(*index - 1);
this -> message = "Erased figure (" + std::to_string(*index) + ")\n";
}
}
Erase::Erase(FileStream* file, ContentStorage* content, FigureStorage* figures) : CommandType(file, content, figures)
{
} | true |
f21fd301b1275eb3a9e692b83b86aaba70bc2abb | C++ | brorica/Algorithm | /USACO/5919.cpp | UTF-8 | 417 | 2.546875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int hay[10001] = { 0, };
int T, sum = 0, average, ans = 0;
cin >> T;
for (int i = 0; i < T; i++)
{
cin >> hay[i];
sum += hay[i];
}
average = sum / T;
for (int i = 0; i < T; i++)
{
if (hay[i] < average)
ans += average - hay[i];
}
cout << ans;
return 0;
} | true |
87288ce1d4b6fcd546c85a96add68c2bfe212e4d | C++ | shashank0302/phonebook-management-system | /Contact.cpp | UTF-8 | 3,810 | 3.03125 | 3 | [] | no_license | #include<bits/stdc++.h>
#include<fstream>
#include "Contact.h"
#include "ContactDB.h"
using namespace std;
ContactDB b;
void Contact::AddRecord()
{
ofstream fout;
fout.open("PhonBook.txt",ios::out|ios::binary|ios::app);
b.storeData();
fout.write((char*)&b,sizeof(b));
fout.close();
cout<<"\nRecord Saved to File......\n";
}
void Contact::DisplayRecords()
{
ifstream fin;
fin.open("PhonBook.txt",ios::out|ios::binary|ios::app);
while(fin.read((char*)&b,sizeof(b)))
{
b.showData();
}
fin.close();
cout<<"\nReading of Data File Completed......\n";
}
void Contact::SearchBySrNo()
{
ifstream fin;
int n, flag=0;
fin.open("PhonBook.txt",ios::out|ios::binary|ios::app);
cout<<"Enter Serial Number of Record To Display: ";
cin>>n;
while(fin.read((char*)&b,sizeof(b)))
{
if(n==b.getSrNo())
{
b.showData();
flag++;
cout<<"\n\n.....Record Found and Displayed......\n";
}
}
fin.close();
if(flag==0)
cout<<"\nThe Record of Serial Number "<<n<<" is not in file....\n";
cout<<"\nReading of Data File Completed......\n";
}
void Contact::deleteRecord()
{
ifstream fin;
ofstream fout;
int flag=0;
string n;
fin.open("PhonBook.txt",ios::out|ios::binary|ios::app);
fout.open("temp.txt",ios::out|ios::binary);
cout<<"Enter name of Record To Delete : ";
cin>>n;
while(fin.read((char*)&b,sizeof(b)))
{
if(n==b.getName())
{
cout<<"\nThe Following record is deleted....\n";
b.showData();
flag++;
}
else
{
fout.write((char*)&b,sizeof(b));
}
}
fin.close();
fout.close();
if(flag==0)
cout<<"\nThe Record of Serial Number "<<n<<" is not in file....\n";
cout<<"\nReading of Data File Completed......\n";
remove("PhonBook.txt");
rename("temp.txt","PhonBook.txt");
}
void Contact::modifyRecord()
{
fstream fio;
int n, flag=0,pos;
fio.open("PhonBook.txt",ios::out|ios::binary|ios::in);
cout<<"Enter Serial Number of Record To Modify : ";
cin>>n;
while(fio.read((char*)&b,sizeof(b)))
{
pos=fio.tellg();
if(n==b.getSrNo())
{
cout<<"\nThe Following record will be modified....\n";
b.showData();
flag++;
cout<<"\nRe-Enter the New Details.....\n";
b.storeData();
fio.seekg(pos-sizeof(b));
fio.write((char*)&b,sizeof(b));
cout<<"\n....Data Modified Successfully....\n";
}
}
fio.close();
if(flag==0)
cout<<"\nThe Record of Serial Number "<<n<<" is not in file....\n";
cout<<"\nReading of Data File Completed......\n";
}
void Contact::SearchByName(){
ifstream fin;
int flag=0;
string n;
fin.open("PhonBook.txt",ios::out|ios::binary|ios::app);
cout<<"Enter the name of Record To Display: ";
cin>>n;
while(fin.read((char*)&b,sizeof(b)))
{
if(n==b.getName())
{
b.showData();
flag++;
cout<<"\n\n.....Record Found and Displayed......\n";
}
}
fin.close();
if(flag==0)
cout<<"\nThe Record of the name "<<n<<" is not in file....\n";
cout<<"\nReading of Data File Completed......\n";
}
bool Contact::findcontact(string name){
ifstream fin;
fin.open("PhonBook.txt",ios::out|ios::binary|ios::app);
while(fin.read((char*)&b,sizeof(b)))
{
if(name==b.getName())
{
return true;
break;
}
}
return false;
}
| true |
f919bfd895734a9f8933bbd74e9a96d0d96d92a2 | C++ | saiteja1111n/c-learning | /overloadfunctions.cpp | UTF-8 | 468 | 3.703125 | 4 | [] | no_license | #include<iostream>
#include<sstream>
using namespace std;
int mult(int a,int b) {
return a*b;
}
double mult(double a1,double b1) {
return a1*b1;
}
int main() {
int a,b;
double a1,b1;
cout<<"Give the values of a and b"<<endl;
cin>>a;
cin>>b;
cout<<"\nGive the values of a1 and b1"<<endl;
cin>>a1;
cin>>b1;
cout<<"\nmult(int a,int b)"<<mult(a,b)<<"\nmult(double a,double b)"<<mult(a1,b1)<<"\n"<<endl;//mult(a1,b) cant use this. it says call of overload
}
| true |
aca85c9457b6d562dd2fe48907da4bf53a89e067 | C++ | QtLab/PUBG-No-Recoil | /hax.cpp | UTF-8 | 1,009 | 2.796875 | 3 | [] | no_license | #include "stdafx.h"
#include "windows.h"
#include <iostream>
bool LeftMouseDown = true;
int leftMouseVKCode = 1;
int RecoilState = 3;
void __stdcall RemoveRecoil()
{
HWND foregroundWin;
leftMouseVKCode = 1;
while (1)
{
foregroundWin = GetForegroundWindow();
if (foregroundWin == FindWindowA("UnrealWindow", 0) && RecoilState == 3)
{
if (LeftMouseDown)
{
Sleep(30u);
mouse_event(1u, 0, 2u, 0, 3u);
}
}
Sleep(1u);
}
}
void __stdcall KeyHandlerThread()
{
while (1)
{
if (GetAsyncKeyState(0x78) < 0) // F9 turns recoil reducer on.
{
RecoilState = 3;
Beep(0x320u, 0xC8u);
}
if (GetAsyncKeyState(0x79) < 0) // F10 turns recoil reducer off.
{
RecoilState = 4;
Beep(0x64u, 0xC8u);
}
LeftMouseDown = GetAsyncKeyState(leftMouseVKCode) < 0;
Sleep(1u);
}
}
void main() {
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)RemoveRecoil, 0, 0, 0);
CreateThread(0, 0, (LPTHREAD_START_ROUTINE)KeyHandlerThread, 0, 0, 0);
std::cin.get();
}
| true |
0730e463d0e589581a59ddabee78929b12bf8a77 | C++ | MAU143429/LetsPlay-Server-CE-2103 | /Lets Play Server/src/BPGAME/BP_Controller.cpp | UTF-8 | 458 | 2.640625 | 3 | [] | no_license | #include "BP_Controller.h"
BP_Controller* BP_Controller::unique_instance{ nullptr };
mutex BP_Controller::mutex_;
BP_Controller::BP_Controller()
{
}
BP_Controller::~BP_Controller() {}
/**
* @brief Getter for the static class instance
* @return the static instance
*/
BP_Controller* BP_Controller::getInstance()
{
lock_guard<std::mutex> lock(mutex_);
if (unique_instance == nullptr) { unique_instance = new BP_Controller(); }
return unique_instance;
} | true |
2547439b1056ed454f8a9a6f4fcd6c0826ebb584 | C++ | hykruntoahead/AndroidNdkStudy | /21DaysLearnCPlus/chapter14/14.4.cpp | UTF-8 | 1,004 | 3.96875 | 4 | [] | no_license | // 包含两个成员属性的模板类
#include <iostream>
using namespace std;
template <typename T1 = int, typename T2=double>
class HoldsPair
{
private:
T1 value1;
T2 value2;
public:
HoldsPair(const T1& val1,const T2& val2) : value1(val1),value2(val2){}
// Accessor functions
const T1 & GetFirstValue () const
{
return value1;
}
const T2 & GetSecondValue () const
{
return value2;
}
};
int main()
{
HoldsPair<> pairIntDbl (300, 10.09);
HoldsPair<short,const char*> pairShortStr (25,"Learn templates, love C++");
cout << "The first object contains -" << endl;
cout << "Value 1: " << pairIntDbl.GetFirstValue () << endl;
cout << "Value 2: " << pairIntDbl.GetSecondValue () << endl;
cout << "The second object contains -" << endl;
cout << "Value 1: " << pairShortStr.GetFirstValue () << endl;
cout << "Value 2: " << pairShortStr.GetSecondValue () << endl;
return 0;
} | true |
08addc929d8b772ddd4a319478ff2cc39dbad588 | C++ | yanyanlili2020/LeetCola0714 | /src/array/1385.cpp | UTF-8 | 1,419 | 3.28125 | 3 | [] | no_license | class Solution12 {
public:
int findTheDistanceValue(vector<int>& arr1, vector<int>& arr2, int d) {
sort(arr2.begin(), arr2.end());
int cnt = 0;
for (auto &x: arr1) {
unsigned p = lower_bound(arr2.begin(), arr2.end(), x) - arr2.begin();
bool ok = true;
if (p < arr2.size()) ok &= (arr2[p] - x > d);
if (p - 1 >= 0 && p - 1 <= arr2.size()) ok &= (x - arr2[p - 1] > d);
cnt += ok;
}
return cnt;
}
};
class Solution12 {
public:
int findTheDistanceValue(vector<int>& arr1, vector<int>& arr2, int d) {
int b=0;int c=0;int e=0;int f=0;int out=0;
b=size(arr1);
c=size(arr2);
for(int i=0;i<b;i++)
{
for(int j=0;j<c;j++)
{
if(abs(arr1[i]-arr2[j])>d)
{e++;}
else {e=0;break;}
}
if(e==c)
{
out=out+1;
e=0;
}
}
return out;
}
};
class Solution72 {
public:
int findTheDistanceValue(vector<int>& arr1, vector<int>& arr2, int d) {
int cnt = 0;
for (auto &x: arr1) {
bool ok = true;
for (auto &y: arr2) {
ok &= (abs(x - y) > d);
}
cnt += ok;
}
return cnt;
}
}; | true |
ab9a59751a4a9831b3f9c664a964cfdec7e58919 | C++ | Faizan-Ali-code/C-programming-code | /saurab dev c/displayLinkedListSumCountAverage.cpp | UTF-8 | 2,588 | 3.875 | 4 | [] | no_license | #include<iostream>
#include<conio.h>
using namespace std;
class doubly_link{
private:
struct node{
node* pre;
int data;
node* next;
};
node* head = NULL;
node* tail = NULL;
public:
void insert(int n);
void display();
void display_reverse();
void sum_count_avg();
};
void doubly_link::insert(int n){
system("cls");
node* new_node = new node;
new_node -> data = n;
new_node -> pre = NULL;
new_node -> next = NULL;
if(head == NULL){
head = new_node;
tail = new_node;
}
else{
tail -> next = new_node;
new_node -> pre = tail;
tail = new_node;
}
cout<<"\n\n Insertion is done in Doubly Linked List... ";
}
void doubly_link::display(){
system("cls");
cout<<"\n\n\t\t\t\t Display Doubly Linked List";
if(head == NULL){
cout<<"\n\n Doubly Linked List is Empty";
}
else{
node* ptr = head;
while(ptr != NULL){
cout<<"\n\n Value : "<<ptr -> data;
ptr = ptr -> next;
}
}
}
void doubly_link::display_reverse(){
system("cls");
if(head == NULL){
cout<<"\n\n Doubly Linked List is Empty";
}
else{
node* ptr = tail;
while(ptr != NULL){
cout<<"\n\n Value : "<<ptr -> data;
ptr = ptr -> pre;
}
}
}
void doubly_link::sum_count_avg(){
system("cls");
cout<<"\n\n\t\t\t\t Sum, Count , Avg Record";
int count=0,sum=0;
float average;
if(head == NULL){
cout<<"\n\n Doubly Linked list is emtpy...";
}
else{
node* ptr = head;
while(ptr != NULL)
{
count++;
sum = sum + ptr -> data;
average = sum / count;
ptr = ptr -> next;
}
cout<<"\n\n Total Number of Values : "<< count;
cout<<"\n\n Total sum of Values : "<<sum;
cout<<"\n\n Average of All values : "<<average;
}
}
int main(){
int choice,n;
doubly_link l;
p:
system("cls");
cout<<"\n\n\t\t\t\t Control Panel";
cout<<"\n\n 1. Insert in Doubly Linked List";
cout<<"\n\n 2. Display Doubly Linked List";
cout<<"\n\n 3. Display Reverse Linked List";
cout<<"\n\n 4. Sum , Count , Average";
cout<<"\n\n 5. Exit";
cout<<"\n\n Enter Your choice :";
cin>>choice;
switch(choice){
case 1:
system("cls");
cout<<"\n\n\t\t\t\t Insert Record";
cout<<"\n\n Enter Value for insertion : ";
cin>>n;
l.insert(n);
break;
case 2:
l.display();
break;
case 3:
l.display_reverse();
break;
case 4:
l.sum_count_avg();
break;
case 5:
exit(0);
default:
cout<<"\n\n Invalid Value ... Please Try Again...";
}
getch();
goto p;
return 0;
}
| true |
039127c29c22f9b386aec40d9616a0e3bed79589 | C++ | espio/Mypaint | /menu_item.cpp | UTF-8 | 2,958 | 2.609375 | 3 | [] | no_license | #include "menu_item.h"
#include "callback.h"
#include "paper.h"
#include <list>
#include <iostream>
Menu_item::Menu_item(void)
{
this->__etat = false;
this->__click = false;
this->__size_child = 0;
}
Menu_item::~Menu_item(void)
{
std::list<Control*>::iterator it;
it = this->__tmp_child.begin();
while (this->__size_child > 0)
{
delete *it;
++it;
--this->__size_child;
}
}
bool Menu_item::Init(int x, int y, int w, int h, const char* name, TTF_Font* font, Paper* draw)
{
SDL_Color color;
SDL_Surface* text;
this->__drawing_area = draw;
if (Control::Init(x, y, w, h) == 0)
return 1;
this->_rect.h -=12;
if (this->Color_surface(30, 30, 30))
return 1;
this->_rect.h +=12;
color.r = 250;
color.g = 0;
color.b = 0;
text = TTF_RenderText_Solid(font, name, color);
if (text == 0)
return 1;
if (SDL_BlitSurface(text, 0, this->_surface, 0))
{
SDL_FreeSurface(text);
return 1;
}
return 0;
}
void Menu_item::Show_menu(void)
{
std::list<Control*>::iterator it;
it = this->__tmp_child.begin();
while (this->__tmp_child.end() != it)
{
(*it)->Update();
++it;
}
}
bool Menu_item::Click_button(SDL_Event* event)
{
pos tmp;
if (event == 0)
return 0;
tmp.x = event->button.x;
tmp.y = event->button.y;
this->Get_pos(&tmp);
if (((tmp.x < 0 || tmp.x >= this->_surface->w ||
tmp.y < 0 || tmp.y >= this->_surface->h + 60) &&
this->__etat == true))
{
this->__drawing_area->Set_actif(!this->__click);
this->__click = false;
this->__etat = false;
}
if (((tmp.x > 0 && tmp.x < this->_surface->w &&
tmp.y > this->_rect.h && tmp.y < this->_rect.h + 60) &&
this->__etat == true) && event->button.button == SDL_BUTTON_LEFT && event->button.type == SDL_MOUSEBUTTONDOWN)
this->__click = true;
return 0;
}
bool Menu_item::Add_items(int x, int y, int w, int h, void (*fct)(SDL_Event*, Control*, void*), void* data, const char* name)
{
Button* menu_item;
menu_item = new (std::nothrow) Button();
if (menu_item == 0 || menu_item->Init(this->_rect.x + x , this->_surface->h + y, w, h, name) == 0)
{
delete menu_item;
return 1;
}
try
{
this->__tmp_child.push_back(menu_item);
++this->__size_child;
}
catch (std::exception ex)
{
return 1;
}
menu_item->Set_callback(fct, data);
return 0;
}
bool Menu_item::Add_surface(void)
{
std::list<Control*>::iterator it;
Control* root;
root = this->Get_root();
it = this->__tmp_child.end();
while (it != this->__tmp_child.begin())
{
--it;
if (root->Add_child(*it))
return 1;
--this->__size_child;
}
return 0;
}
void Menu_item::On_key_down(SDL_Event* event)
{
if (event->button.button == SDL_BUTTON_LEFT && event->button.state == SDL_PRESSED)
{
if (this->__etat == false)
this->Show_menu();
else
{
this->__click = false;
this->__drawing_area->Update();
}
this->__drawing_area->Set_actif(this->__etat);
this->__etat = !this->__etat;
}
}
bool Menu_item::On_key_up(SDL_Event*)
{
return 1;
}
| true |
60ab02915ac45a005592e3bf90b3bec76e2c278f | C++ | MadinaZ/pro | /DvcScheduleSearchBST-3.cpp | UTF-8 | 2,763 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include<algorithm>
#include<set>
#include <cstring>
using namespace std;
#include "BinarySearchTree.h"
string searchSemester(int);
int main()
{
cout<<"Programmer: Madina Sadirmekova \n";
cout<<"Programmer's ID: 1736270 \n";
cout<<"file: "<<__FILE__<<"\n\n";
char* token;
char buf[100];
const char* const tab = "\t";
int counter = 0, sem_num;
BinarySearchTree<string, set<int> > allClass;
ifstream fin;
fin.open("dvc-schedule.txt");
if(!fin.good())
cout<<"I/O error";
cout << endl;
while(fin.good())
{
string line;
getline(fin, line);
strcpy(buf, line.c_str());
if(buf[0] == 0) continue;
char* term(token = strtok(buf, tab));
const string section((token = strtok(0, tab)) ? token : "");
const string course((token = strtok(0, tab)) ? token : "");
const string instructor((token = strtok(0, tab)) ? token : "");
const string whenWhere((token = strtok(0, tab)) ? token : "");
if(course.find('-') == string::npos) continue;
const string subjectCode(course.begin(), course.begin() + course.find('-'));
string classCode = term;
classCode += ".";
classCode.append(section);
counter++;
char* semester= strtok(term, " ");
char* year = strtok(NULL, " ");
if(strcmp(semester,"Spring")) strcat(year,"1");
else if(strcmp(semester,"Summer")) strcat(year,"2");
else if(strcmp(semester,"Fall")) strcat(year,"3");
sem_num = atoi(year);
allClass[course].insert(sem_num);
}
fin.close();
while(buf[0] != 'X' || buf[0] != 'x')
{
cout << "Enter a course name(like, COMSC-210) to search for the first/last semester course offered [X/x to exit]:" << endl;
cout << " ";
cin >> buf;
if(buf[0] == 'X' || buf[0] =='x')
break;
if(allClass.containsKey(buf) == false)
cout << "I didn't find " << buf << endl << endl;
else
{
cout << buf << " was first offered in " << searchSemester(*allClass[buf].begin()) << endl;
cout << buf << " was last offered in " << searchSemester(*allClass[buf].rbegin()) << endl;
cout << endl;
}
}
return 0;
}
string searchSemester(int num)
{
int year = num / 10;
int seme = num % 10;
switch(seme)
{
case 1: return "Spring " + to_string(year);
case 2: return "Summer " + to_string(year);
case 3: return "Fall " + to_string(year);
}
return "Error\n";
}
| true |
ae917879a8e70872685f2ba3e8527c4754cbb996 | C++ | yamikumo-DSD/my_game_project_unified | /source/vm/frame.cpp | UTF-8 | 2,029 | 2.796875 | 3 | [] | no_license | //frame.cpp
#include "frame.h"
#include "exception_def.h"
#include <iostream>
#include "bit_calculation.h"
#include <iterator>
#include "express_debug.h"
#include "debug.h"
MyVM::Frame::Frame
(
std::size_t _stack_size,
std::size_t _maximum_local_variables_num
)
:operand_stack(_stack_size + 1),
local_variables(_maximum_local_variables_num),
sp()
{
sp = operand_stack.begin();
}
decltype(MyVM::Frame::sp) MyVM::Frame::get_sp(void) const
{
return sp;
}
void MyVM::Frame::advance_sp(int _n)
{
if (_n > 0)
{
for (int i = 0; i != _n; ++i)
{
if (sp == operand_stack.end()) { throw StackOverFlow("Exception StackOverFlow is thrown."); }
++sp;
}
}
else if (_n < 0)
{
for (int i = 0; i != -_n; ++i)
{
if (sp == operand_stack.begin()) { throw StackUnderFlow("Exception StackUnderFlow is thrown."); }
--sp;
}
}
}
MyVM::Word& MyVM::Frame::operator[](std::size_t _offset)
{
return local_variables[_offset];
}
const MyVM::Word& MyVM::Frame::operator[](std::size_t _offset) const
{
return local_variables[_offset];
}
MyVM::Word MyVM::Frame::top(void) const { return get_sp()[-1]; }
MyVM::DWord MyVM::Frame::top2(void) const //top dword value is byte1 << 8 | byte2
{
using namespace BitCalculation;
T2Byte<Word> byte1, byte2;
byte1.t = get_sp()[-1]; byte2.t = get_sp()[-2];
T2Byte<DWord> top_value;
top_value.field._0 = byte2.field._0;
top_value.field._1 = byte2.field._1;
top_value.field._2 = byte2.field._2;
top_value.field._3 = byte2.field._3;
top_value.field._4 = byte1.field._0;
top_value.field._5 = byte1.field._1;
top_value.field._6 = byte1.field._2;
top_value.field._7 = byte1.field._3;
return top_value.t;
}
void MyVM::Frame::dump_stack(void)
{
std::cout << "*********** Dump stack ***********" << std::endl;
int i = 0;
for (const jint& x : operand_stack)
{
std::printf("%x", x); if (i == std::distance(operand_stack.begin(), sp)) { std::cout << "<-sp"; }
std::cout << std::endl;
++i;
}
std::cout << "**********************************" << std::endl;
} | true |
4e20665fb678f5f5764fe328afd9bdf79fc98ea0 | C++ | neivv/teippi | /src/list.h | UTF-8 | 7,545 | 3.015625 | 3 | [
"MIT"
] | permissive | #ifndef LIST_H
#define LIST_H
#include <stdint.h>
#include <cstddef>
#include "console/assert.h"
template <typename T, typename M> M get_member_type(M T::*);
template <typename T, typename M> T get_class_type(M T::*);
template <class C, unsigned offset, bool reverse>
class ListIterator
{
public:
ListIterator(C *val) { value = val; }
void operator++() { value = *(C **)((uint8_t *)value + offset + (reverse * sizeof(void *))); }
bool operator!=(const ListIterator &other) const { return other.value != value; }
C *operator*() const { return value; }
ListIterator prev() const
{
auto val = *(C **)((uint8_t *)value + offset + (!reverse * sizeof(void *)));
return ListIterator(val);
}
private:
C *value;
};
template <class C, unsigned offset>
class ListHead
{
public:
ListHead() { value = 0; }
operator C*&() { return value; }
C *& AsRawPointer() { return value; }
ListHead &operator=(C * const val) { value = val; return *this; }
C *operator-> () const { return value; }
ListIterator<C, offset, false> begin() const
{
return ListIterator<C, offset, false>(value);
}
ListIterator<C, offset, false> end() const
{
return ListIterator<C, offset, false>(0);
}
private:
C *value;
};
template <class C, unsigned offset>
class ListEntry
{
public:
ListEntry()
{
}
void Remove(ListHead<C, offset> &first)
{
if (next)
((ListEntry *)((uint8_t *)next + offset))->prev = prev;
if (prev)
((ListEntry *)((uint8_t *)prev + offset))->next = next;
else
{
Assert(first == self());
first = next;
}
}
void Add(ListHead<C, offset> &first)
{
next = first;
prev = 0;
first = self();
if (next)
((ListEntry *)((uint8_t *)next + offset))->prev = self();
}
void Change(ListHead<C, offset> &remove_list, ListHead<C, offset> &add_list)
{
Remove(remove_list);
Add(add_list);
}
C *next;
C *prev;
private:
C *self() const
{
return (C *)((uint8_t *)this - offset);
}
};
template <class C, unsigned offset>
class RevListHead
{
public:
RevListHead() { value = 0; }
operator C*&() { return value; }
C *& AsRawPointer() { return value; }
C *operator-> () const { return value; }
RevListHead &operator=(C * const val) { value = val; return *this; }
ListIterator<C, offset, true> begin() const
{
return ListIterator<C, offset, true>(value);
}
ListIterator<C, offset, true> end() const
{
return ListIterator<C, offset, true>(0);
}
private:
C *value;
};
template <class C, unsigned offset>
class RevListEntry
{
public:
RevListEntry()
{
}
void Remove(RevListHead<C, offset> &first)
{
if (next)
((RevListEntry *)((uint8_t *)next + offset))->prev = prev;
if (prev)
((RevListEntry *)((uint8_t *)prev + offset))->next = next;
else
{
Assert(first == self());
first = next;
}
}
void Add(RevListHead<C, offset> &first)
{
next = first;
prev = 0;
first = self();
if (next)
((RevListEntry *)((uint8_t *)next + offset))->prev = self();
}
void Change(RevListHead<C, offset> &remove_list, RevListHead<C, offset> &add_list)
{
Remove(remove_list);
Add(add_list);
}
C *prev;
C *next;
private:
C *self() const
{
return (C *)((uint8_t *)this - offset);
}
};
template <class C, unsigned offset> class DummyListEntry;
template <class C, unsigned offset>
class DummyListIt
{
public:
DummyListIt(C *val_)
{
val = val_;
}
C *operator*() const
{
return val;
}
void operator++()
{
val = ((DummyListEntry<C, offset> *)((uint8_t *)val + offset))->next;
}
bool operator!=(const DummyListIt &other) const
{
return val != other.val;
}
C *val;
};
template <class C, unsigned offset>
class DummyListHead
{
friend class DummyListEntry<C, offset>;
public:
DummyListHead()
{
Reset();
}
void Reset()
{
C *base = (C *)((uint8_t *)&dummy - offset);
dummy.next = base;
dummy.prev = base;
}
DummyListIt<C, offset> begin() const
{
return dummy.next;
}
DummyListIt<C, offset> end() const
{
return (C *)((uint8_t *)&dummy - offset);
}
void MergeTo(DummyListHead<C, offset> &other, bool at_end = true)
{
C *base = (C *)((uint8_t *)&dummy - offset);
if (dummy.next == base)
return;
if (at_end)
{
ToEntry(dummy.prev)->next = other.dummy.self();
ToEntry(dummy.next)->prev = other.dummy.prev;
ToEntry(other.dummy.prev)->next = dummy.next;
other.dummy.prev = dummy.prev;
}
else
{
ToEntry(dummy.next)->prev = other.dummy.self();
ToEntry(dummy.prev)->next = other.dummy.next;
ToEntry(other.dummy.next)->prev = dummy.prev;
other.dummy.next = dummy.next;
}
Reset();
}
private:
static inline DummyListEntry<C, offset> *ToEntry(C *base)
{
return DummyListEntry<C, offset>::ToEntry(base);
}
DummyListEntry<C, offset> dummy;
};
template <class C, unsigned offset>
class DummyListEntry
{
public:
DummyListEntry()
{
}
void Remove()
{
ToEntry(next)->prev = prev;
ToEntry(prev)->next = next;
}
C *self() const
{
return (C *)((uint8_t *)this - offset);
}
void Add(DummyListHead<C, offset> &new_list)
{
next = new_list.dummy.self();
prev = new_list.dummy.prev;
ToEntry(next)->prev = self();
ToEntry(prev)->next = self();
}
void Change(DummyListHead<C, offset> &new_list)
{
Remove();
Add(new_list);
}
static inline DummyListEntry<C, offset> *ToEntry(C *base)
{
return ((DummyListEntry *)((uint8_t *)base + offset));
}
C *next;
C *prev;
};
static_assert(sizeof(ListEntry<int, 0>) == 8, "sizeof(ListEntry)");
static_assert(sizeof(ListHead<int, 0>) == 4, "sizeof(ListHead)");
static_assert(sizeof(RevListEntry<int, 0>) == 8, "sizeof(RevListEntry)");
static_assert(sizeof(RevListHead<int, 0>) == 4, "sizeof(RevListHead)");
static_assert(sizeof(DummyListEntry<int, 0>) == 8, "sizeof(DummyListEntry)");
static_assert(sizeof(DummyListHead<int, 0>) == 8, "sizeof(DummyListHead)");
#endif // LIST_H
| true |
d2863674d54c23ef6f27a14f9f220a17b426eb50 | C++ | Muzain187/level3 | /BST/constructLLfromTree.cpp | UTF-8 | 628 | 2.828125 | 3 | [] | no_license | Node<int>* constructLinkedList(BinaryTreeNode<int>* root) {
// Write your code here
// return constructList(root)->head;
if(root == NULL)
return NULL;
Node<int>* leftNode = constructLinkedList(root->left);
Node<int>* rightNode = constructLinkedList(root->right);
Node<int>* rootNode = new Node<int>(root->data);
if(leftNode != NULL){
Node<int>* temp = leftNode;
while(temp->next != NULL)
temp = temp->next;
temp->next = rootNode;
}
rootNode->next = rightNode;
if(leftNode != NULL)
return leftNode;
return rootNode;
| true |
eb46186f9ccb712e1a08c8112db998551728a437 | C++ | huanghl365/StudyNote_201308 | /cpp/04_cpp_father_derive/4_8_constructor.cpp | UTF-8 | 451 | 3.453125 | 3 | [
"MIT"
] | permissive | //派生类的构造函数与析构函数的执行顺序
#include <iostream>
using std::cin;
using std::cout;
using std::endl;
class Base{
public:
Base(){
cout<<"Construction base class.\n";//1
}
~Base(){
cout<<"Destruction base class.\n";//4
}
};
class Derive:public Base{
public:
Derive(){
cout<<"Construction derived class.\n";//2
}
~Derive(){
cout<<"Destruction derived class.\n";//3
}
};
int main()
{
Derive op;
return 0;
}
| true |
c7152197e0e290de59c63646d62b00f6d0ad81cc | C++ | thirtiseven/CF | /#505/C.cc | UTF-8 | 692 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <string>
std::string s;
int main(int argc, char *argv[]) {
std::cin >> s;
int ans = 0;
int now = 1;
int len = s.length();
for (int i = 1; i < len; i++) {
if (s[i] != s[i-1]) {
now++;
} else {
ans = std::max(now, ans);
now = 1;
}
}
ans = std::max(now, ans);
now = 0;
if (s[0] == s[len-1] || ans == len) {
std::cout << ans << '\n';
} else {
int pre = 1, sa = 1;
for (int i = 1; i < len; i++) {
if (s[i] != s[i-1]) {
pre++;
} else {
break;
}
}
for (int i = len-2; i >= 0; i--) {
if (s[i] != s[i+1]) {
sa++;
} else {
break;
}
}
ans = std::max(ans, sa+pre);
std::cout << ans << '\n';
}
} | true |
09a583a6dec7c0a9dd5c3450377ccbf912df8893 | C++ | wangkaichao/wkc01 | /project/demo/DemoThread.cpp | UTF-8 | 3,030 | 2.859375 | 3 | [] | no_license | #if 0
#include <thread>
#include <chrono>
#include <iostream>
#include <stdio.h>
#include <unistd.h>
int main()
{
std::thread t1([] {
printf("thread1 start. id:%#x\n", std::this_thread::get_id());
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
printf("thread1 start. id:%#x ~~~~\n", std::this_thread::get_id());
});
sleep(1);
printf("before->detach id:%#x native_handle:%#x\n", t1.get_id(), t1.native_handle());
t1.detach();
printf("after->detach id:%#x native_handle:%#x\n", t1.get_id(), t1.native_handle());
if (!t1.joinable())
{
t1 = std::thread([]{
printf("thread2 start. id:%#x\n", std::this_thread::get_id());
});
printf("before->join id:%#x native_handle:%#x\n", t1.get_id(), t1.native_handle());
t1.join();
printf("after->join id:%#x native_handle:%#x\n", t1.get_id(), t1.native_handle());
}
sleep(2);
return 0;
}
#endif
#include <chrono>
#include "ThreadObj.h"
class DemoThread : public ThreadObj
{
public:
DemoThread() {};
virtual ~DemoThread() {};
virtual void ThreadFunction();
};
void DemoThread::ThreadFunction()
{
while (!m_stopRequested)
{
LOGD("%s do work...", m_threadName.c_str());
std::this_thread::sleep_for(std::chrono::seconds(1));
}
}
static void printUsage(void)
{
LOGD("Usage:");
LOGD(" input ? :print usage");
LOGD(" input 1 :start one thread");
LOGD(" input 2 :stop one thread");
LOGD(" input 3 :stop all threads");
LOGD(" input 4 :list all threads");
LOGD(" input q :quit.");
}
int main()
{
char as8Buff[256];
int isQuit = 0;
std::list<DemoThread *> DemoList;
DemoThread *pObj = nullptr;
int cnt;
std::string tag;
LOG_OPEN("demo");
printUsage();
do
{
fgets(as8Buff, sizeof(as8Buff), stdin);
switch (as8Buff[0])
{
case '?':
printUsage();
break;
case '1':
tag = "thread[" + std::to_string(cnt++) + "]";
pObj = new DemoThread;
pObj->StartThread(tag.c_str());
DemoList.push_front(pObj);
break;
case '2':
if (!DemoList.empty())
{
pObj = DemoList.front();
pObj->StopThread(true);
DemoList.pop_front();
delete pObj;
}
break;
case '3':
ThreadObj::StopAllThreads();
for (auto *p : DemoList)
{
delete p;
}
DemoList.clear();
break;
case '4':
ThreadObj::DumpThreadObjList();
break;
case 'q':
isQuit = 1;
break;
default:
break;
}
} while (!isQuit);
return 0;
}
| true |
aa1de0b0d1751d6f435ae836f0338611ccf30b25 | C++ | waynebhayes/SANA | /wrappedAlgorithms/HGRAAL/src/LEDA/geo/segment_set.h | UTF-8 | 6,510 | 2.6875 | 3 | [] | no_license | /*******************************************************************************
+
+ LEDA 6.3
+
+
+ segment_set.h
+
+
+ Copyright (c) 1995-2010
+ by Algorithmic Solutions Software GmbH
+ All rights reserved.
+
*******************************************************************************/
#ifndef LEDA_SEGMENT_SET_H
#define LEDA_SEGMENT_SET_H
#if !defined(LEDA_ROOT_INCL_ID)
#define LEDA_ROOT_INCL_ID 600055
#include <LEDA/internal/PREAMBLE.h>
#endif
#include <LEDA/geo/seg_tree.h>
#include <LEDA/geo/line.h>
LEDA_BEGIN_NAMESPACE
typedef seg_tree_item seg_item;
//------------------------------------------------------------------------------
// SegmentSet: a dictionary for line segments with a fixed orientation
//------------------------------------------------------------------------------
class __exportC SegmentSet : public segment_tree<double,double,GenPtr> {
int r90; // for angles that are a multiple of pi / 2, i.e. 90 degrees
double alpha; // orientation given by an angle
segment rotate_about_origin_by_alpha(const segment& s, bool pos_dir) const;
public:
typedef double coord_type;
typedef segment segment_type;
typedef line line_type;
public:
segment key(seg_item) const;
seg_item insert(const segment&, GenPtr);
seg_item lookup(const segment&) const;
void del(const segment&);
list<seg_item> intersection(const segment&) const;
list<seg_item> intersection(const line&) const;
list<seg_item> intersection_sorted(const segment&) const;
list<seg_item> intersection_sorted(const line&) const;
SegmentSet(int rot90 = 0);
SegmentSet(double angle);
~SegmentSet() {} // Note: derived classes must call clear in their destructor!
};
#define forall_seg_items(i,S) forall_seg_tree_items(i,S)
//------------------------------------------------------------------------------
// class segment_set: derived from generic SegmentSet
//------------------------------------------------------------------------------
/*{\Manpage {segment_set} {I} {Sets of Parallel Segments}}*/
template<class I>
class segment_set : public SegmentSet {
/*{\Mdefinition
An instance $S$ of the parameterized data type |\Mname| is a
collection of items ($seg\_item$). Every item in $S$ contains as key a
line segment with a fixed direction $\alpha$ (see data type segment) and
an information from data type $I$, called the information type of $S$.
$\alpha$ is called the orientation of $S$. We use $\<s,i\>$ to denote the
item with segment $s$ and information $i$. For each segment $s$ there is
at most one item $\<s,i\> \in S$.}*/
void clear_info(GenPtr& x) { LEDA_CLEAR(I,x); }
void copy_info(GenPtr& x) { LEDA_COPY(I,x); }
public:
typedef segment segment_type;
public:
/*{\Mcreation S }*/
segment_set() : SegmentSet(0) {}
/*{\Mcreate creates an empty instance |\Mvar| of type |\Mname| with orientation
zero, i.e., horizontal segments.}*/
explicit
segment_set(int rot) : SegmentSet(rot) {}
/*{\Mcreate creates an empty instance |\Mvar| of type |\Mname| with orientation
$|rot| \cdot \pi / 2$. }*/
explicit
segment_set(double a) : SegmentSet(a) {}
/*{\Mcreate creates an empty instance |\Mvar| of type |\Mname| with orientation
$a$.
(Note that there may be incorrect results due to rounding errors.)}*/
~segment_set() { clear(); }
/*{\Moperations 2.7 4.7}*/
segment key(seg_item it) const { return SegmentSet::key(it); }
/*{\Mop returns the segment of item $it$.\\
\precond $it$ is an item in |\Mvar|.}*/
const I& inf(seg_item it) const { return LEDA_CONST_ACCESS(I,SegmentSet::inf(it)); }
/*{\Mop returns the information of item $it$.\\
\precond $it$ is an item in |\Mvar|.}*/
seg_item insert(const segment& s, const I& i) { return SegmentSet::insert(s,leda_cast(i));}
/*{\Mop associates the information $i$ with segment
$s$. If there is an item $\<s,j\>$ in |\Mvar|
then $j$ is replaced by $i$, else a new item
$\<s,i\>$ is added to $S$. In both cases the
item is returned.}*/
seg_item lookup(const segment& s) const {return SegmentSet::lookup(s);}
/*{\Mop returns the item with segment $s$ (nil if no
such item exists in \Mvar).}*/
list<seg_item> intersection(const segment& q) const {return SegmentSet::intersection(q);}
/*{\Mop returns all items $\<s,i\>\ \in\ S$ with
$s \cap q \ne \emptyset$.\\
\precond $q$ is orthogonal to the segments in |\Mvar|.}*/
list<seg_item> intersection_sorted(const segment& q) const {return SegmentSet::intersection_sorted(q);}
/*{\Mop as above, but the returned segments are ordered as they are intersected
by $q$ if one travels from |q.source()| to |q.target()|.}*/
list<seg_item> intersection(const line& l) const {return SegmentSet::intersection(l);}
/*{\Mop returns all items $\<s,i\>\ \in\ S$ with
$s \cap l \ne \emptyset$.\\
\precond $l$ is orthogonal to the segments in |\Mvar|.}*/
list<seg_item> intersection_sorted(const line& l) const {return SegmentSet::intersection_sorted(l);}
/*{\Mop as above, but the returned segments are ordered as they are intersected
by $l$ if one travels along $l$ in direction |l.direction()|.}*/
void del(const segment& s) {SegmentSet::del(s);}
/*{\Mop deletes the item with segment $s$ from |\Mvar|.}*/
void del_item(seg_item it) {SegmentSet::del_item(it);}
/*{\Mop removes item $it$ from |\Mvar|.\\
\precond $it$ is an item in |\Mvar|.}*/
void change_inf(seg_item it, const I& i)
{ SegmentSet::change_inf(it,leda_cast(i)); }
/*{\Mopl makes $i$ the information of item $it$.\\
\precond $it$ is an item in |\Mvar|.}*/
void clear() { SegmentSet::clear(); }
/*{\Mop makes |\Mvar| the empty |\Mtype|.}*/
bool empty() const {return SegmentSet::empty();}
/*{\Mop returns true iff |\Mvar| is empty.}*/
int size() const {return SegmentSet::size();}
/*{\Mop returns the size of |\Mvar|.}*/
};
/*{\Mimplementation
Segment sets are implemented by dynamic segment trees based on BB[$\alpha$]
trees (\cite{Wi85,Lu78}) trees. Operations key, inf, change\_inf, empty, and
size take time $O(1)$, insert, lookup, del, and del\_item take time
$O(\log^2 n)$ and an intersection operation takes time $O(k + \log^2 n)$,
where $k$ is the size of the returned list. Here $n$ is the current size of
the set. The space requirement is $O(n\log n)$.}*/
#if LEDA_ROOT_INCL_ID == 600055
#undef LEDA_ROOT_INCL_ID
#include <LEDA/internal/POSTAMBLE.h>
#endif
LEDA_END_NAMESPACE
#endif
| true |
0e5460dbfd7c362122b04cc61eaa33a3938af757 | C++ | andasilva/IceBroadcast | /audio/vumeter.cpp | UTF-8 | 849 | 2.65625 | 3 | [] | no_license | #include "vumeter.h"
VuMeter::VuMeter(QWidget *parent) : QWidget(parent)
{
setBackgroundRole(QPalette::Base);
setAutoFillBackground(false);
m_level = 0;
setMinimumHeight(30);
setMinimumWidth(200);
}
void VuMeter::paintEvent(QPaintEvent* event)
{
Q_UNUSED(event);
QPainter painter(this);
painter.setPen(Qt::black);
painter.drawRect(QRect(painter.viewport().left()+10, painter.viewport().top()+10, painter.viewport().right()-20, painter.viewport().bottom()-20));
if (m_level == 0.0)
{
return;
}
int pos = ((painter.viewport().right()-20)-(painter.viewport().left()+11))*m_level;
painter.fillRect(painter.viewport().left()+11, painter.viewport().top()+10, pos, painter.viewport().height()-21, Qt::cyan);
}
void VuMeter::setLevel(qreal value)
{
m_level = value;
update();
}
| true |
03ff927edf91105a9d20cf306f5c6c5221aaab6e | C++ | FrameSoftware/OPTIC_LASER | /interaddmont.cpp | UTF-8 | 2,818 | 2.65625 | 3 | [] | no_license | #include "interaddmont.h"
#include "ui_interaddmont.h"
#include "fournisseurmanager.h"
#include "articlemanager.h"
#include <QMessageBox>
#include "monture.h"
InterAddMont::InterAddMont(QWidget *parent) :
QWidget(parent),
ui(new Ui::InterAddMont)
{
FournisseurManager::getFournisseurList(); // reinitialisation de la liste de fournisseur
ui->setupUi(this);
setLayout(ui->layGen);
setFixedSize(380,378);
setWindowTitle("Ajout d'une monture");
for(int i =0; i<FournisseurManager::listFourMat.size(); i++){
ui->cmbForn->addItem(FournisseurManager::listFourMat.at(i).nom_four);
//qDebug() << FournisseurManager::listFourMat.at(i).nom_four;
}//le listing est fini ici
if(FournisseurManager::listFourMat.isEmpty() == false)
this->matricule = FournisseurManager::listFourMat.at(0).matricule_four;
setWindowModality(Qt::WindowModal);
connect(ui->btnAnnul,SIGNAL(clicked()),this,SLOT(close()));
connect(ui->cmbForn,SIGNAL(activated(QString)),this,SLOT(selectMatricule(QString)));
}
InterAddMont::~InterAddMont()
{
delete ui;
delete this;
}
void InterAddMont::selectMatricule(QString text){
//cette methode recoit le texte choisi par le nom du fournisseur choisi
/*
* On parcour la liste de FourMat et on cherche le fournisseur choisit puis on recupere son matricule que lon affecte
* a la variable matricule et c'est fini
* */
for(int i =0; i<FournisseurManager::listFourMat.size(); i++){
if(FournisseurManager::listFourMat.at(i).nom_four == text){
this->matricule = FournisseurManager::listFourMat.at(i).matricule_four; //on recupere le matricule ici
qDebug()<< matricule;
}
}
}
void InterAddMont::on_btnValider_clicked(){
ArticleStruct art;
//on cree l'article ici
art.nom = "Monture";
art.nombre = ui->spnNbr->value();
art.prix = ui->lgnPrix->value();
art.matricule_four = this->matricule;
art.dateEntre = ui->dateAchat->date();
art.info_supp = ui->txtInfoSupp->document()->toPlainText();
ArticleManager artMan;
ErrorManager err;
err = artMan.addArticle(art);
if(err.status == true){//si reussite on commence avec la table monture
MontureStruct mon;
mon.id_art = err.id;
mon.taille = ui->lgnTaill->text();
mon.matiere = ui->lgnMat->text();
//ici on q fini d'initialiser la monture
Monture monture;
err = monture.addMonture(mon);
if(err.status == true){
QMessageBox::information(this,"Succes",err.msg);
this->close();
}else{
QString msg;
msg = err.msg+" code <strong>[ "+err.msgTech+" ]</strong>";
QMessageBox::information(this,"Erreur",msg);
close();
}
}
}
| true |
ee109d40e76beb1bbe619a0a216a3baf5e62b19c | C++ | kofed/centers | /contour.cpp | UTF-8 | 3,071 | 2.953125 | 3 | [] | no_license | #include "contour.h"
#include <stdlib.h>
#include "opencv2/opencv.hpp"
#include "contour3d.h"
#include "log.h"
#include <stdlib.h>
Contour::Contour(vector<CPoint> & _points):points(_points){
init();
}
void Contour::init(){
if(points.size() < 5){
throw runtime_error("создание контура с колличеством точек < 5");
}
Moments moments = cv::moments( points, false );
center = CPoint( moments.m10/moments.m00 , moments.m01/moments.m00 );
stringstream ss;
ss << "hash-" << points[0].x << "-" << points[0].y;
auto yml = Log::LOG->openYmlWrite(ss.str());
*yml << "x-y-hash" << "[";
for(auto p : points){
anglePointMap[pointHash(p)] = p;
*yml << "{:" << "x" << p.x << "y" << p.y << "hash" << pointHash(p) << "r" << distToCenter(p) << "angle" << angle(p) << "}";
}
*yml << "]";
Log::LOG->releaseAndDelete(yml);
}
vector<CPoint> Contour::point2CPoint(const vector<Point> & points){
vector<CPoint> cpoints;
for(auto p : points){
cpoints.push_back(CPoint(static_cast<int>(p.x), static_cast<int>(p.y) ));
}
return cpoints;
}
int Contour::size() const{
return points.size();
}
bool Contour::equals(const Contour & ref) const{
return abs(center.x - ref.center.x) + abs(center.y - ref.center.y) < 10;
}
void Contour::toYml() const{
Log::LOG->start("contour");
auto yml = Log::LOG->openYmlWrite(name() + ".yml");
toYml(*yml);
Log::LOG->releaseAndDelete(yml);
Log::LOG->finish("contour");
}
void Contour::toYml(FileStorage & yml) const{
yml << "center" << center;
yml << "contour" << "[";
for(auto point : points){
yml << "{:" << "point" << point << "}";
}
yml << "]";
}
double Contour::distToCenter(const CPoint point) const{
return sqrt(pow(center.x - point.x, 2.0) + pow(center.y - point.y, 2.0));
};
float Contour::tg(const CPoint point) const {
return ((float)(point.y - center.y))/((float)(point.x - center.x));
}
float Contour::pointHash(const CPoint point) const{
return angle(point);
}
float Contour::angle(const CPoint point)const{
double dy = static_cast<double>(point.y - center.y);
double dx = static_cast<double>(point.x - center.x);
return static_cast<float> (atan2(dy, dx));
}
int Contour::dy(const CPoint point) const{
return point.y - center.y;
}
int Contour::dx(const CPoint point) const{
return point.x - center.x;
}
Contour Contour::diviate(const int dx, const int dy) const{
vector<CPoint> diviated;
for(auto p : points){
diviated.push_back(CPoint(p.x + dx, p.y + dy));
};
return Contour(diviated);
}
map<float, CPoint>::const_iterator Contour::upperBound(const float hash) const{
return anglePointMap.upper_bound(hash);
}
map<float, CPoint>::const_iterator Contour::lowerBound(const float hash) const{
return anglePointMap.lower_bound(hash);
}
void Contour::draw(Mat & drawing){
int size = points.size();
polylines(drawing, points, true, color);
putText(drawing, name(), center, FONT_HERSHEY_SIMPLEX, 0.4, color, 1, CV_AA);
}
string Contour::name() const {
stringstream ss;
ss << "(" << center.x << "," << center.y << ")";
return ss.str();
}
| true |
aa5e16de049569349bba644a9d4d2047bbf77b7d | C++ | ABucciarelli-CR/GameDev-1anno-2016-2017 | /Esercitazione_24_11_16/es4/main.cpp | ISO-8859-13 | 2,606 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <string>
void exploration();
void defense();
void escort();
int ammo=50;
int fuel=100;
int supply=100;
int main()
{
std::string choise;
do
{
////////////inizio gioco
std::cout << "Hai a disposizione "<< ammo << " munizioni, " << fuel << " carburante, " << supply << " scorte."<< std::endl;
std::cout << "Che missione vuoi fare?(Attenzione: e' case sensitive)" << std::endl;
std::cout << "exploration: Explore a planet with your friends(-20 fuel, -20 supply)" << std::endl;
std::cout << "defense: Defend your planet with a powerful weapon(-5 fuel, -5 supply, -20 ammo)" << std::endl;
std::cout << "escort: Helps Berlusconi... *cof cof* a group of researchers(-10 fuel, -10 supply, -10 ammo)" << std::endl;
std::cin >> choise;
//////////controllo scelta e invio alle varie operazioni inerenti ad essa
if(choise!="exploration" && choise!="defense" && choise!="escort")
{
std::cout << "errore di inserimento, ritenta" << std::endl;
}
if(choise=="exploration")
{
exploration();
}
else if(choise=="defense")
{
defense();
}
else if(choise=="escort")
{
escort();
}
system("PAUSE");
system("CLS");
}
while(ammo>0 && fuel>0 && supply>0);
////////stampa di ci che stato finito
std::cout << "Hai finito:" << std::endl;
if(ammo<=0)
{
std::cout << "munizioni=" << ammo << std::endl;
}
if(fuel<=0)
{
std::cout << "carburante=" << fuel << std::endl;
}
if(supply<=0)
{
std::cout << "scorte=" << supply<< std::endl;
}
return 0;
}
//////funzione di esplorazione
void exploration()
{
if(fuel>=20 && supply>=20)
{
fuel-=20;
supply-=20;
}
else
{
std::cout << "Mission not available" << std::endl;
}
}
//////funzione di difesa della terra
void defense()
{
if(fuel>=5 && supply>=5 && ammo>=20)
{
fuel-=5;
supply-=5;
ammo-=20;
}
else
{
std::cout << "Mission not available" << std::endl;
}
}
////////funzione di Berlusconi.... di scorta ai ricercatori...
void escort()
{
if(fuel>=10 && supply>=10 && ammo>=10)
{
fuel-=10;
supply-=10;
ammo-=10;
}
else
{
std::cout << "Mission not available" << std::endl;
}
}
| true |
6250aa787cabae94f9115ac3dc41d2950244e1e0 | C++ | blackenwhite/Competitive-Coding | /icecream_parlour.cpp | UTF-8 | 1,138 | 2.953125 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
int binarySearch(vector<int> cost,int beg,int end,int val)
{
while(beg<=end)
{
int mid=(beg+end)/2;
if(cost[mid]==val)
{
cout<<"\nFound Val "<<cost[mid]<<"\t"<<mid<<"\n";
return mid;
}
else if(cost[mid]<val)
{
beg=mid+1;
}
else if(cost[mid]>val)
{
end=mid-1;
}
}
return -1;
}
int main() {
int t;
cin >> t;
for(int test = 0; test < t; test++)
{
int n,m;
cin >> m >> n;
vector<int> arr(n);
int i=0,bsVal=0;
for(i=0;i<n;i++)
cin>>arr[i];
int flag=0;
for(i=0;i<n;i++)
{
for(int j=0;j<n;j++)
{
if(i!=j && arr[i]+arr[j]==m)
{
cout<<i+1<<" "<<j+1<<endl;
flag=1;
break;
}
}
if(flag)
break;
}
}
} | true |
382598fc6ea03fe30c23b2bf086b42d68451b3eb | C++ | GZHU-JourneyWest/West-Footprint | /Contests/2017 SCUT校赛/k.fail.cpp | UTF-8 | 1,706 | 2.71875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using pi = pair<int, int>;
// 成也暴力,败也暴力
// 裸折半失败
// 思路过于复杂,
// 学习对分数的处理
// 学习分治的思路
const int maxN = 40;
int gcd(int x, int y)
{
return y==0 ? x : gcd(y, x%y);
}
int a[maxN], b[maxN];
vector<pi> lft, rght;
void reduce(pi &p)
{
int g = gcd(p.first, p.second);
if (g != 0) p.first /= g, p.second /= g;
}
void push(vector<pi> &bucket, int bgn, int end, pi last)
{
if (bgn > end) return;
pi nxt {last.first+a[bgn], last.second+b[bgn]};
reduce(nxt);
if (nxt.second != 0) bucket.push_back(nxt);
push(bucket, bgn+1, end, nxt);
push(bucket, bgn+1, end, last);
}
int main()
{
#ifdef LOCAL
freopen("in.txt", "r", stdin);
#endif
int t; scanf("%d", &t);
while (t--)
{
lft.clear(); rght.clear();
int n, x, y; scanf("%d%d%d", &n, &x, &y);
pi privot {x, y};
for (int i=0; i<n; ++i)
{
scanf("%d%d", &a[i], &b[i]);
}
push(lft, 0, n/2, {0, 0});
push(rght, n/2+1, n-1, {0, 0});
int cnt = 0;
for (unsigned i=0; i<lft.size(); ++i) {
int ix = lft[i].first, iy = lft[i].second;
pi icur {ix, iy}; reduce(icur);
if (icur == privot) ++cnt;
}
for (unsigned j=0; j<rght.size(); ++j) {
int jx = rght[j].first, jy = rght[j].second;
pi jcur {jx, jy}; reduce(jcur);
if (jcur == privot) ++cnt;
}
for (unsigned i=0; i<lft.size(); ++i)
{
for (unsigned j=0; j<rght.size(); ++j)
{
int cx = lft[i].first + rght[j].first;
int cy = lft[i].second + rght[j].second;
pi cur {cx, cy}; reduce(cur);
if (cur == privot) ++cnt;
}
}
printf("%d\n", cnt);
printf("%f\n", (double)clock()/CLOCKS_PER_SEC);
}
}
| true |
66ffb812fd123aad740ec39a0e7a3f8177e6c135 | C++ | vidma/snowman-game-3d | /prog3d/Tuple2d.cpp | UTF-8 | 2,711 | 3.171875 | 3 | [] | no_license | #define EPSILON_PREC 0.000001
#include <math.h>
#include <iostream>
#include "Tuple2d.h"
/*!
*
* @file
* @brief Op\'erations sur les entit\'es de type (x,y)
*
* @author F. Aubert
*
*/
using namespace prog3d;
using namespace std;
vector<float> Tuple2d::fc(2);
void Tuple2d::cnew() {
c.resize(2);
this->set(0,0);
}
Tuple2d::Tuple2d() {
cnew();
}
Tuple2d::Tuple2d(double x,double y) {
cnew();
this->set(x,y);
}
void Tuple2d::set(double x,double y) {
c[0]=x;c[1]=y;
}
void Tuple2d::set(const Tuple2d ©) {
this->set(copy.getX(),copy.getY());
}
double Tuple2d::getX() const { return c[0];}
double Tuple2d::getY() const { return c[1];}
const double *Tuple2d::dv() const {return &c.front();}
const float *Tuple2d::fv() const {
fc[0]=c[0];fc[1]=c[1];
return &fc.front();
}
void Tuple2d::setX(double a) { c[0]=a;}
void Tuple2d::setY(double a) { c[1]=a;}
double Tuple2d::length2() {
return c[0]*c[0]+c[1]*c[1];
}
double Tuple2d::length() {
return sqrt(this->length2());
}
void Tuple2d::normalize() {
double d=this->length();
if (fabs(d)<EPSILON_PREC) {
throw "Normale nulle";
}
c[0]/=d;
c[1]/=d;
}
void Tuple2d::add(const Tuple2d &a) {
this->set(this->getX()+a.getX(),
this->getY()+a.getY());
}
void Tuple2d::add(const Tuple2d &a,const Tuple2d &b) {
this->set(b.getX()+a.getX(),
b.getY()+a.getY());
}
void Tuple2d::sub(const Tuple2d &a) {
this->set(this->getX()-a.getX(),
this->getY()-a.getY());
}
void Tuple2d::sub(const Tuple2d &a,const Tuple2d &b) {
this->set(a.getX()+b.getX(),
a.getY()+b.getY());
}
double Tuple2d::dot(const Tuple2d &a) {
return getX()*a.getX()+getY()*a.getY();
}
void Tuple2d::scale(double k) {
c[0]*=k;
c[1]*=k;
}
void Tuple2d::moyenne(const Tuple2d& n1,const Tuple2d &n2) {
this->add(n1,n2);
this->scale(0.5);
}
void Tuple2d::moyenne(const Tuple2d& n1) {
this->add(n1);
this->scale(0.5);
}
void Tuple2d::print() {
cout << "x=" << this->getX() << ",y=" << this->getY() << endl;
}
Tuple2d::~Tuple2d() {}
namespace prog3d {
Tuple2d operator +(const Tuple2d &a,const Tuple2d &b) {
Tuple2d p(a);
p.add(b);
return p;
}
Tuple2d operator -(const Tuple2d &a,const Tuple2d &b) {
Tuple2d p(a);
p.sub(b);
return p;
}
Tuple2d operator *(double k,const Tuple2d &b) {
Tuple2d p(b);
p.scale(k);
return p;
}
Tuple2d operator *(const Tuple2d &b,double k) {
return k*b;
}
Tuple2d &Tuple2d::operator=(const Tuple2d &a) {
this->set(a);
return *this;
}
ostream& operator <<(std::ostream &s,const Tuple2d &q) {
s << "(" << q.getX() << "," << q.getY() << ")";
return s;
}
}
| true |
305d9be54bc42779a4eba67093bc515a0f7fa86c | C++ | zoucuomiao/Algorithm_for_Interview-Chinese | /Algorithm_for_Interview/堆、栈、队列/队列_左旋转字符串.hpp | GB18030 | 1,578 | 3.65625 | 4 | [] | no_license | /*
תַ https://www.nowcoder.com/practice/12d959b108cb42b1ab72cef4d36af5ec?tpId=13&tqId=11196&tPage=3&rp=3&ru=/ta/coding-interviews&qru=/ta/coding-interviews/question-ranking
ĿԴָOffer
Ŀ
һλָѭƣROLиַģָһַSѭKλ磬ַS=abcXYZdef,Ҫѭ3λĽXYZdefabcDzǺܼOK㶨
ʱƣ1 ռƣ32768K ȶָ96578
֪ʶ㣺 ַ
˼·
û˫˶У
һʮ
str = "XYZdefabc", n = 3
str = "XYZdefabc" + "XYZ" = "XYZdefabcXYZ"
return str.substr(n, len)
ύ¼
1. ûп str = ""
*/
#pragma once
#include "../all.h"
class Solution {
public:
string LeftRotateString(string str, int n) {
if (str.empty()) return "";
deque<char> d;
for (auto i : str)
d.emplace_back(i);
int len = str.length();
int move = n % len;
stringstream ss;
for (int i = n; i < len; i++)
ss << d[i];
for (int i = 0; i < n; i++)
ss << d[i];
return ss.str();
}
};
void solve()
{
string s{ "abcXYZdef" };
string ret = Solution().LeftRotateString(s, 3);
print(ret);
}
| true |
fa51bdc7585c67b207ae0d5d07f5e9486c8861f2 | C++ | SuperChenSSS/Lanqiao | /算法提高/ADV-12 算法提高 计算时间.cpp | UTF-8 | 756 | 3.21875 | 3 | [] | no_license | 算法提高 计算时间
问题描述
给定一个t,将t秒转化为HH:MM:SS的形式,表示HH小时MM分钟SS秒。HH,MM,SS均是两位数,如果小于10用0补到两位。
输入格式
第一行一个数T(1<=T<=100,000),表示数据组数。后面每组数据读入一个数t,0<=t<24*60*60。
输出格式
每组数据一行,HH:MM:SS。
样例输入
2
0
86399
样例输出
00:00:00
23:59:59
#include <iostream>
#include <cstdio>
using namespace std;
int main() {
int n;
cin >> n;
for(int i = 0; i < n; i++) {
int t;
cin >> t;
int h, m;
h = t / 3600;
t = t % 3600;
m = t / 60;
t = t % 60;
printf("%02d:%02d:%02d\n", h, m, t);
}
return 0;
} | true |
53b3a781cc20321ff6c747f8fe3c07eb78cece67 | C++ | NavadeepGaneshU/Arduino_Dev | /Capacitive_Soli_Moist_Sensor.ino | UTF-8 | 1,184 | 2.921875 | 3 | [] | no_license | /*
Find soil moisture level using generic capacitive moisture sensor (3 Pins)
https://www.clevertronics.blogspot.com
Used Hardware : ESP32 by ESPRESSIF SYSTEMS
Used IDE : Arduino IDE 1.8.12
*/
const int AirValue = 0; //Replace this value with ADC value when probe is in air(Val_1).
const int WaterValue = 3100; //Replace this with ADC value when probe is fully dipped in water(Val_2).
int soilMoistureValue = 0;
int soilmoisturepercent=0;
const int MoistPin=35; // ADC PIN in your MCU
void setup()
{
Serial.begin(9600); // open serial port, set the baud rate to 9600 bps
}
void loop()
{
soilMoistureValue = analogRead(MoistPin); //Reads the capacitive sensor value.
Serial.println(soilMoistureValue); // This is pure ADC value. Use this for above 2 test cases(Val_1 and Val_2).
soilmoisturepercent = map(soilMoistureValue, AirValue, WaterValue, 0, 100);
if(soilmoisturepercent > 100)
{
Serial.println("100 %");
}
else if(soilmoisturepercent <0)
{
Serial.println("0 %");
}
else if(soilmoisturepercent >0 && soilmoisturepercent < 100)
{
Serial.print(soilmoisturepercent);
Serial.println("%");
}
delay(500);
}
| true |
ed9f30ae9b7cf7820e29903dd6f1916b2623d6e4 | C++ | Kose-i/Euclear_Project | /clear_box/Problem037.cpp | UTF-8 | 1,584 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <map>
#include <queue>
using namespace std;
int main() {
constexpr int n {1000000};
vector<char> is_prime(n+1, 1);
is_prime[0] = is_prime[1] = 0;
for (int i=0;i<=n;++i) {
if (is_prime[i] == 0) continue;
for (int j=i+i;j<=n;j+=i) is_prime[j] = 0;
}
map<int, int> mp;
map<int, int> mp_l;
for (int i=0;i<=n;++i) if (is_prime[i] == 1) mp[i] = 1;
{
queue<int> left;
for (int i=0;i<10;++i) {
if (mp[i] == 1) {
left.push(i);
}
}
for (;!left.empty();) {
int l = left.front(); left.pop();
for (int i=1;i<10;++i) {
int num = stoi(to_string(i) + to_string(l));
if (mp[num] == 1) {
mp_l[num] = 1;
left.push(num);
}
}
}
}
map<int, int> mp_r;
{
queue<int> right;
for (int i=0;i<10;++i) {
if (mp[i] == 1) {
right.push(i);
}
}
for (;!right.empty();) {
int r = right.front(); right.pop();
for (int i=1;i<10;++i) {
int num = stoi(to_string(r) + to_string(i));
if (mp[num] == 1) {
mp_r[num] = 1;
right.push(num);
}
}
}
}
int ans {};
for (const auto& e : mp_l) {
if (mp_r[e.first] == 1) {
ans += e.first;
}
}
cout << ans << '\n';
}
| true |
0e18319cade9465a9de21f23dabe936a777926af | C++ | JackYifan/Learning-Code | /1090.cpp | UTF-8 | 1,020 | 2.859375 | 3 | [] | no_license | #include<cstdio>
#include<vector>
#include<cmath>
using namespace std;
const int maxn=100010;
//用数组记录i的子结点
vector<int> child[maxn];
int n;
double p,r;
int maxdepth=0;
int num=0;
//全局变量+递归,当最大深度时返回就会递归完毕
//结点和结点的深度
void DFS(int root,int depth)
{
//如果是叶结点
if(child[root].size()==0)
{
if(depth>maxdepth)
{
maxdepth=depth;
num=1;//重新记数
}
else if(depth==maxdepth) num++;
return ;
}
//遍历root的子结点
for(int i=0;i<child[root].size();i++)
{
DFS(child[root][i],depth+1);
}
}
int main()
{
scanf("%d%lf%lf",&n,&p,&r);
int root;
for(int i=0;i<n;i++)
{
int x;
scanf("%d",&x);
if(x!=-1)
{
child[x].push_back(i);
}
else root=i;
}
DFS(root,0);
double result=p*pow(1+r/100,maxdepth);
printf("%.2f %d",result,num);
return 0;
} | true |
7cef62b9855548a785d0dd823a201f6e3b91204f | C++ | Telefragged/rndlevelsource | /rndlevelsource Unit Tests/WeightedVectorTests.cpp | UTF-8 | 1,317 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "stdafx.h"
#include "CppUnitTest.h"
#include "WeightedVector.h"
using namespace Microsoft::VisualStudio::CppUnitTestFramework;
namespace rndlevelsourceUnitTests
{
TEST_CLASS(WeightedVectorTest)
{
public:
TEST_METHOD(TestWeightedVectorPushBack)
{
WeightedVector<size_t> vector;
vector.push_back(1, 3);
Assert::AreEqual(size_t{ 1 }, vector.size());
Assert::AreEqual(ptrdiff_t{ 3 }, vector.totalWeight());
vector.push_back(2, 2);
Assert::AreEqual(size_t{ 2 }, vector.size());
Assert::AreEqual(ptrdiff_t{ 5 }, vector.totalWeight());
}
TEST_METHOD(TestWeightedVectorGetWeighted)
{
WeightedVector<size_t> vector;
vector.push_back(1);
vector.push_back(2, 2);
vector.push_back(3);
Assert::AreEqual(size_t{ 1 }, vector.getWeighted(0));
Assert::AreEqual(size_t{ 2 }, vector.getWeighted(2));
Assert::AreEqual(size_t{ 3 }, vector.getWeighted(3));
}
TEST_METHOD(TestWeightedVectorErase)
{
WeightedVector<size_t> vector;
vector.push_back(1);
vector.push_back(2, 2);
vector.push_back(3, 3);
vector.push_back(4, 4);
vector.erase(vector.begin() + 1, vector.begin() + 3);
Assert::AreEqual(size_t{ 4 }, vector[1]);
Assert::AreEqual(size_t{ 2 }, vector.size());
Assert::AreEqual(ptrdiff_t{ 5 }, vector.totalWeight());
}
};
}
| true |
5f5883e1572a127c396b29c961274eddcee175e4 | C++ | nodamushi/nsvd-reader | /include/nodamushi/svd/value/void_value.hpp | UTF-8 | 1,209 | 2.546875 | 3 | [
"CC0-1.0"
] | permissive | /*!
@brief value<void>
@file nodamushi/svd/value/void_value.hpp
*/
/*
* These codes are licensed under CC0.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
#ifndef NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP
#define NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP
# include "nodamushi/svd/value.hpp"
namespace nodamushi{
namespace svd{
// void
template<bool attribute,bool r,char... name>struct value<void,attribute,r,name...>
{
using type = void;
static constexpr bool REQUIRED=false;
static constexpr bool ATTRIBUTE=attribute;
constexpr bool empty()const noexcept{return true;}
constexpr operator bool()const noexcept{return false;}
constexpr bool check_require()const noexcept{return true;}
constexpr bool is_required()const noexcept{return false;}
constexpr bool is_attribute()const noexcept{return attribute;}
int operator*()const noexcept{return 0;}
int get()const noexcept{return 0;}
NODAMUSHI_CONSTEXPR_STRING get_name()const noexcept
{
# if __cplusplus >= 201703
return get_const_string<name...>();
# else
const char arr[] = {name...,'\0'};
return std::string(arr);
# endif
}
};
}}// end namespace nodamushi::svd
#endif // NODAMUSHI_SVD_VALUE_VOID_VALUE_HPP
| true |