blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
2
247
content_id
stringlengths
40
40
detected_licenses
listlengths
0
57
license_type
stringclasses
2 values
repo_name
stringlengths
4
111
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringlengths
4
58
visit_date
timestamp[ns]date
2015-07-25 18:16:41
2023-09-06 10:45:08
revision_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
committer_date
timestamp[ns]date
1970-01-14 14:03:36
2023-09-06 06:22:19
github_id
int64
3.89k
689M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
25 values
gha_event_created_at
timestamp[ns]date
2012-06-07 00:51:45
2023-09-14 21:58:52
gha_created_at
timestamp[ns]date
2008-03-27 23:40:48
2023-08-24 19:49:39
gha_language
stringclasses
159 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
7
10.5M
extension
stringclasses
111 values
filename
stringlengths
1
195
text
stringlengths
7
10.5M
ce8c467794ef96d2d81eda736b37b79f246013aa
6b2a8dd202fdce77c971c412717e305e1caaac51
/solutions_2755486_0/C++/Martynas/C-small-0.cpp
b5a806071e6b84b1301f909ddf0a3758aa639b28
[]
no_license
alexandraback/datacollection
0bc67a9ace00abbc843f4912562f3a064992e0e9
076a7bc7693f3abf07bfdbdac838cb4ef65ccfcf
refs/heads/master
2021-01-24T18:27:24.417992
2017-05-23T09:23:38
2017-05-23T09:23:38
84,313,442
2
4
null
null
null
null
UTF-8
C++
false
false
1,997
cpp
C-small-0.cpp
#include <cstdio> #include <map> #include <vector> #define MAXDAYS 677777 #define INF 2000000000 using namespace std; struct Attack { int w, e, s; Attack(int _w, int _e, int _s): w(_w), e(_e), s(_s) { } }; bool success(map<int, int>& wall, Attack& attack) { map<int, int>::iterator it = --(wall.upper_bound(attack.w)); while (it->first < attack.e) { if (it->second < attack.s) return true; ++it; } return false; } void update(map<int, int>& wall, Attack& attack) { map<int, int>::iterator it = --(wall.upper_bound(attack.w)); int last = it->second; if (attack.s > last) { if (it->first < attack.w) { it = wall.insert(it, make_pair(attack.w, attack.s)); } else { it->second = attack.s; } } for (++it; it != wall.end() && it->first < attack.e;) { if (it->second <= attack.s) { if (last <= attack.s) { last = it->second; wall.erase(it++); continue; } else { last = it->second; it->second = attack.s; } } else { last = it->second; } ++it; } if (it == wall.end()) { wall.insert(it, make_pair(attack.e, 0)); } else if (it->first > attack.e && last < attack.s) { wall.insert(it, make_pair(attack.e, last)); } } int solve() { vector<vector<Attack> > days(MAXDAYS); int ans = 0, N; scanf("%d", &N); for (int i = 0; i < N; ++i) { int d, n, w, e, s, dd, dp, ds; scanf("%d%d%d%d%d%d%d%d", &d, &n, &w, &e, &s, &dd, &dp, &ds); for (int i = 0; i < n; ++i) { days[d].push_back(Attack(w, e, s)); d += dd; w += dp; e += dp; s += ds; } } map<int, int> wall; wall.insert(make_pair(-INF, 0)); for (int day = 0; day < MAXDAYS; ++day) { for (int i = 0; i < days[day].size(); ++i) { ans += success(wall, days[day][i]); } for (int i = 0; i < days[day].size(); ++i) { update(wall, days[day][i]); } } return ans; } int main() { int T, t; scanf("%d", &T); for (t = 1; t <= T; t++) { printf("Case #%d: %d\n", t, solve()); } }
754617a1376610f3c7414cfd4590660190ebd451
059d13adb54bd33703aac40cce9a1f386e9e94d0
/samples/ooftst05.cpp
99fa4e3d1462b16ef2970d6b84486e58a42a8daa
[]
no_license
AndyDentFree/oofile
9e5bf44fc927db891f8faabbf05ab3167778ec48
c30de14a25c4e41f2908d4f71ca51c46d109cc89
refs/heads/master
2020-04-06T04:03:50.487740
2012-03-20T06:01:42
2012-03-20T06:01:42
33,068,851
1
0
null
null
null
null
UTF-8
C++
false
false
5,026
cpp
ooftst05.cpp
// Copyright 1994 A.D. Software. All Rights Reserved // OOFTEST5 // Simple stream I/O is used to interact with the user. // to demonstrate the date and date-time parsing #include "ooftest.h" void getStringMaybeBlank(char* readInto); void testDate(); void testTime(); void testDateTime(); int main() { cout << "OOFILE Validation Suite - Test 5\n" << "Today's date is : " << dbDate::today << endl << endl << "Simple test to try the input routines of the dbDate, dbTime & dbDateTime types\n\n" << "A number of sample entries are shown.\n\n"; testDate(); testTime(); testDateTime(); cout << endl << "done" << endl; return EXIT_SUCCESS; } void testDate() { unsigned short year, month, day; cout << "change the default date order to Month, Day Year" << endl; dbDate::sDefaultDateOrder=dbDate::orderMDY; dbDateTime::sBaseYear = 1900; char * test[] = { "Jan 15 2001", "Feb, 24, 1923", "3/09/67", "4-30-1988", "MAY12:1971", "June17", "september 4th", "oct 1st 38", "11/19" }; unsigned short numtests = 9; oofDate aDate; // define a standalone date variable aDate = dbDate::currentDate(); cout << "The current date is: " << aDate << endl; oofDate twoWeeksAgo = aDate-14; cout << "Two weeks ago was: " << twoWeeksAgo << endl; for (int i = 0; i < numtests; ++i) { cout << "Attempting to process the date: " << test[i] << endl; if (dbDate::str2ymd(test[i],year,month,day)) cout << " = (YMD) " << year << "/" << month << "/" << day << endl << endl; else cout << "bad date" << endl; } /* // uncomment this section if you want to try entering dates yourself for (;;) { cout << "Enter a date (MDY): " << flush; if (dbDate::istream2ymd(cin, year, month, day)) { cout << " = (YMD) " << year << "/" << month << "/" << day << endl << endl; cin.ignore(INT_MAX, '\n'); cin.clear(); } else { cout << "bad date" << endl; break; } } */ } void testTime() { //dbTime::long2dhmsm( -1, day, hour, minute, second, millisecond ); //cout << "dbTime::long2dhmsm test with a long of: -1" << endl; //cout << "day " << day << " "<< hour << ':' << minute << '.' << second << ' ' << millisecond << endl; short day; unsigned short hour, minute, second, millisecond; char * test[] = { "12:30.30am", // 00:30:30 "2.20 pm", // 14:20:00 "5:21", // 5:21:00 "2:30.5 PM", // 14:30:05 "23:59:59 AM", // 23:59:59 (ignore AM) "12:00:00 AM", // 00:00:00 "5Pm", // 17:00:00 "5 o'clock", // 5:00:00 "5 pm 30 minutes, 5 seconds", // 17:30:05 "12pm", // 12:00:00 "1pm" // 13:00:00 }; unsigned short numtests = 11; oofTime aTime; // define a standalone date variable aTime = dbTime::currentTime(); cout << "The current time is: " << aTime << endl << endl; for (int i = 0; i < numtests; ++i) { cout << "Processing the time: " << test[i] << endl; if (dbTime::str2dhmsm(test[i],day,hour,minute,second,millisecond)) { cout << " = (H:M:S) " << hour << ':'; if( minute < 10 ) cout << '0'; cout << minute << ':'; if( second < 10 ) cout << '0'; cout << second << endl << endl; } else { cout << " = bad date" << endl << endl; } } } void testDateTime() { char * test[] = { "Jan 15 2001 12:30.30am", "Feb, 24, 1923. 2.20 pm", "3/09/67 5:21", "4-30-1988 2:30.5 PM", "MAY12:1971 - 12:00:00 AM", "June17 '95 5Pm", "september 4th", "oct 1st 38 12pm", "11/19/11 1pm" }; unsigned short numtests = 9; unsigned short year, month, day, hour, minute, second; oofDateTime aDateTime; // define a standalone date variable aDateTime = dbDateTime::currentTime(); cout << "The current time is: " << aDateTime << endl << endl; for (int i = 0; i < numtests; ++i) { cout << "Processing the time: " << test[i] << endl; if (dbDateTime::str2ymdhms(test[i],year,month,day,hour,minute,second)) { cout << " = (DD/MM/YY HH:MM:SS) "; cout << day << '/' << month << '/' << year << ' '; cout << hour << ':'; if( minute < 10 ) cout << '0'; cout << minute << ':'; if( second < 10 ) cout << '0'; cout << second << endl << endl; } else { cout << " = bad date" << endl << endl; } } dbDateTime::ulong2ymdhms(dbDateTime::ymdhms2ulong(1970, 2, 10, 0, 0, 0),year,month,day,hour,minute,second); cout << "Testing dbDateTime::ulong2ymdhms parsing...1970, 2, 10, 0, 0, 0" << endl; cout << day << '/' << month << '/' << year << ' '; cout << hour << ':'; if( minute < 10 ) cout << '0'; cout << minute << ':'; if( second < 10 ) cout << '0'; cout << second << endl << endl; cout << "Testing dbDateTime::ymdhms2stream parsing...1975,10,5,13,40,29" << endl; dbDateTime::ymdhms2stream("DD/MM/YY hh:MIN:SEC pm",1975,10,5,13,40,29,cout); cout << endl<< endl; cout << "Testing dbDate:ymd2Stream parsing...1975,10,5" << endl; dbDate::ymd2Stream("YYYY/MM/DD",1975,10,5,cout); cout << endl<< endl; }
4cda3d6ac0a1fd41e1e4ed2f905879d66837cf5f
aa87d3ce0e0f4b1db28e40385bd155e2ba31ef56
/LearnEnglish/LearnEnglish.cpp
4df3cfc27ca4af8d2e171484215c94e34f6b2c76
[]
no_license
foocoder/HUAWEIOJ
b7a6bc38632db2703d95550d5ca568b4377ea927
fe0b14dbc59623c7c1e3a3a70f10972c21d8eda6
refs/heads/master
2021-01-20T06:14:30.699878
2017-05-15T06:18:30
2017-05-15T06:18:30
83,869,448
0
0
null
null
null
null
UTF-8
C++
false
false
3,191
cpp
LearnEnglish.cpp
// ---- Program Info Start---- //FileName: LearnEnglish.cpp // //Author: Fuchen Duan // //Email: slow295185031@gmail.com // //CreatedAt: 2017-03-21 11:27:57 // ---- Program Info End ---- #include <stdio.h> #include <string.h> #define MAX_ENG_LEN 1000 #define MAX_WORD_LEN 100 char cOnesAlphets[10][6] = { "", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", }; char cTeensAlphets[10][10] = { "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", }; char cTensAlphets[10][8] = { "", "ten", "twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety" }; char cHighPlace[4][9] = { "", "thousand", "million", "billion", }; int fnParseUnsignedInt( unsigned int nNum, char cEngArr[] ){ if( nNum > 999 ) return -1; if( nNum == 0 ){ return 1; } char cHundreds, cTens, cOnes; int nHundred, nTens; //Process Hundreds Place cHundreds = (nNum / 100) + '0'; nHundred = nNum / 100; nNum %= 100; nTens = nNum; /* printf( "%c\t", cHundreds ); */ //Process Tens Place cTens = (nNum / 10) + '0'; nNum %= 10; /* printf( "%c\t", cTens ); */ //Process Ones Place cOnes = nNum + '0'; /* printf( "%c\t", cOnes ); */ if( cHundreds != '0' ){ strncat( cEngArr, cOnesAlphets[cHundreds-'0'], 6 ); strncat( cEngArr, " hundred", 8 ); } //Process and if( nHundred && nTens ){ strncat( cEngArr, " and ", 5 ); } switch( cTens ){ case '0': break; case '1': strncat( cEngArr, cTeensAlphets[cOnes-'0'], 10 ); return 0; default: strncat( cEngArr, cTensAlphets[cTens-'0'], 8 ); break; } //Process blank if( (cTens-'0') && (cOnes-'0') ){ strncat( cEngArr, " ", 1 ); } if( cOnes != '0' ){ strncat( cEngArr, cOnesAlphets[cOnes-'0'], 6 ); } return 0; } void fnParseUnsignedLong( unsigned long ulNum, char cEngArr [] ){ if( ulNum == 0 ){ strncat( cEngArr, "zero", 5 ); return; } unsigned int nNumSegment [ 4 ] = {0}; int nIndex = 0; while( ulNum / 1000 ){ nNumSegment[nIndex++] = ulNum % 1000; ulNum /= 1000; } nNumSegment[nIndex++] = ulNum; char cWordArr[MAX_WORD_LEN]; for( int i = nIndex-1; i>=0; --i ){ if( nNumSegment[i] == 0 ) continue; memset( cWordArr, 0, sizeof( cWordArr ) ); fnParseUnsignedInt( nNumSegment[i], cWordArr ); strncat( cEngArr, cWordArr, MAX_WORD_LEN ); if( i != 0 ){ strncat( cEngArr, " ", 1 ); strncat( cEngArr, cHighPlace[i], 9 ); strncat( cEngArr, " ", 1 ); } } } int main(int argc, char *argv[]) { char cEngArr[MAX_ENG_LEN]; unsigned long ulNum; memset( cEngArr, 0, sizeof( cEngArr ) ); scanf( "%lu", &ulNum ); fnParseUnsignedLong( ulNum, cEngArr ); printf( "%s\n", cEngArr ); return 0; }
93929c5d292ca02f9ad3ec5f9960a6495fd38cd4
1004ee27e1f187ac9b333e3be77d975639b65c5e
/Magma/magma.h
fd002f3ba5798d5a8ac8e478cd247fd5e5862619
[]
no_license
michead/VulkanSPH
8349c4fe2541ffb5dadb5b91fb7aa0bdf93d904f
974bca4823b1326c6b11dee80cab6ff4e3e3a408
refs/heads/master
2021-09-08T00:29:51.749918
2018-03-04T10:06:56
2018-03-04T10:06:56
88,916,330
2
0
null
null
null
null
UTF-8
C++
false
false
1,109
h
magma.h
#pragma once #include <SDL2\SDL_syswm.h> #include <iostream> #include "magma_context.h" #include "config.h" #include "event_handler.h" #include "fluid_simulation.h" #include "perf.h" #include "hud.h" #include "scene.h" #include "gfx_context.h" #include "pipeline.h" // Magma display name #define MAGMA_DISPLAY_NAME "Magma" #define MAGMA_VERSION 1 #define MAGMA_SUCCESS 0 #define MAGMA_FATAL 1 #define MAGMA_CONFIG_FILENAME "magma.ini" #define MAGMA_RESULT int32_t class Magma { public: Magma() { init(); } ~Magma() { cleanup(); } void mainLoop(); MagmaContext context; Config config; GfxContext* mvkContext; Pipeline* pipeline; Scene* scene; SDL_Window* window; EventHandler* eventHandler; FluidSimulation* fluidSimulation; Perf* perf; HUD* hud; bool shouldQuit = false; private: void init(); void update(double deltaTime); void prepareFrame(); void render(double deltaTime); void presentFrame(); void cleanup(); void registerHUDExtensions(); void registerCameraMovement(); };
8fd77f61929b4c59dc8b51c001bcc758872d8be4
9ed54046af4bb2a9ffbf19f7d73394161b03145c
/MyOpenGLStudy01/Model.cpp
96c546fbe59395781f5d5c4b8a6a249a6bf94799
[]
no_license
HHHHHHHHHHHHHHHHHHHHHCS/MyOpenGLStudy01
7b078d5b62e673a2623145cc4feb66519812b937
707c1d92ccf07aed5d564b64f581fdc76534d6be
refs/heads/master
2022-02-24T05:03:40.762937
2022-02-09T03:56:33
2022-02-09T03:56:33
191,728,226
0
0
null
null
null
null
UTF-8
C++
false
false
5,650
cpp
Model.cpp
#include "Model.h" #include "ImageHelper.h" Model::Model(const std::string& path) { LoadModel(path); } Model::~Model() { } std::vector<Mesh> Model::GetMeshes() const { return meshes; } std::vector<Texture*> Model::GetTextures() const { return textures_loaded; } void Model::Draw(Shader shader) { for (unsigned int i = 0; i < meshes.size(); i++) { meshes[i].Draw(shader); } } void Model::LoadModel(const std::string& path) { Assimp::Importer importer; //第二个参数是后期处理 Triangulate是全部三角化 FlipUVs翻转UV 的 Y坐标 CalcTangentSpace 读取的时候自动计算法线切线 //aiProcess_GenNormals:如果模型不包含法向量的话,就为每个顶点创建法线。 //aiProcess_SplitLargeMeshes:将比较大的网格分割成更小的子网格,如果你的渲染有最大顶点数限制,只能渲染较小的网格,那么它会非常有用。 //aiProcess_OptimizeMeshes:和上个选项相反,它会将多个小网格拼接为一个大的网格,减少绘制调用从而进行优化。 const aiScene* scene = importer.ReadFile(path, aiProcess_Triangulate | aiProcess_FlipUVs | aiProcess_CalcTangentSpace); //如果没有场景 或者 flag==错误的flag 或者 没有根目录 if (!scene || (scene->mFlags & AI_SCENE_FLAGS_INCOMPLETE) || !scene->mRootNode) { std::cout << "ERROR::ASSIMP::" << importer.GetErrorString() << std::endl; return; } directory = path.substr(0, path.find_last_of('/')); ProcessNode(scene->mRootNode, scene); } void Model::ProcessNode(aiNode* node, const aiScene* scene) { //处理节点所有的网格(如果有的话) for (unsigned int i = 0; i < node->mNumMeshes; i++) { aiMesh* mesh = scene->mMeshes[node->mMeshes[i]]; meshes.emplace_back(ProcessMesh(mesh, scene)); for (Texture& texture : meshes.back().textures) { textures_loaded.emplace_back(&texture); } } //接下来对他的子节点继续重复这一过程 for (unsigned int i = 0; i < node->mNumChildren; i++) { ProcessNode(node->mChildren[i], scene); } } Mesh Model::ProcessMesh(aiMesh* mesh, const aiScene* scene) { std::vector<Vertex> vertices; std::vector<unsigned int> indices; std::vector<Texture> textures; LoadVertices(&vertices, mesh, scene); LoadIndices(&indices, mesh, scene); LoadTextures(&textures, mesh, scene); return Mesh(vertices, indices, textures); } void Model::LoadVertices(std::vector<Vertex>* vertices, aiMesh* mesh, const aiScene* scene) { for (unsigned int i = 0; i < mesh->mNumVertices; i++) { Vertex vertex; //处理顶点位置 法线 UV glm::vec3 vector; vector.x = mesh->mVertices[i].x; vector.y = mesh->mVertices[i].y; vector.z = mesh->mVertices[i].z; vertex.Position = vector; vector.x = mesh->mNormals[i].x; vector.y = mesh->mNormals[i].y; vector.z = mesh->mNormals[i].z; vertex.Normal = vector; vector.x = mesh->mTangents[i].x; vector.y = mesh->mTangents[i].y; vector.z = mesh->mTangents[i].z; vertex.Tangent = vector; if (mesh->mTextureCoords[0]) { //网格是否有纹理坐标? glm::vec2 vec; vec.x = mesh->mTextureCoords[0][i].x; vec.y = mesh->mTextureCoords[0][i].y; vertex.TexCoords = vec; } else { vertex.TexCoords = glm::vec2(0.0f, 0.0f); } vertices->push_back(vertex); } } void Model::LoadIndices(std::vector<unsigned int>* indices, aiMesh* mesh, const aiScene* scene) { //处理索引 for (unsigned int i = 0; i < mesh->mNumFaces; i++) { aiFace face = mesh->mFaces[i]; for (unsigned int j = 0; j < face.mNumIndices; j++) { indices->push_back(face.mIndices[j]); } } } void Model::LoadTextures(std::vector<Texture>* textures, aiMesh* mesh, const aiScene* scene) { //处理材质 if (mesh->mMaterialIndex >= 0) { // mMaterialIndex mesh 在 场景材质列表 中的索引 // 信息存在mtl中 // 很奇怪 height 是 normal ambient 是height aiMaterial* material = scene->mMaterials[mesh->mMaterialIndex]; std::vector<Texture> diffuseMaps = LoadMaterialTextures(material, aiTextureType_DIFFUSE, "texture_diffuse"); textures->insert(textures->end(), diffuseMaps.begin(), diffuseMaps.end()); std::vector<Texture> specularMaps = LoadMaterialTextures(material, aiTextureType_SPECULAR, "texture_specular"); textures->insert(textures->end(), specularMaps.begin(), specularMaps.end()); std::vector<Texture> normalMaps = LoadMaterialTextures(material, aiTextureType_HEIGHT, "texture_normal"); textures->insert(textures->end(), normalMaps.begin(), normalMaps.end()); // std::vector<Texture> emissionMaps = LoadMaterialTextures(material, aiTextureType_AMBIENT, "texture_emission"); // textures.insert(textures.end(), emissionMaps.begin(), emissionMaps.end()); } } std::vector<Texture> Model::LoadMaterialTextures(aiMaterial* mat, aiTextureType type, std::string typeName) { std::vector<Texture> textures; for (unsigned int i = 0; i < mat->GetTextureCount(type); i++) { aiString str; mat->GetTexture(type, i, &str); bool skip = false; for (auto* img : textures_loaded) { //用于比较两个字符串并根据比较结果返回整数。 //基本形式为strcmp(str1,str2),若str1=str2,则返回零; //若str1<str2,则返回负数;若str1>str2,则返回正数 if (std::strcmp(img->path.data, str.C_Str()) == 0) { textures.push_back(*img); skip = true; break; } } if (!skip) { Texture texture; texture.id = ImageHelper::LoadTexture(str.C_Str(), directory + "/"); texture.type = typeName; texture.path = str; textures.push_back(texture); } } return textures; }
44a6be9dfdf57e448ed213b58419b6a15bb7dacb
0225a1fb4e8bfd022a992a751c9ae60722f9ca0d
/3party/osrm/osrm-backend/contractor/contractor.hpp
ccfabbc8f34831c322823541f5d61efceeecdb1f
[ "Apache-2.0", "BSD-2-Clause" ]
permissive
organicmaps/organicmaps
fb2d86ea12abf5aab09cd8b7c55d5d5b98f264a1
76016d6ce0be42bfb6ed967868b9bd7d16b79882
refs/heads/master
2023-08-16T13:58:16.223655
2023-08-15T20:16:15
2023-08-15T20:16:15
324,829,379
6,981
782
Apache-2.0
2023-09-14T21:30:12
2020-12-27T19:02:26
C++
UTF-8
C++
false
false
40,284
hpp
contractor.hpp
/* Copyright (c) 2015, Project OSRM, Dennis Luxen, others All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef CONTRACTOR_HPP #define CONTRACTOR_HPP #include "../data_structures/binary_heap.hpp" #include "../data_structures/deallocating_vector.hpp" #include "../data_structures/dynamic_graph.hpp" #include "../data_structures/percent.hpp" #include "../data_structures/query_edge.hpp" #include "../data_structures/xor_fast_hash.hpp" #include "../data_structures/xor_fast_hash_storage.hpp" #include "../util/integer_range.hpp" #include "../util/simple_logger.hpp" #include "../util/timing_util.hpp" #include "../typedefs.h" #include <boost/assert.hpp> #include <stxxl/vector> #include <tbb/enumerable_thread_specific.h> #include <tbb/parallel_for.h> #include <tbb/parallel_sort.h> #include <algorithm> #include <limits> #include <vector> class Contractor { private: struct ContractorEdgeData { ContractorEdgeData() : distance(0), id(0), originalEdges(0), shortcut(0), forward(0), backward(0), is_original_via_node_ID(false) { } ContractorEdgeData(unsigned distance, unsigned original_edges, unsigned id, bool shortcut, bool forward, bool backward) : distance(distance), id(id), originalEdges(std::min((unsigned)1 << 28, original_edges)), shortcut(shortcut), forward(forward), backward(backward), is_original_via_node_ID(false) { } unsigned distance; unsigned id; unsigned originalEdges : 28; bool shortcut : 1; bool forward : 1; bool backward : 1; bool is_original_via_node_ID : 1; } data; struct ContractorHeapData { short hop; bool target; ContractorHeapData() : hop(0), target(false) {} ContractorHeapData(short h, bool t) : hop(h), target(t) {} }; using ContractorGraph = DynamicGraph<ContractorEdgeData>; // using ContractorHeap = BinaryHeap<NodeID, NodeID, int, ContractorHeapData, // ArrayStorage<NodeID, NodeID> // >; using ContractorHeap = BinaryHeap<NodeID, NodeID, int, ContractorHeapData, XORFastHashStorage<NodeID, NodeID>>; using ContractorEdge = ContractorGraph::InputEdge; struct ContractorThreadData { ContractorHeap heap; std::vector<ContractorEdge> inserted_edges; std::vector<NodeID> neighbours; explicit ContractorThreadData(NodeID nodes) : heap(nodes) {} }; struct NodePriorityData { int depth; NodePriorityData() : depth(0) {} }; struct ContractionStats { int edges_deleted_count; int edges_added_count; int original_edges_deleted_count; int original_edges_added_count; ContractionStats() : edges_deleted_count(0), edges_added_count(0), original_edges_deleted_count(0), original_edges_added_count(0) { } }; struct RemainingNodeData { RemainingNodeData() : id(0), is_independent(false) {} NodeID id : 31; bool is_independent : 1; }; struct ThreadDataContainer { explicit ThreadDataContainer(int number_of_nodes) : number_of_nodes(number_of_nodes) {} inline ContractorThreadData *getThreadData() { bool exists = false; auto &ref = data.local(exists); if (!exists) { ref = std::make_shared<ContractorThreadData>(number_of_nodes); } return ref.get(); } int number_of_nodes; using EnumerableThreadData = tbb::enumerable_thread_specific<std::shared_ptr<ContractorThreadData>>; EnumerableThreadData data; }; public: template <class ContainerT> Contractor(int nodes, ContainerT &input_edge_list) { std::vector<ContractorEdge> edges; edges.reserve(input_edge_list.size() * 2); const auto dend = input_edge_list.dend(); for (auto diter = input_edge_list.dbegin(); diter != dend; ++diter) { BOOST_ASSERT_MSG(static_cast<unsigned int>(std::max(diter->weight, 1)) > 0, "edge distance < 1"); #ifndef NDEBUG if (static_cast<unsigned int>(std::max(diter->weight, 1)) > 24 * 60 * 60 * 10) { SimpleLogger().Write(logWARNING) << "Edge weight large -> " << static_cast<unsigned int>(std::max(diter->weight, 1)); } #endif edges.emplace_back(diter->source, diter->target, static_cast<unsigned int>(std::max(diter->weight, 1)), 1, diter->edge_id, false, diter->forward ? true : false, diter->backward ? true : false); edges.emplace_back(diter->target, diter->source, static_cast<unsigned int>(std::max(diter->weight, 1)), 1, diter->edge_id, false, diter->backward ? true : false, diter->forward ? true : false); } // clear input vector input_edge_list.clear(); edges.shrink_to_fit(); tbb::parallel_sort(edges.begin(), edges.end()); NodeID edge = 0; for (NodeID i = 0; i < edges.size();) { const NodeID source = edges[i].source; const NodeID target = edges[i].target; const NodeID id = edges[i].data.id; // remove eigenloops if (source == target) { ++i; continue; } ContractorEdge forward_edge; ContractorEdge reverse_edge; forward_edge.source = reverse_edge.source = source; forward_edge.target = reverse_edge.target = target; forward_edge.data.forward = reverse_edge.data.backward = true; forward_edge.data.backward = reverse_edge.data.forward = false; forward_edge.data.shortcut = reverse_edge.data.shortcut = false; forward_edge.data.id = reverse_edge.data.id = id; forward_edge.data.originalEdges = reverse_edge.data.originalEdges = 1; forward_edge.data.distance = reverse_edge.data.distance = std::numeric_limits<int>::max(); // remove parallel edges while (i < edges.size() && edges[i].source == source && edges[i].target == target) { if (edges[i].data.forward) { forward_edge.data.distance = std::min(edges[i].data.distance, forward_edge.data.distance); } if (edges[i].data.backward) { reverse_edge.data.distance = std::min(edges[i].data.distance, reverse_edge.data.distance); } ++i; } // merge edges (s,t) and (t,s) into bidirectional edge if (forward_edge.data.distance == reverse_edge.data.distance) { if ((int)forward_edge.data.distance != std::numeric_limits<int>::max()) { forward_edge.data.backward = true; edges[edge++] = forward_edge; } } else { // insert seperate edges if (((int)forward_edge.data.distance) != std::numeric_limits<int>::max()) { edges[edge++] = forward_edge; } if ((int)reverse_edge.data.distance != std::numeric_limits<int>::max()) { edges[edge++] = reverse_edge; } } } std::cout << "merged " << edges.size() - edge << " edges out of " << edges.size() << std::endl; edges.resize(edge); contractor_graph = std::make_shared<ContractorGraph>(nodes, edges); edges.clear(); edges.shrink_to_fit(); BOOST_ASSERT(0 == edges.capacity()); // unsigned maxdegree = 0; // NodeID highestNode = 0; // // for(unsigned i = 0; i < contractor_graph->GetNumberOfNodes(); ++i) { // unsigned degree = contractor_graph->EndEdges(i) - // contractor_graph->BeginEdges(i); // if(degree > maxdegree) { // maxdegree = degree; // highestNode = i; // } // } // // SimpleLogger().Write() << "edges at node with id " << highestNode << " has degree // " << maxdegree; // for(unsigned i = contractor_graph->BeginEdges(highestNode); i < // contractor_graph->EndEdges(highestNode); ++i) { // SimpleLogger().Write() << " ->(" << highestNode << "," << // contractor_graph->GetTarget(i) // << "); via: " << contractor_graph->GetEdgeData(i).via; // } std::cout << "contractor finished initalization" << std::endl; } ~Contractor() {} void Run() { // for the preperation we can use a big grain size, which is much faster (probably cache) constexpr size_t InitGrainSize = 100000; constexpr size_t PQGrainSize = 100000; // auto_partitioner will automatically increase the blocksize if we have // a lot of data. It is *important* for the last loop iterations // (which have a very small dataset) that it is devisible. constexpr size_t IndependentGrainSize = 1; constexpr size_t ContractGrainSize = 1; constexpr size_t NeighboursGrainSize = 1; constexpr size_t DeleteGrainSize = 1; const NodeID number_of_nodes = contractor_graph->GetNumberOfNodes(); Percent p(number_of_nodes); ThreadDataContainer thread_data_list(number_of_nodes); NodeID number_of_contracted_nodes = 0; std::vector<RemainingNodeData> remaining_nodes(number_of_nodes); std::vector<float> node_priorities(number_of_nodes); std::vector<NodePriorityData> node_data(number_of_nodes); // initialize priorities in parallel tbb::parallel_for(tbb::blocked_range<int>(0, number_of_nodes, InitGrainSize), [&remaining_nodes](const tbb::blocked_range<int> &range) { for (int x = range.begin(); x != range.end(); ++x) { remaining_nodes[x].id = x; } }); std::cout << "initializing elimination PQ ..." << std::flush; tbb::parallel_for(tbb::blocked_range<int>(0, number_of_nodes, PQGrainSize), [this, &node_priorities, &node_data, &thread_data_list]( const tbb::blocked_range<int> &range) { ContractorThreadData *data = thread_data_list.getThreadData(); for (int x = range.begin(); x != range.end(); ++x) { node_priorities[x] = this->EvaluateNodePriority(data, &node_data[x], x); } }); std::cout << "ok" << std::endl << "preprocessing " << number_of_nodes << " nodes ..." << std::flush; bool flushed_contractor = false; while (number_of_nodes > 2 && number_of_contracted_nodes < number_of_nodes) { if (!flushed_contractor && (number_of_contracted_nodes > (number_of_nodes * 0.65))) { DeallocatingVector<ContractorEdge> new_edge_set; // this one is not explicitely // cleared since it goes out of // scope anywa std::cout << " [flush " << number_of_contracted_nodes << " nodes] " << std::flush; // Delete old heap data to free memory that we need for the coming operations thread_data_list.data.clear(); // Create new priority array std::vector<float> new_node_priority(remaining_nodes.size()); // this map gives the old IDs from the new ones, necessary to get a consistent graph // at the end of contraction orig_node_id_to_new_id_map.resize(remaining_nodes.size()); // this map gives the new IDs from the old ones, necessary to remap targets from the // remaining graph std::vector<NodeID> new_node_id_from_orig_id_map(number_of_nodes, UINT_MAX); // build forward and backward renumbering map and remap ids in remaining_nodes and // Priorities. for (const auto new_node_id : osrm::irange<std::size_t>(0, remaining_nodes.size())) { // create renumbering maps in both directions orig_node_id_to_new_id_map[new_node_id] = remaining_nodes[new_node_id].id; new_node_id_from_orig_id_map[remaining_nodes[new_node_id].id] = new_node_id; new_node_priority[new_node_id] = node_priorities[remaining_nodes[new_node_id].id]; remaining_nodes[new_node_id].id = new_node_id; } // walk over all nodes for (const auto i : osrm::irange<std::size_t>(0, contractor_graph->GetNumberOfNodes())) { const NodeID source = i; for (auto current_edge : contractor_graph->GetAdjacentEdgeRange(source)) { ContractorGraph::EdgeData &data = contractor_graph->GetEdgeData(current_edge); const NodeID target = contractor_graph->GetTarget(current_edge); if (SPECIAL_NODEID == new_node_id_from_orig_id_map[i]) { external_edge_list.push_back({source, target, data}); } else { // node is not yet contracted. // add (renumbered) outgoing edges to new DynamicGraph. ContractorEdge new_edge = {new_node_id_from_orig_id_map[source], new_node_id_from_orig_id_map[target], data}; new_edge.data.is_original_via_node_ID = true; BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[source], "new source id not resolveable"); BOOST_ASSERT_MSG(UINT_MAX != new_node_id_from_orig_id_map[target], "new target id not resolveable"); new_edge_set.push_back(new_edge); } } } // Delete map from old NodeIDs to new ones. new_node_id_from_orig_id_map.clear(); new_node_id_from_orig_id_map.shrink_to_fit(); // Replace old priorities array by new one node_priorities.swap(new_node_priority); // Delete old node_priorities vector new_node_priority.clear(); new_node_priority.shrink_to_fit(); // old Graph is removed contractor_graph.reset(); // create new graph std::sort(new_edge_set.begin(), new_edge_set.end()); contractor_graph = std::make_shared<ContractorGraph>(remaining_nodes.size(), new_edge_set); new_edge_set.clear(); flushed_contractor = true; // INFO: MAKE SURE THIS IS THE LAST OPERATION OF THE FLUSH! // reinitialize heaps and ThreadData objects with appropriate size thread_data_list.number_of_nodes = contractor_graph->GetNumberOfNodes(); } const int last = (int)remaining_nodes.size(); tbb::parallel_for(tbb::blocked_range<int>(0, last, IndependentGrainSize), [this, &node_priorities, &remaining_nodes, &thread_data_list]( const tbb::blocked_range<int> &range) { ContractorThreadData *data = thread_data_list.getThreadData(); // determine independent node set for (int i = range.begin(); i != range.end(); ++i) { const NodeID node = remaining_nodes[i].id; remaining_nodes[i].is_independent = this->IsNodeIndependent(node_priorities, data, node); } }); const auto first = stable_partition(remaining_nodes.begin(), remaining_nodes.end(), [](RemainingNodeData node_data) { return !node_data.is_independent; }); const int first_independent_node = static_cast<int>(first - remaining_nodes.begin()); // contract independent nodes tbb::parallel_for( tbb::blocked_range<int>(first_independent_node, last, ContractGrainSize), [this, &remaining_nodes, &thread_data_list](const tbb::blocked_range<int> &range) { ContractorThreadData *data = thread_data_list.getThreadData(); for (int position = range.begin(); position != range.end(); ++position) { const NodeID x = remaining_nodes[position].id; this->ContractNode<false>(data, x); } }); // make sure we really sort each block tbb::parallel_for( thread_data_list.data.range(), [&](const ThreadDataContainer::EnumerableThreadData::range_type &range) { for (auto &data : range) std::sort(data->inserted_edges.begin(), data->inserted_edges.end()); }); tbb::parallel_for( tbb::blocked_range<int>(first_independent_node, last, DeleteGrainSize), [this, &remaining_nodes, &thread_data_list](const tbb::blocked_range<int> &range) { ContractorThreadData *data = thread_data_list.getThreadData(); for (int position = range.begin(); position != range.end(); ++position) { const NodeID x = remaining_nodes[position].id; this->DeleteIncomingEdges(data, x); } }); // insert new edges for (auto &data : thread_data_list.data) { for (const ContractorEdge &edge : data->inserted_edges) { const EdgeID current_edge_ID = contractor_graph->FindEdge(edge.source, edge.target); if (current_edge_ID < contractor_graph->EndEdges(edge.source)) { ContractorGraph::EdgeData &current_data = contractor_graph->GetEdgeData(current_edge_ID); if (current_data.shortcut && edge.data.forward == current_data.forward && edge.data.backward == current_data.backward && edge.data.distance < current_data.distance) { // found a duplicate edge with smaller weight, update it. current_data = edge.data; continue; } } contractor_graph->InsertEdge(edge.source, edge.target, edge.data); } data->inserted_edges.clear(); } tbb::parallel_for( tbb::blocked_range<int>(first_independent_node, last, NeighboursGrainSize), [this, &remaining_nodes, &node_priorities, &node_data, &thread_data_list]( const tbb::blocked_range<int> &range) { ContractorThreadData *data = thread_data_list.getThreadData(); for (int position = range.begin(); position != range.end(); ++position) { NodeID x = remaining_nodes[position].id; this->UpdateNodeNeighbours(node_priorities, node_data, data, x); } }); // remove contracted nodes from the pool number_of_contracted_nodes += last - first_independent_node; remaining_nodes.resize(first_independent_node); remaining_nodes.shrink_to_fit(); // unsigned maxdegree = 0; // unsigned avgdegree = 0; // unsigned mindegree = UINT_MAX; // unsigned quaddegree = 0; // // for(unsigned i = 0; i < remaining_nodes.size(); ++i) { // unsigned degree = contractor_graph->EndEdges(remaining_nodes[i].first) // - // contractor_graph->BeginEdges(remaining_nodes[i].first); // if(degree > maxdegree) // maxdegree = degree; // if(degree < mindegree) // mindegree = degree; // // avgdegree += degree; // quaddegree += (degree*degree); // } // // avgdegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() ); // quaddegree /= std::max((unsigned)1,(unsigned)remaining_nodes.size() ); // // SimpleLogger().Write() << "rest: " << remaining_nodes.size() << ", max: " // << maxdegree << ", min: " << mindegree << ", avg: " << avgdegree << ", // quad: " << quaddegree; p.printStatus(number_of_contracted_nodes); } thread_data_list.data.clear(); } template <class Edge> inline void GetEdges(DeallocatingVector<Edge> &edges) { Percent p(contractor_graph->GetNumberOfNodes()); SimpleLogger().Write() << "Getting edges of minimized graph"; const NodeID number_of_nodes = contractor_graph->GetNumberOfNodes(); if (contractor_graph->GetNumberOfNodes()) { Edge new_edge; for (const auto node : osrm::irange(0u, number_of_nodes)) { p.printStatus(node); for (auto edge : contractor_graph->GetAdjacentEdgeRange(node)) { const NodeID target = contractor_graph->GetTarget(edge); const ContractorGraph::EdgeData &data = contractor_graph->GetEdgeData(edge); if (!orig_node_id_to_new_id_map.empty()) { new_edge.source = orig_node_id_to_new_id_map[node]; new_edge.target = orig_node_id_to_new_id_map[target]; } else { new_edge.source = node; new_edge.target = target; } BOOST_ASSERT_MSG(UINT_MAX != new_edge.source, "Source id invalid"); BOOST_ASSERT_MSG(UINT_MAX != new_edge.target, "Target id invalid"); new_edge.data.distance = data.distance; new_edge.data.shortcut = data.shortcut; if (!data.is_original_via_node_ID && !orig_node_id_to_new_id_map.empty()) { new_edge.data.id = orig_node_id_to_new_id_map[data.id]; } else { new_edge.data.id = data.id; } BOOST_ASSERT_MSG(new_edge.data.id != INT_MAX, // 2^31 "edge id invalid"); new_edge.data.forward = data.forward; new_edge.data.backward = data.backward; edges.push_back(new_edge); } } } contractor_graph.reset(); orig_node_id_to_new_id_map.clear(); orig_node_id_to_new_id_map.shrink_to_fit(); BOOST_ASSERT(0 == orig_node_id_to_new_id_map.capacity()); edges.append(external_edge_list.begin(), external_edge_list.end()); external_edge_list.clear(); } private: inline void Dijkstra(const int max_distance, const unsigned number_of_targets, const int maxNodes, ContractorThreadData *const data, const NodeID middleNode) { ContractorHeap &heap = data->heap; int nodes = 0; unsigned number_of_targets_found = 0; while (!heap.Empty()) { const NodeID node = heap.DeleteMin(); const int distance = heap.GetKey(node); const short current_hop = heap.GetData(node).hop + 1; if (++nodes > maxNodes) { return; } if (distance > max_distance) { return; } // Destination settled? if (heap.GetData(node).target) { ++number_of_targets_found; if (number_of_targets_found >= number_of_targets) { return; } } // iterate over all edges of node for (auto edge : contractor_graph->GetAdjacentEdgeRange(node)) { const ContractorEdgeData &data = contractor_graph->GetEdgeData(edge); if (!data.forward) { continue; } const NodeID to = contractor_graph->GetTarget(edge); if (middleNode == to) { continue; } const int to_distance = distance + data.distance; // New Node discovered -> Add to Heap + Node Info Storage if (!heap.WasInserted(to)) { heap.Insert(to, to_distance, ContractorHeapData(current_hop, false)); } // Found a shorter Path -> Update distance else if (to_distance < heap.GetKey(to)) { heap.DecreaseKey(to, to_distance); heap.GetData(to).hop = current_hop; } } } } inline float EvaluateNodePriority(ContractorThreadData *const data, NodePriorityData *const node_data, const NodeID node) { ContractionStats stats; // perform simulated contraction ContractNode<true>(data, node, &stats); // Result will contain the priority float result; if (0 == (stats.edges_deleted_count * stats.original_edges_deleted_count)) { result = 1.f * node_data->depth; } else { result = 2.f * (((float)stats.edges_added_count) / stats.edges_deleted_count) + 4.f * (((float)stats.original_edges_added_count) / stats.original_edges_deleted_count) + 1.f * node_data->depth; } BOOST_ASSERT(result >= 0); return result; } template <bool RUNSIMULATION> inline bool ContractNode(ContractorThreadData *data, const NodeID node, ContractionStats *stats = nullptr) { ContractorHeap &heap = data->heap; int inserted_edges_size = data->inserted_edges.size(); std::vector<ContractorEdge> &inserted_edges = data->inserted_edges; for (auto in_edge : contractor_graph->GetAdjacentEdgeRange(node)) { const ContractorEdgeData &in_data = contractor_graph->GetEdgeData(in_edge); const NodeID source = contractor_graph->GetTarget(in_edge); if (RUNSIMULATION) { BOOST_ASSERT(stats != nullptr); ++stats->edges_deleted_count; stats->original_edges_deleted_count += in_data.originalEdges; } if (!in_data.backward) { continue; } heap.Clear(); heap.Insert(source, 0, ContractorHeapData()); int max_distance = 0; unsigned number_of_targets = 0; for (auto out_edge : contractor_graph->GetAdjacentEdgeRange(node)) { const ContractorEdgeData &out_data = contractor_graph->GetEdgeData(out_edge); if (!out_data.forward) { continue; } const NodeID target = contractor_graph->GetTarget(out_edge); const int path_distance = in_data.distance + out_data.distance; max_distance = std::max(max_distance, path_distance); if (!heap.WasInserted(target)) { heap.Insert(target, INT_MAX, ContractorHeapData(0, true)); ++number_of_targets; } } if (RUNSIMULATION) { Dijkstra(max_distance, number_of_targets, 1000, data, node); } else { Dijkstra(max_distance, number_of_targets, 2000, data, node); } for (auto out_edge : contractor_graph->GetAdjacentEdgeRange(node)) { const ContractorEdgeData &out_data = contractor_graph->GetEdgeData(out_edge); if (!out_data.forward) { continue; } const NodeID target = contractor_graph->GetTarget(out_edge); const int path_distance = in_data.distance + out_data.distance; const int distance = heap.GetKey(target); if (path_distance < distance) { if (RUNSIMULATION) { BOOST_ASSERT(stats != nullptr); stats->edges_added_count += 2; stats->original_edges_added_count += 2 * (out_data.originalEdges + in_data.originalEdges); } else { inserted_edges.emplace_back(source, target, path_distance, out_data.originalEdges + in_data.originalEdges, node, true, true, false); inserted_edges.emplace_back(target, source, path_distance, out_data.originalEdges + in_data.originalEdges, node, true, false, true); } } } } if (!RUNSIMULATION) { int iend = inserted_edges.size(); for (int i = inserted_edges_size; i < iend; ++i) { bool found = false; for (int other = i + 1; other < iend; ++other) { if (inserted_edges[other].source != inserted_edges[i].source) { continue; } if (inserted_edges[other].target != inserted_edges[i].target) { continue; } if (inserted_edges[other].data.distance != inserted_edges[i].data.distance) { continue; } if (inserted_edges[other].data.shortcut != inserted_edges[i].data.shortcut) { continue; } inserted_edges[other].data.forward |= inserted_edges[i].data.forward; inserted_edges[other].data.backward |= inserted_edges[i].data.backward; found = true; break; } if (!found) { inserted_edges[inserted_edges_size++] = inserted_edges[i]; } } inserted_edges.resize(inserted_edges_size); } return true; } inline void DeleteIncomingEdges(ContractorThreadData *data, const NodeID node) { std::vector<NodeID> &neighbours = data->neighbours; neighbours.clear(); // find all neighbours for (auto e : contractor_graph->GetAdjacentEdgeRange(node)) { const NodeID u = contractor_graph->GetTarget(e); if (u != node) { neighbours.push_back(u); } } // eliminate duplicate entries ( forward + backward edges ) std::sort(neighbours.begin(), neighbours.end()); neighbours.resize(std::unique(neighbours.begin(), neighbours.end()) - neighbours.begin()); for (const auto i : osrm::irange<std::size_t>(0, neighbours.size())) { contractor_graph->DeleteEdgesTo(neighbours[i], node); } } inline bool UpdateNodeNeighbours(std::vector<float> &priorities, std::vector<NodePriorityData> &node_data, ContractorThreadData *const data, const NodeID node) { std::vector<NodeID> &neighbours = data->neighbours; neighbours.clear(); // find all neighbours for (auto e : contractor_graph->GetAdjacentEdgeRange(node)) { const NodeID u = contractor_graph->GetTarget(e); if (u == node) { continue; } neighbours.push_back(u); node_data[u].depth = (std::max)(node_data[node].depth + 1, node_data[u].depth); } // eliminate duplicate entries ( forward + backward edges ) std::sort(neighbours.begin(), neighbours.end()); neighbours.resize(std::unique(neighbours.begin(), neighbours.end()) - neighbours.begin()); // re-evaluate priorities of neighboring nodes for (const NodeID u : neighbours) { priorities[u] = EvaluateNodePriority(data, &(node_data)[u], u); } return true; } inline bool IsNodeIndependent(const std::vector<float> &priorities, ContractorThreadData *const data, NodeID node) const { const float priority = priorities[node]; std::vector<NodeID> &neighbours = data->neighbours; neighbours.clear(); for (auto e : contractor_graph->GetAdjacentEdgeRange(node)) { const NodeID target = contractor_graph->GetTarget(e); if (node == target) { continue; } const float target_priority = priorities[target]; BOOST_ASSERT(target_priority >= 0); // found a neighbour with lower priority? if (priority > target_priority) { return false; } // tie breaking if (std::abs(priority - target_priority) < std::numeric_limits<float>::epsilon() && bias(node, target)) { return false; } neighbours.push_back(target); } std::sort(neighbours.begin(), neighbours.end()); neighbours.resize(std::unique(neighbours.begin(), neighbours.end()) - neighbours.begin()); // examine all neighbours that are at most 2 hops away for (const NodeID u : neighbours) { for (auto e : contractor_graph->GetAdjacentEdgeRange(u)) { const NodeID target = contractor_graph->GetTarget(e); if (node == target) { continue; } const float target_priority = priorities[target]; BOOST_ASSERT(target_priority >= 0); // found a neighbour with lower priority? if (priority > target_priority) { return false; } // tie breaking if (std::abs(priority - target_priority) < std::numeric_limits<float>::epsilon() && bias(node, target)) { return false; } } } return true; } // This bias function takes up 22 assembly instructions in total on X86 inline bool bias(const NodeID a, const NodeID b) const { const unsigned short hasha = fast_hash(a); const unsigned short hashb = fast_hash(b); // The compiler optimizes that to conditional register flags but without branching // statements! if (hasha != hashb) { return hasha < hashb; } return a < b; } std::shared_ptr<ContractorGraph> contractor_graph; std::vector<ContractorGraph::InputEdge> contracted_edge_list; stxxl::vector<QueryEdge> external_edge_list; std::vector<NodeID> orig_node_id_to_new_id_map; XORFastHash fast_hash; }; #endif // CONTRACTOR_HPP
ed2a69bbc1b9a9a5712efbe7206b163cc1e67d07
54065bcaa1c80f235ba58951adc2820b10b7213b
/implicitcolorizer.cpp
7c43b69839df50e9ab3511d3e3fcd0ff0c4a70e1
[]
no_license
Gomer3261/CSC486A-Modelling
7918f7b3e292de23a7ab5933d6bbc6d26be6e73a
6b5eab04e3b528b1a77c007036680bce956cddc7
refs/heads/master
2016-09-10T18:24:04.927582
2015-02-26T19:56:08
2015-02-26T19:56:08
31,385,695
1
0
null
null
null
null
UTF-8
C++
false
false
786
cpp
implicitcolorizer.cpp
#include "implicitcolorizer.h" ImplicitColorizer::ImplicitColorizer(ImplicitObject *child) : ImplicitObject(), m_child(child) { } float ImplicitColorizer::getFieldValue(QVector3D point) { return m_child->getFieldValue(point); } PointFlavour ImplicitColorizer::getFlavour(QVector3D point) { PointFlavour flavour = m_child->getFlavour(point); flavour = PointFlavour(transformColor(point, flavour.color()), flavour.normal()); return flavour; } bool ImplicitColorizer::containsPoint(QVector3D point, float errorMargin) { return m_child->containsPoint(point, errorMargin); } QList<QVector3D> ImplicitColorizer::getPointsInObject() { return m_child->getPointsInObject(); } void ImplicitColorizer::setChild(ImplicitObject* child) { m_child = child; }
217df8daa2288fbb6bca556c2907be580beccd21
9f9660f318732124b8a5154e6670e1cfc372acc4
/Case_save/Case20/Case/case4/1600/alphat
7b9f48714586ae38be7397270b73de2cec949faf
[]
no_license
mamitsu2/aircond5
9a6857f4190caec15823cb3f975cdddb7cfec80b
20a6408fb10c3ba7081923b61e44454a8f09e2be
refs/heads/master
2020-04-10T22:41:47.782141
2019-09-02T03:42:37
2019-09-02T03:42:37
161,329,638
0
0
null
null
null
null
UTF-8
C++
false
false
9,433
alphat
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "1600"; object alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [1 -1 -1 0 0 0 0]; internalField nonuniform List<scalar> 459 ( 0.00125447 0.00137178 0.00139756 0.00146481 0.0015271 0.00158542 0.00164262 0.00169835 0.00173755 0.00175384 0.00174134 0.00169644 0.00161896 0.00151531 0.00140145 0.000550966 0.000673494 0.000757694 0.000753055 0.000727107 0.000693011 0.00065025 0.000607884 0.000569424 0.000535268 0.000505014 0.000478125 0.000454204 0.00043272 0.000412907 0.000393769 0.000373845 0.000359543 0.000327421 0.00170755 0.00417728 0.00399962 0.00465556 0.00530086 0.00594598 0.00651458 0.00694349 0.00733108 0.00764579 0.00784378 0.00787557 0.00766569 0.00702414 0.00525957 0.00142959 0.000838822 0.000595388 0.00125067 0.00172717 0.00206711 0.00224613 0.00223624 0.00179735 0.00154995 0.00137267 0.00123646 0.00112811 0.00103993 0.000964006 0.000893336 0.000824906 0.000764107 0.000711367 0.00083422 0.000427274 0.00208393 0.00570517 0.00496417 0.00622124 0.00685038 0.00731858 0.00768322 0.00797562 0.00829227 0.00862167 0.00892476 0.00914694 0.00922759 0.00907628 0.00845314 0.00651509 0.00142383 0.00118679 0.00170572 0.00218453 0.00260911 0.00289406 0.00281039 0.00093098 0.000822037 0.000734527 0.000663923 0.000606407 0.000559052 0.000519755 0.000487172 0.000460737 0.000496117 0.000572963 0.000939238 0.000494056 0.00244463 0.00728881 0.00498098 0.00658372 0.00713425 0.00732481 0.00745207 0.00760682 0.00786167 0.00820017 0.00858135 0.00893748 0.0092056 0.00931418 0.00918046 0.00851096 0.0062161 0.00170249 0.00211071 0.00272306 0.00331028 0.00376972 0.00404393 0.00377976 0.00105048 0.000956202 0.000888612 0.000837065 0.000793321 0.000753302 0.000714951 0.000674797 0.000628313 0.000588842 0.000601416 0.00107323 0.000545895 0.00281211 0.00932132 0.00547714 0.0063436 0.00707015 0.00712241 0.00706938 0.00715775 0.00738353 0.0077278 0.0081546 0.00857085 0.00888903 0.00903935 0.00899758 0.00871492 0.00799493 0.00661542 0.00614133 0.00598178 0.0059218 0.00587883 0.00580451 0.00557009 0.00469771 0.00427725 0.00403249 0.0038442 0.00364694 0.00336389 0.00298234 0.00251919 0.00200444 0.00148526 0.00109589 0.00110216 0.00073313 0.000672526 0.000814262 0.000914054 0.00320151 0.011534 0.00753709 0.0063265 0.0068752 0.00712463 0.00697273 0.00704324 0.00721307 0.0075207 0.00795126 0.00840665 0.00875587 0.00889889 0.00881398 0.00855693 0.00821652 0.00786284 0.00766114 0.00750624 0.00732811 0.00712505 0.00690006 0.00662496 0.00622828 0.00587594 0.00556501 0.00526788 0.00496566 0.00463675 0.00422233 0.00370739 0.00309221 0.00241174 0.00181017 0.00135756 0.0010242 0.000869911 0.00123997 0.000954019 0.00355529 0.0130785 0.0105525 0.00815926 0.00772328 0.00762248 0.00736333 0.00720283 0.0072597 0.00756046 0.0080376 0.00854495 0.00891192 0.00902098 0.00886257 0.00855187 0.00828746 0.00819777 0.00820192 0.00811311 0.00788388 0.00755914 0.00717907 0.00676419 0.00633164 0.00593164 0.00556539 0.00522394 0.00490738 0.00462294 0.00437037 0.00402679 0.00354581 0.00295843 0.00239333 0.00188813 0.00151667 0.00140115 0.00142881 0.00108719 0.00362139 0.0116194 0.0103325 0.00954912 0.00884339 0.00803154 0.0074044 0.00716286 0.00732837 0.00781159 0.00844683 0.00902426 0.00934972 0.00933313 0.00902423 0.00862044 0.00838117 0.0083778 0.00836724 0.0080947 0.00763739 0.00708485 0.00650762 0.00596254 0.00548618 0.00508571 0.00474564 0.00445754 0.00422507 0.00405762 0.00396426 0.00391642 0.00367727 0.00329948 0.00296616 0.00279362 0.00289704 0.00333443 0.00409409 0.00169481 0.00352156 0.00417898 0.00464132 0.00475628 0.00485838 0.00513743 0.0056943 0.00653635 0.00756369 0.00859746 0.00944634 0.00993166 0.00993857 0.00952993 0.00892664 0.00852209 0.00828312 0.00806288 0.00769867 0.00713622 0.00645953 0.00577059 0.00515145 0.00464154 0.00423831 0.00391643 0.00365071 0.00342629 0.00323418 0.00306565 0.00291129 0.00276995 0.00265865 0.00257663 0.00254467 0.0025544 0.00253886 0.00243701 0.00227826 0.0015933 0.00175811 0.00360618 0.00587252 0.0077496 0.00920514 0.0103065 0.0109926 0.0112539 0.0111332 0.0106251 0.00983572 0.00886439 0.0080444 0.00753159 0.00710267 0.00657605 0.00594167 0.00527505 0.00465101 0.00411737 0.00369796 0.00337562 0.00312369 0.00292202 0.0027597 0.00263199 0.00253712 0.0024745 0.00244645 0.00245049 0.00247037 0.00250141 0.00253463 0.00254241 0.00248018 0.00233376 0.00211332 0.00132516 0.00235197 0.00605049 0.00900604 0.0101271 0.0106838 0.0108479 0.010593 0.00999321 0.00917147 0.00824881 0.00737786 0.00660263 0.00597443 0.00543295 0.0048838 0.00434561 0.0038729 0.00349353 0.00320492 0.00298846 0.00281538 0.00266953 0.00254366 0.00244094 0.00236485 0.00231541 0.00229162 0.0022917 0.00232169 0.00237833 0.00245755 0.00255067 0.00263891 0.00269976 0.00267845 0.00270816 0.00274671 0.00135102 0.00208667 0.00221162 0.00229975 0.00246242 0.00237611 0.00227711 0.00221268 0.00212186 0.00199216 0.00183152 0.00165116 0.00146384 0.00128231 0.00112683 0.00100932 0.000925544 0.000865881 0.000822702 0.000791402 0.000769317 0.00075472 0.000746487 0.000743829 0.000746861 0.000756047 0.000771053 0.000791668 0.000818316 0.000851671 0.000892666 0.000940246 0.000994483 0.00105596 0.00112517 0.00120155 0.00129233 0.00132139 0.00128735 0.00120958 0.00112693 ) ; boundaryField { floor { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 29 ( 0.000197698 7.70075e-05 9.53093e-05 0.000107648 0.000106972 0.000103186 9.81853e-05 9.18712e-05 8.55654e-05 7.97941e-05 7.46281e-05 7.00178e-05 6.58913e-05 6.21957e-05 5.88555e-05 5.57563e-05 5.27445e-05 4.95888e-05 4.73103e-05 4.2149e-05 4.21484e-05 5.80056e-05 6.834e-05 7.62402e-05 0.000197695 7.70065e-05 8.36948e-05 0.000168344 0.000238033 ) ; } ceiling { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 43 ( 0.00028829 0.000304437 0.00031577 0.00033669 0.000325725 0.000313059 0.000304783 0.000293063 0.000276224 0.000255197 0.000231344 0.000206261 0.000181605 0.000160172 0.000143746 0.000131901 0.000123389 0.000117185 0.000112664 0.000109461 0.000107338 0.000106138 0.00010575 0.000106193 0.000107531 0.000109713 0.000112703 0.000116554 0.000121353 0.000127221 0.000133991 0.00014166 0.000150294 0.000159945 0.000170517 0.000182983 0.000186953 0.000182302 0.000171626 0.000160194 0.000469225 0.000549185 0.000322293 ) ; } sWall { type compressible::alphatWallFunction; Prt 0.85; value uniform 0.000287081; } nWall { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 6(0.000129949 0.000135617 0.000154322 0.000187142 0.000190661 0.000159872); } sideWalls { type empty; } glass1 { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 9(0.000173374 0.000233611 0.000282432 0.000328414 0.000374589 0.000422877 0.000466267 0.000474455 0.000462508); } glass2 { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 2(0.000235461 0.000222067); } sun { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 14 ( 0.000177681 0.000193678 0.000197175 0.000206266 0.000214644 0.000222454 0.000230083 0.000237488 0.00024268 0.000244834 0.000243179 0.000237232 0.000226927 0.000213057 ) ; } heatsource1 { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 3(9.52702e-05 0.000115952 0.000130252); } heatsource2 { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 4(0.000201626 0.00011949 0.000119488 0.000200846); } Table_master { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 9(0.000132656 0.000117071 0.000104374 9.39966e-05 8.54437e-05 7.83268e-05 7.2364e-05 6.7377e-05 6.33001e-05); } Table_slave { type compressible::alphatWallFunction; Prt 0.85; value nonuniform List<scalar> 9(0.00014951 0.000136235 0.000126624 0.000119237 0.000112926 0.000107115 0.000101511 9.56056e-05 8.87146e-05); } inlet { type fixedValue; value uniform 1.94e-05; } outlet { type zeroGradient; } } // ************************************************************************* //
a8ddfb2b59ba409d6801513e4a8993519d3fd510
32fe79149d81bd93890d9b4e907a7fc62812b47a
/consumer/src/main.cpp
a7e121a8524c1f10ba280fd1c678eebda7ca2364
[]
no_license
dmi3s/snt
c6db25ed054b65444d9340a45803b1ba2698903d
3580110138e28f0c71e6a23b992f4ed492ee8bc6
refs/heads/master
2021-07-22T18:12:20.780727
2017-10-06T16:45:52
2017-10-06T16:45:52
95,818,380
0
0
null
null
null
null
UTF-8
C++
false
false
2,813
cpp
main.cpp
#include <string> #include <iostream> #include <iomanip> #include <vector> #pragma warning(push, 3) #include <boost/process.hpp> #pragma warning(pop) #include <boost/filesystem.hpp> #include "sample.hpp" namespace bp = boost::process; namespace fs = boost::filesystem; using namespace std; using namespace sn_test; namespace { fs::path getProducer(const char* consumer) { const auto module_name = #ifdef _WINDOWS "producer.exe"; #else "producer"; #endif fs::path producer(consumer); return producer.parent_path() / module_name; } #ifdef _WINDOWS // Windows specific end of line bp::ipstream& getline(bp::ipstream& in, std::string& str) { std::getline(in, str); if (!str.empty() && str.back() == '\r') str.pop_back(); return in; } #endif void skip2EOS(bp::ipstream& is) { string line; while (line != "EOS") getline(is, line); } vector<sample> processAnswer(const string& first_line, bp::ipstream& is) { vector<sample> samples; if (first_line == "EOS" ) return samples; try { size_t n_samples = stoul(first_line); samples.reserve(n_samples); string line; while (n_samples > 0) { getline(is, line); if (line.empty()) continue; samples.push_back(stosm(line)); --n_samples; } getline(is, line); if (line != "EOS") { cerr << "Error: awaiting EOS, but get " << line << "\n"; skip2EOS(is); } } catch (const exception& e) { cerr << "Error: " << e.what(); skip2EOS(is); } return samples; } } int main(int /*argc*/, char* argv[]) { const auto ppath = getProducer(argv[0]); cout << "Starting producer \"" << ppath.string() << "\"\n"; bp::opstream out; bp::ipstream in; bp::child c(ppath, bp::std_out > in, bp::std_in < out); if (!c.running()) { cerr << "Failed." << endl; return 1; } cout << "Ok.\nEnter time for the last samples in milliseconds.\nEnter 0 to exit.\n"; string str; while (c.running()) { cout << "mS> "; getline(cin, str); out << str << endl; getline(in, str); if (str == "EOF") { cout << "Bye-bye!\n"; return 0; } auto samples = processAnswer(str, in); cout << "Number of samples: " << samples.size() << "\n"; size_t i = 0; for (auto s : samples) cout << "[" << i++ << "]: " << setw(16) << s << "\n"; } }
157adc8e5046fc9467f5f778342033aba0f7c32f
f14626611951a4f11a84cd71f5a2161cd144a53a
/SERVER/setup/NewSkillList.cpp
116c7d71d9b5f300a97a833f7fa99082b6365193
[]
no_license
Deadmanovi4/mmo-resourse
045616f9be76f3b9cd4a39605accd2afa8099297
1c310e15147ae775a59626aa5b5587c6895014de
refs/heads/master
2021-05-29T06:14:28.650762
2015-06-18T01:16:43
2015-06-18T01:16:43
null
0
0
null
null
null
null
GB18030
C++
false
false
3,384
cpp
NewSkillList.cpp
/////////////////////////////////////////////////////////////////////////////// /// NewSkillList.cpp /// /// PATH: E:\alienbrainWork\Game_Program_Develop\guangmang\SERVER\setup /// /// CREATED: 08/06/2007 13:49:01 PM by 陈先进 /// /// PURPOSE: 技能类 //////////////////////////////////////////////////////////////////////-- #include "stdafx.h" #include "NewSkillList.h" #include "../../public/StrUnifyInput.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif //CNewSkillProperties::tagChangeProperty::~tagChangeProperty() //{ // strName.clear(); // strOperator.clear(); // strScriptVarName.clear(); //} /* NAME:CState() DESC:默认构造函数 PARA:无 */ CNewSkillProperties::CNewSkillProperties() { m_dwID = 0; } /* NAME:CState(long lStateID) DESC:构造函数 PARA:lStateID为状态的ID */ CNewSkillProperties::CNewSkillProperties(DWORD dwID) { m_dwID = dwID; } /* NAME:~CNewSkill() DESC:析造函数 PARA:无 */ CNewSkillProperties::~CNewSkillProperties() { //Clear(); } //CNewSkillProperties::tagChangeProperty::~tagChangeProperty() //{ // delete strName.c_str(); //} /* NAME:AddNewSkill() DESC:添加技能的主要结构 PARA:pSkill技能的主要结构 */ // void CNewSkillProperties::AddNewSkill( tagSkill *pSkill) { m_lSkill.push_back(pSkill); } //脚本 void CNewSkillProperties::SetFormat( DWORD dwID, string& strFileName,string& strContend) { tagExpression Express = {strFileName,strContend}; m_mapFormat[dwID] = Express; } /* NAME:SetCondition() DESC:添加条件 PARA:dwID条件ID tgConditon条件体 */ void CNewSkillProperties::SetCondition( DWORD dwID,tagCondition *tgCondtition) { map<DWORD, tagCondition*>::iterator it = m_mapCondition.find(dwID); if (it!=m_mapCondition.end()) { char str[256]; _snprintf(str, 256, CStringReading::LoadString(IDS_WS_SKILL,STR_WS_SKILL_SECOND),this->GetNewSkillID(),dwID); PutDebugString(str); return; } else { m_mapCondition[dwID] = tgCondtition; } } /* NAME:SetConGroup() DESC:添加条件组 PARA:dwGroupID条件组ID ptgConditionGroup条件组 */ void CNewSkillProperties::SetConGroup(DWORD dwGroupID,tagConditionGroup *ptgConditionGroup) { map<DWORD,tagConditionGroup*>::iterator it = m_mapConditionGroup.find(dwGroupID); if (it!=m_mapConditionGroup.end()) { char str[256]; _snprintf(str, 256, CStringReading::LoadString(IDS_WS_SKILL,STR_WS_SKILL_FIRST),this->GetNewSkillID(),dwGroupID); PutDebugString(str); return; } else { m_mapConditionGroup[dwGroupID]=ptgConditionGroup; } } /* NAME:GetNewSkill() DESC:通过等级获取相应技能的主要结构 PARA:dwLevel技能等级 */ CNewSkillProperties::tagSkill *CNewSkillProperties::GetNewSkill(DWORD dwLevel) { if (m_lSkill.size()==0) { return NULL; } list<tagSkill*>::iterator it=m_lSkill.begin(); for (; it!=m_lSkill.end(); ++it) { if (dwLevel == (*it)->dwLevel) { tagSkill *ptgSkill = *it; return ptgSkill; } } return NULL; } CNewSkillProperties::stStaticParam *CNewSkillProperties::GetStaticParam(DWORD dwLevel) { CNewSkillProperties::tagSkill *ptgSkill = GetNewSkill(dwLevel); if (ptgSkill) { return ptgSkill->pStaticParam; } return NULL; }
6cb76d5e03e4ad9e29ad12477c653deb213d386f
041202ea37e90e1555bbe615871e7822e0a8cecf
/uva/392.cpp
7b3eaebb6e4ba9d6b9ed61d826cd3f9b094b72ae
[]
no_license
5fe6eb50c7aa19f9/OJ
64d9d6c407f864102b359cb98626d1f687914187
24827c9f006211917386c002facd3192496eb0e6
refs/heads/main
2022-04-23T08:21:57.339331
2022-04-16T15:23:10
2022-04-16T15:23:10
205,539,787
0
0
null
null
null
null
UTF-8
C++
false
false
908
cpp
392.cpp
#include <cstdio> #include <cstring> #include <iostream> using namespace std; #define abs(x) ((x)<0?(x)*-1:(x)) int main(){ int data[9],head,i; while(scanf("%d",data)==1){ head=1; for(i=1;i<9;i++)scanf("%d",data+i); for(i=0;i<9;i++){ if(data[i]){ if(head){ if(data[i]<0)printf("-"); if(abs(data[i])!=1||i==8)printf("%d",abs(data[i])); head=0; }else{ printf(" %c ",data[i]<0?'-':'+'); if(abs(data[i])!=1||i==8)printf("%d",abs(data[i])); } if(i!=8){ printf("x"); if(i<7){ printf("^%d",8-i); } } } } if(head){ printf("0"); } printf("\n"); } }
bbed9d6ff38002baf79090d188da6e44cebb3e7c
0286b14ac24c77dff693814a5951b907914db940
/idlcpp/src/SourceFile.h
926c099f51f600aab5b6589141d9fae155b589d2
[ "MIT" ]
permissive
show0925/idlcpp
e9f5400eefb889cb99c7c57ca50ca6ebaa93e433
8d9a8867985a3930096ecabc621abad2336c0bee
refs/heads/master
2020-04-06T03:48:15.534256
2016-03-15T14:15:29
2016-03-15T14:15:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,478
h
SourceFile.h
#pragma once #ifdef __cplusplus extern "C" { #endif int enterSourceFile(const char* fileName); int leaveSourceFile(); const char* getCurrentSourceFileName(); const char* getMainSourceFileName(); const int import_file_failed = -1; const int import_file_succeeded = 0; const int import_file_already_import = 1; //void setCurrentPackageName(const char* name); void addSourceFile(const char* fileName); #ifdef __cplusplus } #endif #ifdef __cplusplus #include <string> #include <set> #include <map> #include <vector> struct ProgramNode; struct MemberNode; struct ClassNode; struct TypeAliasNode; struct NamespaceNode; struct TemplateClassInstanceNode; struct IdentifyNode; struct ScopeNode; struct TokenNode; struct EmbededCode { int m_tokenNo; std::string m_code; }; class SourceFile { public: SourceFile() { m_syntaxTree = 0; m_currentEmbededCode = 0; } ~SourceFile(); public: void addEmbededCodeBlock(const char* str, int tokenNo); char outputEmbededCodes(FILE* file, int tokenNo); public: std::string m_fileName; ProgramNode* m_syntaxTree; std::vector<EmbededCode*> m_embededCodes; size_t m_currentEmbededCode; std::vector<SourceFile*> m_importSourceFiles; }; struct TypeInfo { MemberNode* m_typeNode; SourceFile* m_sourceFile; public: TypeInfo(MemberNode* typeNode, SourceFile* sourceFile) { m_typeNode = typeNode; m_sourceFile = sourceFile; } }; struct NamespaceInfo { NamespaceNode* m_namespaceNode; SourceFile* m_sourceFile; NamespaceInfo(NamespaceNode* namespaceNode, SourceFile* sourceFile) { m_namespaceNode = namespaceNode; m_sourceFile = sourceFile; } }; enum UseType { ut_as_base = 1, ut_by_value = 2, ut_by_ref = 4, }; enum NameCategory { nc_namespace = 1, nc_type = 2, //nc_class_template = 4, nc_all = 7, }; class SourceFileManager { public: SourceFileManager(); public: int addSourceFile(const char* fileName); SourceFile* popSourceFile(); void prepareParse(SourceFile* sourceFile, bool main); void attachSyntaxTree(ProgramNode* programNode); void checkTypeInfos(); void checkSemantic(); void useType(TypeInfo* typeInfo, UseType usage); void outputUsedTypes(FILE* file); void outputUsedTypesForMetaSource(FILE* file); bool generateCode(const char* fileName); bool generateHeaderFile(const char* fileName); bool generateSourceFile(const char* fileName, const char* cppName); bool generateMetaHeaderFile(const char* fileName, const char* cppName); bool generateMetaSourceFile(const char* fileName, const char* cppName); char outputEmbededCodes(FILE* file, TokenNode* tokenNode); void registerNamespace(NamespaceNode* namespaceNode); void registerType(MemberNode* typeNode); void checkNameForRegister_(MemberNode* memberNode, const std::string& name, int nameCategories); TypeInfo* findTypeInfo(IdentifyNode* identifyNode, const std::string& typeName, bool isGlobal, ScopeNode* scopeNode); private: void insertUnParsedSourceFile(const std::string& fileName); public: SourceFile* m_currentSourceFile; SourceFile* m_mainSourceFile; int m_currentLineNo; bool m_outputLineDirective; size_t m_insertSourceFilePosition; std::vector<SourceFile*> m_unParsedSourceFiles; std::set<std::string> m_sourceFileNames; std::map<std::string, std::vector<NamespaceInfo>> m_namespaceInfos; std::map<std::string, TypeInfo> m_typeInfos; //std::map<std::string, TypeInfo> m_classTemplateTypeInfos; std::map<TypeInfo*, int> m_usedTypes; }; extern SourceFileManager g_sourceFileManager; #endif
bcfdf3ad9836db7deef3ed7478680fddfa67cb1a
45d300db6d241ecc7ee0bda2d73afd011e97cf28
/OTCDerivativesCalculatorModule/Project_Cpp/lib_static/FpmlSerialized/GenClass/fpml-variance-swaps-5-4/VarianceSwap.cpp
7978cd546a92c5197588bbd94e25332a3913760a
[]
no_license
fagan2888/OTCDerivativesCalculatorModule
50076076f5634ffc3b88c52ef68329415725e22d
e698e12660c0c2c0d6899eae55204d618d315532
refs/heads/master
2021-05-30T03:52:28.667409
2015-11-27T06:57:45
2015-11-27T06:57:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,489
cpp
VarianceSwap.cpp
// VarianceSwap.cpp #include "VarianceSwap.hpp" #ifdef ConsolePrint #include <iostream> #endif namespace FpmlSerialized { VarianceSwap::VarianceSwap(TiXmlNode* xmlNode) : NettedSwapBase(xmlNode) { #ifdef ConsolePrint std::string initialtap_ = FileManager::instance().tap_; FileManager::instance().tap_.append(" "); #endif //varianceLegNode ---------------------------------------------------------------------------------------------------------------------- TiXmlElement* varianceLegNode = xmlNode->FirstChildElement("varianceLeg"); if(varianceLegNode){varianceLegIsNull_ = false;} else{varianceLegIsNull_ = true;} if(varianceLegNode) { for(varianceLegNode; varianceLegNode; varianceLegNode = varianceLegNode->NextSiblingElement("varianceLeg")){ #ifdef ConsolePrint FileManager::instance().outFile_ << FileManager::instance().tap_.c_str() << "- varianceLegNode , address : " << varianceLegNode << std::endl; #endif if(varianceLegNode->Attribute("href") || varianceLegNode->Attribute("id")) { if(varianceLegNode->Attribute("id")) { varianceLegIDRef_ = varianceLegNode->Attribute("id"); varianceLeg_.push_back(boost::shared_ptr<VarianceLeg>(new VarianceLeg(varianceLegNode))); varianceLeg_.back()->setID(varianceLegIDRef_); IDManager::instance().setID(varianceLegIDRef_, varianceLeg_.back()); } else if(varianceLegNode->Attribute("href")) { varianceLegIDRef_ = varianceLegNode->Attribute("href");} else { QL_FAIL("id or href error"); } } else { varianceLeg_.push_back(boost::shared_ptr<VarianceLeg>(new VarianceLeg(varianceLegNode)));} } } else { #ifdef ConsolePrint FileManager::instance().outFile_ << FileManager::instance().tap_.c_str() << "- varianceLegNode , address : " << varianceLegNode << std::endl; #endif } #ifdef ConsolePrint FileManager::instance().tap_ = initialtap_; #endif } std::vector<boost::shared_ptr<VarianceLeg>> VarianceSwap::getVarianceLeg() { if(!this->varianceLegIsNull_){ if(varianceLegIDRef_ != ""){ return this->varianceLeg_; }else{ return this->varianceLeg_; } }else { QL_FAIL("null Ptr"); return std::vector<boost::shared_ptr<VarianceLeg>>(); } } }
18afff69b9484f88d44c2a0d2cf6569ea907dff1
e1a22dd68c3b84a96853a843c93d906af2bb79d3
/Gravity2/Renderer/RenderBuffer.h
a3472c4685b80766f927ab5806e0648d8ae0f062
[]
no_license
yeongasm/grvt-engine
f4d312870d8ba72763d428d5f0c43d760ea88617
7ee400ad85da9bb1d4221eda5834a0ec90659b58
refs/heads/master
2020-06-07T05:58:23.474654
2020-05-12T15:26:11
2020-05-12T15:26:11
192,941,649
0
0
null
2019-09-09T07:39:41
2019-06-20T15:09:29
C++
UTF-8
C++
false
false
1,121
h
RenderBuffer.h
#pragma once /** * RenderBuffer data structure. * * The idea of a RenderBuffer is to seperate the Renderer from the Application's sequential pipeline. * RenderBuffer only acts as a container to store data and does not manipulate data in any way. * As of 13.07.2019, multi-threading has not been implemented into the engine. * The idea is to make the Renderer it's stand-alone "application", running in a separate thread. * GPU would be constantly busy rendering from the buffers without caring too much about lag from the CPU. */ class RenderBuffer { private: using Command = RenderCommand; public: glm::mat4 compProjView; Array<glm::mat4> lights; Array<Command> commands; //Array<Command> alphaCommands; //Array<Command> instancingCommands; EulerCamera *camera; /** * TODO(Afiq): * Create data structures for shadow maps & framebuffers as well? */ RenderBuffer(); RenderBuffer(const RenderBuffer &Other); RenderBuffer(RenderBuffer &&Other); RenderBuffer& operator= (const RenderBuffer &Other); RenderBuffer& operator= (RenderBuffer &&Other); ~RenderBuffer(); void Free(); };
e52414d283c91e6385ae5ba6a19c35a5a7baed38
b102dc30de767ec3189b38f133fc1f4193e26526
/C++ Networking/Lab2/can/Node.h
64fbdbaf2a3003ecd92f9350abefa526ac3d76f2
[]
no_license
Ardric/School-Projects
7b2d456bed9f7be146b81c133e6463985cb044dc
9923ae13b1d2a6bcc926f50e695a215671077c6e
refs/heads/master
2020-03-16T21:05:41.660196
2018-11-30T04:51:27
2018-11-30T04:51:27
132,984,531
0
0
null
null
null
null
UTF-8
C++
false
false
693
h
Node.h
#ifndef NODE_H #define NODE_H #include <iostream> #include <string> #include <unordered_map> #include <vector> //#include <utility> using namespace std; typedef struct Points { double x, y; }; class Node{ public: Node(); ~Node(); //void Print(); string MessageHandler( string msg, double xl, double xu, double yl, double yu ); string Get( double X, double Y ); string Set( double X, double Y, string Value ); //string AdjustValues ( string bounds ); private: //int NodeId; double lowerBound; double upperBound; //int address; int port; // pair < double, double > Points; vector<Points> Nodes; unordered_map < int, string > Info; // node split with }; #endif
a8caf811fe926fb8d4c94d6269ec8009771bfd6b
c49ea222f9c12b4bc5a318cef0edde7bd80ee289
/BankingSystemV2/Deposit.cpp
93fe4992ed650a4ad12469d1720c2818fd678889
[]
no_license
bradbow/BankingSystem
042179adb46b375abddd0166e344fed666ff44f2
36d4128e3ff613f3424d1a28d6e9f2cb9cd6b3e9
refs/heads/master
2021-01-01T18:06:38.370763
2011-10-30T13:10:50
2011-10-30T13:10:50
2,629,659
2
0
null
null
null
null
UTF-8
C++
false
false
935
cpp
Deposit.cpp
#include "stdafx.h" // ----------------------------------------------------------------------------------------- // // Constructors / Destructors Deposit::Deposit ( int id, double amount, Date dt, int accountId ) : Transaction(id, amount, dt) { _transactionType = "Deposit"; _accountId = accountId; } // ----------------------------------------------------------------------------------------- // // behaviours void Deposit::execute() { _preTransactionBalance = _ts->getPreTransactionBalance(_accountId); _ts->deposit(_accountId, _amount); _ts->saveTransaction(this); } void Deposit::rollback() { _ts->revert(this); } std::string Deposit::toString() { std::string str; stringstream ss; ss << _id << ","; ss << _amount << ","; ss << _date.getDateString() << ","; ss << _accountId; getline(ss, str); return str; } // ----------------------------------------------------------------------------------------- //
9d31b82d2009c5ac2f7f60d35e06fc0d44920786
33240f213025de3d515a0264eab49021120eed8d
/1153.cpp
a9e9abec53f1e694264e65a93f1a42c8952d0dce
[]
no_license
lannooo/PAT
b842790ab0a8fa3196647411d26edd58c0affd22
b15578f154f1453e28f2f27d8da5441ffb3710a5
refs/heads/main
2023-03-28T07:55:26.224689
2021-03-18T05:33:28
2021-03-18T05:33:28
348,948,542
0
0
null
null
null
null
UTF-8
C++
false
false
3,738
cpp
1153.cpp
#include <cstdio> #include <string> #include <map> #include <unordered_map> #include <vector> #include <algorithm> #include <iostream> using namespace std; struct PatCard{ string cardNumber; int score; }cards[10000]; struct Cite{ int cnt; int score; Cite(){} Cite(int _cnt, int _score):cnt(_cnt), score(_score){} }; vector<PatCard*> tlevel; vector<PatCard*> alevel; vector<PatCard*> blevel; unordered_map<int, Cite*> cites; unordered_map<int, unordered_map<int, int> > dates_cites; void addToDate(int date, int cite) { dates_cites[date][cite]++; } void addToCite(int citeid, int score) { if (cites.count(citeid) != 0) { (cites[citeid]->cnt)++; (cites[citeid]->score)+=score; } else { cites[citeid] = new Cite(1, score); } } void addToLevel(PatCard *ptr, char level) { if (level == 'A') alevel.push_back(ptr); else if (level == 'T') tlevel.push_back(ptr); else blevel.push_back(ptr); } bool cmpScore(PatCard *a, PatCard *b) { if (a->score != b->score) return a->score > b->score; return a->cardNumber < b->cardNumber; } bool cmpCnt(pair<int, int> a, pair<int, int> b) { if (a.second != b.second) return a.second > b.second; return a.first < b.first; } void sortLevels() { sort(tlevel.begin(), tlevel.end(), cmpScore); sort(alevel.begin(), alevel.end(), cmpScore); sort(blevel.begin(), blevel.end(), cmpScore); } void printDate(int term) { if (dates_cites.count(term) == 0){ printf("NA\n"); } else { unordered_map<int, int> citecnt = dates_cites[term]; vector<pair<int, int> > list; for (unordered_map<int, int>::iterator it = citecnt.begin(); it != citecnt.end(); it++) { list.push_back(pair<int, int>(it->first, it->second)); } sort(list.begin(), list.end(), cmpCnt); for (int i=0; i<list.size(); i++) { printf("%d %d\n", list[i].first, list[i].second); } } } void printCite(int term) { if (cites.count(term)==0) { printf("NA\n"); } else { printf("%d %d\n", cites[term]->cnt, cites[term]->score); } } void printLevels(char term) { if(term == 'A') { if (alevel.empty()) printf("NA\n"); for (int i=0; i<alevel.size(); i++) printf("%s %d\n", alevel[i]->cardNumber.c_str(), alevel[i]->score); } else if (term == 'B') { if (blevel.empty()) printf("NA\n"); for (int i=0; i<blevel.size(); i++) printf("%s %d\n", blevel[i]->cardNumber.c_str(), blevel[i]->score); } else { if (tlevel.empty()) printf("NA\n"); for (int i=0; i<tlevel.size(); i++) printf("%s %d\n", tlevel[i]->cardNumber.c_str(), tlevel[i]->score); } } int readInt(char buf[], int from, int len) { int ans = 0; for (int i=from; i<from+len; i++) { ans = ans*10 + (buf[i]-'0'); } return ans; } int _1153() { int N, M, d; scanf("%d%d", &N, &M); char buf[100]; for (int i=0; i<N; i++) { scanf("%s%d", buf, &d); cards[i].cardNumber = string(buf); cards[i].score = d; PatCard *ptr = &cards[i]; // todo something int cite = readInt(buf, 1, 3); int date = readInt(buf, 4, 6); addToLevel(ptr, buf[0]); addToCite(cite, cards[i].score); addToDate(date, cite); } // sort level sortLevels(); int type; int term; char buf2[2]; for (int i=1; i<=M; i++) { scanf("%d", &type); if (type == 1) { // query by level scanf("%s", buf2); printf("Case %d: %d %s\n", i, type, buf2); printLevels(buf2[0]); } else if (type == 2) { // query by cite scanf("%d", &term); printf("Case %d: %d %03d\n", i, type, term); printCite(term); } else {// query by date scanf("%d", &term); printf("Case %d: %d %06d\n", i, type, term); printDate(term); } } //getchar();getchar(); return 0; }
33ecae4791637401e8a8b2d7c564f3e891a3cfd0
d0c2487ee5b6c46f3b44fe0b740876c9485a2c01
/animationcontroller.h
3827df0c8ef7b3e41f9c8513f95fa4e01a6446d6
[ "MIT" ]
permissive
spenCM/DinoVR
837162938ede56aea492dece96fce5d02c9a5803
d35efcb3df894a3e5d5cb61162dbfaddf17f1460
refs/heads/master
2020-09-11T18:25:01.761158
2019-12-04T01:22:57
2019-12-04T01:22:57
222,152,186
0
0
MIT
2019-12-04T01:22:58
2019-11-16T19:57:44
null
UTF-8
C++
false
false
1,125
h
animationcontroller.h
#pragma once #include <chrono> /** * AnimationController controls the timing of the animation. * The primary purpose is to keep the animation synchronized between the various nodes. * The secondary purpose (currently disabled) is to keep a constant animation rate despite changing framerate. * To operate the getFrame function should be called once per graphics frame to get the animation frame to be rendered. * It is critical to either use the constructor which specifies the number of frames or to manually set it using setFrameCount. */ class AnimationController { public: AnimationController(int numFrames); AnimationController(); void setFrameCount(int numFrames); void setFrame(int frame); int getFrame(); void setSpeed(float speed); float getSpeed(); void increaseSpeed(); void decreaseSpeed(); void play(); void pause(); void togglePlay(); void stepForward(); void stepBackward(); private: const float speedMultiplier = 1.05; float speed; int frameCount; int currFrame; bool playing = false; double startTime; double lastTime; void ValidateSpeed(); };
78dfd2c0afee5db200d3e3411ca3083822ab30ba
dbbe188f5a75f4c6d2e6e0809cd8263c9e0c3a53
/src/motor.cpp
98798e51959d66c0ee40b8060f9b8653a5a55381
[]
no_license
acastles91/Upu
40cefe537d552155052ec5503e6cd00fec26e7a1
05d6f52d694b404ac811fca21c7940d081ba6744
refs/heads/master
2021-02-10T04:18:44.757480
2020-03-02T13:37:31
2020-03-02T13:37:31
244,351,268
0
0
null
null
null
null
UTF-8
C++
false
false
5,116
cpp
motor.cpp
#include <motor.h> #include <TMCStepper.h> #include <TeensyStep.h> Motor::Motor(const int dirPinArg, const int stepPinArg, const int enabPinArg, const int chipSelectArg, const int mosiSdiArg, const int misoSdoArg, const int clkArg, float rSenseArg) : driver(chipSelectArg, rSenseArg) //motor(stepPinArg, dirPinArg), //controller{} {} Motor::Motor(const Motor& otherMotor) : driver(otherMotor.driver) //motor(otherMotor.motor), //controller(otherMotor.controller) {} Motor::Motor(const int dirPinArg, const int stepPinArg, const int enabPinArg, const int chipSelectArg) : driver(chipSelectArg, R_SENSE) //motor(stepPinArg, dirPinArg), //controller{} {} void Motor::initializeDriver(){ // // //TMCStepper - simple !! Works with hardware constructor, TMCStepper library driver.begin(); // SPI: Init CS pins and possible SW SPI pins // UART: Init SW UART (if selected) with default 115200 baudrate driver.toff(1); // Enables driver in software driver.tbl(1); driver.rms_current(1000); // Set motor RMS current driver.microsteps(2); // Set microsteps to 1/16th driver.en_pwm_mode(true); // Toggle stealthChop on TMC2130/2160/5130/5160 //driver.pwm_autoscale(true); // Needed for stealthChop driver.semin(5); driver.semax(2); }; //_________________________________________________ void Motor::setupMotor(){ // motor // .setMaxSpeed(maxSpeed) // .setAcceleration(maxAcceleration) // .setStepPinPolarity(LOW); } void Motor::accelerate(){ int speedTest = 150; for(int i = 0; (speedTest * 3) - i == 150; i++){ digitalWrite(step_Pin, HIGH); delayMicroseconds((speedTest * 3) - i); digitalWrite(step_Pin, LOW); delayMicroseconds((speedTest * 3) - i); }; //3662.109 // for (float i = 0.000; i == 3662.1; i + 0.1){ // analogWriteFrequency(stepPin, i); // analogWrite(stepPin, 128); // } // for (int i = 1500; i == 500; i -- ){ // digitalWrite(step_Pin, LOW); // delayMicroseconds(i); // digitalWrite(step_Pin, HIGH); // delayMicroseconds(i); // } // for (int i = 0; i == 128; i + 1){ // analogWrite(stepPin, i); // } }; //_________________________________________________ bool Motor::isAccelerated(){ return accelerated; }; //_________________________________________________ void Motor::moveMotor(){ // if (motorSpeed != (map(analogRead(potSpeed), 0, 1023, 0, 500))){ // setSpeed(); // } //Timer1.pwm(9, 512, 350); //analogWrite(step_Pin, 1); // _motorRef->setTargetRel(100000000000); // _controllerRef->move(_motorRef); //motor.setTargetRel(10000000000); //controller.move(motor); digitalWrite(step_Pin, HIGH); delayMicroseconds(150); digitalWrite(step_Pin, LOW); delayMicroseconds(150); // int speedTest = 150; // for(int i = 0; ((speedTest * 3) - i) == 150; i++){ // digitalWrite(step_Pin, HIGH); // delayMicroseconds((speedTest * 3) - i); // digitalWrite(step_Pin, LOW); // delayMicroseconds((speedTest * 3) - i); // } }; void Motor::xFrames(int x, OpenCelluloid &openCelluloidArg, Bounce &debouncerArg) { openCelluloidArg.homing(); for (int z = 0; z == x; z++){ if (openCelluloidArg.triggerCounter2 != 4) digitalWrite(step_Pin, HIGH); delayMicroseconds(200); digitalWrite(step_Pin, LOW); delayMicroseconds(200); openCelluloidArg.checkTrigger(debouncerArg); } }; //_________________________________________________ // void Motor::oneFrameSlow() { // for (int i = 0; i < frameRatio ; i ++) { // digitalWrite(step_Pin, HIGH); // delayMicroseconds(500); // digitalWrite(step_Pin, LOW); // delayMicroseconds(500); // } // }; //_________________________________________________ void Motor::moveMotorSlow(){ //oneFrameSlow(); }; void Motor::setSpeed(Motor &motorArg, std::array<int, 6> &ledsArg){ if(motorArg.speedIndex == 3){ digitalWrite(ledsArg[0], HIGH); digitalWrite(ledsArg[1], LOW); digitalWrite(ledsArg[2], LOW); digitalWrite(ledsArg[3], LOW); } else if(motorArg.speedIndex == 2){ digitalWrite(ledsArg[0], HIGH); digitalWrite(ledsArg[1], HIGH); digitalWrite(ledsArg[2], LOW); digitalWrite(ledsArg[3], LOW); } else if(motorArg.speedIndex == 1){ digitalWrite(ledsArg[0], HIGH); digitalWrite(ledsArg[1], HIGH); digitalWrite(ledsArg[2], HIGH); digitalWrite(ledsArg[3], LOW); } else if(motorArg.speedIndex == 0){ digitalWrite(ledsArg[0], HIGH); digitalWrite(ledsArg[1], HIGH); digitalWrite(ledsArg[2], HIGH); digitalWrite(ledsArg[3], HIGH); } }
bf59099d35142a0a441bee0c660df44517bed846
b28f7ae59fb4a3470f26c5128c80bbaefeb58c12
/src/io/io.hpp
4fc1ee9587f767674735e369521f01cf024f4347
[ "MIT" ]
permissive
pepng-CU/pepng
ae9b97528bf5972f4ad1d5dbfa93f13c2eca39dc
6030798b6936a6f85655d5e5d1ca638be282de92
refs/heads/main
2023-04-02T06:00:49.822754
2021-04-19T20:09:36
2021-04-19T20:09:36
354,163,654
3
0
null
null
null
null
UTF-8
C++
false
false
6,306
hpp
io.hpp
#pragma once #include <vector> #include <memory> #include <string> #include <GLFW/glfw3.h> #include <glm/glm.hpp> enum AxisType { FIRST, SECOND, THIRD, FORTH }; enum DeviceType { MOUSE, JOYSTICK, KEYBOARD, NONE }; class Device; class Input; /** * An abstract Device unit (Button, Axis, etc). */ class DeviceUnit : public std::enable_shared_from_this<DeviceUnit> { public: friend Device; friend Input; /** * Accessor for the device value. */ virtual float value(); protected: /** * The current device unit value. */ float _value; /** * The strength multiplier for the device. */ float _strength; /** * Parent device. */ std::shared_ptr<Device> _device; DeviceUnit(std::string name, float strength); private: /** * The label for device unit. */ std::string __name; }; /** * On/off device unit. */ class Button : public DeviceUnit, public std::enable_shared_from_this<Button> { public: friend Input; /** * Shared_ptr constructor for Button. */ static std::shared_ptr<Button> make_button(std::string name, int buttonId, float strength = 1); protected: Button(std::string name, int buttonId, float strength = 1); private: /** * The GLFW button value. */ int __button_id; /** * Instantiation of Buttons. */ static std::vector<std::shared_ptr<Button>> __buttons; /** * Keyboard button callback (which uses buttons vector). */ static void keyboardCallback(GLFWwindow* window, int key, int scancode, int action, int mods); /** * Mouse button callback (which uses buttons vector). */ static void mouseButtonCallback(GLFWwindow* window, int button, int action, int mods); }; /** * Float device unit. */ class Axis : public DeviceUnit, public std::enable_shared_from_this<Axis> { public: friend Input; static std::shared_ptr<Axis> make_axis(std::string name, AxisType axisType, float strength, bool needsReset); virtual float value() override; protected: Axis(std::string name, AxisType axisType, float strength, bool needsReset); private: /** * The GLFW axis type. */ AxisType __axis_type; /** * Method to reset value when reset. */ bool __needs_reset; /** * Instantiation of Axes. */ static std::vector<std::shared_ptr<Axis>> __axes; /** * The static XY position of the cursor. */ static glm::vec2 __cursor_position; /** * Scroll callback (uses axes). */ static void scrollCallback(GLFWwindow* window, double xoffset, double yoffset); /** * Cursor callback (uses cursorPosition). */ static void cursorPositionCallback(GLFWwindow* window, double xpos, double ypos); }; /** * Device for collection of Device unit. */ class Device : public std::enable_shared_from_this<Device> { public: friend Input; /** * Shared_ptr constructor of Device. */ static std::shared_ptr<Device> make_device(DeviceType deviceType); /** * Attaches a device unit to the device. */ std::shared_ptr<Device> attach_unit(std::shared_ptr<DeviceUnit> unit); /** * Get an Axis device unit value by name. */ float axis(std::string name); /** * Get a Button device unit value by name. */ bool button(std::string name); /** * Get a Button device unit value by name (reset to zero once called). */ bool button_down(std::string name); private: /** * The device type using the DeviceType enum. */ DeviceType __device_type; /** * The parent input device. */ std::shared_ptr<Input> __input; /** * List of attached device unit. */ std::vector<std::shared_ptr<DeviceUnit>> __units; Device(DeviceType deviceType); }; /** * Global input manager (which should be attached to window). */ class Input : public std::enable_shared_from_this<Input> { public: /** * Shared_ptr constructor for Input. */ static std::shared_ptr<Input> make_input(GLFWwindow* window); /** * Attaches a device to the input. */ std::shared_ptr<Input> attach_device(std::shared_ptr<Device> device); /** * Gets an Axis value from all attached devices by name. */ float axis(std::string name); /** * Gets a Button value from all attached devices by name. */ bool button(std::string name); /** * Get a Button device unit value by name (reset to zero once called). */ bool button_down(std::string name); /** * Gets the window that this input is attached to. */ GLFWwindow* window(); /** * Gets the current input manager. * * TODO: This currently assumes that there is only one window (which shouldn't really be an issue). */ static std::shared_ptr<Input> get(); private: /** * The window that this input manager is attached to. */ GLFWwindow* __window; /** * List of attached devices. */ std::vector<std::shared_ptr<Device>> __devices; /** * List of inputs. */ static std::vector<std::shared_ptr<Input>> __inputs; Input(GLFWwindow* window); }; namespace pepng { std::shared_ptr<Input> make_input(GLFWwindow* window); std::shared_ptr<Device> make_device(DeviceType deviceType); std::shared_ptr<Axis> make_axis(std::string name, AxisType axisType, float strength = 1, bool needsReset = false); std::shared_ptr<Button> make_button(std::string name, int buttonId, float strength = 1); }
0f5041b979027e16f62ed8cdab9aa83d9c9dd1d1
8914acd84a1e51ece18e81a6334e08226219a119
/Code/Source/Rendering/UISytstem.h
fad96f3b7a6bbdec1ba622b03993ca55ad609633
[]
no_license
erdnaxela01/WonderEmporium
9437e2cef71db136f57e304bfe4e879cd1250bf5
0eebbfb554eec9a82662424682b482c1b494a4b7
refs/heads/master
2021-01-10T11:50:03.632148
2016-01-19T19:37:45
2016-01-19T19:37:45
49,336,556
0
0
null
null
null
null
UTF-8
C++
false
false
949
h
UISytstem.h
#ifndef __UI_SYSTEM_H #define __UI_SYSTEM_H #include "MyLibs\OpenGL\UniformBuffer.h" #include "Core\SystemCallback.h" #include "Scene\Scene.h" #include "MyLibs\OpenGL\ShaderProgram.h" #include "UIComponent.h" namespace WE { //this will use a forward rendering to draw things that are part of the ui class UISystem { public: UISystem(Window* window); virtual ~UISystem(); //return the loop callbacks std::vector<SystemCallback*> GetCallbacks(); //notify about a new active scene void NotifyActiveScene(Scene* scene); //set the screen size void SetScreenSize(vec2f size); //return teh screen size vec2f GetScreenSize(); private: //render the UI void Render(); UniformBuffer m_Buffer; vec2f m_ScreenSize; ArrayList<UIComponent*> m_UIComponents; Window* m_Window; }; } #endif //__UI_SYSTEM_H
2b356895385d0527e494312dd0579fa91ea05493
ba0d580d07acf20f4907ed93a8495096110b86f2
/src/ramp/main.cpp
698fa9c99b397421e94ff2e18856a1e449145e21
[]
no_license
navrkald/4-colour-ramp
62f4e83e316a70680dfb03457fd220dfbc28675f
4d42a2b2817e6df4215a30719823bd59977672dd
refs/heads/master
2021-01-23T20:26:08.957514
2017-09-12T18:24:48
2017-09-12T18:24:48
102,858,595
0
0
null
null
null
null
UTF-8
C++
false
false
640
cpp
main.cpp
#include "Display.h" #include "ParamParser.h" #include "ColourRamp.h" #include <string> #include <iostream> using namespace std; int main(int argc, const char* argv[]) { ColourRGB565 topLeft, topRight, bottomLeft, bottomRight; const char* displayName; Error err(ok); if ((err = ParamParser::ParseArguments(argc, argv, displayName, topLeft, topRight, bottomLeft, bottomRight)).Failed()) { err.PrintErrorMessageAndExit(); } Display d; ColourRamp colourRamp(d, displayName); if ((err = colourRamp.Create4ColourRam(topLeft, topRight, bottomLeft, bottomRight)).Failed()) { err.PrintErrorMessageAndExit(); } return 0; }
4ddcd8214666dff127bbb0d4bfedcfb63d224583
1de9a7f6dd421798b87fa1abc562347343236337
/test/test_hand_statistics.cpp
1e02d35716ee4ca5bcae09f2587d8d3c1b68f554
[ "MIT" ]
permissive
kam3k/crib_hand_helper
4e79641520d84d0e017c9015b99e860154d3803b
bc7d67c44817701bc32bf0e1efb105e8b7b20d4b
refs/heads/master
2021-01-11T03:09:30.047245
2016-12-01T21:56:20
2016-12-01T21:56:20
71,085,683
0
0
null
null
null
null
UTF-8
C++
false
false
2,884
cpp
test_hand_statistics.cpp
#include "catch.hpp" #include "crib_hand_helper/hand_statistics.h" using namespace crib; TEST_CASE("Bad hands") { auto hand_statistics = get_hand_statistics({Card("2h"), Card("4d"), Card("7c"), Card("Qs")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 0); REQUIRE(hand_statistics.best == 5); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); hand_statistics = get_hand_statistics({Card("2h"), Card("4h"), Card("7h"), Card("Qh")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 4); REQUIRE(hand_statistics.best == 10); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); hand_statistics = get_hand_statistics({Card("Ac"), Card("4h"), Card("7h"), Card("7s")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 4); REQUIRE(hand_statistics.best == 12); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); hand_statistics = get_hand_statistics({Card("Ac"), Card("Th"), Card("Js"), Card("Ks")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 0); REQUIRE(hand_statistics.best == 7); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); } TEST_CASE("Good hands") { auto hand_statistics = get_hand_statistics({Card("2h"), Card("3d"), Card("3c"), Card("3s")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 6); REQUIRE(hand_statistics.best == 17); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); hand_statistics = get_hand_statistics({Card("5h"), Card("5c"), Card("Th"), Card("Ts")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 12); REQUIRE(hand_statistics.best == 22); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); hand_statistics = get_hand_statistics({Card("7s"), Card("8h"), Card("8s"), Card("9s")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 12); REQUIRE(hand_statistics.best == 24); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); hand_statistics = get_hand_statistics({Card("5s"), Card("5h"), Card("5c"), Card("5d")}, {Card("As"), Card("Ah")}); REQUIRE(hand_statistics.worst == 20); REQUIRE(hand_statistics.best == 28); REQUIRE(hand_statistics.best > hand_statistics.mean); REQUIRE(hand_statistics.worst < hand_statistics.mean); }
3ca9d56a825744edc43848aea831b297397bb6be
f2b70f0f8d6f61899eb70b9f2626f1eb44f68cc7
/libs/qtutil/include/qtutil/VoxoxErrorMessageLabel.h
1858fdde9c75271008cd65cf9e747877d21b17f2
[]
no_license
vikas100/VoxOx
cc36efcbb9a82da03c05ea76093426aafba3bd8c
d4fae14f3f5a4de29abad3b79f4903db01daa913
refs/heads/master
2020-05-18T06:57:08.968725
2011-05-14T01:56:29
2011-05-14T01:56:29
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,501
h
VoxoxErrorMessageLabel.h
/* * WengoPhone, a voice over Internet phone * Copyright (C) 2004-2006 Wengo * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /**************************************************************************** ** Filename: LINKLabel.h ** Last updated [dd/mm/yyyy]: 14/02/2005 ** ** QLabel subclass with LINK handling and more. ** ** Copyright(C) 2005 Angius Fabrizio. All rights reserved. ** ** Based on the LGPL v.2 licensed KLINKLabel from the KDE libraries by ** Kurt Granroth <granroth@kde.org> and Peter Putzer <putzer@kde.org> ** ** Changes made to the KLINKLabel code: ** - link color is no longer taken from KGlobalSettings but from qApp->palette().active().link() ** - removed virtual_hook() member function ** - replaced KCursor::handCursor() with QCursor(Qt::PointingHandCursor) ** - added context menu (see mouseReleaseEvent method) ** ** This file is part of the OSDaB project(http://osdab.sourceforge.net/). ** ** This file may be distributed and/or modified under the terms of the ** GNU Lesser General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See the file LICENSE.GPL that came with this software distribution or ** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information. ** **********************************************************************/ #ifndef VOXOXERRORMESSAGELABEL_H #define VOXOXERRORMESSAGELABEL_H #include <QtGui/QLabel> class VoxoxErrorMessageLabel : public QLabel { Q_OBJECT public: VoxoxErrorMessageLabel(QWidget* parent = 0); ~VoxoxErrorMessageLabel(); }; #endif // VOXOXERRORMESSAGELABEL_H
d9583198b25d1a280f4f34e83569da39bf46daa0
f34aafa1f0415de4db2d888a5d25ae341aa3e069
/wjrpc/errors/errors.hpp
be28dea4d527c76924f35f04fe2088e34cf9287f
[ "MIT" ]
permissive
mambaru/wjrpc
59fe91f0df5f8e861ae6d27e067c74b506a81322
aabea1d07c707111c55a35e160b5a3f34e93ae5c
refs/heads/master
2023-08-25T00:15:54.734860
2023-08-03T21:57:06
2023-08-03T21:57:07
71,155,902
5
2
MIT
2021-04-22T12:38:31
2016-10-17T15:59:20
C++
UTF-8
C++
false
false
1,714
hpp
errors.hpp
// // Author: Vladimir Migashko <migashko@gmail.com>, (C) 2011-2016 // // Copyright: See COPYING file that comes with this distribution // #pragma once #include <string> #include <wjrpc/basic_types.hpp> namespace wjrpc{ enum class error_codes { NoError = 0, ParseError=-32700, InvalidRequest = -32600, ProcedureNotFound = -32601, InvalidParams = -32602, InternalError = -32603, ServerError = -32000, MethodNotImplementation = -32001, BadGateway = -32002, ServiceUnavailable = -32003, QueueOverflow = -32004, }; struct error { error_code_t code = 0; error():code() {} explicit error(error_codes c) : code( static_cast<error_code_t>(c) ) {} typedef std::unique_ptr<error> ptr; }; struct parse_error: error { parse_error() : error(error_codes::ParseError) {} }; struct invalid_request: error { invalid_request() : error(error_codes::InvalidRequest) {} }; struct procedure_not_found: error { procedure_not_found() : error(error_codes::ProcedureNotFound) {} }; struct invalid_params: error { invalid_params() : error(error_codes::InvalidParams) {} }; struct internal_error: error { internal_error() : error(error_codes::InternalError) {} }; struct method_not_impl: error { method_not_impl() : error(error_codes::MethodNotImplementation) {} }; // сетевая ошибка struct bad_gateway: error { bad_gateway() : error(error_codes::BadGateway) {} }; // ошибка конфигурации struct service_unavailable: error { service_unavailable() : error(error_codes::ServiceUnavailable) {} }; struct server_error: error { server_error() : error(error_codes::ServerError) {} }; }
dad2b94306ac8e8e3368657ed733db06bcf8d624
a42eb17fdfbcf62a1e8ff38d2941a2eb4a8984cf
/lecture7/main.cc
4e39cc1ed62357b70fda59127b9b089871cfa580
[]
no_license
ankenman/CS162_Winter2020
71375e95ae34c11da7c9bff99fac88402c05d55e
b777c7197b3c5433b90c3eac87389531126a1da8
refs/heads/master
2020-12-12T00:28:46.337987
2020-03-17T23:59:10
2020-03-17T23:59:10
233,995,323
1
0
null
null
null
null
UTF-8
C++
false
false
520
cc
main.cc
#include "rectangle.h" int main() { cout << "getNumRectangles(): " << Rectangle::getNumRectangles() << endl; Rectangle rect = Rectangle(3, 4); //cout << "Area: " << rect.getArea() << endl; cout << "getNumRectangles(): " << Rectangle::getNumRectangles() << endl; if (true) { Rectangle rect2 = Rectangle(5, 6); cout << "getNumRectangles(): " << Rectangle::getNumRectangles() << endl; } cout << "getNumRectangles(): " << Rectangle::getNumRectangles() << endl; return 0; }
f3a24f4b55670a59b8fb3d8fe669c99ad0b832ee
89edd785fe88d2fafc6d6d1847cfa24b7bd855bd
/grbl_controller_esp32/actions.cpp
393c16e55de73b1625bae76080f0fcc9bf339db6
[]
no_license
mstrens/grbl_controller_esp32
a6f65a96bf9911121f3a92231690f3b540993de6
014861320d4872bec7209abe03ac99c6ea363805
refs/heads/master
2023-05-24T18:47:37.110322
2022-05-24T06:59:23
2022-05-24T06:59:23
170,190,948
156
82
null
2023-05-10T07:20:29
2019-02-11T19:45:27
C
UTF-8
C++
false
false
29,415
cpp
actions.cpp
#include "config.h" #include "language.h" #include "draw.h" #include "setupTxt.h" #include "TFT_eSPI_ms/TFT_eSPI.h" #include "FS.h" #include "actions.h" #include "menu_file.h" #include "telnet.h" #include "cmd.h" #include "com.h" #include "log.h" #include "bt.h" // create for touchscreeen extern TFT_eSPI tft ; extern uint8_t prevPage ; extern uint8_t currentPage ; extern boolean updateFullPage ; extern boolean updatePartPage ; extern boolean waitReleased ; extern uint8_t statusPrinting ; extern char machineStatus[9]; // Iddle, Run, Alarm, ... //extern char lastMsg[80] ; extern char grblLastMessage[STR_GRBL_BUF_MAX_SIZE] ; extern boolean grblLastMessageChanged; extern uint16_t firstFileToDisplay ; extern uint16_t sdFileDirCnt ; extern char cmdName[11][17] ; // store the names of the commands extern uint8_t cmdToSend ; extern M_Page mPages[_P_MAX_PAGES] ; extern uint8_t currentBtn ; extern uint8_t justPressedBtn; extern uint8_t justReleasedBtn; extern uint8_t longPressedBtn; extern uint32_t beginChangeBtnMillis ; extern volatile boolean waitOk ; extern uint8_t jog_status ; extern boolean jogCancelFlag ; extern boolean jogCmdFlag ; extern uint32_t startMoveMillis ; extern int8_t jogDistX ; extern int8_t jogDistY ; extern int8_t jogDistZ ; extern int8_t jogDistA ; extern float moveMultiplier ; extern uint8_t * pNext ; // position of the next char to be written extern uint8_t * pFirst ; // position of the first char extern uint8_t * pGet ; // position of the last char to be read for display extern char printString[250] ; extern char * pPrintString ; extern uint8_t lastStringCmd ; //extern uint8_t grblLink ; // identify if grbl is connected via Serial, BT or Telnet. extern char grblDirFilter[100] ; // contains the name of the directory to be filtered; "/" for the root; last char must be "/" extern char grblFileNames[GRBLFILEMAX][40]; // contain max n filename or directory name with max 40 char. extern uint8_t firstGrblFileToDisplay ; // 0 = first file in the directory extern int grblFileIdx ; // index in the array where next file name being parse would be written uint8_t fileToExecuteIdx ; // save the idex (0...3) of the file to be executed after confimation; 0/3 = sd on tft, 10/3 = sd on GRBL card uint32_t prevAutoMoveMillis ; #define SOFT_RESET 0x18 void fGoToPage(uint8_t param) { //Serial.print( "go to page : " ) ; Serial.println( param) ; // just for testing // to do prevPage = currentPage ; currentPage = param ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fGoToPageAndClearMsg(uint8_t param) { clearMsg() ; grblLastMessage[0] = 0 ; // clear grbl last message ([....] grblLastMessageChanged = true ; prevPage = currentPage ; currentPage = param ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fGoBack(uint8_t param) { //Serial.print( "go back : " ) ; Serial.println( prevPage) ; // just for testing // to do if (prevPage >= _P_INFO && prevPage < _P_MAX_PAGES ) { // if there are sevral back, prevPage = 0 and we will go back to _P_INFO currentPage = prevPage ; } else { currentPage = _P_INFO ; prevPage = _P_INFO ; } updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fHome(uint8_t param) { if( machineStatus[0] == 'I' || machineStatus[0] == 'A' ) { #define HOME_CMD "$H" toGrbl(HOME_CMD);toGrbl("\n\r"); //Serial2.println(HOME_CMD) ; } else { fillMsg(_INVALID_BTN_HOME ) ; } waitReleased = true ; // discard "pressed" until a release } void fUnlock(uint8_t param) { if( machineStatus[0] == 'A') { // if grbl is in alarm toGrbl("$X\n\r") ; // send command to unlock //Serial2.println("$X") ; // send command to unlock //Serial.println("$X has been sent"); // to remove } // Stay on current page waitReleased = true ; // discard "pressed" until a release } void fReset(uint8_t param) { toGrbl((char) SOFT_RESET) ; //Serial2.print( (char) SOFT_RESET) ; waitReleased = true ; // discard "pressed" until a release clearMsg( ); } void fCancel(uint8_t param) { if( statusPrinting == PRINTING_FROM_SD || statusPrinting == PRINTING_PAUSED || statusPrinting == PRINTING_CMD || statusPrinting == PRINTING_STRING) { statusPrinting = PRINTING_STOPPED ; pPrintString[0] = '\0'; closeFileToRead() ; toGrbl( (char) SOFT_RESET) ; //Serial2.print( (char) SOFT_RESET) ; } currentPage = _P_INFO ; // go to page Info updateFullPage = true ; // force a redraw even if current page does not change waitReleased = true ; // discard "pressed" until a release } void fCancelGrbl(uint8_t param) { if ( statusPrinting == PRINTING_FROM_GRBL || statusPrinting == PRINTING_FROM_GRBL_PAUSED) { statusPrinting = PRINTING_STOPPED ; toGrbl( (char) SOFT_RESET) ; //Serial2.print( (char) SOFT_RESET) ; } currentPage = _P_INFO ; // go to page Info updateFullPage = true ; // force a redraw even if current page does not change waitReleased = true ; // discard "pressed" until a release } void fPause(uint8_t param) { if( (statusPrinting == PRINTING_FROM_SD || statusPrinting == PRINTING_FROM_GRBL ) && ( machineStatus[0] == 'R' || machineStatus[0] == 'J' ) ) { // test on J added mainly for test purpose #define PAUSE_CMD "!" toGrbl( PAUSE_CMD) ; //Serial2.print(PAUSE_CMD) ; statusPrinting = PRINTING_PAUSED ; updateFullPage = true ; // //Serial.println("Pause is sent to grbl"); } waitReleased = true ; // discard "pressed" until a release } #define RESUME_CMD "~" void fResume(uint8_t param) { if( statusPrinting == PRINTING_PAUSED && machineStatus[0] == 'H') { toGrbl( RESUME_CMD) ; resetWaitOkWhenSdMillis() ; // we reset the time we sent the last cmd otherwise, we can get a wrong warning saying that we are missing an OK (because it seems that GRBL suspends OK while in pause) statusPrinting = PRINTING_FROM_SD ; updateFullPage = true ; // we have to redraw the buttons because Resume should become Pause } currentPage = _P_INFO ; // go to page Info waitReleased = true ; // discard "pressed" until a release } void fResumeGrbl(uint8_t param) { if( statusPrinting == PRINTING_FROM_GRBL_PAUSED && machineStatus[0] == 'H') { toGrbl( RESUME_CMD) ; resetWaitOkWhenSdMillis() ; // we reset the time we sent the last cmd otherwise, we can get a wrong warning saying that we are missing an OK (because it seems that GRBL suspends OK while in pause) statusPrinting = PRINTING_FROM_GRBL ; updateFullPage = true ; // we have to redraw the buttons because Resume should become Pause } currentPage = _P_INFO ; // go to page Info waitReleased = true ; // discard "pressed" until a release } void fDist( uint8_t param ) { uint8_t newDist = mPages[_P_MOVE].boutons[POS_OF_MOVE_D_AUTO] ; // convertit la position du bouton en type de bouton //Serial.print("newDist=") ; Serial.println(newDist) ; if ( ++newDist > _D0_01 ) newDist = _D_AUTO ; // increase and reset to min value if to big mPages[_P_MOVE].boutons[POS_OF_MOVE_D_AUTO ] = newDist ; // update the button to display mButtonClear(POS_OF_MOVE_D_AUTO + 1 , newDist ) ; // clear the current button mButtonDraw( POS_OF_MOVE_D_AUTO + 1 , newDist ) ; // draw at position (from 1 to 12) a button (newDist) //updateFullPage = true ; // force a redraw of buttons waitReleased = true ; // discard "pressed" until a release } void fMove( uint8_t param ) { // param contains the touch being pressed or the released if no touch has been pressed //Serial.println("running fMove"); float distance = 0.01 ; //uint32_t moveMillis = millis() ; //static uint32_t prevMoveMillis ; if ( mPages[_P_MOVE].boutons[POS_OF_MOVE_D_AUTO] == _D_AUTO ) { handleAutoMove(param) ; // process in a similar way as Nunchuk } else if (justPressedBtn) { // just pressed in non auto mode switch ( mPages[_P_MOVE].boutons[POS_OF_MOVE_D_AUTO] ) { case _D0_01 : distance = 0.01; break ; case _D0_1 : distance = 0.1; break ; case _D1: distance = 1 ; break ; case _D10 : distance = 10 ; break ; case _D100 : distance = 100 ; break ; } //bufferise2Grbl("\n\r",'b'); bufferise2Grbl("$J=G91 G21 ", 'b') ; //Serial2.println("") ; Serial2.print("$J=G91 G21 ") ; //switch ( justPressedBtn ) { // we convert the position of the button into the type of button // case 7 : Serial2.print("X") ; break ; // case 5 : Serial2.print("X-") ; break ; // case 2 : Serial2.print("Y") ; break ; // case 10 : Serial2.print("Y-") ; break ; // case 4 : Serial2.print("Z") ; break ; // case 12 : Serial2.print("Z-") ; break ; // } uint8_t typeOfMove ; typeOfMove = convertBtnPosToBtnIdx( currentPage , justPressedBtn ) ; switch ( typeOfMove ) { // we convert the position of the button into the type of button case _XP : bufferise2Grbl("X") ; break ; case _XM : bufferise2Grbl("X-") ; break ; case _YP : bufferise2Grbl("Y") ; break ; case _YM : bufferise2Grbl("Y-") ; break ; case _ZP : bufferise2Grbl("Z") ; break ; case _ZM : bufferise2Grbl("Z-") ; break ; case _AP : bufferise2Grbl("A") ; break ; case _AM : bufferise2Grbl("A-") ; break ; } if (distance == 100 && ( typeOfMove == _ZP || typeOfMove == _ZM ) ) distance =10; char sdistance[20]; sprintf(sdistance, "%.4f" , distance); bufferise2Grbl(sdistance) ; bufferise2Grbl(" F1000\n", 's'); //Serial2.print(distance) ; Serial2.println (" F100") ; //Serial.print("move for button") ; Serial.print(justPressedBtn) ;Serial.print(" ") ; Serial.print(distance) ; Serial.println (" F100") ; updatePartPage = true ; // force a redraw of data waitReleased = true ; // discard "pressed" until a release // todo change to allow repeated press on the same button } } void handleAutoMove( uint8_t param) { // in Auto mode, we support long press to increase speed progressively, we cancel jog when released // param contains the touch being pressed or the released if no touch has been pressed #define AUTO_MOVE_REPEAT_DELAY 100 uint8_t pressedBtn = 0 ; static uint32_t cntSameAutoMove = 0 ; //float moveMultiplier ; uint32_t autoMoveMillis = millis() ; if ( justReleasedBtn ) { jogCancelFlag = true ; // cancel any previous move when a button is released (even before asking for another jog cntSameAutoMove = 0 ; // reset the counter //Serial.println("cancel jog") ; } else { jogCancelFlag = false ; } if ( ( autoMoveMillis - prevAutoMoveMillis ) < AUTO_MOVE_REPEAT_DELAY ) { return ; } if ( justPressedBtn) { cntSameAutoMove = 0 ; // reset the counter when we just press the button pressedBtn = justPressedBtn ; prevAutoMoveMillis = autoMoveMillis ; } else if ( longPressedBtn ) { pressedBtn = longPressedBtn ; prevAutoMoveMillis = autoMoveMillis ; } //Serial.print("pressedBtn=");Serial.print(pressedBtn); Serial.print(" jogCmdFlag=");Serial.print(jogCmdFlag); Serial.println(" "); if ( ( pressedBtn ) && (jogCmdFlag == false) ) { if (cntSameAutoMove == 0 ) { // moveMultiplier = 0.01 ; startMoveMillis = millis(); } cntSameAutoMove++ ; jogDistX = 0 ; // reset all deplacements jogDistY = 0 ; jogDistZ = 0 ; jogDistA = 0 ; //switch ( pressedBtn ) { // fill one direction of move // case 7 : jogDistX = 1 ; break ; // case 5 : jogDistX = -1 ; break ; // case 2 : jogDistY = 1 ; break ; // case 10 : jogDistY = -1 ; break ; // case 4 : jogDistZ = 1 ; break ; // case 12 : jogDistZ = -1 ; break ; //} uint8_t typeOfMove; typeOfMove = convertBtnPosToBtnIdx( currentPage , pressedBtn ) ; // we convert the position of the button into the type of button switch ( typeOfMove ) { // fill one direction of move case _XP : jogDistX = 1 ; break ; case _XM : jogDistX = -1 ; break ; case _YP : jogDistY = 1 ; break ; case _YM : jogDistY = -1 ; break ; case _ZP : jogDistZ = 1 ; break ; case _ZM : jogDistZ = -1 ; break ; case _AP : jogDistA = 1 ; break ; case _AM : jogDistA = -1 ; break ; } //Serial.print("type of move=");Serial.println(typeOfMove); jogCmdFlag = true ; // the flag will inform the send module that there is a command to be sent based on moveMultiplier and preMove. } } void fSdFilePrint(uint8_t param ){ // lance l'impression d'un fichier; param contains l'index (0 à 3) du fichier à ouvrir //Serial.println("enter fsFilePrint") ; if ( ! setFileToRead( param ) ) { // try to open the file to be printed ; in case of error, go back to Info page (lastMsg is already filled) //Serial.println("SetFileToRead is false") ; currentPage = _P_INFO ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release return ; } if ( fileToReadIsDir () ) { // if user press a directory, then change the directory //Serial.println("FileToRead is dir") ; if ( ! changeDirectory() ) { //Serial.println("changeDirectory is false") ; currentPage = _P_INFO ; // in case of error, goes to info page updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release return ; } // else = change dir is ok, button have been updated, screen must be reloaded updateFullPage = true ; waitReleased = true ; return ; } else if ( fileIsCmd() ) { // when a "command" file is selected, it will not be executed it but will be saved in SPIFFS // note : this function also fill LastMsg (e.g. with the file name when it is a file to be printed updateFullPage = true ; waitReleased = true ; return ; } else { // file can be printed fileToExecuteIdx = param ; // save index of file. prevPage = currentPage ; // go to confirm page currentPage = _P_SD_CONFIRM ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } } void fStartSdPrinting(uint8_t param){ // param is the index of the file button (0...3) waitOk = false ; // toGrbl(PAUSE_CMD) ; //Serial2.print(PAUSE_CMD) ; // delay(10); // toGrbl("?") ; //Serial2.print("?") ; //waitOk = false ; // do not wait for OK before sending char. // statusPrinting = PRINTING_PAUSED ; // initially it was PRINTING_FROM_SD ; // change the status, so char will be read and sent in main loop statusPrinting = PRINTING_FROM_SD ; // change the status, so char will be read and sent in main loop // prevPage = currentPage ; // go to INFO page currentPage = _P_INFO ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fSdMove(uint8_t param) { // param contient _PG_PREV ou _PG_NEXT if ( param == _PG_PREV ) { if ( firstFileToDisplay > 4 ) { firstFileToDisplay -= 4 ; } else { firstFileToDisplay = 1 ; } } else if ( ( param == _PG_NEXT ) && ( (firstFileToDisplay + 4) <= sdFileDirCnt ) ) { firstFileToDisplay += 4 ; if ( ( firstFileToDisplay + 4) > sdFileDirCnt ) firstFileToDisplay = sdFileDirCnt - 3 ; } else { // move one level up sdMoveUp() ; } // look in the directory for another file and upload the list of button. //Serial.print("firstFileToDisplay=") ; Serial.println(firstFileToDisplay); updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fSetXYZ(uint8_t param) { // param contient le n° de la commande switch (param) { case _SETX : memccpy ( printString , _SETX_STRING , '\0' , 249); break ; case _SETY : memccpy ( printString , _SETY_STRING , '\0' , 249); break ; case _SETZ : memccpy ( printString , _SETZ_STRING , '\0' , 249); break ; case _SETA : memccpy ( printString , _SETA_STRING , '\0' , 249); break ; case _SETXYZ : memccpy ( printString , _SETXYZ_STRING , '\0' , 249); break ; case _SETXYZA : memccpy ( printString , _SETXYZA_STRING , '\0' , 249); break ; case _SET_CHANGE : memccpy ( printString , _SET_CHANGE_STRING , '\0' , 249); break ; case _SET_PROBE : memccpy ( printString , _SET_PROBE_STRING , '\0' , 249); break ; case _SET_CAL : memccpy ( printString , _CAL_STRING , '\0' , 249); break ; case _GO_CHANGE : memccpy ( printString , _GO_CHANGE_STRING , '\0' , 249); break ; case _GO_PROBE : memccpy ( printString , _GO_PROBE_STRING , '\0' , 249); break ; default : printString[0]= '\0' ; break ; // null string for safety; normally can't happen } lastStringCmd = param ; // save the last parameter in order to generate a text when the task is execute sendStringToGrbl() ; waitReleased = true ; // discard "pressed" until a release // update will be done when we receive a new GRBL status message } void sendStringToGrbl() { //Serial.print("calibration = ") ; Serial.println( pStringToSend ) ; if ( statusPrinting != PRINTING_STOPPED ) { fillMsg(_NOT_IDLE ) ; } else { //Serial.println("Start sending string") ; // to debug statusPrinting = PRINTING_STRING ; pPrintString = &printString[0] ; waitOk = false ; } } void fCmd(uint8_t param) { // param contient le n° de la commande (valeur = _CMD1, ...) cmdToSend = param ; // fill the index of the command to send; sending will be done in communication module // create file name and try to open SPIFFS cmd file ; filename look like /Cmd char spiffsCmdName[21] = "/Cmd0_" ; // begin with fix text if ( param <= _CMD9 ) { // fill the cmd number (from 1...9 or A or B ) ; A = 10 , B = 11 spiffsCmdName[4] = param - _CMD1 + '1' ; } else { spiffsCmdName[4] = param - _CMD10 + 'A' ; } strcat( spiffsCmdName , cmdName[param - _CMD1]) ; // add the cmd name to the first part if ( ! spiffsOpenCmdFile( spiffsCmdName ) ) { fillMsg(_CMD_NOT_RETRIEVED ) ; currentPage = _P_INFO ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release return ; } waitOk = false ; // do not wait for OK before sending char. statusPrinting = PRINTING_CMD ; currentPage = _P_INFO ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fStartUsb(uint8_t param){ if( statusPrinting == PRINTING_STOPPED ) { while ( Serial.available() ) { // clear the incomming buffer Serial.read() ; } statusPrinting = PRINTING_FROM_USB ; } currentPage = _P_INFO ; // go to page Info updateFullPage = true ; waitReleased = true ; } void fStartTelnet(uint8_t param){ if( statusPrinting == PRINTING_STOPPED ) { checkTelnetConnection(); if ( telnetIsConnected() ) { clearTelnetBuffer() ; statusPrinting = PRINTING_FROM_TELNET ; //fillMsg( "Connected to telnet" ); } else { fillMsg(_NO_TELNET_CONNECTION ); } } currentPage = _P_INFO ; // go to page Info updateFullPage = true ; waitReleased = true ; } void fStopPc(uint8_t param){ statusPrinting = PRINTING_STOPPED ; updateFullPage = true ; // force a redraw even if current page does not change waitReleased = true ; // discard "pressed" until a release } void fLogPrev(uint8_t param) { fillMPage (_P_LOG , POS_OF_LOG_PG_NEXT , _PG_NEXT , _JUST_PRESSED , fLogNext , 0) ; //active the next button uint8_t count = 0 ; fillMPage (_P_LOG , POS_OF_LOG_PG_PREV , _PG_PREV , _JUST_PRESSED , fLogPrev , 0) ; // activate PREV btn while (count < ( N_LOG_LINE_MAX * 2 ) ) { if ( getPrevLogLine()>=0 ) { count++ ; // move back max 6 line before } else { count = N_LOG_LINE_MAX * 2 ; // force exit of while fillMPage (_P_LOG , POS_OF_LOG_PG_PREV , _NO_BUTTON , _NO_ACTION , fLogPrev , 0) ; // deactivate PREV btn } } updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release //drawDataOnLogPage() ; } void fLogNext(uint8_t param) { uint8_t count = 0 ; fillMPage (_P_LOG , POS_OF_LOG_PG_PREV , _PG_PREV , _JUST_PRESSED , fLogPrev , 0) ; // activate PREV btn (even if not needed) fillMPage (_P_LOG , POS_OF_LOG_PG_NEXT , _PG_NEXT , _JUST_PRESSED , fLogNext , 0) ; //active the next button while ( count < N_LOG_LINE_MAX) { // move max line ahead (to be sure that we can display many lines when we are close to the end if ( getNextLogLine()>=0 ){ count++ ; } else { // When move is not possible, Pget point the last valid line; to display it we have to move back 1 line less count = N_LOG_LINE_MAX ; fillMPage(_P_LOG , POS_OF_LOG_PG_NEXT , _NO_BUTTON , _NO_ACTION , fLogNext , 0) ; // deactivate the NEXT button } } count = 0 ; while (count < N_LOG_LINE_MAX ) { if ( getPrevLogLine()>=0 ) { count++ ; // move back max 6 line before } else { count = N_LOG_LINE_MAX; // force exit of while fillMPage(_P_LOG , POS_OF_LOG_PG_PREV , _NO_BUTTON , _NO_ACTION , fLogPrev , 0) ; // deactivate PREV btn } } //clearScreen() ; // not needed because done when we execute the drawFullPage() //drawDataOnLogPage() ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fSdShowPrev(uint8_t param) { // to do setPrevShowBuffer() ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fSdShowNext(uint8_t param) { // to do setNextShowBuffer() ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fOverSwitch (uint8_t BtnParam) { if ( BtnParam == _OVER_SWITCH_TO_SPINDLE ) { // here we have to switch button and title in order to let modify RPM fillMPage (_P_OVERWRITE , POS_OF_OVERWRITE_OVERWRITE , _OVER_SWITCH_TO_FEEDRATE , _JUST_PRESSED , fOverSwitch , _OVER_SWITCH_TO_FEEDRATE ) ; } else { // here we have to switch button and title in order to let modify RPM fillMPage (_P_OVERWRITE , POS_OF_OVERWRITE_OVERWRITE , _OVER_SWITCH_TO_SPINDLE , _JUST_PRESSED , fOverSwitch , _OVER_SWITCH_TO_SPINDLE ) ; } updateFullPage = true ; // force a redraw because Btn has change waitReleased = true ; // discard "pressed" until a release } void fOverModify (uint8_t BtnParam) { char grblOverwriteCode = BtnParam - _OVER_100 ; // _OVER_100 is the first of the 5 codes; code have to be put in the right sequence in the enum if ( mPages[_P_OVERWRITE].boutons[POS_OF_OVERWRITE_OVERWRITE] == _OVER_SWITCH_TO_SPINDLE ) { // when button allows to change to spindle,it means we are currently changing Feedrate grblOverwriteCode += 0x90 ; // 0x90 is the GRBL code for 100% feedrate // Serial.print("We change Feedrate= "); Serial.println( (uint8_t) grblOverwriteCode, HEX); // to debug } else { // We change RPM grblOverwriteCode += 0x99 ; // 0x99 is the GRBL code for 100% RPM // Serial.println("We change RPM"); Serial.println( (uint8_t) grblOverwriteCode, HEX); // to debug } toGrbl((char) grblOverwriteCode ) ; //Serial2.print( (char) grblOverwriteCode ) ; updatePartPage = true ; // force a redraw of data waitReleased = true ; // discard "pressed" until a release } void fSerial(uint8_t param) { // activate GRBL over Serial2 // to do ; unactivate other comm and change GrblLink startGrblCom(GRBL_LINK_SERIAL, false); } void fBluetooth(uint8_t param) { // activate GRBL over Bluetooth // to do ; unactivate other comm and change GrblLink startGrblCom(GRBL_LINK_BT, false); } void fTelnet(uint8_t param) { // activate GRBL over Telnet // to do ; unactivate other comm and change GrblLink startGrblCom(GRBL_LINK_TELNET, false ); } void fSdGrblMove(uint8_t param) { // param contient _PG_PREV ou _PG_NEXT if ( param == _PG_PREV ) { // previous if ( firstGrblFileToDisplay >= 4 ) { firstGrblFileToDisplay -= 4 ; } else { firstGrblFileToDisplay = 0 ; } } else if ( param == _PG_NEXT ){ // next if ( (firstGrblFileToDisplay + 4) < grblFileIdx ) { firstGrblFileToDisplay += 4 ; if ( ( firstGrblFileToDisplay + 4) >= grblFileIdx ) firstGrblFileToDisplay = grblFileIdx - 4 ; } } else { // move one level up if ( strlen(grblDirFilter) > 2) { // change only if there are more than 1 car in the filter char * lastDirBeginAt ; lastDirBeginAt = grblDirFilter + strlen(grblDirFilter) - 2 ; // point to the car before the last one (last is a '/') while ( *lastDirBeginAt != '/' && lastDirBeginAt > grblDirFilter) lastDirBeginAt-- ; // search the last '/' before the last position lastDirBeginAt++ ; //point to the first char after '/' *lastDirBeginAt = '\0' ; //replace this char by a string terminator currentPage = _P_SD_GRBL_WAIT ; // will go to the page that force to read again the file list } } //Serial.print("firstFileToDisplay=") ; Serial.println(firstFileToDisplay); updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fSdGrblFilePrint(uint8_t param ){ // lance l'impression d'un fichier; param contains l'index (0 à 3) du fichier à ouvrir; pour trouver le nom, il faut ajouter cela à firstGrblFileToDisplay if ( (*grblFileNames[param + firstGrblFileToDisplay]) == '/' ) { // if first char = "/", it is a directory if ( ( strlen(grblFileNames[param + firstGrblFileToDisplay]) + strlen(grblDirFilter)) > 99 ){ // when the new filter name would be to big, just discard // discard } else { // change the filter (adding the dir name to existing filter and a "/" at the end char * pendgrblDirFilter ; pendgrblDirFilter = grblDirFilter + strlen(grblDirFilter) ; // point to the '\0' end of name strcpy(pendgrblDirFilter , grblFileNames[param + firstGrblFileToDisplay]+1 ) ; //add the dirname being selected but not the first char (='/' strcpy(grblDirFilter + strlen(grblDirFilter), "/") ; // add '/' at the end } currentPage = _P_SD_GRBL_WAIT ; // will go to the page that force to read again the file list updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release return ; } else { // it is a file name; so send the command to Grbl (the command to send is "$SD/Run=/dir/dir/file.ext" fileToExecuteIdx = param +10 ; // save index of file + 10 (to make the difference with SD from TFT) (to be used in fConfirmedYes for calling fStartSdGrblPrinting prevPage = currentPage ; // go to confirm page currentPage = _P_SD_CONFIRM ; updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } } void fStartSdGrblPrinting(uint8_t param){ // param is the index of the file button (0...3) // we have to send a command with the name like "$SD/Run=/dir/dir/file.ext" char fullFileName[200] ; strcpy(fullFileName , grblDirFilter ); // copy directory name strcpy(fullFileName + strlen(fullFileName) , grblFileNames[param + firstGrblFileToDisplay] ) ; // add the file name toGrbl("$SD/run="); toGrbl(fullFileName); toGrbl("\r\n"); currentPage = _P_INFO ; // go to info page updateFullPage = true ; waitReleased = true ; // discard "pressed" until a release } void fConfirmedYes(uint8_t param ) { // called when Yes btn is pressed; based on parameter call different function //Serial.print("fileToExecuteIdx="); Serial.println(fileToExecuteIdx); if ( fileToExecuteIdx <=3) { // it is a file from sd card attached to tft fStartSdPrinting(fileToExecuteIdx) ; } else if ( fileToExecuteIdx >= 10 && fileToExecuteIdx <=13) {// it is a file from sd card attached to grbl fStartSdGrblPrinting(fileToExecuteIdx - 10); } else { fGoToPage(_P_INFO); // this should not occurs } } void fConfirmedNo(uint8_t param ) { // called when No btn is pressed; should do the same as back btn in principe fGoBack(0); }
c64e59625d2d65c73ac8daee3716a867c150eb54
c1c5a8dc79cacf3b419bad77881213c5db2f80c3
/UVa/C++/12460.cpp
5e14d4f8123e5aa2e9e8fb4185fbf2c81730f57c
[]
no_license
EoinDavey/Competitive
7ff8b6b6225814ac60c3ace659bb63190eb52420
b2b6909b93f5c073b684477f8a4b06dac22ec678
refs/heads/master
2023-01-08T00:06:19.076941
2022-12-26T14:00:31
2022-12-26T14:00:31
67,259,478
17
1
null
2022-01-19T18:17:59
2016-09-02T22:46:26
C++
UTF-8
C++
false
false
967
cpp
12460.cpp
#include<iostream> #include<map> #include<cstdio> #include<string> using namespace std; map<string,string> p; map<string,int> r; string find_parent(string i){ if(p[i]==i) return i; return p[i] = find_parent(p[i]); } void join(string i, string j){ string pi = find_parent(i); string pj = find_parent(j); if(pi==pj) return; p[pi]=pj; } void proc(string in){ string _in = in; p[in]=in; for(int i = 0; i < in.length(); i++){ char c = in[i]; for(char a='a'; a<='z'; a++){ in[i]=a; if(p[in]!="") join(_in,in); } in[i]=c; } } int main(){ string in; while(1){ cin >> in; if(in=="--") break; proc(in); } string a,b; while(cin >> a >> b){ if(find_parent(a)==find_parent(b)){ printf("Yes\n"); }else{ printf("No\n"); } } return 0; }
db679fcd2fa2737b4a5a3a6e9e656f1c6972e510
757d80d5e76344ee5a53e0ae37510e1f9ee6e793
/Class Work/Final Winter 2017/CSC5_Final_Prob3_EvenOddFunctions/main.cpp
ffeb1c02ce93ae9f436f1473a21a280aff4daf9b
[]
no_license
vcuchilla/Cuchilla_Victor_CSC5_40107_RCC
a7f720dc23a82a6544c86041611ad787f14231a7
1d795e7db46dfc22e24527eb975e5b6b5dad3b96
refs/heads/master
2021-01-12T03:00:13.517701
2017-02-13T02:20:02
2017-02-13T02:20:02
78,146,272
0
0
null
null
null
null
UTF-8
C++
false
false
5,171
cpp
main.cpp
/* File: main.cpp Author: Victor Cuchilla Created on February 10th, 2017, 10:00 PM Purpose: This program uses vectors and arrays to fill a column of even or odd numbers that are randomly generated. */ //System Libraries #include <iostream> //Input output stream #include <cstdlib> #include <ctime> #include <vector> using namespace std; //User Libraries //Global Constants //Such as PI, Vc, -> Math/Science values //as well as conversions from system of units to //another const int maxrow = 2 ; //Max number of columns in array //Function Prototypes void fillVec(vector<int>&, vector<int>&, int); //Function that fills the vectors void prntVec(vector<int>, vector<int>, int); //Function that prints the contents of the vectors void fillArr(int Numb[][maxrow],vector<int>, vector<int>, int, int, int); void prntArr(int Numb[][maxrow], int, int); //Function that prints the array //Executable code begins here!!! int main(int argc, char** argv) { //Set the random number seed srand(static_cast<unsigned int>(time(0))); //Declare Variables int sizecol, index, row; //The size of number of columns in each vector inputted by user vector<int> evenNum; //Vector of even numbers vector<int> oddNum; //Vector of odd numbers const int maxSize = 90; //Max size of the array rows int Numb[maxSize][maxrow]; //Array that takes contents of vector //Input values cout<<"how many different even and odd pairs should there be? "; cin >>sizecol; //Input the size of the table cout<<" Even || Odd \n"; //Set up the table //Fill the vectors with numbers and display vector table for (index = 0, sizecol ; index<sizecol ; index++) //Continue filling to size { fillVec(evenNum, oddNum, index); //Call the fill vector function prntVec(evenNum, oddNum, index); //Call the function to display vectors } for (int row = 0; row<=1 ; row++) //Continue filling to size { fillArr(Numb, evenNum, oddNum, sizecol, index, row); } //Fill the array and display the 2D array cout<<" Even || Odd (2-D Array)\n"; //Set up the table prntArr(Numb, sizecol, row); //Print the 2D columns //Exit stage right! return 0; } //****************************************************************************** // Definition of the fillVec function. This function accepts a vector and its ** // size as an argument. It loops through the contents of the filling them with** // A random 2 digit number that is generated. ** //****************************************************************************** void fillVec(vector<int> &evenNum, vector<int> &oddNum, int index) { int evenInt, oddInt; //even integer to be generated evenInt = rand()%99+1; //Generate random number while(evenInt%2!=0 || evenInt<10) evenInt = rand()%99+1; //Generate random number evenNum.push_back(evenInt); //Send the random number to the vector oddInt = rand()%99+1; //Generate random number while(oddInt%2!=1 || oddInt<10) oddInt = rand()%99+1; //Generate random number oddNum.push_back(oddInt); //Send the random number to the vector } //****************************************************************************** // Definition of the prntVec function. This function displays the contents in ** // the vectors that contain even and odd numbers. it accepts the vectors as ** // arguments and then displays a table showing the contents of the vector ** //****************************************************************************** void prntVec(vector<int> evenNum, vector<int> oddNum, int index) { cout<<" "<<evenNum[index]<<" "<<oddNum[index]<<"\n"; //Display contents } //****************************************************************************** // Definition of the fillArr function. This function accepts two vectors as an** // argument and fills a 2D array with the vector contents. ** // ** //****************************************************************************** void fillArr(int Numb[][maxrow], vector<int> evenNum, vector<int> oddNum, int sizecol, int index, int row) { for (index = 0, sizecol ; index<sizecol ; index++) { if (row==0) { Numb[index][row] = evenNum[index]; } else if (row==1) { Numb[index][row] = oddNum[index]; } } } //****************************************************************************** // Definition of the prntArr function. This function accepts a 2D array as an ** // argument and displays the 2D array with the columns and each row ** // ** //****************************************************************************** void prntArr (int Numb[][maxrow], int sizecol, int row) { for (int row = 0; row<sizecol; row++) { cout<<" "<<Numb[row][0]<<" "<<Numb[row][1]<<"\n"; } }
19adc3f014c29b7c13a43544dd89022ff7834eb0
65e3391b6afbef10ec9429ca4b43a26b5cf480af
/TOF/TOFbase/AliTOFLTMSummaryData.cxx
1bb1501acc27b258901994d1f4cd978b92d46b89
[]
permissive
alisw/AliRoot
c0976f7105ae1e3d107dfe93578f819473b2b83f
d3f86386afbaac9f8b8658da6710eed2bdee977f
refs/heads/master
2023-08-03T11:15:54.211198
2023-07-28T12:39:57
2023-07-28T12:39:57
53,312,169
61
299
BSD-3-Clause
2023-07-28T13:19:50
2016-03-07T09:20:12
C++
UTF-8
C++
false
false
4,286
cxx
AliTOFLTMSummaryData.cxx
/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * ***************************************************************************/ /* author: Roberto Preghenella (R+), preghenella@bo.infn.it */ ////////////////////////////////////////////////////////////////////// // // // // // This class provides a summary for LTM data. // // // // // ////////////////////////////////////////////////////////////////////// #include "AliTOFLTMSummaryData.h" ClassImp(AliTOFLTMSummaryData) AliTOFLTMSummaryData::AliTOFLTMSummaryData() : TObject(), fHeader(kFALSE), fTrailer(kFALSE), fSlotID(0), fEventWords(0), fCBit(0), fFault(0), fEventCRC(0), fEventNumber(0), fDecoderCRC(0) { /* default constructor */ for (Int_t iPDL = 0; iPDL < LTM_N_PDL; iPDL++) fPDL[iPDL] = 0; for (Int_t iADC = 0; iADC < LTM_N_ADC; iADC++) fADC[iADC] = 0; for (Int_t iOR = 0; iOR < LTM_N_OR; iOR++) fOR[iOR] = 0; } //_________________________________________________________________ AliTOFLTMSummaryData::AliTOFLTMSummaryData(const AliTOFLTMSummaryData &source) : TObject(source), fHeader(source.fHeader), fTrailer(source.fTrailer), fSlotID(source.fSlotID), fEventWords(source.fEventWords), fCBit(source.fCBit), fFault(source.fFault), fEventCRC(source.fEventCRC), fEventNumber(source.fEventNumber), fDecoderCRC(source.fDecoderCRC) { /* copy constructor */ for (Int_t iPDL = 0; iPDL < LTM_N_PDL; iPDL++) fPDL[iPDL] = source.fPDL[iPDL]; for (Int_t iADC = 0; iADC < LTM_N_ADC; iADC++) fADC[iADC] = source.fADC[iADC]; for (Int_t iOR = 0; iOR < LTM_N_OR; iOR++) fOR[iOR] = source.fOR[iOR]; } //_________________________________________________________________ AliTOFLTMSummaryData & AliTOFLTMSummaryData::operator = (const AliTOFLTMSummaryData &source) { /* operator = */ if(&source == this) return *this; TObject::operator=(source); fHeader = source.fHeader; fTrailer = source.fTrailer; fSlotID = source.fSlotID; fEventWords = source.fEventWords; fCBit = source.fCBit; fFault = source.fFault; for (Int_t iPDL = 0; iPDL < LTM_N_PDL; iPDL++) fPDL[iPDL] = source.fPDL[iPDL]; for (Int_t iADC = 0; iADC < LTM_N_ADC; iADC++) fADC[iADC] = source.fADC[iADC]; for (Int_t iOR = 0; iOR < LTM_N_OR; iOR++) fOR[iOR] = source.fOR[iOR]; fEventCRC = source.fEventCRC; fEventNumber = source.fEventNumber; fDecoderCRC = source.fDecoderCRC; return *this; } //_________________________________________________________________ AliTOFLTMSummaryData::~AliTOFLTMSummaryData() { /* default destructor */ } //_________________________________________________________________ void AliTOFLTMSummaryData::Reset() { /* reset function */ fHeader = kFALSE; fTrailer = kFALSE; fSlotID = 0; fEventWords = 0; fCBit = 0; fFault = 0; for (Int_t iPDL = 0; iPDL < LTM_N_PDL; iPDL++) fPDL[iPDL] = 0; for (Int_t iADC = 0; iADC < LTM_N_ADC; iADC++) fADC[iADC] = 0; for (Int_t iOR = 0; iOR < LTM_N_OR; iOR++) fOR[iOR] = 0; fEventCRC = 0; fEventNumber = 0; fDecoderCRC = 0; }
515493fef84a5551d585abf0e4a3b343dfbdbed1
b838bb4e9a855b91c0b9a4dc2f244bc7eba5843d
/Practice-05--Loops--For--While--Do-While/Solutions/20-Binary-to-Decimal.cpp
d3e2365376d722edd1034f3ed521e6a241368746
[]
no_license
dako98/Introduction-to-Programming--2019-2020
2ae0898bf60c56c7f10e47b240f80fc083eb82cb
f4b313f208fa5ac76aeb7a3cf7ef3ccd3325524a
refs/heads/master
2020-08-01T20:47:53.671349
2020-01-18T10:38:17
2020-01-18T10:38:17
211,112,344
11
1
null
null
null
null
UTF-8
C++
false
false
891
cpp
20-Binary-to-Decimal.cpp
/** * This file is part of the Introduction to Programming * course 2019/20 held by Alexander and Dako. * @file 20-Binary-to-Decimal.cpp * @brief Solution for Problem 20 from Practice 5 * @author Alexander Dimitrov * * Problem: * Read a whole non-negative binary number * and print the decimal representation. */ #include <iostream> int main() { long long binaryNum; int decimalNum = 0; do { std::cout << "Enter a whole non-negative binary number: "; std::cin >> binaryNum; } while (binaryNum < 0); short value = 1; while (binaryNum > 0) { short digit = binaryNum % 10; if (digit > 1) { std::cout << "Not a binary number!" << std::endl; return 1; } decimalNum += digit * value; value <<= 1; binaryNum /= 10; } std::cout << decimalNum; return 0; }
3735c823dae2ecd2a4d4cc2e87f6505742da05a1
cb4a6ece41f8183a73bfede55d4156e01743c848
/ofApp.cpp
9e65464726347a67701db6d31068644dfd72d3fe
[]
no_license
davidwang501/OpenCVPocketCubeSolver
e4938d80ad8e2dba53c30fa7cb2c940c9027c343
946630f42d28bfc41d448b0ba0a93eb0ff7180ab
refs/heads/master
2020-04-17T16:45:29.841544
2019-01-21T05:37:06
2019-01-21T05:37:06
166,754,186
1
0
null
null
null
null
UTF-8
C++
false
false
14,773
cpp
ofApp.cpp
#include "ofApp.h" #include "Solver.h" using namespace cv; using namespace ofxCv; //-------------------------------------------------------------- void ofApp::setup(){ cam.initGrabber(433,300); font.load("/Users/david/Downloads/of_v0.10.0_osx_release/apps/myApps/finalProject2/bin/data/tnr.ttf",22); for(int i=0;i<24;i++){ std::vector<int> blank; blank.push_back(255); blank.push_back(255); blank.push_back(255); faces.push_back(blank); } face=0; tempFace=""; instructions=""; } //-------------------------------------------------------------- void ofApp::update(){ cam.update(); } //-------------------------------------------------------------- void ofApp::draw(){ ofBackground(255,255,255); //draw instructions int counter = 0; int lineNumber = 0; std::string line = ""; for(int i=0;i<instructions.size();i++){ if(counter == 12){ font.drawString(line,580,400+lineNumber*35); //ofDrawBitmapString(line,650,400+lineNumber*20); lineNumber++; line=""; counter=0; } if(instructions[i]==' '){ counter++; line+=instructions[i]; }else{ line+=instructions[i]; } } font.drawString(line,580,400+lineNumber*35); //ofDrawBitmapString(line,650,400+lineNumber*20); //draw cam ofSetColor(255,255,255); cam.draw(575,15); drawColors(); drawGrid(); } void ofApp::drawGrid(){ ofSetColor(0,0,0); ofSetLineWidth(5); //two long vertical ofDrawLine(207,30,207,738); ofDrawLine(384,30,384,738); //two long horizontal ofDrawLine(30,207,561,207); ofDrawLine(30,384,561,384); //short horizontals ofDrawLine(207,30,384,30); ofDrawLine(207,561,384,561); ofDrawLine(207,738,384,738); //short verticals ofDrawLine(30,207,30,384); ofDrawLine(561,207,561,384); // vertical middle lines ofDrawLine(295.5,30,295.5,738); ofDrawLine(118.5,207,118.5,384); ofDrawLine(472.5,207,472.5,384); //horizontal middle lines ofDrawLine(30,295.5,561,295.5); ofDrawLine(207,118.5,384,118.5); ofDrawLine(207,472.5,384,472.5); ofDrawLine(207,649.5,384,649.5); //squares in camera ofNoFill(); ofSetLineWidth(2); ofDrawRectangle(735,100, 35, 35); ofDrawRectangle(735,180, 35, 35); ofDrawRectangle(835,100, 35, 35); ofDrawRectangle(835,180, 35, 35); } void ofApp::drawColors(){ ofFill(); //face 1 ofSetColor(faces[0][0], faces[0][1], faces[0][2]); ofDrawRectangle(207,30, 88.5, 88.5); //face 2 ofSetColor(faces[1][0], faces[1][1], faces[1][2]); ofDrawRectangle(295.5,30, 88.5, 88.5); //face 3 ofSetColor(faces[2][0], faces[2][1], faces[2][2]); ofDrawRectangle(207,118.5, 88.5, 88.5); //face 4 ofSetColor(faces[3][0], faces[3][1], faces[3][2]); ofDrawRectangle(295.5,118.5, 88.5, 88.5); //face 5 ofSetColor(faces[4][0], faces[4][1], faces[4][2]); ofDrawRectangle(207,207, 88.5, 88.5); //face 6 ofSetColor(faces[5][0], faces[5][1], faces[5][2]); ofDrawRectangle(295.5,207, 88.5, 88.5); //face 7 ofSetColor(faces[6][0], faces[6][1], faces[6][2]); ofDrawRectangle(207,295.5, 88.5, 88.5); //face 8 ofSetColor(faces[7][0], faces[7][1], faces[7][2]); ofDrawRectangle(295.5,295.5, 88.5, 88.5); //face 9 ofSetColor(faces[8][0], faces[8][1], faces[8][2]); ofDrawRectangle(207,384, 88.5, 88.5); //face 10 ofSetColor(faces[9][0], faces[9][1], faces[9][2]); ofDrawRectangle(295.5,384, 88.5, 88.5); //face 11 ofSetColor(faces[10][0], faces[10][1], faces[10][2]); ofDrawRectangle(207,472.5, 88.5, 88.5); //face 12 ofSetColor(faces[11][0], faces[11][1], faces[11][2]); ofDrawRectangle(295.5,472.5, 88.5, 88.5); //face 13 ofSetColor(faces[12][0], faces[12][1], faces[12][2]); ofDrawRectangle(207,561, 88.5, 88.5); //face 14 ofSetColor(faces[13][0], faces[13][1], faces[13][2]); ofDrawRectangle(295.5,561, 88.5, 88.5); //face 15 ofSetColor(faces[14][0], faces[14][1], faces[14][2]); ofDrawRectangle(207,649.5, 88.5, 88.5); //face 16 ofSetColor(faces[15][0], faces[15][1], faces[15][2]); ofDrawRectangle(295.5,649.5, 88.5, 88.5); //face 17 ofSetColor(faces[16][0], faces[16][1], faces[16][2]); ofDrawRectangle(30,207, 88.5, 88.5); //face 18 ofSetColor(faces[17][0], faces[17][1], faces[17][2]); ofDrawRectangle(118.5,207, 88.5, 88.5); //face 19 ofSetColor(faces[18][0], faces[18][1], faces[18][2]); ofDrawRectangle(30,295.5, 88.5, 88.5); //face 20 ofSetColor(faces[19][0], faces[19][1], faces[19][2]); ofDrawRectangle(118.5,295.5, 88.5, 88.5); //face 21 ofSetColor(faces[20][0], faces[20][1], faces[20][2]); ofDrawRectangle(384,207, 88.5, 88.5); //face 22 ofSetColor(faces[21][0], faces[21][1], faces[21][2]); ofDrawRectangle(472.5,207, 88.5, 88.5); //face 23 ofSetColor(faces[22][0], faces[22][1], faces[22][2]); ofDrawRectangle(384,295.5, 88.5, 88.5); //face 24 ofSetColor(faces[23][0], faces[23][1], faces[23][2]); ofDrawRectangle(472.5,295.5, 88.5, 88.5); ofNoFill(); } //-------------------------------------------------------------- void ofApp::keyPressed(int key){ if(key==' '){ std::cout<<"scramble: "<<scramble<<std::endl; tempFace=""; ofImage uleft; uleft.grabScreen(735,100,32,32); uleft.save("uleft.png"); ofImage dleft; dleft.grabScreen(735,180,32,32); dleft.save("dleft.png"); ofImage uright; uright.grabScreen(835,100,32,32); uright.save("uright.png"); ofImage dright; dright.grabScreen(835,180,32,32); dright.save("dright.png"); //load in 4 squares of the face uleft.load("/Users/david/Downloads/of_v0.10.0_osx_release/apps/myApps/finalProject2/bin/data/uleft.png"); uright.load("/Users/david/Downloads/of_v0.10.0_osx_release/apps/myApps/finalProject2/bin/data/uright.png"); dleft.load("/Users/david/Downloads/of_v0.10.0_osx_release/apps/myApps/finalProject2/bin/data/dleft.png"); dright.load("/Users/david/Downloads/of_v0.10.0_osx_release/apps/myApps/finalProject2/bin/data/dright.png"); //upper left rgb values Mat ul = toCv(uleft); Vec3b buf1 = ul.at<Vec3b>(15,15); uchar rul = buf1.val[0]; int rulval = rul; uchar gul = buf1.val[1]; int gulval = gul; uchar bul = buf1.val[2]; int bulval = bul; //std::cout<<rulval<<","<<gulval<<","<<bulval<<std::endl; //upper right rgb values Mat ur = toCv(uright); Vec3b buf2 = ur.at<Vec3b>(15,15); uchar rur = buf2.val[0]; int rurval = rur; uchar gur = buf2.val[1]; int gurval = gur; uchar bur = buf2.val[2]; int burval = bur; //std::cout<<rurval<<","<<gurval<<","<<burval<<std::endl; // down left rgb values Mat dl = toCv(dleft); Vec3b buf3 = dl.at<Vec3b>(15,15); uchar rdl = buf3.val[0]; int rdlval = rdl; uchar gdl = buf3.val[1]; int gdlval = gdl; uchar bdl = buf3.val[2]; int bdlval = bdl; //std::cout<<rdlval<<","<<gdlval<<","<<bdlval<<std::endl; // down right rgb values Mat dr = toCv(dright); Vec3b buf4 = dr.at<Vec3b>(15,15); uchar rdr = buf4.val[0]; int rdrval = rdr; uchar gdr = buf4.val[1]; int gdrval = gdr; uchar bdr = buf4.val[2]; int bdrval = bdr; //std::cout<<rdrval<<","<<gdrval<<","<<bdrval<<std::endl; //add colors to temporary face tempFace+=getColor2(rulval,gulval,bulval); tempFace+=getColor2(rurval,gurval,burval); tempFace+=getColor2(rdlval,gdlval,bdlval); tempFace+=getColor2(rdrval,gdrval,bdrval); // for testing // std::cout<<"tempFace: "<<tempFace<<std::endl; // std::cout<<getColor2(rulval,gulval,bulval)<<std::endl; // std::cout<<getColor2(rurval,gurval,burval)<<std::endl; // std::cout<<getColor2(rdlval,gdlval,bdlval)<<std::endl; // std::cout<<getColor2(rdrval,gdrval,bdrval)<<std::endl; updateFaces(getColor2(rulval,gulval,bulval)); face++; updateFaces(getColor2(rurval,gurval,burval)); face++; updateFaces(getColor2(rdlval,gdlval,bdlval)); face++; updateFaces(getColor2(rdrval,gdrval,bdrval)); face-=3; // for testing // std::cout<<"*************"<<std::endl; // std::cout<<"scramble: "<<scramble<<std::endl; // std::cout<<"*************"<<std::endl; // scramble+=getColor(rulval,gulval,bulval); // scramble+=getColor(rurval,gurval,burval); // scramble+=getColor(rdlval,gdlval,bdlval); // scramble+=getColor(rdrval,gdrval,bdrval); // // // std::cout<<getColor(rulval,gulval,bulval)<<std::endl; // std::cout<<getColor(rurval,gurval,burval)<<std::endl; // std::cout<<getColor(rdlval,gdlval,bdlval)<<std::endl; // std::cout<<getColor(rdrval,gdrval,bdrval)<<std::endl; // std::cout<<"*************"<<std::endl; // std::cout<<"scramble: "<<scramble<<std::endl; // std::cout<<"*************"<<std::endl; } //makes temporary face permanent, goes to next face if(key=='n'){ face+=4; scramble+=tempFace; } //done inputting all faces, print out sovling algorithm if(key=='d'){ scramble+=tempFace; Solver s (scramble); s.initalizeCube(); s.firstLayer(); instructions=s.secondLayer(); } // restart game if(key=='r'){ //reset all values for(int i=0;i<24;i++){ faces[i][0]=255; faces[i][1]=255; faces[i][2]=255; } face=0; tempFace=""; instructions=""; scramble=""; } } //-------------------------------------------------------------- void ofApp::keyReleased(int key){ } //-------------------------------------------------------------- void ofApp::mouseMoved(int x, int y ){ } //-------------------------------------------------------------- void ofApp::mouseDragged(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mousePressed(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseReleased(int x, int y, int button){ } //-------------------------------------------------------------- void ofApp::mouseEntered(int x, int y){ } //-------------------------------------------------------------- void ofApp::mouseExited(int x, int y){ } //-------------------------------------------------------------- void ofApp::windowResized(int w, int h){ } //-------------------------------------------------------------- void ofApp::gotMessage(ofMessage msg){ } //-------------------------------------------------------------- void ofApp::dragEvent(ofDragInfo dragInfo){ } // original get color method, didn't work too well std::string ofApp::getColor(int r, int g, int b){ if(r<100){ if(g<100){ return "b"; }else{ return "g"; } } if(r>210){ if((g>60 && g<130)&& (b>20 && b<180)){ return "o"; } } if(g>20 && g<85){ if(b<110 && (r>120 && r<170)){ return "r"; } } if(b<145 && (r>115 && r<210) && (g>130&& g<175)){ return "y"; } return "w"; } // method that returns the color of a square piece std::string ofApp::getColor2(int r, int g, int b){ //calculate lowest Euclidian distance from red, green, blue, yellow, orange, white std::string color =" "; int lowest = 100000; //rgb values are computed by dozens of runs, trial and error //red int r2 = 168; int g2 = 32; int b2 = 31; if(sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2))<lowest){ lowest = sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2)); color="r"; } //orange r2 = 241; g2 = 73; b2 = 67; if(sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2))<lowest){ lowest = sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2)); color="o"; } //blue r2 = 26; g2 = 29; b2 = 110; if(sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2))<lowest){ lowest = sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2)); color="b"; } //green r2 = 69; g2 = 141; b2 = 79; if(sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2))<lowest){ lowest = sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2)); color="g"; } //white r2 = 162; g2 = 163; b2 = 164; if(sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2))<lowest){ lowest = sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2)); color="w"; } //yellow r2 = 153; g2 = 157; b2 = 37; if(sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2))<lowest){ lowest = sqrt((r-r2)*(r-r2)+(g-g2)*(g-g2)+(b-b2)*(b-b2)); color="y"; } return color; } //updates color of color vector with corresponding rgb values void ofApp :: updateFaces(std::string color){ if(color=="r"){ faces[face][0]=255; faces[face][1]=0; faces[face][2]=0; }else if(color=="g"){ faces[face][0]=0; faces[face][1]=128; faces[face][2]=0; }else if(color=="b"){ faces[face][0]=0; faces[face][1]=0; faces[face][2]=255; }else if(color=="o"){ faces[face][0]=255; faces[face][1]=165; faces[face][2]=0; }else if(color=="y"){ faces[face][0]=255; faces[face][1]=255; faces[face][2]=0; }else{ faces[face][0]=255; faces[face][1]=255; faces[face][2]=255; } }
4663a368fc29632f24f48fbb33d7209f5ad18efc
44f42c9fc68fd3d44fc1436dea9fdf79d235c7ba
/TestAtomic/main.cpp
26ce76b9eaabea3a0fa724a54b49abce641a7dab
[]
no_license
MyBW/RayTracing
e174afa26ec1c5241fb67bce8c170cb2c1ba6b2e
f62ce57198a777dfd06d49fa2e2476144913d421
refs/heads/master
2021-06-11T04:20:24.523894
2021-02-19T09:40:27
2021-02-19T09:40:27
152,522,444
0
0
null
null
null
null
UTF-8
C++
false
false
932
cpp
main.cpp
#include <iostream> #include <atomic> #include <vector> struct TestStruct { TestStruct() = default; TestStruct(const TestStruct& T) { } std::atomic<double> TestAry[3]; }; std::vector<std::vector<TestStruct>> Test2D; class A { public: template<typename T> virtual void Test(T a) = 0; }; class B { public: template<typename T> void Test(T a) override { std::cout << a; } private: }; void main() { { A* a = new B(); } std::atomic<double> test = 10; std::atomic<double> &test1 = test; test1 = test1 + 10; std::atomic<double> TestAry[3]; std::atomic<double>& T = TestAry[0]; Test2D.resize(10); { auto&Test2DElement = Test2D[1]; Test2DElement.resize(10); } //for (auto&Test2DElement : Test2D) //{ // Test2DElement.resize(10); //} std::cout << "hello " << Test2D[2][2].TestAry[1] << std::endl; std::cout << "hello " << T <<std::endl; std::cout << "hello " << test1 << std::endl; }
b4a419d2f81647cfd468980bfb9290bf249bd203
489a45659476fafb66934427e42bfce3d60a0116
/Sources/IntExpr.h
78494029e09c05bd729e6e92bd74ec1205c6d4a6
[]
no_license
billw2012/Caveman2Cosmos
3a8c6ea347e75dbe2de9519fe70e6b38e0cf6dbe
2382877536e1669972dd024ce2d0f3d0d5ffd988
refs/heads/master
2020-07-19T00:14:48.856106
2019-09-03T23:20:42
2019-09-03T23:21:02
197,989,388
1
3
null
null
null
null
UTF-8
C++
false
false
7,832
h
IntExpr.h
#pragma once // $Header: //------------------------------------------------------------------------------------------------ // // FILE: IntExpr.h // // PURPOSE: Integer expressions for Civ4 classes // //------------------------------------------------------------------------------------------------ #ifndef INTEXPR_H #define INTEXPR_H #include "CvXMLLoadUtility.h" #include "CvGameObject.h" class CvGameObject; class BoolExpr; enum IntExprTypes { NO_INTEXPR = -1, INTEXPR_CONSTANT, INTEXPR_ATTRIBUTE, INTEXPR_PROPERTY, INTEXPR_PLUS, INTEXPR_MINUS, INTEXPR_MULT, INTEXPR_DIV, INTEXPR_IF, INTEXPR_INTEGRATE_SUM, INTEXPR_INTEGRATE_AVG, INTEXPR_INTEGRATE_COUNT, INTEXPR_RANDOM, INTEXPR_PYTHON, INTEXPR_ADAPT }; class IntExpr { public: virtual ~IntExpr() = 0; virtual int evaluate(CvGameObject* pObject) = 0; static IntExpr* read(CvXMLLoadUtility* pXML); virtual void getCheckSum(unsigned int& iSum) = 0; virtual void buildDisplayString(CvWStringBuffer& szBuffer) const = 0; virtual int getBindingStrength() const = 0; // How strong the operator binds in language so brackets can be placed appropriately virtual bool isConstantZero(); }; class IntExprConstant : public IntExpr { public: IntExprConstant(int iValue = 0) : m_iValue(iValue) {} virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; virtual bool isConstantZero(); protected: int m_iValue; }; class IntExprAttribute : public IntExpr { public: IntExprAttribute(AttributeTypes eAttribute = NO_ATTRIBUTE) : m_eAttribute(eAttribute) {} virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: AttributeTypes m_eAttribute; }; class IntExprProperty : public IntExpr { public: IntExprProperty(PropertyTypes eProperty = NO_PROPERTY) : m_eProperty(eProperty) {} virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: PropertyTypes m_eProperty; }; class IntExprOp : public IntExpr { public: IntExprOp(IntExpr* pExpr1 = NULL, IntExpr* pExpr2 = NULL) : m_pExpr1(pExpr1), m_pExpr2(pExpr2) {} virtual ~IntExprOp(); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual void buildOpNameString(CvWStringBuffer& szBuffer) const = 0; virtual IntExprTypes getType() const = 0; protected: IntExpr* m_pExpr1; IntExpr* m_pExpr2; }; class IntExprPlus : public IntExprOp { public: IntExprPlus(IntExpr* pExpr1 = NULL, IntExpr* pExpr2 = NULL) : IntExprOp(pExpr1, pExpr2) {} virtual int evaluate(CvGameObject* pObject); virtual IntExprTypes getType() const; virtual void buildOpNameString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; }; class IntExprMinus : public IntExprOp { public: IntExprMinus(IntExpr* pExpr1 = NULL, IntExpr* pExpr2 = NULL) : IntExprOp(pExpr1, pExpr2) {} virtual int evaluate(CvGameObject* pObject); virtual IntExprTypes getType() const; virtual void buildOpNameString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; }; class IntExprMult : public IntExprOp { public: IntExprMult(IntExpr* pExpr1 = NULL, IntExpr* pExpr2 = NULL) : IntExprOp(pExpr1, pExpr2) {} virtual int evaluate(CvGameObject* pObject); virtual IntExprTypes getType() const; virtual void buildOpNameString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; }; class IntExprDiv : public IntExprOp { public: IntExprDiv(IntExpr* pExpr1 = NULL, IntExpr* pExpr2 = NULL) : IntExprOp(pExpr1, pExpr2) {} virtual int evaluate(CvGameObject* pObject); virtual IntExprTypes getType() const; virtual void buildOpNameString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; }; class IntExprIf : public IntExpr { public: IntExprIf(BoolExpr* pExprIf = NULL, IntExpr* pExprThen = NULL, IntExpr* pExprElse = NULL) : m_pExprIf(pExprIf), m_pExprThen(pExprThen), m_pExprElse(pExprElse) {} virtual ~IntExprIf(); virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: BoolExpr* m_pExprIf; IntExpr* m_pExprThen; IntExpr* m_pExprElse; }; typedef void (*IntegrateOpFunc)(CvGameObject*, IntExpr*, int*); class IntExprIntegrateOp : public IntExpr { public: IntExprIntegrateOp(IntExpr* pExpr = NULL, RelationTypes eRelation = NO_RELATION, int iData = -1, GameObjectTypes eType = NO_GAMEOBJECT) : m_pExpr(pExpr), m_eRelation(eRelation), m_iData(iData), m_eType(eType) {} virtual ~IntExprIntegrateOp(); virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; virtual IntExprTypes getType() const = 0; virtual IntegrateOpFunc getOp() = 0; protected: IntExpr* m_pExpr; RelationTypes m_eRelation; int m_iData; GameObjectTypes m_eType; }; class IntExprIntegrateSum : public IntExprIntegrateOp { public: IntExprIntegrateSum(IntExpr* pExpr = NULL, RelationTypes eRelation = NO_RELATION, int iData = -1, GameObjectTypes eType = NO_GAMEOBJECT) : IntExprIntegrateOp(pExpr, eRelation, iData, eType) {} virtual IntExprTypes getType() const; virtual IntegrateOpFunc getOp(); }; class IntExprIntegrateAvg : public IntExprIntegrateOp { public: IntExprIntegrateAvg(IntExpr* pExpr = NULL, RelationTypes eRelation = NO_RELATION, int iData = -1, GameObjectTypes eType = NO_GAMEOBJECT) : IntExprIntegrateOp(pExpr, eRelation, iData, eType) {} virtual IntExprTypes getType() const; virtual int evaluate(CvGameObject* pObject); virtual IntegrateOpFunc getOp(); }; class IntExprIntegrateCount : public IntExpr { public: IntExprIntegrateCount(BoolExpr* pExpr = NULL, RelationTypes eRelation = NO_RELATION, int iData = -1, GameObjectTypes eType = NO_GAMEOBJECT) : m_pExpr(pExpr), m_eRelation(eRelation), m_iData(iData), m_eType(eType) {} virtual ~IntExprIntegrateCount(); virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: BoolExpr* m_pExpr; RelationTypes m_eRelation; int m_iData; GameObjectTypes m_eType; }; class IntExprRandom : public IntExpr { public: IntExprRandom(IntExpr* pExpr = NULL) : m_pExpr(pExpr) {} virtual ~IntExprRandom(); virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: IntExpr* m_pExpr; }; class IntExprPython : public IntExpr { public: explicit IntExprPython(CvString szPythonCallback) : m_szPythonCallback(szPythonCallback) {} virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: CvString m_szPythonCallback; }; class IntExprAdapt : public IntExpr { public: IntExprAdapt(IntExpr* pExpr = NULL, int iID = 0) : m_pExpr(pExpr), m_iID(iID) {} virtual ~IntExprAdapt(); virtual int evaluate(CvGameObject* pObject); virtual void getCheckSum(unsigned int& iSum); virtual void buildDisplayString(CvWStringBuffer& szBuffer) const; virtual int getBindingStrength() const; protected: IntExpr* m_pExpr; int m_iID; }; #endif
272827a5706ab8cfa56e53ee22d424c029879b27
5013750dde6990bf5d384cfd806b0d411f04d675
/leetcode/c++/1624. Largest Substring Between Two Equal Characters.cpp
d0d3ae7e7faf720061440a9a107e86aaabe0ed04
[]
no_license
543877815/algorithm
2c403319f83630772ac94e67b35a27e71227d2db
612b2e43fc6e1a2a746401288e1b89689e908926
refs/heads/master
2022-10-11T10:31:17.049279
2022-09-25T15:11:46
2022-09-25T15:11:46
188,680,726
2
0
null
null
null
null
GB18030
C++
false
false
583
cpp
1624. Largest Substring Between Two Equal Characters.cpp
// 哈希表 // 时间复杂度:O(n) // 空间复杂度:O(n) class Solution { public: int maxLengthBetweenEqualCharacters(string s) { int n = s.size(); unordered_map<int, int> record; for (int i = 0; i < n; i++) { if (record.find(s[i]) == record.end()) { record[s[i]] = i; } } int res = -1; for (int i = n - 1; i >= 0; i--) { if (record.find(s[i]) != record.end()) { res = max(res, i - 1 - record[s[i]]); } } return res; } };
70e9dd8748339aa44c09d562a646f830afbc3d05
aab561d22c80ff9ec04c9caed64fa5428af26e63
/include/librorc/sysmon.hh
30ef8b4c0b85feb3e58ee917291f67812fa537ab
[]
no_license
heikoengel/alice-hlt-librorc
4b08cdaeda578965a56206ca03f2a9af5783a555
85636db408e15845453e9a51cc833512f6d9b045
refs/heads/master
2021-10-07T20:57:10.738167
2021-10-04T19:27:17
2021-10-04T19:27:17
166,049,748
0
0
null
null
null
null
UTF-8
C++
false
false
16,604
hh
sysmon.hh
/** * Copyright (c) 2014, Heiko Engel <hengel@cern.ch> * Copyright (c) 2014, Dominic Eschweiler <dominic.eschweiler@cern.ch> * * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of University Frankfurt, FIAS, CERN nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL A COPYRIGHT HOLDER BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * **/ #include <iostream> #include <cstring> #include <librorc/defines.hh> #ifndef LIBRORC_SYSMON_H #define LIBRORC_SYSMON_H #define LIBRORC_MAX_QSFP 3 #define LIBRORC_SYSMON_QSFP_NO_RATE_SELECTION 0 #define LIBRORC_SYSMON_QSFP_EXT_RATE_SELECTION 1 #define LIBRORC_SYSMON_QSFP_APT_RATE_SELECTION 2 namespace LIBRARY_NAME { class bar; /** * @brief System monitor class * * This class can be attached to bar to provide access to the * static parts of the design, like PCIe status and SystemMonitor * readings **/ class sysmon { public: sysmon(bar *parent_bar); ~sysmon(); /** * get PCIe Interface status * @return PCIe status consisting of: * pcie_status_q[31:26] <= pl_ltssm_state; * pcie_status_q[25:23] <= pl_initial_link_width; * pcie_status_q[22:20] <= pl_lane_reversal_mode; * pcie_status_q[19] <= pl_link_gen2_capable; * pcie_status_q[18] <= pl_link_partner_gen2_supported; * pcie_status_q[17] <= pl_link_upcfg_capable; * pcie_status_q[16:9] <= 7'b0; * pcie_status_q[8] <= pl_sel_link_rate; * pcie_status_q[7:2] <= 6'b0; * pcie_status_q[1:0] <= pl_sel_link_width; **/ uint32_t PCIeStatus(); /** * get FPGA Firmware Revision * @return Firmware Revision **/ uint32_t FwRevision(); /** * get FPGA Firmware Build Date * @return Firmware Build Date as combination of * year (bits [31:16]), month (bits[15:8]) and * day (bits[7:0]). **/ uint32_t FwBuildDate(); /** * get number of implemented DMA channels **/ uint32_t numberOfChannels(); uint16_t firmwareType(); bool firmwareIsHltIn(); bool firmwareIsHltOut(); bool firmwareIsHltPciDebug(); bool firmwareIsHltInFcf(); bool firmwareIsHltHardwareTest(); const char *firmwareDescription(); uint32_t pcieNumberOfLanes(); uint32_t pcieGeneration(); /** * get FPGA Temperature * @return FPGA temperature in degree celsius **/ double FPGATemperature(); /** * get FPGA VCC_INT Voltage * @return VCCINT in Volts **/ double VCCINT(); /** * get FPGA VCC_AUX Voltage * @return VCCAUX in Volts **/ double VCCAUX(); bool systemClockIsRunning(); bool systemFanIsEnabled(); bool systemFanIsRunning(); double systemFanSpeed(); /** * control FPGA fan. The fan is by default in automatic control * mode: as long as the FPGA temperature is below ~72 degC the * fan is disabled. If the temperature exceeds this threshold * the fan is activated. This default mode can be overridden by * manual controls. * * @param ovrd override fan control. 1 enables * override mode, 0 activates automatic fan control. * @param enable enable (1) or disable (0) the fan. This only * applies if override is non-zero **/ void systemFanSetEnable ( uint32_t ovrd, uint32_t enable ); /** * get fan operating mode * @return true if automatic fan control is enabled, false if * manual fan override is active **/ bool systemFanIsAutoMode(); /** * get bracket LED mode * @return true if in blink mode, false if in auto mode **/ bool bracketLedInBlinkMode(); /** * set bracket LED mode * @param mode 0 for auto mode, 1 for blink mode **/ void setBracketLedMode( uint32_t mode ); /** * get current link mask * @return bitmask of links, 1 is active, 0 is masked **/ uint32_t getLinkmask(); /** * set link mask * @param mask bitmask of links, 1 is active, 0 is masked **/ void setLinkmask( uint32_t mask ); /** * get board uptime in seconds. This counter is only reset * when (re)configuring the FPGA and cannot be cleared with * software. * @return uptime in seconds **/ uint64_t uptimeSeconds(); /** * get the current dip switch setting * @return dipswitch value **/ uint32_t dipswitch(); bool qsfpIsPresent ( uint8_t index ); bool qsfpLEDIsOn ( uint8_t qsfp_index, uint8_t LED_index ); bool qsfpGetReset ( uint8_t index ); void qsfpSetReset ( uint8_t index, uint8_t reset ); std::string qsfpVendorName ( uint8_t index ); std::string qsfpPartNumber ( uint8_t index ); std::string qsfpRevisionNumber ( uint8_t index ); std::string qsfpSerialNumber ( uint8_t index ); float qsfpTemperature ( uint8_t index ); float qsfpVoltage ( uint8_t index ); float qsfpRxPower ( uint8_t index, uint8_t channel ); float qsfpTxBias ( uint8_t index, uint8_t channel ); float qsfpWavelength ( uint8_t index ); uint8_t qsfpTxFaultMap ( uint8_t index ); uint8_t qsfpGetRateSelectionSupport ( uint8_t index ); uint8_t qsfpPowerClass ( uint8_t index ); bool qsfpHasRXCDR ( uint8_t index ); bool qsfpHasTXCDR ( uint8_t index ); /** * reset i2c bus * @param chain chain to be resetted **/ void i2c_reset ( uint8_t chain ); /** * Read byte from i2c memory location. * Throws exception on error * @param chain i2c chain number * @param slvaddr slave address * @param memaddr memory address * @return data **/ uint8_t i2c_read_mem ( uint8_t chain, uint8_t slvaddr, uint8_t memaddr ); /** * Write byte to i2c memory location. * Throws exception on error * @param chain i2c chain number * @param slvaddr slave address * @param memaddr memory address * @param data to be written **/ void i2c_write_mem ( uint8_t chain, uint8_t slvaddr, uint8_t memaddr, uint8_t data ); /** * perform a write of two bytes to independent i2c * memory locations. Throws exception on error. * @param chain i2c chain number * @param slvaddr slave address * @param memaddr0 first memory address * @param data0 first byte to be written * @param memaddr1 second memory address * @param data1 second byte to be written **/ void i2c_write_mem_dual ( uint8_t chain, uint8_t slvaddr, uint8_t memaddr0, uint8_t data0, uint8_t memaddr1, uint8_t data1 ); /** * set I2C speed mode: * 0: 100 KHz operation * 1: 400 kHz operation * */ void i2c_set_mode ( uint8_t mode ); /** * get I2C speed mode * @return 0 for 100 kHz, 1 for 400 kHZ operation * */ uint8_t i2c_get_mode(); void ddr3SetReset ( uint32_t controller, uint32_t value ); uint32_t ddr3GetReset ( uint32_t controller ); /** * write event to DDR3 memory * @param event_data pointer to data * @param num_dws number of DWs to be written * @param ddr3_start_addr DDR3 memory start address * @param channel channel number, allowed range: 0-7 * @param last_event mark event as last event in DDR3 * memory for current channel * @return returns ddr3_address for next event * */ uint32_t ddr3DataReplayEventToRam ( uint32_t *event_data, uint32_t num_dws, uint32_t ddr3_start_addr, uint8_t channel, bool last_event, bool diu_error = false ); /** * read from DDR3 SPD monitor * @param module 0 or 1 to select target SO-DIMM module * @param address target address to be read * @return 8 bit value read from SPD **/ uint8_t ddr3SpdRead ( uint8_t module, uint8_t address ); /** * read string from DDR3 SPD monitor. This iteratively calls * ddr3SpdRead and returns the results as a string * @param module 0 or 1 to select target SO-DIMM module * @param start_address first address to read * @param end_address last address to read * @return string of the values from start_address to * end_address **/ std::string ddr3SpdReadString ( uint8_t module, uint8_t start_address, uint8_t end_address ); /** * get PCIe/SlowControl error counters **/ uint32_t pcieRequestCanceledCounter(); uint32_t pcieTxTimeoutCounter(); uint32_t pcieIllegalRequestCounter(); uint32_t pcieMultiDwReadCounter(); uint32_t pcieTxDestinationBusyCounter(); uint32_t pcieTransmissionErrorCounter(); /** * clear individual PCIe/SlowControl error counters **/ void clearPcieRequestCanceledCounter(); void clearPcieTxTimeoutCounter(); void clearPcieIllegalRequestCounter(); void clearPcieMultiDwReadCounter(); void clearPcieTxDestinationBusyCounter(); void clearPcieTransmissionErrorCounter(); /** * clear all PCIe/SlowControl error counters **/ void clearAllErrorCounters(); /** * get maximum PCIe deadtime in us * @return maximum deadtime in us **/ float maxPcieDeadtime(); /** * clear maximum PCIe deadtime counter **/ void clearMaxPcieDeadtime(); void storeRefclkFreq( uint32_t freq ); uint32_t refclkFreq(); protected: /** * write data block into DDR3 memory * @param start_addr start address of current block in DDR3 * @param data pointer to data * @param mask bitmask of active DWs in dataset: * 0x0000: no DW active * 0x0001: lowest DW active * 0x7fff: all 15 DWs active * @param channel channel number, allowed range: 0-7 * @param flags flags for current block. Allowed flags are * DATA_REPLAY_END: last block for current channel * DATA_REPLAY_EOE: add EOE-Word after current dataset * */ void ddr3DataReplayBlockToRam ( uint32_t start_addr, uint32_t *data, uint16_t mask, uint8_t channel, uint32_t flags ); void i2c_module_start ( uint8_t chain, uint8_t slvaddr, uint8_t cmd, uint8_t mode, uint8_t bytes_enable ); uint32_t i2c_wait_for_cmpl(); /** * read string from QSFP i2c memory map * @param index target QSFP * @param start start address * @param end end address * @return string **/ std::string qsfp_i2c_string_readout ( uint8_t index, uint8_t start, uint8_t end ); /** * select page 0 address space * @param index target QSFP **/ void qsfp_select_page0 ( uint8_t index ); /** base bar instance */ bar *m_bar; /** high speed mode flag */ uint8_t m_i2c_hsmode; }; } #endif /** LIBRORC_SYSMON_H */
524d96346e66b6a51cd45e23d259cf20c40ebcad
12e679b0dd491f2b5462e2401e0c320fa193a8a6
/Mychat/Mychat/title.h
0fc5f45483335bbe9833949c94e455468581a85e
[]
no_license
ruokaic/Qt-project
e295d7eab93d031cc7335d352feefba33a934045
bda42fa7918bdcdb53399f84179e45a554fa6b2a
refs/heads/main
2023-08-20T06:21:22.304075
2021-10-18T03:52:00
2021-10-18T03:52:00
418,325,403
0
0
null
null
null
null
UTF-8
C++
false
false
418
h
title.h
#ifndef TITLE_H #define TITLE_H #include <QWidget> #include <QMouseEvent> #include <QMenu> #include <QActionGroup> #include <QAction> namespace Ui { class Title; } class Title : public QWidget { Q_OBJECT public: explicit Title(QWidget *parent = 0); ~Title(); private slots: void on_CloseBtn_clicked(); signals: void close(); private: Ui::Title *ui; QPoint x; }; #endif // TITLE_H
505740c6654fb1ab4086d9dd34054ef2649c7c48
d9a642ed3b0047b56045a05e243a018069dc8133
/source code/2352_반도체 설계.cpp
57b8130758812585b567a80776d1585be3f0c683
[]
no_license
kingkk31/BOJ
7562c7b92a1761120ad159653107e0ec23be2b29
03335203cd880607803d28a1fb5cd862e7013e4b
refs/heads/master
2021-05-04T11:39:05.781066
2018-01-09T16:52:15
2018-01-09T16:52:15
49,325,443
2
0
null
null
null
null
UTF-8
C++
false
false
850
cpp
2352_반도체 설계.cpp
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <queue> #include <vector> #include <stack> #include <set> #include <map> #include <list> #include <string> #include <string.h> #include <math.h> #include <algorithm> #include <malloc.h> #include <functional> #pragma warning(disable:4996) using namespace std; int main(void) { int n; cin >> n; vector<pair<int, int> > vt; for (int i = 1; i < n+1; i++) { int second; cin >> second; vt.push_back(make_pair(i, second)); } sort(vt.begin(), vt.end()); vector<int> LIS; LIS.push_back(vt[0].second); for (int i = 1; i<vt.size(); ++i) { if (LIS.back()<vt[i].second) LIS.push_back(vt[i].second); else { vector<int>::iterator itr = lower_bound(LIS.begin(), LIS.end(), vt[i].second); *itr = vt[i].second; } } cout << LIS.size() << endl; return 0; }
00e59d53008cb675f20dbae8c8985fa13dcf808b
9aaa160fb4e092266cc856ae203cb7c0ac411ef2
/playGround.cpp
d9023d9cbaf01ca3a5c6b63eef3e141552b1cf2c
[]
no_license
Zeniz/farland
0711f67d4a20b98122c62359ec855e1a1c345f0f
54d4483a4a951c4a0a271442b97c89b048275965
refs/heads/master
2020-04-26T12:41:22.937420
2019-03-31T22:38:00
2019-03-31T22:38:00
173,557,544
0
0
null
null
null
null
UHC
C++
false
false
2,177
cpp
playGround.cpp
#include "stdafx.h" #include "playGround.h" playGround::playGround() { } playGround::~playGround() { } HRESULT playGround::init() { gameNode::init(true); _mapEditor = new mapEditor; _testMap = new testMap; _stage1 = new stage1; _mainmenu = new mainmenu; _bossStage = new bossStage; _gameover = new gameover; SCENEMANAGER->addScene("mapEditor", _mapEditor); SCENEMANAGER->addScene("testMap", _testMap); SCENEMANAGER->addScene("stage1", _stage1); SCENEMANAGER->addScene("bossStage", _bossStage); SCENEMANAGER->addScene("gameover", _gameover); SCENEMANAGER->addScene("mainmenu", _mainmenu); SCENEMANAGER->changeScene("mainmenu"); return S_OK; } void playGround::release() { gameNode::release(); } void playGround::update() { gameNode::update(); SCENEMANAGER->update(); } void playGround::render() { // Draw 시작 - 이 코드가 빠지면 D2D 출력 X D2DMANAGER->beginDraw(); //=========================================================================== // ## 여기에 코드 작성(Start) ## SCENEMANAGER->render(); // ## 여기에 코드 작성(End) ## //=========================================================================== // ##카메라 정보 마우스 정보 시간정보 출력 ##=================== WCHAR str[128]; TIMEMANAGER->render(); swprintf_s(str, L"cameraX : %d", CAMERA2D->getCamPosX()); D2DMANAGER->drawText(str, CAMERA2D->getCamPosX(), CAMERA2D->getCamPosY() + 80); swprintf_s(str, L"cameraY : %d", CAMERA2D->getCamPosY()); D2DMANAGER->drawText(str, CAMERA2D->getCamPosX(), CAMERA2D->getCamPosY() + 100); swprintf_s(str, L"mouse : [%.1f %.1f]", _ptMouse.x, _ptMouse.y); D2DMANAGER->drawText(str, CAMERA2D->getCamPosX(), CAMERA2D->getCamPosY() + 140); swprintf_s(str, L"mouseABS : [%.1f %.1f]", _ptMouseAbs.x, _ptMouseAbs.y); D2DMANAGER->drawText(str, CAMERA2D->getCamPosX(), CAMERA2D->getCamPosY() + 160); //int aaaa = 10; //wstring aaa = L"아나" + to_wstring(aaaa); //D2DMANAGER->drawText(aaa.c_str(), CAMERA2D->getCamPosX(), CAMERA2D->getCamPosY() + 200); //TIMEMANAGER->render(); // Draw 끝 - 이 코드가 빠지면 D2D 출력 X D2DMANAGER->endDraw(); }
e240d73dfa2026f66458c418b46e2427501966c1
ec79b0d29a3b041fe4c2809ec8f8875d299048f0
/Macierz.h
ec235ee48d53461ad7a30361b9414e475a41e3d9
[]
no_license
jaskoll/Matrix
7e30646906f0a7d46c2d53874ee3bf0b88534b69
a0e3fc50bffb4d136b60ccf7601d3a570f72dc67
refs/heads/master
2021-01-19T22:53:43.790722
2017-04-20T16:12:06
2017-04-20T16:12:06
88,885,715
0
0
null
null
null
null
UTF-8
C++
false
false
514
h
Macierz.h
#pragma once #include <iostream> #include "LiczbaZespolona.h" class Macierz { private: LiczbaZespolona **tablica; int M, N; public: Macierz(int m = 1, int n = 1); Macierz(const Macierz &mac); Macierz &operator=(const Macierz &mac); ~Macierz(); void setM(int x); void setN(int y); LiczbaZespolona getM(); LiczbaZespolona getN(); void wypelnijZerami(); void wypelnijJedynkami(); void wypelnijLosowo(); void wyswietlMacierz(); void wypelnijLiczbami(LiczbaZespolona &b); };
f5b76d36829d31f8cf10abd28735fa998c945c19
d655b54747775c2828bc70761d431e11bc8911d0
/初级算法/回文链表.cpp
f63d2b118804a8500d37af9ea2d8bc012d747e25
[]
no_license
ChangWenWu/Leetcode
1857e05ff406f9e15f8d0318ccdebc25b7b7574b
9b2899e12ab1a791fdd0acd2e5d83ddcaddc4a53
refs/heads/master
2021-07-20T02:35:43.726269
2018-11-29T03:24:37
2018-11-29T03:24:37
141,366,124
1
0
null
null
null
null
UTF-8
C++
false
false
1,073
cpp
回文链表.cpp
// // 回文链表.cpp // Leetcode // // Created by jarvis on 2018/7/26. // #include <stdio.h> //先使用龟兔赛跑思想取得链表中间的节点,之后将节点后的链表反转,一一比对 class Solution { public: ListNode* getMiddle(ListNode* head){ ListNode* fast = head; ListNode* slow = head; while(fast && fast->next){ fast = fast->next->next; slow = slow->next; } return slow; } ListNode* reverseList(ListNode* head){ ListNode* pre = NULL; ListNode* p = head; while(head){ p = head; head = head->next; p->next = pre; pre = p; } return pre; } bool isPalindrome(ListNode* head) { ListNode* middle = getMiddle(head); ListNode* reverse = reverseList(middle); while(head != middle){ if(head->val != reverse->val)return false; head = head->next; reverse = reverse->next; } return true; } };
02c188f755931e0537f4716dce5eb1167ab2cff3
1de094a15fa0067b63e8a7106209dfe29e803ea9
/Disjoint_set/union_by_rank_path_compression.cpp
c61436902d370f3b0ec44f56bc623e97a60fc1de
[]
no_license
jigsaw5071/algorithms
70146537d2e617c02f6253549abc8a32d9361272
9144b2c117f2845ab125b89aeec6b33891c98dd3
refs/heads/master
2020-07-20T19:03:11.431940
2019-10-17T22:17:36
2019-10-17T22:17:36
66,913,566
0
0
null
null
null
null
UTF-8
C++
false
false
1,514
cpp
union_by_rank_path_compression.cpp
/** @ Shubham Sharma date: 24/04/2017 Ref:https://www.topcoder.com/community/data-science/data-science-tutorials/disjoint-set-data-structures/ */ /**======================DISJOINT SET ================================================== 1. The time complexity of m opertaions on an array of size n is <= O(4*m) 2. The space complexity is O(n) 3. The optimizations used are union by rank and path compression */ #include<bits/stdc++.h> using namespace std; struct Node* find_set(struct Node*); struct Node{ public: int data; int rank; struct Node* parent; }; unordered_map<int,Node*> M; void make_set(const int data){ struct Node* node =new Node; node->rank=0; node->parent=node; node->data=data; M[data]=node; } bool make_union(const int data1,const int data2){ struct Node* node1=M[data1]; struct Node* node2=M[data2]; struct Node* parent1=find_set(node1); struct Node* parent2=find_set(node2); if(parent2==parent1){return false;} if(parent1->rank >=parent2->rank){ parent1->rank=(parent1->rank==parent2->rank)?parent1->rank+1:parent1->rank; parent2->parent=parent1; } else{ parent1->parent=parent2; } return true; } struct Node* find_set(struct Node* node){ if(node->parent==node){ return node; } node->parent=find_set(node->parent); return node->parent; } int find_set_element(const int data){ return find_set(M[data])->data; } int main(void){ make_set(1); make_set(2); make_union(1,2); cout<<find_set_element(2); return 0; }
c1ceb4f91832202bc06007a4183129aafa97da09
c21c8cba94f4f73aa23de98e555ef77bcab494f0
/Codechef/FORESTGA.cpp
4a1db4b28ab5711de4896636e09e2816e15c2988
[]
no_license
hoatd/Ds-Algos-
fc3ed0c8c1b285fb558f53eeeaea2632e0ed03ae
1e74995433685f32ce75a036cd82460605024c49
refs/heads/master
2023-03-19T05:48:42.595330
2019-04-29T06:20:43
2019-04-29T06:20:43
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,138
cpp
FORESTGA.cpp
#include<bits/stdc++.h> #define mp make_pair #define ll long long #define pb push_back #define si(x) scanf("%d",&x) #define slli(x) scanf("%lld",&x) #define pi(x) printf("%d",x) #define mx5 100005 #define mx6 1000006 #define mod 1000000007 #define rep(i,n) for(int i=0; i<n; i++) #define fast std::ios::sync_with_stdio(false) #define gc() getchar() #define pc(x) putchar(x) using namespace std; /** approach : binary search **/ ll R[100005]; ll H[100005]; int main() { fast; ll N,W,L; cin>>N>>W>>L; for(ll i=1; i<=N; i++) { cin>>H[i]>>R[i]; } ll low=0LL, high=1000000000000000000LL, mid; ll ans; while(low < high) { mid = (low) + (high - low)/2; ans = 0LL; for(ll i=1; i <= N; i++){ if( H[i] + mid * R[i] >= L ) { ans += H[i] + mid * R[i]; } if ( ans >= W ){ break; } } if( ans >= W ) { high = mid; } else { low = mid + 1; } } cout<<high<<endl; return 0; }
c2ecfa2d12b8c752153e5fab48b31c5c26fbe005
6bf865081abaeee8bc86982c21b5b04c34af8967
/main.cpp
d1723aadea4e73d06f9db1f1c38f17134f99c0bb
[]
no_license
wangjiwang/BankSystem
37badf0ef350f3ee916919b3592220cd815aefd8
778f33cfbf8cc60e3e59ca33cf6df549fd1cad86
refs/heads/master
2021-01-17T08:52:32.567854
2017-03-05T13:08:24
2017-03-05T13:08:24
83,967,318
2
0
null
null
null
null
GB18030
C++
false
false
25,868
cpp
main.cpp
#include <iostream> #include "Account.h" #include "linkList.h" #include <fstream> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include<windows.h> #include <time.h> using namespace std; #define n 10 bank bank; SLNode *rear; void welcome() { cout<<"iriiiiiiiiiiBB irUiirivB Br MorrruBi BB iiiiiZk "<<endl; cout<<"i Mr BO iLoBuYMB vB rM OBioYBG iB Bq iiiiiii "<<endl; cout<<" r Bi BZ ki B vB oB LB iB j BGiiiYB I BG Lv"<<endl; cout<<" MB Bi BN Bv iLBJjSM iB iB MiMui Bk iB BF vrivBUikJ"<<endl; cout<<" Bo B Bu Bi iB IBiVMiYB i BviiBkuE iBN oNBL B "<<endl; cout<<" BJ Bv BBJFBi M i iB i i BL Bv B iVF ri Bv Bi "<<endl; cout<<" BOr Bi rNBuiiiiFBirU Bvi BL IBr BY Bi "<<endl; cout<<" BBiirLvviiiBr vBi uB rZ BBr BBV BBEi BI jJSBi "<<endl; cout<<" Si Y viiiiiiivv i vL iSi Mi iBY "<<endl; cout<<" ii iL q L "<<endl; cout<<" iii iZ BZ BM iFuGBi r MB BB ri i "<<endl; cout<<" Ii BB iB iiBi X kB iBiiBY IB Mo IFiYBV UBB "<<endl; cout<<" iG Bi BiON BBi iiiL LB iB Bi SjBiiiF uB Y iBV "<<endl; cout<<" EBO kr BM iNB vB LB Bi Bi GZ UB SBi Bi "<<endl; cout<<" iBB BB vB UBuLVB Bi Bi ivBN JL B "<<endl; cout<<" iB OB BriB oB Oi iB XB r O YMi ii v "<<endl; cout<<" uM MiBM BB vBEoq rB BM B S ovEB MMB "<<endl; cout<<" iv vEi BBv vu oNMOBMBBBBi uB BEiiirBM Xi "<<endl; cout<<" i iiriri "<<endl; cout<<endl<<endl<<endl; system("pause"); system("cls"); } void cMainMenu() { cout<<"1<--查询"<<" "<<"取款-->2"<<endl; cout<<"3<--改密"<<" "<<"存款-->4"<<endl; cout<<"5<--转账"<<" "<<"退卡-->6"<<endl; } void mMainMenu() { cout<<"1<--查询"<<" "<<"取款-->2"<<endl; cout<<"3<--改密"<<" "<<"存款-->4"<<endl; cout<<"5<--转账"<<" "<<"重置-->6"<<endl; cout<<"7<--开户"<<" "<<"销户-->8"<<endl; cout<<"9<--排序"<<" "<<"退出-->10"<<endl; } void searchMenu() { cout<<"1<--交易明细"<<" "<<"回主菜单-->2"<<endl; } int main() { welcome(); int dealNum,i,j; SLNode *node; fstream file,file2,file3; file.open("bank.txt",ios::in); file2.open("history.txt",ios::in); file3.open("account.txt",ios::in); file3>>bank.account; for(i=1;i<=n;i++) { HeadInit(&bank.pHead[i]); } file>>bank.sum; for(i=1;i<=bank.sum;i++)//把交易明细文件的内容写到链表中 { file2>>bank.pHead[i]->num; file2>>bank.pHead[i]->dealNum; for(j=1;j<=bank.pHead[i]->dealNum;j++){ ListInit(&node); if(j==1){ bank.pHead[i]->next=node; } else{ rear->next=node; } file2>>node->year>>node->month>>node->day; file2.get(); file2.getline(node->dealHis,20,'\n'); rear=node; } } for(i=1;i<=bank.sum;i++) { file>>bank.han[i].num>>bank.han[i].pass>>bank.han[i].money>>bank.han[i].chance>>bank.han[i].name>>bank.han[i].sex>>bank.han[i].birth>>bank.han[i].id>>bank.han[i].tel; } file.close(); file2.close(); file.open("bank.txt",ios::out); file2.open("history.txt",ios::out); customer::login();//登入模块 file<<bank.sum<<'\n'; for(i=1;i<=bank.sum;i++) { file<<bank.han[i].num<<" "<<bank.han[i].pass<<" "<<bank.han[i].money<<" "<<bank.han[i].chance<<" "<<bank.han[i].name<<" "<<bank.han[i].sex<<" "<<bank.han[i].birth<<" "<<bank.han[i].id<<" "<<bank.han[i].tel<<'\n'; } for(i=1;i<=bank.sum;i++) { file2<<bank.pHead[i]->num<<'\n'; file2<<bank.pHead[i]->dealNum<<'\n'; rear = bank.pHead[i]->next; for(j=1;j<=bank.pHead[i]->dealNum;j++) { file2<<rear->year<<" "<<rear->month<<" "<<rear->day<<endl; file2<<rear->dealHis<<'\n'; rear=rear->next; } } file2.close(); file3.close(); file3.open("account.txt",ios::out); file3<<bank.account; file3.close(); return 0; } int customer::login()//登录模块 { cout<<"登入模块"<<endl; int idType,i; int t,flag=0,choice; int flag2=0; char password[7]; cout<<"请问您将以哪种身份使用本系统"<<endl; cout<<"1<--登录"<<" "<<"管理-->2"<<endl; cin>>idType; system("cls"); switch(idType) { case 1://选择使用类型为用户 cout<<"请输入卡号:"<<endl; if((t=customer::searchAccount())!=0){ flag2 = 1; if(bank.han[t].chance==0) { cout<<"该卡已被冻结,请持有效证件到银行解冻!"<<endl; Sleep(2000); goto label; } } if(flag2 == 1){ do { cout<<"请输入密码:"<<endl; cin>>password; system("cls"); if((strcmp(password,bank.han[t].pass))==0) { bank.han[t].chance = 3; cout<<bank.han[t].name<<",欢迎您!"<<endl; flag=1; } else{ cout<<"密码错误,请重新输入"<<endl; bank.han[t].chance--; cout<<"你还有"<<bank.han[t].chance<<"次机会"<<endl; if(bank.han[t].chance==0) { cout<<"抱歉,您输入的密码错误次数太多!"<<endl; cout<<"该卡已被冻结,请持有效证件到银行解冻!"<<endl; Sleep(2000); goto label; break; } } }while(flag==0); do { cMainMenu(); cin>>choice; system("cls"); if(choice<=6&&choice>0) { switch(choice){ case 1://跳至查询菜单; bank.han[t].showRemain(); searchMenu(); cin>>choice; if(choice>=1&&choice<=2) { switch(choice) { case 1: bank.han[t].showHistory();//交易明细板块 Sleep(10000); system("cls"); break; case 2: Sleep(1000); system("cls"); break; } } else{ cout<<"输入错误,将返回主菜单!"<<endl; system("cls"); } break; case 2: bank.han[t].outMoney(); break; case 3: bank.han[t].chPass(); break; case 4: bank.han[t].saveMoney(); break; case 5: bank.han[t].transMoney(); break; label :case 6: choice = 6; break; } } }while(choice!=6); } break; case 2://选择使用类型为管理员 manager a; int choice,flag=0; char password[7]; do{ mMainMenu(); cin>>choice; system("cls"); if(choice == 6) { cout<<"请输入卡号:"<<endl; if((t=customer::searchAccount())!=0) { bank.han[t].forPass(); } else { cout<<"该卡号不存在"<<endl; system("cls"); goto label2; } } if(choice<6&&choice>0) { cout<<"请输入卡号:"<<endl; //if((t=customer::searchAccount())!=0){ if((t=customer::searchAccount())!=0){ flag2 = 1; if(bank.han[t].chance==0) { cout<<"该卡已被冻结,请持有效证件到银行解冻!"<<endl; Sleep(2000); goto label2; } } else { cout<<"该卡号不存在"<<endl; system("cls"); goto label2; } } if(flag2 == 1){ do { cout<<"请输入密码:"<<endl; cin>>password; system("cls"); if((strcmp(password,bank.han[t].pass))==0) { bank.han[t].chance = 3; cout<<bank.han[t].name<<",欢迎您!"<<endl; flag = 1; } else{ cout<<"密码错误,请重新输入"<<endl; bank.han[t].chance--; cout<<"你还有"<<bank.han[t].chance<<"次机会"<<endl; if(bank.han[t].chance==0) { cout<<"抱歉,您输入的密码错误次数太多!"<<endl; cout<<"该卡已被冻结,请持有效证件到银行解冻!"<<endl; Sleep(2000); system("cls"); goto label2; break; } } }while(flag==0); } switch(choice){ case 1://跳至查询菜单; bank.han[t].showRemain(); searchMenu(); cin>>choice; system("cls"); if(choice>=1&&choice<=2) { switch(choice) { case 1://交易明细板块 bank.han[t].showHistory(); Sleep(10000); system("cls"); break; case 2: Sleep(1000); system("cls"); break; } } else{ cout<<"输入错误,将返回主菜单!"<<endl; } break; case 2: bank.han[t].outMoney(); break; case 3: bank.han[t].chPass(); break; case 4: bank.han[t].saveMoney(); break; case 5: bank.han[t].transMoney(); break; } if(choice>6&&choice<=10){ switch(choice){ case 7: a.openAccount();//开户模块 break; case 8: a.delAccount();//销户模块 break; case 9: manager::sortAccount(0,bank.sum);//排序模块 cout<<"排序成功!"<<endl; Sleep(3000); system("cls"); break; case 10: break; } } if(choice<=0||choice>10) { cout<<"输入有误"<<endl; } label2:flag = 0; flag2 = 0; }while(choice!=10); break; } return 0; } int customer::saveMoney()//存钱 { time_t timep; struct tm *p; int x,i; char str[10]; cout<<"请输入您要存入的金额:"<<endl; cin>>x; time(&timep); p = localtime(&timep); sprintf(str,"%d",x); money = money + x; cout<<"您的余额为"<<money<<endl; for(i=1;i<=bank.sum;i++) { if(strcmp(bank.pHead[i]->num,num)==0) { SLNode *temp; ListInit(&temp); temp->year=1900+p->tm_year; temp->month=1+p->tm_mon; temp->day=p->tm_mday; strcpy(temp->dealHis,"存入 "); strcat(temp->dealHis,str); temp->next = bank.pHead[i]->next; bank.pHead[i]->next = temp; if(bank.pHead[i]->dealNum == 10){ } if(bank.pHead[i]->dealNum <10) { bank.pHead[i]->dealNum++; } rear=bank.pHead[i]->next; break; } } Sleep(5000); system("cls"); return 0; } int customer::saveMoney(int x)//存钱 给转账的时候用 { time_t timep; struct tm *p; int i; char str[10]; money = money + x; time(&timep); p = localtime(&timep); sprintf(str,"%d",x); for(i=1;i<=bank.sum;i++) { if(strcmp(bank.pHead[i]->num,num)==0) { SLNode *temp; ListInit(&temp); temp->year=1900+p->tm_year; temp->month=1+p->tm_mon; temp->day=p->tm_mday; strcpy(temp->dealHis,"存入 "); strcat(temp->dealHis,str); temp->next = bank.pHead[i]->next; bank.pHead[i]->next = temp; if(bank.pHead[i]->dealNum == 10){ } if(bank.pHead[i]->dealNum <10) { bank.pHead[i]->dealNum++; } break; } } Sleep(3000); system("cls"); return 0; } int customer::outMoney()//取钱 { time_t timep; struct tm *p; int x,i; char str[10]; int flag = 0; do{ for(i=0;;i++) { cout<<"请输入您要取出的金额:"<<endl; cin>>x; sprintf(str,"%d",x); if(x>money){ cout<<"余额不足,请重新输入"<<endl; } else{ for(i=1;i<=bank.sum;i++) { if(strcmp(bank.pHead[i]->num,num)==0) { time(&timep); p = localtime(&timep); SLNode *temp; ListInit(&temp); temp->year=1900+p->tm_year; temp->month=1+p->tm_mon; temp->day=p->tm_mday; strcpy(temp->dealHis,"支出 -"); strcat(temp->dealHis,str); temp->next = bank.pHead[i]->next; bank.pHead[i]->next = temp; if(bank.pHead[i]->dealNum == 10){ } if(bank.pHead[i]->dealNum <10) { bank.pHead[i]->dealNum++; } money = money - x; cout<<"您的余额为"<<money<<endl; flag = 1; break; } } break; } } }while(flag == 0); Sleep(3000); system("cls"); return 0; } int customer::transMoney()//转账模块 { time_t timep; struct tm *p; int i,j; int x; char str[10]; int flag = 0; do{ cout<<"请输入对方卡号:"<<endl; if((j=customer::searchAccount())!=0){ flag = 1; } }while(flag == 0); flag = 0; do{ for(i=0;;i++) { cout<<"请输入您要汇款的金额:"<<endl; cin>>x; if(x>money){ cout<<"余额不足,请重新输入"<<endl; } else{ time(&timep); p = localtime(&timep); sprintf(str,"%d",x); bank.han[j].saveMoney(x); for(i=1;i<=bank.sum;i++) { if(strcmp(bank.pHead[i]->num,num)==0) { SLNode *temp; ListInit(&temp); temp->year=1900+p->tm_year; temp->month=1+p->tm_mon; temp->day=p->tm_mday; strcpy(temp->dealHis,"支出 -"); strcat(temp->dealHis,str); temp->next = bank.pHead[i]->next; bank.pHead[i]->next = temp; if(bank.pHead[i]->dealNum == 10){ } if(bank.pHead[i]->dealNum <10) { bank.pHead[i]->dealNum++; } money = money - x; flag = 1; break; } } break; } } }while(flag == 0); return 0; } int customer::searchAccount()//查询账户 { int i; char card[20]; cin>>card; for(i=1;i<n;i++) { if(strcmp(bank.han[i].num,card)==0) { break; } } if(i==n) { cout<<"抱歉,该账户为无效账户"<<endl; return 0; } else{ return i; } } int customer::chPass()//改密码板块 { cout<<"请输入您的新个人密码:"<<endl; cin>>pass; cout<<"更改密码成功!"<<endl; Sleep(1000); system("cls"); return 0; } int customer::forPass() { int flag = 0; char idTemp[20],telTemp[20]; do{ cout<<"请输入您的身份证:(输入完成后按enter确认)"<<endl; cin>>idTemp; cout<<"请输入您的预留手机号:(输入完成后按enter确认)"<<endl; cin>>telTemp; if(strcmp(id,idTemp)!=0){ cout<<"身份证号码输入错误,请确认后重新输入:"<<endl; } if(strcmp(tel,telTemp)!=0) { cout<<"预留手机号输入错误,请确认后重新输入:"<<endl; } if(strcmp(id,idTemp)==0&&strcmp(tel,telTemp)==0) { flag = 1; cout<<"请输入您的新个人密码:"<<endl; cin>>pass; } cout<<"更改密码成功!"<<endl; Sleep(3000); system("cls"); }while(flag==0); return 0; } void customer::showRemain()//显示余额板块 { cout<<"显示余额模块"<<endl; cout<<"您的账户余额:"<<money<<endl; } int manager::openAccount()//开账户板块 { bank.account++; bank.sum++; itoa(bank.account,bank.han[bank.sum].num,10); itoa(bank.account,bank.pHead[bank.sum]->num,10); bank.han[bank.sum].chance=3; cout<<"请输入您的姓名:(输入完成后按enter确认)"; cin>>bank.han[bank.sum].name; cout<<"请输入您的性别:(男性为m 女性为f 输入完成后按enter确认)"; cin>>bank.han[bank.sum].sex; cout<<"请输入您的出生年月日:(例1998年3月4号出生输入19980304即可,输入完成后按enter确认)"; cin>>bank.han[bank.sum].birth; cout<<"请输入您的身份证号码:(输入完成后按enter确认)"; cin>>bank.han[bank.sum].id; cout<<"请输入您的预留手机号:(输入完成后按enter确认)"; cin>>bank.han[bank.sum].tel; cout<<"请输入您的密码:(密码为6位数字 输入完成后按enter确认)"; cin>>bank.han[bank.sum].pass; bank.han[bank.sum].money=0; cout<<"开户成功!"<<endl; Sleep(3000); system("cls"); return 0; } int manager::delAccount()//销户模块 { int t,flag=1,i; char name[20],id[20],tel[20],pass[20]; cout<<"请输入卡号:"<<endl; if((t=customer::searchAccount())!=0) { do{ switch(flag) { case 1 : cout<<"请输入您的姓名:(输入完成后按enter确认)"; cin>>name; if(strcmp(bank.han[t].name,name)!=0) { cout<<"该用户名不存在,请重新输入"<<endl; break; } flag++; case 2 : cout<<"请输入您的身份证号码:(输入完成后按enter确认)"; cin>>id; if(strcmp(bank.han[t].id,id)!=0) { cout<<"您的身份证号码有误,请重新输入"<<endl; break; } flag++; case 3 : cout<<"请输入您的预留手机号:(输入完成后按enter确认)"; cin>>tel; if(strcmp(bank.han[t].tel,tel)!=0) { cout<<"您的预留手机号有误,请重新输入"<<endl; break; } flag++; case 4 : cout<<"请输入您的密码:(密码为6位数字 输入完成后按enter确认)"; cin>>pass; if(strcmp(bank.han[t].pass,pass)!=0) { cout<<"密码错误,请重新输入"<<endl; break; } flag++; } }while(flag!=5); for(i=1;i<=bank.sum;i++) { if(strcmp(bank.pHead[i]->num,bank.han[t].num)==0) break; } for(;i<bank.sum;i++) { bank.pHead[i]=bank.pHead[i+1]; } for(;t<bank.sum;t++)//韩剑智教我的快捷删除数组中某元素的方法 { bank.han[t]=bank.han[t+1]; } bank.sum--; for(t=1;t<=bank.sum;t++) { cout<<bank.han[t].num<<bank.han[t].name<<endl; } } else{ cout<<"请确认无误后重新输入!"<<endl; } Sleep(5000); system("cls"); return 0; } int manager::sortAccount(int left,int right)//排序模块 { if(left<right)//这个if循环是为了防止无限递归 用来跳出递归 因为递归的原因 使得该if有点多次使用的感觉 { int i=left; int j=right; int middle; customer temp; temp=bank.han[i]; while(i<j)//这个while保证能使一次实现基准数左边比其小 右边比其大 { while(i<j && strcmp(bank.han[j].num,temp.num)>0)//从右往左找第一个比基准数 小 的数 { j--; } bank.han[i]=bank.han[j]; while(i<j && strcmp(bank.han[i].num,temp.num)<0)//从左往右找第一个比基准数 大 的数 { i++; } bank.han[j]=bank.han[i]; } middle=i;//middle = j; bank.han[middle]=temp; sortAccount(left,middle-1);//向左半部份调用 sortAccount(middle+1,right);//向右半部份调用 } return 0; } void customer::showHistory()//显示交易明细板块 { int dealNum,i,j; SLNode *rear; for(i=1;i<=bank.sum;i++)//把由交易明细文件转换而成的链表往屏幕显示 { if(strcmp(bank.pHead[i]->num,num)==0){ for(j=1;j<=bank.pHead[i]->dealNum;j++){ if(j==1){ cout<<bank.pHead[i]->next->year<<" "<<bank.pHead[i]->next->month<<" "<<bank.pHead[i]->next->day<<endl; cout<<bank.pHead[i]->next->dealHis<<endl; rear=bank.pHead[i]->next; } else{ cout<<rear->next->year<<" "<<rear->next->month<<" "<<rear->next->day<<endl; cout<<rear->next->dealHis<<endl; rear=rear->next; } } } } }
9b81e66dee9e4213d2e8d023e64d186098ac03ca
0e8dad8b6ee61b4d4ca9cd040b6c0ccd4e8f3e07
/src-Teensy/TeensyGoNogo/SerialParser.h
7bce1b3ce52a304da4b0252b54101bcf229a0430
[ "MIT" ]
permissive
emaleepeterson/TeensyGoNogo
9842a83ebc14a0bf0610a97f96d2ab55f0fb0c99
ca9cab249f05ad014f663ca1656a2ace9ddd81b3
refs/heads/master
2020-04-06T19:30:17.496118
2018-11-19T16:34:24
2018-11-19T16:34:24
157,739,570
0
0
null
null
null
null
UTF-8
C++
false
false
481
h
SerialParser.h
#ifndef _SerialParser_h_ #define _SerialParser_h_ #include <Arduino.h> typedef void (*interpreter)(char* cmd, int num_args, long* args); class SerialParser { public: static const int MAX_ARGS = 10; static const int MAX_CMD = 128; private: HardwareSerial _serial; interpreter _interp; String _usbMessage; long _args[MAX_ARGS]; char _cmd[MAX_CMD+1]; public: SerialParser(interpreter interp); ~SerialParser(); void update(); void parse(); }; #endif //_SerialParser_h_
8bd5ed837311acbf5f96275a7d8d31aecfb35161
6cb9f535c40a11a22a4abbfb3c05adb1fd8aec96
/BaoCao/BC_DHMT/Source/Bai2.cpp
ab7e46b3b93fdd98f518e6b47c98aca05e9001ca
[]
no_license
ceontgroup/public-project
f77449a000176dfd4fdceaf65853d44fda217e7e
c311e143cad7d552cfdc47ce70cdbc61ba00e433
refs/heads/master
2016-08-11T18:06:59.377421
2013-06-02T17:46:36
2013-06-02T17:46:36
48,648,449
0
0
null
null
null
null
UTF-8
C++
false
false
2,140
cpp
Bai2.cpp
#include <stdio.h> #include<iostream> #include<math.h> #include "graphics.h" int init(); int close(); int pause(); int drawLine(int xa,int ya,int xb,int yb,int color=0); int drawCircle(int x0,int y0,int R,int c=0); int main() { drawLine(0,300,23,123,3); drawCircle(200,200,200,4); return 0; } //--------------------------------------------- int init(){ int gd=0,gm=DETECT; initgraph(&gd,&gm,""); return graphresult(); } //---------------------------------------------- int close(){ closegraph(); return 1; } //--------------------------------------------- int pause(){ while (!kbhit()); return 1; } //---------------------------------------------- int drawCircle(int x0,int y0,int R,int c){ int x,y,p; init(); p=1-R; x=0;y=R; while(x<=y){ putpixel(x+x0,y+y0,c);putpixel(y+x0,x+y0,c); putpixel(y+x0,-x+y0,c);putpixel(x+x0,-y+y0,c); putpixel(-x+x0,-y+y0,c);putpixel(-y+x0,-x+y0,c); putpixel(-y+x0,x+y0,c);putpixel(-x+x0,y+y0,c); if (p<0) p+=2*x+3; else{ p+=2*(x-y)+5; y--; } x++; } pause(); close(); } //---------------------------------------------- int drawLine(int xa,int ya,int xb,int yb,int c){ int dx,dy,e,esi,eti,x,y; init(); float m; dx=xb-xa; dy=yb-ya; m=dy/(float)dx; if (m>1||m<-1){ dx=dx+dy; dy=dx-dy; dx=dx-dy; } if(m<0) dy*=-1; e=2*dy-dx; esi=2*(dy-dx); eti=2*dy; x=xa; y=ya; if(m>1||m<-1) while(y!=yb){ putpixel(x,y,c); if (e<0) e+=eti; else { e+=esi; x++; } if(m>1) y++; else y--; } else while(x!=xb){ putpixel(x,y,c); if (e<0) e+=eti; else { e+=esi; if (m>0) y++; if (m<0) y--; } x++; } pause(); close(); return 0; } //-----------------------------------------
dac43ccb93b00f7ea26b7dd9af65f5483bce0bfb
c8814f2e344cf72bc25ad84e2e596505bbddcdf2
/0 通用/0.2 输入输出挂/0.2.3 fread输入.cpp
c1f591492e2e281197d21ccf5df5aae20c26a95b
[]
no_license
Hukeqing/ACM-Template-SingDanceRap
b648d7058f05be8e6c268e27cc63e18fa2168f1a
3c61332d5630ab466a48b95b9c67de31e1e63087
refs/heads/master
2023-02-02T14:38:07.376220
2020-12-24T01:57:44
2020-12-24T01:57:44
189,908,584
1
0
null
null
null
null
UTF-8
C++
false
false
877
cpp
0.2.3 fread输入.cpp
/* * fread快读,最强快读 * 不可以与其他任何读入重用 * 可以判断是否为文件结束 * 使用: * int a; * FastRead (a); */ struct fastio { static const int s = 1 << 24; unsigned p, l; fastio() { p = l = 0; } char gc() { static char bf[s]; if (p == l) p = 0, l = fread(bf, 1, s, stdin); return p == l ? -1 : bf[p++]; } template <class __T> bool read(__T &x) { char c = gc(), f = 0; double d = 0.1; while ((c < '0' || c > '9') && ~c) {f |= (c == '-'); c = gc(); } if (c == -1) return 0; x = 0; while (c <= '9' && c >= '0') { x = x * 10 + c - '0'; c = gc(); } if (c == '.') { c = gc(); while(c <= '9' && c >= '0') { x += d * (c - '0'); d *= 0.1; ch = gc(); } } return 1; } } io;
2eadb9d3ecd2ef659de896e73012817c237d45f6
46a6f2d120608c7483052ab60f4f107b3d85a815
/meta_manage/meta_menage/3rd/unispace_library/include/util/math/us_size.hpp
8337f23c4e244a6ac46227a700f8722e3bf9eda5
[]
no_license
radtek/httpcms
fe38f4e0d9eed566ea5b217747acff81c5ea2fc7
93911b10411ddc987e98826f728056ece0fb0075
refs/heads/master
2020-06-11T01:13:25.089747
2018-11-21T10:06:34
2018-11-21T10:06:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,619
hpp
us_size.hpp
/**********************************************************************//** * @file math\us_size.hpp * * Declares the size class. *************************************************************************/ #ifndef __US_SIZE_HPP__ #define __US_SIZE_HPP__ #ifndef __US_VEC2_HPP__ #include "us_vec2.hpp" #endif // #include <string> // #include <type_traits> namespace unispace { /**********************************************************************//** * @class us_size * @brief 二维尺寸大小类。 * @author yimin.liu@unispace-x.com * @date 2016/3/14 *************************************************************************/ template<typename T = float> class us_size{ static_assert(std::is_same<T, int>::value || std::is_same<T, float>::value || std::is_same<T, double>::value, "template parameter must is int or float or double"); public: T m_width; T m_height; public: /******************************************************************//** * @fn us_size::us_size() * @brief 构造函数. * @author yimin.liu@unispace-x.com * @date 2016/3/14 *********************************************************************/ us_size(); /******************************************************************//** * Constructor. * @author yimin.liu@unispace-x.com * @date 2016/3/14 * @param width The width. * @param height The height. *********************************************************************/ us_size(T width, T height); /******************************************************************//** * Copy constructor. * @author yimin.liu@unispace-x.com * @date 2016/3/14 * @param other The other. *********************************************************************/ us_size(const us_size& other); /******************************************************************//** * Constructor. * @author yimin.liu@unispace-x.com * @date 2016/3/14 * @param v The us_vec2&lt;T&gt; to process. *********************************************************************/ explicit us_size(const us_vec2<T>& v); // 重载运算符 us_size& operator= (const us_size& other); us_size& operator= (const us_vec2<T>& v); // 重载 + 加上一个 size 后的值 us_size operator+(const us_size& right) const; // 重载 - 减去一个 size 后的值 us_size operator-(const us_size& right) const; // 重载 * 放大 scale 倍 后的值 us_size operator*(double scale) const; // 重载 / 缩小 scale 倍 后的值 us_size operator/(double scale) const; // 重载 == 操作 bool operator == (const us_size& t)const; // 重载 != 操作 bool operator != (const us_size& t)const; /**********************************************************************//** * @brief 获取缩放后的size值. * @author yimin.liu@unispace-x.com * @date 2016/11/01 * @param scale_factor The scale factor. * @return 一个缩放后的us_size. *************************************************************************/ us_size scale(const double scale_factor)const; /**********************************************************************//** * @brief 获取缩放后的size值. * @author 2016/11/01 * @date 2016/3/24 * @param scale_factor_x The scale factor x coordinate. * @param scale_factor_y The scale factor y coordinate. * @return 一个缩放后的us_size. *************************************************************************/ us_size scale(const double scale_factor_x, const double scale_factor_y)const; /**********************************************************************//** * @brief 判断是否是 0 size (高和宽都是0) * @author yimin.liu@unispace-x.com * @date 2016/3/24 * @return true if zero, false if not. *************************************************************************/ bool is_zero()const; /**********************************************************************//** * @brief 判断等于操作,主要是为 浮点数进行的. * @author yimin.liu@unispace-x.com * @date 2016/3/24 * @param t 进行比较的对象. * * @return 两个us_size的高宽都相等,返回true.否则false. *************************************************************************/ bool equals(const us_size& t) const; /**********************************************************************//** * @brief 判断宽或高的值是否有负数. * @author yimin.liu@unispace-x.com * @date 2016/3/24 * @return true if negative, false if not. *************************************************************************/ bool has_negative()const; /**********************************************************************//** * @brief 判断宽或高的值是否有非正数值. * @author yimin.liu@unispace-x.com * @date 2016/3/24 * @return true 有非正数值, false 无非正数值. *************************************************************************/ bool has_non_positive()const; /*****************************************************************//** * @fn us_size& us_size::set_size(T width, T height); * @brief 设置 size 的值. * @author yimin.liu@unispace-x.com * @date 2016/3/14 * @param width The width. * @param height The height. * @return A reference to an us_size. ********************************************************************/ us_size& set_size(T width, T height); /*****************************************************************//** * @brief 对size自身进行缩放. * @author yimin.liu@unispace-x.com * @date 2016/11/01 * @param scale_factor The scale factor. * @return A reference to an us_size. *********************************************************************/ us_size& set_scale(const double scale_factor); /*****************************************************************//** * @brief 对size自身进行缩放. * @author yimin.liu@unispace-x.com * @date 2016/11/01 * @param scale_factor_x The scale factor x coordinate. * @param scale_factor_y The scale factor y coordinate. * @return A reference to an us_size. *********************************************************************/ us_size& set_scale(const double scale_factor_x, const double scale_factor_y); // 重载 += 自身加上一个 size 后的值 us_size& operator+=(const us_size& right); // 重载 -= 自身减去一个 size 后的值 us_size& operator-=(const us_size& right); // 重载 *= 自身放大 scale 倍 后的值 us_size& operator*=(double scale); // 重载 /= 自身缩小 scale 倍 后的值 us_size& operator/=(double scale); public: // 转换 us_size 到 vec2【(vec2)obj的形式】 operator us_vec2<T>() const; /******************************************************************//** * @fn std::string us_size::to_string()const; * @brief 转换为字符串. * @author yimin.liu@unispace-x.com * @date 2016/3/14 * @return This object as a std::string. *********************************************************************/ std::string to_string()const; /******************************************************************//** * @fn static const us_size us_size::zero(); * @brief 获取零size. * @author yimin.liu@unispace-x.com * @date 2016/3/14 * @return A const us_size. *********************************************************************/ static const us_size zero(); }; } //****************************************************************************// #endif //!__US_SIZE_HPP__
a8be07ff337b1960fb1ce7aa47da5bd07eb10ae8
a41d36f0dac61f59ba988ddcf7f696e6a15be3fe
/AsteroidShooter/includes/MapBackground.h
b9fb3473a9488d7fbb44b8ea45edade380f1341d
[ "MIT" ]
permissive
htmlboss/OpenGL-2D-Game-Engine
54847f070639cec91170a146dea661af4650a3e0
1908e5a6ab781585381bcb7bcae6a595506354b2
refs/heads/master
2021-01-17T19:01:17.609130
2016-10-22T12:16:35
2016-10-22T12:16:35
71,636,806
2
0
null
null
null
null
UTF-8
C++
false
false
500
h
MapBackground.h
#ifndef MAP_BACKGROUND_H #define MAP_BACKGROUND_H #include <string> #include <InputManager.h> #include <SpriteBatch.h> class MapBackground { public: MapBackground(); ~MapBackground(); void Init(const std::string& BackgroundPath, Engine::InputManager* inputMgr, const glm::vec2& cameraPosition); void Update(); void DrawBackground(Engine::SpriteBatch& spritebatch); private: std::string m_bgPath; Engine::InputManager* m_inputMgr; glm::vec2 m_position; }; #endif // !MAP_BACKGROUND_H
46115048ccc1561be85ad825dc74a3178a717d4a
dccd1058e723b6617148824dc0243dbec4c9bd48
/aoj/itp1_cpp/itp111b.cpp
a3dda09e0e2816905429797e3c212474ca56d4b2
[]
no_license
imulan/procon
488e49de3bcbab36c624290cf9e370abfc8735bf
2a86f47614fe0c34e403ffb35108705522785092
refs/heads/master
2021-05-22T09:24:19.691191
2021-01-02T14:27:13
2021-01-02T14:27:13
46,834,567
7
1
null
null
null
null
UTF-8
C++
false
false
861
cpp
itp111b.cpp
#include <cstdio> #include <iostream> using namespace std; struct dice{ int q1,q2,q3,q4,q5,q6; }; void mN(dice &d){ int tmp=d.q1; d.q1=d.q2; d.q2=d.q6; d.q6=d.q5; d.q5=tmp; } void mE(dice &d){ int tmp=d.q1; d.q1=d.q4; d.q4=d.q6; d.q6=d.q3; d.q3=tmp; } void mW(dice &d){ int tmp=d.q1; d.q1=d.q3; d.q3=d.q6; d.q6=d.q4; d.q4=tmp; } void mS(dice &d){ int tmp=d.q1; d.q1=d.q5; d.q5=d.q6; d.q6=d.q2; d.q2=tmp; } void spin(dice &d){ int tmp=d.q2; d.q2=d.q3; d.q3=d.q5; d.q5=d.q4; d.q4=tmp; } int main(){ dice z; int q; scanf(" %d %d %d %d %d %d", &z.q1, &z.q2, &z.q3, &z.q4, &z.q5, &z.q6); scanf(" %d", &q); for(int i=0; i<q; ++i){ int a, b; dice x=z; scanf(" %d %d", &a, &b); if(a==x.q3 || a==x.q4) mE(x); while(a != x.q1) mN(x); while(b != x.q2) spin(x); printf("%d\n", x.q3); } return 0; }
e6d0cc4a33c85227f2361b7ce236b5deb871c803
9a5776aab7b866b4542aa08dd2d49afb177899f1
/src/utils/uint_seq.cpp
cab09195f792dc68c576db0b0e6f61f2c5504d13
[]
no_license
cxxcunow/mybit
767778d39436bc380f23b666848e40c50bf1a391
2ba822d8da60199c7bfe163be98bfe6bfb649c8e
refs/heads/master
2020-03-20T17:47:49.720089
2018-06-16T08:36:17
2018-06-16T08:36:17
137,565,967
0
0
null
null
null
null
UTF-8
C++
false
false
2,327
cpp
uint_seq.cpp
#include "uint_seq.h" #include "uitil.h" #include "stdio.h" #include "string.h" template <unsigned int BITS> base_seq<BITS>::base_seq(const std::vector<unsigned char>& vuc) { memcpy(data, vuc.data(), sizeof(data)); } template <unsigned int BITS> std::string base_seq<BITS>::GetHex() { return ::HexStr(std::reverse_iterator<const uint8_t*>(data + sizeof(data)), std::reverse_iterator<const uint8_t*>(data)); } template <unsigned int BITS> void base_seq<BITS>::SetHex(const char* psz) { memset(data, 0, sizeof(data)); // skip leading spaces while (isspace(*psz)) psz++; // skip 0x if (psz[0] == '0' && tolower(psz[1]) == 'x') psz += 2; // hex string to uint const char* pbegin = psz; while (::HexDigit(*psz) != -1) psz++; psz--; unsigned char* p1 = (unsigned char*)data; unsigned char* pend = p1 + Width; while (psz >= pbegin && p1 < pend) { *p1 = ::HexDigit(*psz--); if (psz >= pbegin) { *p1 |= ((unsigned char)::HexDigit(*psz--) << 4); p1++; } } } template <unsigned int BITS> void base_seq<BITS>::SetHex(const std::string& str) { SetHex(str.c_str()); } template <unsigned int BITS> std::string base_seq<BITS>::ToString() { return (GetHex()); } // Explicit instantiations for base_seq<160> template base_seq<160>::base_seq(const std::vector<unsigned char>&); template std::string base_seq<160>::GetHex(); template std::string base_seq<160>::ToString(); template void base_seq<160>::SetHex(const char*); template void base_seq<160>::SetHex(const std::string&); // Explicit instantiations for base_seq<256> template base_seq<256>::base_seq(const std::vector<unsigned char>&); template std::string base_seq<256>::GetHex(); template std::string base_seq<256>::ToString(); template void base_seq<256>::SetHex(const char*); template void base_seq<256>::SetHex(const std::string&); // Explicit instantiations for base_seq<512> template base_seq<512>::base_seq(const std::vector<unsigned char>&); template std::string base_seq<512>::GetHex(); template std::string base_seq<512>::ToString(); template void base_seq<512>::SetHex(const char*); template void base_seq<512>::SetHex(const std::string&);
23b951385e2425d236f57f50241a53b6b27a1316
508b3822cb78b4e9f20d8bdcd16a3a14338b9336
/CavaEngine/Engine/BaseObject.cpp
0c0e53651ad36f6643216ce767317c3284b3e743
[]
no_license
hittoSepi/CavaEngine
30d4873f9eca605a56699ef5c2b175b14fc58c81
65c82100076f0f3d90c6f7f8ad717c0baef6b85c
refs/heads/master
2023-07-05T07:45:20.040967
2021-08-29T09:31:50
2021-08-29T09:31:50
396,976,975
0
0
null
null
null
null
UTF-8
C++
false
false
242
cpp
BaseObject.cpp
#include "Core/Cava.h" #include "Engine/BaseObject.h" namespace Cava { BaseObject::BaseObject() { LogError("Don't use with default constructor!"); } BaseObject::BaseObject(std::string name) { id = Engine::GetId(name); } }
8fa5126babad435a630a6ec1cd69512dcae58b3c
f979deecf55ce316483d170762ba2731dd241f89
/include/plane_detector/plane_detector.hpp
e35500f8e0a8ac58d095b160844d1fd92e184b6a
[ "MIT" ]
permissive
robotics-upo/plane_detector
2334f243c3ce2fe75d5c7fdcb36d361c4ecd491c
fda2e7b76103263a0800d43a073bfeb59673b8d3
refs/heads/master
2022-02-05T09:23:19.038448
2022-01-27T11:03:02
2022-01-27T11:03:02
139,177,385
58
10
null
null
null
null
UTF-8
C++
false
false
12,109
hpp
plane_detector.hpp
#ifndef PLANE_DETECTOR__ #define PLANE_DETECTOR__ #include <vector> #include <random> #include <queue> #include "detected_plane.hpp" #include <eigen3/Eigen/Geometry> #include <eigen3/Eigen/Eigenvalues> #include <boost/array.hpp> #include <boost/thread.hpp> #include <exception> #include <opencv2/opencv.hpp> #include <iostream> #define __MIN_RANGE__ 0.3 #define __MAX_RANGE__ 10.0 struct UnknownDepthException:public std::exception { const char *what() const throw() { return "Unknown Depth Exception"; } }; enum PixelStatus { UNPROCESSED = -3, IN_R_PRIMA, IN_QUEUE }; //! @class PlaneDetector //! @brief Implements a fast plane detector on RGB-D images as presented in Poppinga IROS 2008 class PlaneDetector { public: //! Recommended constructor PlaneDetector(double delta = 1.0, double epsilon = 1.0, double gamma = 10.0, int theta = 1000, double _std_dev = 0.03); //! @brief Detects the planes inside the image int detectPlanes(const cv::Mat &depth); inline std::vector<DetectedPlane> getPlanes() const { return _detected_planes; } void resetStatus(); inline int getPos(int i, int j) const { return i + j * _width; } void setCameraParameters(const boost::array< double, 9 >& k_); inline void setCameraParameters(const float focal_length, const float cx, const float cy) { _kx = 1 / focal_length; _ky = 1 / focal_length; _cx = cx; _cy = cy; _initialized = true; } inline bool isInitialized() {return _initialized;} inline void setFloatImage(bool new_value) {_float_image = new_value;} protected: // Parameters from the paper Poppinga: double _delta; // Maximum neighbor distance (0.2 is OK) double _epsilon; // Maximum MSE (1e-4) double _gamma; // Maximum distance to plane int _theta; // Minimum number of points of the segmented plane std::vector <DetectedPlane> _detected_planes; // Vector de IDs std::vector <int> _detected_ids; // Contiene todos los IDs que son considerados planos std::vector<int> _status_vec; // Relaciona los puntos de la imagen con una region std::queue<int> _q; int _available_pixels; bool _initialized; bool _downsample; double _std_dev; cv::Mat _image; std::vector<int> _curr_region; // Saves the region in coordinates --> i + j * _height DetectedPlane _curr_plane; // Internal stuff for update Matrices Eigen::SelfAdjointEigenSolver<Eigen::Matrix3d> _es; DetectedPlane _p; // Attributes of the image int _width, _height; bool _float_image; // Camera parameters Eigen::Matrix3d _K; float _kx, _cx, _ky , _cy; // Taken from camera parameters std::vector<Eigen::Vector3d> _color; int getRandomPixel(int region = (int)UNPROCESSED) const; //! @brief Gets the unprocessed nearest neighbor of the image int getNearestNeighbor(int index) const; //! @brief Gets the amount of available pixels in image int availablePixels() const; // For random numbers static std::default_random_engine generator; //! @brief Adds pixels to region and adds its nearest neighbors to the queue (modifying status_vec) void addPixelToRegion(int index, int _curr_region_id); Eigen::Vector3d get3DPoint(int i, int j) const; Eigen::Vector3d get3DPoint(int index) const; //! @brief Gets the depth of a depth image //! @return THe depth value or -1.0 if the data is not valid double getDepth(int i, int j) const; //! @brief updates s_g, m_k, p_k and MSE //! @retval true The conditions of step 8 of the matrix (see [1]) are met --> the matrices are updated bool updateMatrices(const Eigen::Vector3d &v); //! @brief Initialize the color matrix void initializeColors(); }; std::default_random_engine PlaneDetector::generator; PlaneDetector::PlaneDetector(double delta, double epsilon, double gamma, int theta, double _std_dev): _delta(delta), _epsilon(epsilon), _gamma(gamma), _theta(theta),_initialized(false), _downsample(true),_std_dev(_std_dev) { initializeColors(); } void PlaneDetector::initializeColors() { // Different colors for planes Eigen::Vector3d v; v(0) = 0.0; v(1) = 1.0; v(2) = 0.0; _color.push_back(v); v(0) = 1.0; v(1) = 0.0; v(2) = 0.0; _color.push_back(v); v(0) = 0.0; v(1) = 0.0; v(2) = 1.0; _color.push_back(v); v(0) = 0.0; v(1) = 1.0; v(2) = 1.0; _color.push_back(v); v(0) = 1.0; v(1) = 0.0; v(2) = 1.0; _color.push_back(v); v(0) = 1.0; v(1) = 1.0; v(2) = 0.0; _color.push_back(v); } int PlaneDetector::detectPlanes(const cv::Mat& image) { if (!_initialized) { // The camera parameters have to be set before detecting planes return 0; } // First: get parameters of the image (MUST BE AT THE FIRST) _width = image.cols; _height = image.rows; this->_image = image; // TODO: será lento? if (_downsample) { _width /= 2; _height /= 2; } // All internal status to zero or proper values resetStatus(); _q.empty(); int _curr_region_id = 0; _available_pixels = availablePixels(); while (_available_pixels > _theta * 1.1) { // std::cout << "Available pixels: " << _available_pixels << std::endl; _curr_region.clear(); // Initialization of the algorithm--> random point and nearest neighbor int candidate = getRandomPixel(); int nearest = getNearestNeighbor(candidate); if (nearest > 0) { _status_vec[nearest] = _curr_region_id; addPixelToRegion(candidate, _curr_region_id); addPixelToRegion(nearest, _curr_region_id); // Initialize matrices and vectors Eigen::Vector3d r_1 = get3DPoint(candidate); Eigen::Vector3d r_2 = get3DPoint(nearest); _curr_plane.s_g = r_1 + r_2; _curr_plane.m_k = (r_1 - _curr_plane.s_g * 0.5)*(r_1 - _curr_plane.s_g * 0.5).transpose(); _curr_plane.m_k += (r_2 - _curr_plane.s_g * 0.5)*(r_2 - _curr_plane.s_g * 0.5).transpose(); _curr_plane.p_k = r_1 * r_1.transpose() + r_2*r_2.transpose(); _curr_plane.n_points = 2; while (!_q.empty()) { int new_point = _q.front(); _q.pop(); Eigen::Vector3d v = get3DPoint(new_point); if (updateMatrices(v)) { addPixelToRegion(new_point, _curr_region_id); } else { _available_pixels--; } } // The queue has been emptied --> clear possible QUEUE status and add the region to the detected planes if condition of step 12 (Algorithm 1) if (_curr_region.size() > _theta) { _curr_plane.makeDPositive(); _curr_plane.calculateCovariance(_std_dev); // std::cout << "Detected plane: " << _curr_plane.toString() << std::endl; _detected_planes.push_back(_curr_plane); _detected_ids.push_back(_curr_region_id); } _curr_region_id++; // The next plane will have a new identificator } else { // No nearest neighbor available --> discard (to R_PRIMA) _status_vec[candidate] = (int)IN_R_PRIMA; _available_pixels--; } } return _detected_planes.size(); } void PlaneDetector::resetStatus() { if (_status_vec.size() != _width*_height) { _status_vec.resize(_width*_height); } for (size_t i = 0; i < _width; i++) { for (size_t j = 0; j < _height; j++) { if (getDepth(i, j) > 0.0) { _status_vec[getPos(i,j)] = (int)UNPROCESSED; } else { _status_vec[getPos(i,j)] = (int)IN_R_PRIMA; } } } _p.init(); _curr_plane.init(); _detected_planes.clear(); _detected_ids.clear(); } int PlaneDetector::getRandomPixel(int region) const { std::uniform_int_distribution<int> distribution(0, _height * _width - 1); int ret_val; do { ret_val = distribution(generator); } while (_status_vec[ret_val] != region); return ret_val; } //! Gets the unprocessed nearest neighbor of a pixel in a window of size 9 int PlaneDetector::getNearestNeighbor(int index) const { int near = -1; int aux; float min_dist = 1e10; Eigen::Vector3d v = get3DPoint(index); Eigen::Vector3d v_; for (int i = -1; i < 2; i++) { for (int j = -1; j < 2; j++) { if (i != 0 || j != 0) { aux = index + i + j * _width; if (aux > 0 && aux < _height * _width) { // Check bounds if (_status_vec[aux] == (int)UNPROCESSED) { v_ = get3DPoint(aux); double dist = (v - v_).norm(); if (dist < min_dist) { near = aux; min_dist = dist; } } } } } } return near; } int PlaneDetector::availablePixels() const { bool ret_val = false; int cont = 0; //TODO: Uncomment for (int i = 0; i < _width * _height /*&& cont < _theta*/; i++) { if (_status_vec[i] == (int)UNPROCESSED) cont++; } // std::cout << "availablePixels() --> cont = " << cont << std::endl; return cont; } void PlaneDetector::setCameraParameters(const boost::array< double, 9 >& k_) { for (int i = 0; i < 3;i++) { for (int j = 0; j < 3; j++) { _K(i,j) = k_[i*3 + j]; } } _kx = 1.0/_K(0,0); _cx = _K(0,2); _ky = 1.0/_K(1,1); _cy = _K(1,2); _initialized = true; } double PlaneDetector::getDepth(int i, int j) const { double ret_val = -1.0; if (_downsample) { i *= 2; j *= 2; } if (i >= _image.cols || j >= _image.rows) return -1.0; // std::cout << "Data: " << cvbDepth->image.at<float>(i,j) << " "; if(_float_image) ret_val = _image.at<float>(j, i); /// CAUTION!!!! the indices in cv::Mat are row, cols (elsewhere cols, rows) else ret_val = _image.at<u_int16_t>(j, i)*0.001; if(ret_val < __MIN_RANGE__ || ret_val > __MAX_RANGE__) { ret_val = -1.0; } return ret_val; } Eigen::Vector3d PlaneDetector::get3DPoint(int i, int j) const { Eigen::Vector3d pt; pt[2] = getDepth(i, j); if (_downsample) { i *= 2; j *= 2; } if(pt[2] > __MIN_RANGE__ && pt[2] < __MAX_RANGE__) { pt[0] = (float)(i - _cx) * pt[2] * _kx; pt[1] = (float)(j - _cy) * pt[2] * _ky; } else { throw UnknownDepthException(); } return pt; } Eigen::Vector3d PlaneDetector::get3DPoint(int index) const { return get3DPoint(index%_width, index/_width); } void PlaneDetector::addPixelToRegion(int index, int _curr_region_id) { _status_vec[index] = _curr_region_id; _curr_region.push_back(index); Eigen::Vector3d v = get3DPoint(index); _available_pixels--; int neighbor = getNearestNeighbor(index); while (neighbor >= 0) { Eigen::Vector3d v_2 = get3DPoint(neighbor); if ( (v-v_2).norm() < _delta) { // First check --> the neighbor is sufficiently near to the point _status_vec[neighbor] = (int)IN_QUEUE; _q.push(neighbor); neighbor = getNearestNeighbor(index); } else { neighbor = -1; } } } bool PlaneDetector::updateMatrices(const Eigen::Vector3d& v) { size_t k = _curr_region.size(); double div_1 = 1.0 / (double)(k + 1); double div = 1.0 / (double)(k); _p.s_g = _curr_plane.s_g + v; _p.m_k = _curr_plane.m_k + v*v.transpose() - (_p.s_g * div_1)*_p.s_g.transpose() + (_curr_plane.s_g * div) * _curr_plane.s_g.transpose(); _p.p_k = _curr_plane.p_k + v*v.transpose(); // Calculate d and n (n is the eigenvector related to the lowest eigenvalue) _es.compute(_p.m_k); double min_eigenval = 1e10; int min_i; for (int i = 0; i < 3; i++) { double curr_eigen = fabs(_es.eigenvalues()(i)); if (curr_eigen < min_eigenval) { min_eigenval = curr_eigen; min_i = i; } } _p.v = _es.eigenvectors().col(min_i); _p.d = div_1 * _p.v.dot(_p.s_g); // Update the MSE (Eq 3) _p.mse = div_1 * _p.v.transpose() * _p.p_k * _p.v - 2 * _p.v.dot(_p.s_g) * _p.d * div_1 + _p.d * _p.d; _p.n_points = k + 1; // Check if the new plane meets the constraint of algorithm 1 step 8. If so, update the values of the matrices of the class if (_p.mse < _epsilon && _p.distance(v) < _gamma) { // Meets the constraints --> Actualize the plane _p.r_g = _p.s_g * div_1; _curr_plane = _p; return true; } return false; } #endif
3771812d4f074136ed418f21c0402fc9e85d4cb7
f662401bbb2bc91f1a28e831e5fe476258404cca
/Estructuras de datos y Técnicas algorítmicas/Árboles de búsqueda avanzados/3. Rango de claves en un árbol binario de búsqueda/TreeMapRango.h
edc8fb1a70e2ee736b970cfea0c60564c2041ced
[]
no_license
Joncarre/CPlusPlus-language
4b1ff82d3986085293453bdfd406fa7daf98a54e
56a7c274e4907e188ef25c732221836176a9215b
refs/heads/master
2023-02-07T23:38:02.247708
2023-02-03T19:13:39
2023-02-03T19:13:39
95,282,321
0
0
null
null
null
null
UTF-8
C++
false
false
1,860
h
TreeMapRango.h
// // TreeMapRango.h // // Extensión de tablas <clave, valor> como árboles de búsqueda AVL // con una operación para consultar las claves en un rango // #ifndef TREEMAPRANGO_H_ #define TREEMAPRANGO_H_ #include <vector> #include "TreeMap_AVL.h" template <typename Clave, typename Valor, typename Comparador = std::less<Clave>> class TreeMapRango : public TreeMap<Clave, Valor, Comparador> { public: TreeMapRango(Comparador c = Comparador()) : TreeMap<Clave, Valor, Comparador>(c) {}; std::vector<Clave> rango(Clave const& k1, Clave const& k2) const { // Lista vacía. std::vector<Clave> lista; // Rango. rango(k1, k2, this->raiz, lista); return lista; } protected: using TreeNode = typename TreeMap<Clave, Valor, Comparador>::TreeNode; using Link = TreeNode *; /* * Función que realiza las podas necesarias para ir encontrando los elementos que estén * dentro del intervalo que hayamos establecido con k1 y k2. Además, si el elemento está * en ese intervalo, lo introduce en el vector (lista). Su complejidad viene dada por el tamaño * del árbol pero no será lineal ya que la poda permite reducir esa complejidad. * * Complejidad: O(log n) */ void rango(Clave const& k1, Clave const& k2, Link a, std::vector<Clave> & lista) const { // Raíz no es vacío. if (a!=nullptr){ // Si clave < k1 entonces podamos hijo_Iz. if (this->menor(a->cv.clave, k1)){ rango(k1, k2, a->dr, lista); }// Si Clave > k2 entonces podamos hijo_Dr. else if (this->menor(k2, a->cv.clave)){ rango(k1, k2, a->iz, lista); } else { // Si esta en el Rango. rango(k1, k2, a->iz, lista); lista.push_back(a->cv.clave); rango(k1, k2, a->dr, lista); } } } }; #endif /* TREEMAPRANGO_H_ */
9059719a6a007d810fd883088ee7f552186271b6
47de94fb364e9c5e7ef07c3d5a9529a7420d7e1c
/greedy/CF519C.cpp
435195aed98ae94658f016c569149b1ca979a12f
[]
no_license
Dainerx/Competitive-programming
5490c4acf2f82f5aa88955b5ab38083a7846b376
edb9757681d8c241b5b7c523591c1136e4ac9008
refs/heads/master
2021-01-19T22:05:40.931873
2019-05-21T15:37:07
2019-05-21T15:37:07
88,751,997
6
1
null
null
null
null
UTF-8
C++
false
false
1,290
cpp
CF519C.cpp
#include <algorithm> #include <vector> #include <iostream> #include <fstream> #include <string> #include <stdio.h> #include <cmath> #include <complex> #include <math.h> #include <string> #include <string.h> #include<ctype.h> #include <map> #include <set> #include <numeric> using namespace std; #define MAX(a,b,c) max(a,max(b,c)) #define MIN(a,b,c) min(a,min(b,c)) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define FORJ(j,a,b) for(int j=(a);j<(b);j++) #define REV(i,b,a) for(int i=(a);i>=(b);i--) #define mp make_pair #define pb push_back unsigned int calc(unsigned int n, unsigned int m) { unsigned int counter = 0; while (n >= 1 && m >= 2 || n >= 2 && m >= 1) { //While I have not exhausted all my ressources keep going. //Greedy perspective of picking which side I'm opting for if (n > m) { n-= 2; m--; counter++; } else if (m > n) { n--; m-=2; counter++; } else { //Since they share the same order of importance we go with what so ever. n--; m -= 2; counter++; } } return counter; } int main() { //signed is better here unsigned int n, m; scanf("%i %i", &n, &m); cout << calc(n, m); return 0; }
b992d6a5346dfbc36c6b06ef1623d89a762407df
fc30dbc3a456aa4c309eb80a13fc2c1b998f4f42
/Sorts, heap, binsearch/Количество инверсий.cpp
3f12bdfcdd51a79e7803ae3b40e0b048f48c8c7e
[]
no_license
Konstantin343/Algorithms-ITMO
3121887d60d7fc937e645aa35f33b8d0b32c6f20
883a4a725d35edbe6c50cba9cceda5a934a09576
refs/heads/master
2020-05-17T20:26:17.950991
2019-05-31T20:42:14
2019-05-31T20:42:14
183,945,261
1
0
null
null
null
null
UTF-8
C++
false
false
967
cpp
Количество инверсий.cpp
#include <iostream> using namespace std; int a[500000]; long long t = 0; void merge (int left, int middle, int right) { int res[500000]; if(a[middle] > a[middle + 1] && (right-left) % 2 == 1) middle++; int i = left, j = middle; while (i < middle || j < right) { if (a[i] < a[j] && i != middle || j == right) { res[i + j - middle] = a[i]; i++; } else { if(a[j] < a[i]) t+= (middle - i); res[i + j - middle] = a[j]; j++; } } for (int t = left; t < right; t++) a[t] = res [t]; } void mergeSort (int b, int e) { if (e - b < 2) { return; } else { mergeSort(b, (b + e) / 2); mergeSort((b + e) / 2, e); merge(b, (b + e) / 2, e); } } int main() { int n; cin >> n; for (int i = 0; i < n; i++) { cin >> a[i]; } mergeSort(0, n); cout << t; return 0; }
70f830edd9afdf341ea64fa30c208e2b740f17f2
b6d2cb74a76194fd25fdc3607ef828e94d98039e
/Codeforces/870C.cpp
1b58d7a771215e95d7edb9ee14bc2871d7f41536
[]
no_license
giovaneaf/CompetitiveProgramming
22d63481015ab45a03d527c866cae339cffeb5fb
863f6bc61497591cb98e50973aa23bfcb9879ab8
refs/heads/master
2021-06-07T20:28:45.116299
2021-05-25T00:38:16
2021-05-25T00:38:16
131,643,425
6
1
null
null
null
null
UTF-8
C++
false
false
823
cpp
870C.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef pair<int, bool> ib; #define FOR(a, b, c) for(int a = b; a < c; ++a) #define RFOR(a, b, c) for(int a = b; a >= c; --a) #define mp(a, b) make_pair(a, b) #define all(v) v.begin(), v.end() #define ii pair<int, int> #define vi vector<int> #define vii vector<ii> #define vvi vector<vi> #define vb vector<bool> #define fst first #define snd second #define MAXN 10010 #define LOGMAXN 20 #define MAXM 100010 #define INF 0x3f3f3f3f #define INFLL 0x3f3f3f3f3f3f3f3f #define EPS 1e-9 int main() { ios_base::sync_with_stdio(false); cin.tie(0); int q; cin >> q; while(q--) { int n; cin >> n; if(n <= 3 || n == 5 || n == 7 || n == 11) printf("-1\n"); else printf("%d\n", n/4 - ((n&1) ? 1 : 0)); } return 0; }
f6f115fdd2e69b6d79c5f0e907a69a97966465f1
bd91a68c3ed8072ae292191b50bea3349b2f55bc
/ASTNodes/HatOp.cpp
92d4fb8413d22d3b8ec8c5a544fbba6a6f0ee895
[ "MIT" ]
permissive
jonathan-beard/Raft
0e28d5ea72e840441b2f42f46b45ec2f5b08371e
6b2c250c915b5ce1db84277e6e5722977e8ebbba
refs/heads/master
2021-01-17T05:24:36.314552
2019-04-23T16:03:09
2019-04-23T16:03:09
8,226,622
6
1
null
null
null
null
UTF-8
C++
false
false
312
cpp
HatOp.cpp
/** * HatOp.cpp - * @author: Jonathan Beard * @version: Tue Feb 11 12:51:41 2014 */ #include "HatOp.hpp" using namespace Node; HatOp::HatOp() : BitOperation( "HatOp" ) { class_tree.addRelation( typeid( Node::BitOperation ).hash_code(), typeid( Node::HatOp ).hash_code() ); }
c7b040421e8ff56944aff6a8647bc1d99d63d97a
e7f68328593453d949f382f52b323d6a9bf7499d
/EUVanguardTIOWAddonML700AceCompat/Cfgweapons.hpp
b5b8bdb1e9ece08abdd3b728b4b5181cf06af58b
[]
no_license
OnkelDolf/EUVanguardTIOWAddonML700Compat
e848fedc30830536e41f63719e4f728683a5c037
b9cb2690dc0e939e6c843054e5a1bf6e0851907d
refs/heads/master
2020-08-30T08:37:33.723363
2020-01-01T00:34:10
2020-01-01T00:34:10
218,321,072
0
0
null
null
null
null
UTF-8
C++
false
false
78,482
hpp
Cfgweapons.hpp
// Generated by unRap v1.06 by Kegetys class Cfgweapons { class InventoryItem_Base_F; // External class reference class ItemCore; // External class reference class UniformItem; // External class reference class HeadgearItem; // External class reference class VestItem; // External class reference class Rifle; // External class reference class Rifle_Base_F : Rifle { class weaponSlotsInfo; // External class reference class GunParticles; // External class reference }; class UGL_F; // External class reference ////////////////////////////////////////////////////////////////////////////////////// //TODO: Balance out the space marines so a Lucius pattern lasgun can't one shot them// ////////////////////////////////////////////////////////////////////////////////////// /* class SM_Gear : ItemCore { scope = 0; allowedSlots[] = {BACKPACK_SLOT}; hiddenSelections[] = {"camo"}; class ItemInfo : VestItem { hiddenSelections[] = {"camo"}; LOAD[] = {(0,0)}; }; }; class TIOW_Mk7Vest : SM_Gear { // For more info go to https://community.bistudio.com/wiki/Arma_3_Soldier_Protection class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; // reference to the hit point class defined in the man base class pen = 0.4; // Mod exclusive caculation armor = 250; // addition to armor of referenced hitpoint passThrough = 0.1; // multiplier of base passThrough defined in referenced hitpoint }; class Arms { hitpointName = "HitArms"; pen = 0.4; // Mod exclusive caculation armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; pen = 0.4; // Mod exclusive caculation armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; pen = 0.4; // Mod exclusive caculation armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; pen = 0.4; // Mod exclusive caculation armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; pen = 0.4; // Mod exclusive caculation armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; pen = 0.4; // Mod exclusive caculation armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_UM : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_IF : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_BA : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_BR : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_SL : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_RG : TIOW_Mk7Vest { class ItemInfo : ItemInfo { mass = 100; class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_IH : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_WS : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_DA : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_SW : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_WB : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_IW : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_BL : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_WE : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_EC : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_AL : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_TS : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_NL : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class TIOW_Mk7Limbs_DG : TIOW_Mk7Vest { class ItemInfo : ItemInfo { class HitpointsProtectionInfo { class Neck { hitpointName = "HitNeck"; armor = 250; passThrough = 0.1; }; class Arms { hitpointName = "HitArms"; armor = 100; passThrough = 0.1; }; class Chest { hitpointName = "HitChest"; armor = 250; passThrough = 0.1; }; class Diaphragm { hitpointName = "HitDiaphragm"; armor = 250; passThrough = 0.1; }; class Abdomen { hitpointName = "HitAbdomen"; armor = 100; passThrough = 0.1; }; class Pelvis { hitpointName = "HitPelvis"; armor = 100; passThrough = 0.1; }; class Body { hitpointName = "HitBody"; armor = 100; passThrough = 0.1; }; }; }; }; class SM_Helm_Base : ItemCore { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_UM : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_UM : TIOW_MK7Helmet_UM { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_IF : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_IF : TIOW_MK7Helmet_IF { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_BA : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_BA : TIOW_MK7Helmet_BA { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_BR : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_BR : TIOW_MK7Helmet_BR { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_SL : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_SL : TIOW_MK7Helmet_SL { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_RG : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_RG : TIOW_MK7Helmet_RG { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_IH : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_IH : TIOW_MK7Helmet_IH { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_WS : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_WS : TIOW_MK7Helmet_WS { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_DA : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_DA : TIOW_MK7Helmet_DA { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_SW : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_SW : TIOW_MK7Helmet_SW { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_WB : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_WB : TIOW_MK7Helmet_WB { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_IW : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet2_IW : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_IW : TIOW_MK7Helmet_IW { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_BL : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_BL : TIOW_MK7Helmet_BL { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_WE : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_WE : TIOW_MK7Helmet_WE { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_EC : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_EC : TIOW_MK7Helmet_EC { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_AL : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_AL : TIOW_MK7Helmet_AL { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_TS : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_TS : TIOW_MK7Helmet_TS { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_NL : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_NL : TIOW_MK7Helmet_NL { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK7Helmet_DG : SM_Helm_Base { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; class TIOW_MK4Helmet_DG : TIOW_MK7Helmet_DG { class ItemInfo : HeadgearItem { class HitpointsProtectionInfo { class Head { hitpointName = "HitHead"; armor = 45; passThrough = 0.1; }; }; }; }; */ class Rifle; class Rifle_Base_F: Rifle { class WeaponSlotsInfo; class GunParticles; }; class UGL_F; class ItemCore; class InventoryItem_Base_F; class InventoryOpticsItem_Base_F; class InventoryMuzzleItem_Base_F; class InventoryUnderItem_Base_F; class MuzzleSlot; class CowsSlot; class PointerSlot; class UnderBarrelSlot; class hgun_ACPC2_F; class KriegHeavyStubber: Rifle_Base_F { scope=1; scopeArsenal=1; scopeCurator=1; magazineWells[]={}; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { compatibleItems[]={}; iconPosition[]={0,0.45}; iconScale=0.2; iconPicture="\A3\Weapons_F\Data\UI\attachment_muzzle.paa"; iconPinpoint="Center"; }; class CowsSlot: CowsSlot { iconPosition[]={0.5,0.35}; compatibleItems[]={}; iconScale=0.2; }; class PointerSlot: PointerSlot { iconPosition[]={0.2,0.45}; compatibleItems[]={}; iconScale=0.25; }; class UnderBarrelSlot: UnderBarrelSlot { linkProxy="\A3\Data_f_Mark\proxies\weapon_slots\UNDERBARREL"; iconPosition[]={0.2,0.7}; iconScale=0.2; compatibleItems[]= { "KriegHeavyStubberDK_Bipod" }; }; mass=175; }; caseless[]= { "", 1, 1, 1 }; model="\TIOW_AutoWeapons\Model\Krieg_Heavy_Stubber.p3d"; soundBullet[]= { "caseless", 1 }; drySound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\dry_Mx", 0.56234097, 1, 10 }; reloadMagazineSound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Reload_MX", 1, 1, 10 }; changeFiremodeSound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\firemode_Mx", 0.177828, 1, 5 }; modes[]= { "Single", "FullAuto", "fullauto_medium", "single_medium_optics1", "single_far_optics2" }; class Single: Mode_SemiAuto { dispersion=0.00035; soundContinuous=0; reloadTime=0.4; recoil="recoil_single_gm6"; recoilProne="recoil_single_prone_gm6"; sounds[]= { "StandardSound", "SilencedSound" }; class BaseSoundModeType { closure1[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 0.39810699, 1, 40 }; closure2[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_02", 0.39810699, 1, 40 }; soundClosure[]= { "closure1", 0.5, "closure2", 0.5 }; }; class StandardSound: BaseSoundModeType { begin1[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_short_01", 7.9432802, 1, 2200 }; begin2[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_short_02", 7.9432802, 1, 2200 }; soundBegin[]= { "begin1", 0.5, "begin2", 0.5 }; class SoundTails { class TailForest { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_tail_forest", 1, 1, 2200 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailHouses { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_tail_houses", 1, 1, 2200 }; frequency=1; volume="(1-interior/1.4)*houses"; }; class TailInterior { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_tail_interior", 1.99526, 1, 2200 }; frequency=1; volume="interior"; }; class TailMeadows { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_tail_meadows", 1, 1, 2200 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailTrees { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_tail_trees", 1, 1, 2200 }; frequency=1; volume="(1-interior/1.4)*trees"; }; }; soundSetShot[]= { "GM6Lynx_Shot_SoundSet", "GM6Lynx_Tail_SoundSet", "GM6Lynx_InteriorTail_SoundSet" }; }; class SilencedSound: BaseSoundModeType { soundSetShot[]= { "MX_silencerShot_SoundSet", "MX_silencerTail_SoundSet" }; begin1[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_short_01", 0.79432797, 1, 400 }; begin2[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_short_02", 0.79432797, 1, 400 }; begin3[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_short_03", 0.79432797, 1, 400 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin1", 0.34 }; class SoundTails { class TailInterior { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_tail_interior", 1, 1, 400 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_trees", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_forest", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_meadows", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_houses", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; }; }; class FullAuto: Mode_FullAuto { soundContinuous=0; soundBurst=0; sounds[]= { "StandardSound", "SilencedSound" }; class BaseSoundModeType { closure1[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 0.316228, 1, 10 }; closure2[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_02", 0.316228, 1.1, 10 }; soundClosure[]= { "closure1", 0.5, "closure2", 0.5 }; soundSet=""; }; class StandardSound: BaseSoundModeType { soundSetShot[]= { "GM6Lynx_Shot_SoundSet", "GM6Lynx_Tail_SoundSet", "GM6Lynx_InteriorTail_SoundSet" }; begin1[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 3.1622801, 1, 1800 }; begin2[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_02", 3.1622801, 1, 1800 }; begin3[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 3.1622801, 1, 1800 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin1", 0.34 }; class SoundTails { class TailInterior { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 1.58489, 1, 1800 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "A3\Sounds_F\arsenal\weapons\LongRangeRifles\GM6_Lynx\GM6_closure_01", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; }; class SilencedSound: BaseSoundModeType { soundSetShot[]= { "MX_silencerShot_SoundSet", "MX_silencerTail_SoundSet" }; begin1[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_short_01", 0.79432797, 1, 400 }; begin2[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_short_02", 0.79432797, 1, 400 }; begin3[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_short_03", 0.79432797, 1, 400 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin1", 0.34 }; class SoundTails { class TailInterior { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_Mx_tail_interior", 1, 1, 400 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_trees", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_forest", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_meadows", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Silencer_mx_tail_houses", 1, 1, 400 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; }; reloadTime=0.096; dispersion=0.00087; recoil="recoil_auto_mx"; recoilProne="recoil_auto_prone_mx"; minRange=0; minRangeProbab=0.89999998; midRange=15; midRangeProbab=0.69999999; maxRange=1250; maxRangeProbab=0.1; aiRateOfFire=3; }; magazines[]= { "TIOW_50Rnd_Stubber_mag", "TIOW_50Rnd_Stubber_mag_Tracer", "TIOW_50Rnd_Stubber_amput", "TIOW_50Rnd_Stubber_manstop", "TIOW_50Rnd_Stubber_expander", "TIOW_100Rnd_Stubber_mag", "TIOW_100Rnd_Stubber_mag_Tracer", "TIOW_100Rnd_Stubber_amput", "TIOW_100Rnd_Stubber_manstop", "TIOW_100Rnd_Stubber_expander", "TIOW_150Rnd_Stubber_mag", "TIOW_150Rnd_Stubber_mag_Tracer", "TIOW_150Rnd_Stubber_amput", "TIOW_150Rnd_Stubber_manstop", "TIOW_150Rnd_Stubber_expander" }; class Library { libTextDesc=""; }; reloadAction="GestureReloadMX"; picture="\A3\weapons_F\Rifles\MX\data\UI\gear_mx_lmg_X_CA.paa"; UiPicture="\A3\weapons_f\data\UI\icon_MG_CA.paa"; recoil="recoil_mx"; maxZeroing=1000; discreteDistanceInitIndex=0; maxRecoilSway=0.0125; swayDecaySpeed=1.25; class GunParticles: GunParticles { class SecondEffect { positionName="Nabojnicestart"; directionName="Nabojniceend"; effectName="CaselessAmmoCloud"; }; }; distanceZoomMin=300; distanceZoomMax=300; descriptionShort=""; handAnim[]= { "OFP2_ManSkeleton", "\A3\Weapons_F\Rifles\Khaybar\data\anim\katiba_gl.rtm" }; class fullauto_medium: FullAuto { showToPlayer=0; burst=5; minRange=2; minRangeProbab=0.5; midRange=75; midRangeProbab=0.7; maxRange=1500; maxRangeProbab=0.05; aiRateOfFire=2; aiRateOfFireDistance=500; }; class single_medium_optics1: Single { requiredOpticType=1; showToPlayer=0; minRange=1; minRangeProbab=0.2; midRange=2; midRangeProbab=0.7; maxRange=3; maxRangeProbab=0.2; aiRateOfFire=3; aiRateOfFireDistance=600; }; class single_far_optics2: single_medium_optics1 { requiredOpticType=2; showToPlayer=0; minRange=1; minRangeProbab=0.1; midRange=2; midRangeProbab=0.6; maxRange=3; maxRangeProbab=0.05; aiRateOfFire=4; aiRateOfFireDistance=700; }; aiDispersionCoefY=6; aiDispersionCoefX=4; }; class Pistol; class Pistol_Base_F: Pistol { class WeaponSlotsInfo; }; class Rifle; class Rifle_Base_F: Rifle { class WeaponSlotsInfo; class GunParticles; }; class UGL_F; class Launcher; class Launcher_Base_F: Launcher { class WeaponSlotsInfo; }; class ItemCore; class InventoryItem_Base_F; class InventoryOpticsItem_Base_F; class Type14Heavy; class TIOW_SM_Ragefire_PlasmaGun; class DK_PlasmaGun; class arifle_MX_Base_F: Rifle_Base_F { author="$STR_A3_Bohemia_Interactive"; _generalMacro="lasgunbase"; magazines[]= { "30Rnd_65x39_caseless_mag", "30Rnd_65x39_caseless_mag_Tracer" }; class Library { libTextDesc="$STR_A3_CfgWeapons_arifle_XMX_Library0"; }; reloadAction="GestureReloadMX"; recoil="recoil_mx"; maxZeroing=1000; discreteDistanceInitIndex=0; maxRecoilSway=0.0125; swayDecaySpeed=1.25; class GunParticles: GunParticles { class SecondEffect { positionName="Nabojnicestart"; directionName="Nabojniceend"; effectName="CaselessAmmoCloud"; }; }; class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { linkProxy="\A3\data_f\proxies\weapon_slots\MUZZLE"; compatibleItems[]= { "muzzle_snds_h" }; iconPosition[]={0,0.45}; iconScale=0.2; }; class CowsSlot: CowsSlot { iconPosition[]={0.5,0.35}; iconScale=0.2; }; class PointerSlot: PointerSlot { iconPosition[]={0.2,0.45}; iconScale=0.25; }; }; distanceZoomMin=300; distanceZoomMax=300; descriptionShort="$STR_A3_CfgWeapons_XM_base_F0"; handAnim[]= { "OFP2_ManSkeleton", "\A3\Weapons_F\Rifles\MX\data\Anim\mx.rtm" }; modes[]= { "Single", "FullAuto", "fullauto_medium", "single_medium_optics1", "single_far_optics2" }; class Single: Mode_SemiAuto { reloadTime=0.096; recoil="recoil_single_mx"; recoilProne="recoil_single_prone_mx"; dispersion=0.00087; minRange=2; minRangeProbab=0.5; midRange=200; midRangeProbab=0.7; maxRange=400; maxRangeProbab=0.3; }; class FullAuto: Mode_FullAuto { reloadTime=0.096; dispersion=0.00087; recoil="recoil_auto_mx"; recoilProne="recoil_auto_prone_mx"; minRange=0; minRangeProbab=0.8; midRange=15; midRangeProbab=0.7; maxRange=30; maxRangeProbab=0.1; aiRateOfFire=1e-006; }; class fullauto_medium: FullAuto { showToPlayer=0; burst=3; aiBurstTerminable=1; minRange=2; minRangeProbab=0.5; midRange=75; midRangeProbab=0.7; maxRange=150; maxRangeProbab=0.05; aiRateOfFire=2; aiRateOfFireDistance=200; }; class single_medium_optics1: Single { requiredOpticType=1; showToPlayer=0; minRange=2; minRangeProbab=0.2; midRange=450; midRangeProbab=0.7; maxRange=600; maxRangeProbab=0.2; aiRateOfFire=6; aiRateOfFireDistance=600; }; class single_far_optics2: single_medium_optics1 { requiredOpticType=2; showToPlayer=0; minRange=100; minRangeProbab=0.1; midRange=500; midRangeProbab=0.6; maxRange=700; maxRangeProbab=0.05; aiRateOfFire=8; aiRateOfFireDistance=700; }; class GL_3GL_F: UGL_F { displayName="$STR_A3_cfgweapons_3gl0"; descriptionShort="$STR_A3_cfgweapons_3gl1"; useModelOptics=0; useExternalOptic=0; magazines[]= { "1Rnd_HE_Grenade_shell", "UGL_FlareWhite_F", "UGL_FlareGreen_F", "UGL_FlareRed_F", "UGL_FlareYellow_F", "UGL_FlareCIR_F", "1Rnd_Smoke_Grenade_shell", "1Rnd_SmokeRed_Grenade_shell", "1Rnd_SmokeGreen_Grenade_shell", "1Rnd_SmokeYellow_Grenade_shell", "1Rnd_SmokePurple_Grenade_shell", "1Rnd_SmokeBlue_Grenade_shell", "1Rnd_SmokeOrange_Grenade_shell", "3Rnd_HE_Grenade_shell", "3Rnd_UGL_FlareWhite_F", "3Rnd_UGL_FlareGreen_F", "3Rnd_UGL_FlareRed_F", "3Rnd_UGL_FlareYellow_F", "3Rnd_UGL_FlareCIR_F", "3Rnd_Smoke_Grenade_shell", "3Rnd_SmokeRed_Grenade_shell", "3Rnd_SmokeGreen_Grenade_shell", "3Rnd_SmokeYellow_Grenade_shell", "3Rnd_SmokePurple_Grenade_shell", "3Rnd_SmokeBlue_Grenade_shell", "3Rnd_SmokeOrange_Grenade_shell" }; cameraDir="OP_look"; discreteDistance[]={50,75,100,150,200,250,300,350,400}; discreteDistanceCameraPoint[]= { "OP_eye_50", "OP_eye_75", "OP_eye_100", "OP_eye_150", "OP_eye_200", "OP_eye_250", "OP_eye_300", "OP_eye_350", "OP_eye_400" }; discreteDistanceInitIndex=1; reloadAction="GestureReloadMXUGL"; reloadMagazineSound[]= { "A3\Sounds_F\arsenal\weapons\Rifles\MX\Mx_UGL_reload", 1, 1, 10 }; }; aiDispersionCoefY=6; aiDispersionCoefX=4; }; class M36KantRifleBase: arifle_MX_Base_F { author="1st Legion"; scope=0; scopeCurator=0; scopeArsenal=0; displayName="M36 Kantrael Pattern Lasrifle"; model="\Cadian_Weapons\Model\M36KantRifle.p3d"; reloadAction="GestureReloadMXCompact"; picture="\Cadian_Weapons\Icon\KantraelLasrifle_ca.paa"; muzzles[]= { "this" }; magazineWell[]={}; magazines[]= { "M36KantRifle_mag", "HighDensityM36KantRifle_mag" }; rightHandIKCurve[]={1}; handAnim[]= { "OFP2_ManSkeleton", "\Cadian_Weapons\Anim\M36KantRifle.rtm" }; class WeaponSlotsInfo: WeaponSlotsInfo { mass=80; class MuzzleSlot: MuzzleSlot { linkProxy="\A3\data_f\proxies\weapon_slots\MUZZLE"; compatibleItems[]={}; iconPosition[]={0,0.44999999}; iconScale=0.2; }; class CowsSlot: CowsSlot { iconPosition[]={0.5,0.34999999}; iconScale=0.2; compatibleItems[]= { "TIOW_2x4xScope_1", "TIOW_6xScope_1", "TIOW_10xScope_1" }; }; class PointerSlot: PointerSlot { iconPosition[]={0.2,0.44999999}; iconScale=0.25; compatibleItems[]={}; }; }; inertia=0.40000001; aimTransitionSpeed=1.2; dexterity=1.6; initSpeed=720; recoil="recoil_lasgun"; modelOptics="\DKoK_Weapons\Type14_Optic.p3d"; class OpticsModes { class TWS { opticsID=1; useModelOptics=1; opticsPPEffects[]= { "OpticsCHAbera1", "OpticsBlur1" }; opticsZoomMin=0.039999999; opticsZoomMax=0.0625; opticsZoomInit=0.0625; discreteDistance[]={100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600}; discreteDistanceInitIndex=2; distanceZoomMin=100; distanceZoomMax=1600; discretefov[]={0.0625,0.025}; discreteInitIndex=0; modelOptics[]= { "\A3\Weapons_f\acc\reticle_tws_mg", "\A3\Weapons_f\acc\reticle_tws_mg_NFOW" }; memoryPointCamera="opticView"; visionMode[]= { "Normal" }; opticsFlare=1; opticsDisablePeripherialVision=1; cameraDir=""; }; class Iron: TWS { opticsID=2; useModelOptics=0; opticsPPEffects[]= { "", "" }; opticsFlare=0; opticsDisablePeripherialVision=0; opticsZoomMin=0.15000001; opticsZoomMax=0.40000001; opticsZoomInit=0.5; memoryPointCamera="eye"; visionMode[]={}; discretefov[]={}; distanceZoomMin=200; distanceZoomMax=200; discreteDistance[]={200}; discreteDistanceInitIndex=0; }; }; maxZeroing=1000; class ItemInfo { priority=1; }; descriptionShort="Lucius Pattern No.98 Lasgun - Fires at a higher charge range than most lasguns, giving significantly more punch, at the cost of recharge rate and quicker power pack depletion - Power pack only good for 25 shots. Standard issue Death Korps weapon."; selectionFireAnim="muzzleFlash"; modes[]= { "Single", "Burst", "single_medium_optics1", "single_far_optics2" }; class Single: Mode_SemiAuto { reloadTime=0.096000001; recoil="recoil_pistol_light"; recoilProne="recoil_prone_pistol_light"; dispersion=0.00034999999; minRange=200; minRangeProbab=0.5; midRange=400; midRangeProbab=0.69999999; maxRange=750; maxRangeProbab=0.30000001; soundContinuous=0; soundBurst=0; sounds[]= { "StandardSound" }; class BaseSoundModeType { closure1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 0.316228, 1, 10 }; closure2[]= { "\DKoK_Weapons\Sound\close_2.ogg", 0.316228, 1.1, 10 }; soundClosure[]={}; }; class StandardSound: BaseSoundModeType { soundSetShot[]= { "Lasgun_Shot_SoundSet", "Lasgun_Tail_SoundSet", "Lasgun_InteriorTail_SoundSet" }; begin1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 3.1622801, 1, 1800 }; begin2[]= { "\DKoK_Weapons\Sound\close_2.ogg", 3.1622801, 1, 1800 }; begin3[]= { "\DKoK_Weapons\Sound\close_3.ogg", 3.1622801, 1, 1800 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin1", 0.34 }; class SoundTails { class TailInterior { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.2387199, 1, 1800 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; }; }; class Burst: Mode_Burst { sounds[]= { "StandardSound" }; class BaseSoundModeType { closure1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 10 }; closure2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1.1, 10 }; soundClosure[]= { "closure1", 0.5, "closure2", 0.5 }; }; class StandardSound: BaseSoundModeType { begin1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin3[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin3", 0.34 }; class SoundTails { class TailInterior { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1.58489, 1, 1200 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; SoundSetShot[]= { "Lasgun_Shot_SoundSet", "Lasgun_Tail_SoundSet", "Lasgun_InteriorTail_SoundSet" }; }; soundBurst=0; burst=3; reloadTime=0.096; dispersion=0.00035; recoil="recoil_pistol_light"; recoilProne="recoil_prone_pistol_light"; minRange=2; minRangeProbab=0.3; midRange=50; midRangeProbab=0.7; maxRange=200; maxRangeProbab=0.05; aiRateOfFire=1; aiRateOfFireDistance=250; }; class single_medium_optics1: Single { requiredOpticType=1; showToPlayer=0; minRange=2; minRangeProbab=0.2; midRange=450; midRangeProbab=0.7; maxRange=600; maxRangeProbab=0.2; aiRateOfFire=2; aiRateOfFireDistance=600; }; class single_far_optics2: single_medium_optics1 { requiredOpticType=2; showToPlayer=0; minRange=100; minRangeProbab=0.1; midRange=500; midRangeProbab=0.6; maxRange=1200; maxRangeProbab=0.05; aiRateOfFire=4; aiRateOfFireDistance=1200; }; aiDispersionCoefY=6; aiDispersionCoefX=4; }; class Uniform_Base; class UniformItem; class InventoryItem_Base_F; class ItemCore; class Binocular; class VestItem: InventoryItem_Base_F { type=701; hiddenSelections[]={}; armor="5*0"; passThrough=1; hitpointName="HitBody"; }; class Cad_Gear_Vest2: ItemCore { scope=1; allowedSlots[]={901}; hiddenSelections[]= { "camo", "camoB", "RegimentCamo" }; class ItemInfo: VestItem { hiddenSelections[]= { "camo", "camoB", "RegimentCamo" }; }; }; class Cad_Gear2: Cad_Gear_Vest2 { scope=1; displayName="[Cadian] Flak Armor 2"; picture="\A3\characters_f\Data\UI\icon_V_TacVest_blk_CA.paa"; model="\CadFoot\Model\CadianArmor.p3d"; hiddenSelections[]= { "camo", "camoB", "RegimentCamo" }; hiddenSelectionsTextures[]={}; class ItemInfo: ItemInfo { uniformModel="\CadFoot\Model\CadianArmor.p3d"; containerClass="Supply80"; overlaySelectionsInfo[]= { "ghillie_hide" }; class HitpointsProtectionInfo { class Neck { hitpointName="HitNeck"; armor=78; passThrough=0.5; }; class Arms { hitpointName="HitArms"; armor=78; passThrough=0.5; }; class Chest { hitpointName="HitChest"; armor=78; passThrough=0.6; }; class Diaphragm { hitpointName="HitDiaphragm"; armor=78; passThrough=0.6; }; class Abdomen { hitpointName="HitAbdomen"; armor=16; passThrough=0.3; }; class Pelvis { hitpointName="HitPelvis"; armor=16; passThrough=0.3; }; class Body { hitpointName="HitBody"; passThrough=0.6; }; }; }; }; class Van_Gear: Cad_Gear2 { scope=2; scopeCurator=2; scopeArsenal=2; displayName="[Vanguard] Flak Armor"; picture="\CadFoot\Icon\KasrkinArmor_ca.paa"; model="\CadFoot\Model\CadianKasrkinArmor.p3d"; hiddenSelections[]= { "camo", "camoB", "RegimentCamo" }; hiddenSelectionsTextures[]= { "CadFoot\Data\Textures\KasrArmor1_776_co.paa", "CadFoot\Data\Textures\KasrArmor2_776_co.paa", "euvanguardtiowaddon\Data\Textures\GM_FlakArmorReg_Vanguard_ca.paa" }; class ItemInfo: ItemInfo { uniformModel="\CadFoot\Model\CadianKasrkinArmor.p3d"; containerClass="Supply80"; overlaySelectionsInfo[]= { "ghillie_hide" }; class HitpointsProtectionInfo { class Neck { hitpointName="HitNeck"; armor=80; passThrough=0.4; }; class Arms { hitpointName="HitArms"; armor=80; passThrough=1; }; class Chest { hitpointName="HitChest"; armor=80; passThrough=0.3; }; class Diaphragm { hitpointName="HitDiaphragm"; armor=80; passThrough=0.3; }; class Abdomen { hitpointName="HitAbdomen"; armor=35; passThrough=0.1; }; class Pelvis { hitpointName="HitPelvis"; armor=35; passThrough=0.1; }; class Body { hitpointName="HitBody"; armor=80; passThrough=0.3; }; }; }; }; /* class Van_Gear: Cad_Gear2 { scope=2; scopeCurator=2; scopeArsenal=2; displayName="[Vanguard] Flak Armor"; picture="\CadFoot\Icon\CadianArmor_ca.paa"; model="\CadFoot\Model\CadianArmor.p3d"; hiddenSelections[]= { "camo", "camoB", "RegimentCamo" }; hiddenSelectionsTextures[]= { "CadFoot\Data\Textures\GM_FlakArmor_776_co.paa", "", "euvanguardtiowaddon\Data\Textures\GM_FlakArmorReg_Vanguard_ca.paa" }; class ItemInfo: ItemInfo { uniformModel="\CadFoot\Model\CadianArmor.p3d"; containerClass="Supply80"; overlaySelectionsInfo[]= { "ghillie_hide" }; class HitpointsProtectionInfo { class Neck { hitpointName="HitNeck"; armor=80; passThrough=0.3; }; class Arms { hitpointName="HitArms"; armor=80; passThrough=0.3; }; class Chest { hitpointName="HitChest"; armor=80; passThrough=0.3; }; class Diaphragm { hitpointName="HitDiaphragm"; armor=80; passThrough=0.3; }; class Abdomen { hitpointName="HitAbdomen"; armor=35; passThrough=0.1; }; class Pelvis { hitpointName="HitPelvis"; armor=35; passThrough=0.1; }; class Body { hitpointName="HitBody"; armor=80; passThrough=0.3; }; */ /* class Neck { hitpointName="HitNeck"; armor=175.5; //125% increase of the normal Cadian flak armour 175.5 passThrough=0.5; }; class Arms { hitpointName="HitArms"; armor=175.5; passThrough=0.5; }; class Chest { hitpointName="HitChest"; armor=175.5; passThrough=0.6; }; class Diaphragm { hitpointName="HitDiaphragm"; armor=175.5; passThrough=0.6; }; class Abdomen { hitpointName="HitAbdomen"; armor=36; passThrough=0.3; }; class Pelvis { hitpointName="HitPelvis"; armor=36; passThrough=0.3; }; class Body { hitpointName="HitBody"; armor=175.5; passThrough=0.6; }; */ /* }; }; }; */ class Van_MedGear: Cad_Gear2 { scope=2; scopeCurator=2; scopeArsenal=2; displayName="[Vanguard] Medicae Flak Armor"; picture="\CadFoot\Icon\CadianArmor_ca.paa"; model="\CadFoot\Model\CadianArmor.p3d"; hiddenSelections[]= { "camo", "camoB", "RegimentCamo" }; hiddenSelectionsTextures[]= { "CadFoot\Data\Textures\GM_FlakArmor_776_co.paa", "", "CadFoot\Data\Textures\MED_FlakArmorReg_776_ca.paa" }; class ItemInfo: ItemInfo { uniformModel="\CadFoot\Model\CadianArmor.p3d"; containerClass="Supply80"; overlaySelectionsInfo[]= { "ghillie_hide" }; class HitpointsProtectionInfo { class Neck { hitpointName="HitNeck"; armor=100; //~54% increase of the normal Cadian flak armour passThrough=0.9; }; class Arms { hitpointName="HitArms"; armor=100; passThrough=0.9; }; class Chest { hitpointName="HitChest"; armor=100; passThrough=0.9; }; class Diaphragm { hitpointName="HitDiaphragm"; armor=100; passThrough=0.9; }; class Abdomen { hitpointName="HitAbdomen"; armor=24; passThrough=0.6; }; class Pelvis { hitpointName="HitPelvis"; armor=24; passThrough=0.6; }; class Body { hitpointName="HitBody"; armor=100; passThrough=0.9; }; }; }; }; class Cad_Inf_Helm2: ItemCore { scope=1; displayName="[Cadian] Shocktrooper Helmet 2"; picture="\A3\characters_f\Data\UI\icon_H_Cap_blk_CA.paa"; model="\CadFoot\Model\CadianHelmet.p3d"; hiddenSelections[]= { "camo", "camoB", "Camo1" }; hiddenSelectionsTextures[]={}; class ItemInfo: HeadgearItem { mass=45; uniformModel="\CadFoot\Model\CadianHelmet.p3d"; allowedSlots[]={801,901,701,605}; modelSides[]={6}; hiddenSelections[]= { "camo", "camoB", "Camo1" }; hiddenSelectionsTextures[]={}; class HitpointsProtectionInfo { class Head { hitpointName="HitHead"; armor=35; passThrough=0.1; }; }; }; }; class Van_Inf_Helm: Cad_Inf_Helm2 { scope=2; scopeArsenal=2; scopeCurator=2; displayName="[Vanguard] Helmet"; picture="\CadFoot\Icon\CadianHelmet_ca.paa"; model="\CadFoot\Model\CadianHelmet.p3d"; hiddenSelections[]= { "camo" }; hiddenSelectionsTextures[]= { "CadFoot\Data\Textures\GM_Helmet_776_co.paa" }; class ItemInfo: HeadgearItem { mass=45; uniformModel="\CadFoot\Model\CadianHelmet.p3d"; allowedSlots[]={801,901,701,605}; modelSides[]={6}; hiddenSelections[]= { "camo" }; class HitpointsProtectionInfo { class Head { hitpointName="HitHead"; armor=78.75; //125% buff passThrough=0.1; }; }; }; }; class Van_InfBreather_Helm: Cad_Inf_Helm2 { scope=2; scopeArsenal=2; scopeCurator=2; displayName="[Vanguard] Helmet, Hostile Environment"; picture="\CadFoot\Icon\CadianHelmetRebreather_ca.paa"; model="\CadFoot\Model\CadianGogglesHelmet.p3d"; hiddenSelections[]= { "camo", "camoB", "Camo1" }; hiddenSelectionsTextures[]= { "CadFoot\Data\Textures\GM_Helmet_776_co.paa", "CadFoot\Data\Textures\KasrRebreather_776_co.paa", "CadFoot\Data\Textures\KasrArmor2_776_co.paa" }; class ItemInfo: HeadgearItem { mass=45; uniformModel="\CadFoot\Model\CadianGogglesHelmet.p3d"; allowedSlots[]={801,901,701,605}; modelSides[]={6}; hiddenSelections[]= { "camo", "camoB", "Camo1" }; hiddenSelectionsTextures[]= { "CadFoot\Data\Textures\GM_Helmet_776_co.paa", "CadFoot\Data\Textures\KasrRebreather_776_co.paa", "CadFoot\Data\Textures\KasrArmor2_776_co.paa" }; class HitpointsProtectionInfo { class Head { hitpointName="HitHead"; armor=78.75; passThrough=0.05; }; }; }; }; class LasLMGBase: arifle_MX_Base_F { author="1st Legion"; scope=0; scopeCurator=0; scopeArsenal=0; displayName="Unkown Pattern Las-LMG"; model="\Cadian_Weapons\Model\M36KantRifle.p3d";//Replace with Volker will make. reloadAction="GestureReloadMXCompact"; picture="\Cadian_Weapons\Icon\KantraelLasrifle_ca.paa"; muzzles[]= { "this" }; magazineWell[]={}; magazines[]= { "150RndLasLmg_mag", "200RndLasLmg_mag" }; rightHandIKCurve[]={1}; handAnim[]= { "OFP2_ManSkeleton", "\Cadian_Weapons\Anim\M36KantRifle.rtm" }; class WeaponSlotsInfo: WeaponSlotsInfo { mass=80; class MuzzleSlot: MuzzleSlot { linkProxy="\A3\data_f\proxies\weapon_slots\MUZZLE"; compatibleItems[]={}; iconPosition[]={0,0.45}; iconScale=0.2; }; class CowsSlot: CowsSlot { iconPosition[]={0.5,0.35}; iconScale=0.2; compatibleItems[]= { "TIOW_2x4xScope_1", "TIOW_6xScope_1", "TIOW_10xScope_1" }; }; class PointerSlot: PointerSlot { iconPosition[]={0.2,0.45}; iconScale=0.25; compatibleItems[]={}; }; }; inertia=0.4; aimTransitionSpeed=1.2; dexterity=1.6; initSpeed=720; recoil="recoil_lasgun"; modelOptics="\DKoK_Weapons\Type14_Optic.p3d"; class OpticsModes { class TWS { opticsID=1; useModelOptics=1; opticsPPEffects[]= { "OpticsCHAbera1", "OpticsBlur1" }; opticsZoomMin=0.04; opticsZoomMax=0.0625; opticsZoomInit=0.0625; discreteDistance[]={100,200,300,400,500,600,700,800,900,1000,1100,1200,1300,1400,1500,1600}; discreteDistanceInitIndex=2; distanceZoomMin=100; distanceZoomMax=1600; discretefov[]={0.0625,0.025}; discreteInitIndex=0; modelOptics[]= { "\A3\Weapons_f\acc\reticle_tws_mg", "\A3\Weapons_f\acc\reticle_tws_mg_NFOW" }; memoryPointCamera="opticView"; visionMode[]= { "Normal" }; opticsFlare=1; opticsDisablePeripherialVision=1; cameraDir=""; }; class Iron: TWS { opticsID=2; useModelOptics=0; opticsPPEffects[]= { "", "" }; opticsFlare=0; opticsDisablePeripherialVision=0; opticsZoomMin=0.15; opticsZoomMax=0.4; opticsZoomInit=0.5; memoryPointCamera="eye"; visionMode[]={}; discretefov[]={}; distanceZoomMin=200; distanceZoomMax=200; discreteDistance[]={200}; discreteDistanceInitIndex=0; }; }; maxZeroing=1000; class ItemInfo { priority=1; }; descriptionShort="Lucius Pattern No.98 Lasgun - Fires at a higher charge range than most lasguns, giving significantly more punch, at the cost of recharge rate and quicker power pack depletion - Power pack only good for 25 shots. Standard issue Death Korps weapon."; selectionFireAnim="muzzleFlash"; modes[]= { "Single", /*"FullAuto",*/ "Burst", "FullAutoSuppression", "single_medium_optics1", "single_far_optics2" }; class Single: Mode_SemiAuto { reloadTime=0.096; recoil="recoil_pistol_light"; recoilProne="recoil_prone_pistol_light"; dispersion=0.00035; minRange=200; minRangeProbab=0.5; midRange=400; midRangeProbab=0.7; maxRange=750; maxRangeProbab=0.3; soundContinuous=0; soundBurst=0; sounds[]= { "StandardSound" }; class BaseSoundModeType { closure1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 0.316228, 1, 10 }; closure2[]= { "\DKoK_Weapons\Sound\close_2.ogg", 0.316228, 1.1, 10 }; soundClosure[]={}; }; class StandardSound: BaseSoundModeType { soundSetShot[]= { "Lasgun_Shot_SoundSet", "Lasgun_Tail_SoundSet", "Lasgun_InteriorTail_SoundSet" }; begin1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 3.1622801, 1, 1800 }; begin2[]= { "\DKoK_Weapons\Sound\close_2.ogg", 3.1622801, 1, 1800 }; begin3[]= { "\DKoK_Weapons\Sound\close_3.ogg", 3.1622801, 1, 1800 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin1", 0.34 }; class SoundTails { class TailInterior { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.2387199, 1, 1800 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1800 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; }; }; /* class FullAuto: Mode_FullAuto { sounds[]= { "StandardSound" }; class BaseSoundModeType { closure1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 10 }; closure2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1.1, 10 }; soundClosure[]= { "closure1", 0.5, "closure2", 0.5 }; }; class StandardSound: BaseSoundModeType { begin1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin3[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin3", 0.34 }; class SoundTails { class TailInterior { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1.58489, 1, 1200 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; SoundSetShot[]= { "Lasgun_Shot_SoundSet", "Lasgun_Tail_SoundSet", "Lasgun_InteriorTail_SoundSet" }; }; soundBurst=0; burst=0; reloadTime=0.075; dispersion=0.00035; recoil="recoil_pistol_light"; recoilProne="recoil_prone_pistol_light"; minRange=2; minRangeProbab=0.3; midRange=50; midRangeProbab=0.7; maxRange=200; maxRangeProbab=0.05; aiRateOfFire=1; aiRateOfFireDistance=250; }; */ class FullAutoSuppression: Mode_FullAuto { sounds[]= { "StandardSound" }; class BaseSoundModeType { closure1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 10 }; closure2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1.1, 10 }; soundClosure[]= { "closure1", 0.5, "closure2", 0.5 }; }; class StandardSound: BaseSoundModeType { begin1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin3[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin3", 0.34 }; class SoundTails { class TailInterior { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1.58489, 1, 1200 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; SoundSetShot[]= { "Lasgun_Shot_SoundSet", "Lasgun_Tail_SoundSet", "Lasgun_InteriorTail_SoundSet" }; }; //textureType = "fastAuto"; Never delete this. It was a pain to find. soundBurst=0; burst=0; reloadTime=0.075; dispersion=0.008; recoil="recoil_pistol_light"; recoilProne="recoil_prone_pistol_light"; minRange=2; minRangeProbab=0.3; midRange=50; midRangeProbab=0.7; maxRange=200; maxRangeProbab=0.05; aiRateOfFire=1; aiRateOfFireDistance=250; }; class Burst: Mode_Burst { sounds[]= { "StandardSound" }; class BaseSoundModeType { closure1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 10 }; closure2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1.1, 10 }; soundClosure[]= { "closure1", 0.5, "closure2", 0.5 }; }; class StandardSound: BaseSoundModeType { begin1[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin2[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; begin3[]= { "\DKoK_Weapons\Sound\close_1.ogg", 2.8183801, 1, 1200 }; soundBegin[]= { "begin1", 0.33000001, "begin2", 0.33000001, "begin3", 0.34 }; class SoundTails { class TailInterior { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1.58489, 1, 1200 }; frequency=1; volume="interior"; }; class TailTrees { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*trees"; }; class TailForest { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*forest"; }; class TailMeadows { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*(meadows/2 max sea/2)"; }; class TailHouses { sound[]= { "\DKoK_Weapons\Sound\close_1.ogg", 1, 1, 1200 }; frequency=1; volume="(1-interior/1.4)*houses"; }; }; SoundSetShot[]= { "Lasgun_Shot_SoundSet", "Lasgun_Tail_SoundSet", "Lasgun_InteriorTail_SoundSet" }; }; soundBurst=0; burst=6; reloadTime=0.075; dispersion=0.00035; recoil="recoil_pistol_light"; recoilProne="recoil_prone_pistol_light"; minRange=2; minRangeProbab=0.3; midRange=50; midRangeProbab=0.7; maxRange=200; maxRangeProbab=0.05; aiRateOfFire=1; aiRateOfFireDistance=250; }; class single_medium_optics1: Single { requiredOpticType=1; showToPlayer=0; minRange=2; minRangeProbab=0.2; midRange=450; midRangeProbab=0.7; maxRange=600; maxRangeProbab=0.2; aiRateOfFire=2; aiRateOfFireDistance=600; }; class single_far_optics2: single_medium_optics1 { requiredOpticType=2; showToPlayer=0; minRange=100; minRangeProbab=0.1; midRange=500; midRangeProbab=0.6; maxRange=1200; maxRangeProbab=0.05; aiRateOfFire=4; aiRateOfFireDistance=1200; }; aiDispersionCoefY=6; aiDispersionCoefX=4; }; class VanguardLasLMG: LasLMGBase { author="Dolf"; scope=2; scopeCurator=2; scopeArsenal=2; displayName="[Vanguard] Unkown Pattern Las-LMG"; hiddenSelections[]= { "casing_camo", "wording_camo" }; hiddenSelectionsTextures[]= { "Cadian_Weapons\Data\Textures\M36KantRifle_casing_776_co.paa", "Cadian_Weapons\Data\Textures\M36KantRifle_wording_co.paa" }; model="\Cadian_Weapons\Model\M36KantRifle.p3d"; }; class launch_RPG7_F: Launcher_Base_F { }; class MissileLauncherDKOK: launch_RPG7_F { author="1st legion"; model="DKoK_Weapons\Model\MissileLauncher.p3d"; scope=0; displayName="Death Korps Missile Launcher"; handAnim[]= { "OFP2_ManSkeleton", "\DKoK_Weapons\Anim\MissileLauncher.rtm" }; descriptionShort="Death Korps Missile Launcher"; lockingTargetSound[]= { "A3\Sounds_F\arsenal\weapons\Launchers\NLAW\locking_NLAW", 0.316228, 1 }; lockedTargetSound[]= { "A3\Sounds_F\arsenal\weapons\Launchers\NLAW\locked_NLAW", 0.316228, 2.5 }; changeFiremodeSound[]= { "A3\sounds_f\dummysound", 0.56234097, 1, 20 }; modelOptics="\A3\Weapons_F\acc\reticle_NLAW"; opticsPPEffects[]= { "OpticsCHAbera1", "OpticsBlur1" }; opticsZoomMin=0.0623; opticsZoomMax=0.0623; opticsZoomInit=0.0623; class OpticsModes { class optic { opticsID=1; useModelOptics=1; opticsZoomMin=0.0623; opticsZoomMax=0.0623; opticsZoomInit=0.0623; distanceZoomMin=300; distanceZoomMax=300; memoryPointCamera="cam"; opticsFlare=1; opticsDisablePeripherialVision=1; cameraDir="look"; visionMode[]= { "Normal", "NVG", "TI" }; thermalMode[]= { 4, 5 }; opticsPPEffects[]= { "OpticsCHAbera1", "OpticsBlur1" }; }; class Hamr2Collimator { opticsID=1; useModelOptics=0; opticsPPEffects[]= { "Default" }; opticsFlare=0; opticsDisablePeripherialVision=0; opticsZoomMin=0.25; opticsZoomMax=1.25; opticsZoomInit=0.75; memoryPointCamera="eye"; visionMode[]={}; distanceZoomMin=200; distanceZoomMax=200; }; }; class WeaponSlotsInfo: WeaponSlotsInfo { mass=100; }; magazines[]= { "MLAT_Mag", "MLHE_Mag", "MLSmoke_Mag", "MLMelta_Mag" }; canLock=2; weaponLockDelay=5; lockAcquire=0; hiddenSelections[]= { "camo" }; hiddenSelectionsTextures[]= { "\DKoK_Weapons\Data\Textures\MissileLauncherBlack_co.paa" }; }; };
de5d79dfba8867eeb0cc077c07c07ba720d3cff4
5929456eb5e3853863f1d70ebbe1b5b5838305f1
/src/World.h
fb1db1393fd79628753ac464eab31ae2a2177b4f
[]
no_license
tschicke/Cubes
48f53abb0fc1698f7cc38980efecded58e896241
fb90a0254d6ce7098f27df167eb4b65d03150b59
refs/heads/master
2021-01-01T15:49:54.288594
2013-07-11T03:49:09
2013-07-11T03:49:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
900
h
World.h
/* * World.h * * Created on: Mar 26, 2013 * Author: Tyler */ #ifndef WORLD_H_ #define WORLD_H_ #include "Common.h" #include "ChunkManager.h" #include "Player.h" #include "Character.h" #include "SelectedBlock.h" namespace ts { class World { public: World(); virtual ~World(); virtual void handleInput() = 0; virtual void update(time_t dt) = 0; virtual void draw() = 0; Chunk * getChunkAt(int x, int y, int z); Block * getBlockAt(int x, int y, int z); SelectedBlock raytraceBlocks(glm::vec3 startPos, glm::vec3 endPos); void addBlockOfTypeAtPosition(int x, int y, int z, BlockType blockType); void removeBlockAtPosition(int x, int y, int z); Player * getMainPlayer(); void addEntity(Entity * entity); void clearEntities(); protected: ChunkManager chunkManager; Player * mainPlayer; std::vector<Entity *> entityList; }; } /* namespace ts */ #endif /* WORLD_H_ */
d892d6e05357287b79692ef530e8c07e69a72e8d
e63de97193cfdfe03c691975f2cf0195c1d0c7c7
/UVa_00516_PrimeLand.cpp
cadf63f40d8e7bca4a10951553644078ff98eb30
[]
no_license
Abdoronic/UVa-Solutions-Cpp
a2df3ffebcdb24e92eeda6315a0aaaa323ae6553
85a0685167cc2dc2692e509c756bbed9be337aef
refs/heads/master
2020-03-22T00:53:13.916458
2018-09-30T21:58:03
2018-09-30T21:58:03
139,270,793
1
0
null
null
null
null
UTF-8
C++
false
false
1,400
cpp
UVa_00516_PrimeLand.cpp
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> ii; typedef vector<int> vi; typedef vector<ii> vii; #define sz(c) int((c).size()) #define all(c) (c).begin(), (c).end() #define pb push_back #define INF int(1e9) #define EPS 1e-9 #define MOD int(1e9 + 7) vector<int> primes; vector<bool> isPrime; void sieve(int N) { //all prime numbers from 1 to N aprox. (N / log N) numbers isPrime.assign(N + 1, true); isPrime[0] = isPrime[1] = false; for(int i = 2; i <= N; i++) { if(isPrime[i]) { primes.push_back(i); if(1LL * i * i <= N) for(int j = i * i; j <= N; j += i) isPrime[j] = false; } } } vector<ii> primeFactorsPowers(int N) { vector<ii> factors; for(int p : primes) { if(p * p > N) break; int e = 0; while(N % p == 0 && ++e) N /= p; if(e > 0) factors.push_back({p, e}); } if(N > 1) factors.push_back({N, 1}); return factors; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); string line; sieve(100000); while(true) { getline(cin, line); istringstream ss(line); int p, e; ss >> p; if(p == 0) break; ss >> e; int num = pow(p, e); while(ss >> p >> e) num *= pow(p, e); num--; vii factors = primeFactorsPowers(num); for(int i = (int)factors.size() - 1; i >= 0; i--) printf("%d %d%c", factors[i].first, factors[i].second, i == 0 ? '\n' : ' '); } return 0; }
c516ef2e46ab4f840c17291bc2e32a9bee4816a1
d44026a7e3386e8f94de39e766220fdf2a6acaa2
/Algorithm/Sorting/P07-Quicksort-2-Sorting.cpp
2a29cbb3c2cd234058a77d1f1a63550939e019c5
[]
no_license
velamen2009/HackerRank
23a4ebf3c6aeffed23bfe7ba2565ddcd4134e1a7
2825cbe6b1305c5bcf0475d2a9bf33befb493581
refs/heads/master
2020-04-06T03:58:17.207289
2017-04-07T22:49:15
2017-04-07T22:49:15
83,093,511
0
0
null
null
null
null
UTF-8
C++
false
false
1,162
cpp
P07-Quicksort-2-Sorting.cpp
#include <bits/stdc++.h> using namespace std; //fake partition int partition(vector<int>& arr, int L, int R){ int pivot = arr[L]; vector<int> tmp(R - L + 1, 0); int k = 0; for(int i = L; i <= R; ++i){ if(arr[i] < pivot){ tmp[k] = arr[i]; ++k; } } for(int i = L; i <= R; ++i){ if(arr[i] == pivot){ tmp[k] = pivot; ++k; } } int ans = k; for(int i = L; i <= R; ++i){ if(arr[i] > pivot){ tmp[k] = arr[i]; ++k; } } for(int i = L; i <= R; ++i){ arr[i] = tmp[i - L]; } return L + ans - 1; } void quickSort(vector <int> &arr, int L, int R) { // Complete this function if(R > L){ int pivot = partition(arr, L, R); quickSort(arr, L, pivot - 1); quickSort(arr, pivot + 1, R); if(R > L){ for(int i = L; i <= R; ++i){ cout << arr[i] << " "; } cout << endl; } } } int main() { int n; cin >> n; vector <int> arr(n); for(int i = 0; i < (int)n; ++i) { cin >> arr[i]; } quickSort(arr, 0, arr.size() - 1); return 0; }
c94e8bc835fc9ab36ebe18b3b697419d84e83ea7
87448c28abede2ceb4723ce3019a4d3ad0f65ed6
/GPENakaoFDM/src/GPE5CSolver.h
b1dba751a63fe3d60483779e264c44a555242588
[ "Apache-2.0" ]
permissive
tomaszhof/interval_arithmetic
6158491b64723b0253a90572c8760df1b67b1037
0d1e7c842803f8ca211bf2a9d7239f7541452492
refs/heads/master
2021-06-03T10:41:11.837756
2021-04-10T20:03:12
2021-04-10T20:03:12
12,877,600
0
0
null
null
null
null
UTF-8
C++
false
false
1,723
h
GPE5CSolver.h
/* * GPDESolver.h * * Created on: 25-01-2014 * Author: thof */ #ifndef GPE5CSOLVER_H_ #define GPE5CSOLVER_H_ #include "Solver.h" #include "THashMap.h" #include "ExampleGPE01.h" #include "ExampleGPE02.h" #include "ExampleGPE03.h" #include "ExampleGPE04.h" #include "ExampleGPE05.h" #include "ExampleGPE06.h" #include "ExampleGPE08.h" #include "ExampleGPE11.h" using namespace interval_arithmetic; namespace interval_arithmetic { template<typename T> class GPE5CSolver: public Solver<T> { using Solver<T>::bc; using Solver<T>::params; using Solver<T>::u; //using Solver<T>::X; using Solver<T>::maxP; using Solver<T>::maxQ; using Solver<T>::maxR; using Solver<T>::maxS; using Solver<T>::maxT; using Solver<T>::_initparams; using Solver<T>::ih; using Solver<T>::ik; const Interval<T> im1 = {-1.0L, -1.0L}; const Interval<T> i1 = {1.0L, 1.0L}; const Interval<T> i2 = {2.0L, 2.0L}; const Interval<T> i6 = {6.0L, 6.0L}; const Interval<T> i12 = {12.0L, 12.0L}; T alphax(T xi, T yj); T alphay(T xi, T yj); T betax(T xi, T yj); T betay(T xi, T yj); Interval<T> IAlphaX(Interval<T> xi, Interval<T> yj); Interval<T> IAlphaY(Interval<T> xi, Interval<T> yj); Interval<T> IBetaX(Interval<T> xi, Interval<T> yj); Interval<T> IBetaY(Interval<T> xi, Interval<T> yj); public: GPE5CSolver(); virtual ~GPE5CSolver(); int SolveFP(); int SolvePIA(); int SolveDIA(); int SetExample(int eid); void WriteFPResultsToCsv(); void WriteIntervalResultsToCsv(); }; } /* namespace intervalarth */ template<typename T> inline void interval_arithmetic::GPE5CSolver<T>::WriteFPResultsToCsv() { } template<typename T> inline void interval_arithmetic::GPE5CSolver<T>::WriteIntervalResultsToCsv() { } #endif /* GPE5CSOLVER_H_ */
6efc7ad3697958d29b6a343e05d49aed8bbcb083
67d5a3661034b26b8f8f4aac78954d08679939c9
/src/FrameConstantsBuffer.cpp
7e84a8697f3f0a1990c565dd742553d066afdefc
[]
no_license
RohacekD/Bachleor-Thesis-Shadow-Mapping-Opengl
ee67be95c6a54b0e41be3b8f75f03608285926ff
05b16ee20ffeffa119f30966e53f07ef7806c4c7
refs/heads/master
2021-03-27T19:46:27.891132
2018-05-11T21:44:35
2018-05-11T21:44:35
118,285,361
0
0
null
null
null
null
UTF-8
C++
false
false
1,010
cpp
FrameConstantsBuffer.cpp
#include "FrameConstantsBuffer.h" #include "glm\gtc\type_ptr.hpp" //================================================================================= C_FrameConstantsBuffer::C_FrameConstantsBuffer(const std::string& blockName, unsigned int index) : C_UniformBuffer(blockName, index) { const auto matSize = sizeof(glm::mat4); const auto vecSize = sizeof(glm::vec4); const auto bytes = matSize + vecSize; ErrorCheck(); GLW::C_UniformBuffer::bind(); glBufferData(GL_UNIFORM_BUFFER, bytes, nullptr, GL_DYNAMIC_DRAW); ErrorCheck(); } //================================================================================= void C_FrameConstantsBuffer::UploadData() const { bind(); char *data = (char *)glMapBuffer(GL_UNIFORM_BUFFER, GL_READ_WRITE); memcpy(data, glm::value_ptr(m_ViewProjection), sizeof(decltype(m_ViewProjection))); memcpy(data + sizeof(decltype(m_ViewProjection)), glm::value_ptr(m_CameraPosition), sizeof(decltype(m_CameraPosition))); glUnmapBuffer(GL_UNIFORM_BUFFER); unbind(); }
98ec86757b60337cdcb631854e45916d1010f851
2fe6eb81b6c420aa2371f2328b4e3fbbc5e94132
/SnakeAndLadder/utils.cpp
e18f2de6cb42bbbae0d140d86925b4dcfa16ecfe
[]
no_license
Kamal-Singh/ObjectOrientedDesign
cd79b43c6adc6ade64fcf9d0f9e4ad838d3f68dc
900395329c60c3fcce030669d933c18172b8a57d
refs/heads/master
2023-03-27T17:44:01.014002
2021-04-03T14:17:17
2021-04-03T14:17:17
354,309,829
1
0
null
null
null
null
UTF-8
C++
false
false
204
cpp
utils.cpp
#include<bits/stdc++.h> #include "utils.hpp" using namespace std; // Helper Functions void handleErrorAndExit(string message) { cout<<message<<endl; cout<<"Exiting the Game"<<endl; exit(1); }
b09983a137d3fc0f501ae80b1417ba9312186b0d
a1faac8530885629c561e60c14e7faf532efedc4
/graph/classOrdering/classOrder.cpp
3a2fc7c6ce3206cfa0e6d63f51f32e8820e4ed79
[]
no_license
echenyu/interviewPracticeProblems
c420cccc87ca21bfcfeea12fb9fb945c20e8a28f
5a102d09403415b511471e68a6ae3b4828c7b797
refs/heads/master
2020-04-06T07:11:08.988128
2016-09-14T18:10:54
2016-09-14T18:10:54
61,405,799
0
0
null
null
null
null
UTF-8
C++
false
false
4,914
cpp
classOrder.cpp
#include <unordered_set> #include <unordered_map> #include <queue> #include <iostream> #include <vector> #include <ctime> #include <stack> using namespace std; bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites); void removeEdge(int front, unordered_map<int, int> &prereqs, vector<unordered_set<int>> &graph); void addEdgeless(unordered_map<int, int> &prereqs, queue<int> &noEdges); vector<unordered_set<int>> make_graph(int numCourses, vector<pair<int, int>>& prerequisites); int main() { vector<pair<int,int>> prerequisites = {make_pair(6,27),make_pair(83,9),make_pair(10,95),make_pair(48,67),make_pair(5,71),make_pair(18,72),make_pair(7,10),make_pair(92,4),make_pair(68,84),make_pair(6,41),make_pair(82,41),make_pair(18,54),make_pair(0,2),make_pair(1,2),make_pair(8,65),make_pair(47,85),make_pair(39,51),make_pair(13,78),make_pair(77,50),make_pair(70,56),make_pair(5,61),make_pair(26,56),make_pair(18,19),make_pair(35,49),make_pair(79,53),make_pair(40,22),make_pair(8,19),make_pair(60,56),make_pair(48,50),make_pair(20,70),make_pair(35,12),make_pair(99,85),make_pair(12,75),make_pair(2,36),make_pair(36,22),make_pair(21,15),make_pair(98,1),make_pair(34,94),make_pair(25,41),make_pair(65,17),make_pair(1,56),make_pair(43,96),make_pair(74,57),make_pair(19,62),make_pair(62,78),make_pair(50,86),make_pair(46,22),make_pair(10,13),make_pair(47,18),make_pair(20,66),make_pair(83,66),make_pair(51,47),make_pair(23,66),make_pair(87,42),make_pair(25,81),make_pair(60,81),make_pair(25,93),make_pair(35,89),make_pair(65,92),make_pair(87,39),make_pair(12,43),make_pair(75,73),make_pair(28,96),make_pair(47,55),make_pair(18,11),make_pair(29,58),make_pair(78,61),make_pair(62,75),make_pair(60,77),make_pair(13,46),make_pair(97,92),make_pair(4,64),make_pair(91,47),make_pair(58,66),make_pair(72,74),make_pair(28,17),make_pair(29,98),make_pair(53,66),make_pair(37,5),make_pair(38,12),make_pair(44,98),make_pair(24,31),make_pair(68,23),make_pair(86,52),make_pair(79,49),make_pair(32,25),make_pair(90,18),make_pair(16,57),make_pair(60,74),make_pair(81,73),make_pair(26,10),make_pair(54,26),make_pair(57,58),make_pair(46,47),make_pair(66,54),make_pair(52,25),make_pair(62,91),make_pair(6,72),make_pair(81,72),make_pair(50,35),make_pair(59,87),make_pair(21,3),make_pair(4,92),make_pair(70,12),make_pair(48,4),make_pair(9,23),make_pair(52,55),make_pair(43,59),make_pair(49,26),make_pair(25,90),make_pair(52,0),make_pair(55,8),make_pair(7,23),make_pair(97,41),make_pair(0,40),make_pair(69,47),make_pair(73,68),make_pair(10,6),make_pair(47,9),make_pair(64,24),make_pair(95,93),make_pair(79,66),make_pair(77,21),make_pair(80,69),make_pair(85,5),make_pair(24,48),make_pair(74,31),make_pair(80,76),make_pair(81,27),make_pair(71,94),make_pair(47,82),make_pair(3,24),make_pair(66,61),make_pair(52,13),make_pair(18,38),make_pair(1,35),make_pair(32,78),make_pair(7,58),make_pair(26,58),make_pair(64,47),make_pair(60,6),make_pair(62,5),make_pair(5,22),make_pair(60,54),make_pair(49,40),make_pair(11,56),make_pair(19,85),make_pair(65,58),make_pair(88,44),make_pair(86,58)}; prerequisites.push_back(make_pair(1, 2)); int numCourses = 2; int start_s = clock(); cout << canFinish(100, prerequisites) << " is the answer" << endl; int stop_s = clock(); cout << "Execution Time: " << (stop_s - start_s)/double(CLOCKS_PER_SEC)*1000 << endl; } //Uses Kahn's Algorithm to solve - have a queue that holds onto each of the //node's that have no incoming edges. bool canFinish(int numCourses, vector<pair<int, int>>& prerequisites) { vector<unordered_set<int>> graph = make_graph(numCourses, prerequisites); unordered_map<int, int> prereqs; for(int i = 0; i < numCourses; i++) prereqs[i] = 0; for(auto neighbors : graph) { for(int neigh : neighbors) { prereqs[neigh]++; } } queue<int> noEdges; addEdgeless(prereqs, noEdges); while(!noEdges.empty()) { int front = noEdges.front(); noEdges.pop(); prereqs.erase(front); removeEdge(front, prereqs, graph); addEdgeless(prereqs, noEdges); } return prereqs.empty(); } vector<unordered_set<int>> make_graph(int numCourses, vector<pair<int, int>>& prerequisites) { vector<unordered_set<int>> graph(numCourses); for (auto pre : prerequisites) graph[pre.second].insert(pre.first); return graph; } void removeEdge(int front, unordered_map<int, int> &prereqs, vector<unordered_set<int>> &graph) { for(auto i : graph[front]) { prereqs[i]--; } } void addEdgeless(unordered_map<int, int> &prereqs, queue<int> &noEdges) { stack<int> toErase; for(auto kv : prereqs) { if(!kv.second) { noEdges.push(kv.first); toErase.push(kv.first); } } while(!toErase.empty()) { prereqs.erase(toErase.top()); toErase.pop(); } }
2d7f91725be83592a1eb02a2fbfa88ed42436a6b
f2ec1b91bac114462da146bae86c194e301f1198
/demo/design_patterns/chain_of_responsibility.hpp
6534c3c691a1ef76c1b082785078c0aab189e48b
[]
no_license
congzhibin/yjkd
a35d89be9a54c9857ac40abcde6dba3d57258709
8c69e170bb1cee39f590f00d9caa4648018e6935
refs/heads/master
2020-03-28T05:17:34.419291
2017-08-22T01:25:16
2017-08-22T01:25:16
null
0
0
null
null
null
null
GB18030
C++
false
false
1,735
hpp
chain_of_responsibility.hpp
#pragma once // 责任链模式 // 1. Put a "next" pointer in the base class // 2. The "chain" method in the base class always delegates to the next object // 3. If the derived classes cannot handle, they delegate to the base class class CHandlerBase { public: CHandlerBase() : m_pNext(0) {} virtual ~CHandlerBase() {} void Append(CHandlerBase *p) { if (m_pNext) { m_pNext->Append(p); } else { m_pNext = p; } } // 2. The "chain" method in the base class always delegates to the next obj virtual void Handle(int i) { if (m_pNext) { m_pNext->Handle(i); } } private: CHandlerBase *m_pNext; // 1. "next" pointer in the base class }; class CHandler1 : public CHandlerBase { public: virtual void Handle(int i) { if (i>=0 && i<=2) { // handle } else { CHandlerBase::Handle(i); // 3. Delegate to the base class } } }; class CHandler2 : public CHandlerBase { public: virtual void Handle(int i) { if (i>=3 && i<=6) { // handle } else { CHandlerBase::Handle(i); } } }; class CHandler3 : public CHandlerBase { public: virtual void Handle(int i) { // handle all } }; class CChainOfResponsibilityClient { public: static void main() { CHandler1 h1; // 处理[1,2] CHandler2 h2; // 处理[3,6] CHandler3 h3; // 处理其它情况 h1.Append(&h2); h1.Append(&h3); for (int i=1; i < 10; i++) { h1.Handle(i); } } };
76b0f6eaab3b29819acfd326024e12c1ea9b1935
0b2748e3d25c4daf628e8b728f581931f024a833
/source/sdk/include/Comm/win32.h
b2f9fc97bdbdebe9b6df47f82fd0a8225dbfe8c1
[]
no_license
Zoltan3057/N_Kunhou_Arm_sdk
b4c3653705e2bb76935f3ac07fae503f09172dd8
e50f60d3e7f19715bbedc9ccc55ca6280d13ad1b
refs/heads/master
2020-03-21T17:27:50.975966
2018-03-03T05:34:10
2018-03-03T05:34:10
138,833,358
2
1
null
null
null
null
UTF-8
C++
false
false
655
h
win32.h
#ifndef _WIN32_DRAND48_KYOSHO_2015_08321_ #define _WIN32_DRAND48_KYOSHO_2015_08321_ #if defined(_WINDOWS) #define MNWZ 0x100000000 #define ANWZ 0x5DEECE66D #define CNWZ 0xB16 #define INFINITY 0xFFFFFFFFF int labelsize; int dim; static unsigned long long seed = 1; namespace W32_RAND{ double drand48(void) { seed = (ANWZ * seed + CNWZ) & 0xFFFFFFFFFFFFLL; unsigned int x = seed >> 16; return ((double)x / (double)MNWZ); } //static unsigned long long seed = 1; void srand48(unsigned int i) { seed = (((long long int)i) << 16) | rand(); } } #endif//_WINDOWS #endif//_WIN32_DRAND48_KYOSHO_2015_08321_
81d0d0e79024e781a6164dfb16d1e1bc92bc3271
ba1e90ae6ea9f8f74d9b542e159825341c717712
/2015/ebay1.cpp
5e7c32d165b7fcc5b49db9c20ea8430bcc8cc852
[]
no_license
sailesh2/CompetitiveCode
b384687a7caa8980ab9b9c9deef2488b0bfe9cd9
5671dac08216f4ce75d5992e6af8208fa2324d12
refs/heads/master
2021-06-24T22:39:11.396049
2020-11-27T05:22:17
2020-11-27T05:22:17
161,877,355
0
0
null
null
null
null
UTF-8
C++
false
false
1,114
cpp
ebay1.cpp
#include<stdio.h> #include<iostream> #include<vector> using namespace std; long long int k,n; long long int ctr=0; void fun(vector<long long int> *,long long int,long long int *); int main() { long long int i,j,a,b; cin>>n>>k; vector<long long int> arr[n+1]; for(i=0;i<n-1;i++) { cin>>a>>b; arr[a].push_back(b); } long long int brr[1000000]={0}; fun(arr,1,brr); cout<<ctr; return 0; } void fun(vector<long long int> *arr,long long int i,long long int *brr) { long long int idx,j; idx=k/i; long long int sum = 0; if(idx>n) idx=n; while (idx > 0) { sum = (sum + brr[idx]); idx -= (idx & -idx); } ctr=ctr+sum; idx=i; long long int val=1; while (idx <=n) { brr[idx] = brr[idx] + val; idx += (idx & -idx); } for(j=0;j<arr[i].size();j++) fun(arr,arr[i][j],brr); idx=i; val=-1; while (idx <=n) { brr[idx] = brr[idx] + val; idx += (idx & -idx); } return; }
f565ddfaa3d4853ffd034503aef191c9d189b31a
f806d792bf22bc8306a0926f7b2306c0b3dd4367
/CS203/Lab 6/D.cpp
3281274535eab8420e6917deb55934271775224e
[ "MIT" ]
permissive
Wycers/Codelib
d7665476c810ddefd82dd758a4963f6b0e1b7ac1
7d54dce875a69bc998597abb1c2e2c814587c9b8
refs/heads/master
2023-03-05T13:57:44.371292
2022-09-22T02:23:17
2022-09-22T02:23:17
143,575,376
28
4
MIT
2023-03-04T22:05:33
2018-08-05T01:44:34
VHDL
UTF-8
C++
false
false
910
cpp
D.cpp
#include <cstdio> #include <cstring> using namespace std; const int N = 1e5 + 10; struct Edge { int to, next; } edge[N]; int head[N], cnt; void insert(int u, int v) { edge[++cnt] = { v, head[u]}; head[u] = cnt; } int n, d, tag; void dfs(int now, int fa, int dis) { if (dis > d) { tag = now; d = dis; } for (int i = head[now]; i; i = edge[i].next) { int v = edge[i].to; if (fa == v) continue; dfs(v, now, dis + 1); } } void solve() { memset(head, 0, sizeof head); cnt = 0; scanf("%d", &n); for (int i = 1; i < n; ++i) { int u, v; scanf("%d%d", &u, &v); insert(u, v); insert(v, u); } d = 0; tag = 1; dfs(1, 0, 0); d = 0; dfs(tag, 0, 0); printf("%d\n", d); } int main() { int T; scanf("%d", &T); while (T--) solve(); return 0; }
fa164b050820044c164c3129f6151f9a9c314236
a4391f2d2d8eae762a04686ad3dbbac96215479c
/coursera_yellow_belt_cpp/week5/PA003_figures/figures.cpp
106f94951b9edf35cbb57be7eb7a80a6d67dfddd
[]
no_license
svspirivm/cpp_development_fundamentals
c34a828d66e1ddd326adec66ebfae321a102bb70
6c5670bc6288d92ca2524b38c17ec7778590a686
refs/heads/main
2023-01-28T06:41:02.943164
2020-12-10T12:02:03
2020-12-10T12:02:03
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,444
cpp
figures.cpp
#include<iostream> #include<vector> #include<memory> #include<string> #include<sstream> #include<iomanip> #include<cmath> using namespace std; class Figure { public: Figure() { } virtual string Name() const = 0; virtual double Perimeter() const = 0; virtual double Area() const = 0; private: }; class Rect : public Figure { public: Rect(const double& width, const double& height) { width_ = width; height_ = height; } virtual string Name() const override { return "RECT"; } virtual double Perimeter() const override { return 2 * (width_ + height_); } virtual double Area() const override { return width_ * height_; } private: double width_; double height_; }; class Triangle : public Figure { public: Triangle(const double& a, const double& b, const double& c) { a_ = a; b_ = b; c_ = c; } virtual string Name() const override { return "TRIANGLE"; } virtual double Perimeter() const override { return a_ + b_ + c_; } virtual double Area() const override { double p = this->Perimeter() / 2; return pow(p * (p - a_) * (p - b_) * (p - c_), 0.5); } private: double a_; double b_; double c_; }; class Circle : public Figure { public: Circle(const double& radius) { radius_ = radius; } virtual string Name() const override { return "CIRCLE"; } virtual double Perimeter() const override { return 2 * 3.14 * radius_; } virtual double Area() const override { return 3.14 * radius_ * radius_; } private: double radius_; }; shared_ptr<Figure> CreateFigure(istringstream& input) { string type; input >> type; if (type == "RECT") { double width = 0, height = 0; input >> width >> height; return make_shared<Rect>(width, height); } else if (type == "TRIANGLE") { double a = 0, b = 0, c = 0; input >> a >> b >> c; return make_shared<Triangle>(a, b, c); } else if (type == "CIRCLE") { double radius; input >> radius; return make_shared<Circle>(radius); } } int main() { vector<shared_ptr<Figure>> figures; for (string line; getline(cin, line); ) { istringstream is(line); string command; is >> command; if (command == "ADD") { is >> ws; figures.push_back(CreateFigure(is)); } else if (command == "PRINT") { for (const auto& current_figure : figures) { cout << fixed << setprecision(3) << current_figure->Name() << " " << current_figure->Perimeter() << " " << current_figure->Area() << endl; } } } return 0; }
305cdabf37fd2ff1e68db347199d12522cc126aa
5428c2d8a5df241bf2dbdccc41aeef726e1a02fa
/Editor/Angulo.h
829a49c9c192f95615a19d1a444901f72a43e080
[]
no_license
tomasmussi/tatucarretarun
10671201b2c94fc0d84cdf1d6496f1d62092d770
75e9ada7d4867d96dd600602db080b55ff6b5f96
refs/heads/master
2021-01-24T09:15:34.564344
2016-10-03T15:31:23
2016-10-03T15:31:23
69,884,040
0
0
null
null
null
null
UTF-8
C++
false
false
238
h
Angulo.h
#ifndef ANGULO_H_ #define ANGULO_H_ #include "constantes.h" class Angulo { public: static void corregir(long* valor); /* Pasajes */ static double aRadianes(long grados); static long aGrados(double radianes); }; #endif /*ANGULO_H_*/
07744a5e66d3d2aab995308545ba0713466ddc6e
09882ac9f3d0949cadc9743544f24a7b12f962fd
/src/html/tagstack.h
9d41ae02720fb976c2ba16a108de171cceb6990e
[]
no_license
ousttrue/w3m1
ddcc240c5d9017ce78dd41cca3197c6bd191f0a1
eaf5969cdacb3f9ae19e1fa32a652c88695fbf4c
refs/heads/master
2022-12-08T23:58:04.264222
2020-09-03T13:30:24
2020-09-03T13:30:24
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,065
h
tagstack.h
#pragma once #include "readbuffer.h" #define MAX_UL_LEVEL 9 #define UL_SYMBOL(x) (N_GRAPH_SYMBOL + (x)) #define UL_SYMBOL_DISC UL_SYMBOL(9) #define UL_SYMBOL_CIRCLE UL_SYMBOL(10) #define UL_SYMBOL_SQUARE UL_SYMBOL(11) #define HR_SYMBOL 26 struct TextLineList; struct environment { HtmlTags env = HTML_UNKNOWN; int type = 0; int count = 0; int indent = 0; }; struct html_feed_environ { private: TextLineList *buf; public: TextLineList *list() const { return buf; } struct readbuffer *obuf; Str tagbuf; int limit; int maxlimit; std::vector<environment> envs; public: html_feed_environ(readbuffer *obuf, TextLineList *buf, int width, int indent = 0); void PUSH_ENV(HtmlTags cmd); void POP_ENV(); char *title; int blank_lines; bool need_flushline(Lineprop mode); void flushline(int indent, int force, int width); void push_render_image(Str str, int width, int limit); void purgeline(); void do_blankline(struct readbuffer *obuf, int indent, int indent_incr, int width); };
5ab3fdb77e2c336e5d5937ca5a1cb6d9960d3afc
2ffd002d702d5e281a94ce85cec050fe822664d0
/Header files/Platform.h
7c814a629539f62538494b983d66d3a6886bd80e
[]
no_license
Salman0115/C-Game-
1a14d0d525698b079305926ea8b892653be167b7
c206b1f7da3f68b4e2036ade8131a4b8280eeba3
refs/heads/main
2023-02-17T06:33:35.142265
2021-01-16T17:01:11
2021-01-16T17:01:11
330,210,446
0
0
null
null
null
null
UTF-8
C++
false
false
356
h
Platform.h
/*! \file Platform.h */ #pragma once #pragma once #include"SFML/Graphics.hpp" #include <Box2D/Box2D.h> #include "Col_Def.h" class Platform : public sf::RectangleShape, public Col_Def { public: Platform(); Platform(b2World * world, const sf::Vector2f& Position, const sf::Vector2f& Size, const float& orientation, sf::Texture* texture); ~Platform(); };
cedcce05458baba1fca914e748950cc3dc953c65
1e7759ceadb45cb7b441f5ecfed1ea5e90016e31
/CS-162/Assignments/Assignment 4/main.cpp
dc68095994f7e576a168c37537767bec061d5237
[]
no_license
bpranaw/CS-Assignments
166fe3899e4091944a57de8018dc9273e3970253
974382882f439abfa1ea74d5e5c25f106130d720
refs/heads/master
2020-12-20T13:58:50.738834
2020-08-22T13:23:08
2020-08-22T13:23:08
236,100,148
0
0
null
null
null
null
UTF-8
C++
false
false
4,231
cpp
main.cpp
#include "gameplay.h" #include <iostream> #include <stdlib.h> #include "room.h" using std::cout; using std::cin; void facilitate_game(int, bool, int); int main(int argc, char* argv []) { int dimensions = 3; bool debug = false; //Light Error Handing_________________________________________________________________________________________________________________________________________________________ //In case the user enters something incorrect //It's not an exhaustive check but it should do the trick if(argc < 3) { cout << "You have entered an incorrect value somewhere, so the default settings of\nDimensions: 3\nDebug: false\nwill be used..." << endl; } else { char c = argv[2][0]; //This is inside so it doesn't cause a seg fault if((c != 84 && c != 116 && c != 70 && c != 102 ) || argv[1][0] > 57 || atoi(argv[1]) < 3) { cout << "You have entered an incorrect value somewhere, so the default settings of\nDimensions: 3\nDebug: false\nwill be used..." << endl; } else { //Sets the command line arguments as the arguments //that will go into the game dimensions = atoi(argv[1]); if(c == 84 || c== 116) debug = true; } } facilitate_game(dimensions, debug, argc); return 0; } /************************************************************************************* * Function Name: facilitate_game * Description: Allows the players (CPU or human) to play the same * This was put here to save space in main, which has the error * handling * Inputs: N/A * Outputs: N/A ************************************************************************************/ void facilitate_game(int dimensions, bool debug, int argc) { //Actual Gameplay_____________________________________________________________________________________________________________________________________________________________ cout << endl << "********************************************************************************************************" << endl << "Welcome to the Wumpus game!!!\n\nStory: You are an explorer in a WUMPUS CAVE. You must explore the cave and find the Treasure\nFinding a WUMPUS or a bottomless pit room will kill you immediately. Bats will movve you to another orom when you encounter them.\nYou can kill the wumpus by shooting an arrow through rooms in cardinal directions.\n\nInstructions:\nMovement: You can move around north, west, south and east by entering the wasd keys when prompted. LOWERCASE = Movement.\nAttacking: You can fire your arrows north, west, south or east by entering the WASD keys respectively. UPPERCASE = Attacking.\nLEAVING: You may exit the game at any turn by entering either (E) or (e).\nWIN CONDITION: In order to win you need to:\n 1) Kill the Wumpus\n 2) Find the Treasure\n 3) Go back to the start room\n " << endl << endl; //Iniates the game with these parameters Gameplay game(dimensions, debug); string choice; //Computer gameplay if(argc > 3) { bool check = false; while(!check) { //Checks for death if(game.get_has_died()) { //Allows the player to choose a new map for the computer cout << "Would you like to play again with your same map? If so, enter Y, and N if not. Enter E to exit.\nAny false entry is treated as E" << endl; //Prompts them cin >> choice; //Executes the reset if(choice == "Y" || choice == "y") game.game_reset(0); else if(choice == "N" || choice == "n") game.game_reset(1); else break; } //Lets the computer play the game check = game.computer_turn(); } } else { bool check = false; while(!check) { //Checks for death if(game.get_has_died()) { //Prompts the user as to whether they want to play again on the same map cout << "Would you like to play again with your same map? If so, enter Y, and N if not. Enter E to exit.\nAny false entry is treated as E" << endl; cin >> choice; //Executes the reset if(choice == "Y" || choice == "y") game.game_reset(0); else if(choice == "N" || choice == "n") game.game_reset(1); else break; } //Allows the user to play the game check = game.play_game(); } } }
ed62c41571d5c45046d955c2f97c2b715f330beb
76ca52991ca1a1e50d066e9f7c4827b6a4453414
/libs/hwui/FrameInfoVisualizer.h
3040a77ef0d440d21f3060dfc3e869240fa9fb9d
[ "Apache-2.0", "LicenseRef-scancode-unicode" ]
permissive
ResurrectionRemix/android_frameworks_base
3126048967fa5f14760664bea8002e7911da206a
5e1db0334755ba47245d69857a17f84503f7ce6f
refs/heads/Q
2023-02-17T11:50:11.652564
2021-09-19T11:36:09
2021-09-19T11:36:09
17,213,932
169
1,154
Apache-2.0
2023-02-11T12:45:31
2014-02-26T14:52:44
Java
UTF-8
C++
false
false
2,723
h
FrameInfoVisualizer.h
/* * Copyright (C) 2014 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #pragma once #include "FrameInfo.h" #include "Properties.h" #include "Rect.h" #include "utils/RingBuffer.h" #include <utils/Timers.h> #include <memory> namespace android { namespace uirenderer { class IProfileRenderer; // TODO: This is a bit awkward as it needs to match the thing in CanvasContext // A better abstraction here would be nice but iterators are painful // and RingBuffer having the size baked into the template is also painful // But making DrawProfiler also be templated is ALSO painful // At least this is a compile failure if this doesn't match, so there's that. typedef RingBuffer<FrameInfo, 120> FrameInfoSource; class FrameInfoVisualizer { public: explicit FrameInfoVisualizer(FrameInfoSource& source, nsecs_t frameInterval); ~FrameInfoVisualizer(); bool consumeProperties(); void setDensity(float density); void unionDirty(SkRect* dirty); void draw(IProfileRenderer& renderer); void dumpData(int fd); private: void createData(); void destroyData(); void initializeRects(const int baseline, const int width); void nextBarSegment(FrameInfoIndex start, FrameInfoIndex end); void drawGraph(IProfileRenderer& renderer); void drawThreshold(IProfileRenderer& renderer); inline float durationMS(size_t index, FrameInfoIndex start, FrameInfoIndex end) { float duration = mFrameSource[index].duration(start, end) * 0.000001f; // Clamp to large to avoid spiking off the top of the screen duration = duration > 50.0f ? 50.0f : duration; return duration > 0.0f ? duration : 0.0f; } ProfileType mType = ProfileType::None; float mDensity = 0; FrameInfoSource& mFrameSource; nsecs_t mFrameInterval; int mVerticalUnit = 0; int mThresholdStroke = 0; int mNumFastRects; std::unique_ptr<float[]> mFastRects; int mNumJankyRects; std::unique_ptr<float[]> mJankyRects; bool mShowDirtyRegions = false; SkRect mDirtyRegion; bool mFlashToggle = false; nsecs_t mLastFrameLogged = 0; }; } /* namespace uirenderer */ } /* namespace android */
24cb1b6dfb81acc9b95044436c971a7b15d4d526
fe8e8951eb7e7a489eb92612ebb4548027374d58
/headers/Document.h
c00727f6cc86afc8e45dd0dd98a496706c583061
[]
no_license
cfernandomaciel/pattern-recognition
60a7c2a94e845dcf06b4dd597b94b061efe9b382
8aa031762e38d53f1188505d620d2b9c891965d3
refs/heads/master
2022-12-10T11:20:53.457336
2016-10-22T16:01:39
2016-10-22T16:01:39
288,463,909
0
0
null
null
null
null
UTF-8
C++
false
false
703
h
Document.h
#ifndef DOCUMENT_H #define DOCUMENT_H #include "opencv2/opencv.hpp" #include <QString> using namespace std; namespace dynengines { namespace detector { class Document { public : Document(string name); cv::Mat setTextBlocks(cv::Mat imgIn); cv::Mat setTextBlocks(cv::Mat imgIn, int size); cv::Mat setTextBlocks(cv::Mat imgIn, int width, int height); private : int i; string document_name; cv::Mat drawRectangle(cv::Mat imgIn, std::vector<cv::Rect> letterbox); void cut(cv::Mat imgIn, cv::Rect rect); void createFolder(); }; } } #endif // DOCUMENT_H
adf1cf0610d260e9030be40905b9d9fa8ed039a3
75b54f62c18f420bc81262df202b781a63120087
/Cell.cpp
918c80510061ec1271dd20074524c3a649a2699d
[]
no_license
xSeditx/Evolving_Networks
8bb4aaaab3b18e3e24f170db2a5e31a32b9bb677
5f7088527f6d275c48a2fa02eac8825938b8a53d
refs/heads/master
2021-09-09T19:09:38.448739
2018-03-19T04:21:05
2018-03-19T04:21:05
123,770,338
1
0
null
2018-03-15T07:54:12
2018-03-04T08:27:12
C++
UTF-8
C++
false
false
14,234
cpp
Cell.cpp
// // // Cell class for building and manipulating organisms // // _____ ______ __ __ // / _ \ | ____} | | | | // | | \ _| | |___ | | | | // | | | ___} | | | | // | | _ | | | | | | // | | _/ | | |____ | |______ | |______ // \_____/ |______} |_________| |_________| // // // TODO: Impliment better friction so that cells lose Velocity proportional to their mass and friction Coefficient //============================================================================================================================================================= #include"cell.h" #include"window.h" #include"Vertex2D.h" #include"world.h" //============================================================================================================================================================= // CELL CLASS //============================================================================================================================================================= Cell::Cell(Organism *parent) : Offset(0, 0) , Starting(Offset) , Potential(Offset) , Velocity(0, 0) , Acceleration(0, 0) , Force(0, 0) , ID(parent->Number_of_Cells++) , Friction(RANDOM(1)) , Angle(0) , Speed(0) , Size(10) , Mass(20) , Color(color_from_rgb( (55 + RANDOM(200)), (55 + RANDOM(200)), (55 + RANDOM(200)) )) , Parent(parent) , Brain(Net(3, 5, 2)) { } void Cell::See() const { const float X = Offset.X + Parent->Potential.X, Y = Offset.Y + Parent->Potential.Y; for (int dist = 0; dist < 8; dist++) { const auto Xx = X + dist * _COS(Angle); const auto Yy = Y + dist * _SIN(Angle); SET_PIXELII(Xx, Yy, 0xffffff); } } //============================================================================================================================================================= // ORGANISM CLASS //============================================================================================================================================================= Organism::Organism(unsigned char numcells, int x, int y) : Number_of_Cells(0) , Distance_moved(0.0) , Position(x, y) , Starting(x, y) , Potential(x, y) , X(x), Y(y) , Velocity(0, 0) , Radius(20) , Angle(0) { FOR_LOOP(count, numcells) cells.emplace_back(this); const float Theta = 360.f / Number_of_Cells; for (Cell &c : cells) { Angle += Theta; while (Angle < 0) Angle += 360; while (Angle >= 360) Angle -= 360; const auto Xx = X + Radius * _COS(Angle); const auto Yy = Y + Radius * _SIN(Angle); c.Offset.X = Xx - Position.X; c.Offset.Y = Yy - Position.Y; // rand()%(int)dist;// // rand()%(int)dist;// c.Starting = c.Offset; c.Number_of_edges = 0; } FOR_LOOP(cellcount, numcells) { FOR_LOOP(edgecount, rand() % numcells) { // MAKE EDGES CONNECTING THE OTHER CELLS if (edgecount != cellcount) { int cnum = rand() % numcells; int cnum2 = rand() % numcells; cells[cnum].edges.emplace_back(&cells[cnum], &cells[cnum2], RANDOM(1)); cells[cnum2].edges.emplace_back(&cells[cnum2], &cells[cnum], RANDOM(1)); cells[cnum].Number_of_edges++; cells[cnum2].Number_of_edges++; } } } } Organism* Organism::Copy(Organism *Parent) { *this = *Parent; return this; } Organism* Organism::Mutate(Organism Parent) { this->Number_of_Cells = Parent.Number_of_Cells; this->cells = Parent.cells; this->Velocity.X = 0; this->Velocity.Y = 0; this->Distance_moved = 0; FOR_LOOP(cellcount, Parent.Number_of_Cells) { this->cells[cellcount].Offset = this->cells[cellcount].Starting; this->cells[cellcount].Velocity = 0; this->cells[cellcount].Force = 0; this->cells[cellcount].Acceleration = 0; this->cells[cellcount].Speed = 0; this->cells[cellcount].Angle = 0; this->cells[cellcount].Parent = this; this->cells[cellcount].Brain.Layers[0].Neurons[0].Value = 0; this->cells[cellcount].Brain.Layers[0].Neurons[1].Value = 0; this->cells[cellcount].Brain.Layers[0].Neurons[2].Value = 0; this->cells[cellcount].Brain.Layers[1].Neurons[0].Value = 0; this->cells[cellcount].Brain.Layers[1].Neurons[1].Value = 0; this->cells[cellcount].Brain.Layers[1].Neurons[2].Value = 0; this->cells[cellcount].Brain.Layers[1].Neurons[3].Value = 0; this->cells[cellcount].Brain.Layers[1].Neurons[4].Value = 0; FOR_LOOP(HNeuron, Parent.cells[cellcount].Brain.Layers[1].Number_of_Neurons) { FOR_LOOP(HSynapses, Parent.cells[cellcount].Brain.Layers[0].Number_of_Neurons) { this->cells[cellcount].Brain.Layers[1].Neurons[HNeuron].Synapses[HSynapses].Weight += ((RANDOM(2) - 1) / 10); } } this->cells[cellcount].Brain.Layers[2].Neurons[0].Value = 0; this->cells[cellcount].Brain.Layers[2].Neurons[1].Value = 0; FOR_LOOP(ONeuron, Parent.cells[cellcount].Brain.Layers[2].Number_of_Neurons) { FOR_LOOP(OSynapses, Parent.cells[cellcount].Brain.Layers[1].Number_of_Neurons) { this->cells[cellcount].Brain.Layers[2].Neurons[ONeuron].Synapses[OSynapses].Weight += ((RANDOM(2) - 1) / 10); } } } return this; } void Organism::Update(float Time_Step) { const auto DELTA_TIME = (SDL_GetTicks() - SCREEN->TIME) / 10; SCREEN->TIME = SDL_GetTicks(); float Xmove = 0, Ymove = 0; for (Cell &Parent : cells) { Parent.Acceleration = Parent.Force / Parent.Mass; Parent.Velocity += Parent.Acceleration; Parent.Offset += Parent.Velocity; Parent.Force = 0; Xmove += Parent.Offset.X; Ymove += Parent.Offset.Y; } Xmove = Xmove / Number_of_Cells; Ymove = Ymove / Number_of_Cells; X = Xmove + Potential.X; Y = Ymove + Potential.Y; Potential.X = Xmove + Starting.X; Potential.Y = Ymove + Starting.Y; Distance_moved = sqrt(Squared(X - Starting.X) + Squared(Y - Starting.Y)); for (Cell &Parent : cells) { Parent.Velocity *= .5f; // APPLY A CRUDE "FRICTION" SO THAT VELOCITY IS LOST OVER TIME Parent.See(); Parent.Brain.Think(); for (Edge &Child : Parent.edges) { // For Every Cell Get and Set Information about all Connecting Cells. const int off = Child.Child_ID; Child.Angle = GetAngle(Parent.Offset, cells[off].Offset); Child.Displacement = Get_Displacement(cells[off].Offset, Parent.Offset) - Child.RestDistance; Child.Distance = Child.Get_Distance(cells[off]); constexpr float K = .1f; cells[off].Force.X += -K * Child.Displacement.X; cells[off].Force.Y += -K * Child.Displacement.Y; // acceleration = (−SpringStiffness ⁄ mass) * Position cells[off].Brain.Layers[0].Neurons[1].Value = cells[off].Force.X; //Parent.Brain.Layers[2].Neurons[1].Value; cells[off].Brain.Layers[0].Neurons[0].Value = cells[off].Force.Y; //.Brain.Layers[2].Neurons[0].Value; } while (Parent.Angle < 0) Parent.Angle += 360; while (Parent.Angle >= 360) Parent.Angle -= 360; } for (Cell &C : cells) { C.Speed = C.Brain.Layers[2].Neurons[0].Value * 30; C.Angle += (C.Brain.Layers[2].Neurons[1].Value * 5); while (C.Angle < 0) C.Angle += 360; while (C.Angle >= 360) C.Angle -= 360; C.Force.X += C.Speed * _COS(C.Angle); C.Force.Y += C.Speed * _SIN(C.Angle); } } void Organism::Draw() const { FOR_LOOP(cellcount, Number_of_Cells) { FOR_LOOP(edgecount, cells[cellcount].Number_of_edges) { const int Child = cells[cellcount].edges[edgecount].Child_ID; const float x1 = cells[cellcount].Offset.X + Potential.X, y1 = cells[cellcount].Offset.Y + Potential.Y, x2 = (x1 + cells[Child].Offset.X + Potential.X) / 2, y2 = (y1 + cells[Child].Offset.Y + Potential.Y) / 2; SET_DRAW_COLOR(cells[cellcount].Color); LINE(x1, y1, x2, y2); } } } int Organism::Collision(Organism *List []) const { CIRCLE(X, Y, 50); FOR_LOOP(OrganismCount, 55) { if (List[OrganismCount] != this) { if (sqrt(Squared(List[OrganismCount]->Y - this->Y) + Squared(List[OrganismCount]->X - this->X)) < 50) { List[OrganismCount]->Mutate(Organism(*this)); FILLED_CIRCLE(X, Y, 30); FILLED_CIRCLE(List[OrganismCount]->X, List[OrganismCount]->Y, 30); } } } return 1; } //============================================================================================================================================================= // EDGE CLASS //============================================================================================================================================================= Edge::Edge(Cell *parent, Cell *other, unsigned char tension) : Parent_ID(parent->ID), Child_ID(other->ID), Tension(tension), Angle(0), Parent_ptr(parent), Child_ptr(other), Distance(Get_Distance(*other)), RestDistance(Get_Displacement(other->Offset, parent->Offset)), Displacement(0, 0) { }
0274b4a844f425b42e8984d121e4b21f4dbe21e2
1dff02275f30fe1b0c5b4f15ddd8954cae917c1b
/ugene/src/plugins/external_tool_support/src/utils/ExternalToolSupportAction.cpp
003ed6f93580500ad0a1d4570b3605eec3a5e5c9
[ "MIT" ]
permissive
iganna/lspec
eaba0a5de9cf467370934c6235314bb2165a0cdb
c75cba3e4fa9a46abeecbf31b5d467827cf4fec0
refs/heads/master
2021-05-05T09:03:18.420097
2018-06-13T22:59:08
2018-06-13T22:59:08
118,641,727
0
0
null
null
null
null
UTF-8
C++
false
false
5,638
cpp
ExternalToolSupportAction.cpp
/** * UGENE - Integrated Bioinformatics Tools. * Copyright (C) 2008-2012 UniPro <ugene@unipro.ru> * http://ugene.unipro.ru * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include "ExternalToolSupportAction.h" #include <U2Core/AppContext.h> #include <U2Core/AppSettings.h> #include <U2Core/UserApplicationsSettings.h> namespace U2 { ExternalToolSupportAction::ExternalToolSupportAction(QObject* p, GObjectView* v, const QString& _text, int order, const QStringList& _toolNames) : GObjectViewAction(p,v,_text,order), toolNames(_toolNames) { QFont isConfiguredToolFont; bool isOneOfToolConfigured=false; foreach(QString toolName, toolNames){ if(!AppContext::getExternalToolRegistry()->getByName(toolName)->getPath().isEmpty()){ isOneOfToolConfigured=true; } ExternalTool* exTool=AppContext::getExternalToolRegistry()->getByName(toolName); connect(exTool, SIGNAL(si_pathChanged()), SLOT(sl_pathChanged())); } connect(AppContext::getAppSettings()->getUserAppsSettings(), SIGNAL(si_temporaryPathChanged()), SLOT(sl_pathChanged())); if(!isOneOfToolConfigured || (AppContext::getAppSettings()->getUserAppsSettings()->getUserTemporaryDirPath().isEmpty())){ isConfiguredToolFont.setItalic(true); setFont(isConfiguredToolFont); // setText(text()+"..."); setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getGrayIcon()); }else{ isConfiguredToolFont.setItalic(false); setFont(isConfiguredToolFont); // if(text().endsWith("...")){ // setText(text().remove(text().length()-3,3)); // }else{ // setText(text()); // } if(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->isValid()){ setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getIcon()); }else{ setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getWarnIcon()); } } } ExternalToolSupportAction::ExternalToolSupportAction(const QString& _text, QObject* p, const QStringList& _toolNames) : GObjectViewAction(p, NULL, _text), toolNames(_toolNames) { QFont isConfiguredToolFont; bool isOneOfToolConfigured=false; foreach(QString toolName, toolNames){ if(!AppContext::getExternalToolRegistry()->getByName(toolName)->getPath().isEmpty()){ isOneOfToolConfigured=true; } ExternalTool* exTool=AppContext::getExternalToolRegistry()->getByName(toolName); connect(exTool, SIGNAL(si_pathChanged()), SLOT(sl_pathChanged())); } connect(AppContext::getAppSettings()->getUserAppsSettings(), SIGNAL(si_temporaryPathChanged()), SLOT(sl_pathChanged())); if(!isOneOfToolConfigured || (AppContext::getAppSettings()->getUserAppsSettings()->getUserTemporaryDirPath().isEmpty())){ isConfiguredToolFont.setItalic(true); setFont(isConfiguredToolFont); // setText(text()+"..."); setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getGrayIcon()); }else{ isConfiguredToolFont.setItalic(false); setFont(isConfiguredToolFont); // if(text().endsWith("...")){ // setText(text().remove(text().length()-3,3)); // }else{ // setText(text()); // } if(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->isValid()){ setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getIcon()); }else{ setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getWarnIcon()); } } } void ExternalToolSupportAction::sl_pathChanged() { QFont isConfiguredToolFont; bool isOneOfToolConfigured=false; foreach(QString toolName, toolNames){ if(!AppContext::getExternalToolRegistry()->getByName(toolName)->getPath().isEmpty()){ isOneOfToolConfigured=true; } } if(!isOneOfToolConfigured || (AppContext::getAppSettings()->getUserAppsSettings()->getUserTemporaryDirPath().isEmpty())){ isConfiguredToolFont.setItalic(true); setFont(isConfiguredToolFont); // if(!text().endsWith("...")){ // setText(text()+"..."); // } setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getGrayIcon()); }else{ isConfiguredToolFont.setItalic(false); setFont(isConfiguredToolFont); // if(text().endsWith("...")){ // setText(text().remove(text().length()-3,3)); // } if(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->isValid()){ setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getIcon()); }else{ setIcon(AppContext::getExternalToolRegistry()->getByName(toolNames.at(0))->getWarnIcon()); } } } }//namespace
de1ce1ae5973aa082e077514907a9ef8757c9eaa
896f155af23de87003a9bf8d557363f5b4ffa1c9
/src_old/src/objective/classify.cpp
e654849f84a55c0cbce865672e450a6464023d89
[]
no_license
teodorvb/phd-track-import
f7c5cb87a7305f8f808999c61edca97382aca4f7
f19ce8d46050632a83732ddf3cb1714af10e7afd
refs/heads/master
2022-12-25T00:58:03.088455
2020-09-20T14:55:32
2020-09-20T14:55:32
297,099,387
0
0
null
null
null
null
UTF-8
C++
false
false
5,377
cpp
classify.cpp
#include "objective/classify.hpp" #include "objective/common.hpp" namespace track_select { namespace objective { Classify::Classify(unsigned int p_size, unsigned int v_size, Classify::FitnessType f_type, unsigned int data_dim, unsigned int categories) : ObjectiveFunc(p_size, v_size), fitness_type_(f_type), input_dim_(data_dim), categories_count_(categories), parallel_exec_(false), generation_counter_(0) {} Classify::Classify(const Classify& obj) : ObjectiveFunc((const ObjectiveFunc&)obj), fitness_type_(obj.fitness_type_), input_dim_(obj.input_dim_), categories_count_(obj.categories_count_), parallel_exec_(obj.parallel_exec_), generation_counter_(obj.generation_counter_) {} Classify& Classify::operator=(const Classify& obj) { ObjectiveFunc::operator=((const ObjectiveFunc&)obj); fitness_type_ = obj.fitness_type_; input_dim_ = obj.input_dim_; categories_count_ = obj.categories_count_; parallel_exec_ = obj.parallel_exec_; generation_counter_ = obj.generation_counter_; return *this; } std::vector<optimizer::OptimizerReportItem> Classify::operator()(const Matrix& pop) const { if (!std::isfinite(pop.sum())) throw ErrorNotFinite("Classify::operator() pop"); std::cout.flush(); unsigned int p_size = populationSize(); std::vector<optimizer::OptimizerReportItem> items(p_size); auto calc = [=](unsigned int me, optimizer::OptimizerReportItem& item) { item = (*this)(Vector(pop.col(me))); }; if (parallelExec()) { std::vector<std::thread> threads; for (unsigned int i = 0; i < p_size; i++) threads.push_back(std::thread(calc, i, std::ref(items[i]))); for (auto & t : threads) t.join(); } else { for (unsigned int i = 0; i < p_size; i++) calc(i, items[i]); } return items; } optimizer::OptimizerReportItem Classify::buildItem(const std::vector<std::tuple<unsigned short, Vector>> &cls) const { optimizer::OptimizerReportItem item; Matrix confusion = Matrix::Zero(categoriesCount(), categoriesCount()); for (const auto& c : cls) { Matrix::Index max_index; std::get<1>(c).maxCoeff(&max_index); confusion(std::get<0>(c), max_index)++; } item.setProperty("Accuracy", confusion.trace()/confusion.sum()); real res = 0; if (type() == ACCURACY) { res = confusion.trace()/confusion.sum(); } else if (type() == LOGPROB) { for (auto& c : cls) { res += std::log(std::get<1>(c)(std::get<0>(c))); } res /= cls.size(); } else if (type() == F1_SCORE) { f1_score(confusion); } else if (type() == MATTEWS) { real tp = confusion(msmm::YES,msmm::YES); real fp = confusion(msmm::NO, msmm::YES); real fn = confusion(msmm::YES, msmm::NO); real tn = confusion(msmm::NO, msmm::NO); res = (tp*tn - fp * fn) / std::sqrt((tp+fp)*(tp+fn)*(tn+fp)*(tn+fn)); } else { std::stringstream ss; ss << "Unsupported fitness " << type(); throw std::runtime_error(ss.str()); } if (std::isfinite(res)) item.setFitness(res); else { item.setFitness(-10); } confusion.resize(std::pow(categoriesCount(), 2), 1); item.setData("Confusion Matrix", confusion); return item; } std::ostream& operator<<(std::ostream& out, Classify::FitnessType& type) { switch (type) { case Classify::ACCURACY: out << "accuracy"; break; case Classify::F1_SCORE: out << "f1-score"; break; case Classify::MATTEWS: out << "mattews"; break; case Classify::PRECISION_ONLY: out << "precision_only"; break; case Classify::PRECISION_PRIORITY: out << "precision_priority"; break; case Classify::SENSITIVITY_SPECIFICITY: out << "sensitivity_specificity"; break; case Classify::LOGPROB: out << "logprob"; break; default: std::runtime_error("Unknow Fitness"); } return out; } std::istream& operator>>(std::istream& in, Classify::FitnessType& type) { std::string data; in >> data; if (data == "accuracy") { type = Classify::ACCURACY; } else if (data == "f1-score") { type = Classify::F1_SCORE; } else if (data == "mattews") { type = Classify::MATTEWS; } else if (data == "precision_only") { type = Classify::PRECISION_ONLY; } else if (data == "precision_priority") { type = Classify::PRECISION_PRIORITY; } else if (data == "sensitivity_specificity") { type = Classify::SENSITIVITY_SPECIFICITY; } else if (data == "logprob") { type = Classify::LOGPROB; } else { throw std::runtime_error("cannot read Classify::FitnessType" " from istream: " + data); } return in; } void Classify::setParallelExec(bool exec) { parallel_exec_ = exec; } } }
14bf57d18649f7dadcf3452ba2d16a658c89f2d1
564202fe2e6eead9981a85f10c1cc6d84f48aa21
/EjercicioUno/ejer6prac3.cpp
7378b619aa7d89ab0978d03426731042a1cbf0bd
[]
no_license
JhosefRea/EjercicioUno-1
6be8c52a942657194f4c921af7c192fe10ed4bd2
753e0c3cf27f323b377bf6c932d320211b2f184a
refs/heads/master
2022-11-25T18:47:52.979147
2020-08-04T22:23:57
2020-08-04T22:23:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
504
cpp
ejer6prac3.cpp
#include <iostream> #include <string> #include <iomanip> using namespace std; int main() { int b=0,d=1,a; while(d<=5){ while(b==0){ cout<<d<<". Ingrese el número: "; cin>> a; if(a>=1 && a<=30){ b=1; }else{ cout<<"el número ingresado debe ser entre 1 y 30"<<endl; } } b=0; for(int i=1;i<=a;i++){ cout<<"*"; } cout<<endl; d++; } }
298a04123a3f91a41456043814cc161dffc25a60
0dc37855b2ea3cbb5a76119435a857919d9284c4
/08定义与声明/08定义与声明/main.cpp
d5aafc2162f1ee7867bfe03473fbf323b9b08d4f
[]
no_license
andangel/CPP
1e337c82fa97e8a16d4bd2a76665a4c8fcb424ff
435487482316e0c521220e9518fb7a04140b5122
refs/heads/master
2018-09-30T02:10:14.995622
2018-09-09T17:47:50
2018-09-09T17:47:50
110,524,237
0
0
null
null
null
null
GB18030
C++
false
false
1,035
cpp
main.cpp
#include "main.h" /* 编译器在main函数调用其他函数,只会往上找函数的定义 如果找不到函数的定义 则找函数声明,如果没有函数声明,编译器则会警告 c++会报错 如果调用一个没有定义的函数则会报错 */ int main(int argc, char * argv[])//argv类型是char * 的数组,其实就是二维字符串数组 { char str[] = { "Hello!" }; int length = sizeof(str) / sizeof(char); //数组传递的是指针.所以不能在数组里面判断数组元素.因为它返回的都是指针的长度 OutputString(length, str); char strs[3][100] = { {"哈哈哈"}, {"你是煞笔"}, {"草你妹"} }; char *p[3] = {strs[0],strs[1],strs[2]};//将字符数组的第一个元素指针赋值给指针数组的第一个元素 //p[0] = strs[0];//将字符数组的第一个元素指针赋值给指针数组的第一个元素 //cout << p << endl; ////p[0] = &strs[0][0]; ////cout << p << endl; //p[1] = strs[1]; //p[2] = strs[2]; OutputStrings(3, p); system("pause"); return 0; }
ca8dd145d9d6377b2ea38c10e6e22c7d43ac42f1
eda4cab2ee431fababa9cc39eff0d5eaaaf0df79
/twoDvector.h
c00ff7ae7df2637aac9bfabdc29ee482f7d297c0
[]
no_license
mpily/billiards
b8ad483292f6f64c515a2f0b92301b6e36caa065
ff23aa1f76b9fa8b3dbf64b0696fd87d21f78482
refs/heads/master
2020-12-09T19:47:37.526824
2020-01-22T08:11:22
2020-01-22T08:11:22
233,403,211
0
0
null
null
null
null
UTF-8
C++
false
false
1,274
h
twoDvector.h
#ifndef PI #define PI 3.1415926535897932 #endif #ifndef TWODVECTOR #define TWODVECTOR class twoDvector { private: /* data */ public: double xcomp;//to represent x component of vector double ycomp;//to represent y component of vector double magn;//to represent magnitude of the vector double angle;//to represent angle to the horizontal twoDvector (double xcomp,double ycomp); twoDvector(double mag,double angle,bool); twoDvector(); long double dotProd(twoDvector & b); twoDvector operator +(twoDvector b){ twoDvector toret(this->xcomp+b.xcomp,this->ycomp+b.ycomp); return toret; } twoDvector operator -(twoDvector b){ twoDvector toret(this->xcomp-b.xcomp,this->ycomp-b.ycomp); return toret; } twoDvector operator *(long double c){ twoDvector toret(this->xcomp*c,this->ycomp*c); return toret; } /* twoDvector operator *(int c){ twoDvector toret(this->xcomp*c,this->ycomp*c); return toret; }*/ void operator =(twoDvector b){this->xcomp = b.xcomp; this->ycomp = b.ycomp;this->magn = b.magn; this->angle = b.angle;} virtual ~twoDvector () = default; //have not implemented cross product because I am not sure it will be needed }; #endif
21072a4070475dda38b7f3812e67b18bccbacb96
23010d729fd4af75fecba6c988581370d6400884
/src/libtpm2/include/crypto_tools.h
214bf31bf10fc72fc8921768d28c85d3b1ad3fc4
[]
no_license
erbth/TPM2
013a5b533e5e7562026909db327d47c96f3391d2
0142dba45fa899ea7d63d3f374e0fb835897a727
refs/heads/master
2021-11-22T14:09:05.779943
2021-08-22T02:28:42
2021-08-22T02:28:42
252,819,285
0
0
null
null
null
null
UTF-8
C++
false
false
336
h
crypto_tools.h
/** Cryptographic tools */ #ifndef __CRYPTO_TOOLS_H #define __CRYPTO_TOOLS_H #include <string> /* Warning: Both functions modifiy the position within fd */ bool verify_sha256_fd (int fd, std::string digest); /* digest is of size 32 bytes */ bool verify_sha256_fd (int fd, const unsigned char* digest); #endif /* __CRYPTO_TOOLS_H */
b618497b08552ecab2981fa99918a59504eafa6a
2eb51675c54f2eeae69ffde1e6bff3de7d8650dd
/.history/code/LRU_20200917230240.cpp
babe46bd572bb61dc1870977a6262fe56c50aa04
[ "Unlicense" ]
permissive
nlwmode/Cpp_Interview_Guide
c9a2f53311db90c8a10890c6b1e36c9991e4420e
a196d875e46ae77df6ad3b40d8d279d7919cc3f2
refs/heads/master
2022-12-17T09:58:05.716082
2020-09-17T18:03:15
2020-09-17T18:03:15
295,740,193
10
0
null
null
null
null
UTF-8
C++
false
false
1,314
cpp
LRU_20200917230240.cpp
#include<iostream> #include<list> #include<unordered_map> using namespace std; class LRU { private: int capacity; list < pair<int , int> > cache; //用于保存当前缓存窗口 unordered_map<int , list< pair<int , int> >::iterator > umap; // 编号以及在list中的下标,方便删除 public: LRU(int cap): capacity(cap) {} // 往缓存中插入新值 void put(int key , int val) { auto it = umap.find(key); if(it != umap.end()) { cache.erase(it->second); umap.erase(key); } // 先插入在判断是否超过缓存大小,会省很多判断 cache.push_front( pair<int , int>(key ,val)); umap.emplace(key ,cache.begin()); if(cache.size() > capacity) { umap.erase(cache.back().first); cache.pop_back(); } } // 通过key,来取值 int get(int key) { auto it = umap.find(key); if(it != umap.end()) { return -1; } auto target_it = it->second; pair<int , int> tmp{target_it->first , target_it->second}; cache.push_front( tmp ); cache.erase(target_it); umap.erase(key); umap.emplace(key , cache.begin()); return tmp.second; } };
cee855621cd87e482582c1d578b60ca62241b92d
30912d948683f21c1b9bad4e13dfca7d1ed1721a
/Inc/OVRTOS/OVThread.hpp
0794e3110013895cf746c7d6d910ad3d4fdcabe2
[]
no_license
alsaibie/OpenVentilatorFW
e2350e281a50ceda46a24bc80d5233bce587ebe6
71795f724e4e3b3c7366c039787e87aa01bdda14
refs/heads/master
2021-05-20T02:29:49.435194
2020-05-01T23:01:45
2020-05-01T23:01:45
252,148,090
1
0
null
null
null
null
UTF-8
C++
false
false
1,641
hpp
OVThread.hpp
#ifndef OVTHREAD_HPP_ #define OVTHREAD_HPP_ #include "FreeRTOS.h" #include "task.h" namespace OVRTOS { class OVThread { public: inline uint32_t start() { // TODO: Add check guards if (xTaskCreate(&task, thread_name, thread_stack_depth, (void *)this, thread_priority, &task_handle) == pdPASS) { return pdPASS; } else { return pdFAIL; } } inline char *get_name() { return pcTaskGetName(task_handle); } protected: OVThread(const char *name, uint32_t stack_depth, uint32_t priority, uint32_t Ts_ms) : thread_stack_depth(stack_depth), thread_priority(priority), t_sampling_ticks(pdMS_TO_TICKS(Ts_ms)), initializedDelay(false) { thread_name = name; }; ~OVThread(){} inline static void task(void *arg) { OVThread *ptr = static_cast<OVThread *>(arg); ptr->run(); } virtual void run() { /* Redefine this function when inheriting */ /* Do thread stuff */ thread_lap(); /* Call to complete the thread period */ } inline void thread_lap() { if (!initializedDelay) { initializedDelay = true; previousWakeTick = xTaskGetTickCount(); } vTaskDelayUntil(&previousWakeTick, t_sampling_ticks / portTICK_PERIOD_MS); } private: const char *thread_name; TaskHandle_t task_handle; uint32_t thread_stack_depth; uint32_t thread_priority; TickType_t t_sampling_ticks; bool initializedDelay; TickType_t previousWakeTick; }; } // namespace OVRTOS #endif /* OVTHREAD_HPP_ */
121a552f52cca75cd9f37fa4245ed0d5a54508d1
439d88c4935bd9f325bda1c65283cb40fa704e7e
/sketch/stepper/stepper.ino
e3792a7cbec8652d599bd67e44869ccb2e0e21fb
[]
no_license
pamtdoh/orchestrion
a1b602ce03d8014415e9f63891422ea4994b543d
d061d74ee06b47a6da1a5793dddca5d35ec7effb
refs/heads/master
2020-07-13T21:00:49.669067
2020-05-27T08:25:58
2020-05-27T08:25:58
205,154,391
0
0
null
null
null
null
UTF-8
C++
false
false
2,675
ino
stepper.ino
#include "component.h" #include <Wire.h> unsigned int periods[] = { 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 65535, 64793, 61156, 57724, 54484, 51426, 48540, 45815, 43244, 40817, 38526, 36364, 34323, 32396, 30578, 28862, 27242, 25713, 24270, 22908, 21622, 20408, 19263, 18182, 17161, 16198, 15289, 14431, 13621, 12856, 12135, 11454, 10811, 10204, 9631, 9091, 8581, 8099, 7645, 7215, 6810, 6428, 6067, 5727, 5405, 5102, 4816, 4545, 4290, 4050, 3822, 3608, 3405, 3214, 3034, 2863, 2703, 2551, 2408, 2273, 2145, 2025, 1911, 1804, 1703, 1607, 1517, 1432, 1351, 1276, 1204, 1136, 1073, 1012, 956, 902, 851, 804, 758, 716, 676, 638, 602, 568, 536, 506, 478, 451, 426, 402, 379, 358, 338, 319, 301, 284, 268, 253, 239, 225, 213, 201, 190, 179, 169, 159, 150, 142, 134, 127, 119, 113, 106, 100, 95, 89, 84, 80 }; // x -> dir: 5, step: 2 // y -> dir: 6, step: 3 // x -> dir: 7, step: 4 // a -> dir: 13, step: 12 // int dir_pins[] = {5, 6, 7, 13}; // int step_pins[] = {2, 3, 4, 12}; class StepperMotor : public Component { public: void note_on(byte note) { period = periods[note]; } void note_off(byte note) { period = 0; } StepperMotor(int step_pin, int dir_pin) : step_pin(step_pin), dir_pin(dir_pin) { pinMode(step_pin, OUTPUT); pinMode(dir_pin, OUTPUT); } void update() { if (period && micros() - last_step > period) { last_step = micros(); digitalWrite(step_pin, HIGH); digitalWrite(step_pin, LOW); } } private: int step_pin; int dir_pin; unsigned int period = 0; unsigned long last_step = micros(); }; int enable_pin = 8; constexpr int stepper_count = 4; StepperMotor* steppers[stepper_count] = { new StepperMotor(2, 5), new StepperMotor(3, 6), new StepperMotor(4, 7), new StepperMotor(12, 13) }; // Adress to differentiate from other slaves constexpr int ADDRESS = 3; void setup() { Serial.begin(115200); Wire.begin(ADDRESS); Wire.onReceive(wireEvent); // set enable pin to LOW for CNC Shield pinMode(enable_pin, OUTPUT); digitalWrite(enable_pin, LOW); Component::map(3, steppers[0]); Component::map(4, steppers[1]); Component::map(5, steppers[2]); Component::map(6, steppers[3]); } void loop() { for (int i = 0; i < stepper_count; i++) { steppers[i]->update(); } } void wireEvent(int available) { while (Wire.available() < CMD_LEN); byte buf[CMD_LEN]; Wire.readBytes(buf, CMD_LEN); byte op = buf[0]; byte* data = buf + 1; cmds[op](data); }
d79e364761d8d3f9772106e191409b51da460d9b
3f6b4edcc87fc49e7ded7f08ea781020665fd5fc
/PropertiesStorage.h
15aa82e0267801b8e504fa0cf5109a27cede3242
[]
no_license
r-lerman/PropStorage
f4f934ffdf0650a706cf5444361eeb92de649d5d
d7e105270736d4fb68074f62f56cb9530254909f
refs/heads/master
2023-03-17T09:40:12.496359
2021-03-04T04:40:14
2021-03-04T04:40:14
312,428,661
0
0
null
null
null
null
UTF-8
C++
false
false
6,147
h
PropertiesStorage.h
#pragma once #include <sstream> #include <iostream> #include <map> #include <typeinfo> namespace Storage { typedef signed __int64 Int64; typedef signed __int32 Int32; typedef std::string String; typedef double Double; enum class PropertyType { Type_Unknown, Type_String, Type_Int32, Type_Int64, Type_Double, }; template<class T> class VariantValue { public: VariantValue() { setDefaultValue(); } VariantValue(const T& val) : m_value(val) { } void setDefaultValue(); void operator= (const T& rVal) { set(rVal); } void set(const T& val) { m_value = val; } T get() const { return m_value; } std::string toString() const; private: T m_value; }; template<class T> inline std::ostream& operator<<(std::ostream& out, const VariantValue<T>& v) { return out << v.toString(); } // -------------------------------------------------------------------------------------------- class Property { public: virtual PropertyType getType() const = 0; virtual std::string getAsString() const = 0; virtual bool fromString(const std::string& value) = 0; virtual bool copy(const Property* p) = 0; virtual bool operator== (const Property* p) = 0; std::string getLastError() const { return m_lastError; } protected: mutable std::string m_lastError; }; inline std::ostream& operator<<(std::ostream& out, const Property *p) { return out << (p ? p->getAsString() : std::string()); } // -------------------------------------------------------------------------------------------- template<class T> class PropValue : public Property, public VariantValue<T> { public: PropValue() { } PropValue(const T& val) : VariantValue<T>(val) { } std::string getAsString() const { return VariantValue<T>::toString(); } T get() const { return VariantValue<T>::get(); } void set(const T& val) { VariantValue<T>::set(val); } bool fromString(const std::string& value); PropertyType getType() const { if (typeid(get()) == typeid(String)) return PropertyType::Type_String; else if (typeid(get()) == typeid(Int32)) return PropertyType::Type_Int32; else if (typeid(get()) == typeid(Int64)) return PropertyType::Type_Int64; else if (typeid(get()) == typeid(Double)) return PropertyType::Type_Double; return PropertyType::Type_Unknown; } bool copy(const Property* p) { m_lastError.clear(); if (p && p->getType() == getType()) { VariantValue<T>::set( dynamic_cast<const Storage::PropValue<T>*>(p)->get() ); return true; } m_lastError = "Illigal operation"; return false; } bool operator== (const Property* p) { return p && p->getType() == getType() && dynamic_cast<const Storage::PropValue<T>*>(p)->get() == get(); } }; // -------------------------------------------------------------------------------------------- using PropertyMap = std::map<std::string, Property*>; class PropertyStorage { friend inline std::ostream& operator<<(std::ostream& out, const PropertyStorage& p); public: PropertyStorage() { } PropertyStorage(const std::string &name) : m_storageName(name) { } ~PropertyStorage() { for (auto& it : m_propStorage) { delete it.second; it.second = nullptr; } m_propStorage.clear(); } void operator= (const PropertyStorage& rVal); bool defineProperty(const std::string &prop_name, PropertyType prop_type); bool isProperyDefined(const std::string& prop_name) { return m_propStorage.find(prop_name) != m_propStorage.end(); } const Property* getProperty(const std::string &prop_name) const; bool setProperty(const std::string &prop_name, const Property* p); bool deleteProperty(const std::string& prop_name); size_t propCount() const { return m_propStorage.size(); } bool saveStorage() const; bool loadStorage(); void setName(const std::string& name) { m_storageName = name; } std::string getName() const { return m_storageName; } std::string getLastError() const { return m_lastError; } static Property* createProperty(PropertyType prop_type); static Property* createProperty(const std::string &value); // Helper methods for convinience (if you sure about the type of the property and you know that propery is defined) bool getProp(const std::string& prop_name, String &val) const; bool getProp(const std::string& prop_name, Int32& val) const; bool getProp(const std::string& prop_name, Int64& val) const; bool getProp(const std::string& prop_name, Double& val) const; String getString(const std::string& prop_name) const; Int32 getInt32(const std::string& prop_name) const; Int64 getInt64(const std::string& prop_name) const; Double getDouble(const std::string& prop_name) const; bool setProp(const std::string& prop_name, const String& val); bool setProp(const std::string& prop_name, const Int32& val); bool setProp(const std::string& prop_name, const Int64& val); bool setProp(const std::string& prop_name, const Double& val); private: std::string m_storageName; PropertyMap m_propStorage; mutable std::string m_lastError; }; inline std::ostream& operator<<(std::ostream& out, const PropertyStorage &p) { for (const auto& it : p.m_propStorage) out << it.first << " = " << it.second << std::endl; return out; } }
0bcb7188de2ba01495ab0b949f10dbbaa15416fb
6af6a8a36e81cd8bd8ec62e0d6c91c1341553525
/aspirant_application/Sublayout.EnemyStats.cpp
47eead7059392aa8835a691fd588dde2a7a90c3e
[ "MIT" ]
permissive
playdeezgames/dcjam2021
0c9511b30134bcc95d72a0e29761013101810c9b
b0846eb8d61ae1a6d2fa22cd016f4316c1b17839
refs/heads/main
2023-05-21T22:57:27.769257
2021-06-15T20:40:44
2021-06-15T20:40:44
353,330,612
3
0
MIT
2021-04-15T10:52:47
2021-03-31T11:21:00
C++
UTF-8
C++
false
false
3,295
cpp
Sublayout.EnemyStats.cpp
#include <sstream> #include "Application.OnEnter.h" #include "Visuals.Texts.h" #include "Game.Avatar.h" #include "Game.Creatures.h" #include "Game.Avatar.Statistics.h" namespace sublayout::EnemyStats { const std::string LAYOUT_NAME = "Sublayout.EnemyStats"; const std::string HEALTH_TEXT_ID = "EnemyHealth"; const std::string ATTACK_TEXT_ID = "Attack"; const std::string STREAK_TEXT_ID = "Streak"; const std::string DEFEND_TEXT_ID = "Defend"; const std::string TEXT_ENEMY_ATTITUDE = "EnemyAttitude"; const std::map<game::creature::Attitude, std::string> attitudeTexts = { { game::creature::Attitude::NEUTRAL, "" }, { game::creature::Attitude::UNIMPRESSED, "Unimpressed" }, { game::creature::Attitude::AMOROUS, "Feeling randy!" }, { game::creature::Attitude::DISGUST, "Disgusted" }, { game::creature::Attitude::HOSTILE, "Angry" }, { game::creature::Attitude::EMBARRASSED, "*BLUSHING*" }, { game::creature::Attitude::DISTRACTED, "Distracted" } }; static void UpdateAttitude() { std::stringstream ss; auto position = game::Avatar::GetPosition(); auto creature = game::Creatures::GetInstance(position); if (creature) { ss << attitudeTexts.find(creature.value().attitude)->second; } ::visuals::Texts::SetText(LAYOUT_NAME, TEXT_ENEMY_ATTITUDE, ss.str()); } static void UpdateHealth() { std::stringstream ss; ss << "Enemy: "; auto position = game::Avatar::GetPosition(); auto creature = game::Creatures::GetInstance(position); if (creature) { auto health = creature.value().health; if (health > 0) { ss << health << "/"; ss << creature.value().descriptor.maximumHealth; } else { ss << "DEAD!"; } ::visuals::Texts::SetText(LAYOUT_NAME, HEALTH_TEXT_ID, ss.str()); } } static void UpdateAttack() { auto attack = game::avatar::Statistics::Read(game::avatar::Statistic::ATTACK) + game::avatar::Statistics::Read(game::avatar::Statistic::STREAK); auto timer = game::avatar::Statistics::Read(game::avatar::Statistic::ATTACK_TIMER); std::stringstream ss; ss << "Courage: " << attack; if (timer > 0) { ss << "(" << timer << ")"; } ::visuals::Texts::SetText(LAYOUT_NAME, ATTACK_TEXT_ID, ss.str()); } static void UpdateStreak() { auto streak = game::avatar::Statistics::Read(game::avatar::Statistic::STREAK); std::stringstream ss; ss << "Streak: " << streak; ::visuals::Texts::SetText(LAYOUT_NAME, STREAK_TEXT_ID, ss.str()); } static void UpdateDefend() { auto defend = game::avatar::Statistics::Read(game::avatar::Statistic::DEFEND); auto timer = game::avatar::Statistics::Read(game::avatar::Statistic::DEFEND_TIMER); std::stringstream ss; ss << "Alertness: " << defend; if (timer > 0) { ss << "(" << timer << ")"; } ::visuals::Texts::SetText(LAYOUT_NAME, DEFEND_TEXT_ID, ss.str()); } const std::vector<::UIState> states = { ::UIState::IN_PLAY_COMBAT, ::UIState::IN_PLAY_COMBAT_RESULT }; void Start() { for (auto state : states) { ::application::OnEnter::AddHandler(state, UpdateHealth); ::application::OnEnter::AddHandler(state, UpdateAttack); ::application::OnEnter::AddHandler(state, UpdateDefend); ::application::OnEnter::AddHandler(state, UpdateAttitude); ::application::OnEnter::AddHandler(state, UpdateStreak); } } }
7f2e1c38063290a457acc11b804d620b002596b8
9f520bcbde8a70e14d5870fd9a88c0989a8fcd61
/pitzDaily/339/pa
0ca5893d823ec288b5dda3f0a531e50fbf5821b7
[]
no_license
asAmrita/adjoinShapOptimization
6d47c89fb14d090941da706bd7c39004f515cfea
079cbec87529be37f81cca3ea8b28c50b9ceb8c5
refs/heads/master
2020-08-06T21:32:45.429939
2019-10-06T09:58:20
2019-10-06T09:58:20
213,144,901
1
0
null
null
null
null
UTF-8
C++
false
false
104,702
pa
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1806 | | \\ / A nd | Web: www.OpenFOAM.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "339"; object pa; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 2 -2 0 0 0 0]; internalField nonuniform List<scalar> 6400 ( -0.126188683253 -0.126190140239 -0.126194201616 -0.126201981305 -0.126213193105 -0.126227706226 -0.126245588708 -0.126267590733 -0.126293931713 -0.126324866769 -0.126363898565 -0.126412939463 -0.126470034465 -0.126535365735 -0.126610367102 -0.126696710915 -0.126795201068 -0.126905664791 -0.127027294155 -0.127157082384 -0.127290965571 -0.127429193386 -0.12757604309 -0.12773652931 -0.1279143167 -0.128109632561 -0.128320214643 -0.128544566059 -0.128782977155 -0.1290365453 -0.129306317908 -0.129591576252 -0.129888007117 -0.130191257203 -0.130500053839 -0.130811606397 -0.131125476853 -0.131448707751 -0.131780744386 -0.132111955333 -0.132443766288 -0.132790999326 -0.133162049351 -0.133549711475 -0.133945320488 -0.134343719033 -0.134740947914 -0.135134720873 -0.135523107526 -0.135904705208 -0.136279112001 -0.136641865763 -0.136985701731 -0.137299306314 -0.137583096364 -0.137848126878 -0.138091084297 -0.138298146858 -0.13846390621 -0.13859826052 -0.138707195909 -0.138793117895 -0.138854199817 -0.138906621584 -0.138977481545 -0.139082605587 -0.139213880662 -0.139342838189 -0.139448997208 -0.139531109393 -0.139594755593 -0.139646008807 -0.139688864641 -0.139723418921 -0.139751369659 -0.13977353497 -0.139790389787 -0.139800719797 -0.139806941204 -0.139809518603 -0.126186584392 -0.126188123493 -0.126191732449 -0.126199345786 -0.126211487529 -0.126226924474 -0.126245103183 -0.126266091303 -0.126291266179 -0.126322182825 -0.126360973475 -0.126409175023 -0.126466352771 -0.126532247133 -0.126607344472 -0.126692678402 -0.126790613236 -0.126901444409 -0.127024036183 -0.127154514527 -0.127287015469 -0.127423513501 -0.127569646764 -0.127729669592 -0.127907484007 -0.128103273706 -0.128313802139 -0.128538336662 -0.128777298623 -0.129031256541 -0.129300653979 -0.129585878638 -0.129883014171 -0.130185997943 -0.130494833524 -0.13080645453 -0.13111967216 -0.131443086878 -0.131775912198 -0.132106860518 -0.132435303843 -0.132781114966 -0.133156414914 -0.133547131675 -0.133943917456 -0.134343654946 -0.134742069895 -0.135137357809 -0.135526869087 -0.135907062339 -0.136277537503 -0.136640446473 -0.136993124213 -0.137309682804 -0.137595002807 -0.137865076433 -0.13810491287 -0.138306113307 -0.138471833902 -0.138605847527 -0.13871058406 -0.138797359316 -0.138862137034 -0.138917082946 -0.138989634128 -0.139095394813 -0.13922843567 -0.139356828853 -0.139461476893 -0.139542505878 -0.139605169884 -0.139655658526 -0.13969797598 -0.139732008559 -0.139758655742 -0.139779191722 -0.139794093414 -0.139803477357 -0.139809186689 -0.139811035091 -0.126180724457 -0.126183282503 -0.12618640205 -0.126193341177 -0.12620506903 -0.126222431346 -0.126242354511 -0.126262619758 -0.126286267526 -0.126316266329 -0.126354459489 -0.126402045347 -0.126459056659 -0.126525100918 -0.126599989276 -0.126682672341 -0.126778641586 -0.126893185579 -0.127017930244 -0.127147476526 -0.127276923301 -0.12740880191 -0.127553266946 -0.127714729352 -0.12789260937 -0.128087434858 -0.128298372832 -0.128523839284 -0.128763458316 -0.129017859114 -0.129287236447 -0.129572516723 -0.129871168944 -0.130172914266 -0.130479523255 -0.130793036357 -0.131105417329 -0.131426321296 -0.131759458631 -0.132092539458 -0.132427096956 -0.132776736848 -0.133148914506 -0.133537200715 -0.133933812356 -0.134334128158 -0.134734458039 -0.135132076332 -0.135524318959 -0.135908655186 -0.136283674286 -0.136647410147 -0.136993542424 -0.13731361414 -0.137610705217 -0.137882516268 -0.138118648352 -0.138318115759 -0.138483459096 -0.138617832313 -0.138725810913 -0.138812755698 -0.138878709335 -0.138940074436 -0.139020225815 -0.13913045489 -0.139258954401 -0.13938263931 -0.139486316631 -0.139566809175 -0.139628698132 -0.13967761605 -0.139716521923 -0.139746751709 -0.139770691501 -0.139788780174 -0.139801073175 -0.139808686503 -0.139813234019 -0.139814772627 -0.126172715558 -0.126175246917 -0.126177641289 -0.126183970679 -0.126194183091 -0.126211248118 -0.126237025886 -0.126257178872 -0.126278883568 -0.126307312486 -0.126344574193 -0.126391638446 -0.126448531105 -0.126513891826 -0.126588267739 -0.126674146906 -0.126773139555 -0.126885558514 -0.127004815263 -0.127125761029 -0.127251063685 -0.127384848004 -0.127530382209 -0.127691289762 -0.127869185613 -0.128064364549 -0.128276005143 -0.128502379212 -0.128742942365 -0.128997791437 -0.129268036528 -0.129553649026 -0.129852315111 -0.130157048459 -0.13045996357 -0.13076847036 -0.131084277889 -0.131403787359 -0.131731461139 -0.132066380176 -0.132408133382 -0.132763082284 -0.133135972527 -0.133523852635 -0.133921061232 -0.134322944307 -0.134725731842 -0.135126382362 -0.135522140717 -0.135910460694 -0.136289073034 -0.136654964869 -0.137003229504 -0.13732885421 -0.13763002789 -0.137901821986 -0.138137744511 -0.138337007735 -0.138502426117 -0.138637891833 -0.138748136733 -0.138837899957 -0.138912078039 -0.138985897478 -0.139071269487 -0.139177820718 -0.139304272949 -0.139426240692 -0.139528224486 -0.139606791062 -0.139665160398 -0.139708378005 -0.13974131852 -0.139768231328 -0.139789511878 -0.139803889399 -0.139812373152 -0.139817889073 -0.139821541102 -0.139823012007 -0.126160275493 -0.126160521894 -0.126163480751 -0.126169860817 -0.126181056838 -0.126196727658 -0.12621970466 -0.126242278812 -0.126265450794 -0.126294113493 -0.126330592891 -0.126377227294 -0.126434142853 -0.126502493578 -0.126581439384 -0.126667612908 -0.126762395401 -0.126866013689 -0.1269769465 -0.127094965874 -0.127220384174 -0.127354087116 -0.127499606196 -0.127660585738 -0.127838519948 -0.12803407206 -0.128246164306 -0.128473598865 -0.128715235324 -0.128971357501 -0.129242004752 -0.129529675807 -0.129831720431 -0.130131926167 -0.13043275471 -0.130738163831 -0.13104846038 -0.131367673943 -0.131696652733 -0.132034651155 -0.132381874306 -0.132741639086 -0.133116741043 -0.133505728779 -0.133904524203 -0.134308841004 -0.134714869776 -0.135119376777 -0.135519507287 -0.135912587524 -0.13629587175 -0.13666597856 -0.137018630658 -0.137349480465 -0.137654430014 -0.137927695199 -0.13816446288 -0.138364691891 -0.138531651727 -0.138669838038 -0.138784314633 -0.138880511878 -0.13896606083 -0.139051667376 -0.139139510863 -0.139245232325 -0.139369348403 -0.139488629181 -0.139587654076 -0.139661778976 -0.139713143981 -0.139748782185 -0.139777336341 -0.139801133354 -0.139817249061 -0.139826188845 -0.139830864237 -0.139834585192 -0.139836260295 -0.139836523396 -0.126137049009 -0.12613671995 -0.126142049712 -0.126148416349 -0.126160461456 -0.126177077789 -0.126198124693 -0.126221016038 -0.126246204709 -0.126275773841 -0.126311017713 -0.126357563064 -0.1264193211 -0.12649207712 -0.126570136188 -0.126652349042 -0.126740546091 -0.126837581822 -0.126944641235 -0.127060467295 -0.12718339417 -0.127315840364 -0.127461283089 -0.127622550644 -0.127800761851 -0.127996002402 -0.128208970547 -0.128437269323 -0.128680568924 -0.128937966331 -0.129210882059 -0.129499070657 -0.129798646133 -0.130102157627 -0.130397148671 -0.130694859541 -0.131003053224 -0.13132317013 -0.131654449707 -0.131996034843 -0.132348136406 -0.132712622766 -0.133091065044 -0.133482561797 -0.133884060971 -0.134291742325 -0.134701867646 -0.135111119999 -0.135516583024 -0.135915484378 -0.13630483354 -0.136681067356 -0.137039941947 -0.137376704179 -0.137686002914 -0.137962082481 -0.138201441027 -0.138404800979 -0.138575711412 -0.138718942431 -0.138839839069 -0.138944874143 -0.139044486592 -0.139137294479 -0.13922832683 -0.139337095791 -0.139461628666 -0.13957677119 -0.139669085617 -0.139733954713 -0.139775480838 -0.139804864766 -0.13982962923 -0.139846471257 -0.13985460442 -0.139856893743 -0.139857467405 -0.139857011608 -0.139855568747 -0.139854786038 -0.126101544159 -0.126104032573 -0.126113301742 -0.126122852151 -0.126132519334 -0.126148986081 -0.126171170795 -0.126194509903 -0.126221087828 -0.126251619037 -0.126288836412 -0.126336241763 -0.126401655024 -0.126473583543 -0.126548372797 -0.126625076502 -0.126708479547 -0.126803206675 -0.126908355819 -0.127019652006 -0.127139355248 -0.127270916544 -0.127415922136 -0.127576665322 -0.127754857796 -0.127951840959 -0.128163591776 -0.12839317625 -0.128638326035 -0.128899838407 -0.129174148259 -0.129460637562 -0.129759255589 -0.130055384822 -0.130347125716 -0.130641672657 -0.130949287376 -0.131270858209 -0.131604811779 -0.131950069441 -0.132306789074 -0.132676077256 -0.13305871935 -0.133453940032 -0.133859285766 -0.134271348942 -0.134686540974 -0.13510157596 -0.135513550254 -0.13591964864 -0.136316725311 -0.136700982855 -0.137067817364 -0.137411807598 -0.137726988104 -0.138008061927 -0.138252622141 -0.138461951187 -0.138639566256 -0.138789951391 -0.138919019339 -0.139035020622 -0.139144524042 -0.139244046924 -0.139349285048 -0.139462327729 -0.139585420657 -0.139692369387 -0.139772831897 -0.139825534964 -0.139858463519 -0.139882910874 -0.139899487322 -0.139904862731 -0.139902466393 -0.139896297261 -0.139890337743 -0.1398835522 -0.139877674072 -0.13987529326 -0.126060081921 -0.126065205087 -0.12607597125 -0.126090125082 -0.126100488691 -0.126117289189 -0.126138482585 -0.126162589521 -0.126191021023 -0.126219640607 -0.126260552324 -0.12631400021 -0.126377508791 -0.126446813908 -0.126516712102 -0.126588071243 -0.126669909407 -0.126764197024 -0.126865003006 -0.126971775469 -0.127088553908 -0.127218756717 -0.127363130364 -0.127524219516 -0.127703020713 -0.127899803358 -0.128113508437 -0.128339591221 -0.128589418736 -0.128856898491 -0.129130404938 -0.129410593892 -0.12970561851 -0.129996388853 -0.130283129385 -0.130578665897 -0.130887530111 -0.131210724689 -0.131547315662 -0.131896272486 -0.13225757451 -0.132631870217 -0.133019450201 -0.133419473091 -0.13382979174 -0.134247323861 -0.134668689654 -0.135090738195 -0.135510651371 -0.135925611036 -0.136332327837 -0.13672668652 -0.137103540494 -0.137456830382 -0.137780385109 -0.13806953754 -0.138322670587 -0.138541013883 -0.138727159135 -0.138884873485 -0.139021091287 -0.139145284353 -0.139263914173 -0.139380274931 -0.139498953918 -0.139622464448 -0.139741447985 -0.139837649937 -0.139904618103 -0.139945599666 -0.13997061422 -0.139986042688 -0.139987673233 -0.139977235122 -0.139960662201 -0.139942803645 -0.139925865099 -0.13991096706 -0.139899717845 -0.139894657805 -0.126014980302 -0.12602177437 -0.126032610103 -0.126043826213 -0.126057561188 -0.126078831713 -0.12609933237 -0.126123634256 -0.126155331241 -0.126186108944 -0.126224047745 -0.126281498729 -0.126345537586 -0.126410662011 -0.126476249514 -0.126546423359 -0.126626182608 -0.126717294841 -0.126813906292 -0.126917480493 -0.127031576292 -0.127159288437 -0.127301497545 -0.127461608886 -0.127644797071 -0.12783982317 -0.128054990646 -0.12828595114 -0.128533544564 -0.128799116763 -0.129074753532 -0.129358699766 -0.129638683973 -0.129921684257 -0.130209068827 -0.130506551937 -0.130817236019 -0.131142273613 -0.131481469569 -0.13183413696 -0.132200127901 -0.132579732664 -0.132972910179 -0.133378711854 -0.133795114887 -0.134219274786 -0.134648073871 -0.135078588965 -0.135508142117 -0.135933929415 -0.136352519401 -0.136759429964 -0.137148942078 -0.137514489499 -0.13784991485 -0.138151077419 -0.13841646746 -0.138646076157 -0.138840441764 -0.139003240622 -0.139144674126 -0.139277911747 -0.139410468624 -0.139543826941 -0.139676369663 -0.139815736993 -0.139940835045 -0.140021607093 -0.140073853418 -0.140103334731 -0.140117658696 -0.140116279894 -0.140096357001 -0.140064178328 -0.140028023432 -0.139992829253 -0.139960830514 -0.139935566421 -0.139918449205 -0.139910525397 -0.125965728119 -0.125973725497 -0.125986185099 -0.125996693282 -0.126011250658 -0.126032482443 -0.126053163094 -0.126076896868 -0.126106966448 -0.126145892945 -0.126185160654 -0.126241322004 -0.126304639329 -0.12636620897 -0.126427225345 -0.126497587971 -0.126577835331 -0.126664003642 -0.126755560949 -0.126856059028 -0.126968334628 -0.127094069234 -0.127234103576 -0.127390321691 -0.127575790753 -0.127775557849 -0.127982999523 -0.128218358625 -0.128466487785 -0.128734004797 -0.129008640991 -0.12928732506 -0.129563107809 -0.129838802713 -0.130125618771 -0.130425082406 -0.130737869792 -0.131064981486 -0.131406789752 -0.13176313033 -0.13213393389 -0.132519215541 -0.132918632154 -0.133331112095 -0.133754696782 -0.134186733569 -0.134624392744 -0.135065058261 -0.135506244192 -0.135945177334 -0.136378282543 -0.136800739266 -0.137206321245 -0.137588095946 -0.137939952943 -0.138257772075 -0.13853882389 -0.138779616262 -0.138978330959 -0.139143169407 -0.139291717495 -0.139439933916 -0.13959082718 -0.139741285976 -0.139889372863 -0.140034687654 -0.140162462076 -0.140254274433 -0.140291720033 -0.140307123134 -0.140304777754 -0.14027849821 -0.140228882835 -0.140165592608 -0.140102341469 -0.140043275984 -0.139992041109 -0.139953810238 -0.139930592046 -0.139920415319 -0.125910308322 -0.125917988987 -0.125931115003 -0.125944054195 -0.125962746786 -0.125980081791 -0.126000136439 -0.126024208428 -0.126048831466 -0.126090791075 -0.126136102766 -0.12619134975 -0.126253476048 -0.126313752954 -0.12637276919 -0.126441117351 -0.126520387811 -0.126602747606 -0.126689950059 -0.126786506895 -0.126896502103 -0.127021354812 -0.12716272131 -0.127315688874 -0.127493053222 -0.127701073759 -0.127911613461 -0.128142724062 -0.128389422028 -0.128646286083 -0.128925139027 -0.129202012635 -0.129472778101 -0.129745936659 -0.130032923173 -0.130334013023 -0.130648901788 -0.130978297541 -0.131322801747 -0.131682738625 -0.132058399468 -0.132449702818 -0.132855982552 -0.133275998367 -0.13370784272 -0.134149079685 -0.134597213562 -0.135049973301 -0.135505102813 -0.135959879253 -0.136410645768 -0.13685231324 -0.137278321803 -0.1376815173 -0.138055590506 -0.138395254298 -0.138693589627 -0.138940595146 -0.139137651609 -0.139305923275 -0.139470737902 -0.139644200766 -0.139817154628 -0.139984048656 -0.140141858019 -0.140285503616 -0.140410455448 -0.140517001805 -0.140562649363 -0.140569130807 -0.140543233559 -0.14048326976 -0.140391145972 -0.140279653546 -0.140179753618 -0.140090505844 -0.140013937466 -0.139959202004 -0.139930543172 -0.139921000135 -0.125847305 -0.125853207517 -0.125862572099 -0.125879522515 -0.125903426622 -0.125919647879 -0.125939334075 -0.125965302828 -0.125987956117 -0.126026262677 -0.126075732629 -0.126131134471 -0.126191366374 -0.126251069817 -0.126312400112 -0.126379422393 -0.126455302846 -0.126533598854 -0.126617121394 -0.126709536984 -0.12681488351 -0.126935847285 -0.127081419253 -0.127240406479 -0.12740914558 -0.127613030402 -0.12782788603 -0.128051141007 -0.12830399697 -0.128561863558 -0.128828870089 -0.129097209307 -0.129365162203 -0.129641453261 -0.129930005818 -0.130232639325 -0.130549618307 -0.13088151145 -0.131228954277 -0.131592470414 -0.131972877178 -0.132370415636 -0.132784154113 -0.133212521746 -0.133653667172 -0.134105479757 -0.134565873852 -0.135032946077 -0.135504660087 -0.135978417197 -0.136450526593 -0.13691584656 -0.137367810637 -0.137799202643 -0.138202754203 -0.138568838704 -0.138881513883 -0.139126327355 -0.139318743446 -0.139499357901 -0.13969957322 -0.139914331374 -0.140110419029 -0.140291995573 -0.140456705897 -0.140597323588 -0.140712555543 -0.140808065843 -0.140880435966 -0.140896221553 -0.140857588013 -0.140753648769 -0.140597452102 -0.140400458792 -0.1402540132 -0.140128777215 -0.140015919198 -0.139938477931 -0.139910646662 -0.139910055957 -0.125776621778 -0.125780801233 -0.125784893561 -0.125803932732 -0.125827152639 -0.125846567361 -0.125867511654 -0.125895427719 -0.125920730799 -0.125956668428 -0.12600660189 -0.126061195989 -0.126118930673 -0.126175513446 -0.126239590146 -0.126309254597 -0.12638188496 -0.12645628548 -0.126536541815 -0.126625523925 -0.126725724542 -0.126839610868 -0.126981389737 -0.127152491824 -0.127322293072 -0.127512406242 -0.127732960999 -0.127955896512 -0.128196425948 -0.128454848525 -0.128718817768 -0.128982357973 -0.129246955019 -0.129524747276 -0.129815462039 -0.130120056209 -0.130439187123 -0.130773568771 -0.131124259271 -0.131491750862 -0.131876900219 -0.132280582234 -0.132702108561 -0.133139571173 -0.133591021598 -0.134054789086 -0.134529358024 -0.135013199028 -0.135504499147 -0.136000763826 -0.136498467809 -0.136992744717 -0.137477666624 -0.137946058603 -0.138387492325 -0.138781297828 -0.139101934563 -0.139338947031 -0.139525952134 -0.139736411691 -0.140006912756 -0.140285602458 -0.140495972267 -0.140691407616 -0.140859037158 -0.140983787659 -0.141071788703 -0.14114141262 -0.141215730157 -0.14126192593 -0.141242952224 -0.141100027676 -0.140846854412 -0.140494692307 -0.140312882599 -0.140155094148 -0.139981577889 -0.139866666613 -0.139859607575 -0.139893701419 -0.125699014992 -0.125703725028 -0.1257105166 -0.125722843092 -0.125742076812 -0.125763229003 -0.125785823636 -0.125813849593 -0.125844371861 -0.125879323408 -0.125928771474 -0.125982127737 -0.126037721965 -0.126091457923 -0.126153083854 -0.12622520848 -0.126297317458 -0.126369672128 -0.126447252625 -0.126533253246 -0.126629393346 -0.12673673154 -0.126870849374 -0.127045471086 -0.127223799812 -0.127406091117 -0.127624501509 -0.127850643136 -0.128081004387 -0.128332500612 -0.128587814266 -0.128846761894 -0.129115023787 -0.12939534297 -0.129688290973 -0.129995061095 -0.130316810683 -0.130653926618 -0.131007624862 -0.131379290062 -0.131769660915 -0.132179577986 -0.132608882233 -0.133055798826 -0.133518368057 -0.133995408321 -0.134486118065 -0.13498938199 -0.135503459981 -0.136026128861 -0.136554150587 -0.137083618379 -0.13761029535 -0.138127000046 -0.138614893687 -0.139029342906 -0.139356388817 -0.139593098244 -0.139769964802 -0.140033961806 -0.140449108216 -0.140912242877 -0.141063063937 -0.141257718657 -0.141409689904 -0.141520342762 -0.14161509716 -0.141694146403 -0.141759156244 -0.141833906641 -0.142075282489 -0.14193081732 -0.141510577017 -0.140539819628 -0.1403298779 -0.140163047003 -0.139865870767 -0.139680627698 -0.13975898799 -0.139901428084 -0.125612598978 -0.125617834409 -0.1256295376 -0.125635603736 -0.125650481334 -0.125671538943 -0.125695167611 -0.125724281841 -0.125761090485 -0.125794209792 -0.12584222032 -0.125894287055 -0.125948304859 -0.126000901793 -0.126060169031 -0.126131424218 -0.126202608671 -0.126273645312 -0.126349021292 -0.126431990332 -0.126524624016 -0.126627567188 -0.126751832554 -0.126919697294 -0.127110660966 -0.127293069802 -0.127497563999 -0.127732129675 -0.127965481313 -0.128198276373 -0.128443792259 -0.128700136363 -0.128969538661 -0.129251995416 -0.129547404172 -0.129856708531 -0.130181005234 -0.130521353965 -0.130878557668 -0.131254169072 -0.131649853337 -0.132066360109 -0.132503506478 -0.132959825349 -0.133433799741 -0.133925120506 -0.13443384223 -0.134959180029 -0.135499376338 -0.136052279495 -0.136615579256 -0.137187492365 -0.137766846511 -0.138346244341 -0.138885834854 -0.139297976741 -0.139683302009 -0.140018299655 -0.140097037685 -0.140387723678 -0.14096990387 -0.14064845787 -0.140343268153 -0.140168723964 -0.139989212381 -0.139801751767 -0.139596282274 -0.139438897453 -0.139400009794 -0.139422421891 -0.139335767381 -0.139117930791 -0.13880623505 -0.13911507519 -0.140380062515 -0.140669544631 -0.139931909591 -0.139283184269 -0.139585338589 -0.140031056395 -0.125515711178 -0.125520321264 -0.125530290415 -0.125536887939 -0.125549648998 -0.125570744715 -0.125594247714 -0.125621931613 -0.125663976402 -0.125699682007 -0.125746189603 -0.125797339941 -0.125850564514 -0.125903378357 -0.125961150689 -0.126029906799 -0.126099193505 -0.126168858647 -0.126242104557 -0.126322001192 -0.126410766221 -0.126509951291 -0.126626730307 -0.126784201486 -0.126979132581 -0.127169821744 -0.127361118673 -0.127583920701 -0.127821643467 -0.128053369091 -0.128290174405 -0.128541966541 -0.128810808483 -0.129094731758 -0.12939238871 -0.129703987261 -0.130031040213 -0.130374513983 -0.130735661555 -0.131115640335 -0.131516514205 -0.131939678789 -0.132384862897 -0.132850309384 -0.133335045484 -0.133840691168 -0.134369111086 -0.134919435794 -0.135488325505 -0.136074151474 -0.13667770752 -0.137300058642 -0.137944875038 -0.138604237918 -0.139180262609 -0.139572396039 -0.140098378375 -0.139905747777 -0.13951752519 -0.139213621084 -0.139126670393 -0.139007251779 -0.138400308683 -0.137559187588 -0.136575446748 -0.135539967546 -0.134530171524 -0.13368174578 -0.133146338904 -0.132977646634 -0.133047345044 -0.13323115968 -0.133532337111 -0.134225124947 -0.135249404988 -0.1360169424 -0.136316181118 -0.137548937395 -0.139170367419 -0.140633957419 -0.125409824965 -0.125413744349 -0.125423404372 -0.125429346196 -0.125441531406 -0.125461875189 -0.125484747941 -0.125509137258 -0.12554979837 -0.125591518331 -0.125639020834 -0.125690013054 -0.125743290485 -0.125798285108 -0.125854408123 -0.125920358284 -0.125987364864 -0.126055640107 -0.12612664062 -0.126203408115 -0.126288063379 -0.126382637353 -0.126492914273 -0.126638891216 -0.126827282489 -0.127031011272 -0.127220508318 -0.127427302255 -0.127653767669 -0.127882552018 -0.128116023978 -0.128367560734 -0.128636516896 -0.128921597813 -0.129221642575 -0.129536107559 -0.129865833322 -0.130212677186 -0.130577799869 -0.130962571548 -0.131368857262 -0.131798344443 -0.132251358554 -0.132725758421 -0.133220167813 -0.13373921524 -0.134288066618 -0.134864740176 -0.1354628576 -0.136083049123 -0.136731118784 -0.137411868257 -0.138134819311 -0.138889589023 -0.139623864091 -0.139407272865 -0.139202428563 -0.138948817775 -0.138297200169 -0.137480243465 -0.136654923994 -0.135838574653 -0.134677970524 -0.133231658973 -0.131592019512 -0.129895497054 -0.128260790858 -0.126829041006 -0.125748792019 -0.125115892865 -0.124859562283 -0.124850655562 -0.125064081502 -0.125814089379 -0.127418062335 -0.129453430715 -0.131163088059 -0.133269492125 -0.139524369027 -0.140719464794 -0.125296470988 -0.125299353476 -0.125305939167 -0.125312544322 -0.125326650305 -0.12534606283 -0.125368928172 -0.125391202817 -0.125429161825 -0.125473094429 -0.125520943581 -0.12557127785 -0.125623606782 -0.125681802215 -0.125737831563 -0.125800977131 -0.125865786633 -0.125933267587 -0.126002133554 -0.12607578504 -0.126156209549 -0.126245527207 -0.126349225766 -0.12648434236 -0.126662410241 -0.126869911866 -0.127068865729 -0.127265897723 -0.127477235476 -0.127695971529 -0.127925455113 -0.128175549167 -0.128443886835 -0.12872975388 -0.129032368836 -0.129350280825 -0.129683852787 -0.130034376435 -0.130404077862 -0.130793867923 -0.131205658961 -0.131641883512 -0.132102846043 -0.132585792947 -0.133086110713 -0.133611182773 -0.134177712295 -0.134785778417 -0.135414692163 -0.136065999551 -0.136757401999 -0.137493407418 -0.13828209678 -0.139154646913 -0.138909651229 -0.138527115745 -0.138042906872 -0.137380013359 -0.136398971246 -0.135161121947 -0.133738371804 -0.132201404183 -0.130498936857 -0.128678472958 -0.126781596401 -0.124891630779 -0.123082170685 -0.121427074634 -0.119994487167 -0.118850710219 -0.118032702291 -0.117463040158 -0.117162934219 -0.117365761233 -0.118430947873 -0.120490208303 -0.123369354484 -0.127171562645 -0.132914107973 -0.142015803198 -0.125177384839 -0.125179353616 -0.125182422555 -0.125190108051 -0.125205634359 -0.125223773797 -0.12524609322 -0.125268657649 -0.125302392778 -0.125345904669 -0.125392751396 -0.125441497396 -0.125491199684 -0.125548640274 -0.125607866649 -0.125669575569 -0.125732288672 -0.125798899322 -0.12586682788 -0.125937989362 -0.126014519736 -0.126097932177 -0.126194848107 -0.126319318204 -0.126483406401 -0.12668175469 -0.126889003917 -0.127085669987 -0.127287133493 -0.127497403508 -0.127719139119 -0.127965195909 -0.128232831196 -0.128517356049 -0.128822506232 -0.129144394162 -0.129481692132 -0.129837034211 -0.130212409398 -0.130608880603 -0.131027094734 -0.131469489065 -0.131937144277 -0.132428410459 -0.132939277345 -0.133474476495 -0.134048841071 -0.134660632217 -0.135307330238 -0.135993375572 -0.136726832416 -0.137498305676 -0.138397319956 -0.13798649636 -0.137493102218 -0.137031322646 -0.136262505736 -0.135124241698 -0.133670184044 -0.131957445434 -0.130031096781 -0.127957312753 -0.12577926344 -0.1235473192 -0.12127736614 -0.119002686392 -0.116760673015 -0.1145963185 -0.112555559313 -0.110701623821 -0.109117590077 -0.107800844949 -0.106757251603 -0.106138319098 -0.106242669668 -0.107542400951 -0.110391858564 -0.114092976333 -0.11680095267 -0.119172699692 -0.12505334889 -0.125054886259 -0.125056505539 -0.125065623238 -0.125080088233 -0.125095778342 -0.125115090924 -0.12513883869 -0.125168091194 -0.125209719825 -0.125254894096 -0.125301693488 -0.125348998533 -0.12540266134 -0.125463878392 -0.125525552443 -0.125586724858 -0.125651359239 -0.12571835863 -0.125788051527 -0.125861798109 -0.12593923041 -0.126028894004 -0.126143153537 -0.126292844013 -0.126477287685 -0.126680226485 -0.126878665624 -0.127071574127 -0.127273903388 -0.127492831755 -0.1277313926 -0.127995524557 -0.128280466961 -0.128588879142 -0.12891529557 -0.129257105091 -0.129618005315 -0.13000000758 -0.130404367846 -0.130831280497 -0.131281985845 -0.131760045861 -0.132266116546 -0.132793144434 -0.133331882993 -0.133893967909 -0.13449327044 -0.135154634917 -0.135881239061 -0.136647148516 -0.137461301063 -0.136753731251 -0.136046928012 -0.135578860433 -0.134887775232 -0.133670749665 -0.132039952747 -0.130077817224 -0.127861350548 -0.125440759259 -0.1228671453 -0.120176304739 -0.117394749655 -0.11452738756 -0.111591423182 -0.108616361666 -0.105642669787 -0.102710026822 -0.0998631144172 -0.0971645598346 -0.094660467622 -0.0922445500193 -0.0898838456407 -0.0877938640602 -0.086648844122 -0.0868624296849 -0.0852050482662 -0.0732348661277 -0.0559343723457 -0.124923137953 -0.124924472518 -0.124925916691 -0.124936833518 -0.124949698905 -0.124962512895 -0.124977728767 -0.125001412714 -0.125025138339 -0.125064013586 -0.125107349586 -0.125152072873 -0.12519735182 -0.125248228489 -0.125308193286 -0.125369435998 -0.125429512134 -0.125491917191 -0.12555639741 -0.125624332088 -0.125696139432 -0.125768167498 -0.12584967462 -0.125953944726 -0.1260897358 -0.126258571983 -0.126452171292 -0.126648504521 -0.12684307163 -0.127034864686 -0.127247312273 -0.127480860226 -0.127737913919 -0.128015429622 -0.128322838446 -0.12865722752 -0.129006554526 -0.129375213294 -0.129764721179 -0.130177834957 -0.1306161127 -0.131080190283 -0.131576183054 -0.132103842301 -0.132640682307 -0.133172874632 -0.13371471769 -0.134291250722 -0.134992564024 -0.135801161615 -0.136826117895 -0.135494124425 -0.134355172838 -0.133861979317 -0.133233705793 -0.132059207314 -0.130314087918 -0.128161341341 -0.125677833984 -0.122939715862 -0.119994384072 -0.116881337956 -0.113624031898 -0.110237284037 -0.106729238136 -0.103118349068 -0.0994305819026 -0.0956918024465 -0.0919126699006 -0.0880868584598 -0.0842114288218 -0.080279643062 -0.0760877785875 -0.0713513343192 -0.0660996269041 -0.0608859967721 -0.0554106526325 -0.0432047434595 -0.00918176085004 0.0404193617244 -0.124783876439 -0.124784948496 -0.124787221941 -0.124800174192 -0.124811606016 -0.124821838828 -0.124834296045 -0.124855690264 -0.124873584274 -0.124908735127 -0.124949872379 -0.1249922076 -0.125035216083 -0.125083116862 -0.125140359809 -0.125200372136 -0.125260088262 -0.125319962335 -0.125380724895 -0.125445754127 -0.125515399469 -0.125582949893 -0.125655156482 -0.125749253931 -0.125871952225 -0.126024110023 -0.126203732792 -0.126389176218 -0.126584619174 -0.126776713954 -0.126979291033 -0.127201286714 -0.127453737531 -0.127731958746 -0.128031156305 -0.128365204118 -0.12872346974 -0.12910194916 -0.129503326799 -0.129927956022 -0.1303792462 -0.130864487518 -0.13139063137 -0.131942785135 -0.132484439082 -0.133005874071 -0.133525674829 -0.134026911985 -0.134761031797 -0.135860400999 -0.13437923949 -0.132965762785 -0.132241268973 -0.131546682931 -0.130391146157 -0.128605753787 -0.126288967707 -0.123584034357 -0.120567480579 -0.117307296748 -0.113846112847 -0.11021964371 -0.106451952945 -0.102560586369 -0.0985582566847 -0.0944577265279 -0.090265750552 -0.0859745095739 -0.0815495758274 -0.076922389885 -0.0719918586421 -0.0666254509928 -0.0606189806635 -0.0535270797756 -0.0451876075885 -0.0358597700509 -0.0239557055533 -0.00034268155224 0.0508077723514 0.115158249457 -0.124631407035 -0.124632237188 -0.124635324349 -0.124650030247 -0.124659669382 -0.124669056075 -0.124679598161 -0.124697053505 -0.124710887834 -0.124743204147 -0.124781973922 -0.124821553507 -0.124861854047 -0.124906157806 -0.124959358703 -0.125016424666 -0.125076242115 -0.125133456874 -0.125190147197 -0.125251169985 -0.125316872039 -0.12538154487 -0.12544443587 -0.12552694537 -0.125637306995 -0.125773194851 -0.125936328313 -0.126106665663 -0.126290327912 -0.126485778018 -0.126688637255 -0.126900987441 -0.127135314369 -0.127407514626 -0.127710635055 -0.128042722624 -0.128405844852 -0.128793667037 -0.12920764514 -0.129648676358 -0.130121257657 -0.130638736112 -0.131203505205 -0.13178132094 -0.132340776151 -0.132876095349 -0.133387864759 -0.133515277361 -0.134685236037 -0.133269451185 -0.13166713292 -0.130831157484 -0.130034812906 -0.12883075505 -0.127013530234 -0.124583069276 -0.121676448895 -0.118419778776 -0.11489105157 -0.111153231054 -0.107248379985 -0.103211771236 -0.0990681364581 -0.0948327577375 -0.0905092369084 -0.0860882743912 -0.0815419525826 -0.0768186684136 -0.0718377493523 -0.0664804309109 -0.0605692570444 -0.053848117218 -0.0460094303048 -0.0367190384463 -0.0257755638753 -0.0130282585614 0.00424183263168 0.0359381838553 0.0934786180358 0.15355166474 -0.124462541344 -0.124464142107 -0.124467227536 -0.124480315896 -0.124489919029 -0.124501167063 -0.124511533935 -0.124526406466 -0.124540447143 -0.124567605958 -0.124603155467 -0.124639563758 -0.124676772227 -0.124716918829 -0.12476499647 -0.124816669556 -0.124873058689 -0.124928759019 -0.124982809653 -0.125039654081 -0.125099115275 -0.125161844866 -0.125220847006 -0.125287447599 -0.125385079865 -0.125505180429 -0.125650664222 -0.125805157588 -0.125971880359 -0.126160663651 -0.126364278823 -0.126578555997 -0.126799613727 -0.127052840063 -0.127347669291 -0.12768135523 -0.128049938929 -0.128448526461 -0.128874622517 -0.129334940686 -0.129839828172 -0.130401917538 -0.131009324944 -0.13162778665 -0.132246614 -0.132875914253 -0.133692039918 -0.13347975836 -0.132343837732 -0.13069832804 -0.12963556769 -0.128736362449 -0.127449932107 -0.125600879456 -0.123103526673 -0.120044457016 -0.116573657058 -0.112811262505 -0.108836859238 -0.104710935331 -0.100474086816 -0.0961557155309 -0.0917701431375 -0.0873155704379 -0.0827709737129 -0.0780943934313 -0.0732200364857 -0.0680574119422 -0.0624918268782 -0.0563767449433 -0.0494982407321 -0.0415232210866 -0.0320361935681 -0.0207672332643 -0.00763849563114 0.00787994946783 0.0293059517249 0.0658628841699 0.1239273708 0.17652651832 -0.124280190145 -0.124283340701 -0.124285823063 -0.124294264607 -0.124305631136 -0.124318706662 -0.12433019181 -0.124344951913 -0.124361602821 -0.124382392553 -0.124413257348 -0.124445874721 -0.124479656857 -0.12451535484 -0.124557999295 -0.124603863728 -0.12465304148 -0.124706481183 -0.124758890432 -0.124811613061 -0.124864490007 -0.124925816975 -0.124985539298 -0.125043500638 -0.12512076733 -0.125222312447 -0.125348983989 -0.125486300682 -0.125633356607 -0.125807393183 -0.126003514073 -0.12621993035 -0.126437336429 -0.126674496032 -0.126950688971 -0.127274145696 -0.127644581942 -0.128055489418 -0.128498107385 -0.128984630065 -0.129531453346 -0.130145276779 -0.130803736307 -0.131483188816 -0.132188450602 -0.132861111365 -0.133169353179 -0.132048604188 -0.13020408662 -0.128872433356 -0.127758282608 -0.126371182705 -0.124437904245 -0.121887614473 -0.118723507506 -0.115079944042 -0.111107313109 -0.106920134976 -0.102595613904 -0.0981879360209 -0.0937286545154 -0.0892316652177 -0.0846904384818 -0.0800780528206 -0.0753465451564 -0.0704274607572 -0.0652313464918 -0.0596480969684 -0.0535479839325 -0.0467729050604 -0.0390936844542 -0.0301422745511 -0.0194387193741 -0.00665187700092 0.00822439072163 0.0258472497008 0.0500032642464 0.088841720854 0.145044937785 0.191508839245 -0.124092084364 -0.124095148991 -0.124096353975 -0.124099822957 -0.1241115128 -0.124124028822 -0.124135481886 -0.12414887088 -0.124165926466 -0.124184328614 -0.124211380014 -0.124240069896 -0.124270232405 -0.124301242863 -0.124338391348 -0.124378912542 -0.124421771972 -0.124471098294 -0.12452094103 -0.124570904743 -0.124621140883 -0.124678920077 -0.124734749948 -0.124791696548 -0.124856762844 -0.124939025428 -0.125039232244 -0.125154617736 -0.125279134733 -0.125433165545 -0.125612489058 -0.125817083024 -0.126037011599 -0.126264997928 -0.126526494727 -0.126830170674 -0.127189079977 -0.127605005383 -0.128069927775 -0.12858989754 -0.12918630784 -0.129856722261 -0.13058032199 -0.131348050234 -0.132162473323 -0.132422921477 -0.131439795299 -0.129934777017 -0.128492968053 -0.127161491182 -0.125619693013 -0.123611071697 -0.120984304976 -0.117739365516 -0.113957983521 -0.109800850357 -0.105412426872 -0.100897566482 -0.0963240441058 -0.0917324913002 -0.0871375390345 -0.0825318255603 -0.0778858863474 -0.0731505798372 -0.0682588651893 -0.0631272707709 -0.057654983605 -0.0517221743535 -0.045188413216 -0.03788248282 -0.0295615174385 -0.0198484409403 -0.00825855878951 0.0055662878947 0.0217093503009 0.0408815439329 0.0666763743034 0.106021839034 0.159274868614 0.200772875693 -0.123901101121 -0.12390297303 -0.123902330179 -0.123903767162 -0.123911766151 -0.123921168375 -0.123930797236 -0.12394104823 -0.123956216613 -0.123973289804 -0.123997365969 -0.124022040951 -0.124048286856 -0.124074218168 -0.124105564313 -0.124140350672 -0.124177006209 -0.124221522284 -0.124267583401 -0.124314737227 -0.124365041584 -0.124417027262 -0.124467622818 -0.124515410211 -0.124573469556 -0.124644849014 -0.124725085677 -0.124812599589 -0.124912217263 -0.125042337974 -0.12519993301 -0.125380615392 -0.125587217825 -0.125806780355 -0.12605580631 -0.126345510374 -0.126687082185 -0.127097287797 -0.127582021363 -0.128141259528 -0.128789627653 -0.129519355721 -0.130325346663 -0.131221502771 -0.132555684633 -0.131033336609 -0.129645607397 -0.128205273121 -0.126812015787 -0.125149809372 -0.123068382989 -0.120400703574 -0.117088450462 -0.113206530647 -0.108892451231 -0.104315823199 -0.0996102748323 -0.0948662593159 -0.0901355361538 -0.0854394644937 -0.0807718570569 -0.0761038468571 -0.0713864285636 -0.066554378972 -0.0615286417405 -0.0562170032422 -0.0505118193643 -0.044286817756 -0.0373945042349 -0.0296571456358 -0.0208323399878 -0.0105624951565 0.00159616884776 0.0159720233465 0.032667167243 0.0523791533871 0.0784177814659 0.11663332677 0.166352610289 0.203974534322 -0.12370472115 -0.123707040468 -0.123703928913 -0.123705951677 -0.123708503097 -0.123713421725 -0.123719752807 -0.123726255798 -0.123738186282 -0.123751382493 -0.123772153854 -0.123792288939 -0.123813697787 -0.123834151355 -0.123859553974 -0.123887436608 -0.123916750558 -0.123955878743 -0.123996825508 -0.124038064682 -0.124084706128 -0.124128917931 -0.124175013805 -0.124217759157 -0.124260976094 -0.124320228793 -0.124391409784 -0.124456845558 -0.124532253337 -0.124633822243 -0.124769164502 -0.124927967647 -0.125109725481 -0.125308473068 -0.125534714704 -0.125806439281 -0.126129278979 -0.126528961202 -0.127026983905 -0.127624409711 -0.1283163879 -0.129077327071 -0.129864926696 -0.130694618383 -0.130533890239 -0.129484907626 -0.127745111868 -0.126555838232 -0.124869491498 -0.122746206163 -0.120069024538 -0.116737724952 -0.112788228422 -0.108357294511 -0.103613419519 -0.0987211194545 -0.0937974552519 -0.0889135862563 -0.0841007443706 -0.0793586127355 -0.0746603208335 -0.069958560261 -0.0651897856668 -0.0602783713182 -0.055138524008 -0.049673951034 -0.0437749249258 -0.0373148146145 -0.0301475672985 -0.0221002626043 -0.0129447003812 -0.00235553169205 0.0100650101298 0.0246133902788 0.0413730662633 0.0608944491417 0.085971277371 0.121703376833 0.167561154469 0.202346309575 -0.123498808669 -0.12350104498 -0.123498100079 -0.123499513021 -0.123499430782 -0.123500807239 -0.123503346841 -0.123505830794 -0.123513161172 -0.123520616571 -0.123537076653 -0.123552139397 -0.123567130472 -0.123581986486 -0.123601756974 -0.123622072916 -0.123643057308 -0.123674314298 -0.123708499974 -0.123741100841 -0.123780037186 -0.123816522847 -0.12385372335 -0.123895781951 -0.123933133959 -0.123981078248 -0.124039319848 -0.124094400098 -0.124142041859 -0.124210493374 -0.124315590053 -0.124451985109 -0.124610030785 -0.124785479044 -0.124980673434 -0.125221831732 -0.125514942436 -0.125894608835 -0.12639830341 -0.127028001877 -0.127756899186 -0.128536914292 -0.129420731567 -0.130827175404 -0.128576974338 -0.126961980836 -0.12583018044 -0.12466691138 -0.122561563178 -0.119930293071 -0.116626690972 -0.112662693359 -0.108152228675 -0.103273638027 -0.0982058155709 -0.0930978484029 -0.088044849319 -0.0830948584266 -0.0782566080096 -0.0735087408701 -0.0688065755103 -0.0640889608489 -0.0592829822479 -0.0543075082616 -0.0490742220142 -0.0434864336119 -0.0374357609957 -0.0307984716087 -0.023432766929 -0.0151726455154 -0.00580519500241 0.00496500048255 0.0175001668347 0.032082227929 0.048781395128 0.0679626852375 0.0918381079571 0.124832008962 0.166875907476 0.19931171079 -0.12328367221 -0.123284157542 -0.123283522421 -0.123283812782 -0.123282941852 -0.123282182152 -0.123281208711 -0.123279758456 -0.123281913705 -0.123282635819 -0.123293577622 -0.123303448363 -0.123311045731 -0.12331896913 -0.123333577822 -0.123346732629 -0.12335966778 -0.123379315759 -0.12340278544 -0.123425704275 -0.123454253969 -0.123484701382 -0.123518139634 -0.123553059674 -0.123588057877 -0.123623464613 -0.123668956281 -0.123718201702 -0.123743501953 -0.123778953508 -0.123842901585 -0.123946030661 -0.124077573774 -0.124234259534 -0.124399322636 -0.124596852089 -0.124847668578 -0.125189731586 -0.12568645905 -0.126334483451 -0.127062177842 -0.127783002857 -0.128524320949 -0.127987201971 -0.126558173723 -0.124619819818 -0.124024130714 -0.122468682802 -0.119893336959 -0.116703868175 -0.112776261834 -0.108239816491 -0.103259808491 -0.0980371943569 -0.0927449133466 -0.0875093761133 -0.082400058759 -0.0774402235804 -0.072616572544 -0.0678893510568 -0.0632001004485 -0.0584784574839 -0.0536464642632 -0.0486210782087 -0.0433142852742 -0.0376312986351 -0.0314671132439 -0.0247028462693 -0.0172031109718 -0.00881161205488 0.000665766754168 0.0114913086179 0.0239903228654 0.0384306697854 0.0548738139486 0.0735278342349 0.0961164867848 0.126535956968 0.165221663131 0.195702432089 -0.123062838319 -0.123062510305 -0.123061878024 -0.123061029509 -0.1230594352 -0.123057072866 -0.123052856816 -0.123047754927 -0.123045217145 -0.123039382223 -0.123043493749 -0.123047934581 -0.123048520836 -0.123047689553 -0.123055896867 -0.123061737719 -0.12306667144 -0.123073424992 -0.123082724839 -0.123093752516 -0.123111382716 -0.123129284439 -0.123158910302 -0.123186224403 -0.123214190638 -0.123239920952 -0.123274197407 -0.123317273642 -0.123338442252 -0.123344648822 -0.123369123031 -0.123425054375 -0.123518623936 -0.123641773746 -0.123787833779 -0.123943072255 -0.124137964704 -0.124412269809 -0.124886916143 -0.125541550701 -0.126269709622 -0.127099004542 -0.12862439709 -0.12582679565 -0.123828296057 -0.122717126962 -0.122161510555 -0.119986276972 -0.11689218274 -0.113095868375 -0.108576123541 -0.103542542139 -0.0981884029594 -0.0927196001155 -0.0872905219275 -0.0820001660262 -0.076890711275 -0.0719611831969 -0.0671785394299 -0.0624882442863 -0.0578221588447 -0.0531046331725 -0.0482559152611 -0.0431935703594 -0.0378318646388 -0.0320796812677 -0.0258372429144 -0.0189927219788 -0.0114199412013 -0.00297563871081 0.00651255622937 0.0172723057188 0.0295908618377 0.0437181004083 0.0597056077868 0.0776380064683 0.0988588989116 0.126877131154 0.162628942814 0.191517443237 -0.122837887973 -0.122836852722 -0.12283483847 -0.122833258698 -0.122830196861 -0.122825687306 -0.122818173211 -0.122809056455 -0.122803390621 -0.122794049465 -0.122788516734 -0.122786533481 -0.122780781513 -0.122772886861 -0.122770318843 -0.122766875103 -0.122763001773 -0.122757143268 -0.122752500516 -0.122748376985 -0.122754030937 -0.122758116078 -0.122769811344 -0.122783862685 -0.122802392696 -0.122824302961 -0.122850327231 -0.122890266684 -0.12292038723 -0.122907423837 -0.122900725479 -0.122913305669 -0.122957168411 -0.123026504868 -0.12313244334 -0.123259000653 -0.123401959513 -0.123580892392 -0.123969512648 -0.124605440571 -0.125249576935 -0.125843147794 -0.125209794459 -0.123795567606 -0.121406039022 -0.121108522035 -0.120044114372 -0.117221957175 -0.113564502162 -0.109148644076 -0.104092260711 -0.0986430913345 -0.0930068815021 -0.0873786586966 -0.0818857923847 -0.0765974047522 -0.0715285894334 -0.0666562707332 -0.0619309407025 -0.0572871057779 -0.0526506141126 -0.0479436673273 -0.0430871850387 -0.0380013031028 -0.0326042998206 -0.0268104960307 -0.0205273205894 -0.013652270386 -0.00607089955538 0.00234473227098 0.0117444620507 0.0223230066711 0.03433181064 0.0480019775939 0.0633768383936 0.0804475189909 0.100258889168 0.126021063275 0.159146627666 0.186701307199 -0.122609499607 -0.122607931132 -0.122604743994 -0.122602586742 -0.122596875252 -0.122588934048 -0.122578177211 -0.122564593947 -0.122554868846 -0.122543079305 -0.12252737808 -0.122518547007 -0.122506224735 -0.122492437721 -0.122476590613 -0.122461890209 -0.122447498032 -0.122428832285 -0.122411946993 -0.122394215805 -0.122382691937 -0.122373091609 -0.122362643092 -0.122357111276 -0.122360044505 -0.122367371953 -0.122384711816 -0.122417327143 -0.122458908645 -0.122458822643 -0.122424826182 -0.122403738188 -0.122393435307 -0.12241685846 -0.12246166942 -0.122538760217 -0.122635305335 -0.122743456849 -0.122928271473 -0.123575532458 -0.12436346977 -0.125577784538 -0.123236430823 -0.121428224559 -0.119573110268 -0.11950720435 -0.117623689129 -0.11417479331 -0.109915511755 -0.104908588149 -0.0993864084562 -0.0936051427888 -0.0877715207577 -0.082057344084 -0.0765586205701 -0.0713142395863 -0.0663139866092 -0.0615157601705 -0.0568571856266 -0.0522653909172 -0.0476633125181 -0.0429735077377 -0.0381195453787 -0.0330258227144 -0.0276162577279 -0.0218123200207 -0.0155304709327 -0.00867944209192 -0.00115838973897 0.00714391842117 0.0163549156403 0.0266386982574 0.0382139313648 0.051294461035 0.0659211419046 0.0820213686192 0.100406355165 0.12404589806 0.154796502647 0.181222340332 -0.122378765935 -0.122376708381 -0.122374454914 -0.122370760958 -0.12236087127 -0.122348803083 -0.122334784827 -0.122317212422 -0.12229994296 -0.122283045187 -0.122259541682 -0.122243291254 -0.122223240534 -0.122200994137 -0.12217283665 -0.122146547586 -0.122118604485 -0.122086759198 -0.122058051615 -0.122027706198 -0.121994894019 -0.12196598326 -0.121934943951 -0.121910431217 -0.121890012437 -0.121873571179 -0.121871187625 -0.121884305042 -0.121917369233 -0.121951355031 -0.121923874526 -0.121866525846 -0.121817045082 -0.121787185651 -0.121777278979 -0.12179431969 -0.121839881673 -0.121913319003 -0.121996610787 -0.122367684427 -0.123226486117 -0.125241680096 -0.121684703261 -0.118798873222 -0.118002406035 -0.117641581902 -0.11489766209 -0.110839793518 -0.105965008385 -0.100424045155 -0.09451299452 -0.0884809271612 -0.0825246087927 -0.076784467726 -0.0713240237771 -0.0661532890598 -0.0612396390693 -0.0565254466928 -0.0519389855254 -0.0474031535261 -0.0428405414687 -0.0381760978148 -0.0333377057283 -0.0282555407699 -0.0228606820673 -0.0170833388153 -0.0108506429872 -0.00408418096738 0.0033018174169 0.0114009671516 0.0203187719128 0.0301911859511 0.0412076271544 0.0535680357628 0.0673185046684 0.0823497117611 0.0992949133816 0.120935761938 0.149551200672 0.175054463003 -0.122146194941 -0.122144197047 -0.122142651878 -0.122135406768 -0.122121570296 -0.122105997227 -0.12208860349 -0.12206715559 -0.122042251574 -0.122018339322 -0.121987129288 -0.121961737623 -0.121933275367 -0.121899689565 -0.12185976034 -0.121822629969 -0.12177959261 -0.121732233666 -0.121689752924 -0.121642643811 -0.121589880471 -0.121540314796 -0.121485822236 -0.121440651116 -0.121392633789 -0.121351461929 -0.121316433605 -0.121294635027 -0.121293549394 -0.121319180153 -0.121336308043 -0.121287172235 -0.121220301651 -0.121141267149 -0.121084406002 -0.121054451954 -0.121056653336 -0.121089760794 -0.121152748424 -0.121220871374 -0.121321897081 -0.120126385141 -0.118906635165 -0.115917295131 -0.116461582359 -0.115387159554 -0.111871735326 -0.10721202887 -0.1017443841 -0.0957416412317 -0.0895185770881 -0.0833109534027 -0.0772952714925 -0.0715765835196 -0.0661868632177 -0.061109781542 -0.0562938003116 -0.0516693085986 -0.0471584488768 -0.0426825690906 -0.0381660254968 -0.0335378352203 -0.0287316175502 -0.0236846553771 -0.018336509464 -0.0126274357058 -0.00649646137338 0.00012092820702 0.00729472124093 0.0151008524578 0.0236239901312 0.0329743370088 0.0433149007386 0.05483400166 0.067587465963 0.0814468666824 0.0969124166347 0.11664294676 0.143357009152 0.168167978827 -0.121911516911 -0.121909223977 -0.121903146993 -0.121893635257 -0.121878388348 -0.121860226811 -0.121839258923 -0.12181325292 -0.121782525558 -0.121751218542 -0.121713780878 -0.121676608939 -0.121639624565 -0.121594490532 -0.121542695986 -0.121493712019 -0.121436858382 -0.121374218001 -0.121312338114 -0.121244944814 -0.121170744759 -0.121100616059 -0.121022880727 -0.120946660252 -0.12086906674 -0.120798468915 -0.120724899416 -0.120660998094 -0.120612421285 -0.120585321759 -0.120589108986 -0.120595223548 -0.120542270836 -0.120469723001 -0.12039560109 -0.12033309177 -0.120291540139 -0.120283539527 -0.120329269177 -0.120384164617 -0.120614100207 -0.118013575262 -0.11600117937 -0.113829394511 -0.114872424168 -0.112772316756 -0.108569735426 -0.103302975089 -0.0972922509565 -0.0909033054503 -0.084441183277 -0.0781245578701 -0.0721013159663 -0.0664404749661 -0.0611445998097 -0.0561742463892 -0.0514626075813 -0.0469314250339 -0.0424995480099 -0.0380890256171 -0.0336277201379 -0.029050110533 -0.0242967469824 -0.0193131366973 -0.0140484065698 -0.00845391771404 -0.002481605707 0.00391816882607 0.010798688141 0.0182174991631 0.0262382567077 0.0349458450323 0.0444776750637 0.0550126983599 0.0666236890418 0.0791797343913 0.0930869732826 0.110963315724 0.136051528174 0.160489424125 -0.121675613683 -0.12167235492 -0.121662286295 -0.121651160966 -0.121634624772 -0.121613211623 -0.121587548919 -0.121556360736 -0.121519708813 -0.1214816833 -0.121439229024 -0.121389922619 -0.121344149422 -0.121289333879 -0.121227585868 -0.121162277985 -0.121091829464 -0.121014504694 -0.120929585097 -0.120841991708 -0.120746486256 -0.120649216223 -0.120546177217 -0.120433792425 -0.120323345794 -0.120210551091 -0.120097889753 -0.119988250857 -0.119884875831 -0.119796727064 -0.119728689026 -0.119696762448 -0.119667938155 -0.119625189687 -0.119543631462 -0.119445359148 -0.119340465248 -0.119268675226 -0.119281399739 -0.11943869424 -0.120963705366 -0.11655204924 -0.11311037872 -0.112288102407 -0.113075122847 -0.109873456102 -0.10502080933 -0.0991410251924 -0.0926490978513 -0.0859447334655 -0.0793099177124 -0.0729408727141 -0.0669512871375 -0.0613756063187 -0.0561897413776 -0.0513346498703 -0.046731743176 -0.0422971052266 -0.0379487156043 -0.0336111762515 -0.0292172672768 -0.0247080495927 -0.0200319707931 -0.0151436693898 -0.0100027492209 -0.00457260123754 0.0011810040192 0.00729196851067 0.0137962357992 0.020733046386 0.0281465241848 0.0360992306465 0.0447065773049 0.0541428526026 0.0645063595304 0.0756707555337 0.0879352391114 0.103903879964 0.127547438519 0.152052694806 -0.121440827839 -0.121437071059 -0.121427763886 -0.121413237105 -0.121392847946 -0.121366726878 -0.121335519572 -0.121299085987 -0.121256515085 -0.121211203596 -0.121162285371 -0.121103037164 -0.121046233361 -0.120983159031 -0.120910488879 -0.120827215016 -0.120742620368 -0.120647698941 -0.120541022988 -0.120433450892 -0.120315729894 -0.120186317209 -0.12005305821 -0.119905661742 -0.119758591466 -0.119599820163 -0.119443442813 -0.119279491335 -0.119116081643 -0.11896023227 -0.118814381925 -0.118680002373 -0.118565696536 -0.118457433867 -0.118322774468 -0.118150942106 -0.117946925411 -0.117719723518 -0.117497770673 -0.117406800906 -0.119800630355 -0.113792077807 -0.109631566327 -0.11084492642 -0.110907144153 -0.106707707318 -0.101228750529 -0.0947548116702 -0.087849278276 -0.0808936228811 -0.0741448261888 -0.0677701036182 -0.0618464531281 -0.0563762687641 -0.0513118294925 -0.0465780014038 -0.0420875780404 -0.0377535858098 -0.0334951626282 -0.0292409809674 -0.0249298860214 -0.0205104420399 -0.0159397996364 -0.0111825121434 -0.00620945331844 -0.000996841226881 0.0044750104481 0.0102237106558 0.0162675244771 0.0226272996808 0.0293278435613 0.0364087894719 0.0439585720761 0.0521352276944 0.0610522618702 0.0705837604725 0.0809010197855 0.0946018307126 0.116867530491 0.142729921299 -0.121207382078 -0.121202994198 -0.121193504511 -0.121176103071 -0.121151153644 -0.121120958828 -0.12108511233 -0.121043940557 -0.120996123502 -0.120943000751 -0.120886241417 -0.120820515203 -0.120748989165 -0.120676216959 -0.120590325944 -0.120492684784 -0.12039142004 -0.120278251157 -0.120152740031 -0.120020482293 -0.119876771823 -0.119716882993 -0.119551330913 -0.119370413383 -0.119179554297 -0.118978298301 -0.118766534034 -0.11854320514 -0.118317121975 -0.118085226076 -0.117855600424 -0.117621845572 -0.117394402917 -0.117163399327 -0.116922510177 -0.11664082655 -0.116284546744 -0.115770286061 -0.11492628714 -0.113558011968 -0.110313156405 -0.109451668054 -0.105839272167 -0.109333668317 -0.108275546356 -0.103271322594 -0.0971866705021 -0.0901670760206 -0.0829168566607 -0.0757684721866 -0.0689570933238 -0.0626149288991 -0.0567825945364 -0.0514333526385 -0.0464989547732 -0.0418914744904 -0.0375178679078 -0.0332903153205 -0.0291307822702 -0.0249732253874 -0.0207634539187 -0.0164582297095 -0.0120240034628 -0.00743580944898 -0.00267638430006 0.00226462319934 0.00739175917326 0.0127057789034 0.0182066094113 0.0238959392791 0.0297789694178 0.0358737988039 0.0422443718086 0.0490337055071 0.0563798930836 0.0642128926826 0.072670375144 0.0843268017786 0.105422411042 0.133475040471 -0.120975676321 -0.120969893944 -0.120957048526 -0.120936125842 -0.120909443436 -0.120876894948 -0.120837571113 -0.12079194485 -0.120738606493 -0.120677845573 -0.120612787861 -0.120541056507 -0.120455919653 -0.120369888533 -0.120273008756 -0.120162587555 -0.12004087062 -0.119911098628 -0.119766630719 -0.11960613973 -0.119436588168 -0.119248114474 -0.119046896405 -0.118831012065 -0.118592048174 -0.118345772102 -0.118075826958 -0.117795155153 -0.117499162235 -0.11718880903 -0.116874343708 -0.116549480479 -0.116221835966 -0.115886120697 -0.115539127217 -0.115168054311 -0.114723183974 -0.114112421367 -0.113122214996 -0.111349056557 -0.109119001086 -0.107124120755 -0.104201076031 -0.108014618647 -0.105327708223 -0.0996140677776 -0.0929065279644 -0.085399628215 -0.0778672026341 -0.0705792187431 -0.0637500009029 -0.057472023222 -0.0517516012851 -0.0465357891501 -0.0417388839199 -0.0372631601112 -0.0330121387186 -0.0288990164685 -0.0248499446042 -0.0208051332317 -0.0167180577802 -0.0125542358086 -0.00828993502236 -0.00391125527852 0.000586508794291 0.0051994815433 0.00991633668751 0.0147205420438 0.019593834508 0.0245196514559 0.0294858378548 0.0344937803386 0.0395879697724 0.0448853009903 0.0504958683711 0.0563221323916 0.062433525266 0.071130094734 0.0878474998171 0.108910777448 -0.120747272235 -0.120740233457 -0.120724136055 -0.120698973968 -0.120671885139 -0.120637219394 -0.120594468924 -0.120544066293 -0.120484832788 -0.120417157266 -0.120343684197 -0.12026330786 -0.120171000897 -0.120068504104 -0.119960062199 -0.119836225776 -0.119696028396 -0.119547220879 -0.119381857941 -0.119197027605 -0.118999947572 -0.118782739196 -0.118541791581 -0.118285704037 -0.118006378047 -0.117708169262 -0.117384996806 -0.117039701838 -0.116672657638 -0.116288271611 -0.11588609395 -0.11546898329 -0.115045055803 -0.114613491032 -0.114184622519 -0.113761196176 -0.11334259146 -0.112923570303 -0.112454379083 -0.112624909746 -0.10876989646 -0.105024268324 -0.103477691378 -0.106577922814 -0.102192563555 -0.095779999095 -0.0884095729647 -0.0804706678478 -0.0727080522126 -0.0653283626511 -0.0585203896143 -0.0523336699896 -0.0467429288534 -0.0416717413948 -0.0370199102671 -0.0326825727232 -0.0285618896902 -0.0245736381878 -0.0206492654397 -0.0167360058506 -0.0127955561483 -0.00880263152169 -0.00474376011121 -0.000616610917565 0.00357039698159 0.00779866235577 0.0120407196841 0.0162628277087 0.0204285898122 0.0245017234994 0.0284465836814 0.0322330024648 0.0358564403069 0.0393424636199 0.042629523334 0.0453860326588 0.0474965262552 0.0509012355634 0.0585565470379 0.0606274558189 -0.120523746583 -0.120516358858 -0.120499939233 -0.12047401991 -0.120442916678 -0.120404622543 -0.12035781133 -0.120302242036 -0.120237638353 -0.120163749032 -0.120081424951 -0.11999169908 -0.119892383804 -0.119776530698 -0.119651950404 -0.119515511775 -0.119360201642 -0.119187726211 -0.119002757124 -0.118795616172 -0.118566636404 -0.118320079612 -0.118045688129 -0.11775009199 -0.117429156245 -0.117075856268 -0.11669564192 -0.116284290098 -0.115846682742 -0.115379653032 -0.114887018115 -0.11437721149 -0.113851781159 -0.113320430066 -0.112808154511 -0.112335178838 -0.111936514937 -0.111670275546 -0.111567670811 -0.112781134552 -0.10714190043 -0.101998342966 -0.102472166508 -0.104567430105 -0.0987693082946 -0.0917039967234 -0.0836841106649 -0.0753799655354 -0.0674365806536 -0.0600111988523 -0.0532601051017 -0.0471893507961 -0.0417449510867 -0.036829630069 -0.0323315258155 -0.028141009989 -0.0241606943027 -0.0203102663176 -0.0165273872864 -0.0127669518547 -0.00899934452061 -0.0052089130096 -0.00139298774426 0.00243839277314 0.00626252322172 0.0100443932331 0.0137378529757 0.0172877320854 0.0206322150037 0.0237026380007 0.0264182145613 0.0286827267601 0.030395720694 0.0314377815214 0.0315152039848 0.0299923144394 0.0263989349262 0.0212681948504 0.0135402112073 -0.00213256055573 -0.120305684868 -0.120298256674 -0.120281825831 -0.120257861414 -0.120221845592 -0.120179995749 -0.12012914598 -0.12006870746 -0.119999014118 -0.119918425308 -0.119827498341 -0.119727800379 -0.119617872655 -0.119493163135 -0.119352423864 -0.119201666275 -0.119031562956 -0.118840726028 -0.118633583668 -0.118402867374 -0.118148000841 -0.117871298867 -0.117564921258 -0.117227664293 -0.116859592301 -0.116457452842 -0.116017558186 -0.11554156228 -0.115023715854 -0.114471088231 -0.113889312991 -0.113270903543 -0.112624442898 -0.111971763166 -0.111347785907 -0.110783962518 -0.110339039715 -0.110112968613 -0.110105197511 -0.111730809688 -0.103773389665 -0.0976433659382 -0.100759861195 -0.101788183679 -0.0949186587313 -0.0872805777699 -0.0786913020442 -0.0701073209819 -0.0620394442051 -0.0546169056739 -0.0479577427056 -0.0420273757122 -0.0367462545858 -0.0319990473887 -0.0276649841529 -0.023631831631 -0.0198042760376 -0.0161070769537 -0.0124849171529 -0.00890094245765 -0.0053347537743 -0.00178098176111 0.00175122437954 0.00523784467428 0.00863947918538 0.0119013854893 0.0149543485717 0.0177162938619 0.0200939743531 0.0219822371512 0.0232574440609 0.0237715149074 0.0233672858609 0.0218902377875 0.0190599434788 0.014266324183 0.00699118764549 -0.00230707572663 -0.0135986207114 -0.0270564438583 -0.120095206831 -0.120087251289 -0.120069258195 -0.120045766252 -0.120009009546 -0.119964248214 -0.119909531419 -0.119844480121 -0.119769254369 -0.119682235564 -0.119584037037 -0.119474014066 -0.119353183935 -0.119218484405 -0.119066576738 -0.118897985368 -0.118713662962 -0.118508259038 -0.118276962029 -0.118024808254 -0.117747460542 -0.117437780242 -0.117098059128 -0.116722185853 -0.116309666808 -0.115856613877 -0.115358980524 -0.114813431605 -0.114217314588 -0.113581599318 -0.112890975598 -0.112142716602 -0.111355075798 -0.110553187696 -0.109765873945 -0.109041716518 -0.108467473442 -0.108190423536 -0.108145177372 -0.110179840673 -0.0993138245236 -0.0923905685761 -0.0984134763719 -0.0982551679308 -0.09058351047 -0.0824489433182 -0.0734007039957 -0.0646294010612 -0.056500475157 -0.0491326659039 -0.0426014279893 -0.0368367933121 -0.0317369507221 -0.0271716052843 -0.0230137919509 -0.0191507026868 -0.0154905979616 -0.0119643789469 -0.0085245327189 -0.00514312724439 -0.00180972750089 0.00146967064757 0.00467241223908 0.00775800807702 0.0106671434988 0.0133218300531 0.0156269887788 0.0174732451291 0.0187409830932 0.0193048930387 0.0190356914706 0.0177991661809 0.0154755255859 0.0120175471924 0.00743282180692 0.00152568888865 -0.00613841771265 -0.0151060304933 -0.0231703695912 -0.0281730962125 -0.11989390725 -0.119885530532 -0.1198670459 -0.119842001175 -0.119806645592 -0.119758137673 -0.11969920663 -0.119629333848 -0.119548347591 -0.11945588085 -0.119350761097 -0.119232866125 -0.119101772284 -0.118955763756 -0.118793635818 -0.118611063905 -0.118410453961 -0.118187868222 -0.117938258586 -0.117663030192 -0.117360944331 -0.117023748719 -0.11665086072 -0.116238255138 -0.115781778809 -0.115278391689 -0.114724012536 -0.114110735657 -0.113442600027 -0.112709580871 -0.111899063364 -0.111016389197 -0.110064715432 -0.109064648653 -0.108037394499 -0.107043668618 -0.106210292208 -0.105744771599 -0.105693674088 -0.108619215278 -0.0943394983413 -0.0867608113673 -0.0955572024996 -0.0940267493772 -0.0857673116839 -0.0771986808356 -0.0678046370719 -0.0589338215154 -0.0508094607867 -0.0435490405014 -0.0371821633306 -0.0316094479541 -0.0267099548591 -0.0223416945485 -0.0183741260889 -0.0146957956429 -0.0112199595774 -0.00788470058538 -0.00465116042288 -0.001501187974 0.00156458416797 0.00452717510926 0.00734806477609 0.00996727409545 0.0123024874655 0.0142506764347 0.0156926329209 0.016500063489 0.0165454457227 0.015715820015 0.013928403045 0.0111376885495 0.00733538204167 0.00260411552404 -0.00276993698972 -0.00850917868827 -0.0151237157708 -0.0229677088189 -0.0293441001784 -0.0282370694441 -0.119700433962 -0.119691664843 -0.1196733668 -0.11964512661 -0.119608807313 -0.119558718241 -0.11949702958 -0.119422899311 -0.119336844253 -0.119239211006 -0.119127970844 -0.119003459253 -0.118862900923 -0.118707196144 -0.118534198356 -0.118342083254 -0.118126038471 -0.117886809984 -0.117619431633 -0.117323403777 -0.116996496091 -0.1166331436 -0.11622960015 -0.115782061665 -0.115284337557 -0.114734644544 -0.114124697455 -0.113450579836 -0.112700172758 -0.11186506526 -0.110933381817 -0.109894782224 -0.108746745621 -0.107494119987 -0.10613813604 -0.104736583036 -0.103409285195 -0.102369322258 -0.102046074257 -0.107365220425 -0.0895085169403 -0.081209505337 -0.0921355738409 -0.0891220537287 -0.0804864845809 -0.0715412928797 -0.0619116118129 -0.0530218274159 -0.0449660779795 -0.0378635412256 -0.0316963934701 -0.026341631287 -0.0216619951945 -0.0175070535038 -0.0137451224146 -0.0102679240917 -0.00699507218836 -0.00387289923334 -0.000872194628582 0.00201426978047 0.00477326632561 0.00737068535497 0.0097493859998 0.0118270972378 0.0134970640739 0.0146334019913 0.015101527408 0.0147725585798 0.0135403804051 0.0113419881658 0.00818172086098 0.00414439294668 -0.000637383842757 -0.00602445362832 -0.0117262672112 -0.0171513581721 -0.0224286615593 -0.028888893902 -0.0281660155359 -0.0284688215055 -0.119512486661 -0.119502911398 -0.119483365237 -0.119452134715 -0.119413368149 -0.119364612444 -0.119302072439 -0.119224680706 -0.119134623594 -0.119031940944 -0.118915832403 -0.118784500217 -0.11863792744 -0.118473325646 -0.118290800057 -0.118088470045 -0.117861327449 -0.11760653211 -0.117322880573 -0.117007716324 -0.116658867128 -0.116271411832 -0.115839787618 -0.115358897198 -0.114825611476 -0.114231674204 -0.113569775759 -0.112828510334 -0.111994584996 -0.111055145576 -0.109992855786 -0.108796425318 -0.107446075453 -0.105909923656 -0.104168983666 -0.102221188272 -0.0999699704008 -0.0974450418423 -0.0944194466639 -0.0966750651558 -0.0869902975531 -0.0757941974618 -0.0877269724363 -0.0835122867011 -0.0747512126845 -0.0654923093703 -0.0557405091218 -0.0469067389656 -0.038980251444 -0.0320818485434 -0.0261471409518 -0.0210349003006 -0.0165941196147 -0.0126690250051 -0.0091289760288 -0.00587056435643 -0.00282107437703 6.37783733174e-05 0.00280237180554 0.00538956697572 0.00779764848255 0.00997497565538 0.0118432582129 0.0132965202527 0.0142054341748 0.0144290642402 0.0138335002553 0.0123144303767 0.00981931983885 0.00636651217728 0.00206382723412 -0.00287509406417 -0.00816656174178 -0.0136197204522 -0.0192452245876 -0.0246944623164 -0.0283448471371 -0.0285809597261 -0.0288890359109 -0.0289402306492 -0.119331500619 -0.119320715025 -0.119299066644 -0.119267003275 -0.119226081596 -0.119176334921 -0.119112932307 -0.119033887732 -0.118941480049 -0.11883535746 -0.118715209501 -0.118579315449 -0.118427310544 -0.118256397119 -0.118066803238 -0.117854475651 -0.117616947471 -0.117349916863 -0.117052080895 -0.116719931201 -0.116350778817 -0.11594137285 -0.115485459854 -0.114975827016 -0.114408578228 -0.113772699164 -0.113057980058 -0.112252484062 -0.111343056963 -0.11030985073 -0.109143512145 -0.107807488743 -0.106258274097 -0.104449902344 -0.102343500242 -0.0997786733271 -0.0964845531613 -0.0921804807246 -0.0843858292419 -0.091418370796 -0.0909318587507 -0.0696509971181 -0.0821498829874 -0.0773932886215 -0.0685889046937 -0.0590845188587 -0.0493249078951 -0.0406144037345 -0.0328720031357 -0.0262177585304 -0.0205439673942 -0.0156960388683 -0.0115116175693 -0.00783243443654 -0.00453079709893 -0.00150972004834 0.00129457145021 0.00391575893582 0.00636000956593 0.00860812036875 0.0106158045457 0.012311605098 0.0135944781075 0.014335722719 0.0143896239619 0.0136138956145 0.0118972078952 0.00918791729822 0.00551621638858 0.00100408551641 -0.00413298475573 -0.00958025570804 -0.0149386179076 -0.0199353360591 -0.0248638268933 -0.0298501526495 -0.033309523134 -0.0303757647123 -0.029725944277 -0.029457477536 -0.119160470284 -0.119148710688 -0.119125903 -0.119093414226 -0.119050559678 -0.118997506777 -0.118932013346 -0.118853081501 -0.118759521232 -0.118651339245 -0.118527916383 -0.118389035275 -0.118231907381 -0.118056912783 -0.117860651907 -0.117642338006 -0.117396025719 -0.117118128595 -0.116807924722 -0.116462227902 -0.116076139941 -0.115646670117 -0.115169575967 -0.114637072543 -0.114037652048 -0.113362745648 -0.112603292747 -0.111749191821 -0.110779084828 -0.109680005762 -0.108416789278 -0.106949876787 -0.105244314094 -0.103251950595 -0.100871838917 -0.0979122056182 -0.0941230879368 -0.0891238747064 -0.0803632407111 -0.0890968429843 -0.0843045139001 -0.0550714487559 -0.0755422425839 -0.0707779360245 -0.0620092625037 -0.0523838880231 -0.0427187037779 -0.0341848384473 -0.0266713314711 -0.0202924973455 -0.0149022020847 -0.0103363860595 -0.00642346403174 -0.0030051301472 4.17636182786e-05 0.00280638060445 0.00534232179512 0.00767136105578 0.00978591900506 0.0116509007184 0.0132034361292 0.0143505893089 0.0149687138062 0.0149108949496 0.0140266150779 0.012192129542 0.00934535804003 0.00551621003349 0.000840974352275 -0.00444505624784 -0.0100261579522 -0.0155242380702 -0.0205421129132 -0.0248236151969 -0.0286615320943 -0.0327662381235 -0.0315978829073 -0.0304824374956 -0.0298834626623 -0.0296150901059 -0.119000960402 -0.118988961792 -0.118966034455 -0.118932768515 -0.118888797962 -0.118833244806 -0.118765794425 -0.11868643619 -0.11859159691 -0.118481678379 -0.11835593173 -0.118213588701 -0.1180534391 -0.117874194528 -0.117674376728 -0.117449596905 -0.117196570678 -0.11691195915 -0.116592083385 -0.116234770613 -0.115836830178 -0.115391414075 -0.114895750076 -0.11434108521 -0.113718022348 -0.113012166414 -0.11222076144 -0.111327672067 -0.11031186548 -0.109146803297 -0.107805178218 -0.106269201948 -0.104487037011 -0.102399563865 -0.099908093416 -0.0968922217421 -0.0932667676772 -0.0891992362122 -0.0850072697832 -0.0913920867009 -0.0592537845894 -0.0391763344299 -0.0690235215998 -0.0634731007238 -0.0550793077243 -0.0454889937576 -0.035992483333 -0.0276703161598 -0.0204162326177 -0.0143329351742 -0.00924142389975 -0.00497062678528 -0.00134137107182 0.00180275394431 0.00457908980773 0.00706773854321 0.00931093249424 0.0113171699508 0.0130635174294 0.0144972186703 0.0155352404445 0.0160627126484 0.015936099489 0.0149990664731 0.0131133847024 0.0101984203069 0.00626852080659 0.00145784197894 -0.00398110642018 -0.00971579455025 -0.0153764814499 -0.0205663070421 -0.0249957924165 -0.0287841266474 -0.0315838419036 -0.0319348637006 -0.031037083824 -0.0302301203259 -0.0297327058794 -0.0295001236799 -0.118852359607 -0.118841306244 -0.118818686312 -0.118785201309 -0.118740566755 -0.118684217132 -0.118615584654 -0.118534729373 -0.118439147685 -0.118327772278 -0.118200274106 -0.118055653474 -0.117892946454 -0.117710766978 -0.117506760595 -0.117277232572 -0.117020361867 -0.116731681044 -0.116406549636 -0.116041203693 -0.115631848133 -0.115175997628 -0.114666758499 -0.11409342434 -0.113449796901 -0.11272459746 -0.111907587286 -0.110983315782 -0.109926688619 -0.108720006807 -0.107361593075 -0.105801554391 -0.103986243778 -0.101862514506 -0.099334586004 -0.0962909808341 -0.0926395252789 -0.088326650781 -0.0830288078374 -0.089302382301 -0.0585929103274 -0.0334298874791 -0.0640661808181 -0.0561728798873 -0.0481830982203 -0.0385639903927 -0.0292371122344 -0.0211317355864 -0.0141486991207 -0.00836857005651 -0.00358325025438 0.000384824134646 0.00372141324249 0.00657970765314 0.00907030519922 0.0112631618436 0.0131879865648 0.0148386179271 0.0161752047884 0.0171258339525 0.0175865019091 0.0174216636489 0.0164737293423 0.0145902259713 0.0116670425346 0.00769388257769 0.00278506790685 -0.0028118164819 -0.00873516247041 -0.0145794541038 -0.0199912530542 -0.0246441677643 -0.0282046522428 -0.0309163749178 -0.0339611569146 -0.0316247617972 -0.0305669904424 -0.0298341697946 -0.0294027358809 -0.0292058662383 -0.118715708368 -0.118705811511 -0.118683712393 -0.118650447873 -0.11860572028 -0.118549138024 -0.118480625027 -0.118398655075 -0.118302562209 -0.118190410732 -0.118061839214 -0.117915882778 -0.117751313702 -0.117567201969 -0.117359682203 -0.117127560459 -0.116868965435 -0.116578619603 -0.116249051318 -0.115882173698 -0.115467891025 -0.115000736178 -0.114479166286 -0.113894823137 -0.113236950318 -0.112497465573 -0.111662448376 -0.110713110982 -0.109636828622 -0.108435740976 -0.107073892768 -0.10550773496 -0.103712557352 -0.10163420754 -0.0991968445673 -0.0962913711991 -0.0927473589944 -0.0880873887956 -0.0823098305907 -0.086780015736 -0.0626177173724 -0.0276356060239 -0.0601207175093 -0.0495452571568 -0.0416825543812 -0.0317737251789 -0.0225490636631 -0.0146297338981 -0.00790893306528 -0.00242767493738 0.00205130064171 0.00571365422873 0.00875142406778 0.0113138288324 0.013504042053 0.0153809060051 0.0169604847539 0.018220605814 0.019103103704 0.0195159000809 0.0193343402349 0.0184057405575 0.0165680865722 0.0136906268861 0.00972856397582 0.0047692942772 -0.00095429528554 -0.00708663581297 -0.0131828277524 -0.018770055922 -0.0235276384182 -0.0274367616355 -0.0304642307202 -0.0321945964568 -0.0319176331021 -0.0307426135596 -0.0298895736386 -0.0293004860326 -0.0289484784991 -0.0287861258985 -0.118592241053 -0.118582473813 -0.118560866954 -0.118527927136 -0.118483613973 -0.118427623918 -0.118359557667 -0.118278098129 -0.118182059535 -0.118070320476 -0.117941446536 -0.117794807737 -0.117629350693 -0.117443357627 -0.117235308159 -0.117002774036 -0.116743232369 -0.116451143845 -0.116122512098 -0.115753624078 -0.115337974795 -0.114866969901 -0.114336618327 -0.11374370412 -0.113080187078 -0.112331882091 -0.111483918221 -0.110527400516 -0.109460662736 -0.108264257469 -0.10690888485 -0.105380573403 -0.103655500434 -0.101709672398 -0.0995144311331 -0.0970832701066 -0.0944120121529 -0.0916233969373 -0.0886593102074 -0.0944878944208 -0.0351778365323 -0.0148106289054 -0.0550702350311 -0.0428644223493 -0.03540864637 -0.025123411617 -0.015972598706 -0.00820278521513 -0.00172644327507 0.00346717200356 0.00764444782732 0.0110013737291 0.0137361943058 0.0159937344062 0.0178691739249 0.0194093231137 0.0206155104329 0.0214483124005 0.0218301944487 0.0216486615679 0.0207602384456 0.0190014216224 0.0162195547093 0.0123275333351 0.00736601112009 0.001544217383 -0.00477142051503 -0.0111295841075 -0.0170635927818 -0.0220941456271 -0.0259238647176 -0.0289940327474 -0.0318237074384 -0.0333887626138 -0.0311528142796 -0.0299543653831 -0.0291807359023 -0.0286937561739 -0.0284093981464 -0.0282773217389 -0.118481530991 -0.118471116346 -0.118449786031 -0.118417285136 -0.118373699228 -0.118318715491 -0.118251816965 -0.118172030446 -0.118077861624 -0.117967696616 -0.11783968409 -0.117693122846 -0.117527692364 -0.117341779781 -0.117133685411 -0.116901891875 -0.11664233783 -0.116350965433 -0.116024081571 -0.115657783993 -0.115243849632 -0.114770814537 -0.114237448918 -0.11364211964 -0.112976896203 -0.11222771832 -0.111378389304 -0.110427425088 -0.109367553297 -0.108180350789 -0.106854058813 -0.105377592189 -0.103750555556 -0.101973265644 -0.100076613276 -0.0981456206065 -0.0963349714581 -0.0950202834231 -0.0943616353505 -0.104888287176 -0.0265118463911 -0.00971650785606 -0.0507918362218 -0.0362029888508 -0.0292548835707 -0.0185604495684 -0.00950155873164 -0.00185953668667 0.00438511198995 0.00930214164044 0.0131834845914 0.0162365356776 0.0186651563341 0.020609290469 0.0221554629855 0.0233374995294 0.0241409201124 0.0245079849566 0.0243411848802 0.0235082466742 0.0218503947997 0.0192027449596 0.0154403762296 0.0105460473356 0.00467247273043 -0.00183199487362 -0.00846226332812 -0.0146872933355 -0.0201124562462 -0.0244324048484 -0.0273383475469 -0.0294434017818 -0.0325388434393 -0.0311259652449 -0.0298515607085 -0.0289571421203 -0.0283624715481 -0.0279916976678 -0.027774660117 -0.0276542246111 -0.118382050643 -0.118371339428 -0.118350237694 -0.118318563649 -0.118276173185 -0.118222798212 -0.118157928145 -0.118080526331 -0.117989328812 -0.117881960391 -0.117756594131 -0.117611310937 -0.117446898557 -0.117262216979 -0.117055478179 -0.116824542989 -0.116567193241 -0.11627896014 -0.115955799327 -0.115592773461 -0.115181213071 -0.114712792844 -0.114181860169 -0.11358884902 -0.112926524412 -0.112179739054 -0.111338314417 -0.110395310588 -0.10934396699 -0.108177460317 -0.106887481799 -0.105474001378 -0.103943935017 -0.102321468859 -0.100665196276 -0.0990844456973 -0.0977715808465 -0.0971411300335 -0.0969889101655 -0.106139695612 -0.0238375673343 -0.00882392007463 -0.047659111204 -0.0301451768949 -0.0233801276946 -0.0121100715604 -0.00313510877005 0.00440220567168 0.0104224795487 0.0150709651037 0.0186607464285 0.0214110249823 0.0235300272736 0.025152027286 0.0263539982889 0.027155724284 0.0275258749045 0.0273876005161 0.0266234852552 0.0250833934779 0.022599213858 0.0190184458956 0.0142678778298 0.00843002300923 0.00179255479464 -0.00515636576802 -0.0117981037568 -0.01754381397 -0.0221132074616 -0.0256942347791 -0.028455950911 -0.0300582009834 -0.0298408452218 -0.0292993972716 -0.0285005813423 -0.0278786894988 -0.0274531682685 -0.0271880286161 -0.0270297555807 -0.0269385529802 -0.118293131753 -0.118282755739 -0.118262334799 -0.118232112061 -0.118191594626 -0.118140467297 -0.118078161058 -0.118003882915 -0.117915791937 -0.117812288686 -0.117691056107 -0.117549793203 -0.117387515511 -0.117204845882 -0.117000425505 -0.116772304265 -0.116517545621 -0.116233780062 -0.115915763409 -0.115557619634 -0.115152543338 -0.114690735277 -0.114168250885 -0.113580732713 -0.112923092652 -0.112185725637 -0.11135416392 -0.110422308629 -0.109387344583 -0.108245256758 -0.106990991828 -0.105628279686 -0.104179914586 -0.102671764174 -0.101158865031 -0.0997424895986 -0.098585651727 -0.0979774507177 -0.0975340455806 -0.10505373678 -0.0200333208131 -0.00644450921727 -0.044081680527 -0.0243658436802 -0.0176929095674 -0.00575879487184 0.00313325125512 0.0105878887986 0.0163865504166 0.0207715946255 0.0240720579673 0.0265194527128 0.0283246795133 0.029615280828 0.0304575307919 0.0308560298638 0.0307616506158 0.0300780490289 0.0286688037396 0.0263692345865 0.0230102290026 0.0184691642367 0.01275224026 0.00607057519657 -0.00113947562866 -0.0082642406871 -0.0146158683211 -0.0195963615897 -0.023050124041 -0.0259038822054 -0.0291575872513 -0.0310308968062 -0.0289597527064 -0.0279436613101 -0.0272309014363 -0.0267533084262 -0.026456656244 -0.0262818152631 -0.0261732881326 -0.0261248717959 -0.118215896451 -0.118206129196 -0.118187237516 -0.11815893173 -0.118120679313 -0.118072099032 -0.11801262723 -0.117941538778 -0.11785738932 -0.117758179592 -0.117641627459 -0.11750593427 -0.117349154198 -0.117170702247 -0.116969399213 -0.116744844172 -0.116494381388 -0.116214940985 -0.11590341653 -0.11555310668 -0.115156365533 -0.114705613008 -0.114192537389 -0.113614179199 -0.112966757445 -0.112239166301 -0.111421874223 -0.110506610791 -0.109489868923 -0.10837121328 -0.107148364003 -0.105829403689 -0.104432131133 -0.102979315041 -0.101513121345 -0.100125345585 -0.0989094458204 -0.0980004800757 -0.0969130122433 -0.102976023344 -0.0147782149597 -0.00179283825473 -0.0395044944359 -0.018400747027 -0.0119491170762 0.000577060053243 0.00933715498975 0.0167111204598 0.0222813845873 0.0264041844134 0.0294151862597 0.0315582581421 0.0330447288752 0.0339940916558 0.0344605614458 0.0344323520194 0.0338417282466 0.0325729236785 0.0304723589337 0.0273658595175 0.0230951138081 0.0175909277681 0.0109741318728 0.00361906721392 -0.00388278357097 -0.0108234616911 -0.0165042796344 -0.0204778253117 -0.0229095091862 -0.0251716612095 -0.0295705472229 -0.0282146950505 -0.0271290727087 -0.026371970373 -0.0258538194277 -0.0255168004838 -0.0253197699523 -0.0252212068499 -0.0251439785943 -0.025120492191 -0.118152838734 -0.118143981962 -0.118126456284 -0.118099769661 -0.118063592367 -0.11801746194 -0.117960835831 -0.117892996173 -0.117813100278 -0.117718759042 -0.117607404503 -0.117477071681 -0.117328941935 -0.117158825963 -0.116962786392 -0.116742933345 -0.116497088061 -0.116223871402 -0.115918897491 -0.115577638751 -0.115192242903 -0.114753870351 -0.114254685986 -0.113688454513 -0.11305397891 -0.112342578705 -0.111540776016 -0.110643275497 -0.109647360753 -0.108552019534 -0.107354075582 -0.106059926975 -0.104688128252 -0.103243785638 -0.101767319279 -0.100318916142 -0.0989334644196 -0.0976592394448 -0.0960527449935 -0.101097047898 -0.00892875621154 0.0040963014589 -0.0343353778319 -0.012186564543 -0.006051083891 0.00694996881387 0.0155078806307 0.0227855404971 0.0281113813546 0.0319693381915 0.03468858807 0.0365249053297 0.0376871046429 0.0382850934162 0.0383595186436 0.0378810652286 0.0367629157867 0.0348707638046 0.0320372153472 0.0280862612564 0.022886788336 0.0164515349448 0.00905220296677 0.00125165090701 -0.00623166424326 -0.0127244628949 -0.017653036569 -0.0208652914626 -0.0234239418221 -0.0256149041794 -0.0253233935189 -0.0256028630866 -0.0251489388303 -0.0246969286553 -0.0243510479952 -0.0241156504854 -0.0239641896318 -0.0238971630472 -0.0238473965261 -0.0238101491711 -0.118103014214 -0.118095163219 -0.118078577218 -0.118053365198 -0.118019103538 -0.117975314435 -0.117921528998 -0.117857097845 -0.117781185739 -0.117692572264 -0.117588776098 -0.117465921592 -0.117323552713 -0.117161456588 -0.116976662925 -0.116765719876 -0.116526556066 -0.116260321306 -0.115963674348 -0.115631590611 -0.115259258685 -0.114836542242 -0.114352430516 -0.113802688118 -0.113185527155 -0.112490810348 -0.111709094928 -0.110832460616 -0.109857122061 -0.108782409907 -0.107603057163 -0.106323133654 -0.104943584218 -0.103479004047 -0.101957841891 -0.100401002191 -0.0988287665525 -0.0972442144984 -0.0953853018674 -0.0998106760329 -0.00312703372803 0.0103189913579 -0.0290476282078 -0.00586593377375 -5.52508605655e-05 0.0133424683535 0.0216469472328 0.0288120947187 0.0338760240217 0.0374657388517 0.039890231871 0.0414172414375 0.0422497266761 0.0424864049347 0.0421527804426 0.0412009631353 0.0395248982304 0.0369732720904 0.0333692325716 0.0285442590889 0.022414555447 0.0151077470184 0.00707732387375 -0.000908208077734 -0.00803153700887 -0.013841854668 -0.018179194731 -0.0207666297557 -0.0227797683594 -0.0267604776017 -0.0244175808523 -0.0238384118785 -0.0233492457236 -0.0229867123499 -0.022724390413 -0.0225369865893 -0.0223990066436 -0.0223089929044 -0.0222740436086 -0.0222081606942 -0.118063510225 -0.118056463824 -0.118041113301 -0.118017603523 -0.117985317885 -0.117943943187 -0.117893169519 -0.117832461626 -0.117761054859 -0.117678023437 -0.117581945485 -0.11746963382 -0.117336396026 -0.117181193637 -0.117005371014 -0.116806405521 -0.116580129419 -0.116324721466 -0.116037621383 -0.115716615435 -0.115357485156 -0.114951170693 -0.114486555229 -0.113956489557 -0.113359653807 -0.112687703031 -0.111927116796 -0.111072849128 -0.110121000955 -0.109065734891 -0.107895810416 -0.106610273036 -0.105216849756 -0.103717465981 -0.102127210788 -0.100464698342 -0.098732431779 -0.0969068906774 -0.0949513521074 -0.0991094379642 0.0023938518746 0.0164473547326 -0.0238729133344 0.00043724256607 0.0059457460296 0.0197053710133 0.0277325917824 0.0347782327516 0.0395681044071 0.0428888440961 0.0450168427892 0.0462330908808 0.0467313231423 0.04659763823 0.0458408870378 0.044393826264 0.0421316287736 0.0388888620666 0.0344860667653 0.0287759446588 0.0217509787148 0.0136963281173 0.00527336491896 -0.00256345822803 -0.00890912175709 -0.01360012246 -0.0175183404072 -0.0210831558405 -0.0228690416005 -0.021988218248 -0.0220840874947 -0.0217644732593 -0.0214354361251 -0.0211696205177 -0.0209705717167 -0.02082091985 -0.0207053967838 -0.0206108741556 -0.0205696676771 -0.020534102613 -0.118032964545 -0.118026608645 -0.118012700242 -0.11799093479 -0.117960684423 -0.117921929787 -0.117874480093 -0.11781789773 -0.117751502505 -0.117674413443 -0.117585548081 -0.117483129157 -0.117363420942 -0.11722056012 -0.117053181246 -0.116864333456 -0.116651623516 -0.116411415529 -0.116140284754 -0.115834516576 -0.115489024123 -0.115099453443 -0.1146573866 -0.11415142526 -0.113578511197 -0.112930231752 -0.112196480802 -0.111368444267 -0.110440499823 -0.109401218122 -0.108233012995 -0.1069388764 -0.10552802572 -0.103989096196 -0.102332874405 -0.100571962456 -0.0986983548655 -0.0966927242505 -0.0947594889806 -0.098807512748 0.00761912972616 0.0223517318985 -0.0188664494304 0.00666480893629 0.0118852730107 0.0259948368379 0.0337378178121 0.0406656465086 0.0451763723949 0.0482316339776 0.0500640796578 0.0509702838225 0.0511314861711 0.0506200300119 0.0494267497825 0.0474645642433 0.0445908708223 0.0406298533745 0.035407433618 0.0288121659684 0.0209423466131 0.012284586723 0.00373135048912 -0.00361470612251 -0.00880441284217 -0.0119105545749 -0.015390808983 -0.0209777265625 -0.0238864802474 -0.0210643377517 -0.0202720881571 -0.0197824256319 -0.0194691787845 -0.019255201846 -0.0191042483763 -0.0189928869999 -0.0189076315335 -0.0188333430561 -0.018795680005 -0.0187884097879 -0.118011269672 -0.118005255135 -0.117992524798 -0.117972267026 -0.117944206602 -0.117908438105 -0.117864701313 -0.117812603879 -0.117751591261 -0.11768087526 -0.117599425934 -0.117506008721 -0.117398280374 -0.117271657681 -0.117120544473 -0.116943654375 -0.116743261033 -0.116517965947 -0.116264645533 -0.115978645254 -0.115654035997 -0.115284649228 -0.114865556658 -0.114387174328 -0.113842218311 -0.113223000039 -0.112517925171 -0.111720760113 -0.110817756354 -0.109786608509 -0.108625656599 -0.107334043784 -0.105897857019 -0.104319439498 -0.102606748258 -0.100752970917 -0.0987745917296 -0.0966534163267 -0.0946909716979 -0.0988572105343 0.0125716942826 0.0280190985359 -0.0140162633415 0.0127970633242 0.0177264401868 0.0321822027574 0.0396400025025 0.0464566738632 0.0506888534125 0.0534862141605 0.0550272628801 0.0556269890329 0.0554508600996 0.0545566054016 0.0529158203648 0.0504214882606 0.0469150263451 0.0422157783318 0.036167318982 0.0287191391043 0.0201269294246 0.0111500675153 0.00297392303435 -0.0031864375113 -0.00666948577668 -0.00817217611433 -0.0116333716712 -0.0214512797477 -0.019173808536 -0.0183690199174 -0.0178750702258 -0.0175674489942 -0.0173588512584 -0.0172199294263 -0.0171240652194 -0.0170553661185 -0.0170033824499 -0.0169502142423 -0.0169308589898 -0.0169403610818 -0.117996844383 -0.117991224986 -0.117979453752 -0.11796085058 -0.11793540591 -0.117903049391 -0.11786338359 -0.117816041684 -0.117760649791 -0.117696589449 -0.11762295329 -0.11753855932 -0.117441980849 -0.117329808723 -0.117197425322 -0.117039543041 -0.116855397954 -0.116646636106 -0.116411709786 -0.116146674833 -0.115846245284 -0.115503392505 -0.115111802225 -0.114664143881 -0.114151941985 -0.113565668433 -0.112896232026 -0.112130578023 -0.111248832039 -0.11023945426 -0.109094649954 -0.107802494439 -0.106351044846 -0.104735166728 -0.102962333164 -0.101042685159 -0.0989978479294 -0.0967780649965 -0.0947180952023 -0.0991620448701 0.0172927650631 0.0334621176861 -0.00929913339951 0.0188282476164 0.0234496918051 0.0382496000745 0.045421700435 0.0521362265926 0.0560944251404 0.0586448937321 0.0599020102827 0.0602020792598 0.059691423941 0.0584125143166 0.0563166396686 0.0532772407997 0.0491225947627 0.0436745928484 0.0368094457806 0.0285669354612 0.0194109331867 0.0103920645044 0.00289370518504 -0.00192534081887 -0.00427972025139 -0.0070509320455 -0.0118824877595 -0.0126647124525 -0.014787245492 -0.0151849075771 -0.0152424152555 -0.0151996174409 -0.015135163529 -0.0150862519044 -0.0150513260522 -0.0150275074849 -0.0150129744761 -0.014989962563 -0.0149888123523 -0.0150045742627 -0.117988466674 -0.117983372802 -0.11797280129 -0.117956233774 -0.117933565171 -0.117904791263 -0.117869558964 -0.117827439858 -0.117777994017 -0.11772079185 -0.117655250197 -0.117580344369 -0.11749475176 -0.117396894122 -0.117282421124 -0.117144945607 -0.116981750646 -0.116794806727 -0.116581711236 -0.11633928912 -0.116065456782 -0.115753345766 -0.115394828518 -0.1149820919 -0.114507284219 -0.113961024707 -0.113330126934 -0.112600185138 -0.11175250135 -0.110772043936 -0.109648554614 -0.108361738206 -0.106896419157 -0.105245035394 -0.103419044158 -0.101457732964 -0.0993661837552 -0.0971436037997 -0.0948073156742 -0.0997424266992 0.0218285275747 0.0386822514138 -0.00469181077519 0.024757025106 0.0290424837716 0.0441837246106 0.0510683257576 0.0576911324512 0.0613828390237 0.0637004320491 0.0646844437196 0.0646952773583 0.0638566060387 0.0621951097101 0.0596407344702 0.0560480424419 0.0512357243244 0.0450370230094 0.0373776834321 0.0284208647793 0.018902429071 0.0101808813887 0.00363973882561 7.2734471106e-05 -0.00136123018769 -0.0053136772662 -0.0133990036011 -0.0113162706635 -0.0121017965295 -0.0124908394336 -0.012719363091 -0.0128312356271 -0.0128856532742 -0.0129211476798 -0.0129475525787 -0.0129679725353 -0.0129839804628 -0.0130005017368 -0.013023920486 -0.0130475757032 -0.117985351621 -0.117980913116 -0.117971814961 -0.117957432053 -0.117937620419 -0.11791256492 -0.117881955906 -0.117845412079 -0.11780247632 -0.117752606495 -0.117695363633 -0.117630164641 -0.11755591438 -0.117471152722 -0.117373893407 -0.117259542143 -0.117120675024 -0.11695665452 -0.11676998853 -0.116556444954 -0.116312646558 -0.116032666002 -0.115711692885 -0.115340876347 -0.114910125209 -0.114407924987 -0.113825023232 -0.113141066414 -0.112334069978 -0.111393836825 -0.110298923933 -0.109023163015 -0.107545579664 -0.105863683922 -0.103999884773 -0.101986636226 -0.099846064458 -0.097666477586 -0.0956354626044 -0.10010320436 0.0262998018631 0.0436615938953 -0.000158005743079 0.0305821290212 0.0344924543115 0.0499714252753 0.0565657932419 0.0631087933216 0.0665440456999 0.0686457152752 0.0693709867487 0.069107039193 0.0679512774881 0.0659141557107 0.0629033004277 0.0587555249631 0.053284789402 0.0463475179423 0.0379399567541 0.0283816850042 0.0187253698106 0.0105977097563 0.00508005328298 0.00186184942236 -0.000610195850942 -0.0042825800569 -0.00853120191362 -0.0089158879785 -0.00953169642072 -0.00998009978601 -0.0103025299397 -0.0105275612071 -0.0106810721911 -0.010798608812 -0.0108924781165 -0.0109671885569 -0.0110235664004 -0.0110748699295 -0.0111111491648 -0.0111277762055 -0.117986887891 -0.117983099653 -0.117975503258 -0.117963353788 -0.11794650224 -0.117925283912 -0.11789943907 -0.117868644585 -0.117832500962 -0.117790537088 -0.117742177571 -0.1176869202 -0.117624086968 -0.117552703982 -0.117471224774 -0.117377449648 -0.117266602194 -0.117131807478 -0.116973155489 -0.116791721709 -0.116583464394 -0.116343720705 -0.116064471673 -0.115740653939 -0.115360574906 -0.114913561771 -0.114385342983 -0.113757291785 -0.113009092931 -0.112118784855 -0.111057841234 -0.109802245934 -0.108327490874 -0.106625123469 -0.104704584687 -0.102582785005 -0.100332249453 -0.0981336661677 -0.0974441411577 -0.0998090974401 0.0307274025107 0.0483808648013 0.00435003155167 0.0362909669485 0.0397826978246 0.0555974251411 0.0618989916272 0.0683759988433 0.0715673784698 0.0734731305187 0.0739578736673 0.0734381840321 0.0719815322556 0.0695817135299 0.0661229833164 0.0614254765119 0.0553031434232 0.0476469054532 0.0385406173812 0.0284797900821 0.0188500231548 0.0114654209006 0.00698587994261 0.00387795629543 -0.00121039175876 -0.00610067016073 -0.00566759952406 -0.00650306706977 -0.00710638878494 -0.0075981358478 -0.00798997109202 -0.00830648372056 -0.00855493057867 -0.00875586083589 -0.00892166448524 -0.00905688421069 -0.00916474471026 -0.00924345457563 -0.00928399843082 -0.00928061994627 -0.11799211179 -0.117988988282 -0.117982869776 -0.117973024326 -0.117959215549 -0.117941925832 -0.117920949551 -0.117896013772 -0.117866785362 -0.117832874975 -0.117793831464 -0.117749127145 -0.11769815368 -0.11764024823 -0.117574512225 -0.117499665489 -0.117414031542 -0.117312438076 -0.117189060463 -0.117044028205 -0.116875581884 -0.116680992233 -0.11645267068 -0.11618286247 -0.115860333666 -0.115477057906 -0.115019354523 -0.114462174678 -0.113781273621 -0.112953274442 -0.111950682818 -0.110733582137 -0.109273031296 -0.107546798558 -0.105541494707 -0.103230982706 -0.100613449294 -0.097350801457 -0.0977270094924 -0.0986500369992 0.0351199085264 0.0529022736 0.00886077345057 0.0418470508185 0.0448911444085 0.0610439740079 0.0670510432474 0.0734781884948 0.0764407382553 0.0781737990668 0.0784403697162 0.077689231731 0.0759541626584 0.0732119331538 0.0693223424589 0.0640902512879 0.0573354366358 0.0489994466032 0.0392834785634 0.0289038044528 0.019660308365 0.0135482596357 0.0104969066173 0.00816368338333 0.00279441300336 -0.00887730225924 -0.00461351642631 -0.00449517081038 -0.0048150171616 -0.00529316258899 -0.00575167243121 -0.00615528786955 -0.00650560101642 -0.00679351013615 -0.00703102079019 -0.00722280832259 -0.00737362966999 -0.00747684118826 -0.00753823378929 -0.00754863235327 -0.118000265681 -0.11799772355 -0.117993025916 -0.117985474231 -0.117974779804 -0.117961488682 -0.117945476333 -0.117926475633 -0.117904199017 -0.117878347562 -0.117848607558 -0.117814627099 -0.117776013053 -0.117732234283 -0.11768275373 -0.117627013713 -0.117564273899 -0.117493033915 -0.117409209124 -0.117307521892 -0.117185540634 -0.117041862544 -0.116870368332 -0.116661111839 -0.116408924615 -0.116101188377 -0.115723219868 -0.115252639145 -0.114662302791 -0.113921474453 -0.112990689994 -0.111834935605 -0.110417119466 -0.108693734692 -0.106623402161 -0.104175846307 -0.101305483114 -0.0974800125128 -0.0978594797357 -0.0990959994292 0.0385456944048 0.0572285911962 0.0132829944068 0.047188399933 0.0497938516212 0.0662912117452 0.0720033025858 0.0783987402969 0.0811497306759 0.0827364193358 0.0828117498759 0.0818594518801 0.0798760627546 0.0768208220877 0.0725280610904 0.0667888748005 0.0594343791375 0.0504726476647 0.0402566461431 0.0297550831753 0.0211866933727 0.0168370139889 0.0155384784195 0.0106052213123 0.00195085060069 0.00181217920753 -0.00057547512339 -0.00147316983013 -0.00223197325266 -0.00291477851591 -0.00353140567468 -0.00406036728904 -0.00452047608631 -0.00490000691822 -0.00521051200255 -0.00545971804351 -0.00565275808894 -0.00577775910815 -0.00586471085917 -0.00590604431852 -0.118010361629 -0.118008442957 -0.1180050584 -0.117999593881 -0.117992122579 -0.11798290466 -0.117971897309 -0.117958771476 -0.117943280986 -0.117925249296 -0.117904548786 -0.11788108301 -0.117854768798 -0.117825490115 -0.117793148909 -0.117757830348 -0.117719462611 -0.117676987047 -0.117628783985 -0.117571591058 -0.117502025445 -0.117416207578 -0.117307215887 -0.117170038638 -0.117000059847 -0.116781726464 -0.11650251951 -0.116137713478 -0.115655498153 -0.115024043997 -0.114204530787 -0.113147111007 -0.111802867337 -0.110114917164 -0.108046310241 -0.105574087115 -0.102731370523 -0.0995559081577 -0.0979060199611 -0.102253446212 0.0412442583336 0.0613023996285 0.0174352657523 0.0522614166601 0.0544686836203 0.0713180494834 0.0767352222539 0.0831188297042 0.0856765087356 0.0871462936972 0.087061763436 0.0859454328348 0.0837525401214 0.0804247448932 0.0757694420744 0.0695661330242 0.0616636734819 0.0521542816383 0.0416060772789 0.0313936793417 0.0241501057658 0.0220370583887 0.0236751972948 0.0181942437936 -0.00238289580943 0.00310963032629 0.0023691201673 0.0014030479719 0.000392832470831 -0.00051767250254 -0.00131895605964 -0.00200853742843 -0.00258556999174 -0.00305950862839 -0.00344265265395 -0.00374694686397 -0.00397745732372 -0.00413562129063 -0.00424904586884 -0.00431479450055 -0.118021369861 -0.118020205325 -0.118017934824 -0.118014284789 -0.118009803798 -0.118004219236 -0.117997504351 -0.117989341386 -0.117979680244 -0.11796864383 -0.117956427654 -0.117943304792 -0.11792963634 -0.117915834209 -0.11790236695 -0.117889628591 -0.117877456062 -0.117865141093 -0.117851415306 -0.117835346956 -0.117817148734 -0.117792194346 -0.11775530048 -0.117703240689 -0.117628532033 -0.117516248466 -0.117350565441 -0.11711025979 -0.116766863169 -0.11627846823 -0.115608788652 -0.114700807855 -0.113475787194 -0.111864701443 -0.109825511174 -0.107328338481 -0.104410656097 -0.101070015419 -0.0985061310624 -0.103957926783 0.0443124747782 0.0651998837729 0.0212964031569 0.0570812487135 0.0589075410608 0.0761052720799 0.0812258833877 0.0876149863831 0.0899983206228 0.0913824024294 0.0911748880123 0.0899389823325 0.0875864359292 0.0840401252833 0.0790797296989 0.0724749224939 0.0641026159034 0.054156134802 0.0434532806269 0.0339163688317 0.0285423642465 0.0273940073606 0.026342526341 0.0208922112397 0.0163894610295 0.00919753471926 0.00645696425521 0.00458408753001 0.00312009643837 0.00188943762733 0.000872456005775 1.08457736027e-05 -0.000696560802256 -0.0012693338131 -0.00172499050519 -0.00208157742749 -0.00234512208338 -0.00254316758244 -0.00267895977318 -0.00276253625572 -0.118032093762 -0.118031804291 -0.11803049494 -0.11802829008 -0.11802609884 -0.118023603257 -0.118020286158 -0.118016143736 -0.11801155498 -0.118007029319 -0.118003126825 -0.118000527218 -0.118000046428 -0.118002505282 -0.118008784393 -0.118019361119 -0.118033727759 -0.1180522013 -0.118075354327 -0.118103989008 -0.118137354021 -0.118173422012 -0.118211511733 -0.118249931536 -0.118279863064 -0.118286534514 -0.118251064367 -0.118161777103 -0.117990501124 -0.117702045134 -0.117242216809 -0.116536001929 -0.11548373962 -0.11401327173 -0.112031428061 -0.10949961873 -0.10641371636 -0.102751686703 -0.0995000393603 -0.105419274733 0.0475902902363 0.0690313904542 0.0249931173697 0.0617076336593 0.0631112387225 0.0806396066982 0.0854503661668 0.0918611807949 0.0940848157097 0.0954182129865 0.0951272443208 0.093825015734 0.0913728798561 0.0876781266661 0.0824890089965 0.0755668629005 0.0668213094437 0.0565603620324 0.0458168401897 0.036975782349 0.0336502051472 0.03367711229 0.0267072629029 0.0160747488969 0.0152543662735 0.0124186116287 0.00974144324928 0.00755610606137 0.00576125649569 0.00425865472833 0.00300215114483 0.00196946666305 0.00112432094459 0.000445356078541 -8.59930771315e-05 -0.000494820645784 -0.000797412380451 -0.00102430333652 -0.00117482839638 -0.00126045351107 -0.118042206211 -0.118042583844 -0.118042350261 -0.118041617085 -0.11804119275 -0.118041131276 -0.11804042641 -0.118039901147 -0.118040345138 -0.118042600992 -0.118047482697 -0.118056039807 -0.118069442396 -0.11808850718 -0.118114201449 -0.118147064819 -0.118187694228 -0.118237755976 -0.118299428173 -0.118374188696 -0.118461401598 -0.118561817585 -0.118676468253 -0.118805175569 -0.118940901162 -0.119072915612 -0.119190133424 -0.119288345961 -0.119340743411 -0.119306326939 -0.119115751439 -0.118675906173 -0.117891612219 -0.116645675932 -0.114782459209 -0.112220246761 -0.108906301035 -0.104780631178 -0.100773841156 -0.106864082166 0.0508300316072 0.0727675021738 0.0285953111989 0.0661805922225 0.0670873502688 0.0849007149271 0.0893831479888 0.0958141180017 0.0978967548334 0.09920978049 0.0988849192426 0.0975759572266 0.0951018148001 0.0913471715458 0.0860333184825 0.078906858832 0.069912837394 0.0595019270888 0.0490164173969 0.0412277622193 0.040047435403 0.0432541751884 0.0356679756038 0.0095234410002 0.01668411813 0.0151557173356 0.0128306797485 0.0104210011244 0.0082892237175 0.00651320570697 0.00503398810208 0.00382314629898 0.00283887889075 0.00205080701756 0.00144249511026 0.000978532686925 0.000631240856809 0.000379152564848 0.000211791033807 0.00012872381641 -0.118052216353 -0.118052886703 -0.118053687999 -0.11805496157 -0.118055932559 -0.118056679619 -0.118058145689 -0.118061388105 -0.118067326818 -0.118077170697 -0.11809173622 -0.118112108459 -0.118139237031 -0.118174154882 -0.11821823171 -0.11827257847 -0.118339223653 -0.118420940337 -0.118520607013 -0.118640286703 -0.118781714127 -0.118947582899 -0.11914082547 -0.119363550129 -0.11961248913 -0.119882232111 -0.120172475493 -0.120483136903 -0.120795458175 -0.121068767864 -0.121230613265 -0.121172523232 -0.12077880477 -0.119869297191 -0.118226673855 -0.115687334227 -0.112125311266 -0.107477235635 -0.102340498177 -0.108419081701 0.0540715172925 0.0763713215994 0.0321236556192 0.0704841078355 0.0707899651087 0.0888666026799 0.0929665655566 0.0994396404962 0.101376478895 0.102717545745 0.10239631083 0.101154841371 0.0987372000151 0.0950329959655 0.0897217682699 0.0825558708488 0.073509746342 0.0631881466279 0.0533701944267 0.047376800029 0.0470939587985 0.0466452538407 0.039321480745 0.0331342105723 0.0242742769352 0.0198702009162 0.016359181447 0.0133634404875 0.0107842862204 0.00865074054701 0.00692298827068 0.00553077696007 0.00441120283368 0.00351370134522 0.00281638323576 0.00229060708652 0.00190355167242 0.0016325239926 0.00144691962891 0.00136678287196 -0.118062302269 -0.118062714726 -0.118063973736 -0.118065942456 -0.118067433564 -0.118069486478 -0.118073977777 -0.1180820804 -0.118094710114 -0.118112705835 -0.118136670144 -0.118167682345 -0.118206861835 -0.118256005339 -0.118317073136 -0.118392288286 -0.118484566875 -0.118597394024 -0.118734396641 -0.118898552933 -0.11909353743 -0.119324398606 -0.119597263039 -0.119916686708 -0.120284463385 -0.120702124089 -0.121180725059 -0.121726116454 -0.122333609596 -0.122976114711 -0.12357561451 -0.124025468436 -0.124201897977 -0.123812960155 -0.122561329398 -0.120162438473 -0.11635651721 -0.110923243902 -0.104635215982 -0.109785366046 0.0573297379732 0.0800778025399 0.0356823920467 0.0746484617631 0.074261491867 0.0924558073134 0.0961772501745 0.102618661328 0.104465078036 0.105831572358 0.105601136148 0.10448621919 0.102252043136 0.0987272179259 0.0936061769869 0.0866100899707 0.077779033859 0.0677705661964 0.05867116679 0.0548878780059 0.0565285486442 0.047973253472 0.0334011588624 0.0318225275117 0.027965401928 0.0237423880952 0.0197323575643 0.0162016209993 0.0131818548273 0.0106736390042 0.00865712096759 0.00706326856524 0.00580700034775 0.0048112207491 0.00403032952625 0.0034380741306 0.00300601496763 0.00272051604928 0.00252091359184 0.00243471570768 -0.118071088505 -0.11807121686 -0.118072506872 -0.118074390331 -0.118076575973 -0.118081394133 -0.118090307524 -0.118103900374 -0.11812263418 -0.118147121782 -0.118178655229 -0.118218739809 -0.118269069317 -0.118331782612 -0.118409429159 -0.118505142963 -0.118622446228 -0.118765101994 -0.118937136282 -0.119143136648 -0.119389312258 -0.119683092068 -0.120032591321 -0.120445672316 -0.120931633202 -0.121503349069 -0.122180122241 -0.122982457173 -0.123924804514 -0.124988467861 -0.126110999103 -0.127224589363 -0.128182162582 -0.128581960151 -0.128030435352 -0.126031554911 -0.122113190304 -0.11580866834 -0.107477557835 -0.111107588999 0.0612872586033 0.0838952591196 0.0392697337844 0.078551967754 0.0772654355695 0.095661969338 0.0988299715987 0.105381355575 0.10704547603 0.108561592891 0.108397304705 0.107521587126 0.105515613144 0.102321851371 0.0975459339148 0.0909929032076 0.0827557696706 0.073715371209 0.066054852838 0.0653264772394 0.072509476535 0.0623121497127 0.025088740045 0.0346037423807 0.0317550664871 0.0276482143182 0.0231597934287 0.0189693189336 0.0154316136017 0.0125342512796 0.0102162438262 0.0084020903164 0.00699989221983 0.00590663256633 0.00506020791825 0.00442005283948 0.00394502528625 0.00363148783332 0.00342527579926 0.00331625621876 -0.118077903687 -0.118078098424 -0.118079530499 -0.118081691041 -0.118085407986 -0.118093855419 -0.11810668426 -0.118124124286 -0.118147323883 -0.118177442045 -0.118215955844 -0.118264618559 -0.1183255027 -0.118401146499 -0.118494768662 -0.118609775526 -0.118749085848 -0.118916961756 -0.119119328026 -0.119363111341 -0.11965617502 -0.120007532943 -0.12042751858 -0.120929176017 -0.12153042069 -0.122254368663 -0.12313067454 -0.12419783419 -0.125492547909 -0.127022470682 -0.128771563855 -0.130717386481 -0.132683291936 -0.134221682053 -0.134853537574 -0.133808830406 -0.130165670705 -0.12317902151 -0.111786634948 -0.111904473966 0.0653507252769 0.0891094747341 0.0431550797811 0.0824023084023 0.0803207398152 0.0980912234178 0.101151555702 0.107211801971 0.109136578951 0.110484996498 0.110744329061 0.110011882343 0.108561578292 0.105805372367 0.101780496978 0.0959905052181 0.0888935210605 0.0814742011177 0.0765195626382 0.0772651423738 0.0799251781547 0.0694949390206 0.058012758712 0.0453419824595 0.0380681509651 0.0320910509756 0.0266935211963 0.021738728678 0.0175392271147 0.014201626273 0.0115783778767 0.00954061598756 0.00798744846079 0.0067978944793 0.005881837547 0.00519903900699 0.00470023568298 0.00436021267188 0.00414220977574 0.00401553004213 -0.118083378824 -0.118083947743 -0.118085240789 -0.118087727103 -0.118093324122 -0.118104629339 -0.118120089403 -0.118140881832 -0.118168215184 -0.118203465714 -0.118248317764 -0.118304800424 -0.118375302382 -0.118462734937 -0.118570154998 -0.118700069505 -0.118855961654 -0.119044350333 -0.119272995778 -0.119549979496 -0.119884278782 -0.120286212786 -0.120768045216 -0.121347926908 -0.122053574274 -0.122918312942 -0.123982309086 -0.125302569665 -0.126946297113 -0.128970823342 -0.131412427721 -0.134331094267 -0.137553125427 -0.14064110225 -0.143108213255 -0.143930712486 -0.141544058105 -0.133999029422 -0.119917125232 -0.112687013774 0.0751945650842 0.0937315828679 0.0462922520459 0.0857344381986 0.0815634229009 0.100449460828 0.101998094966 0.109081648967 0.110227734924 0.112342932243 0.112317394021 0.112209660033 0.110847755527 0.108793067665 0.105330309131 0.100744052564 0.0951859566317 0.0904527449124 0.0900504714127 0.096618624926 0.0875501752098 0.0618707215396 0.0575192232274 0.0496759394705 0.0423876966969 0.035798330807 0.0297808497318 0.0242638967942 0.0194495141636 0.0156425521337 0.0127187167703 0.0104740421958 0.00877473875243 0.00749760613989 0.00651962777144 0.00578396887551 0.00525585645485 0.00490102347524 0.00468294698682 0.00457861417899 -0.118086826174 -0.118087523417 -0.118089084764 -0.118092621038 -0.118099895539 -0.118112899128 -0.118130536507 -0.118154252086 -0.118185182233 -0.118224862013 -0.118275097901 -0.11833815036 -0.118416674025 -0.118513334904 -0.118630580316 -0.118771071194 -0.118939440982 -0.119143998757 -0.119394006739 -0.119697993508 -0.120065955065 -0.120509384156 -0.121040380582 -0.121681081519 -0.122471749752 -0.123456682074 -0.124680959476 -0.12621767611 -0.1281839316 -0.13068563175 -0.133828902401 -0.137785112022 -0.142432611322 -0.147461188877 -0.15252393158 -0.156245714093 -0.15771918051 -0.150295183726 -0.134635520801 -0.111840529319 0.0889626173288 0.100785329075 0.0505369215413 0.09160530555 0.0833286247835 0.102240759513 0.102083664025 0.109295505232 0.110072823309 0.11259255007 0.112831127741 0.113424443808 0.112806899644 0.111920786322 0.109899285316 0.107277768599 0.104279406021 0.10246674009 0.107748181932 0.127552900155 0.113748683015 0.0489887570928 0.0589175847072 0.0533013737434 0.0460719105611 0.0389338594606 0.0323443476979 0.0263579119681 0.0210375666745 0.0167923674119 0.0136081265706 0.0111942847797 0.0093725966032 0.00801049128445 0.00698815194345 0.00622070069702 0.00566544891217 0.00529434034872 0.00507755609582 0.00499781041109 -0.118088558786 -0.118089294542 -0.118091853829 -0.118096584489 -0.118104472202 -0.118118478022 -0.118137712504 -0.118163941118 -0.118197763634 -0.118240663548 -0.118294554302 -0.118362139463 -0.118446217168 -0.118549397078 -0.118673988854 -0.118821721695 -0.118997817907 -0.119213328923 -0.119478297099 -0.119801059245 -0.120193661061 -0.120666419965 -0.121225691833 -0.121902110304 -0.12275418997 -0.123831670512 -0.125178230015 -0.126879122127 -0.12908419763 -0.131974532018 -0.135737077589 -0.140629314432 -0.146682296731 -0.153807618809 -0.161985003577 -0.169817236265 -0.169880649902 -0.174771144209 -0.174382035944 -0.12090085072 0.157766242529 0.0757669028401 0.0535054940387 0.101485311132 0.0662620861259 0.117669474609 0.0870513377104 0.121872493796 0.100760041684 0.121260626118 0.107795484372 0.118963126605 0.110209730814 0.115596466504 0.109139366596 0.111755568715 0.108323668501 0.117102995228 0.124662748243 0.162168451945 0.148402469785 0.108738840522 0.0688283016862 0.0599413176849 0.049947327367 0.0416035576288 0.0343175118428 0.0278996270568 0.0221891133637 0.0175740385873 0.0142061306765 0.0117000066647 0.00979483341228 0.00836092594056 0.00729692581793 0.00650867711746 0.00593781136809 0.00555381698994 0.00532382134641 0.00523280216364 -0.118089238283 -0.118090209452 -0.118094014773 -0.118099430571 -0.118107658929 -0.118120210698 -0.118139899236 -0.118168155444 -0.118203350156 -0.118247510265 -0.118303241994 -0.118373659258 -0.118461838801 -0.118570202277 -0.118699816135 -0.118850009006 -0.119026820363 -0.119245665061 -0.119518580179 -0.119851558059 -0.120255230394 -0.120740062304 -0.121315974579 -0.122015349428 -0.122899226046 -0.124025526813 -0.125438990004 -0.127228836074 -0.129571688334 -0.132698032977 -0.136827613844 -0.142327068167 -0.14943641536 -0.15826066065 -0.171055477499 -0.172867728306 -0.177804174695 -0.176268652934 -0.177580701588 -0.188661847329 0.228775692593 0.0329037424135 0.0897616694984 0.130268693926 0.0561039066981 0.142478732531 0.065173588765 0.135290200338 0.0819521458244 0.128110978361 0.0964879667724 0.125177660296 0.108167443862 0.126887092868 0.118819002179 0.134024143877 0.130592518008 0.149727120934 0.139654539249 0.179319894011 0.103675281331 0.0635304755502 0.0661464243164 0.0652801788754 0.0523656721269 0.043192641872 0.0354278626934 0.0287310175894 0.0227986331857 0.0179600695852 0.0144852475292 0.0119515230682 0.0100161879312 0.00854134464698 0.00744725707746 0.00664674905695 0.00607143571993 0.00567920116474 0.00543043845414 0.00532639669661 ) ; boundaryField { frontAndBack { type empty; } upperWall { type zeroGradient; } lowerWall { type zeroGradient; } inlet { type zeroGradient; } outlet { type adjointOutletPressurePower; value nonuniform List<scalar> 20 ( 0.0207759101279 0.104213093505 0.143078836013 0.167411534333 0.183749585015 0.193950091111 0.19803946851 0.197318407126 0.194902710647 0.191776780254 0.188008152227 0.183568418803 0.178429221721 0.172559476632 0.165916665183 0.158384181178 0.14990464717 0.140510019373 0.131642272529 0.102787776472 ) ; } } // ************************************************************************* //
1c3e74729e115e361bf3ee382c27f757f261b988
7bb951c4ff12631ea58ad0d1b9900a9cfbff8672
/02 栈、队列与哈希/02 如何实现队列/题目/2.cpp
5cd2330a51156279d5028ddbe24e235073d1109b
[]
no_license
Newbie-W/ProgrammerAlgorithmInterview
8dc9293ab9f3a03a09e549b374e47ceda1de6957
376a0b8e6276ccbaf2ecc50e189534c5d341b6c5
refs/heads/master
2021-07-10T14:00:04.142741
2021-03-12T03:50:53
2021-03-12T03:50:53
235,237,131
0
0
null
null
null
null
UTF-8
C++
false
false
2,455
cpp
2.cpp
/* 实现一个队列的数据结构, 使其具有【入队列】、【出队列】、【查看队列首尾元素】以及【查看队列大小】等功能 法二:链表实现 1. 分别用两个指针指向队列的首元素和尾元素。pHead指向队列首元素。pEnd指向队列尾元素 2. 入队列:将队尾加入新结点,然后移动队列尾指针 出队列:队列首元素指针后移 */ #include <stdio.h> #include <stdlib.h> #define MAXSIZE 10 #define TRUE 1 #define FALSE 0 typedef int T; typedef int Status; // typedef int bool; typedef struct Node Node; struct Node { T data; Node* next; }; typedef struct MyQueue { Node* pHead; Node* pEnd; } MyQueue; // 初始化队列 void initQueue(MyQueue *q) { q->pEnd = q->pHead = NULL; } // 判断队列是否为空 bool isEmpty(MyQueue *q) { return q->pHead == NULL; } // 返回队列的大小 int size(MyQueue *q) { int size = 0; Node* p = q->pHead; while (p != NULL) { p = p->next; size++; } return size; } // 返回队列首元素 Status getFront(MyQueue *q, T* e) { if (!q->pHead) { printf("获取队列首元素失败。队列为空\n"); return FALSE; } *e = q->pHead->data; return TRUE; } // 返回队列尾元素 T getBack(MyQueue *q, T* e) { if (!q->End) { printf("获取队列尾元素失败,队列为空\n"); return FALSE; } *e = q->pEnd->data; return TRUE; } // (出队列)删除队列头元素 void deQueue(MyQueue *q) { if (!q->pHead) { printf("出队列失败,队列为空\n"); } Node* tmp = q->pHead; q->pHead = q->pHead->next; if (!q->pHead) { // 最后一个元素出队列,设置队尾指针也为空 q->pEnd = NULL; } free(tmp); } // (入队列)新元素加入队列尾 Status enQueue(MyQueue *q, T e) { Node* p = (Node*)malloc(sizeof(Node)); if (!p) { printf("申请结点失败"); return FALSE; } p->data = e; p->next = NULL; if (!q->pHead) { // 新元素入空队列 q->pHead = q->pEnd = p; } else { q->pEnd->next = p; q->pEnd = p; } return TRUE; } void destroyQueue(MyQueue *q) { Node* p = q->pHead; while (p) { Node* tmp = p; p = p->next; free(tmp); } } int main() { MyQueue queue; initQueue(&queue); enQueue(&queue, 1); enQueue(&queue, 2); int e; if (getFront(&queue, &e)) { printf("队列头元素为:%d\n", e); } if (getBack(&queue, &e)) { printf("队列尾元素为:%d\n", e) } printf("队列大小为:%d\n", size(&queue)); return 0; }
09a1826086e7cf14cf8c52426f821bb2b75938be
0e933dcbe2ead513c8cb8dff4487c78f2bfa3f18
/src/search.cpp
61502958ace2915e7e63a37fb2b9da8f43f45e4d
[]
no_license
xzijoq/chessBingen
89d9fe4fa79ee93ae8917b556ea1bbf267f0a18f
eeed4d90741925a0d9635f3045f626c9d8ef60fb
refs/heads/master
2020-05-17T00:48:58.810486
2019-05-19T07:46:45
2019-05-19T07:46:45
183,401,550
0
0
null
null
null
null
UTF-8
C++
false
false
20
cpp
search.cpp
#include<data.h>
bbc294fda7423ac403267146c668f0a8ea9b5fbf
73a7b4aa23e861ad2a8d5dda0a700bb6a7fa2fa4
/Preenchimento de Vetor I.cpp
3c88614920c7f1819704a37c9776053e75feabef
[]
no_license
jacksonn455/Exercicios
127300c92d84d0dfdd304e9a25e0d3db05678ce2
f31978c0425188e7b2a5efff0144854d8cf32048
refs/heads/master
2020-04-25T18:05:03.607794
2019-06-18T14:28:32
2019-06-18T14:28:32
null
0
0
null
null
null
null
UTF-8
C++
false
false
314
cpp
Preenchimento de Vetor I.cpp
#include<iostream> #include<iomanip> using namespace std; int main(){ double x[100],y[100]; int i; for(i=0;i<100;i++){ cin >> x[i]; y[i] = x[i]*4; if(y[i]<0){ y[i] = y[i] * -1; } cout << fixed << setprecision(1); cout << "Y[" <<i <<"] = "<<y[i]<<endl; } }
6d10ec03357b85052b98bff6aabc9428007795f9
1745d6834e3d294917f4a23964a203723620ddcb
/mainform.h
23bac30e94c7a78e8a57705acc7b17061b7074a1
[]
no_license
maxiprogram/CopyData
9f53b38ffb1edef6f80fafaf72650e05b87ea136
ea15c960cfb8f816fcb48fd30cad80624010ad6d
refs/heads/master
2021-01-25T07:07:38.457316
2015-03-25T10:23:56
2015-03-25T10:23:56
32,796,664
0
0
null
null
null
null
UTF-8
C++
false
false
1,152
h
mainform.h
#ifndef MAINFORM_H #define MAINFORM_H #include <QMainWindow> #include <QSettings> #include <QMessageBox> #include <QFileDialog> #include <QTimer> #include <QSystemTrayIcon> #include <QCloseEvent> #include "about.h" #include "threadcopy.h" namespace Ui { class MainForm; } class MainForm : public QMainWindow { Q_OBJECT public: explicit MainForm(QWidget *parent = 0); ~MainForm(); void ReadIni(int& time_update, QString& path_src, QString& path_dest); void WriteIni(int time_update, QString path_src, QString path_dest); void closeEvent(QCloseEvent* event); private slots: void onTimerCopy(); void trayIconActivated(QSystemTrayIcon::ActivationReason reason); void on_pushButton_clicked(); void on_pushButton_2_clicked(); void on_pushButton_3_clicked(); void on_action_3_triggered(); void on_pushButton_4_clicked(); void on_action_triggered(); private: Ui::MainForm *ui; int time_update; QString path_src; QString path_dest; bool flag_copy; QTimer* timer; ThreadCopy* thread_copy; QSystemTrayIcon* tray; About* about_form; }; #endif // MAINFORM_H
24a7e66f68ee27bf34775fdb364711233b5e19dc
efb30f8d69b0a4499f737c6de27d79f4d00940f8
/p256_pbc/mdrun.hpp
ebdd6908fc6f05aedf60c594bb2570a33b6a4ea7
[]
no_license
nabehironagoya/cppmd
9f6a0ace4d0d614a63c83d51c78509b0b3159431
84cbabe6fa82f568383e3ae3bd0c06ac88249d29
refs/heads/master
2020-06-21T04:34:30.350610
2019-07-24T07:09:03
2019-07-24T07:09:03
197,345,176
0
0
null
null
null
null
UTF-8
C++
false
false
4,027
hpp
mdrun.hpp
#include <iostream> #include <string> #include <cmath> #include <vector> using namespace std; double mod(double, double); class Atom{ static int n_atoms; int num; int resnr; string resname; string atomname; double mass; double epsilon; double sigma; double r[3]; double v[3]; double f[3]; public: static int get_n_atoms(){return n_atoms;} Atom(){ n_atoms++; // initialize atom info for (int xyz=0; xyz<3; xyz++){ this->r[xyz] = 0.0; this->v[xyz] = 0.0; this->f[xyz] = 0.0; } this->num = n_atoms; this->resname = "None"; this->resnr = 0; this->atomname = "None"; this->mass = 1.0; this->epsilon = 0.5; this->sigma = 0.5; } ~Atom(){n_atoms--;} void set_resnr(int resnr){this->resnr = resnr;} void set_resname(string resname){this->resname = resname;} void set_atomname(string atomname){this->atomname = atomname;} void set_mass(double mass){this->mass = mass;} void set_epsilon(double epsilon){this->epsilon = epsilon;} void set_sigma(double sigma){this->sigma = sigma;} int get_num(){return this->num;} int get_resnr(){return this->resnr;} string get_resname(){return this->resname;} string get_atomname(){return this->atomname;} double get_mass(){return this->mass;} double get_epsilon(){return this->epsilon;} double get_sigma(){return this->sigma;} double get_r(int xyz){return this->r[xyz];} double get_v(int xyz){return this->v[xyz];} double get_f(int xyz){return this->f[xyz];} void set_r(int xyz, double r){this->r[xyz] = r;} void set_v(int xyz, double v){this->v[xyz] = v;} void add_f(int xyz, double f){this->f[xyz] += f;} void integrate_r(double dt, double *box){ for (int xyz=0; xyz<3; xyz++){ this->r[xyz] += this->v[xyz]*dt; this->r[xyz] = mod(this->r[xyz], box[xyz]); } } void integrate_v(double dt){ for (int xyz=0; xyz<3; xyz++){ this->v[xyz] += 0.5*(this->f[xyz]*dt)/(this->mass); } } void reset_f(){ for (int xyz=0; xyz<3; xyz++){ this->f[xyz] = 0.0; } } double get_kin(){ double kin = 0.0; for (int xyz=0; xyz<3; xyz++){ kin += 0.5*(this->mass)*pow(this->v[xyz], 2); } return kin; } }; // for interaction between 2 particles class Itp{ int i, j; double eps_ij; double sig_ij; double d_ij; double p_ij; double f_ij[3]; double r_ij[3]; public: Itp(){} ~Itp(){} void init(Atom *atom, int i, int j){ this->i = i; this->j = j; this->eps_ij = sqrt(atom[i].get_epsilon() * atom[j].get_epsilon()); this->sig_ij = 0.5*(atom[i].get_sigma() + atom[j].get_epsilon()); } double get_eps_ij(){return this->eps_ij;} double get_sig_ij(){return this->sig_ij;} void set_r_ij(Atom *atom, double *box){ // box?? this->d_ij = 0.0; for (int xyz=0; xyz<3; xyz++){ this->r_ij[xyz] = atom[this->j].get_r(xyz) - atom[this->i].get_r(xyz) - box[xyz]*round((atom[this->j].get_r(xyz) - atom[this->i].get_r(xyz))/box[xyz]); this->d_ij += pow(r_ij[xyz], 2); } this->d_ij = sqrt(this->d_ij); } void set_f_ij(Atom *atom, double r_c){ if (this->d_ij < r_c){ for (int xyz=0; xyz<3; xyz++){ this->f_ij[xyz] = 4*(this->eps_ij/this->sig_ij)*(12*pow(this->sig_ij/this->d_ij, 13) - 6*pow(this->sig_ij/this->d_ij, 7))*(this->r_ij[xyz]/this->d_ij); atom[this->i].add_f(xyz, -this->f_ij[xyz]); atom[this->j].add_f(xyz, this->f_ij[xyz]); } } } double set_p_ij(Atom *atom, double r_c){ if (this->d_ij < r_c){ this->p_ij = 4*this->eps_ij*(pow(this->sig_ij/this->d_ij, 12) - pow(this->sig_ij/this->d_ij, 6)); return this->p_ij; }else{ return 0; } } };
81df3b2609560c5b83ed347107adecb978cf4c1b
f9ad1b06b1f80675eccb23d70009f79e8c4af0d7
/dal/network/tcpclient.cpp
36c96538d26e713cca077617ff761e991693655b
[]
no_license
canispeakchinese/farm_client
5531ff0fbddd7d3a3bd6b0497ddce5715cc5ad9e
e9b1465a1af652213a15f3347b577dcc8f724ec0
refs/heads/master
2020-03-11T04:47:54.893603
2018-05-26T08:47:44
2018-05-26T08:47:44
129,785,317
0
0
null
null
null
null
UTF-8
C++
false
false
3,304
cpp
tcpclient.cpp
#include "tcpclient.h" #include <QDataStream> #include <QIODevice> #include <QMessageBox> #include <QHostAddress> TcpClient::TcpClient(MainView* parent): QTcpSocket(new QTcpSocket()), parent(parent) { totalBytes = 0; inBlock.resize(0); connect(this, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(connectError())); connect(this, SIGNAL(connected()), this, SLOT(connectSuccess())); connect(this, SIGNAL(readyRead()), this, SLOT(readyRead())); } void TcpClient::start() { // 连接失败直接报错 qDebug() << "Start connect to server"; connectToHost(QHostAddress(ipAddress), 6666); if(waitForConnected(1000) == false) { connectError(); } } void TcpClient::connectError() { qDebug() << "TcpClient Connect Error: " << errorString() << ", can retry num: " << retryNum; if(retryNum > 0) { MainView::tcpMutex.lock(); retryNum--; MainView::tcpMutex.unlock(); QMessageBox::warning(parent, "连接网络失败", errorString()); connectToHost(QHostAddress(ipAddress), 6666); if(waitForConnected(1000) == false) { connectError(); } } else { exit(-1); } } void TcpClient::connectSuccess() { qDebug() << "TcpClient Connect Success, And Set Connect Retry Num to 3"; MainView::tcpMutex.lock(); retryNum = 3; MainView::tcpMutex.unlock(); } void TcpClient::readyRead() { if(!bytesAvailable()) return; inBlock.append(readAll()); while(true) { if(totalBytes == 0) { if(inBlock.size() >= (int)(sizeof(qint64) + sizeof(int))) { QDataStream in(&inBlock, QIODevice::ReadWrite); in.setVersion(QDataStream::Qt_5_5); in >> totalBytes; in >> messageType; inBlock = in.device()->readAll(); } else { break; } } if(inBlock.size() >= totalBytes - 12) { QDataStream all(&inBlock, QIODevice::ReadWrite); all.setVersion(QDataStream::Qt_5_5); QByteArray message = all.device()->read(totalBytes - 12); QDataStream in(&message, QIODevice::ReadWrite); in.setVersion(QDataStream::Qt_5_5); switch (messageType) { case 1: emit getLoginResult(in); break; case 2: emit getSignResult(in); break; case 3: emit getUpdateResult(in); break; case 4: emit getPlantResult(in); break; case 5: emit getBusinessResult(in); break; case 6: emit getSpadResult(in); break; case 7: emit getHarvestResult(in); break; case 8: emit getStatusChangeResult(in); break; case 9: emit getReclaResult(in); break; case 10: emit getFertilizeResult(in); break; default: break; } inBlock = all.device()->readAll(); totalBytes = 0; } } }
5fd115c065e168b1d66d127b228666e8e4ca1629
c9822f8c49046088715ea96762dbffedd014a0b0
/hardwork/STL/queue.hpp
35e0fe3b88bc34afebf26fed811042c838a0e5e4
[ "MIT" ]
permissive
jskyzero/Cplusplus.Playground
471d6b6068c5ad9119db86c346143e9f9103f5f8
b4a82bb32af04efcffb6e251ac8956a3cc316174
refs/heads/master
2023-01-07T00:23:48.900807
2020-11-12T04:49:21
2020-11-12T04:49:21
201,798,526
0
0
null
null
null
null
UTF-8
C++
false
false
2,136
hpp
queue.hpp
/* Queue (abstract data type) In computer science, a queue (/ˈkjuː/ kyew) is a particular kind of abstract data type or collection in which the entities in the collection are kept in order and the principal (or only) operations on the collection are the addition of entities to the rear terminal position, known as enqueue, and removal of entities from the front terminal position, known as dequeue. This makes the queue a First-In-First-Out (FIFO) data structure. In a FIFO data structure, the first element added to the queue will be the first one to be removed. This is equivalent to the requirement that once a new element is added, all elements that were added before have to be removed before the new element can be removed. Often a peek or front operation is also entered, returning the value of the front element without dequeuing it. A queue is an example of a linear data structure, or more abstractly a sequential collection. Constructor operations to construct a queue: i. createQueue( ) // post: creates an empty queue ii. enqueue(newItem) // [equivalent to add(newItem)] // post: adds newItem at the end of the queue. Selector operations to select items of a queue i. front( ) // post: returns the item at the front of the queue. It does not change the //queue. Predicate operations to test Queues i. isEmpty( ) // post: determines whether a queue is empty ii. dequeue( ) // post: retrieves and removes the item at the front of the queue. */ #include <iostream> #include <queue> #include <cassert> typedef std::queue<int> Queue; void print_queue(Queue initial_queue) { Queue copied_queue = initial_queue; while (!copied_queue.empty()) { std::cout << copied_queue.front() << "-"; copied_queue.pop(); } std::cout << "end\n"; } void practice_queue(void) { std::cout << "practice_queue" << std::endl; // i. createQueue( ) Queue myqueue; // ii. enqueue(newItem) myqueue.push(123); myqueue.push(456); print_queue(myqueue); // i. front( ) assert(myqueue.front() == 123); // i. isEmpty( ) assert(!myqueue.empty()); // ii. dequeue( ) myqueue.pop(); print_queue(myqueue); }
e9450a63a81e6e971a178ff0be01f294e7dc0552
590c5838440cac897007f8dfb1d5f68bc35928c3
/Exercicios/Lista 5 - Exercícios de Vetores/exercicio17.cpp
11728bf3da2d34ed7839265d664da1b877bf89fc
[]
no_license
luizsilvadev/algoritimos
3f8360814246805887cd5c28c4520d2acb884483
9ea895482a719cc4ca3278b5da0b3d5a0c15cef6
refs/heads/master
2022-11-21T10:10:46.323109
2020-07-26T01:10:49
2020-07-26T01:10:49
282,448,527
0
0
null
null
null
null
UTF-8
C++
false
false
432
cpp
exercicio17.cpp
#include <iostream> using namespace std; int main(){ int tam; bool encontrou=false; cin>>tam; char vetor[tam],busca; for (int i=0;i<tam;i++){ cin>>vetor[i]; } cin>>busca; for (int i=0;i<tam;i++){ if (vetor[i]==busca){ cout<<i<<" "; encontrou=true; } } if (not encontrou){ cout<<-1; } return 0; }
e1ce7776d52a939ae7e08e5c876e507e8c2ece8a
efe79a0c8a5a48220bce63e7c35be993b5e6c3a8
/src/backends/multicore/intrin_avx512.hpp
1ef6354dfd55f594f6f760b932c01b1f6445964a
[ "BSD-3-Clause" ]
permissive
kabicm/arbor
4d4a4b731f64c80b9d181bae830d572637490f04
cfab5fd6a2e6a211c097659c96dcc098ee806e68
refs/heads/master
2021-09-05T10:04:34.454500
2018-01-16T10:47:32
2018-01-16T10:47:32
94,232,576
0
0
null
null
null
null
UTF-8
C++
false
false
2,203
hpp
intrin_avx512.hpp
#pragma once // vector types for avx512 // double precision avx512 register using vecd_avx512 = __m512d; // 8 way mask for avx512 register (for use with double precision) using mask8_avx512 = __mmask8; inline vecd_avx512 set(double x) { return _mm512_set1_pd(x); } namespace detail { // Useful constants in vector registers const vecd_avx512 vecd_avx512_zero = set(0.0); const vecd_avx512 vecd_avx512_one = set(1.0); const vecd_avx512 vecd_avx512_two = set(2.0); const vecd_avx512 vecd_avx512_nan = set(std::numeric_limits<double>::quiet_NaN()); const vecd_avx512 vecd_avx512_inf = set(std::numeric_limits<double>::infinity()); const vecd_avx512 vecd_avx512_ninf = set(-std::numeric_limits<double>::infinity()); } // // Operations on vector registers. // // shorter, less verbose wrappers around intrinsics // inline vecd_avx512 blend(mask8_avx512 m, vecd_avx512 x, vecd_avx512 y) { return _mm512_mask_blend_pd(m, x, y); } inline vecd_avx512 add(vecd_avx512 x, vecd_avx512 y) { return _mm512_add_pd(x, y); } inline vecd_avx512 sub(vecd_avx512 x, vecd_avx512 y) { return _mm512_sub_pd(x, y); } inline vecd_avx512 mul(vecd_avx512 x, vecd_avx512 y) { return _mm512_mul_pd(x, y); } inline vecd_avx512 div(vecd_avx512 x, vecd_avx512 y) { return _mm512_div_pd(x, y); } inline vecd_avx512 max(vecd_avx512 x, vecd_avx512 y) { return _mm512_max_pd(x, y); } inline vecd_avx512 expm1(vecd_avx512 x) { // Assume that we are using the Intel compiler, and use the vectorized expm1 // defined in the Intel SVML library. return _mm512_expm1_pd(x); } inline mask8_avx512 less(vecd_avx512 x, vecd_avx512 y) { return _mm512_cmp_pd_mask(x, y, 0); } inline mask8_avx512 greater(vecd_avx512 x, vecd_avx512 y) { return _mm512_cmp_pd_mask(x, y, 30); } inline vecd_avx512 abs(vecd_avx512 x) { return max(x, sub(set(0.), x)); } inline vecd_avx512 min(vecd_avx512 x, vecd_avx512 y) { // substitute values in x with values from y where x>y return blend(greater(x, y), x, y); } inline vecd_avx512 exprelr(vecd_avx512 x) { const auto ones = set(1); return blend(less(ones, add(x, ones)), div(x, expm1(x)), ones); }
83f7ac78e9b7b3ec17c011f4f64de79da050e226
fa161bf3f18e18726ee939d16ed34bf9d0a080ba
/src/lib/asg/postgres_backend_model/data_schema.cpp
7c1cc1a0a1d967441d2ff813431358be234663dd
[]
no_license
appstackgen/appstackgen
c6b50565f59d609225eb6e6f667f4fb57ad026bf
1dabb43a984ce8d81b1bf746f5d4b8bd0c8b6602
refs/heads/master
2021-01-20T07:13:35.267281
2015-06-09T06:12:27
2015-06-09T06:12:27
34,614,112
0
0
null
null
null
null
UTF-8
C++
false
false
270
cpp
data_schema.cpp
/* * This file is part of Project 'appstackgen'. * * Copyright (c) 2015, Johannes Lochmann * * All rights reserved. */ #include "data_schema.h" namespace asg { namespace postgres_backend_model { string data_schema::static_node_type_name { "data_schema" }; } }