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
8046dbcd0fda3829bbfb4f90975c164bc4c926c5
b3cf660dc6b38d59fdfe82f8d9dca2eecdbe31cb
/WindowsAudioOutput/WindowsAudioOutput.h
e8ad7d750a936f504e8ac3cc4469372d8c29756c
[]
no_license
f1nality/WindowsAudioOutput
0dc0fb3833f7b98527e4b1a99a57341d8a18db36
7dece5c45e0635090a0dc4c2cd3e4a75e61e02a7
refs/heads/master
2020-04-09T10:12:23.105759
2014-08-03T13:42:48
2014-08-03T13:42:48
21,322,568
4
3
null
null
null
null
UTF-8
C++
false
false
706
h
WindowsAudioOutput.h
#include <stdio.h> #include <wchar.h> #include <tchar.h> #include <vector> #include "windows.h" #include "Mmdeviceapi.h" #include "PolicyConfig.h" #include "Propidl.h" #include "Functiondiscoverykeys_devpkey.h" #include "WindowsAudioPlaybackDevice.h" typedef void (*ProcessAudioPlaybackDeviceCallback)(LPWSTR, LPWSTR, BOOL); class WindowsAudioOutput { public: WindowsAudioOutput(void); ~WindowsAudioOutput(void); bool SetDefaultAudioPlaybackDeviceById(std::wstring devID); bool SetDefaultAudioPlaybackDeviceByIndex(UINT device_index); void EnumerateAudioPlaybackDevices(ProcessAudioPlaybackDeviceCallback enumerate_callback); std::vector<WindowsAudioPlaybackDevice> GetAudioPlaybackDevices(); };
7bbca030a902fea4e297d16eea99b47fa0e152d7
4c0e2864361dcd5f73e4ad890e8170f44a5ffa74
/curlingsim/main.cpp
e654e3fbf8f8189132f0b22bcc8553a3939662e5
[]
no_license
gregstarr/poolgame
cb7df72de7106d24c9366e55cafcaba8f4dfcd87
813d11a3e8887b1dd0b77619a7c6a649960937cc
refs/heads/master
2021-01-18T13:47:32.046576
2015-08-04T20:12:18
2015-08-04T20:12:18
39,852,279
0
1
null
2015-08-04T18:12:25
2015-07-28T18:56:30
C++
UTF-8
C++
false
false
5,032
cpp
main.cpp
#include <SFML/Graphics.hpp> #include <string> #include <cmath> #include <iostream> #include <random> #define PI 3.1415 using namespace std; default_random_engine generator; void randomize(vector<float> & param,int length,float high,float low,float spacing) { uniform_real_distribution<float> dist(low,high); while(param.size()<length) { double number = dist(generator); bool valid = true; for(auto a:param) if(abs(a-number)<spacing) valid=false; if(valid) param.push_back(number); } } void setMode(string mode,vector<float> & x,vector<float> & y,vector<float> & v,vector<float> & d,vector<int> & c) { x.clear(); y.clear(); v.clear(); d.clear(); c.clear(); if(mode=="random"||mode=="bounce") { randomize(x,10,485,15,15); randomize(y,10,485,15,15); randomize(v,10,1,.2,0); randomize(d,10,2*PI,0,0); for(int i=0;i<20;i++) c.push_back(0); } if(mode=="test") { uniform_real_distribution<float> dist(0.0,1.0); x.push_back(250.0); y.push_back(250.0); v.push_back(0.01); d.push_back(1.0); x.push_back(dist(generator)*30 + 235); y.push_back(400); v.push_back(1.0); d.push_back(3*PI/2); c.push_back(0); c.push_back(0); } } void moveStones(vector<float> & x,vector<float> & y,vector<float> & v,vector<float> & d,string mode) { for(int i=0;i<x.size();i++) { x[i]+= cos(d[i])*v[i]; y[i]+= sin(d[i])*v[i]; if(mode=="bounce") { if(x[i]>485||x[i]<15) d[i]=PI-d[i]; if(y[i]>485||y[i]<15) d[i]=2*PI-d[i]; } if(mode=="random") { if(x[i]>515||x[i]<-15||y[i]>515||y[i]<-15) { uniform_real_distribution<float> dist(0.0,1.0); x.erase(x.begin()+i); y.erase(y.begin()+i); d.erase(d.begin()+i); v.erase(v.begin()+i); randomize(x,10,485,15,15); randomize(y,10,485,15,15); randomize(v,10,1,.2,0); randomize(d,10,2*PI,0,0); } } } } void addPolar(float t1, float r1, float t2, float r2,float & tf, float & rf) { float x1 = cos(t1)*r1; float y1 = sin(t1)*r1; float x2 = cos(t2)*r2; float y2 = sin(t2)*r2; float xf = x1+x2; float yf = y1+y2; if(xf<0) tf = PI+atan(yf/xf); else tf = atan(yf/xf); rf = sqrt(xf*xf+yf*yf); } void checkCollision(float & x1, float & y1, float & v1, float & d1, int & c1, float & x2, float & y2, float & v2, float & d2, int & c2) { float distance = sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)); int delay = 10; if(distance<30&&c1>delay&&c2>delay) { float angle = atan((y1-y2)/(x1-x2)); float xcomp1 = cos(d1-angle)*v1; float xcomp2 = cos(d2-angle)*v2; addPolar(angle,-1*xcomp2,d2,v2,d2,v2); addPolar(angle,xcomp1,d2,v2,d2,v2); addPolar(angle,-1*xcomp1,d1,v1,d1,v1); addPolar(angle,xcomp2,d1,v1,d1,v1); c1=0; c2=0; } } int main() { sf::RenderWindow window(sf::VideoMode(500,500),"window",sf::Style::Default); window.setFramerateLimit(80); string mode = "bounce"; vector<float> x; vector<float> y; vector<float> v; vector<float> d; vector<int> c; setMode(mode,x,y,v,d,c); while(window.isOpen()) { sf::Event event; while(window.pollEvent(event)) { if(event.type==sf::Event::Closed) window.close(); if(event.type==sf::Event::KeyPressed) { if(event.key.code==sf::Keyboard::Q) window.close(); if(event.key.code==sf::Keyboard::R) { mode = "random"; setMode(mode,x,y,v,d,c); } if(event.key.code==sf::Keyboard::B) { mode = "bounce"; setMode(mode,x,y,v,d,c); } if(event.key.code==sf::Keyboard::T) { mode = "test"; setMode(mode,x,y,v,d,c); } } } window.clear(sf::Color::White); window.setTitle(mode); moveStones(x,y,v,d,mode); for(int i=0;i<x.size();i++) { for(int j=i+1;j<x.size();j++) checkCollision(x[i],y[i],v[i],d[i],c[i],x[j],y[j],v[j],d[j],c[j]); c[i]++; sf::CircleShape circle(15); sf::RectangleShape line(sf::Vector2f(15,1)); line.setPosition(x[i],y[i]); line.setRotation(360*d[i]/(2*PI)); line.setFillColor(sf::Color::Blue); circle.setOrigin(15,15); circle.setFillColor(sf::Color::Black); circle.setPosition(x[i],y[i]); window.draw(circle); window.draw(line); } window.display(); } return 0; }
cddb6e73c77c2c7261e8ec83e5db15b978de9acf
5e5f49e07ba502ccceb5360f6f0dd1c29ca98186
/LittleMath.h
c45ec15ffa88cd0a2b8a4877c04db7e2575567a5
[]
no_license
JeckyllIsHyde/LCP
baf3da8a030d78913f69d02e4881f46d566163d3
7f7110496f90bd32b79c4d5bf7b1003eb15ac57f
refs/heads/master
2021-08-31T13:19:51.982515
2017-12-21T12:43:47
2017-12-21T12:43:47
114,026,895
0
0
null
null
null
null
UTF-8
C++
false
false
4,973
h
LittleMath.h
#ifndef LITTLEMATH_H #define LITTLEMATH_H #include <iostream> #include <array> #include <cassert> #include <cmath> template <typename T, size_t N> struct VectorT { std::array<T,N> _data; VectorT() { for (int i=0; i<N; i++) (*this)(i)=T(0); } VectorT(const VectorT& v) { for (int i=0; i<N; i++) (*this)(i)=v(i); } const T& operator()(int i) const {assert(i<N); return _data[i];} T& operator()(int i) {assert(i<N); return _data[i];} VectorT operator+(const VectorT& v) const { VectorT vo; for (int i=0; i<N; i++) vo(i) = (*this)(i)+v(i); return vo; } VectorT& operator+=(const VectorT& v) { for (int i=0; i<N; i++) (*this)(i)+=v(i); return (*this); } VectorT operator*(const double a) const { VectorT vo; for (int i=0; i<N; i++) vo(i) = a*(*this)(i); return vo; } VectorT operator/(const double a) const { VectorT vo; for (int i=0; i<N; i++) vo(i) = (*this)(i)/a; return vo; } T operator*(const VectorT& v) const { T p = 0; for (int i=0; i<N; i++) p += (*this)(i)*v(i); return p; } T dot(const VectorT& v) const { return (*this)*v; } T norm() const { return std::sqrt((*this)*(*this)); } }; template <typename T,size_t N> std::ostream& operator<<(std::ostream& os, const VectorT<T,N>& v) { for (int i=0; i<N; i++) os << v(i) << " "; return os; } template <typename T, size_t N, size_t M> struct MatrixT { std::array<std::array<T,M>,N> _data; MatrixT() { for (int i=0; i<N; i++) for (int j=0; j<M; j++) (*this)(i,j)=T(0); } MatrixT(const MatrixT& m) { for (int i=0; i<N; i++) for (int j=0; j<M; j++) (*this)(i,j)=m(i,j); } MatrixT(const VectorT<T,N>& v) { for (int i=0; i<N; i++) (*this)(i,0)=v(i); } static MatrixT identityMatrix() { assert(N==M); MatrixT m; for (int i=0;i<N;i++) m(i,i)=1.0; return m; } const T& operator()(int i, int j) const { assert(i<N && j<M); return _data[i][j];} T& operator()(int i, int j) { assert(i<N && j<M); return _data[i][j];} MatrixT operator+(const MatrixT& m) const { MatrixT mo; for (int i=0; i<N; i++) for (int j=0; j<M; j++) mo(i,j) = (*this)(i,j)+m(i,j); return mo; } MatrixT operator*(const double a) const { MatrixT mo; for (int i=0; i<N; i++) for (int j=0; j<M; j++) mo(i,j) = (*this)(i,j)*a; return mo; } MatrixT operator/(const double a) const { MatrixT mo; for (int i=0; i<N; i++) for (int j=0; j<M; j++) mo(i,j) = (*this)(i,j)/a; return mo; } template<template<typename,size_t,size_t> class MatT, size_t P> MatT<T,N,P> operator*(const MatT<T,M,P>& m) const { MatT<T,N,P> mo; for (int i=0; i<N; i++) for (int j=0; j<P; j++) for (int k=0; k<M; k++) mo(i,j) += (*this)(i,k)*m(k,j); return mo; } MatrixT<T,M,N> transpose() const { MatrixT<T,M,N> mo; for (int i=0; i<N; i++) for (int j=0; j<M; j++) mo(j,i) = (*this)(i,j); return mo; } template<template<typename,size_t,size_t> class MatT, size_t P> MatT<T,N,M+P> cath(const MatT<T,N,P>& m) const { MatT<T,N,M+P> mo; for (int i=0; i<N; i++) { for (int j=0; j<M; j++) mo(i,j) += (*this)(i,j); for (int j=0; j<P; j++) mo(i,j+M) += m(i,j); } return mo; } template<template<typename,size_t,size_t> class MatT, size_t P> MatT<T,N+P,M> catv(const MatT<T,P,M>& m) const { MatT<T,N+P,M> mo; for (int j=0; j<M; j++) { for (int i=0; i<N; i++) mo(i,j) += (*this)(i,j); for (int i=0; i<P; i++) mo(i+N,j) += m(i,j); } return mo; } }; template <typename T,size_t N,size_t M> std::ostream& operator<<(std::ostream& os, const MatrixT<T,N,M>& m) { for (int i=0; i<N; i++, os << std::endl) for (int j=0; j<M; j++) os << m(i,j) << " "; return os; } typedef VectorT<double, 2> Vector2d; typedef MatrixT<double, 2, 2> Matrix2d; struct SpatialVector2D: VectorT<double,3> { SpatialVector2D() { (*this)(0)=(*this)(1)=(*this)(2)=0.0; } SpatialVector2D( double th, Vector2d v ) { (*this)(0)=th;(*this)(1)=v(1);(*this)(2)=v(2); } SpatialVector2D( double v0, double v1, double v2 ) { (*this)(0)=v0;(*this)(1)=v1;(*this)(2)=v2; } SpatialVector2D( const SpatialVector2D& V ) { for (int i=0; i<3; i++, _data[i]=V(i)); } }; struct SpatialTransform2D { Matrix2d E; Vector2d r; SpatialTransform2D() : E(Matrix2d::identityMatrix()), r() {} SpatialTransform2D(double th, Vector2d& v) : E(Matrix2d::identityMatrix()), r(v) { setTheta(th); } void setTheta(double th) { E(0,0)=E(1,1)=std::cos(th); E(1,0)=-std::sin(th); E(0,1)=std::sin(th); } double getTheta() const { return std::atan2(E(0,1),E(0,0)); } }; std::ostream& operator<<(std::ostream& os, const SpatialTransform2D& V) { os << "r:\n" << V.r << "\nE:\n" << V.E; return os; } #endif // #ifndef LITTLEMATH_H
87ab7b00e0d84d974262e5c169043ce275476e4e
59bfd57fc640f236c26adf713005c438308ab75a
/include/wls-dense-lapack.hpp
b5bc808a8e19e86885bcc36a81d910aa472d9e17
[]
no_license
YvanMokwinski/WLS
361a0b306cd8846d244f4f1c5a823b67bb4214ba
703f7ac0703eadff3655534c1e032a88bd0334e2
refs/heads/master
2022-12-08T12:25:07.927198
2020-09-01T14:46:44
2020-09-01T14:46:44
229,385,430
0
0
null
null
null
null
UTF-8
C++
false
false
1,105
hpp
wls-dense-lapack.hpp
#pragma once #pragma once #include "wls-types.h" #include "wls-mkl.hpp" namespace WLS { namespace dense { //! //! @brief BLAS MKL wrapper. //! struct lapack_t { using int_t = wls_int_t; using int_p = wls_int_p; using const_int_p = const_wls_int_p; template <typename T> inline static void gesv(const_int_p m_, const_int_p n_, T* x_, const_int_p ld_, wls_int_p ipiv_, T* y_, const_int_p incy_, wls_int_p info_lapack_); template <typename T> inline static void getrs(const char * transpose_, const_int_p m_, const_int_p n_, const T* x_, const_int_p ld_, const_int_p ipiv_, T* y_, const_int_p incy_, wls_int_p info_lapack_); template <typename T> inline static void getrf(const_int_p m_, const_int_p n_, T* x_, const_int_p ld_, wls_int_p ipiv_, wls_int_p info_lapack_); }; }; };
6f0c37a6406f813d5aa595b4e35e435bb2575767
688a4d5070271111232acff9c5899211b18d6064
/framework/utilities/Utilities.h
9fd43d66f0ce08b80acd7f102c8dea7a5bfa4750
[ "BSL-1.0" ]
permissive
weiliew/viscous
1e41dfeb4d3526354d7651898dbc688196dba43c
c1041945c62fd9c6d4d7cb3808646b219f7b0802
refs/heads/master
2016-09-05T17:35:55.375085
2014-12-14T19:08:50
2014-12-14T19:08:50
18,191,530
3
3
null
null
null
null
UTF-8
C++
false
false
1,101
h
Utilities.h
/* * Utilities.h * * Created on: 1 Jan 2013 * Author: Wei Liew [wei@onesixeightsolutions.com] * * Copyright Wei Liew 2012 - 2013. * Distributed under the Boost Software License, Version 1.0. * (See http://www.boost.org/LICENSE_1_0.txt) * */ #ifndef UTILITIES_H_ #define UTILITIES_H_ namespace vf_common { // branch prediction utilities #define LIKELY(x) __builtin_expect(!!(x), 1) #define UNLIKELY(x) __builtin_expect(!!(x), 0) class { public: template<typename T> operator std::shared_ptr<T>() { return std::shared_ptr<T>(); } } boostNullPtr; // For anyone who is interested in knowing the background on this, (and StaticSignal.h) // this is taken from examples in http://stackoverflow.com/questions/7858817/unpacking-a-tuple-to-call-a-matching-function-pointer // and here http://loungecpp.wikidot.com/tips-and-tricks:indices // template<int ...> struct seq {}; template<int N, int ...S> struct gens : gens<N-1, N-1, S...> {}; template<int ...S> struct gens<0, S...>{ typedef seq<S...> type; }; } // namespace vf_common #endif /* UTILITIES_H_ */
c84962166718a961453557be6662289361c56eb2
e305f7f61554cb80bb1665e888401a7a12019cb1
/src/pid2.cpp
fa5f7815a79190a48de0bcbf2193327269f97062
[]
no_license
SebastianHurtado98/new_robot
bd231521dcc8e8fe90669137c2d718e0bd75f605
28ad9ad484a77bd14608b813871741d04d674f44
refs/heads/main
2023-08-13T04:23:49.942098
2021-10-10T15:03:51
2021-10-10T15:03:51
415,617,165
0
0
null
null
null
null
UTF-8
C++
false
false
450
cpp
pid2.cpp
#include "ros/ros.h" #include "geometry_msgs/Twist.h" int main(int argc, char **argv) { ros::init(argc, argv, "talker"); ros::NodeHandle n; ros::Publisher cmd_vel_pub = n.advertise<geometry_msgs::Twist>("cmd_vel", 1); ros::Rate loop_rate(10); int count = 0; while (ros::ok()) { geometry_msgs::Twist vel; vel.linear.x = 0.2; cmd_vel_pub.publish(vel); ros::spinOnce(); loop_rate.sleep(); ++count; } return 0; }
4814f2e189ff02257cb73169bbc565c09b78feaf
54a60046303a99aa0581b7ff2d2f09e17a519da8
/Cli-Serv TD Slobodskoy/TD Slobodskoy Client/Classes/Enemy.h
56e30108afab2bf7fe47ea4e94da8273e00fcedf
[]
no_license
EgorEast/CFU_Project
f7984bdd67fad97c687d57b392c3019221353542
6ad093c8bd014b5f9d6438ebfdec2d995a6c490c
refs/heads/master
2022-12-03T01:49:43.172526
2020-08-20T11:16:31
2020-08-20T11:16:31
265,323,351
0
0
null
null
null
null
UTF-8
C++
false
false
865
h
Enemy.h
#pragma once #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> #include "Entity.h" #include <nlohmann/json.hpp> ////////////////////////////////////////////////////КЛАСС ВГРАГОВ//////////////////////// class Enemy :public Entity { public: //Конструктор класса врага Enemy(sf::Image& image, sf::String Name, sf::Vector2f startPos, int Width, int Height, int& playerHealth); //Функция "оживления" объекта класса void update(float time) override; //Правила, по которым будет двигаться враг void move(float time); private: //Указатель на жизни игрока int* _ptrPlayerHealth; //Первая точка, куда будет двигаться враг int _curPointInd = 1; //Угол поворота объекта float _angle; };
5d581def8bf0ab26629eb725ee92820d71244c35
0d0bb86839bcf6662d91aa180719ff04aee6c0dc
/Compiler_hw3/src/include/visitor/visitor.hpp
842d6c0ba4d654d32d58bd4f64ee949e99ba0838
[]
no_license
samuelyutt/Intro-Compiler-course
7f8ba03948c4e631ab33091f11f606ec0410a9ba
f4ac3515fff97d2438f6478a776687bb0962bf0c
refs/heads/master
2022-08-03T17:45:25.498189
2020-05-26T16:27:55
2020-05-26T16:27:55
267,092,211
1
0
null
null
null
null
UTF-8
C++
false
false
1,831
hpp
visitor.hpp
#pragma once #include "AST/ast.hpp" #include "AST/program.hpp" #include "AST/declaration.hpp" #include "AST/constantvalue.hpp" #include "AST/variable.hpp" #include "AST/programbody.hpp" #include "AST/expression.hpp" #include "AST/variablereference.hpp" #include "AST/binaryoperator.hpp" #include "AST/unaryoperator.hpp" #include "AST/functioncallexpr.hpp" #include "AST/statement.hpp" #include "AST/compoundstmt.hpp" #include "AST/arrtype.hpp" #include "AST/arrdeclaration.hpp" #include "AST/assignment.hpp" #include "AST/print.hpp" #include "AST/read.hpp" #include "AST/return.hpp" #include "AST/while.hpp" #include "AST/if.hpp" #include "AST/for.hpp" #include "AST/function.hpp" #include "AST/functioninvokation.hpp" class ASTNodeVisitorBase { public: virtual void visit(ProgramNode *e) = 0; virtual void visit(DeclarationNode *e) = 0; virtual void visit(ConstantValueNode *e) = 0; virtual void visit(VariableNode *e) = 0; virtual void visit(ProgramBodyNode *e) = 0; virtual void visit(ExpressionNode *e) = 0; virtual void visit(VariableReferenceNode *e) = 0; virtual void visit(BinaryOperatorNode *e) = 0; virtual void visit(UnaryOperatorNode *e) = 0; virtual void visit(FunctionCallExprNode *e) = 0; virtual void visit(StatementNode *e) = 0; virtual void visit(CompoundStmtNode *e) = 0; virtual void visit(ArrTypeNode *e) = 0; virtual void visit(ArrDeclarationNode *e) = 0; virtual void visit(AssignmentNode *e) = 0; virtual void visit(PrintNode *e) = 0; virtual void visit(ReadNode *e) = 0; virtual void visit(ReturnNode *e) = 0; virtual void visit(WhileNode *e) = 0; virtual void visit(IfNode *e) = 0; virtual void visit(ForNode *e) = 0; virtual void visit(FunctionNode *e) = 0; virtual void visit(FunctionInvokationNode *e) = 0; };
979ecb8f0809ab97161f5d5e48654913c9064599
978b0c7d4bb8ea32c78f771810e39ad765136b99
/EIP/eips_usersys.cpp
fee75e95e002c9e47fc0112c75392f7e64c946fa
[]
no_license
mmk-tsm/NBB_WIDTH_Ep_0
0dde91dc99dbec277f3a9a0d8eb24abc90ac1d0f
e7c0eda5ac0dc52175e1bb07c4b75358a3674bdc
refs/heads/master
2022-11-11T12:08:39.273994
2020-07-07T13:16:00
2020-07-07T13:16:00
277,529,351
0
0
null
null
null
null
UTF-8
C++
false
false
15,592
cpp
eips_usersys.cpp
/* * Copyright (c) 2002-2009 by Real Time Automation, Inc. * * This software is copyrighted by and is the sole property of * Real Time Automation, Inc. (RTA). All rights, title, ownership, * or other interests in the software remain the property of RTA. * This software may only be used in accordance with the corresponding * license agreement. Any unauthorized use, duplication, transmission, * distribution, or disclosure of this software is expressly forbidden. * * This Copyright notice MAY NOT be removed or modified without prior * written consent of RTA. * * RTA reserves the right to modify this software without notice. * * Real Time Automation * 150 S. Sunny Slope Road USA 262.439.4999 * Suite 130 http://www.rtaautomation.com * Brookfield, WI 53005 software@rtaautomation.com * ************************************************************************* * * Version Date: 12/16/2009 * Version: 2.14 * Conformed To: EtherNet/IP Protocol Conformance Test A-7 (17-AUG-2009) * Module Name: eips_usersys.c * Author: Jamin D. Wendorf (jwendorf@rtaautomation.com) * Language: Ansi C * Compile Options: N/A * Compile defines: N/A * Libraries: N/A * Link Options: N/A * * Description. * ======================================================================= * This file contains system functions that need to be written by the user. * This includes timer, NVRAM, and task calls. * */ // M.McKiernan 19.01.2010 // Replace #if PLATFORM==CB34-EX by #if 0, ie. remove whole pile of stuff relating to LED task. // Leave functions by moving outside #if nesting; // void eips_usersys_init (uint8 init_type) // void eips_usersys_process (void) // void eips_usersys_fatalError (char *function_name, int16 error_num) // uint16 eips_usersys_getIncarnationID (void) // void UpdateLEDTask( void* args ) - though now only a dummy function. // // M.McKiernan 11.02.2010 // Edited eips_usersys_fatalError () function - dont just sit there. // PutAlarmTable( ETHERNETIP_ALARM, 0); // Flag an alarm // Set global g_bEIPSoftwareFatalErrorOccurred = TRUE; - this will stop eips_rtasys_process(local_get_ticks_passed()); - see main.cpp // gEIPTaskErrorFlag is checked in other tasks (UDP tasks in eips_usersock.cpp) // Sets an OS_FLAGS variable gEIPTaskErrorFlag see OSFlagSet() used to shutdown the UDP tasks. // // /* ---------------------------- */ /* INCLUDE FILES */ /* ---------------------------- */ #include "eips_system.h" #include "general.h" #include <Bsp.h> #include "Alarms.h" extern bool g_bEIPSoftwareFatalErrorOccurred; extern OS_FLAGS gEIPTaskErrorFlag; //used for shutting down UDP tasks in EthernetIP. //#if PLATFORM==CB34-EX #if 0 /* ---------------------------- */ /* EXTERN FUNCTIONS */ /* ---------------------------- */ /* ---------------------------- */ /* LOCAL STRUCTURE DEFINITIONS */ /* ---------------------------- */ /* ---------------------------- */ /* STATIC VARIABLES */ /* ---------------------------- */ uint8 led1_enable = 0; uint8 led1_on_color = 0; uint8 led1_off_color = 0; uint8 led2_enable = 0; uint8 led2_on_color, led2_off_color; /* ---------------------------- */ /* EXTERN VARIABLES */ /* ---------------------------- */ /* ---------------------------- */ /* LOCAL FUNCTIONS */ /* ---------------------------- */ void ledtask_update_led1 (uint8 enable, uint8 on_color, uint8 off_color); void ledtask_update_led2 (uint8 enable, uint8 on_color, uint8 off_color); void local_led_update (uint8 led, uint8 color); /* ---------------------------- */ /* MISCELLANEOUS */ /* ---------------------------- */ #define RTA_LED_NS 0 #define RTA_LED_IO 1 #define RTA_LED_ORG 0 #define RTA_LED_RED 1 #define RTA_LED_GRN 2 #define RTA_LED_OFF 3 #define LED_1 0 #define LED_2 1 /* ==================================================================== Function: eips_usersys_ledTest Parameters: N/A Returns: N/A Turn first indicator Green, all other indicators off Leave first indicator on Green for approximately 0.25 second Turn first indicator on Red for approximately 0.25 second Turn first indicator on Green Turn second indicator (if present) on Green for approx. 0.25 second Turn second indicator (if present) on Red for approx. 0.25 second Turn second indicator (if present) Off If other indicators are present, test each indicator in sequence as prescribed by the second indicator above. If a Module Status indicator is present, it shall be the first indicator in the sequence, followed by any Network Status indicators present. After completion of this power up test, the indicator(s) shall turn to a normal operational state (all OFF). ======================================================================= */ #if EIPS_NTWK_LED_USED || EIPS_IO_LED_USED void eips_usersys_ledTest (void) { static uint8 first_time = 1; eips_user_dbprint0("eips_usersys_ledTest\r\n"); /* don't run the first time since LED test is handled in main */ if(first_time) { first_time = 0; return; } /* NS Green for 250MS */ ledtask_update_led1(0, RTA_LED_GRN, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* NS Red for 250MS */ ledtask_update_led1(0, RTA_LED_RED, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* NS Green */ ledtask_update_led1(0, RTA_LED_GRN, RTA_LED_OFF); /* IO Green for 250MS */ ledtask_update_led2(0, RTA_LED_GRN, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* IO Red for 250MS */ ledtask_update_led2(0, RTA_LED_RED, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* IO OFF */ ledtask_update_led2(0, RTA_LED_OFF, RTA_LED_OFF); } #endif /* ==================================================================== Function: eips_usersys_nsLedUpdate Parameters: led state (see eips_cnxn.h) Returns: N/A This function controls the Network LED. ======================================================================= */ #ifdef EIPS_NTWK_LED_USED void eips_usersys_nsLedUpdate (uint8 led_state) { // switch on the state switch(led_state) { // switch on the valid LED states case EIPS_LEDSTATE_OFF: // eips_user_dbprint0("NS LED: Off\r\n"); ledtask_update_led1(1, RTA_LED_OFF,RTA_LED_OFF); break; case EIPS_LEDSTATE_FLASH_GREEN: // eips_user_dbprint0("NS LED: Flash Green\r\n"); ledtask_update_led1(1, RTA_LED_GRN,RTA_LED_OFF); break; case EIPS_LEDSTATE_FLASH_RED: // eips_user_dbprint0("NS LED: Flash Red\r\n"); ledtask_update_led1(1, RTA_LED_RED,RTA_LED_OFF); break; case EIPS_LEDSTATE_STEADY_GREEN: // eips_user_dbprint0("NS LED: Steady Green\r\n"); ledtask_update_led1(1, RTA_LED_GRN,RTA_LED_GRN); break; case EIPS_LEDSTATE_STEADY_RED: // eips_user_dbprint0("NS LED: Steady Red\r\n"); ledtask_update_led1(1, RTA_LED_RED,RTA_LED_RED); break; case EIPS_LEDSTATE_ALT_REDGREEN: ledtask_update_led1(1, RTA_LED_RED,RTA_LED_GRN); break; // error default: eips_user_dbprint0("NTWK LED: ERR\r\n"); break; }; } #endif /* ==================================================================== Function: eips_usersys_ioLedUpdate Parameters: led state (see eips_cnxn.h) Returns: N/A This function controls the I/O LED. ======================================================================= */ #ifdef EIPS_IO_LED_USED void eips_usersys_ioLedUpdate (uint8 led_state) { // switch on the state switch(led_state) { // switch on the valid LED states case EIPS_LEDSTATE_OFF: // eips_user_dbprint0("IO LED: Off\r\n"); ledtask_update_led2(1, RTA_LED_OFF,RTA_LED_OFF); break; case EIPS_LEDSTATE_FLASH_GREEN: // eips_user_dbprint0("IO LED: Flash Green\r\n"); ledtask_update_led2(1, RTA_LED_GRN,RTA_LED_OFF); break; case EIPS_LEDSTATE_FLASH_RED: // eips_user_dbprint0("IO LED: Flash Red\r\n"); ledtask_update_led2(1, RTA_LED_RED,RTA_LED_OFF); break; case EIPS_LEDSTATE_STEADY_GREEN: // eips_user_dbprint0("IO LED: Steady Green\r\n"); ledtask_update_led2(1, RTA_LED_GRN,RTA_LED_GRN); break; case EIPS_LEDSTATE_STEADY_RED: // eips_user_dbprint0("IO LED: Steady Red\r\n"); ledtask_update_led2(1, RTA_LED_RED,RTA_LED_RED); break; case EIPS_LEDSTATE_ALT_REDGREEN: ledtask_update_led2(1, RTA_LED_RED,RTA_LED_GRN); break; // error default: eips_user_dbprint0("NTWK LED: ERR\r\n"); break; }; } #endif /* */ /* ******************************************************************** */ /* LOCAL FUNCTIONS */ /* ******************************************************************** */ /* ==================================================================== Function: N/A Parameters: N/A Returns: N/A This function ======================================================================= */ static uint8 last_led = 0xFF; void local_led_update (uint8 led, uint8 color) { uint8 led_color = 0; switch(color) { case RTA_LED_OFF: case RTA_LED_RED: case RTA_LED_GRN: case RTA_LED_ORG: led_color = color; break; default: return; }; switch(led) { case LED_1: last_led = ((last_led & 0xC0) | (led_color << 4)); break; case LED_2: last_led = ((last_led & 0x30) | (led_color << 6)); break; }; putleds(last_led); } void ledtask_update_led1 (uint8 enable, uint8 on_color, uint8 off_color) { led1_enable = enable; if(enable) { led1_on_color = on_color; led1_off_color = off_color; } else { local_led_update(LED_1, on_color); } } void ledtask_update_led2 (uint8 enable, uint8 on_color, uint8 off_color) { led2_enable = enable; if(enable) { led2_on_color = on_color; led2_off_color = off_color; } else { local_led_update(LED_2, on_color); } } /* ==================================================================== Function: UpdateLEDTask Parameters: ignored Returns: N/A This function starts the LED task and performs the LED test. ======================================================================= */ void UpdateLEDTask( void* args ) { /* NS Green for 250MS */ ledtask_update_led1(0, RTA_LED_GRN, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* NS Red for 250MS */ ledtask_update_led1(0, RTA_LED_RED, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* NS Green */ ledtask_update_led1(0, RTA_LED_GRN, RTA_LED_OFF); /* IO Green for 250MS */ ledtask_update_led2(0, RTA_LED_GRN, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* IO Red for 250MS */ ledtask_update_led2(0, RTA_LED_RED, RTA_LED_OFF); OSTimeDly(TICKS_PER_SECOND/4); /* IO and NS Flash Green */ ledtask_update_led1(1, RTA_LED_GRN, RTA_LED_OFF); ledtask_update_led2(1, RTA_LED_GRN, RTA_LED_OFF); for( ;; ) { /* *************************** */ /* LED 1 PROCESSING - ON COLOR */ /* *************************** */ if(led1_enable) local_led_update(LED_1, led1_on_color); /* *************************** */ /* LED 2 PROCESSING - ON COLOR */ /* *************************** */ if(led2_enable) local_led_update(LED_2, led2_on_color); /* **************************** */ /* DELAY 500MS (1Hz Flash rate) */ /* **************************** */ OSTimeDly( TICKS_PER_SECOND / 2 ); /* **************************** */ /* LED 1 PROCESSING - OFF COLOR */ /* **************************** */ if(led1_enable) local_led_update(LED_1, led1_off_color); /* **************************** */ /* LED 2 PROCESSING - OFF COLOR */ /* **************************** */ if(led2_enable) local_led_update(LED_2, led2_off_color); /* **************************** */ /* DELAY 500MS (1Hz Flash rate) */ /* **************************** */ OSTimeDly( TICKS_PER_SECOND / 2 ); } // end of for } #endif /* */ /* ******************************************************************** */ /* GLOBAL FUNCTIONS CALLED BY RTA */ /* ******************************************************************** */ /* ==================================================================== Function: eips_usersys_init Parameters: init type Returns: N/A This function initialize all user system variables. ======================================================================= */ void eips_usersys_init (uint8 init_type) { /* different initialization based on passed parameters (if needed) */ switch (init_type) { /* Out of Box Initialization */ case EIPSINIT_OUTOFBOX: break; /* Normal Initialization */ case EIPSINIT_NORMAL: default: break; }; } /* ==================================================================== Function: eips_usersys_process Parameters: N/A Returns: N/A This function handles any user system processing. ======================================================================= */ void eips_usersys_process (void) { /* do nothing */ } /* ==================================================================== Function: eips_usersys_fatalError Parameters: N/A Returns: N/A This function handles fatal errors. ======================================================================= */ void eips_usersys_fatalError (char *function_name, int16 error_num) { // eips_user_dbprint2("FATAL ERROR: \"%s\" Error: %d\n",function_name, error_num); PutAlarmTable( ETHERNETIP_ALARM, 0); // Flag an alarm /* we shouldn't get here, but make sure we don't return */ /* TSM -cant just sit here for(;;) { // ledtask_update_led1(0, RTA_LED_RED, RTA_LED_OFF); // ledtask_update_led2(0, RTA_LED_RED, RTA_LED_OFF); OSTimeDly(1); } */ // gEIPTaskErrorFlag is checked in other tasks (UDP tasks in eips_usersock.cpp) OSFlagSet( &gEIPTaskErrorFlag, 0x00000001 ); //set b0 to shutdown the UDP tasks. g_bEIPSoftwareFatalErrorOccurred = TRUE; // this will stop eips_rtasys_process(local_get_ticks_passed()); - see main.cpp /* //todo - for now, wait 5 seconds and reset the NBB. while(i<5) { OSTimeDly(TICKS_PER_SECOND); i++; } ForceReboot(); // force a reset. */ } /* ==================================================================== Function: eips_usersys_getIncarnationID Parameters: N/A Returns: 16-bit number This function generates the Incarnation ID. ======================================================================= */ uint16 eips_usersys_getIncarnationID (void) { return((uint16)rand()); } //Dummy version - to allow compile. void UpdateLEDTask( void* args ) { /* do nothing */ OSTimeDly(1); } /* *********** */ /* END OF FILE */ /* *********** */
b6b677f102b3a9eeaabf404dcceb09b20fb2e54b
7b2456c98c94ff1c9a0334b24797a85ecc5cff21
/cses/sorting-and-searching/playlist.cpp
c770728d092a27cfc2bc22683c12b03ff0119930
[]
no_license
bkorecic/competitive-programming-solutions
fe694b485f10d5b90903552efd3e740e90891c94
f7edecc7bfb318992ea4e49cae11942e1e1e6879
refs/heads/master
2021-12-15T04:43:23.722769
2021-12-12T05:59:50
2021-12-12T05:59:50
211,429,503
1
0
null
null
null
null
UTF-8
C++
false
false
508
cpp
playlist.cpp
#include <bits/stdc++.h> #define f first #define s second #define mp make_pair #define pb push_back using namespace std; typedef long long ll; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; map <int, int> pos; // last seen pos int ans = 1; int l = 0; for(int r=0; r<n; r++){ int cur; cin >> cur; int last = -1; if(pos.count(cur)) last = pos[cur]; l = max(l, last+1); pos[cur] = r; ans = max(ans, r-l+1); } cout << ans << '\n'; return 0; }
fcb4e3981cd1b4304920b0de77b75acf0ae1af0f
cd52e1882e29bac90d77593699a1111380256fc5
/editor/HomeScreen.h
c481f8f1b9fafed52dfc3fc1d4aeca99ab2f50cc
[]
no_license
chortas/TDP1-Portal
5af5edf40d878939391877e72a944b116c60e40f
70872b61ef882a9078e8b9c9cd6524f04d343371
refs/heads/master
2020-06-10T20:20:12.815077
2019-06-25T07:46:48
2019-06-25T07:46:48
193,735,074
2
1
null
2019-06-25T15:29:34
2019-06-25T15:29:33
null
UTF-8
C++
false
false
620
h
HomeScreen.h
// // Created by camix on 20/06/19. // #ifndef PORTAL_HOMESCREEN_H #define PORTAL_HOMESCREEN_H #define CLOSED_EXC "The user want to close the process\n" #include "../common/Window.h" #include "../common/InputText.h" class HomeScreen { InputText input; Window &window; std::string& yamlPath; public: HomeScreen(Window &window); ~HomeScreen(); std::string &start(bool withAnswer = false); }; class CloseException: public std::exception { public: CloseException() = default; virtual const char* what() const throw() { return CLOSED_EXC; } }; #endif //PORTAL_HOMESCREEN_H
cb8fff199bb8593f2badaf6c9037184da67ac86c
c085d357389bccf709b742785b7333ddc7a25190
/CS1010301HW06/TS0605/Diary.ixx
2be52c05b8483fe273eac21befb4bff3a0638b1c
[]
no_license
jimmy1010ww/NTUST_109-2_ODD
d990a01a8e5618a2c33816c3e207b05b728b5d3b
7358a95d9d6b4be211f703de71372dd7d86a7cd7
refs/heads/main
2023-04-05T21:44:33.044702
2021-04-20T17:19:07
2021-04-20T17:19:07
350,739,673
1
0
null
null
null
null
UTF-8
C++
false
false
43
ixx
Diary.ixx
export module Diary; export void MyFunc();
6dd7da5fc57260402912dc0d00ce4a661d278da7
a4e25ab73d3f04d5368ccb754092c6ab597ba056
/src/Framework/EntityManager.cpp
1653d3f5957d9a8af8a8397a40d5f93ec62196f2
[]
no_license
eoma/gm-engine
1fccf0a09aabe9edd65116b75e06e843067d4e26
49c306094c8e255fd17f88ddb292e4b4d6d66ec4
refs/heads/master
2020-05-19T13:40:09.901589
2015-03-13T10:46:09
2015-03-13T10:46:09
20,478,330
2
1
null
2014-11-03T17:29:41
2014-06-04T09:59:21
C++
UTF-8
C++
false
false
3,562
cpp
EntityManager.cpp
#include "GM/Framework/EntityManager.h" #include "GM/Framework/Templates/EntityTemplateManager.h" #include "GM/Framework/Entity.h" #include "GM/Framework/Utilities/ComponentSerializer.h" #include <algorithm> #include <iostream> using namespace GM::Framework; EntityManager::EntityManager() : entities() , pending_deletion() { component_serializer = ComponentSerializerPtr(new ComponentSerializer()); template_manager = EntityTemplateManagerPtr(new EntityTemplateManager(component_serializer)); } EntityManager::~EntityManager() { //std::cout << "EntityManager destroyed" << std::endl; } void EntityManager::update(float elapsed_time) { for(auto entity : pending_deletion) { std::cout << "Removing " + entity->get_name() << std::endl; remove_entity(entity, true); } pending_deletion.clear(); for (auto entity : entities) { entity->update_components(elapsed_time); entity->update_properties(); } } void EntityManager::initialize() { for (auto entity : entities) { entity->initialize_components(); } } EntityPtr EntityManager::get_entity(const std::string &name) const { for(auto entity : entities) { if(entity->get_name() == name) return entity; } return nullptr; } const std::vector<EntityPtr> &EntityManager::get_entities() const { return entities; } EntityPtr EntityManager::create_entity(const std::string &name) { auto entity = EntityPtr(new Entity(name)); entities.push_back(entity); return entity; } EntityPtr EntityManager::create_entity(const std::string &name, const std::string &template_name) { auto entity = EntityPtr(new Entity(name)); entities.push_back(entity); apply(template_name, entity); return entity; } EntityPtr EntityManager::remove_entity(const std::string &name, bool immediate) { for(unsigned int i = 0; i < entities.size(); i++) { auto entity = entities[i]; if(entity->get_name() == name) { if(immediate) { //entities.erase(entities.begin() + i); entities[i] = entities.back(); entities.pop_back(); } else { pending_deletion.push_back(entity); } return entity; } } return nullptr; } EntityPtr EntityManager::add_entity(EntityPtr entity) { entities.push_back(entity); return entity; } EntityPtr EntityManager::remove_entity(const EntityPtr &entity, bool immediate) { auto entity_it = std::find(entities.begin(), entities.end(), entity); if(entity_it != entities.end()) { if(immediate) entities.erase(entity_it); else pending_deletion.push_back(entity); } return entity; } EntityPtr EntityManager::remove_entity(const unsigned long id, bool immediate) { // Can use binary search (using std::lower_bound) if we can guarantee that // the entity manager is the only one to create entities. auto entity_it = std::find_if(entities.begin(), entities.end(), [id](const EntityPtr &entity) { return entity->get_id() == id; }); EntityPtr entity = nullptr; if(entity_it != entities.end()) { entity = *entity_it; if(immediate) entities.erase(entity_it); else pending_deletion.push_back(entity); } return entity; } clan::Signal<void(const EntityPtr &/*owner*/, const std::string &/*type*/, const std::string &/*name*/)> &EntityManager::register_component_serializer_signal() { return component_serializer->sig_create_component; } void EntityManager::add_templates(const std::string &template_filename) { template_manager->add_templates(template_filename); } void EntityManager::apply(const std::string &template_name, const EntityPtr &entity) { template_manager->apply(template_name, entity); }
f7a7be67e1a230e860e97cc12a4112abf11d5e0d
02039931ac3ec97d98a28afdb2077b4e30fbd944
/src/Compatibility/F4EE.h
b66d83d174f11adfb11b19f8e438ff16fa6eab2a
[ "MIT" ]
permissive
DiReis/Buffout4
c902716083b7eb2bf4f57c41d401e92ec8053d94
225e5307f41700f420b048523a43bef14bfd67d6
refs/heads/master
2023-01-23T21:36:30.499198
2020-12-01T06:56:34
2020-12-01T06:56:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,011
h
F4EE.h
#pragma once namespace Compatibility { class F4EE { public: static void Install() { const auto validate = []() { // 1.6.20 constexpr auto precalc = "D5467FEA7D6A722E0ED87B5FB857B5E0C9FDBE57B060ADB711013ED27565688D3D4514F99E4DF02109273ED69330E5272AD76822EB15717FEBC11AF409BA60F1"sv; const auto sha = Botan::HashFunction::create("SHA-512"s); boost::iostreams::mapped_file_source file("data/f4se/plugins/f4ee.dll"); if (sha && file.is_open()) { const auto hash = sha->process( reinterpret_cast<const std::uint8_t*>(file.data()), file.size()); std::string hashStr; hashStr.reserve(hash.size() * 2); for (const auto byte : hash) { hashStr += fmt::format(FMT_STRING("{:02X}"), byte); } if (precalc == hashStr) { return true; } else { logger::error( FMT_STRING( "{}: mismatch on sha512\n" "\texpected \"{}\"\n" "\tfound \"{}\""), typeid(F4EE).name(), precalc, hashStr); } } return false; }; const auto handle = static_cast<const std::byte*>(WinAPI::GetModuleHandle(L"f4ee.dll")); if (handle != nullptr && validate()) { const auto base = reinterpret_cast<std::uintptr_t>(handle); SetMorphValues(base); logger::info("installed {}"sv, typeid(F4EE).name()); } else { logger::warn("failed to install {}"sv, typeid(F4EE).name()); } } private: static void CopyMorphs(const float a_src[], std::size_t a_size, RE::BSTArray<float>& a_dst) { constexpr std::size_t max = 5; a_dst.resize(max); std::fill(a_dst.begin(), a_dst.end(), 0.0F); for (std::size_t i = 0; i < std::min(a_size, max); ++i) { a_dst[static_cast<std::uint32_t>(i)] = a_src[i]; } } static RE::BSTArray<float>* CreateMorphs() { return new RE::BSTArray<float>(5, 0.0F); } static void SimpleInlinePatch(std::uintptr_t a_dst, std::size_t a_size, std::uintptr_t a_func); static void SetMorphValues(std::uintptr_t a_base); }; }
81f4b65965a60186b48331c67c1fdbf82d7b2b3b
faf52f759ea38fdfeb9e4a06327bdb677fe53931
/repos_2_bzzzuka_Minimizator/src/mnbrak.cpp
9a491bc2bf139a057fd1f0d13204d21724a767f1
[]
no_license
Redrum34/mix
010866ba0f5c105b49da17ec897f054d59a6e8ca
ed538d7bcfe8c955dd34d1643760e11e869fee13
refs/heads/master
2020-09-01T21:31:13.084997
2019-11-01T20:43:59
2019-11-01T20:43:59
null
0
0
null
null
null
null
UTF-8
C++
false
false
181
cpp
mnbrak.cpp
#include <cmath> #include "Powell.h" using namespace std; namespace { inline void shft3(DP &a, DP &b, DP &c, const DP d) { a=b; b=c; c=d; } }
1d3da2e859f5ccdc74b3ca6cc6236ef3280ccef5
7e1a07b790b2ce0d1647d57ab72c5bf7eda31503
/ServerInputControler/ReceiveSocket.cpp
f7f83a9a7452f97a394d4bd75522076720ac1718
[]
no_license
stoneami/ServerInputControler-UDP
fb00115a6d67badeb22a9f977af0450c2c0108ce
8f9a58c32ab3debe83ca7bcb4f195ec6665ae8bf
refs/heads/master
2016-09-06T21:51:22.182460
2013-11-06T13:13:02
2013-11-06T13:13:02
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,451
cpp
ReceiveSocket.cpp
#include "StdAfx.h" #include "ReceiveSocket.h" CReceiveSocket::CReceiveSocket(void) { } CReceiveSocket::~CReceiveSocket(void) { } void CReceiveSocket::OnSend(int nErrorCode){} void CReceiveSocket::OnOutOfBandData(int nErrorCode){} void CReceiveSocket::OnAccept(int nErrorCode){} void CReceiveSocket::OnConnect(int nErrorCode){} void CReceiveSocket::OnClose(int nErrorCode){} //Handle message from client. //There there types of message: //1.mouse action, it's like "r", "u" etc. //2.set move step, it's like "#10","#20". //3.text, it's like "##abcdefg","##hello". //4.mouse moving, it's like "###r20u52", "###l2d100" void CReceiveSocket::OnReceive(int nErrorCode) { m_nLength = Receive(m_szBuffer,sizeof(m_szBuffer),0); Log::I(L"ReceiveSocket", Utils::getWChar(m_szBuffer), m_nLength); if(m_nLength < 1) return; if(m_nLength>3 && m_szBuffer[0]=='#' && m_szBuffer[1]=='#' && m_szBuffer[2]=='#')//mouse moving, it's like "###r20u52", "###l2d100" { mMouseControler.HandleMouseEvent(m_szBuffer, m_nLength); } else if(m_nLength>2 && m_szBuffer[0]=='#' && m_szBuffer[1]=='#')// text message like "##aa", "##bb" { mKeyboardControler.SendMultiKey(m_szBuffer+2, m_nLength - 2); } else if(m_nLength>1 && m_szBuffer[0]=='#')//set move step like "#10","#20" { MouseControler::SetStep(atoi(m_szBuffer + 1)); } else//mouse action: move or click, like "rr","rrddllrr" { mMouseControler.HandleMouseEvent(m_szBuffer, m_nLength); } }
e2c7523e3c51f1d6230a01c0637db9e5803da85b
5d467d69b9c57b9978c48a1bccdf807de5a205df
/Sources/Couleur.h
4e242c87e93b889f1d9157b1d6145c8b8244d167
[]
no_license
kevin-plumyoen/Projet_UdeS_DX11
dc0152c4060efd8a22e993c3935da620b35994b7
257c87019e60f86e88f7c99d01fa1f227b784b4c
refs/heads/master
2021-01-02T21:57:08.700262
2020-02-11T17:37:48
2020-02-11T17:37:48
239,815,301
0
0
null
null
null
null
UTF-8
C++
false
false
1,366
h
Couleur.h
#ifndef COULEUR_H #define COULEUR_H #pragma warning(push, 0) #include <iostream> #include <DirectXMath.h> #include <assimp/types.h> #pragma warning(pop) struct Couleur { using vector_type = DirectX::XMVECTOR; using value_type = float; using value_ref = value_type & ; vector_type values; Couleur() : values{ DirectX::XMVectorSet(0.f, 0.f, 0.f, 0.f) } {} Couleur(float r, float g, float b, float a) : values{ DirectX::XMVectorSet(r, g, b, a) } {} Couleur(const DirectX::XMVECTOR& vector) : values{ vector } {} Couleur(const Couleur&) = default; Couleur(const aiColor3D& c) : values{ DirectX::XMVectorSet(c.r, c.g, c.b, 1.0f) } {} operator DirectX::XMVECTOR() const { return values; }; const value_type& r() const { return DirectX::XMVectorGetX(values); } const value_type& g() const { return DirectX::XMVectorGetY(values); } const value_type& b() const { return DirectX::XMVectorGetZ(values); } const value_type& a() const { return DirectX::XMVectorGetW(values); } void r(const value_type& r) { values = DirectX::XMVectorSetX(values, r); } void g(const value_type& g) { values = DirectX::XMVectorSetY(values, g); } void b(const value_type& b) { values = DirectX::XMVectorSetZ(values, b); } void a(const value_type& a) { values = DirectX::XMVectorSetW(values, a); } }; #endif
864235ab93882354f8aca303b8ce2166ae07afab
687b44eabc9b401aeb219910eaf3a82b565bac4f
/MavLinkCom/src/serial_com/TcpClientPort.cpp
d5a5bc53c42267d552400d7f93a4a794f3e3e502
[ "MIT" ]
permissive
mitchellspryn/UrdfSim
ec284e572f1e0a4377f1ab7a49fd8a03691e56e1
a8a46c2b317811ad83bcb46fd12ea75a2862a68e
refs/heads/master
2022-07-19T06:31:39.349835
2021-03-17T00:45:00
2021-03-17T00:45:00
166,617,310
100
27
NOASSERTION
2022-06-22T20:39:10
2019-01-20T03:01:06
C++
UTF-8
C++
false
false
6,999
cpp
TcpClientPort.cpp
// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. #include "Utils.hpp" #include "TcpClientPort.hpp" #include <stdio.h> #include <string.h> #include "SocketInit.hpp" #include "wifi.h" using namespace mavlink_utils; #ifdef _WIN32 // windows #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include <windows.h> #include <winsock2.h> #include <ws2tcpip.h> // Need to link with Ws2_32.lib #pragma comment (lib, "Ws2_32.lib") typedef int socklen_t; static bool socket_initialized_ = false; #else // posix #include <sys/types.h> #include <sys/socket.h> #include <arpa/inet.h> #include <netinet/in.h> #include <cerrno> #include <netdb.h> #include <errno.h> #include <unistd.h> #include <arpa/inet.h> typedef int SOCKET; const int INVALID_SOCKET = -1; const int ERROR_ACCESS_DENIED = EACCES; inline int WSAGetLastError() { return errno; } const int SOCKET_ERROR = -1; #define E_NOT_SUFFICIENT_BUFFER ENOMEM #endif class TcpClientPort::TcpSocketImpl { SocketInit init; SOCKET sock = INVALID_SOCKET; sockaddr_in localaddr; sockaddr_in remoteaddr; bool closed_ = true; public: bool isClosed() { return closed_; } int getRssi(const char* ifaceName) { return getWifiRssi(static_cast<int>(sock), ifaceName); } static void resolveAddress(const std::string& ipAddress, int port, sockaddr_in& addr) { struct addrinfo hints; memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = IPPROTO_TCP; addr.sin_family = AF_INET; addr.sin_port = htons(port); bool found = false; struct addrinfo *result = NULL; std::string serviceName = std::to_string(port); int rc = getaddrinfo(ipAddress.c_str(), serviceName.c_str(), &hints, &result); if (rc != 0) { throw std::runtime_error(Utils::stringf("TcpClientPort getaddrinfo failed with error: %d\n", rc)); } for (struct addrinfo *ptr = result; ptr != NULL; ptr = ptr->ai_next) { if (ptr->ai_family == AF_INET && ptr->ai_socktype == SOCK_STREAM && ptr->ai_protocol == IPPROTO_TCP) { // found it! sockaddr_in* sptr = reinterpret_cast<sockaddr_in*>(ptr->ai_addr); addr.sin_family = sptr->sin_family; addr.sin_addr.s_addr = sptr->sin_addr.s_addr; addr.sin_port = sptr->sin_port; found = true; break; } } freeaddrinfo(result); if (!found) { throw std::runtime_error(Utils::stringf("TcpClientPort could not resolve ip address for '%s:%d'\n", ipAddress.c_str(), port)); } } int connect(const std::string& localHost, int localPort, const std::string& remoteHost, int remotePort) { sock = socket(AF_INET, SOCK_STREAM, 0); resolveAddress(localHost, localPort, localaddr); resolveAddress(remoteHost, remotePort, remoteaddr); // bind socket to local address. socklen_t addrlen = sizeof(sockaddr_in); int rc = bind(sock, reinterpret_cast<sockaddr*>(&localaddr), addrlen); if (rc < 0) { int hr = WSAGetLastError(); throw std::runtime_error(Utils::stringf("TcpClientPort socket bind failed with error: %d\n", hr)); } rc = ::connect(sock, reinterpret_cast<sockaddr*>(&remoteaddr), addrlen); if (rc != 0) { int hr = WSAGetLastError(); throw std::runtime_error(Utils::stringf("TcpClientPort socket connect failed with error: %d\n", hr)); } closed_ = false; return 0; } void accept(const std::string& localHost, int localPort) { SOCKET local = socket(AF_INET, SOCK_STREAM, 0); resolveAddress(localHost, localPort, localaddr); // bind socket to local address. socklen_t addrlen = sizeof(sockaddr_in); int rc = ::bind(local, reinterpret_cast<sockaddr*>(&localaddr), addrlen); if (rc < 0) { int hr = WSAGetLastError(); throw std::runtime_error(Utils::stringf("TcpClientPort socket bind failed with error: %d\n", hr)); } // start listening for incoming connection rc = ::listen(local, 1); if (rc < 0) { int hr = WSAGetLastError(); throw std::runtime_error(Utils::stringf("TcpClientPort socket listen failed with error: %d\n", hr)); } // accept 1 sock = ::accept(local, reinterpret_cast<sockaddr*>(&remoteaddr), &addrlen); if (sock == INVALID_SOCKET) { int hr = WSAGetLastError(); throw std::runtime_error(Utils::stringf("TcpClientPort accept failed with error: %d\n", hr)); } closed_ = false; } // write to the serial port int write(const uint8_t* ptr, int count) { socklen_t addrlen = sizeof(sockaddr_in); int hr = send(sock, reinterpret_cast<const char*>(ptr), count, 0); if (hr == SOCKET_ERROR) { throw std::runtime_error(Utils::stringf("TcpClientPort socket send failed with error: %d\n", hr)); } return hr; } int read(uint8_t* result, int bytesToRead) { int bytesRead = 0; // try and receive something, up until port is closed anyway. while (!closed_) { socklen_t addrlen = sizeof(sockaddr_in); int rc = recv(sock, reinterpret_cast<char*>(result), bytesToRead, 0); if (rc < 0) { #ifdef _WIN32 int hr = WSAGetLastError(); if (hr == WSAEMSGSIZE) { // message was too large for the buffer, no problem, return what we have. } else if (hr == WSAECONNRESET || hr == ERROR_IO_PENDING) { // try again - this can happen if server recreates the socket on their side. continue; } else #else int hr = errno; if (hr == EINTR) { // skip this, it is was interrupted. continue; } else #endif { return -1; } } if (rc == 0) { //printf("Connection closed\n"); return -1; } else { return rc; } } return -1; } void close() { if (!closed_) { closed_ = true; #ifdef _WIN32 closesocket(sock); #else int fd = static_cast<int>(sock); ::close(fd); #endif } } std::string remoteAddress() { return inet_ntoa(remoteaddr.sin_addr); } int remotePort() { return ntohs(remoteaddr.sin_port); } }; //----------------------------------------------------------------------------------------- TcpClientPort::TcpClientPort() { impl_.reset(new TcpSocketImpl()); } TcpClientPort::~TcpClientPort() { close(); } void TcpClientPort::close() { impl_->close(); } void TcpClientPort::connect(const std::string& localHost, int localPort, const std::string& remoteHost, int remotePort) { impl_->connect(localHost, localPort, remoteHost, remotePort); } void TcpClientPort::accept(const std::string& localHost, int localPort) { impl_->accept(localHost, localPort); } int TcpClientPort::write(const uint8_t* ptr, int count) { return impl_->write(ptr, count); } int TcpClientPort::read(uint8_t* buffer, int bytesToRead) { return impl_->read(buffer, bytesToRead); } bool TcpClientPort::isClosed() { return impl_->isClosed(); } std::string TcpClientPort::remoteAddress() { return impl_->remoteAddress(); } int TcpClientPort::remotePort() { return impl_->remotePort(); } int TcpClientPort::getRssi(const char* ifaceName) { return impl_->getRssi(ifaceName); }
38f7283f11fbd626976b245a2e97555d85651a92
9028d5e85e3321869e94c3accf24bf67e0e07ee0
/Prata-Capture_15-18/Capture_15/Listing_15.13/newexcp.cpp
07fdb8a80cb8543ea23ee8525c41b333cc575ec9
[]
no_license
pukala2/old_stuff
525dc8b3601df9141cbcfe215c2e9971e6fef3ed
2e45b8465b900b00c3781e716686c5df665f06d2
refs/heads/master
2020-03-24T08:11:37.674093
2018-07-27T14:50:55
2018-07-27T14:50:55
142,587,686
0
0
null
null
null
null
UTF-8
C++
false
false
588
cpp
newexcp.cpp
//wyjatek bad_alloc #include <iostream> #include <new> #include <cstdlib> struct Big{ double stuff[200000]; }; int main(){ Big *pb; try{ std::cout<<"Proba przydzialu wielkiego bloku pamieci:\n"; pb = new Big[1000000]; //16 00 000 000 bajtow std::cout<<"Udalo sie przebrnac przez instrukcje new:\n"; } catch(std::bad_alloc & ba){ std::cout<<"Przechwycilem wyjatek!\n"; std::cout<<ba.what()<<std::endl; exit(EXIT_FAILURE); } std::cout<<"Udalo sie przydzielic pamiec\n"; pb[0].stuff[0]=4; std::cout<<pb[0].stuff[0]<<std::endl; delete [] pb; return 0; }
ba321dfdcb5609d33339e627cf7e1ac2e1f5cbfc
383b176f168c763f20e9b50c09b9ce3c1a538c8d
/501.cpp
0bb6809454ab558f47c74ef4d925d7651592bfcc
[]
no_license
mosthandsomeman/LeetCode
dab7e25037736cd993f657179f8ccbbf55940586
99f2b6dc1fed2829298996a432773bb28a42615e
refs/heads/master
2023-01-21T02:11:50.872572
2020-11-30T13:35:32
2020-11-30T13:35:32
280,103,486
0
0
null
null
null
null
UTF-8
C++
false
false
888
cpp
501.cpp
#include<vector> #include<queue> #include<map> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; class Solution { public: vector<int> findMode(TreeNode *root) { vector<int> vec; map<int, int> mmap; queue<TreeNode*> q; int max = 0; if(root) q.push(root); while(!q.empty()){ TreeNode * top = q.front(); q.pop(); if(mmap.find(top->val) != mmap.end()) mmap[top->val]++; else mmap[top->val] = 1; if(mmap[top->val] > max) max = mmap[top->val]; if(top->left) q.push(top->left); if(top->right) q.push(top->right); } for(auto elem:mmap){ if(elem.second == max) vec.push_back(elem.first); } return vec; } };
966ad3a751dcad298cba1ac685ca7948f51f01d0
a92b18defb50c5d1118a11bc364f17b148312028
/src/prod/src/Hosting2/CleanupSecurityPrincipalRequest.h
d6baab47d0f991652782137f4b47793cfb364d51
[ "MIT" ]
permissive
KDSBest/service-fabric
34694e150fde662286e25f048fb763c97606382e
fe61c45b15a30fb089ad891c68c893b3a976e404
refs/heads/master
2023-01-28T23:19:25.040275
2020-11-30T11:11:58
2020-11-30T11:11:58
301,365,601
1
0
MIT
2020-11-30T11:11:59
2020-10-05T10:05:53
null
UTF-8
C++
false
false
1,453
h
CleanupSecurityPrincipalRequest.h
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License (MIT). See License.txt in the repo root for license information. // ------------------------------------------------------------ #pragma once namespace Hosting2 { class CleanupSecurityPrincipalRequest : public Serialization::FabricSerializable { public: CleanupSecurityPrincipalRequest(); CleanupSecurityPrincipalRequest( std::wstring const & nodeId, std::vector<std::wstring> const & applicationIds, bool const cleanupForNode); __declspec(property(get=get_ApplicationIds)) std::vector<std::wstring> const & ApplicationIds; std::vector<std::wstring> const & get_ApplicationIds() const { return applicationIds_; } __declspec(property(get=get_NodeId)) std::wstring const & NodeId; std::wstring const & get_NodeId() const { return nodeId_; } __declspec(property(get = get_IsCleanupForNode)) bool const IsCleanupForNode; bool const get_IsCleanupForNode() const { return cleanupForNode_; } void WriteTo(Common::TextWriter & w, Common::FormatOptions const &) const; FABRIC_FIELDS_03(nodeId_, applicationIds_, cleanupForNode_); private: std::wstring nodeId_; std::vector<std::wstring> applicationIds_; bool cleanupForNode_; }; }
25bc44407fe131fa8fc40f43585659ed1fbc7014
45b32ffcdc7ac3864c0b810b61deeee136616554
/3dMaxExport_KOK/Current/ExportXml/MSkeleton.cpp
637069a809b9ec034877a3c2d3907261efbbcb71
[]
no_license
atom-chen/Tools-2
812071cf6ab3e5a22fb13e4ffdc896ac03de1c68
0c41e12bd7526d2e7bd3328b82f11ea1b4a93938
refs/heads/master
2020-11-29T10:05:24.253448
2017-07-12T06:05:17
2017-07-12T06:05:17
null
0
0
null
null
null
null
GB18030
C++
false
false
3,044
cpp
MSkeleton.cpp
#include "name.h" #include "MSkeleton.h" #include "skeleton.h" #include "glm/gtx/quaternion.hpp" MSkeletonJoint::MSkeletonJoint(AWDSkeletonJoint* pAWDSkeletonJoint, MSkeletonJoint* pParent) { m_pParentMSkeletonJoint = pParent; m_pAWDSkeletonJoint = pAWDSkeletonJoint; } void MSkeletonJoint::buildJointChildList() { buildMatrix(); AWDSkeletonJoint* child = m_pAWDSkeletonJoint->get_first_child(); while (child) { MSkeletonJoint* pMSkeletonJoint = new MSkeletonJoint(child, this); m_MSkeletonJointVec.push_back(pMSkeletonJoint); pMSkeletonJoint->buildJointChildList(); child = child->next; } } void MSkeletonJoint::buildMatrix() { m_pRSMat = new MMat3x3; m_pTVec = new MMVec3; // 局部空间信息 awd_float64 *pbind_mtx = m_pAWDSkeletonJoint->get_bind_mtx(); int col = 0; int row = 0; int oneIdx = 0; // 由于矩阵是按照列存储的,因此这里也先访问列,前 3 列是 3 个坐标轴,第 4 列是偏移 for (col = 0; col < 3; ++col) { for (row = 0; row < 3; ++row) { oneIdx = col * 3 + row; (*m_pRSMat)[col][row] = (float)pbind_mtx[oneIdx]; } } for (oneIdx = 9; oneIdx < 12; ++oneIdx) { (*m_pTVec)[oneIdx - 9] = (float)pbind_mtx[oneIdx]; } } // 位置偏移 MMVec3& MSkeletonJoint::getPos() { return (*m_pTVec); } MQuat MSkeletonJoint::getRot() { return glm::toQuat<float, glm::mediump>(*m_pRSMat); } void MSkeletonJoint::buildboneXml(tinyxml2::XMLElement* bonesElem, tinyxml2::XMLDocument* pXMLDocument, int boneIdx) { tinyxml2::XMLElement* boneElem = pXMLDocument->NewElement("bone"); bonesElem->InsertEndChild(boneElem); boneElem->SetAttribute("id", boneIdx); boneElem->SetAttribute("name", m_pAWDSkeletonJoint->get_name()); tinyxml2::XMLElement* posElem = pXMLDocument->NewElement("position"); boneElem->InsertEndChild(posElem); posElem->SetAttribute("x", (*m_pTVec)[0]); posElem->SetAttribute("y", (*m_pTVec)[1]); posElem->SetAttribute("z", (*m_pTVec)[2]); tinyxml2::XMLElement* rotElem = pXMLDocument->NewElement("rotation"); boneElem->InsertEndChild(rotElem); MQuat pMQuat = getRot(); rotElem->SetAttribute("angle", pMQuat.w); tinyxml2::XMLElement* axisElem = pXMLDocument->NewElement("axis"); rotElem->InsertEndChild(axisElem); axisElem->SetAttribute("x", pMQuat.x); axisElem->SetAttribute("y", pMQuat.y); axisElem->SetAttribute("z", pMQuat.z); ++boneIdx; AWDSkeletonJoint* child = m_pAWDSkeletonJoint->get_first_child(); while (child) { MSkeletonJoint* pMSkeletonJoint = new MSkeletonJoint(child, this); pMSkeletonJoint->buildboneXml(bonesElem, pXMLDocument, boneIdx); child = child->next; } } MSkeleton::MSkeleton(AWDSkeleton* pAWDSkeleton) { m_pAWDSkeleton = pAWDSkeleton; } void MSkeleton::buildBoneList() { m_pRootMSkeletonJoint = new MSkeletonJoint(m_pAWDSkeleton->get_root_joint(), nullptr); m_pRootMSkeletonJoint->buildJointChildList(); } void MSkeleton::buildboneXmlList(tinyxml2::XMLElement* bonesElem, tinyxml2::XMLDocument* pXMLDocument) { m_pRootMSkeletonJoint->buildboneXml(bonesElem, pXMLDocument, 0); }
85f2e56035d49c858e84dbcf7a732f1f34fde123
0f30d43960d46961688497af9004c2f154d71877
/hxmath/bin/cpp/include/haxe/macro/TypedExprDef.h
06f4c9569ca6ac903a3796f6d309f2fdd5433d87
[]
no_license
mboussaa/haxe-testing
77d2c44596f92d3b509ad2e450f61d2e640eb9a3
930bd6e63c8cb91a4df323d01ae518d048c089ba
refs/heads/master
2021-01-17T10:20:07.126520
2016-06-02T10:00:49
2016-06-02T10:00:49
59,005,172
1
0
null
null
null
null
UTF-8
C++
false
true
4,145
h
TypedExprDef.h
// Generated by Haxe 3.3.0 #ifndef INCLUDED_haxe_macro_TypedExprDef #define INCLUDED_haxe_macro_TypedExprDef #ifndef HXCPP_H #include <hxcpp.h> #endif HX_DECLARE_CLASS2(haxe,macro,Binop) HX_DECLARE_CLASS2(haxe,macro,FieldAccess) HX_DECLARE_CLASS2(haxe,macro,ModuleType) HX_DECLARE_CLASS2(haxe,macro,TConstant) HX_DECLARE_CLASS2(haxe,macro,Type) HX_DECLARE_CLASS2(haxe,macro,TypedExprDef) HX_DECLARE_CLASS2(haxe,macro,Unop) namespace haxe{ namespace macro{ class TypedExprDef_obj : public hx::EnumBase_obj { typedef hx::EnumBase_obj super; typedef TypedExprDef_obj OBJ_; public: TypedExprDef_obj() {}; HX_DO_ENUM_RTTI; static void __boot(); static void __register(); static bool __GetStatic(const ::String &inName, Dynamic &outValue, hx::PropertyAccess inCallProp); ::String GetEnumName( ) const { return HX_HCSTRING("haxe.macro.TypedExprDef","\x50","\x0d","\x10","\x77"); } ::String __ToString() const { return HX_HCSTRING("TypedExprDef.","\x08","\xb1","\x2f","\x1d") + _hx_tag; } static ::haxe::macro::TypedExprDef TArray( ::Dynamic e1, ::Dynamic e2); static ::Dynamic TArray_dyn(); static ::haxe::macro::TypedExprDef TArrayDecl(::Array< ::Dynamic> el); static ::Dynamic TArrayDecl_dyn(); static ::haxe::macro::TypedExprDef TBinop(::hx::EnumBase op, ::Dynamic e1, ::Dynamic e2); static ::Dynamic TBinop_dyn(); static ::haxe::macro::TypedExprDef TBlock(::Array< ::Dynamic> el); static ::Dynamic TBlock_dyn(); static ::haxe::macro::TypedExprDef TBreak; static inline ::haxe::macro::TypedExprDef TBreak_dyn() { return TBreak; } static ::haxe::macro::TypedExprDef TCall( ::Dynamic e,::Array< ::Dynamic> el); static ::Dynamic TCall_dyn(); static ::haxe::macro::TypedExprDef TCast( ::Dynamic e,::hx::EnumBase m); static ::Dynamic TCast_dyn(); static ::haxe::macro::TypedExprDef TConst(::hx::EnumBase c); static ::Dynamic TConst_dyn(); static ::haxe::macro::TypedExprDef TContinue; static inline ::haxe::macro::TypedExprDef TContinue_dyn() { return TContinue; } static ::haxe::macro::TypedExprDef TEnumParameter( ::Dynamic e1, ::Dynamic ef,Int index); static ::Dynamic TEnumParameter_dyn(); static ::haxe::macro::TypedExprDef TField( ::Dynamic e,::hx::EnumBase fa); static ::Dynamic TField_dyn(); static ::haxe::macro::TypedExprDef TFor( ::Dynamic v, ::Dynamic e1, ::Dynamic e2); static ::Dynamic TFor_dyn(); static ::haxe::macro::TypedExprDef TFunction( ::Dynamic tfunc); static ::Dynamic TFunction_dyn(); static ::haxe::macro::TypedExprDef TIf( ::Dynamic econd, ::Dynamic eif, ::Dynamic eelse); static ::Dynamic TIf_dyn(); static ::haxe::macro::TypedExprDef TLocal( ::Dynamic v); static ::Dynamic TLocal_dyn(); static ::haxe::macro::TypedExprDef TMeta( ::Dynamic m, ::Dynamic e1); static ::Dynamic TMeta_dyn(); static ::haxe::macro::TypedExprDef TNew( ::Dynamic c,::Array< ::Dynamic> params,::Array< ::Dynamic> el); static ::Dynamic TNew_dyn(); static ::haxe::macro::TypedExprDef TObjectDecl(::Array< ::Dynamic> fields); static ::Dynamic TObjectDecl_dyn(); static ::haxe::macro::TypedExprDef TParenthesis( ::Dynamic e); static ::Dynamic TParenthesis_dyn(); static ::haxe::macro::TypedExprDef TReturn( ::Dynamic e); static ::Dynamic TReturn_dyn(); static ::haxe::macro::TypedExprDef TSwitch( ::Dynamic e,::Array< ::Dynamic> cases, ::Dynamic edef); static ::Dynamic TSwitch_dyn(); static ::haxe::macro::TypedExprDef TThrow( ::Dynamic e); static ::Dynamic TThrow_dyn(); static ::haxe::macro::TypedExprDef TTry( ::Dynamic e,::Array< ::Dynamic> catches); static ::Dynamic TTry_dyn(); static ::haxe::macro::TypedExprDef TTypeExpr(::hx::EnumBase m); static ::Dynamic TTypeExpr_dyn(); static ::haxe::macro::TypedExprDef TUnop(::hx::EnumBase op,Bool postFix, ::Dynamic e); static ::Dynamic TUnop_dyn(); static ::haxe::macro::TypedExprDef TVar( ::Dynamic v, ::Dynamic expr); static ::Dynamic TVar_dyn(); static ::haxe::macro::TypedExprDef TWhile( ::Dynamic econd, ::Dynamic e,Bool normalWhile); static ::Dynamic TWhile_dyn(); }; } // end namespace haxe } // end namespace macro #endif /* INCLUDED_haxe_macro_TypedExprDef */
3bcde22873800eeedf64ee22b3c8b3789599cc4d
615e70f40aefca4a8994e835241dc6ce0a5db3ed
/lib/ios8/coretext/CTDefines.inc
a3d457e2fe98714e7701ae7cf57f3f2a61413175
[ "MIT" ]
permissive
genericptr/GLPT
f6c16f35a86ec127ad549d9d1f97dbbc43365574
852dc244eb00f1727fc8edc3ec11ae16d011eb73
refs/heads/trunk
2022-11-28T07:31:25.225130
2022-11-12T01:26:44
2022-11-12T01:26:44
151,209,923
3
2
MIT
2022-05-18T00:17:24
2018-10-02T06:28:42
Pascal
UTF-8
C++
false
false
101
inc
CTDefines.inc
{ Parsed from CoreText.framework (iPhoneOS8.2) CTDefines.h } { Created on Fri Mar 20 2:11:07 2015 }
c4f76d388d2f4f054151b9a01ba65ab0d48d353e
ede8447af3a013f09b1298ca962dceaff062292a
/constin.cpp
dc073624c2aff31cc5cb7c3933c56dc8eeaaf60f
[]
no_license
Ajax07/Some-Useful-Coding-Problem-GoldmanSachs-using-Cpp
0d692788df96ca3af6f5a8bfd07ef1e00a0f6ac9
6ea8045d6c9386264720b52fb5a947abef14c6fd
refs/heads/main
2023-06-14T14:04:30.579185
2021-07-16T14:00:40
2021-07-16T14:00:40
null
0
0
null
null
null
null
UTF-8
C++
false
false
381
cpp
constin.cpp
#include <iostream> #include <string> using namespace std; class Player{ string name; int health; int xp; public: Player(); Player(std::string name_val); Player(std::string name_val, int health_val, int xp_val); }; Player::Player() : name{"none"},health{0},xp{0}{ } Player::Player(std::string name_val) : name{"name_val"},health{0},xp{0}{ }
a40b854d34dfc7b7540fcf3b40580aa8f6289238
b2a263fc5fb54e623eaf3a8e3d63209cbd08ead4
/tests/io-device_notifier_pool/test_standard_streams.hpp
9e1d19032dd254f8986c95dd3667fa3b3d43097f
[]
no_license
semenovf/pfs
3679961bc7d3e5514fe4aafe18bea7be4d238c2f
682c9d42a1ccb63e1d8117014877e7d96254f672
refs/heads/master
2021-07-19T06:08:10.048568
2019-04-02T06:03:30
2019-04-02T06:03:30
80,082,005
0
1
null
null
null
null
UTF-8
C++
false
false
1,847
hpp
test_standard_streams.hpp
#pragma once #include "pfs/io/file.hpp" namespace test_standard_streams { static int can_write_counter = 0; struct event_handler { void accepted (device_ptr d, server_ptr) { std::cout << "connected: " << d->url().utf8() << std::endl; } void disconnected (device_ptr d) { std::cout << "disconnected: " << d->url().utf8() << std::endl; } void ready_read (device_ptr d) { std::cout << "ready_read: " << d->url().utf8() << std::endl; } void can_write (device_ptr d) { std::cout << "can_write: " << d->url().utf8() << std::endl; can_write_counter++; } void on_error (pfs::error_code const & ec) { std::cerr << "on_error: " << pfs::to_string(ec).utf8() << std::endl; } }; void run () { std::cout << "///////////////////////////////////////////////////////////////////////////\n"; std::cout << "// Test standard streams //\n"; std::cout << "///////////////////////////////////////////////////////////////////////////\n"; ADD_TESTS(4); pfs::error_code ec; device_notifier_pool pool; pfs::io::device_ptr infile = pfs::io::open_device(pfs::io::open_params<pfs::io::file_stdin>(), ec); TEST_OK2(!ec, "Success stdin opened"); pfs::io::device_ptr outfile = pfs::io::open_device(pfs::io::open_params<pfs::io::file_stdout>(), ec); TEST_OK2(!ec, "Success stdout opened"); pfs::io::device_ptr errfile = pfs::io::open_device(pfs::io::open_params<pfs::io::file_stderr>(), ec); TEST_OK2(!ec, "Success stderr opened"); pool.insert(infile, pfs::io::notify_read); pool.insert(outfile, pfs::io::notify_write); pool.insert(errfile, pfs::io::notify_all); event_handler eh; pool.dispatch(eh, 100); TEST_OK2(can_write_counter == 2, "Two streams can write"); } } // namespace test_standard_streams
f1598d546c23c0a7be1d736db02765ceda57572b
397a4559b44b07b08df50e309bbb5d86b1d60459
/TextInputManager.h
e01f7ac6438735b18e857c493dbef2617f498438
[]
no_license
toshikurauchi/eyeswipe
c456145e0d154b9d65c04b876e3746fed212474a
9465862d525264027d0c91a60180909c1f626976
refs/heads/master
2022-04-26T22:24:11.524885
2020-04-28T17:43:31
2020-04-28T17:43:31
259,454,221
0
0
null
null
null
null
UTF-8
C++
false
false
376
h
TextInputManager.h
#ifndef TEXTINPUTMANAGER_H #define TEXTINPUTMANAGER_H #include <QObject> #include <QStringList> class TextInputManager : public QObject { Q_OBJECT public: TextInputManager(QObject *root); public slots: void addSingleLetter(QChar letter); void addWordCandidates(QStringList words, int idx); private: QObject *textField; }; #endif // TEXTINPUTMANAGER_H
7ae2abc45f15b63ac61b4edf9aa36d1ffae0bca8
a6cb68035cfcb597888b3e5e7e2dd2ec86bea2c6
/stringTests.cpp
2d5335129b12c544c902f3c616fbca6dde8f7971
[]
no_license
SeeMorton1/autoindex
d1ef2839730e029d08e634a78ad69e0c204cf115
0f1cd63fa59dfd31fe12935de0f317637c23d62b
refs/heads/main
2022-12-22T09:15:55.720824
2020-10-05T02:11:31
2020-10-05T02:11:31
301,270,524
0
0
null
null
null
null
UTF-8
C++
false
false
943
cpp
stringTests.cpp
// // Created by Conner Morton on 9/23/2020. // #include "catch.hpp" #include "DSString.h" TEST_CASE("DSString tests","[DSString]"){ DSString s[10]; s[0] = DSString("test"); s[1] = DSString(""); s[2] = DSString("A really good. string class!"); s[3] = DSString("UPPERCASE"); s[4] = DSString("uppercase"); s[5] = DSString("\n"); s[6] = DSString("I want THIS"); s[7] = DSString(" "); s[8] = DSString("test"); SECTION("bool operators"){ REQUIRE(s[0] == s[8]); } SECTION("methods"){ unsigned last = s[6].getLength()-1; REQUIRE(s[6][s[6].getLength()-1]==s[6][last]); unsigned getT = s[6].getIndex('T'); REQUIRE(getT == 7); s[0].reverse(0,s[0].getLength()-1); REQUIRE(s[0]=="tset"); s[0].reverse(0,s[0].getLength()-1); } SECTION("[] operator"){ REQUIRE(s[0][0] =='t'); REQUIRE(s[2][1] == ' '); } }
679f5eb0942748f7d66568e61df4f7e53a6502c2
b0893dbcad94f7677871bd77a1f7f9abfc40cc46
/src/math/topology/sico/simplex/baseA.hpp
554b0a2d12c78e1baa345533bc817f7c3cf10b21
[ "Apache-2.0" ]
permissive
dmilos/math
71124fc3e750eae5bf5fb787ff371573bb9e2464
41131d481d8112eda4f71a86a0effe7c3154a17e
refs/heads/master
2023-04-28T05:48:20.038227
2023-04-22T17:43:09
2023-04-22T20:26:09
140,083,004
2
1
null
null
null
null
UTF-8
C++
false
false
1,368
hpp
baseA.hpp
#ifndef math_topology_sico_simplex_baseA #define math_topology_sico_simplex_baseA // ::math::topology::sico::simplex::baseA<dimension_size> #include <vector> namespace math { namespace topology { namespace sico { namespace simplexxx { template < unsigned dimension_size > struct base_fixed { public: typedef std::array<size_type, dimension_size + 1 > face_type; typedef std::vector<size_type> cell_type; public: simplexA(){ } explicit simplexA( face_type const& face ): m_face(face) { } explicit simplexA( face_type const& face, cell_type const& cell ): m_face(face), m_cell(cell){ } public: face_type const& face() const{ return m_face; } face_type & face() { return m_face; } private: face_type m_face; public: cell_type const& cell() const{ return m_cell; } cell_type & cell() { return m_cell; } private: cell_type m_cell; }; template<> struct simplexA < 0 > { public: // TODO }; } } } #endif
9aa10da0d82e98cf2819463b119356d2ab5859ef
4b023194fe3e48d23fdc87d62cb4b1ef6df92480
/engine/src/app.cpp
22031f60ac94ddfee869414c50d262f4e5b4ee42
[]
no_license
Ace17/eelusion
648840b6c5755f35ce35c9e3b4c97b1e1e85527b
c8777651014583319d3dc3b8409047d549f77aab
refs/heads/master
2020-08-06T23:34:54.224371
2019-10-10T07:07:39
2019-10-10T07:07:39
213,200,977
1
0
null
null
null
null
UTF-8
C++
false
false
6,128
cpp
app.cpp
// Copyright (C) 2018 - Sebastien Alaiwan // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // Main loop timing. // No game-specific code should be here, // and no platform-specific code should be here (SDL is OK). #include <vector> #include <string> #include <memory> #include "SDL.h" #include "base/geom.h" #include "base/resource.h" #include "base/scene.h" #include "base/view.h" #include "app.h" #include "ratecounter.h" #include "audio/audio.h" #include "render/display.h" using namespace std; auto const TIMESTEP = 10; Display* createDisplay(Size2i resolution); Audio* createAudio(); Scene* createGame(View* view, vector<string> argv); class App : View, public IApp { public: App(Span<char*> args) : m_args({ args.data, args.data + args.len }) { SDL_Init(0); m_display.reset(createDisplay(Size2i(512, 512))); m_audio.reset(createAudio()); m_scene.reset(createGame(this, m_args)); m_lastTime = SDL_GetTicks(); } virtual ~App() { SDL_Quit(); } bool tick() override { processInput(); auto const now = (int)SDL_GetTicks(); bool dirty = false; auto timestep = m_slowMotion ? TIMESTEP * 10 : TIMESTEP; while(m_lastTime + timestep < now) { m_lastTime += timestep; if(!m_paused) { auto next = m_scene->tick(m_control); if(next != m_scene.get()) { m_scene.release(); m_scene.reset(next); } } dirty = true; } if(dirty) { m_actors.clear(); m_scene->draw(); draw(); m_fps.tick(now); } auto fps = m_fps.slope(); if(fps != m_lastFps) { fpsChanged(fps); m_lastFps = fps; } return m_running; } private: void processInput() { SDL_Event event; while(SDL_PollEvent(&event)) { switch(event.type) { case SDL_QUIT: onQuit(); break; case SDL_KEYDOWN: onKeyDown(&event); break; case SDL_KEYUP: onKeyUp(&event); break; } } m_control.left = keys[SDL_SCANCODE_LEFT]; m_control.right = keys[SDL_SCANCODE_RIGHT]; m_control.up = keys[SDL_SCANCODE_UP]; m_control.down = keys[SDL_SCANCODE_DOWN]; m_control.start = keys[SDL_SCANCODE_RETURN]; m_control.fire = keys[SDL_SCANCODE_Z] || keys[SDL_SCANCODE_LCTRL]; m_control.jump = keys[SDL_SCANCODE_X] || keys[SDL_SCANCODE_SPACE]; m_control.dash = keys[SDL_SCANCODE_C]; m_control.restart = keys[SDL_SCANCODE_R]; m_control.debug = keys[SDL_SCANCODE_SCROLLLOCK]; } void draw() { m_display->beginDraw(); for(auto& actor : m_actors) { auto where = Rect2f(actor.pos.x, actor.pos.y, actor.scale.width, actor.scale.height); m_display->drawActor(where, !actor.screenRefFrame, (int)actor.model, actor.effect == Effect::Blinking, actor.action, actor.ratio, actor.zOrder); } if(m_paused) m_display->drawText(Vector2f(0, 0), "PAUSE"); else if(m_slowMotion) m_display->drawText(Vector2f(0, 0), "SLOW-MOTION MODE"); else if(m_control.debug) m_display->drawText(Vector2f(0, 0), "DEBUG MODE"); if(m_textboxDelay > 0) { auto y = 2.0f; auto const DELAY = 90.0f; if(m_textboxDelay < DELAY) y += 16 * (DELAY - m_textboxDelay) / DELAY; m_display->drawText(Vector2f(0, y), m_textbox.c_str()); m_textboxDelay--; } m_display->endDraw(); } void fpsChanged(int fps) { char title[128]; sprintf(title, "%s (%d FPS)", m_title.c_str(), fps); m_display->setCaption(title); } void onQuit() { m_running = 0; } void onKeyDown(SDL_Event* evt) { if(evt->key.keysym.sym == SDLK_ESCAPE) onQuit(); if(evt->key.keysym.sym == SDLK_F2) m_scene.reset(createGame(this, m_args)); if(evt->key.keysym.sym == SDLK_TAB) m_slowMotion = !m_slowMotion; if(evt->key.keysym.sym == SDLK_RETURN && (evt->key.keysym.mod & KMOD_LALT)) { if(evt->key.repeat == 0) { m_fullscreen = !m_fullscreen; m_display->setFullscreen(m_fullscreen); } } else if(evt->key.keysym.sym == SDLK_PAUSE) { m_audio->playSound(0); m_paused = !m_paused; } keys[evt->key.keysym.scancode] = 1; } void onKeyUp(SDL_Event* evt) { keys[evt->key.keysym.scancode] = 0; } // View implementation void setTitle(char const* gameTitle) override { m_title = gameTitle; } void preload(Resource res) override { switch(res.type) { case ResourceType::Sound: m_audio->loadSound(res.id, res.path); break; case ResourceType::Model: m_display->loadModel(res.id, res.path); break; } } void textBox(char const* msg) override { m_textbox = msg; m_textboxDelay = 60 * 4; } void playMusic(MUSIC id) override { m_audio->playMusic(id); } void stopMusic() override { m_audio->stopMusic(); } void playSound(SOUND sound) override { m_audio->playSound(sound); } void setCameraPos(Vector2f pos) override { m_display->setCamera(pos); } void setAmbientLight(float amount) override { m_display->setAmbientLight(amount); } void sendActor(Actor const& actor) override { m_actors.push_back(actor); } int keys[SDL_NUM_SCANCODES] {}; int m_running = 1; int m_lastTime; int m_lastFps = -1; RateCounter m_fps; Control m_control {}; vector<string> m_args; unique_ptr<Scene> m_scene; bool m_slowMotion = false; bool m_fullscreen = false; bool m_paused = false; unique_ptr<Audio> m_audio; unique_ptr<Display> m_display; vector<Actor> m_actors; string m_title; string m_textbox; int m_textboxDelay = 0; }; /////////////////////////////////////////////////////////////////////////////// unique_ptr<IApp> createApp(Span<char*> args) { return make_unique<App>(args); }
3c1e8ae9642096254ffb130672ed7b5d81add3a6
97e4c9f84f8900c533480356ac20cd42894e8e38
/Proyecto Datos 2/main.cpp
1a295ab49ceec2a76ae1e3abcfeb20be9576610e
[]
no_license
jfhr1999/Datos-progra-2
215b6dd5548163ec97973dd2c5a414b924f33faa
afa9d13b4c57062d40f24d93afc320a1477e797c
refs/heads/master
2020-03-19T07:01:13.518552
2018-06-11T18:03:18
2018-06-11T18:03:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,719
cpp
main.cpp
#include<iostream> #include<string> #include<fstream> #include "DLinkedList.h" #include "Turing.h" #include "Grafo.h" using namespace std; int main(){ while(true){ Turing turing; string opcion =""; cout << "bienvenido, por favor elija entre una se las siguientes opciones: " << "s para detener la maquina, i para cargar un archivo y brindar una cinta, r para reiniciar la maquina" << endl; cin >> opcion; if(opcion == "i"){ Turing turing; string nombreArchivo = ""; string cinta = ""; cout << "por favot ingrese el nombre del archivo con la extension (.txt): " << endl; cin >> nombreArchivo; cout << "ingrese la cinta a leer: " << endl; cin >> cinta; turing.crearGrafo(nombreArchivo); turing.crearCinta(cinta); string desicion = ""; cout << "Ingrese c para continuar o s para salir" << endl; cin >> desicion; while(desicion == "c"){ int result = turing.startTuring(true); if(result == 0 || result == -1){ turing.dibujarGrafo(); getch(); break; } cout << "Ingrese c para continuar o s para salir" << endl; cin >> desicion; } } if(opcion == "s"){ break; } if(opcion == "r"){ } } /*Turing turing; turing.crearGrafo("hola.txt"); turing.crearCinta("00011"); cout << "Cinta: " << turing.imprimirCinta() << endl << endl; turing.startTuring(); turing.dibujarGrafo(); getch();*/ }
d6fd7cacbfc2235daf573dea071049af39404771
65e3391b6afbef10ec9429ca4b43a26b5cf480af
/STARLIGHT/starlight/src/nucleus.cpp
b587a84d3a5bcb2758e57b720bea81b33bc1246a
[]
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
6,440
cpp
nucleus.cpp
/////////////////////////////////////////////////////////////////////////// // // Copyright 2010 // // This file is part of starlight. // // starlight is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // starlight 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 starlight. If not, see <http://www.gnu.org/licenses/>. // /////////////////////////////////////////////////////////////////////////// // // File and Version Information: // $Rev:: 298 $: revision of last commit // $Author:: srklein $: author of last commit // $Date:: 2018-02-22 00:23:57 +0100 #$: date of last commit // // Description: // // // /////////////////////////////////////////////////////////////////////////// #include <iostream> #include <fstream> #include "starlightconstants.h" #include "reportingUtils.h" #include "nucleus.h" #include <inputParameters.h> using namespace std; using namespace starlightConstants; //______________________________________________________________________________ nucleus::nucleus(const int Z, const int A, const int productionMode) : xZ(Z), xA(A), _productionMode(productionMode) { init(); } void nucleus::init() { _woodSaxonSkinDepth=0.53; switch (xZ) { case 82: { _Radius = 6.624; _rho0 = 0.160696; } break; case 79: { _Radius = 6.38; _rho0 = 0.169551; } break; case 29: { _Radius = 4.214; _rho0 = 0.173845; } break; case 54: // Added by SRK 2/2018 { _Radius=5.36; // value used by ALICE _rho0=0.18406; // calculated by me, to give normalization \intd^3r rho(r)=129 } break; case 44: // Ruthenium, added by SRK 2/2018 from parameters in arXiv:1607.04697. _rho0 is calculated by me { _Radius=5.085; _rho0=0.1624; _woodSaxonSkinDepth=0.46; } break; case 40: { _Radius=5.020; _rho0=0.1684; _woodSaxonSkinDepth=0.46; } break; case 1: { //is this a proton or deuteron if(xA==1){ _Radius = 0.7; _rho0 = -1.0; //Not relevant for protons } else { _Radius = 2.1; _rho0 = xA; } } break; default: printWarn << "density not defined for projectile with Z = " << xZ << ". using defaults." << endl; _Radius = 1.2*pow(xA, 1. / 3.); // _rho0 = 0.138; This matches the radius above for a hard-sphere nucleus // add empircal correction to match to the Woods-Saxon nucleus that STARlight uses S. Klein 2/2018 _rho0=0.138/(1.13505-0.0004283*xA); if( xZ < 7 ){ // This is for Gaussian form factors/densities _rho0 = xA; } } } //______________________________________________________________________________ nucleus::~nucleus() { } //______________________________________________________________________________ double nucleus::rws(const double r) const { if( xZ < 7 ){ // Gaussian density distribution for light nuclei double norm = (3./(2.*starlightConstants::pi))*sqrt( (3./(2.*starlightConstants::pi)) ); norm = norm/(nuclearRadius()*nuclearRadius()*nuclearRadius()); return norm*exp(-((3./2.)*r*r)/(nuclearRadius()*nuclearRadius())); }else{ // Fermi density distribution for heavy nuclei double x=exp(-(r - nuclearRadius()) / woodSaxonSkinDepth()); return x/(1.+x); // Below can give problems on some machines if r is too large // return 1.0 / (1. + exp((r - nuclearRadius()) / woodSaxonSkinDepth())); } } //______________________________________________________________________________ double nucleus::formFactor(const double t) const { // electromagnetic form factor of proton if ((xZ == 1) && (xA == 1)) { const double rec = 1. / (1. + t / 0.71); return rec * rec; } if( xZ < 7 ){ // Gaussian form factor for light nuclei const double R_G = nuclearRadius(); return exp(-R_G*R_G*t/(6.*starlightConstants::hbarc*starlightConstants::hbarc)); } else { // nuclear form factor, from Klein Nystrand PRC 60 (1999) 014903, Eq. 14 const double R = nuclearRadius(); const double q = sqrt(t); const double arg1 = q * R / hbarc; const double arg2 = hbarc / (q * R); const double sph = (sin(arg1) - arg1 * cos(arg1)) * 3. * arg2 * arg2 * arg2; const double a0 = 0.70; // [fm] return sph / (1. + (a0 * a0 * t) / (hbarc * hbarc)); } } //______________________________________________________________________________ double nucleus::dipoleFormFactor(const double t, const double t0) const { const double rec = 1. / (1. + t / t0); return rec * rec; } //______________________________________________________________________________ double nucleus::thickness(const double b) const { // JS This code calculates the nuclear thickness function as per Eq. 4 in // Klein and Nystrand, PRC 60. // former DOUBLE PRECISION FUNCTION T(b) // data for Gauss integration const unsigned int nmbPoints = 5; const double xg[nmbPoints + 1] = {0., 0.1488743390, 0.4333953941, 0.6794095683, 0.8650633667, 0.9739065285}; const double ag[nmbPoints + 1] = {0., 0.2955242247, 0.2692667193, 0.2190863625, 0.1494513492, 0.0666713443}; const double zMin = 0; const double zMax = 15; const double zRange = 0.5 * (zMax - zMin); const double zMean = 0.5 * (zMax + zMin); double sum = 0; for(unsigned int i = 1; i <= nmbPoints; ++i) { double zsp = zRange * xg[i] + zMean; double radius = sqrt(b * b + zsp * zsp); sum += ag[i] * rws(radius); zsp = zRange * (-xg[i]) + zMean; radius = sqrt(b * b + zsp * zsp); sum += ag[i] * rws(radius); } return 2. * zRange * sum; }
0296ccc6c942e1269dd7e026f0fbb126f0bdb027
e9f297eed1aedb4e2b3fbb6762201a79b4c1162a
/code/raygun_blue_spin_final.ino
32c89b3f890039e109ca87527028155f6b90270f
[]
no_license
Make3DPrintingProjects/Raygun-Pen
e997a316b172e5ba1a4c79b30eda038079c93780
42876700efdff763598a6e5786e34ab1cf0a4aa4
refs/heads/master
2016-08-05T21:32:24.691026
2015-10-28T14:33:39
2015-10-28T14:33:39
38,721,990
0
0
null
null
null
null
UTF-8
C++
false
false
916
ino
raygun_blue_spin_final.ino
// Raygun Pen program // Modified the original version from Adafruit Goggles project #include <Adafruit_NeoPixel.h> #ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc. #include <avr/power.h> #endif #define PIN 0 Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, PIN); uint8_t mode = 0, // Current animation effect offset = 0; // Position of spinning LED uint32_t color = 0x0000FF; // Start blue uint32_t prevTime; void setup() { #ifdef __AVR_ATtiny85__ // Trinket if(F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif pixels.begin(); pixels.setBrightness(85); // 1/3 brightness prevTime = millis(); } void loop() { uint8_t i; uint32_t t; { for(i=0; i<16; i++) { uint32_t c = 0; if(((offset + i) & 7) < 2) c = color; // 4 pixels on... pixels.setPixelColor( i, c); // NeoPixel in Shell } pixels.show(); offset++; delay(50); } }
738434fc32e93d1fe246316d3e24e967fb672e8e
e3587c7dce8512f9b83cc884054a2b5dc442d80e
/SmartProxy/src/main.cpp
848981f65eba2b68e95b13389bff4e769512fc5d
[]
no_license
love-xunmeng/SmartPlatform
1a79283e7d294e5155ae8ee490197154b743fef9
cf311d9d414be50c0691c73dd2d4945ccaa532c6
refs/heads/master
2021-01-02T22:33:57.254300
2017-09-13T02:31:32
2017-09-13T02:31:32
99,339,644
2
0
null
null
null
null
GB18030
C++
false
false
3,427
cpp
main.cpp
//#include "MySqlRunnable.h" //#include "MySqlConnectionPool.h" //#include "mysql_connect.h" #include "RequestHandler.h" #include "ServiceUpdater.h" #include "crow.h" #include "boost/asio.hpp" #include "boost/make_shared.hpp" #include "boost/shared_ptr.hpp" #include "boost/thread.hpp" #include <iostream> using namespace boost; using namespace std; //int test_mysql_connection_pool(); //int test_mysql_query(boost::shared_ptr<MySqlRunnable> mysql_connection); //int test_mysql_insert(boost::shared_ptr<MySqlRunnable> mysql_connection); int main() { //boost::shared_ptr<MySqlConnectionPool> mysql_connection_pool = boost::make_shared<MySqlConnectionPool>(std::thread::hardware_concurrency()); boost::asio::io_service ios; ServiceUpdater::instance()->set(ios, 500, true); ServiceUpdater::instance()->start(); boost::thread asio_thread_ = boost::thread(boost::bind(&boost::asio::io_service::run, boost::ref(ios))); crow::SimpleApp app; app.route_dynamic("/").methods(crow::HTTPMethod::Post)([] {return process_route_request();}); app.route_dynamic("/CameraOcclusionServiceRequest").methods(crow::HTTPMethod::Post)([](const crow::request& req) {return process_camera_occlusion_service_request(req); }); app.route_dynamic("/HusbandWithLooksRequest").methods(crow::HTTPMethod::Post)([](const crow::request& req) {return husband_wife_looks_request(req); }); //CROW_ROUTE(app, "/")(process_route_request); ///CROW_ROUTE(app, "/CameraOcclusionServiceRequest").methods("POST"_method)(process_camera_occlusion_service_request); //CROW_ROUTE(app, "/TestMySqlInsert")([&] { // boost::shared_ptr<MySqlRunnable> mysql_connection = mysql_connection_pool->get_connection(); // test_mysql_insert(mysql_connection); // mysql_connection_pool->return_connection(mysql_connection); // return "Success"; }); //CROW_ROUTE(app, "/TestMySqlQuery")([&] { // boost::shared_ptr<MySqlRunnable> mysql_connection = mysql_connection_pool->get_connection(); // test_mysql_query(mysql_connection); // if (nullptr != mysql_connection) { // mysql_connection_pool->return_connection(mysql_connection); // } // return "Success"; }); crow::logger::setLogLevel(crow::LogLevel::Error); app.port(18080).multithreaded().run(); getchar(); ServiceUpdater::instance()->stop(); } //int test_mysql_connection_pool() { // ConnectionPool *pool = ConnectionPool::getInstance(); // std::shared_ptr<Connection>con; // Statement *state; // ResultSet *result; // // //获得一个连接 // con = pool->getConnect(); // //获得一个数据库连接对象 // state = con->createStatement(); // //使用XL_db这个数据库 // state->execute("use XL_db"); // //查询语句 // result = state->executeQuery("select * from UserInfo;"); // while (result->next()) // { // int id = result->getInt("uid"); // std::string name = result->getString("password"); // std::cout << "id:" << id << " name:" << name << std::endl; // } // // boost::this_thread::sleep(boost::posix_time::seconds(10)); // pool->retConnect(con); // std::cout << pool->getPoolSize() << std::endl; // boost::this_thread::sleep(boost::posix_time::seconds(10)); // // return EXIT_SUCCESS; //} // //int test_mysql_query(boost::shared_ptr<MySqlRunnable> mysql_connection) { // mysql_connection->execute_query("select * from user"); // return 0; //} // //int test_mysql_insert(boost::shared_ptr<MySqlRunnable> mysql_connection) { // //mysql_connection->insert(); // return 0; //}
a3bbea17dd89d5b309750fd3d512b3e2c15ed95e
210f4988362a9cfbce10d542797109e7b66a37e5
/source/sim/resources.h
785ccd4902d3834cb29d1d74ce6e3ac3e77e5a5a
[]
no_license
dmdware/sf2
1ab8215c93d3ea7231d28771cede45c7bc2df3d2
4068d511a82d0a293b7e9571d58f5fb7cb4c2730
refs/heads/master
2020-06-20T11:25:39.986160
2016-12-10T03:42:59
2016-12-10T03:42:59
76,088,530
1
0
null
null
null
null
UTF-8
C++
false
false
2,423
h
resources.h
#ifndef RESOURCES_H #define RESOURCES_H #include "../platform.h" //TODO MAX_ICONS 256 mod struct Resource { public: char icon; ecbool physical; ecbool capacity; ecbool global; std::string name; //TODO change to char[]? float rgba[4]; std::string depositn; //TODO change to char[]? int conduit; std::string unit; //measuring unit unsigned int halflife; }; //conduit #define CD_NONE -1 #define CD_ROAD 0 #define CD_POWL 1 #define CD_CRPIPE 2 #define RES_NONE -1 #define RES_DOLLARS 0 #define RES_LABOUR 1 #define RES_HOUSING 2 #define RES_FARMPRODUCTS 3 #define RES_RETFOOD 4 #define RES_CHEMICALS 5 #define RES_IRONORE 6 #define RES_METAL 7 #define RES_STONE 8 #define RES_CEMENT 9 #define RES_COAL 10 #define RES_URANIUM 11 #define RES_PRODUCTION 12 #define RES_CRUDEOIL 13 #define RES_WSFUEL 14 #define RES_RETFUEL 15 #define RES_ENERGY 16 #define RESOURCES 17 //#define RES_ELECTRONICS 6 extern Resource g_resource[RESOURCES]; //TODO remove electronics plant to avoid crash //TODO make Basket allocate *r = x RESOURCES for modding //MAX_RESOURCES 256 struct Basket { public: int r[RESOURCES]; int& operator[](const int i) { return r[i]; } }; //TODO implement Bundle struct Bundle { public: unsigned char res; int amt; }; //capacity supply (e.g. electricity, water pressure) struct CapSup { public: unsigned char rtype; int amt; int src; int dst; }; void DefR(int resi, const char* n, const char* depn, int iconindex, ecbool phys, ecbool cap, ecbool glob, float r, float g, float b, float a, int conduit, const char* unit, unsigned int halflife); void Zero(int *b); void UpdDecay(); ecbool ResB(int building, int res); ecbool TrySub(const int* cost, int* universal, int* stock, int* local, int* netch, int* insufres); struct CycleHist { public: int prod[RESOURCES]; //earnings and production int cons[RESOURCES]; //expenses and consumption int price[RESOURCES]; int wage; CycleHist() { reset(); } void reset() { Zero(prod); Zero(cons); Zero(price); wage = -1; } }; struct TrCycleHist { public: int earn; //fees collected int pay; //wage paid int trprice; //transport fee int opwage; //driver wage int jobsgiven; int jobsfini; TrCycleHist() { reset(); } void reset() { earn = 0; pay = 0; trprice = 0; opwage = 0; jobsgiven = 0; jobsfini = 0; } }; #endif
1d8e8879c2ed8ce076d2cf4e2e88b7e8b691b37a
8fd97c8310d59bf1ce9487e42dbf5395d4412345
/source/utils/color/ccolor.h
7674654c67b529013ef4dc5192d78653f35e7af4
[ "Zlib" ]
permissive
gummikana/poro
37c5dba0c11412e8ccdde5b4f5e949864c1e6e74
70162aca06ca5a1d4f92b8d01728e1764e4c6873
refs/heads/master
2023-06-22T17:48:43.103700
2019-09-17T15:32:31
2019-09-17T15:32:31
1,170,509
9
5
null
null
null
null
UTF-8
C++
false
false
17,457
h
ccolor.h
/*************************************************************************** * * Copyright (c) 2003 - 2011 Petri Purho * * This software is provided 'as-is', without any express or implied * warranty. In no event will the authors be held liable for any damages * arising from the use of this software. * Permission is granted to anyone to use this software for any purpose, * including commercial applications, and to alter it and redistribute it * freely, subject to the following restrictions: * 1. The origin of this software must not be misrepresented; you must not * claim that you wrote the original software. If you use this software * in a product, an acknowledgment in the product documentation would be * appreciated but is not required. * 2. Altered source versions must be plainly marked as such, and must not be * misrepresented as being the original software. * 3. This notice may not be removed or altered from any source distribution. * ***************************************************************************/ /////////////////////////////////////////////////////////////////////////////// // // // // 1 16/08/2004 21:35 Pete // Added the Set32() Get32() method pair and made the member variables // private // //----------------------------------------------------------------------------- #ifndef INC_CCOLOR_H #define INC_CCOLOR_H #include <math.h> #include "../staticarray/cstaticarray.h" //! Color class /*! A basic color class that thinks that each color component is a 8 bit integer between [0 - 255] the far away relative of this is the Color class coded by Sebastian Aaltonen thanks to him. */ namespace ceng { class CColorFloat { public: typedef unsigned int uint32; typedef unsigned char uint8; static void InitMasks(); CColorFloat( float r = 0, float g = 0, float b = 0, float a = 1.f ) : r( r ), g( g ), b( b ), a( a ), multiplied_with_alpha( false ) { InitMasks(); } CColorFloat( const CColorFloat& other ) : r( other.r ), g( other.g ), b( other.b ), a( other.a ), multiplied_with_alpha( false ) { InitMasks(); } CColorFloat( const uint32 clor ) : multiplied_with_alpha( false ) { InitMasks(); Set32( clor ); } //------------------------------------------------------------------------- // Operators CColorFloat operator+(const CColorFloat& other) const { return CColorFloat(r+other.r,g+other.g,b+other.b,a+other.a); } CColorFloat operator-(const CColorFloat& other) const { return CColorFloat(r-other.r,g-other.g,b-other.b,a-other.a); } CColorFloat operator*(const CColorFloat& other) const { return CColorFloat(r*other.r,g*other.g,b*other.b,a*other.a); } CColorFloat operator/(const CColorFloat& other) const { return CColorFloat(r/other.r,g/other.g,b/other.b,a/other.a); } CColorFloat operator*( float num ) const { return CColorFloat(r*num,g*num,b*num,a*num); } CColorFloat operator/( float num ) const { return CColorFloat(r/num,g/num,b/num,a/num); } void operator+=(const CColorFloat& other) { r+=other.r; g+=other.g; b+=other.b; a+=other.a; } void operator-=(const CColorFloat& other) { r-=other.r; g-=other.g; b-=other.b; a-=other.a; } void operator*=( float num) { r*=num; g*=num; b*=num; a*=num; } void operator/=(float num) { r/=num; g/=num; b/=num; a/=num; } bool FloatCompare( float v1, float v2, float e = 1.f / 512.f ) const { return ( fabs( v1 - v2 ) < e ); } bool operator==(const CColorFloat& other) const { if ( FloatCompare( r, other.r ) && FloatCompare( g, other.g ) && FloatCompare( b, other.b ) && FloatCompare( a, other.a ) ) return true; return false; } bool operator!=(const CColorFloat& other) const { return !operator==(other); } CColorFloat& operator=( const CColorFloat& other ) { r = other.r; g = other.g; b = other.b; a = other.a; return *this; } float operator[]( int i ) const { switch( i ) { case 0: return GetR(); case 1: return GetG(); case 2: return GetB(); case 3: return GetA(); default: return 0; } } float& operator[]( int i ) { static float dump_me = 0; switch( i ) { case 0: return r; case 1: return g; case 2: return b; case 3: return a; default: return dump_me; } } /////////////////////////////////////////////////////////////////////////// float GetR() const { return r; } float GetG() const { return g; } float GetB() const { return b; } float GetA() const { return a; } uint8 GetR8() const { return (uint8)(r * 255.0f); } uint8 GetG8() const { return (uint8)(g * 255.0f); } uint8 GetB8() const { return (uint8)(b * 255.0f); } uint8 GetA8() const { return (uint8)(a * 255.0f); } void SetR( float cr ) { r = cr; } void SetG( float cg ) { g = cg; } void SetB( float cb ) { b = cb; } void SetA( float ca ) { a = ca; } void Set8( uint8 r, uint8 g, uint8 b, uint8 a ) { SetR( (float)(r / 255.f) ); SetG( (float)(g / 255.f) ); SetB( (float)(b / 255.f) ); SetA( (float)(a / 255.f) ); } void Set32( const uint32& color ) { uint32 r32, g32, b32, a32; r32 = color & RMask; g32 = color & GMask; b32 = color & BMask; a32 = color & AMask; r = ( r32 >> RShift ) / 255.f; g = ( g32 >> GShift ) / 255.f; b = ( b32 >> BShift ) / 255.f; a = ( a32 >> AShift ) / 255.f; } // BUGBUG: Chechk should the return be r32 | g32 | b32 | a32 !? uint32 Get32() const { uint32 r32, g32, b32, a32; r32 = GetR8() << RShift; g32 = GetG8() << GShift; b32 = GetB8() << BShift; a32 = GetA8() << AShift; return r32 | g32 | b32 | a32; } //========================================================================= CColorFloat GetMultipliedWithAlpha() const { CColorFloat result( *this ); result.multiplied_with_alpha = true; /*if( this->multiplied_with_alpha ) return result;*/ result.r *= result.a; result.g *= result.a; result.b *= result.a; return result; } /////////////////////////////////////////////////////////////////////////// float r; /*!< The red component of this color */ float g; /*!< The green component of this color */ float b; /*!< The blue component of this color */ float a; /*!< The alpha component of this color */ bool multiplied_with_alpha; private: static bool masks_initialized; public: static uint32 RMask; static uint32 GMask; static uint32 BMask; static uint32 AMask; static uint8 RShift; static uint8 GShift; static uint8 BShift; static uint8 AShift; }; //----------------------------------------------------------------------------- class CColorUint8 { public: typedef unsigned int uint32; typedef unsigned char uint8; static void InitMasks(); CColorUint8( uint8 r = 0, uint8 g = 0, uint8 b = 0, uint8 a = 255 ) : r( r ), g( g ), b( b ), a( a ) { InitMasks(); } CColorUint8( const CColorUint8& other ) : r( other.r ), g( other.g ), b( other.b ), a( other.a ) { InitMasks(); } CColorUint8( const uint32 clor ) { InitMasks(); Set32( clor ); } //------------------------------------------------------------------------- // Operators CColorUint8 operator+(const CColorUint8& other) const { return CColorUint8(r+other.r,g+other.g,b+other.b,a+other.a); } CColorUint8 operator-(const CColorUint8& other) const { return CColorUint8(r-other.r,g-other.g,b-other.b,a-other.a); } CColorUint8 operator*(const CColorUint8& other) const { return CColorUint8(r*other.r,g*other.g,b*other.b,a*other.a); } CColorUint8 operator/(const CColorUint8& other) const { return CColorUint8(r/other.r,g/other.g,b/other.b,a/other.a); } CColorUint8 operator*( float num ) const { return CColorUint8((uint8)( r*num ), (uint8)( g*num ), (uint8)( b*num ), (uint8)( a*num )); } CColorUint8 operator/( float num ) const { return CColorUint8( (uint8)((float)r/num), (uint8)((float)g/num), (uint8)((float)b/num), (uint8)((float)a/num) ); } void operator+=(const CColorUint8& other) { r+=other.r; g+=other.g; b+=other.b; a+=other.a; } void operator-=(const CColorUint8& other) { r-=other.r; g-=other.g; b-=other.b; a-=other.a; } void operator*=( float num) { r = (uint8)( r * num ); g = (uint8)( g * num ); b = (uint8)( b * num ); a = (uint8)( a * num ); } void operator/=(float num) { r = (uint8)( r / num ); g = (uint8)( g / num ); b = (uint8)( b / num ); a = (uint8)( a / num ); } bool operator==(const CColorUint8& other) const { return ( r == other.r && g == other.g && b == other.b && a == other.a ); } bool operator!=(const CColorUint8& other) const { return !operator==(other); } CColorUint8& operator=( const CColorUint8& other ) { r = other.r; g = other.g; b = other.b; a = other.a; return *this; } uint8 operator[]( int i ) const { switch( i ) { case 0: return GetR(); case 1: return GetG(); case 2: return GetB(); case 3: return GetA(); default: return 0; } } uint8& operator[]( int i ) { static uint8 dump_me = 0; switch( i ) { case 0: return r; case 1: return g; case 2: return b; case 3: return a; default: return dump_me; } } /////////////////////////////////////////////////////////////////////////// uint8 GetR() const { return r; } uint8 GetG() const { return g; } uint8 GetB() const { return b; } uint8 GetA() const { return a; } uint8 GetR8() const { return r; } uint8 GetG8() const { return g; } uint8 GetB8() const { return b; } uint8 GetA8() const { return a; } float GetRf() const { return (float)(r / 255.0f); } float GetGf() const { return (float)(g / 255.0f); } float GetBf() const { return (float)(b / 255.0f); } float GetAf() const { return (float)(a / 255.0f); } void SetR( uint8 cr ) { r = cr; } void SetG( uint8 cg ) { g = cg; } void SetB( uint8 cb ) { b = cb; } void SetA( uint8 ca ) { a = ca; } void Set8( uint8 r, uint8 g, uint8 b, uint8 a ) { SetR( r ); SetG( g ); SetB( b ); SetA( a ); } void SetFloat( float r, float g, float b, float a ) { SetR( (uint8)(r * 255.f) ); SetG( (uint8)(g * 255.f) ); SetB( (uint8)(b * 255.f) ); SetA( (uint8)(a * 255.f) ); } void Set32( const uint32& color ) { uint32 r32, g32, b32, a32; r32 = color & RMask; g32 = color & GMask; b32 = color & BMask; a32 = color & AMask; r = ( r32 >> RShift ); g = ( g32 >> GShift ); b = ( b32 >> BShift ); a = ( a32 >> AShift ); } // BUGBUG: Chechk should the return be r32 | g32 | b32 | a32 !? uint32 Get32() const { uint32 r32, g32, b32, a32; r32 = GetR8() << RShift; g32 = GetG8() << GShift; b32 = GetB8() << BShift; a32 = GetA8() << AShift; return r32 | g32 | b32 | a32; } //========================================================================= /////////////////////////////////////////////////////////////////////////// uint8 r; /*!< The red component of this color */ uint8 g; /*!< The green component of this color */ uint8 b; /*!< The blue component of this color */ uint8 a; /*!< The alpha component of this color */ private: static bool masks_initialized; public: static uint32 RMask; static uint32 GMask; static uint32 BMask; static uint32 AMask; static uint8 RShift; static uint8 GShift; static uint8 BShift; static uint8 AShift; }; //----------------------------------------------------------------------------- #if 0 template < class T > class CColor { public: typedef unsigned int uint32; typedef unsigned char uint8; CColor( T r = 0, T g = 0, T b = 0, T a = 255 ) : r( r ), g( g ), b( b ), a( a ), # if SDL_BYTEORDER == SDL_LIL_ENDIAN RMask( 0x000000FF ), GMask( 0x0000FF00 ), BMask( 0x00FF0000 ), AMask( 0xFF000000 ), RShift( 0 ), GShift( 8 ), BShift( 16 ), AShift( 24 ) # else RMask( 0xFF000000 ), GMask( 0x00FF0000 ), BMask( 0x0000FF00 ), AMask( 0x000000FF ), RShift( 24 ), GShift( 16 ), BShift( 8 ), AShift( 0 ) # endif { } CColor( const CColor<T>& other ) : r( other.r ), g( other.g ), b( other.b ), a( other.a ), # if SDL_BYTEORDER == SDL_LIL_ENDIAN RMask( 0x000000FF ), GMask( 0x0000FF00 ), BMask( 0x00FF0000 ), AMask( 0xFF000000 ), RShift( 0 ), GShift( 8 ), BShift( 16 ), AShift( 24 ) # else RMask( 0xFF000000 ), GMask( 0x00FF0000 ), BMask( 0x0000FF00 ), AMask( 0x000000FF ), RShift( 24 ), GShift( 16 ), BShift( 8 ), AShift( 0 ) # endif { } CColor( const T c[4] ) : r( c[0] ), g( c[1] ), b( c[2] ), a( c[3] ), # if SDL_BYTEORDER == SDL_LIL_ENDIAN RMask( 0x000000FF ), GMask( 0x0000FF00 ), BMask( 0x00FF0000 ), AMask( 0xFF000000 ), RShift( 0 ), GShift( 8 ), BShift( 16 ), AShift( 24 ) # else RMask( 0xFF000000 ), GMask( 0x00FF0000 ), BMask( 0x0000FF00 ), AMask( 0x000000FF ), RShift( 24 ), GShift( 16 ), BShift( 8 ), AShift( 0 ) # endif { } CColor( const uint32 clor ) : # if SDL_BYTEORDER == SDL_LIL_ENDIAN RMask( 0x000000FF ), GMask( 0x0000FF00 ), BMask( 0x00FF0000 ), AMask( 0xFF000000 ), RShift( 0 ), GShift( 8 ), BShift( 16 ), AShift( 24 ) # else RMask( 0xFF000000 ), GMask( 0x00FF0000 ), BMask( 0x0000FF00 ), AMask( 0x000000FF ), RShift( 24 ), GShift( 16 ), BShift( 8 ), AShift( 0 ) # endif { Set32( clor ); } //------------------------------------------------------------------------- // Operators CColor<T> operator+(const CColor<T>& other) const { return CColor(r+other.r,g+other.g,b+other.b,a+other.a); } CColor<T> operator-(const CColor<T>& other) const { return CColor(r-other.r,g-other.g,b-other.b,a-other.a); } CColor<T> operator*(const CColor<T>& other) const { return CColor(r*other.r,g*other.g,b*other.b,a*other.a); } CColor<T> operator/(const CColor<T>& other) const { return CColor(r/other.r,g/other.g,b/other.b,a/other.a); } CColor<T> operator*(const T& num) const { return CColor(r*num,g*num,b*num,a*num); } CColor<T> operator/(const T& num) const { return CColor(r/num,g/num,b/num,a/num); } void operator+=(const CColor<T>& other) { r+=other.r; g+=other.g; b+=other.b; a+=other.a; } void operator-=(const CColor<T>& other) { r-=other.r; g-=other.g; b-=other.b; a-=other.a; } void operator*=(const T& num) { r*=num; g*=num; b*=num; a*=num; } void operator/=(const T& num) { r/=num; g/=num; b/=num; a/=num; } bool operator==(const CColor<T>& other) const { if ( r == other.r && g == other.g && b == other.b && a == other.a ) return true; return false; } bool operator!=(const CColor<T>& other) const { return !operator==(other); } CColor< T >& operator=( const CColor<T>& other ) { r = other.r; g = other.g; b = other.b; a = other.a; return *this; } /////////////////////////////////////////////////////////////////////////// #ifndef __APPLE__ T GetR() const { return r; } T GetG() const { return g; } T GetB() const { return b; } T GetA() const { return a; } float GetRf() const { return (float)r / 255.0f; } float GetGf() const { return (float)g / 255.0f; } float GetBf() const { return (float)b / 255.0f; } float GetAf() const { return (float)a / 255.0f; } #else T GetR() const { return b; } T GetG() const { return g; } T GetB() const { return r; } T GetA() const { return a; } float GetRf() const { return (float)b / 255.0f; } float GetGf() const { return (float)g / 255.0f; } float GetBf() const { return (float)r / 255.0f; } float GetAf() const { return (float)a / 255.0f; } #endif void SetR( const T& cr ) { r = cr; } void SetG( const T& cg ) { g = cg; } void SetB( const T& cb ) { b = cb; } void SetA( const T& ca ) { a = ca; } void SetFloat( float r, float g, float b, float a ) { SetR( (T)(r * 255.f) ); SetG( (T)(g * 255.f) ); SetB( (T)(b * 255.f) ); SetA( (T)(a * 255.f) ); } void Set32( const uint32& color ) { uint32 r32, g32, b32, a32; r32 = color & RMask; g32 = color & GMask; b32 = color & BMask; a32 = color & AMask; r = r32 >> RShift; g = g32 >> GShift; b = b32 >> BShift; a = a32 >> AShift; } // BUGBUG: Chechk should the return be r32 | g32 | b32 | a32 !? uint32 Get32() const { uint32 r32, g32, b32, a32; r32 = r << BShift; g32 = g << GShift; b32 = b << RShift; a32 = a << AShift; return r32 | g32 | b32 | a32; } /////////////////////////////////////////////////////////////////////////// T r; /*!< The red component of this color */ T g; /*!< The green component of this color */ T b; /*!< The blue component of this color */ T a; /*!< The alpha component of this color */ private: const uint32 RMask; const uint32 GMask; const uint32 BMask; const uint32 AMask; const uint8 RShift; const uint8 GShift; const uint8 BShift; const uint8 AShift; }; #endif //----------------------------------------------------------------------------- template< typename T > CColorFloat operator * ( T s, const CColorFloat& c) { return CColorFloat(s * c.r, s * c.g, s * c.b, s * c.a ); } } //end o namespace ceng // -------------- types ------------------------------ namespace types { typedef ceng::CStaticArray< unsigned char, 4 > ccolor; typedef ceng::CColorFloat fcolor; } // end of namespace types #endif
dbd0eb3ec30de752ee9c5f1d1c67c322f612055a
667a1619cf903f7274bb8df1e197f11e9d73a30b
/ui/src/monitor/2d/monitorgraphicsview.cpp
8f970547204934f7c021d783601910a28ae59910
[ "Apache-2.0" ]
permissive
bekiS/qlcplus
0a8a205d8910e08da62b513bdd4ee8486c966e0e
cb927a87351782a59d8a46529d1a73f76ecca261
refs/heads/master
2021-01-24T20:25:57.445957
2015-05-03T21:22:16
2015-05-06T20:58:17
15,012,815
1
0
null
null
null
null
UTF-8
C++
false
false
8,676
cpp
monitorgraphicsview.cpp
/* Q Light Controller Plus monitorgraphicsview.cpp Copyright (C) Massimo Callegari 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.txt Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ #include "monitorgraphicsview.h" #include "monitorfixtureitem.h" #include "qlcfixturemode.h" #include "doc.h" MonitorGraphicsView::MonitorGraphicsView(Doc *doc, QWidget *parent) : QGraphicsView(parent) , m_doc(doc) , m_unitValue(1000) , m_gridEnabled(true) , m_bgItem(NULL) { m_scene = new QGraphicsScene(); m_scene->setSceneRect(this->rect()); setScene(m_scene); m_gridSize = QSize(5, 5); updateGrid(); } void MonitorGraphicsView::setGridSize(QSize size) { m_gridSize = size; updateGrid(); QHashIterator <quint32, MonitorFixtureItem*> it(m_fixtures); while (it.hasNext() == true) { it.next(); updateFixture(it.key()); } } void MonitorGraphicsView::setGridMetrics(float value) { m_unitValue = value; QHashIterator <quint32, MonitorFixtureItem*> it(m_fixtures); while (it.hasNext() == true) { it.next(); updateFixture(it.key()); } } quint32 MonitorGraphicsView::selectedFixtureID() { MonitorFixtureItem *item = getSelectedItem(); if (item != NULL) return item->fixtureID(); else return Fixture::invalidId(); } QList<quint32> MonitorGraphicsView::fixturesID() const { return m_fixtures.keys(); } void MonitorGraphicsView::setFixtureGelColor(quint32 id, QColor col) { MonitorFixtureItem *item = m_fixtures[id]; if (item != NULL) item->setGelColor(col); } void MonitorGraphicsView::setFixtureRotation(quint32 id, ushort degrees) { MonitorFixtureItem *item = m_fixtures[id]; if (item != NULL) item->setRotation(degrees); } void MonitorGraphicsView::showFixturesLabels(bool visible) { foreach(MonitorFixtureItem *item, m_fixtures.values()) item->showLabel(visible); } QColor MonitorGraphicsView::fixtureGelColor(quint32 id) { MonitorFixtureItem *item = m_fixtures[id]; if (item == NULL) return QColor(); return item->getColor(); } QPointF MonitorGraphicsView::realPositionToPixels(qreal xpos, qreal ypos) { qreal realX = m_xOffset + ((xpos * m_cellPixels) / m_unitValue); qreal realY = m_yOffset + ((ypos * m_cellPixels) / m_unitValue); return QPointF(realX, realY); } void MonitorGraphicsView::updateFixture(quint32 id) { Fixture *fxi = m_doc->fixture(id); if (fxi == NULL || m_fixtures.contains(id) == false) return; const QLCFixtureMode *mode = fxi->fixtureMode(); int width = 0; int height = 0; if (mode != 0) { width = mode->physical().width(); height = mode->physical().height(); } if (fxi->isDimmer()) { width = fxi->heads() * 200; height = 200; } else { if (width == 0) width = 300; if (height == 0) height = 300; } MonitorFixtureItem *item = m_fixtures[id]; item->setSize(QSize((width * m_cellPixels) / m_unitValue, (height * m_cellPixels) / m_unitValue)); item->setPos(realPositionToPixels(item->realPosition().x(), item->realPosition().y())); } void MonitorGraphicsView::setBackgroundImage(QString filename) { m_backgroundImage = filename; if (m_bgItem != NULL) { m_scene->removeItem(m_bgItem); delete m_bgItem; m_bgItem = NULL; } if (filename.isEmpty() == false) { m_bgPixmap = QPixmap(m_backgroundImage); m_bgItem = new QGraphicsPixmapItem(m_bgPixmap); m_bgItem->setZValue(0); // make sure it goes on the bacground m_scene->addItem(m_bgItem); } updateGrid(); } void MonitorGraphicsView::writeUniverse(int index, const QByteArray &ua) { QHashIterator <quint32, MonitorFixtureItem*> it(m_fixtures); while (it.hasNext() == true) { it.next(); quint32 fid = it.key(); Fixture *fxi = m_doc->fixture(fid); // preliminary validity checks if (fxi == NULL || fxi->universe() != (quint32)index) { continue; } MonitorFixtureItem *item = it.value(); item->updateValues(ua); } } MonitorFixtureItem *MonitorGraphicsView::getSelectedItem() { QHashIterator <quint32, MonitorFixtureItem*> it(m_fixtures); while (it.hasNext() == true) { it.next(); MonitorFixtureItem *item = it.value(); if (item->isSelected() == true) return item; } return NULL; } void MonitorGraphicsView::addFixture(quint32 id, QPointF pos) { if (id == Fixture::invalidId() || m_fixtures.contains(id) == true) return; if (m_doc->fixture(id) == NULL) return; MonitorFixtureItem *item = new MonitorFixtureItem(m_doc, id); item->setZValue(2); item->setRealPosition(pos); m_fixtures[id] = item; m_scene->addItem(item); updateFixture(id); connect(item, SIGNAL(itemDropped(MonitorFixtureItem*)), this, SLOT(slotFixtureMoved(MonitorFixtureItem*))); } bool MonitorGraphicsView::removeFixture(quint32 id) { MonitorFixtureItem *item = NULL; if (id == Fixture::invalidId()) { item = getSelectedItem(); if (item != NULL) id = item->fixtureID(); } else item = m_fixtures[id]; if (item == NULL) return false; m_scene->removeItem(item); m_fixtures.take(id); m_doc->monitorProperties()->removeFixture(id); delete item; return true; } void MonitorGraphicsView::updateGrid() { int itemsCount = m_gridItems.count(); for (int i = 0; i < itemsCount; i++) m_scene->removeItem((QGraphicsItem *)m_gridItems.takeLast()); if (m_gridEnabled == true) { m_xOffset = 0; m_yOffset = 0; int xInc = this->width() / m_gridSize.width(); int yInc = this->height() / m_gridSize.height(); if (yInc < xInc) { m_cellPixels = yInc; m_xOffset = (this->width() - (m_cellPixels * m_gridSize.width())) / 2; } else if (xInc < yInc) { m_cellPixels = xInc; m_yOffset = (this->height() - (m_cellPixels * m_gridSize.height())) / 2; } int xPos = m_xOffset; int yPos = m_yOffset; for (int i = 0; i < m_gridSize.width() + 1; i++) { QGraphicsLineItem *item = m_scene->addLine(xPos, m_yOffset, xPos, this->height() - m_yOffset, QPen( QColor(40, 40, 40, 255) )); item->setZValue(1); xPos += m_cellPixels; m_gridItems.append(item); } for (int i = 0; i < m_gridSize.height() + 1; i++) { QGraphicsLineItem *item = m_scene->addLine(m_xOffset, yPos, this->width() - m_xOffset, yPos, QPen( QColor(40, 40, 40, 255) )); item->setZValue(1); yPos += m_cellPixels; m_gridItems.append(item); } if (m_bgItem != NULL) { m_bgItem->setX(m_xOffset); m_bgItem->setY(m_yOffset); m_bgItem->setPixmap(m_bgPixmap.scaled(xPos - m_cellPixels - m_xOffset, yPos - m_cellPixels - m_yOffset)); } } } void MonitorGraphicsView::resizeEvent(QResizeEvent *event) { QGraphicsView::resizeEvent(event); updateGrid(); QHashIterator <quint32, MonitorFixtureItem*> it(m_fixtures); while (it.hasNext() == true) { it.next(); updateFixture(it.key()); } } void MonitorGraphicsView::mouseReleaseEvent(QMouseEvent *e) { emit viewClicked(e); QGraphicsView::mouseReleaseEvent(e); } void MonitorGraphicsView::slotFixtureMoved(MonitorFixtureItem *item) { quint32 fid = m_fixtures.key(item); // Convert the pixel position of the fixture into // position in millimeters QPointF mmPos; mmPos.setX(((item->x() - m_xOffset) * m_unitValue) / m_cellPixels); mmPos.setY(((item->y() - m_yOffset) * m_unitValue) / m_cellPixels); // update the fixture item's real position item->setRealPosition(mmPos); emit fixtureMoved(fid, mmPos); }
9895c7076a1437f508f90b49b59bf5b8b2a0f56d
d9b5fc0de6efc5331b409740457bdca087a85509
/ior/include/morbid/ior/grammar/generic_tagged_profile.hpp
ecbda7c7b81bfe341319cc863acc265fa2ed942f
[ "BSL-1.0" ]
permissive
expertisesolutions/mORBid
e3ffbd90d6fad4e9f69342dafb2a2eecb3580ffa
3ebc133f9dbe8af1c5cfb39349a0fbf5c125229b
refs/heads/master
2020-05-23T11:19:00.547650
2013-04-17T23:20:17
2013-04-17T23:20:17
19,280,894
1
0
null
null
null
null
UTF-8
C++
false
false
907
hpp
generic_tagged_profile.hpp
/* (c) Copyright 2012 Felipe Magno de Almeida * * Distributed under the Boost Software License, Version 1.0. (See * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) */ #ifndef MORBID_IOR_GRAMMAR_GENERIC_TAGGED_PROFILE_HPP #define MORBID_IOR_GRAMMAR_GENERIC_TAGGED_PROFILE_HPP #include <morbid/giop/grammar.hpp> #include <iostream> namespace morbid { namespace ior { namespace grammar { template <typename Domain, typename Iterator, typename Attr, boost::uint_t<32u>::least Tag> struct generic_tagged_profile : giop::grammar<Domain, Iterator, Attr(giop::endian)> { template <typename Profile> generic_tagged_profile(Profile const& profile) : generic_tagged_profile::base_type(start) { start = giop::ulong_(Tag) & giop::raw_size(giop::ulong_)[profile] ; } giop::rule<Domain, Iterator, Attr(giop::endian)> start; }; } } } #endif
d70de9e002c1d66276422318e5aa0ed442a92d32
416263d4e0a89084e196eec1daa58aaf215e6efd
/Slider.h
0bcbb44c52d6d1fc5f074937fd091a217f7f62be
[]
no_license
TheRealYoussef/SFML-Classes
9e4e8f0577f74752ec3dbb8835b720bb71d72f16
ebf9395c961ebe9eae12b03bab478f093b633307
refs/heads/master
2021-01-10T15:16:03.786275
2015-05-24T10:07:40
2015-05-24T10:07:40
36,149,565
0
0
null
null
null
null
UTF-8
C++
false
false
620
h
Slider.h
#ifndef SLIDER_H #define SLIDER_H #include "Globals.h" class Slider { private: sf::RenderWindow *window; sf::Texture socketTexture, sliderTexture; sf::Sprite socketSprite, sliderSprite; int amount; float ratio; bool pressed; bool active; public: Slider(); void init(const std::string & socketFilePath, const std::string & sliderFilePath, sf::RenderWindow & window, const sf::Vector2f & position = sf::Vector2f(0, 0), unsigned int amount = 0, bool active = true); void setActive(bool active); void setSlider(sf::Event & sfEvent); unsigned int getAmount() const; void display() const; ~Slider(); }; #endif
c0c086d42757c3c3556dc5b84e88bc383acfad82
79f5a0941af83fe5f07219523f612a68ea489b9b
/1005.cpp
70f80194a1aecb21254ad95c1b6cedfd03137363
[]
no_license
luoshaochuan/PAT
d94e9a65c0e5ed34bb220af6fc8f54c4c256201b
7ec3cedfd6938b36446d06550ee67d2d52852ddf
refs/heads/master
2021-01-23T12:32:51.008313
2017-07-10T13:54:31
2017-07-10T13:54:31
93,169,183
0
0
null
null
null
null
UTF-8
C++
false
false
521
cpp
1005.cpp
#include<iostream> #include<string> using namespace std; string map[10] = { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" }; void print_sum(int sum) { if (sum == 0) return; print_sum(sum / 10); cout << map[sum % 10] << " "; } int main() { string input; cin >> input; int sum = 0; for (int i = 0; i<input.length(); ++i) { sum += (input[i] - '0'); } if (sum) { print_sum(sum / 10); cout << map[sum % 10] << endl;; } else { cout << "zero" << endl; } return 0; }
795433782f47b8ebc7f50a49bd07198b1cd078a8
c6f8134410addbbbd94963e9ec5e7e03af0134a1
/DungeonOfMadness/src/Executable/HelpExecutable.h
d22cd42b520fdb569214be1a06646c2d781a174a
[]
no_license
RunningFlip/DungeonOfMadness
37d53efea6e65ff796b4b086fb7ce607b3bf5ec6
aa7a97a0b9c13426d319c2e1b6cc121fe85e3e7e
refs/heads/master
2022-12-13T20:54:25.527860
2020-09-08T17:16:46
2020-09-08T17:16:46
293,872,238
0
0
null
null
null
null
UTF-8
C++
false
false
473
h
HelpExecutable.h
#pragma once #include "Executable.h" #include "../IO/Parser.h" class HelpExecutable : public Executable { private: Parser& parser; public: HelpExecutable(const std::string _keyword, const std::string _description, const StateContainer _stateContainer, Parser& _parser); void OnExecute(const StateMachine& _stateMachine, const std::string _extension) override; const int GetMaxLength(const std::map<std::string, Parser::ParserInfo> _information, const int _size); };
e8cc0482c4c1425e01b85f8f6423ebedf2005a57
e3d5534ebe55eae7a9aaeb58c038bf20b705ce87
/level1.cpp
e6794978fd14cc20405e31c3c9a6d61039c2d81c
[]
no_license
kankaicho/faked-kingdom-rush-
19403daaee3a184ce90140082931fa87e3175f9c
95f217f4b04d0f1202cf3951ea183f25ec313634
refs/heads/master
2023-04-07T13:24:31.200389
2023-03-20T06:28:07
2023-03-20T06:28:07
270,343,839
0
0
null
null
null
null
UTF-8
C++
false
false
10,764
cpp
level1.cpp
#include "level1.h" Level1::Level1(QWidget *parent) : QWidget(parent) { this->setFixedSize(1280, 960); this->setWindowIcon(QPixmap(":/Saved Pictures/AKKO.jpg")); this->setWindowTitle("level1"); initialLocBtnAndTower(); //返回按钮实现 connect(backBtn, &MyPushbutton::clicked, [=](){ qDebug() << "level1 backBtn pressed"; QTimer::singleShot(200, this, [=](){ emit this->level1Back(); }); }); //建造按钮/*test*/ for(int i = 0; i < Level1TowerNumber; i ++) { connect(locBtn[i], &update_build_button::clicked, [=](){ if(locBtn[i]->GetLevelStatus() == 0) { bbb[i]->move(Level1Loc_X[i] - 47, Level1Loc_Y[i] - 70); connect(bbb[i], &buildTowerBtn::clicked, [=](){ if(bbb[i]->getTowerType() == 1 && this->Coin >= archery[i]->buildCost) { locBtn[i]->getTowerArchery(archery[i], bbb[i]->getTowerType()); bbb[i]->move(-200, -200); } else if(bbb[i]->getTowerType() == 2 && this->Coin >= magic[i]->buildCost) { locBtn[i]->getTowerMagic(magic[i], bbb[i]->getTowerType()); bbb[i]->move(-200, -200); } else if(bbb[i]->getTowerType() == 0) { bbb[i]->move(-200, -200); } }); } Coin -= archery[i]->buildCost; Coin -= magic[i]->buildCost; QString str = QString("coin: %1 health: %2").arg(this->Coin).arg(this->health); status->setText(str); }); } /*怪物测试*/ connect(startBtn, &MyPushbutton::clicked, [=](){ timer1->start(10); connect(timer1, &QTimer::timeout, [=](){ showEnemy(); for(int i = 0; i < 10; i ++) { testmonster[i].updatePosition(); if(testmonster[i].enterDirection && !testmonster[i].causeDamage) { this->health -= testmonster[i].enterDamage; showEndScene(); testmonster[i].causeDamage = true; } } for(int i = 0; i < 5 ; i ++) { testmonster2[i].updatePosition(); if(testmonster2[i].enterDirection && !testmonster2[i].causeDamage) { this->health -= testmonster2[i].enterDamage; showEndScene(); testmonster2[i].causeDamage = true; } } //攻击判断 for(int j = 0; j < Level1TowerNumber; j ++) { archery[j]->temInterval += 5; if(archery[j]->temInterval >= archery[j]->attackSpeed) { for(int i = 0; i < 10; i ++) { if(archery[j]->judgeRect.intersects(testmonster[i].m_Rect) && testmonster[i].isAlive) { archery[j]->shoot(testmonster[i].mX, testmonster[i].mY); qDebug() << "Attack!!!"; testmonster[i].HP -= archery[j]->perDamage; if(testmonster[i].HP <= 0) { this->Coin += testmonster[i].deathCoin; testmonster[i].isAlive = false; testmonster[i].isFree = true; enemyNumber --; showEndScene(); } archery[j]->temInterval = 0; break; } } } } for(int j = 0; j < Level1TowerNumber; j ++) { magic[j]->temInterval += 5; if(magic[j]->temInterval >= magic[j]->attackSpeed) { for(int i = 0; i < 10; i ++) { if(testmonster[j].m_Rect.intersects(magic[j]->judgeRect) && testmonster[i].isAlive) { magic[j]->shoot(testmonster[i].mX, testmonster[i].mY); testmonster[i].HP -= archery[j]->perDamage; if(testmonster[i].HP <= 0) { this->Coin += testmonster[i].deathCoin; testmonster[i].isAlive = false; testmonster[i].isFree = true; enemyNumber --; showEndScene(); } break; } } magic[j]->temInterval = 0; } } QString str = QString("coin: %1 health: %2").arg(this->Coin).arg(this->health); status->setText(str); update(); }); }); } void Level1::paintEvent(QPaintEvent *) { QPainter painter(this); QPixmap pix; pix.load(":/Saved Pictures/level1Scene.png"); painter.drawPixmap(0,0,this->width(),this->height(),pix); for(int i = 0; i < Level1TowerNumber; i ++) { painter.drawRect(archery[i]->judgeRect); painter.drawRect(magic[i]->judgeRect); } for(int i = 0; i < 10; i ++) { painter.drawRect(testmonster[i].m_Rect); } for(int i = 0; i < Level1TowerNumber; i ++) { if(archery[i]->onAttackStatus) { archery[i]->paintBullet(painter); archery[i]->onAttackStatus = false; } if(magic[i]->onAttackStatus) { magic[i]->paintBullet(painter); magic[i]->onAttackStatus = false; } if(magic[i]->built) painter.drawPixmap(Level1Loc_X[i], Level1Loc_Y[i], magic[i]->towerImg.width(), magic[i]->towerImg.height(), magic[i]->towerImg); if(archery[i]->built) painter.drawPixmap(Level1Loc_X[i], Level1Loc_Y[i], archery[i]->towerImg.width(), archery[i]->towerImg.height(), archery[i]->towerImg); } for(int i = 0; i < 10; i ++) { if(testmonster[i].isFree == false) painter.drawPixmap(testmonster[i].mX, testmonster[i].mY,testmonster[i].m_pixmap.width(),testmonster[i].m_pixmap.height(), testmonster[i].m_pixmap); } for(int i = 0; i < 5; i ++) { if(testmonster2[i].isFree == false) painter.drawPixmap(testmonster2[i].mX, testmonster2[i].mY,testmonster2[i].m_pixmap.width(),testmonster2[i].m_pixmap.height(), testmonster2[i].m_pixmap); } // for(int i = 0; i < currentEnemyNumber; i ++) // { // if(finalEnemy[i]->isFree == false) // painter.drawPixmap(finalEnemy[i]->mX, finalEnemy[i]->mY, finalEnemy[i]->m_pixmap.width(),finalEnemy[i]->m_pixmap.height(),finalEnemy[i]->m_pixmap); // } } int Level1::getMonsterType() { int type = rand()%3; return type; } void Level1::showEnemy() { currentTime ++; if(currentTime == timeInterval) { currentTime = 0; for(int i = 0; i < 10; i ++) { if(testmonster[i].isFree && testmonster[i].isAlive && (!testmonster[i].enterDirection)) { testmonster[i].isFree = false; testmonster[i].mX = Path1X[0]; testmonster[i].mY = Path1Y[0]; break; } } for(int i = 0; i < 5 ; i ++) { if(testmonster2[i].isFree && testmonster2[i].isAlive && (!testmonster2[i].enterDirection)) { testmonster2[i].isFree = false; testmonster2[i].mX = Path2X[0]; testmonster2[i].mY = Path2Y[0]; break; } } } } void Level1::showEndScene() { QLabel *winLabel = new QLabel; QPixmap temPix; temPix.load(":/Saved Pictures/KAR.jpg"); winLabel->setGeometry(0, 0, temPix.width(), temPix.height()); winLabel->setPixmap(temPix); winLabel->setParent(this); winLabel->move((this->width() - temPix.width()) * 0.5, -temPix.height()); if(enemyNumber <= 0 || health <= 6) { QPropertyAnimation *animation = new QPropertyAnimation(winLabel, "geometry"); animation->setDuration(1000); animation->setStartValue(QRect(winLabel->x(), winLabel->y(), winLabel->width(), winLabel->height())); animation->setEndValue(QRect(winLabel->x(), winLabel->y() + winLabel->height() * 2, winLabel->width(), winLabel->height())); animation->setEasingCurve(QEasingCurve::OutBounce); animation->start(); } } void Level1::initialLocBtnAndTower() { backBtn = new MyPushbutton(":/Saved Pictures/quitBtn.png",":/Saved Pictures/quitBtn2.png"); backBtn->setParent(this); backBtn->move(this->width()-backBtn->width(),this->height()-backBtn->height()); startBtn = new MyPushbutton(":/Saved Pictures/startBtn.png"); startBtn->setParent(this); startBtn->move(0, 0); timer1 = new QTimer(this); for(int i = 0; i < Level1TowerNumber; i ++) { magic[i] = new magicTower(Level1Loc_X[i], Level1Loc_Y[i]); archery[i] = new archeryTower(Level1Loc_X[i], Level1Loc_Y[i]); locBtn[i] = new update_build_button(); locBtn[i]->setParent(this); locBtn[i]->move(Level1Loc_X[i], Level1Loc_Y[i]); locBtn[i]->setLoc(Level1Loc_X[i], Level1Loc_Y[i]); bbb[i] = new buildTowerBtn; bbb[i]->setParent(this); bbb[i]->move(-200, -200); } //设置HP,Coin状态显示信息 status->setParent(this); QFont statusFont; statusFont.setFamily("华文新魏"); statusFont.setPointSize(14); status->setFont(statusFont); QString str = QString("coin: %1 health: %1").arg(Coin).arg(health); status->setText(str); status->setGeometry(300, 100, 240, 80); }
d82984da4998da148041bba0db8886d2f91fb8e2
2dd3cb3544f1e1fd307c12b6f476bd87668b4776
/amplitude_calculations/src/main.cpp
b20fdadcf68af2b5da8c5df5b4564746c1607508
[]
no_license
miklbjorn/KS-CP-violation-in-GGSZ
f38c3c7f8846c6b813b4427cbbefc25d9a569ffd
b2413ddbc152786ef4515233ddd288c120083b64
refs/heads/master
2020-05-16T05:42:25.932930
2019-04-22T17:46:37
2019-04-22T17:46:37
182,823,258
0
0
null
null
null
null
UTF-8
C++
false
false
3,819
cpp
main.cpp
#include <iostream> #include "DtoKpipiAmplitude.h" #include "EvtGenAmplitude.h" #include "OutputMaker.h" #include "tclap/CmdLine.h" int main(int argc , char* argv[] ){ int seed, numpoints; double r_value; std::string kaon_type, output_dir, model; ////////////////////////////////////////////////////////////// // ---- PROCESS ARGUMENTS ------------------------------------ ////////////////////////////////////////////////////////////// try { // The command line parsing TCLAP::CmdLine cmd("Enjoy your amplitudes!", ' ', "0.1"); TCLAP::ValueArg<std::string> output_dir_arg( "o", // short name "output_dir", // long name "Directory in which to put output. (Default './output').", // description false, // is it required (no there is a default) "./output", // default "string"); cmd.add(output_dir_arg); TCLAP::ValueArg<int> numpoints_arg( "n", // short name "num_points", // long name "Number of points along each of the s(K, h+) and s(K, pi-) axes for which amp should be calculated. (default: 500).", // description false, // is it required (no there is a default) 500, // default "int"); cmd.add(numpoints_arg); TCLAP::ValueArg<int> seed_arg( "s", // short name "seed", // long name "Seed used in KL amplitude variation. 0 (default) gives non-random r and delta's).", // description false, // is it required (no there is a default) 0, // default "int"); cmd.add(seed_arg); TCLAP::ValueArg<double> r_val_arg( "r", // short name "r_value", // long name "r value used when transforming KS to KL amplitude. (default = 0.236*0.236 = tan^2 \\theta_cabibbo).", // description false, // is it required (no there is a default) 0.236*0.236, // default "double"); cmd.add(r_val_arg); TCLAP::ValueArg<std::string> kaon_type_arg( "k", // short name "kaon_type", // long name "Specify wether you want a 'KS' (default) or 'KL' amplitude.", // description false, // is it required (no there is a default) "KS", // default "string={KS/KL}"); cmd.add(kaon_type_arg); TCLAP::ValueArg<std::string> model_arg( "m", "model", "which model to use, from EvtGen (default), Belle2018, Belle2010, Belle2006, BaBar2005, Cleo2002", false, "EvtGen", "string={EvtGen (default), Belle2018, Belle2010, Belle2006, BaBar2005, Cleo2002}"); cmd.add(model_arg); cmd.parse(argc, argv); output_dir = output_dir_arg.getValue(); numpoints = numpoints_arg.getValue(); seed = seed_arg.getValue(); kaon_type = kaon_type_arg.getValue(); model = model_arg.getValue(); r_value = r_val_arg.getValue(); } catch (TCLAP::ArgException &e){ std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl; } ////////////////////////////////////////////////////////////// // ---- Calculate amplitude ---------------------------------- ////////////////////////////////////////////////////////////// std::cout << "Running KS-amplitude calculator\n"; DtoKpipiAmplitude* amp; if (model=="EvtGen"){ amp = new EvtGenAmplitude(kaon_type, seed, r_value); } else { std::cout << "Unknown model: " << model << "! Exiting!\n"; exit(-1); } OutputMaker out = OutputMaker(); out.write_output(*amp, output_dir, numpoints); delete amp; return 0; }
cdd68b708401a062bd1a96397f83dd501c4966b1
b5f7b52677988562473629862e51b94b43eff90c
/tp5/sources/Joueur.h
83dc4ee5cc55f3ffa8053f4d42aba10c0cc575ce
[]
no_license
PaulClas/Log1000
866efc33ce1de23d4c7a4ce270415921542e70cd
8466fad9bb3a21f235bf38a51b69816717f393f9
refs/heads/master
2020-07-28T09:30:05.489731
2019-09-18T21:42:11
2019-09-18T21:42:11
209,380,711
0
0
null
null
null
null
WINDOWS-1252
C++
false
false
968
h
Joueur.h
#ifndef Joueur_H #define Joueur_H #include <string> #include "Equipe.h" using namespace std; // Cette classe represente un Joueur class Joueur { public: // Constructeurs Joueur () {} Joueur(string, string, int, string, string); // Setters void setNom(string nom); void setPrenom(string prenom); void setAge(int age); // Getters string getNom(); string getPrenom(); int getAge(); string getNomEquipe(); string getPaysEquipe(); // Associer une equipe à un joeur void associerEquipe(Equipe*); // Enregistrer le Joueur void saveJoueur(string); // Afficher le Joueur void afficher(); // Chercher un Joueur dans une base de donnees par titre Joueur* trouverJoueur(string, string, string); private: // Informations sur le joueur string nom; string prenom; int age; Equipe* equipe; }; #endif
82ce99f5276b97cdf44a6663d9fa369d10b0517f
b0387e1717bef2ccd39371791191b35f99b9b6bf
/TFInstancing/src/TFInstancingApp.cpp
f983146d3d193691d29f3ba8c12926625f061cd1
[]
no_license
rystylee/Cinder-Experiments
1744049e50b21f7c211b51c495e50ea7eb4a9ee9
ff8ce68c092874183d4f5faa1f45c3e62ac7f6ea
refs/heads/master
2018-12-12T06:09:46.225774
2017-11-04T15:11:11
2018-09-13T04:45:34
108,731,736
4
1
null
null
null
null
UTF-8
C++
false
false
2,167
cpp
TFInstancingApp.cpp
#include "cinder/app/App.h" #include "cinder/app/RendererGl.h" #include "cinder/gl/gl.h" #include "cinder/CameraUi.h" #include "cinder/params/Params.h" #include "TFInstancing.h" using namespace ci; using namespace ci::app; using namespace std; class TFInstancingApp : public App { public: void setup() override; void update() override; void draw() override; void setupCamera(); void setupParams(); CameraPersp mCam; CameraUi mCamUi; params::InterfaceGlRef mParams; float mFrameRate; float mAccelStep; ColorA mStartColor; ColorA mEndColor; TFInstancing mInstancing; }; void TFInstancingApp::setup() { setupCamera(); setupParams(); mInstancing.setup(); } void TFInstancingApp::update() { mFrameRate = getAverageFps(); mInstancing.setAccelStep(mAccelStep); mInstancing.setStartColor(mStartColor); mInstancing.setEndColor(mEndColor); mInstancing.update(); } void TFInstancingApp::draw() { gl::clear(); gl::disableAlphaBlending(); gl::setMatrices(mCam); gl::viewport(getWindowSize()); gl::enableDepthRead(); gl::enableDepthWrite(); mInstancing.draw(); mParams->draw(); } void TFInstancingApp::setupCamera() { const vec2 windowSize = toPixels(getWindowSize()); mCam = CameraPersp(windowSize.x, windowSize.y, 60.0f, 0.01f, 3000.0f); mCam.setAspectRatio(getWindowAspectRatio()); mCam.lookAt(vec3(0, 0, 600.0f), vec3(0)); mCamUi = CameraUi(&mCam, getWindow(), -1); } void TFInstancingApp::setupParams() { mAccelStep = 0.8; mStartColor = ColorA(1.0, 0.4, 1.0, 1.0); mEndColor = ColorA(0.0, 0.8, 1.0, 1.0); mParams = params::InterfaceGl::create("Params", ivec2(200, 200)); mParams->addParam("fps", &mFrameRate, "", true); mParams->addParam("uStartColor", &mStartColor, "", false); mParams->addParam("uEndColor", &mEndColor, "", false); mParams->addParam("uAccelStep", &mAccelStep).step(0.01f).min(0.001f).max(1.5f); } auto options = RendererGl::Options().version(4, 1); CINDER_APP(TFInstancingApp, RendererGl(options), [](App::Settings* settings) { settings->setWindowSize(1024, 768); });
edcc6a8108aadcaa7936940d469bad0f9a78fc79
3e74450bf09cbbe7018c9465bcca8d457e91e1b2
/proyectoTwo/testLib/robologs.h
1c2489f4ccbf6961b84b554fff94bdd64164fc5b
[]
no_license
rajila/raspberry-iot
41e85e5135b6cd81f8623d696bfbcd068fca5893
76ba5de4a1b1871b2b524c49f8327d5bd34dbcdf
refs/heads/master
2020-03-30T23:46:46.298278
2019-04-21T13:56:40
2019-04-21T13:56:40
151,713,020
0
0
null
null
null
null
UTF-8
C++
false
false
1,563
h
robologs.h
#ifndef ROBOLOGS_H #define ROBOLOGS_H #include <Arduino.h> //Permite utilizar los comandos de Arduino #include <stdio.h> #define _WATERLEVEL_PIN A0 #define _FORSESENSITIVER_PIN A0 #define _PINLED 2 #define _TIMESLEEP 250 class robologs //Definicion de la clase { public: //Constructor de la clase robologs(); void blinking(int pin, int time); private: //Nada que declarar }; class SensorMeasurement { private: char id[100]; char obProp[100]; double out; public: char* getID(); char* getObserverProperty(); double getSensorOutput(); void setID(char value[]); void setObserverProperty(char value[]); void setSensorOutput(double value); SensorMeasurement(char id[], char observationProperty[], double sensorOutput); }; class ISensor { public: virtual SensorMeasurement monitor() = 0; }; class Sensor : public ISensor { private: char id[100]; char observationProperty[100]; public: Sensor(char id[], char observationProperty[]); char* getID(); char* getObservationProperty(); void setID(char value[]); void setObservationProperty(char value[]); }; class WaterLevelSensor : public Sensor { private: double _valueSensor; public: WaterLevelSensor(char id[], int analPort); SensorMeasurement monitor(); }; class ForceSensitiveResistorSensor : public Sensor { private: double _valueSensor; public: ForceSensitiveResistorSensor(char id[], int analPort); SensorMeasurement monitor(); }; #endif
7f1ab1d7dc3269aa3f8754b9f5d9db1402a8f53c
69ce0ea02982df693bb9e7d0f5969bafe1c2c4d5
/psp/ActiveList/ActiveList.h
98c98f4e75de567aba104f7649efe6c41b10998f
[]
no_license
leonovvalentin/psp
c78a8e2e2d4bc01cd9466b1ac066ba7aa853eea9
cf34bdaba21f843dc9debb0689eb7c77fcad45b3
refs/heads/master
2021-01-18T14:11:36.937748
2015-03-31T14:27:31
2015-03-31T14:27:31
17,769,667
0
0
null
null
null
null
UTF-8
C++
false
false
2,138
h
ActiveList.h
// // ActiveList.h // psp2 // // Created by Valentin on 10/8/13. // Copyright (c) 2013 Valentin. All rights reserved. // #ifndef __psp2__ActiveList__ #define __psp2__ActiveList__ #include "Job.h" #include "utils.h" #include <iostream> #include <vector> using namespace std; class ActiveList { private: vector<Job *> _jobList; /** Total duration of all jobs. */ int _duration; #pragma mark - init public: /** Constructor. Create activeList with empty jobList. */ ActiveList(); /** Constructor. Create random activeList. @param source Source of jobs list. @param jobsCapacity Expected count of jobs. */ ActiveList(Job *source, unsigned long jobsCapacity); /** Constructor. Create activeList via jobList. @param jobList List of jobs. */ ActiveList(const vector<Job *> *jobList); #pragma mark - interface public: /** Swap 2 random jobs, and move some job to another position. Not more times than specified number of times for each operation. @return ActiveList, created from current ActiveList by swapping and moving random jobs. */ PActiveList swapAndMove(const int swapPermissibleTimes, const int movePermissibleTimes) const; /** @param dispersion Indicates width (from the current position in specified activeList, current position ± dispertion) in which same element will be searched. @return Hamming distance between current and specified activLists. */ int hammingDistance(const ActiveList *activeList, const int dispersion) const; #pragma mark - out public: friend ostream & operator<<(ostream &os, const ActiveList &activeList); string stringJobList() const; #pragma mark - getters public: const vector<Job *> * jobList() const; /** Duration. @return Total duration of all jobs. */ int duration(); unsigned long size() const; Job * operator[](unsigned long index) const; Job * firstJob() const; Job * lastJob() const; }; #endif /* defined(__psp2__ActiveList__) */
bd688b9146411224d31039d45e313c6ccbc39a3a
b0af22c12f1500936267c0f4ebd9c3a6a19b6de8
/assemBase.h
e8073569953d6426c8b938a870ad1ccd32e74571
[]
no_license
WJM96/ASMInterp
c8a543ace2dea518c53d38fc6f572f12f1a60e01
1be3d79b4f75d3088814663f791878fcd562fa52
refs/heads/master
2020-05-17T11:13:17.949212
2014-06-14T22:46:17
2014-06-14T22:46:17
20,838,861
1
0
null
null
null
null
UTF-8
C++
false
false
3,711
h
assemBase.h
/**************************************/ // Wesley McClintock // Assembler & interpreter // Desc: This was a school project. // Some of the helper functions, like convertToNumber were // provided by the teacher. I either didn't modify them, // or only made minor changes. // // I'm aware that having global variables and a slew of functions may not be // the best structure, or take advantage of C++. /**************************************/ #ifndef ASSEMPROJ_H #define ASSEMPROJ_H #include <iostream> #include <fstream> #include <iomanip> #include <string> #include "LabelHandler.h" using namespace std; const int MAX = 500; //size of simulators memory const int COL = 7; //number of columns for output typedef short int Memory; //creates a new type so we are not using short int over and over. If the program changes so memory needs to be larger only the typedef needs to change //I changed it to unsigned because all of our jumps are unsigned //Opcode constants //registers const int REG_AX = 0; const int REG_BX = 1; const int REG_CX = 2; const int REG_DX = 3; //operand codes, unshifted because their position may vary const int CONSTANT = 7; const int REF_BX = 4; const int REF_OFFSET = 5; const int REF_CONST = 6; //special codes const int JUMP = 1 << 3; const int NOT = 2 << 3; const int FUN = 0; const int RFN = 1; const int JE = 0; const int JNE = 1; const int JB = 2; const int JBE = 3; const int JA = 4; const int JAE = 5; const int JMP = 6; //instruction codes, shifted because their position is fixed const int HALT = 5; const int SPECIAL = 0; const int OR = (1 << 5); const int AND = (2 << 5); const int CMP = (3 << 5); const int SUB = (4 << 5); const int ADD = (5 << 5); const int MOV_TO_REG = (6 << 5); const int MOV_TO_MEM = (7 << 5); //I/O codes const int GET = 6; const int PUT = 7; LabelHandler labelHandler; struct Registers { Memory AX; Memory BX; Memory CX; Memory DX; Memory instrAddr; //what line of code when the program in running Memory flag; //compare flag Memory SP; } regis; // a global variable containing the current registers. int address; //current address while being created extern Memory memory[MAX] = {0}; //all of memory, used and modified by most functions //prototypes void printMemoryDump(); //prints memeory with integers commands void convertToNumber(string line, unsigned int &start, int &value); //takes in a string and changes it to number void fillMemory(); //prepares to move the file into memory void changeToLowerCase(string &line); //makes sure everything is in lower case bool convertCommand(ifstream *fin); //converts one line to machine code in memory bool compFUN(ifstream *fin); Memory getOperand(string operand); //returns the operand, registers or constants etc Memory getInstruction(string instruction); //returns the instruction code. ERROR if not an instruction bool compInstruction(string operand1, string operand2, int i); //compiles i, op1, and op2 into a single Memory unit. Advances memory bool extractConstToMem(string operand); //extracts the first constant in a string to memory, returns false if no constant is found Memory* getMemFromOp(Memory operand); //returns a pointer to a register or memory location based off of operand void getOps(Memory full, Memory &op1, Memory &op2); //isolates the operands. The oposite of compIRM bool doCommand(Memory op1, Memory op2, Memory operation); //moves something to a register bool callFunc(); bool returnFunc(); void get(); //gets a number and stores it in ax void put(); //prints the number in ax void runProgram(); #endif
31671fa8a8df00b2e394d2e9bc3395c0e8df590e
967e3d42f1bca15baf82ae7351a73b776e2e4310
/UVAONLINEJUDGE/10991.cpp
90a6b9bc9b967d23690f40146b3e873c76ed1952
[]
no_license
kangli-bionic/competitive_prog
857d735b9ab909063d643a9c30dd39b297c4fe5a
3b5fd9b395ea7355e8d52f8d03dcf375ee567549
refs/heads/master
2023-03-07T00:01:40.993832
2021-02-21T15:29:22
2021-02-21T15:29:22
null
0
0
null
null
null
null
UTF-8
C++
false
false
655
cpp
10991.cpp
#include <bits/stdc++.h> #define ff first #define ss second #define mp make_pair using namespace std; typedef long long ll; const double PI = acos(-1); pair<double,double> p[4]; int main(){ int t; double r1,r2,r3,A,B,C; scanf("%d", &t); while(t--){ scanf("%lf%lf%lf", &r1, &r2, &r3); A = r1+r2; B = r2+r3; C = r1+r3; double S = (A+B+C)/2; double area = sqrt(S*(S-A)*(S-B)*(S-C)); double ang1 = acos(((B*B - A*A - C*C)/(-2*A*C))); double ang2 = acos(((C*C - A*A - B*B)/(-2*A*B))); double ang3 = acos(((A*A - B*B - C*C)/(-2*B*C))); printf("%.15lf\n", area - r1*r1*ang1/2 - r2*r2*ang2/2 - r3*r3*ang3/2); } return 0; }
a66845c688e9cefd0dbf334f7642651881f5383a
1db7b0d1abbd860e1ef081e61b5f72dd8079449f
/src/server/gaga_room.cpp
e662d46d8c5433fdef38d0e907b11d56610f7186
[]
no_license
denkisdeng/gaga
4386348acd85add6d350deab4827799df494503a
1177fea7ccadb2e5fb5b7f67ad8143b28623fac8
refs/heads/master
2020-03-23T20:01:28.426889
2017-03-01T01:40:27
2017-03-01T01:40:27
null
0
0
null
null
null
null
UTF-8
C++
false
false
7,538
cpp
gaga_room.cpp
#include "gaga_room.h" #include "gaga_server.h" #include "gaga_client_agent.h" #include "gaga_timer.h" int Room::Join(const RakNet::RakNetGUID& guid, Player& playerInfo) { if (m_playerList.size() > m_maxPlayer) { return -1; } Player *player = nullptr; ClientAgent *clientAgent = GagaServer::GetInstance()->FindClientAgent(guid); if (!clientAgent) { return -2; } std::string userid = clientAgent->get_userid(); uint32_t playerid = GetPlayerid(userid); player = FindPlayer(playerid); if (nullptr == player) { player = GagaServer::GetInstance()->AcquirePlayer(); player->Reset(); player->set_userid(clientAgent->get_userid()); playerid = AssignPlayerid(); player->set_playerid(playerid); player->set_car_name(playerInfo.get_car_name()); player->set_is_free(playerInfo.get_is_free()); player->set_is_owned(playerInfo.get_is_owned()); player->set_stage(playerInfo.get_stage()); player->set_decal(playerInfo.get_decal()); player->set_decal_color(playerInfo.get_decal_color()); player->set_driver_name(playerInfo.get_driver_name()); player->set_driver_type(playerInfo.get_driver_type()); player->set_accel(playerInfo.get_accel()); player->set_speed(playerInfo.get_speed()); player->set_handling(playerInfo.get_handling()); player->set_tough(playerInfo.get_tough()); player->set_is_gold(playerInfo.get_is_gold()); player->set_min_stage(playerInfo.get_min_stage()); player->set_max_stage(playerInfo.get_max_stage()); player->set_paint_color(playerInfo.get_paint_color()); m_playerList.insert(std::make_pair(playerid, player)); } // binding client agent to player with guid if (player) { player->set_userGuid(guid); } else { return -3; } PlayerListNtf(); if (m_playerList.size() == m_maxPlayer) { TimerManager::GetInstance()->AddTimeoutTimer("start-game", 64, [this]() { this->EnterGameNtf(); }); } return 0; } uint32_t Room::GetPlayerid(const std::string userid) { proto::PlayerList_ntf playerList_ntf; for (auto it : m_playerList) { Player *player = it.second; if (player && player->get_userid() == userid) { return player->get_playerid(); } } return 0; } uint32_t Room::AssignPlayerid() { return m_playerList.size() + 1; } int Room::GetReady(const std::string& userid) { auto playerid = GetPlayerid(userid); Player *player = FindPlayer(playerid); if (player) { player->GetReady(); return 0; } return -1; } void Room::Leave(const RakNet::RakNetGUID& guid) { } int Room::StartGame() { Reset(); m_nextLogicFrame = new LogicFrame(); m_nextLogicFrame->frameNo = m_frameNo; int ret = TimerManager::GetInstance()->AddTickTimer("ROOM-" + std::to_string(m_roomNo), 6, [this]() {this->Tick(); }); if (ret != 0) { return -1; } return 0; } void Room::StopGame() { TimerManager::GetInstance()->RemoveTimer("ROOM-" + std::to_string(m_roomNo)); } void Room::Tick() { ++m_frameNo; if (m_frameNo > 64 * 60 * 15) return; LogicFrameNtf(); m_logicFrameList.push_back(m_nextLogicFrame); m_nextLogicFrame = new LogicFrame(); m_nextLogicFrame->frameNo = m_frameNo; //gaga_printf("Room Tick ..."); } void Room::Reset() { m_frameNo = 0; for (auto it : m_playerList) { Player *player = it.second; player->Reset(); } } void Room::SendAllPlayer(const RakNet::MessageID msgId, const ::google::protobuf::MessageLite& msg) { for (auto it : m_playerList) { ClientAgent *client = FindClientAgent(it.second->get_playerid()); if (client) { client->SendMsg(msgId, msg); } } } void Room::SendPlayer(const uint32_t playerid, RakNet::MessageID msgId, const ::google::protobuf::MessageLite& msg) { ClientAgent *client = FindClientAgent(playerid); if (client) { client->SendMsg(msgId, msg); } } Player* Room::FindPlayer(const uint32_t playerid) { auto it = m_playerList.find(playerid); if (it != m_playerList.end()) { return it->second; } return nullptr; } ClientAgent* Room::FindClientAgent(const uint32_t playerid) { Player *player = FindPlayer(playerid); if (player) { return GagaServer::GetInstance()->FindClientAgent(player->get_userGuid()); } return nullptr; } bool Room::IsFull() { return m_playerList.size() >= m_maxPlayer; } void Room::PlayerListNtf() { proto::PlayerList_ntf playerList_ntf; for (auto it : m_playerList) { Player *player = it.second; auto player_t = playerList_ntf.add_player_list(); player_t->set_playerid(player->get_playerid()); player_t->set_car_name(player->get_car_name()); player_t->set_is_free(player->get_is_free()); player_t->set_is_owned(player->get_is_owned()); player_t->set_stage(player->get_stage()); player_t->set_decal(player->get_decal()); player_t->set_decal_color(player->get_decal_color()); player_t->set_driver_name(player->get_driver_name()); player_t->set_driver_type(player->get_driver_type()); player_t->set_accel(player->get_accel()); player_t->set_speed(player->get_speed()); player_t->set_handling(player->get_handling()); player_t->set_tough(player->get_tough()); player_t->set_is_gold(player->get_is_gold()); player_t->set_min_stage(player->get_min_stage()); player_t->set_max_stage(player->get_max_stage()); player_t->set_paint_color(player->get_paint_color()); } SendAllPlayer(proto::MSG_PLAYER_LIST_NTF, playerList_ntf); } void Room::StartRaceNtf() { proto::StartRace_ntf startRace_ntf; SendAllPlayer(proto::MSG_START_RACE_NTF, startRace_ntf); } void Room::EnterGameNtf() { proto::EnterGame_ntf enterGame_ntf; for (auto it : m_playerList) { Player *player = it.second; auto player_t = enterGame_ntf.add_player_list(); player_t->set_playerid(player->get_playerid()); } SendAllPlayer(proto::MSG_ENTER_GAME_NTF, enterGame_ntf); } void Room::EnterGameOk(uint32_t playerid) { auto player = FindPlayer(playerid); if (player) { player->set_state(kPlayerEnterRoomOk); } int enterGameOkNum = 0; for (auto it : m_playerList) { Player *player = it.second; if (player->get_state() == kPlayerEnterRoomOk) { enterGameOkNum++; } } if (enterGameOkNum == m_maxPlayer) { StartRaceNtf(); TimerManager::GetInstance()->AddTimeoutTimer("start-game", 64, [this]() { this->StartGame(); }); } } void Room::SubmitCommand(const GameCommand &command) { GameCommand *newCommand = new GameCommand(); newCommand->commandType = command.commandType; newCommand->playerid = command.playerid; newCommand->intVar1 = command.intVar1; newCommand->intVar2 = command.intVar2; newCommand->intVar3 = command.intVar3; newCommand->strVar1 = command.strVar1; newCommand->strVar2 = command.strVar2; newCommand->strVar3 = command.strVar3; m_nextLogicFrame->commandList.push_back(newCommand); } void Room::LogicFrameNtf() { proto::LogicFrame_ntf logicFrame_ntf; logicFrame_ntf.set_frame_no(m_nextLogicFrame->frameNo); for (auto command : m_nextLogicFrame->commandList) { auto cmd = logicFrame_ntf.add_command_list(); cmd->set_command_type(command->commandType); cmd->set_playerid(command->playerid); cmd->set_intvar1(command->intVar1); cmd->set_intvar2(command->intVar2); cmd->set_intvar3(command->intVar3); cmd->set_strvar1(command->strVar1); cmd->set_strvar2(command->strVar2); cmd->set_strvar3(command->strVar3); } SendAllPlayer(proto::MSG_LOGIC_FRAME_NTF, logicFrame_ntf); } void Room::Distroy() { for (auto logicFrame : m_logicFrameList) { for (auto command : logicFrame->commandList) { delete command; } logicFrame->commandList.clear(); delete logicFrame; } for (auto command : m_nextLogicFrame->commandList) { delete command; } delete m_nextLogicFrame; }
52a30622366d28bfbd47ce2c89a94a9315861315
0ca1bb89e877b3c9d3ae6f5baceb7ecb8e0120d4
/Plugins/BugReport/BugReportPlugin.cpp
b96c4221e79e1f8a54546b4b82d6166cb7726530
[]
no_license
MazingR/stormancer-sdk-cpp
10451899e563d76407c6995306abaeaffc70752a
e90ab82d50c4e829eac2bf98326fe6efabea8d5f
refs/heads/master
2020-03-20T21:35:33.262788
2018-06-15T09:16:07
2018-06-15T09:16:07
null
0
0
null
null
null
null
UTF-8
C++
false
false
458
cpp
BugReportPlugin.cpp
#include "stormancer/headers.h" #include "BugReportPlugin.h" #include "BugReportService.h" namespace Stormancer { void BugReportPlugin::sceneCreated(Scene* scene) { if (scene) { auto name = scene->getHostMetadata("stormancer.bugReporting"); if (name.length() > 0) { auto service = std::make_shared<BugReportService>(scene->shared_from_this()); scene->dependencyResolver()->registerDependency<BugReportService>(service); } } } }
dc177570dbaf005c4b0160cb33910873beb5a22c
e459d2c25a612f78529edcc66c8e110bf002e996
/galaxrendering/renderingtest/src/Rendering.h
c17e4237c4e495b32c539eae0aa39fc6c1d970df
[]
no_license
srpeiter/ICCP
3ae94371a90681d569adf7f92bceb66c144d1427
e53bbeee6c9498cad09aa9496a1b1f388f44eb7e
refs/heads/master
2021-01-10T00:54:07.203053
2015-05-15T14:36:18
2015-05-15T14:36:18
30,299,619
0
2
null
2015-02-23T23:53:11
2015-02-04T13:18:29
C++
UTF-8
C++
false
false
1,099
h
Rendering.h
/* * Rendering.h * * Created on: May 14, 2015 * Author: sarwan */ #ifndef RENDERING_H_ #define RENDERING_H_ #include <GL/glew.h> #include <GL/gl.h> #include <GL/glext.h> #include <GL/glu.h> #include <SDL/SDL.h> #include <GLFW/glfw3.h> #include <stdio.h> #include <stdlib.h> #include <random> #include <stdexcept> #include <iostream> #include <fstream> #include <sstream> #include <iomanip> #include <vector> #include<string.h> #include<time.h> struct prop { float x; float y; float z; float mass; float xcol; float ycol; float zcol; }; void initGL(); void initGLFW(); void initPointSpriteExt(); static void error_callback(int error, const char* description); static void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods); void Pre_Render(); void Render(std::vector<prop> coord, int num); void Post_Render(); //void SaveToTGA(int idx=-1); not yet working : taking snapshots //void SaveToTGA2(const std::string &sName); not yet working extern GLuint m_texStar; extern GLFWwindow* window; //extern int m_idxSnapshot; #endif /* RENDERING_H_ */
17a918956189e57367a88802a803a30184092f86
599f770a1aaaf61f17b51844ae93d1fabce3f434
/logger.cpp
c3d2edb5cc534c7915f2d556549f7da38bfd58d4
[]
no_license
zeroch/AirLogger
cae0589398dfacecdcb3654e270622ccbcc70083
22f24595f23cb1d5e5130802f2ce3a5ee8de0e22
refs/heads/master
2021-01-10T01:46:16.202162
2015-11-30T19:37:02
2015-11-30T19:37:02
45,637,008
1
0
null
null
null
null
UTF-8
C++
false
false
1,487
cpp
logger.cpp
#include "logger.h" Logger::Logger() { } Logger::~Logger() { if(m_log.is_open()) { m_log << std::endl; m_log << getCurrentTime() << '\t' << "Mission Complete. Close the log" << std::endl; m_log.close(); } } Logger& Logger::getInstance() { static Logger m_Instance; return m_Instance; } bool Logger::logSetup(const std::string &fn) { m_filename = fn; m_log.open(m_filename.c_str()); // check log.txt is create and write the first line if( m_log.is_open()) { m_log << getCurrentTime() << '\t' << "Log file create successful " << m_filename; return true; } return false; } std::ostream& Logger::log(const LogLevel m_level) { // format the new line m_log << std::endl; m_log << getCurrentTime() << '\t'; switch(m_level) { case Logger::LogLevel::ERROR : m_log << "[Error] : "; break; case Logger::LogLevel::WARNING: m_log << "[Warning]: "; break; case Logger::LogLevel::INFO: m_log << "[INFO] : "; break; case Logger::LogLevel::DEBUG: m_log << "[DEBUG] : "; break; case Logger::LogLevel::DEBUG1: m_log << "[DEBUG1] : "; break; case Logger::LogLevel::DEBUG2: m_log << "[DEBUG2] : "; break; case Logger::LogLevel::DEBUG3: m_log << "[DEBUG3] : "; break; default: break; } return m_log; } std::string Logger::getCurrentTime() { time_t now = time(0); struct tm tstruct; char buf[80]; tstruct = *localtime(&now); strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", &tstruct); return buf; }
074b59a354dd4792423afdc96e3cf39bc5f73a0e
c65e36bffd5a1f24205254a8879a5fc6685672dc
/src/cpp_pubsub/src/reviser.cpp
b209c32254e4770d053a290ca11467353fd695f0
[]
no_license
mayanks888/Gtest_ros2
f3445d978e1a9f938147ded0897445396b196b37
eed20bda81ecc796f10e1e89745aa7e430daa17b
refs/heads/master
2022-11-13T12:40:47.314436
2020-06-10T12:45:05
2020-06-10T12:45:05
266,098,716
0
0
null
null
null
null
UTF-8
C++
false
false
4,583
cpp
reviser.cpp
#include "cpp_pubsub/Reviser.hpp" Reviser::Reviser() : Node("reviser") { rev_subscription_ = this->create_subscription<traffic_light_msgs::msg::TrafficLightStruct>("/snowball/perception/traffic_light/recogniser_output", 10, std::bind(&Reviser::topic_callback, this, _1)); reviser_pub = this->create_publisher<traffic_light_msgs::msg::TrafficLightData>("/snowball/perception/traffic_light/reviser", 10); std::cout<<"reviser process___________________________________________________"<<std::endl; // auto callback = std::bind(&MinimalSubscriber::topic_callback, this, _1); // subscription_ = this->create_subscription<traffic_light_msgs::msg::TrafficLightStruct>("/tl_bbox_info_new", 10, callback); } void Reviser::topic_callback(const traffic_light_msgs::msg::TrafficLightStruct::SharedPtr msg) { // std::cout<<1<<std::endl; ////////////////////////////////////////////////////////// // int color_info; // color_info=msg->selected_box.color; // std::cout<<"my colo info "<<color_info<<std::endl; TlColor color_info; color_info=status_col[msg->selected_box.color]; std::cout<<"my colo info "<<color_info<<std::endl; // mytlcolor[2]; //////////////////////////////////////////////////////////////////////////////////// typedef std::shared_ptr<Image_Light> LightPtr; // LightPtr mytemp(new Image_Light); LightPtr mylight (new Image_Light); std::vector<LightPtr> lights_ref ; //= new LightPtr; mylight->color=color_info; // lights_ref.confidence=0.2; lights_ref.push_back(mylight); // ????????????????v option.ts=msg->selected_box.header.stamp.sec; std::cout <<"mytime"<<option.ts<<std::endl; ///////////////////////// // lights_ref.color.Tlcolor=red; for (size_t i = 0; i < lights_ref.size(); ++i) { // std::string id = lights_ref[i]->info.id().id(); std::cout << lights_ref[i]->color << std::endl; switch (lights_ref[i]->color) { default: case BLACK: case UNKNOWN_COLOR: // if (color_map_.find(id) != color_map_.end() && option.ts > 0 && option.ts - time_map_[id] < config_.color_reviser_config().blink_time()) { if (color_map_.find(id) != color_map_.end() && option.ts > 0 && option.ts - time_map_[id] <1.5) { std::cout << "Revise " << kColorStr[lights_ref[i]->color] << " to color " << kColorStr[color_map_[id]]; lights_ref[i]->color = color_map_[id]; } else { std::cout << "Unrevised color " << kColorStr[lights_ref[i]->color]; } break; case YELLOW: // if YELLOW appears after RED, revise it to RED // this simply means if color_map has a id of our specific light and if at any time in last 10 instance if the // if the detection is red and switch yellow to red. if (color_map_.find(id) != color_map_.end() && option.ts > 0 && color_map_.at(id) == RED) { lights_ref[i]->color = color_map_.at(id); std::cout << "Revise Yellow to color Red"; color_map_[id] = RED; time_map_[id] = option.ts; break; } case RED: // if its red then keep the status as it is and store into cache memory case GREEN: // if its Green then check if the the instance inceased by 10 than clear everything and store info from the begining if (time_map_.size() > 10) { color_map_.clear(); time_map_.clear(); } color_map_[id] = lights_ref[i]->color; time_map_[id] = option.ts; std::cout << "Revise Keep Color Unchanged: " << kColorStr[lights_ref[i]->color]<<std::endl; break; } } for (auto x : color_map_) std::cout << "mayank_data "<<x.first << " " << x.second << std::endl; auto rev_result = traffic_light_msgs::msg::TrafficLightData(); rev_result.color= kColorStr[lights_ref[0]->color]; // rev_result.trafficlight_id=id; rev_result.trafficlight_id=msg->selected_box.id; rev_result.trafficlight_roi.x_offset=msg->selected_box.x_offset; rev_result.trafficlight_roi.y_offset=msg->selected_box.y_offset; rev_result.trafficlight_roi.height=msg->selected_box.height; rev_result.trafficlight_roi.width=msg->selected_box.width; std::cout<<"mydata"<<msg->header.stamp.sec<<std::endl; // std::cout<<"mydata"; rev_result.header.stamp=msg->selected_box.header.stamp; // rev_result.header=msg->header; reviser_pub->publish(rev_result); }
7c29528e415c00d0ee8fadb632bb3f812fcf4e6f
8c1390baf5549bafdd86d516ff61619dda88b349
/include/omp_raii/omp_raii.hh
15bb29def8687867376732e9309bc3a1f96612ae
[ "MIT" ]
permissive
Falkgaard/omp_raii
136db304eb6ef89f0118ec02e27a4c4d8b44cda7
3bb46cfafda6d028bdac91e089e618e2df84730f
refs/heads/main
2023-08-27T01:20:16.381470
2021-11-08T17:26:23
2021-11-08T17:26:23
425,491,207
0
0
null
null
null
null
UTF-8
C++
false
false
3,050
hh
omp_raii.hh
#pragma once #ifndef OMP_RAII_HH_1A5VSVG6 #define OMP_RAII_HH_1A5VSVG6 #include <omp.h> class omp_raii_lock_t final { private: omp_lock_t m_lock; public: // RAII scoped access to an omp_lock class omp_raii_lock_pass_t final { private: friend class omp_raii_lock_t; omp_lock_t *m_lock_ptr; // constructor A; reference to lock to set (possibly blocking wait) omp_raii_lock_pass_t( omp_lock_t &lock ) noexcept: m_lock_ptr { &lock } { omp_set_lock( m_lock_ptr ); } // constructor B; pointer to lock that's already passed an omp_test_lock() in the outer class; // since it's already set by the test, there's no need to set it in the constructor omp_raii_lock_pass_t( omp_lock_t *tested_lock_ptr ) noexcept: m_lock_ptr { tested_lock_ptr } {} public: ~omp_raii_lock_pass_t() noexcept { omp_unset_lock( m_lock_ptr ); } omp_raii_lock_pass_t( omp_raii_lock_pass_t const & ) = delete; omp_raii_lock_pass_t( omp_raii_lock_pass_t && ) = delete; auto & operator=( omp_raii_lock_pass_t const & ) = delete; auto & operator=( omp_raii_lock_pass_t && ) = delete; }; // end-of-class omp_raii_lock_pass_t // essentially a std::optional-ish omp_raii_lock_pass wrapper class omp_maybe_raii_lock_pass_t final { omp_raii_lock_pass_t *m_raii_lock_pass_ptr; public: omp_maybe_raii_lock_pass_t( omp_raii_lock_pass *pass_ptr = nullptr ) noexcept: m_raii_lock_pass_ptr { pass_ptr } {} omp_maybe_raii_lock_pass_t( omp_maybe_raii_lock_pass_t const & ) = delete; omp_maybe_raii_lock_pass_t( omp_maybe_raii_lock_pass_t && ) = delete; auto & operator=( omp_maybe_raii_lock_pass_t const & ) = delete; auto & operator=( omp_maybe_raii_lock_pass_t && ) = delete; ~omp_maybe_raii_lock_pass_t() noexcept { if ( m_raii_lock_pass_ptr ) delete m_raii_lock_pass_ptr; } [[nodiscard]] bool has_value() const noexcept { return m_raii_lock_pass_ptr != nullptr; } operator bool() const noexcept { return m_raii_lock_pass_ptr != nullptr; } }; // end-of-class omp_maybe_raii_lock_pass_t omp_raii_lock_t() noexcept { omp_init_lock( &m_lock ); } omp_raii_lock_t( omp_raii_lock_t const & ) = delete; omp_raii_lock_t( omp_raii_lock_t && ) = delete; auto & operator=( omp_raii_lock_t const & ) = delete; auto & operator=( omp_raii_lock_t && ) = delete; // blocking wait for a scoped RAII pass [[nodiscard]] omp_raii_lock_pass_t await_pass() noexcept { return { m_lock }; } // get a scoped RAII pass if available (no waiting) [[nodiscard]] omp_maybe_raii_lock_pass_t request_pass() noexcept { if ( omp_test_lock( &m_lock ) ) return { new omp_raii_lock_pass_t(&m_lock) }; else return {}; } ~omp_raii_lock_t() noexcept { omp_destroy_lock( &m_lock ); } }; // end-of-class omp_raii_lock_t #endif // end-of-header-guard OMP_RAII_HH_1A5VSVG6
50061d10a90bebb8e04151bbfc4cc7061e867ce7
a5a99f646e371b45974a6fb6ccc06b0a674818f2
/MuonAnalysis/MomentumScaleCalibration/test/Macros/RooFit/CompareBias.cc
a086fccc4c8a350640abf21fef3d1ba3be3e6729
[ "Apache-2.0" ]
permissive
cms-sw/cmssw
4ecd2c1105d59c66d385551230542c6615b9ab58
19c178740257eb48367778593da55dcad08b7a4f
refs/heads/master
2023-08-23T21:57:42.491143
2023-08-22T20:22:40
2023-08-22T20:22:40
10,969,551
1,006
3,696
Apache-2.0
2023-09-14T19:14:28
2013-06-26T14:09:07
C++
UTF-8
C++
false
false
7,451
cc
CompareBias.cc
#include "TCanvas.h" #include "TFile.h" #include "TH1.h" #include "TString.h" #include "TROOT.h" #include "TLegend.h" #include "FitMassSlices.cc" #include "Legend.h" class CompareBias { public: CompareBias() : file1_(0), file2_(0) { gROOT->SetStyle("Plain"); doFit_ = false; TString fileNum1("0"); TString fileNum2("2"); TString inputFileName("_MuScleFit.root"); TString outputFileName("BiasCheck_"); TString inputFile1(fileNum1+inputFileName); TString inputFile2(fileNum2+inputFileName); TString outputFile1(outputFileName+fileNum1+".root"); TString outputFile2(outputFileName+fileNum2+".root"); FitMassSlices fitter1; FitMassSlices fitter2; fitter1.rebinZ = 1; // 2 for Z fitter1.useChi2 = false; fitter1.rebinX = 2; fitter1.rebinY = 2; fitter1.sigma2 = 1.; fitter1.fit(fileNum1+"_MuScleFit.root", "BiasCheck_"+fileNum1+".root", "crystalBall", "exponential", 3.095, 2.8, 3.4, 0.04, 0., 0.); // fitter1.fit(fileNum1+"_MuScleFit.root", "BiasCheck_"+fileNum1+".root", "voigtian", "", 91, 80, 100, 2, 0.1, 10); if( fileNum2 != "" ) { fitter2.rebinX = 2; fitter2.rebinY = 2; fitter2.sigma2 = 1.; fitter2.fit(fileNum2+"_MuScleFit.root", "BiasCheck_"+fileNum2+".root", "crystalBall", "exponential", 3.095, 2.8, 3.4, 0.04, 0., 0.); // fitter2.fit(fileNum2+"_MuScleFit.root", "BiasCheck_"+fileNum2+".root", "voigtian", "", 91, 80, 100, 2, 0.1, 10); } file1_ = new TFile(outputFile1, "READ"); if( fileNum2 != "" ) { file2_ = new TFile(outputFile2, "READ"); } TFile * outputFile = new TFile("CompareBias.root", "RECREATE"); outputFile->cd(); compare("MassVsPt", "uniform", 1., 8., "muon pt (GeV)", "Mass (GeV)"); compare("MassVsEta", "uniform", -2.8, 2.8, "muon #eta", "Mass (GeV)"); //r.c. ------------------ compare("MassVsEtaPlus", "uniform", -2.8, 2.8, "muon + #eta", "Mass (GeV)"); compare("MassVsEtaMinus", "uniform", -2.8, 2.8, "muon - #eta", "Mass (GeV)"); // compare("MassVsEtaPhiPlus", "uniform", -2.8, 2.8, "muon - #eta #phi", "Mass (GeV)"); //r.c. ----------------- compare("MassVsPhiPlus", "uniform", -3.14, 3.14, "muon(+) #phi", "Mass (GeV)"); compare("MassVsPhiMinus", "uniform", -3.14, 3.14, "muon(-) #phi", "Mass (GeV)"); // compare("MassVsPhiPlus", "sinusoidal", -3.14, 3.14, "muon(+) #phi", "Mass (GeV)"); // compare("MassVsPhiMinus", "sinusoidal", -3.14, 3.14, "muon(-) #phi", "Mass (GeV)"); outputFile->Write(); outputFile->Close(); } protected: void compare(const TString & histoName, const TString & fitType, const double & xMin, const double & xMax, const TString & xAxisTitle, const TString & yAxisTitle) { gDirectory->mkdir(histoName); gDirectory->cd(histoName); TH1 * histo1 = getHisto(file1_, histoName); histo1->GetXaxis()->SetTitle(xAxisTitle); histo1->GetYaxis()->SetTitle(yAxisTitle); histo1->GetYaxis()->SetTitleOffset(1.25); TH1 * histo2 = 0; if( file2_ != 0 ) { histo2 = getHisto(file2_, histoName); histo2->GetXaxis()->SetTitle(xAxisTitle); histo2->GetYaxis()->SetTitle(yAxisTitle); histo2->GetYaxis()->SetTitleOffset(1.25); } // Fit using RooFit // The polynomial in RooFit is a pdf, so it is normalized to unity. This seems to give problems. // fitWithRooFit(histo1, histo2, histoName, fitType, xMin, xMax); // Fit with standard root, but then we also need to build the legends. if( doFit_ ) { fitWithRoot(histo1, histo2, xMin, xMax, fitType); } else { TCanvas * canvas = drawCanvas(histo1, histo2, true); canvas->Write(); } gDirectory->GetMotherDir()->cd(); } TH1 * getHisto(TFile * file, const TString & histoName) { TDirectory* dir = (TDirectory*)file->Get(histoName); TCanvas * canvas = (TCanvas*)dir->Get("meanCanvas"); return (TH1*)canvas->GetPrimitive("meanHisto"); } void fitWithRoot(TH1 * histo1, TH1 * histo2, const double & xMin, const double & xMax, const TString & fitType) { TF1 * f1 = 0; TF1 * f2 = 0; if( fitType == "uniform" ) { f1 = new TF1("uniform1", "pol0", xMin, xMax); if( file2_ != 0 ) { f2 = new TF1("uniform2", "pol0", xMin, xMax); } } else if( fitType == "sinusoidal" ) { f1 = new TF1("sinusoidal1", "[0] + [1]*sin([2]*x + [3])", xMin, xMax); f1->SetParameter(1, 2.); f1->SetParameter(2, 1.); f1->SetParameter(3, 1.); if( file2_ != 0 ) { f2 = new TF1("sinusoidal2", "[0] + [1]*sin([2]*x + [3])", xMin, xMax); f2->SetParameter(1, 2.); f2->SetParameter(2, 1.); f2->SetParameter(3, 1.); } } else { std::cout << "Wrong fit type: " << fitType << std::endl; exit(1); } histo1->Fit(f1, "", "", xMin, xMax); if( histo2 != 0 ) { histo2->Fit(f2, "", "", xMin, xMax); } TCanvas * canvas = drawCanvas(histo1, histo2); f1->Draw("same"); if( histo2 != 0 ) { f2->Draw("same"); f2->SetLineColor(kRed); } TwinLegend legends; legends.setText(f1, f2); legends.Draw("same"); canvas->Write(); } TCanvas * drawCanvas(TH1 * histo1, TH1 * histo2, const bool addLegend = false) { TCanvas * canvas = new TCanvas(TString(histo1->GetName())+"_canvas", TString(histo1->GetName())+" canvas", 1000, 800); canvas->Draw(); canvas->cd(); histo1->Draw(); histo1->SetMarkerStyle(24); histo1->SetMarkerSize(0.5); if( histo2 != 0 ) { histo2->SetLineColor(kRed); histo2->SetMarkerColor(kRed); histo2->SetMarkerSize(0.5); histo2->SetMarkerStyle(24); histo2->Draw("same"); if( addLegend ) { TLegend * leg = new TLegend(0.1,0.7,0.48,0.9); leg->AddEntry(histo1,"Before calibration","pl"); leg->AddEntry(histo2,"After calibration","pl"); leg->Draw("same"); } } return canvas; } void fitWithRooFit(TH1 * histo1, TH1 * histo2, const TString & histoName, const TString & fitType, const double & xMin, const double & xMax) { FitWithRooFit fitter; fitter.initConstant(3.097, 3.05, 3.15); // fitter.initLinearTerm(0., -1., 1.); RooPlot * rooPlot1 = fit( histo1, file1_->GetName(), &fitter, fitType, xMin, xMax ); RooRealVar * constant = fitter.constant(); std::cout << "fitted value for constant 1 = " << constant->getVal() << std::endl; RooPlot * rooPlot2 = fit( histo2, file2_->GetName(), &fitter, fitType, xMin, xMax ); constant = fitter.constant(); std::cout << "fitted value for constant 2 = " << constant->getVal() << std::endl; TCanvas * canvas = new TCanvas(histoName+"_canvas", histoName+" canvas", 1000, 800); canvas->Draw(); canvas->cd(); rooPlot1->Draw(); rooPlot2->SetLineColor(kRed); rooPlot2->SetMarkerColor(kRed); rooPlot2->Draw("same"); canvas->Write(); } RooPlot * fit(TH1 * histo, const TString & fileName, FitWithRooFit * fitter, const TString & fitType, const double & xMin, const double & xMax) { gDirectory->mkdir(fileName); gDirectory->cd(fileName); // fitter->fit(histo, "", fitType, xMin, xMax, true); fitter->fit(histo, "", fitType, xMin, xMax); RooPlot * rooPlot = (RooPlot*)gDirectory->Get(TString(histo->GetName())+"_frame"); gDirectory->GetMotherDir()->cd(); return rooPlot; } TFile * file1_; TFile * file2_; bool doFit_; };
ad93d05fd8da72f225f308eb88aeca0c000174eb
c66e921b5a2a06cb965f4951b24597a088e4209b
/src/animation_frame.h
73499eeed03f56f1c012a69ae92e2ac6356677fc
[]
no_license
s9w/terminal_moo
17ab757aeea97729cb72569c1b18d0a853056a2c
7688d6d40db9f79eb3c2d2c53f5cf290a4c52df4
refs/heads/master
2022-12-30T07:14:22.467127
2020-10-19T14:40:08
2020-10-19T14:40:08
304,576,742
24
3
null
null
null
null
UTF-8
C++
false
false
924
h
animation_frame.h
#pragma once #include "helpers.h" #include <algorithm> namespace moo { struct AnimationFrame { constexpr AnimationFrame(const size_t frame_count, const Seconds period, const double initial_progress) : m_frame_count(frame_count) , m_period(period) , m_time_state(initial_progress * m_period) { } constexpr auto progress(const Seconds& dt) -> void { m_time_state += dt; if (m_time_state > m_period) { m_time_state -= m_period; } } constexpr auto get_index() const -> size_t { const double progress = m_time_state / m_period; constexpr size_t zero = 0; return std::clamp(static_cast<size_t>(progress * m_frame_count), zero, m_frame_count - 1); } size_t m_frame_count = 0; Seconds m_period; Seconds m_time_state; }; }
6e67e224e238099b7be18ebf6c334873ae40931b
db364b3e3eb572b618fdde7f49c0c9d0371ceb50
/undergraduateStudent.cpp
d74e685e744e6bfff7c7e1749cd5fefbdd79bd8c
[]
no_license
GabrielCE/universityDatabase
f5a649a91b906cb3e8b216a8356873b8e8270626
99f8a9d86ffad3c55f987181c1edf58dd56e7a8e
refs/heads/master
2020-05-23T07:49:02.523683
2017-01-30T18:28:46
2017-01-30T18:28:46
80,447,581
1
0
null
null
null
null
UTF-8
C++
false
false
1,064
cpp
undergraduateStudent.cpp
// CPP file for UndergraduateStudent class #include <iostream> #include "undergraduateStudent.h" using namespace std; // constructor UndergraduateStudent::UndergraduateStudent() : Student() {} // end constructor // setGradeClassification function void UndergraduateStudent::setGradeClassification(string classification){ gradeName = classification; } // end setGradeClassification function // getGradeClassification function string UndergraduateStudent::getGradeClassification(){ return gradeName; } // end getGradeClassification function // setGradeLevel function void UndergraduateStudent::setGradeLevel(int level){ gradeLevel = level; } // end setGradeLevel function // getGradeLevel function int UndergraduateStudent::getGradeLevel(){ return gradeLevel; } // end getGradeLevel function // print function void UndergraduateStudent::print(){ Student::print(); cout << "Grade level: " << getGradeLevel() << endl; cout << "Grade Classification: " << getGradeClassification() << endl; } // end print function
c43d5fd73a7c8914fec76b3afec6f52706b37bba
d2f0a9a335c38134e1d669227f6e4c05e9f0c06a
/SD semester projects mostly/Double linked list/ElemDLList.h
a495278c3a3b0f1680d96e6fbeaab6daf600a32e
[]
no_license
Anton94/OOP-Cplusplus
37e9cb9ab9a383b893f36a56fe69862c61a16607
7fe21e8cf103bcbb43591f17b5cb095f3ffb6f8f
refs/heads/master
2021-01-10T21:45:50.652354
2017-02-01T15:06:04
2017-02-01T15:06:04
25,372,476
0
1
null
null
null
null
UTF-8
C++
false
false
1,311
h
ElemDLList.h
#pragma once /* Boxes which will contain the information of the list. One parametar for the data. Two pointers to the next box and the prev box. Cascade destructor- deletes every cells untill 'next' points NULL. */ template <class T> struct ElemDLList { public: ElemDLList(); ElemDLList(const T& x, ElemDLList<T>* pNext = NULL, ElemDLList<T>* pPrev = NULL); ElemDLList(const ElemDLList<T>& other); ElemDLList<T>& operator=(const ElemDLList<T>& other); ~ElemDLList(); private: void copFrom(const ElemDLList<T>& other); public: T data; ElemDLList<T> *next, *prev; }; template <class T> ElemDLList<T>::ElemDLList() { next = prev = NULL; } template <class T> ElemDLList<T>::ElemDLList(const T& x, ElemDLList<T>* pNext = NULL, ElemDLList<T>* pPrev = NULL) : data(x), next(pNext), prev(pPrev) {} template <class T> ElemDLList<T>::ElemDLList(const ElemDLList<T>& other) { copFrom(); } template <class T> ElemDLList<T>& ElemDLList<T>::operator=(const ElemDLList<T>& other) { if (this != &other) { copFrom(); } return *this; } template <class T> ElemDLList<T>::~ElemDLList() { delete next; // delete next cell } // copy the value and set`s the pointers to NULL! template <class T> void ElemDLList<T>::copFrom(const ElemDLList<T>& other) { data = other.data; next = NULL; prev = NULL; }
e668acbde619f3789c6461af6e5788b20a6c3cdb
3efc07fc7056d4f7c31cc820ed580d6348f9f94c
/RecursiveRaytracer/src/graphics/scene.h
c04c82e8df7655ba59b92a1397a31272cacc9f99
[]
no_license
artpark/WhittedRayTracer
0ed833d4c297f9efa315e6f5ec8bddf220d46e98
609e785d7a9a4a0b2e69a87f865369f0305154fa
refs/heads/master
2020-08-06T16:40:35.770369
2019-10-17T22:39:38
2019-10-17T22:39:38
null
0
0
null
null
null
null
UTF-8
C++
false
false
5,341
h
scene.h
#ifndef Scene_h #define Scene_h #include "../vect.h" #include "geometry/meshTriangle.h" #include "geometry/sphere.h" #include "lightSource.h" #include <iostream> #include <list> using namespace std; void fresnel(const Vec3 &I, const Vec3 &N, const float &ior, float &kr) { float cosi = clamp(-1, 1, I.dot(N)); float etai = 1, etat = ior; if (cosi > 0) { swap(etai, etat); } float sint = etai / etat * sqrtf(max(0.f, 1 - cosi * cosi)); if (sint >= 1) { kr = 1; } else { float cost = sqrtf(max(0.f, 1 - sint * sint)); cosi = fabsf(cosi); float Rs = ((etat * cosi) - (etai * cost)) / ((etat * cosi) + (etai * cost)); float Rp = ((etai * cosi) - (etat * cost)) / ((etai * cosi) + (etat * cost)); kr = (Rs * Rs + Rp * Rp) / 2; } } class Scene { public: list<Geometry *> geometries; list<LightSource> lightSources; Scene() {} void add(Geometry *g) { geometries.push_back(g); } void add(LightSource l) { lightSources.push_back(l); } Vec3 Shading(const Ray &ray, const Geometry &hitGeometry, double t, int depth) { Vec3 hitColor = Vec3(1, 1, 1); if (depth < 0) { return hitColor; } Vec3 rayOrig = ray.origin; Vec3 rayDir = ray.direction; Vec3 hitPoint = ray.origin + rayDir * t; Vec3 normal; Vec2 uv; Vec2 st; uint32_t index = 0; hitGeometry.getSurfaceProperties(hitPoint, rayDir, index, uv, normal, st); Vec3 tmp = hitPoint; switch (hitGeometry.materialType) { case (REFLECTION): { Vec3 reflectionDir = rayDir.reflect(normal).normalize(); Vec3 reflectionRayOrig = (reflectionDir.dot(normal) < 0) ? hitPoint - normal * 0.00001 : hitPoint + normal * 0.00001; hitColor = trace_ray(Ray(reflectionRayOrig, reflectionDir), depth - 1); break; } case (REFLECTION_AND_REFRACTION): { Vec3 reflectionDir = rayDir.reflect(normal).normalize(); Vec3 reflectionRayOrig = (reflectionDir.dot(normal) < 0) ? hitPoint - normal * 0.00001 : hitPoint + normal * 0.00001; Vec3 reflectionColor = trace_ray(Ray(reflectionRayOrig, reflectionDir), depth - 1); Vec3 refractionDir = refract(rayDir, normal, hitGeometry.ior).normalize(); Vec3 refractionRayOrig = (refractionDir.dot(normal) < 0) ? hitPoint - normal * 0.00001 : hitPoint + normal * 0.00001; Vec3 refractionColor = trace_ray(Ray(refractionRayOrig, refractionDir), depth - 1); float kr; fresnel(rayDir, normal, hitGeometry.ior, kr); hitColor = reflectionColor * kr + refractionColor * (1 - kr); break; } default: //DIFFUSE_AND_GLOSSY { Vec3 lightAmt = 0, specularColor = 0; Vec3 shadowPointOrig = (rayDir.dot(normal) < 0) ? hitPoint + normal * 0.00001 : hitPoint - normal * 0.00001; for (const LightSource light : lightSources) { Vec3 lightDir = light.position - hitPoint; float lightDistance2 = lightDir.dot(lightDir); lightDir = lightDir.normalize(); float LdotN = max(0.0, lightDir.dot(normal)); Geometry *shadowHitObject = nullptr; bool inShadow = check_occlusion(hitPoint, lightDir, hitGeometry); lightAmt = lightAmt + (light.intensity * LdotN * (1 - inShadow)); Vec3 reflectionDirection = (-lightDir).reflect(normal).normalize(); specularColor = specularColor + (light.intensity * powf(max(0.0, -(reflectionDirection.dot(rayDir))), hitGeometry.specularExponent)); } hitColor = hitGeometry.ambientColor * hitGeometry.Ka + lightAmt * hitGeometry.evalDiffuseColor(st) * hitGeometry.Kd + specularColor * hitGeometry.Ks; break; } } return hitColor; } Vec3 trace(float x, float y) { // eye at the origin, image plane center at 0,0,-1 Vec3 ray_origin = Vec3(0, 0, 0); Vec3 ray_direction = Vec3(x, y, -1).normalize(); return trace_ray(Ray(ray_origin, ray_direction), 50); } Vec3 trace_ray(const Ray &ray, int depth) { float tNearK = __FLT_MAX__; uint32_t indexK; Vec2 uvK; const Geometry *nearest_obj = nullptr; double tNear = __FLT_MAX__; for (const Geometry *geometry : geometries) { if ((*geometry).intersect(ray.origin, ray.direction, tNearK, indexK, uvK) && tNearK < tNear) { nearest_obj = geometry; tNear = tNearK; } } if (nearest_obj != nullptr) { return Shading(ray, *nearest_obj, tNearK, depth); } return Vec3(1, 1, 1); } bool check_occlusion(Vec3 source, Vec3 target, const Geometry &self) { float tNearK = __FLT_MAX__; uint32_t indexK; Vec2 uvK; const Geometry *nearest_obj = nullptr; double tNear = __FLT_MAX__; for (const Geometry *geometry : geometries) { if (geometry == &self) { continue; } if ((*geometry).intersect(source, target, tNearK, indexK, uvK) && tNearK < tNear) { nearest_obj = geometry; tNear = tNearK; } } if (nearest_obj != nullptr) { return true; } return false; } }; #endif
8dd99f082691de272fa8c1b13baa60599b8f5bc2
e411243364f278b90a573369bc14d8a237e6b82d
/Engine/Rect.h
b5d33fc3dbde738330f0efae3d5a0dadfc8471dc
[]
no_license
outincrimson/Pong
6d073734795d2da7219a2f9303fdd76dd1ff6d42
2efc62f29e4f14f7207ad452289f793a7f37aba0
refs/heads/master
2020-03-24T06:44:56.807968
2018-07-27T12:13:32
2018-07-27T12:13:32
142,539,741
0
0
null
null
null
null
UTF-8
C++
false
false
1,562
h
Rect.h
#pragma once #include "Vector2.h" template<typename T> class Rectangle_ { public: Rectangle_() = default; constexpr Rectangle_(T in_left, T in_right, T in_top, T in_bottom) : left(in_left), right(in_right), top(in_top), bottom(in_bottom) { } constexpr Rectangle_(const Vector2<T>& in_top_left, const Vector2<T>& in_bottom_right) : Rectangle_(in_top_left.x, in_bottom_right.x, in_top_left.y, in_bottom_right.y) { } constexpr Rectangle_(const Vector2<T>& in_top_left, T in_width, T in_height) : Rectangle_(in_top_left, in_top_left + Vector2<T>(in_width, in_height)) { } constexpr bool operator==(const Rectangle_& rhs) const { return left == rhs.left && right == rhs.right && top == rhs.top && bottom == rhs.bottom; } constexpr bool operator!=(const Rectangle_& rhs) const { return !(*this == rhs); } constexpr bool is_overlapping(const Rectangle_& other) const { return right > other.left && left < other.right && bottom > other.top && top < other.bottom; } static constexpr Rectangle_ FromCenter(const Vector2<T> & center, T width, T height) { width /= (T) 2; height /= (T) 2; const Vector2<T> half(width, height); return Rectangle_(center - half, center + half); } static constexpr Rectangle_ MakeRectangle(const Vector2<T>& v, T width, T height) { return Rectangle_(v.x, v.x + width, v.y, v.y + height); } public: T left; T right; T top; T bottom; }; using RectI = Rectangle_<int>; using RectU = Rectangle_<unsigned int>; using RectF = Rectangle_<float>; using RectD = Rectangle_<double>;
f434a7a54f0f30a3822abacafbcc58f62fbea28f
8c9f6b358b693cbb6ced1eef4d3922a59d4aedc9
/generators/src/structured_models/generalized_gn.cpp
900227cfbd84f145c3036f350d1b9ef215e7259f
[ "MIT" ]
permissive
jg-you/network-archaeology
a72fec2d50e992ba152616ed10316ee1f0e3ef68
0cd4758d18414c3226bd6dc1e0bd8f92b4ac4214
refs/heads/master
2021-07-06T08:14:00.501974
2020-07-15T21:33:00
2020-07-15T21:33:00
137,176,458
5
2
MIT
2020-07-15T21:33:01
2018-06-13T07:07:37
Python
UTF-8
C++
false
false
3,023
cpp
generalized_gn.cpp
#include "gn.h" generalized_gn_model::generalized_gn_model(double a, double alpha, double b, unsigned int m1, unsigned int m2, double gamma, double tau, bool directed) : structured_model() { a_ = a; alpha_ = alpha; b_ = b; m1_ = m1; m2_ = m2; gamma_ = gamma; tau_ = tau; directed_ = directed; } void generalized_gn_model::intialize(unsigned int T) { // clear current state history_.clear(); history_.reserve(2 * T * (m1_ + m2_)); adj_list_.clear(); adj_list_.reserve(T * (m1_ + m2_)); // adj_list_.push_back(neighbourhood_t()); // unconnected node token_states_[0] = {1.0}; token_states_[1] = {1.0}; normalization_ = 2.0; max_token_ = 1; adj_list_.push_back({1}); adj_list_.push_back({0}); history_.push_back(0); history_.push_back(1); } void generalized_gn_model::step(unsigned int t, std::mt19937& engine) { if (rand_real_(engine) < p(t)) // new node { // select target nodes id_vec_t nodes(m1_); for (unsigned int i = 0; i < m1_; ++i) nodes[i] = random_token(engine); // add new edges and add to history for (auto const & n: nodes) { ++max_token_; // add to history history_.push_back(max_token_); history_.push_back(n); // update states token_states_[max_token_] = {1.0}; normalization_ += 1.0; // update to normalization due to new node normalization_ -= weight(n); ++token_states_[n][0]; normalization_ += weight(n); // connect adj_list_.push_back({n}); if (!directed_) adj_list_[n].insert(max_token_); } } else // densification { id_vec_t source(m2_); for (unsigned int i = 0; i < m2_; ++i) { source[i] = random_token(engine); } for (unsigned int i = 0; i < m2_; ++i) { id_t target; target = random_token(engine); history_.push_back(source[i]); history_.push_back(target); if (source[i] != target) { normalization_ -= weight(source[i]); normalization_ -= weight(target); ++token_states_[source[i]][0]; ++token_states_[target][0]; normalization_ += weight(source[i]); normalization_ += weight(target); } else // same node { normalization_ -= weight(target); token_states_[target][0] += 2; normalization_ += weight(target); } adj_list_[source[i]].insert(target); if (!directed_) adj_list_[target].insert(source[i]); } } } double generalized_gn_model::weight(id_t token) const { // p[0] = gamma return std::pow(token_states_.at(token)[0], gamma_); } double generalized_gn_model::p(unsigned int t) const { return a_ * std::pow((double) t + tau_, - alpha_) + b_; }
9c0fd6be6176e1c9b5eb7ce2276cd853ec3f1046
6d00129928082010a2156e9416f74ba6ab8d162d
/modules/cadac/vehicle.hh
6c07fd18e59c76360d02d84cfc137373b53d50fb
[ "BSD-3-Clause" ]
permissive
mlouielu/mazu-sim
095dda66190c5783b3db38b5bbdd58c29ff220e7
fd2da3a9f7ca3ca30d3d3f4bbd6966cb68623225
refs/heads/master
2020-09-24T14:04:13.981499
2019-11-17T15:18:38
2019-11-17T15:18:38
225,775,896
1
0
BSD-3-Clause
2019-12-04T04:03:24
2019-12-04T04:03:23
null
UTF-8
C++
false
false
3,128
hh
vehicle.hh
#ifndef __VEHICLE_HH__ #define __VEHICLE_HH__ #include <armadillo> #include <cstdio> #include <cstdlib> #include <map> #include <string> #include <vector> #include "aux.hh" #include "cadac_constants.hh" #include "component.hh" #include "vehicle_var.hh" /********************************* TRICK HEADER ******************************* PURPOSE: (Simulation module abstraction class and vehicle class) LIBRARY DEPENDENCY: ((../src/Vehicle.cpp)) PROGRAMMERS: (((Chun-Hsu Lai) () () () )) *******************************************************************************/ class Vehicle { protected: char Name[32]; int module_num; public: Vehicle(){}; ~Vehicle(){}; void set_name(char *in) { strcpy(Name, in); } char *get_name() { return Name; } }; class LaunchVehicle : public Vehicle { public: LaunchVehicle(double step_in); ~LaunchVehicle(){}; /* Set Aerodynamics variables */ void set_refa(double in); void set_refd(double in); void set_XCP(double in); void set_reference_point(double rp); void set_liftoff(int in); void load_angle(double yaw, double roll, double pitch); void load_angular_velocity(double ppx_in, double qqx_in, double rrx_in); void load_location(double lonx_in, double latx_in, double alt_in); void load_geodetic_velocity(double alpha0x, double beta0x, double dvbe); /* Set stage variables */ void Allocate_stage(unsigned int stage_num); void set_stage_var(double isp, double fmass_init, double vmass_init, double aexit_in, double fuel_flow_rate_in, double xcg0, double xcg1, double moi_roll0, double moi_roll1, double moi_pitch0, double moi_pitch1, double moi_yaw0, double moi_yaw1, unsigned int num_stage); void Allocate_RCS(int num, std::vector<RCS_Thruster *> &RT_list); void Allocate_ENG(int NumEng, std::vector<ENG *> &Eng_list_In); void set_payload_mass(double in); void set_faring_mass(double in); void set_stage_1(); void set_stage_2(); void set_stage_3(); void set_faring_sep(); void engine_ignition(); void set_no_thrust(); void set_mtvc(enum TVC_TYPE); void set_S1_TVC(); void set_S2_TVC(); void set_S3_TVC(); Aerodynamics_var *Aero; EarthEnvironment_var *Env; DM_var *DM; Prop_var *Prop; ACT_var *ACT; Sensor_var *Sensor; std::vector<STAGE_VAR *> Stage_var_list; std::vector<struct ENG *> Eng_list; std::vector<RCS_Thruster *> Thruster_list; std::vector<ENG *> S1_Eng_list; std::vector<ENG *> S2_Eng_list; std::vector<ENG *> S3_Eng_list; double dt; }; class FH_module { public: FH_module(){}; ~FH_module(){}; virtual void algorithm(LaunchVehicle *VehicleIn) = 0; virtual void init(LaunchVehicle *VehicleIn) = 0; protected: // Data_exchang *data_exchang; }; // class Vehicle_list { // private: // int howmany; // Vehicle **vehicle_ptr; // public: // Vehicle_list(){}; // ~Vehicle_list(){}; // void Add_vehicle(Vehicle *ptr); // }; #endif // __VEHICLE_HH__
8f4db0f335bf8343a021caf5385b38eab6178d74
e549fa7f97f979bbdfadd7a030a3f5191065d5b2
/SATIP-Client/scanwidget.h
43072621ee3b4dbbe6a8f2dc99dcf227ffbeebf5
[]
no_license
mgandi/SAT-IP-Tools
6cec86148bfb379125b8cc19e2f01ec32e18536c
748c94527037374dc504f90c9f1f71199397de37
refs/heads/master
2021-01-25T06:36:53.282165
2014-03-21T16:31:08
2014-03-21T16:31:08
null
0
0
null
null
null
null
UTF-8
C++
false
false
942
h
scanwidget.h
#ifndef SCANWIDGET_H #define SCANWIDGET_H #include <QWidget> namespace Ui { class ScanWidget; } class GatewayDevice; class ScanWidgetPrivate; class ScanWidget : public QWidget { Q_OBJECT public: explicit ScanWidget(GatewayDevice *device, QWidget *parent = 0); ~ScanWidget(); private slots: void on_cleanButton_clicked(); void on_settingsButton_clicked(); void on_saveRTSP_clicked(); void on_saveHTTP_clicked(); void on_startButton_clicked(); void on_stopButton_clicked(); void on_stepForwardButton_clicked(); void on_stepBackwardButton_clicked(); void on_addChannel_clicked(); void showProgressStatus(); void hideProgressStatus(); void scanStarted(); void scanProgress(int percent, int frequency, int endFrequency); void scanDone(); void scanStopped(); void scanPaused(); private: Ui::ScanWidget *ui; ScanWidgetPrivate *d; }; #endif // SCANWIDGET_H
a6e000d6f67dc3741f4dba5eec7ad4c58756a891
cfeac52f970e8901871bd02d9acb7de66b9fb6b4
/generated/src/aws-cpp-sdk-lex/include/aws/lex/LexRuntimeServiceClient.h
f5b0e73c276f7962d0ff82a94d9708df451d9c5e
[ "Apache-2.0", "MIT", "JSON" ]
permissive
aws/aws-sdk-cpp
aff116ddf9ca2b41e45c47dba1c2b7754935c585
9a7606a6c98e13c759032c2e920c7c64a6a35264
refs/heads/main
2023-08-25T11:16:55.982089
2023-08-24T18:14:53
2023-08-24T18:14:53
35,440,404
1,681
1,133
Apache-2.0
2023-09-12T15:59:33
2015-05-11T17:57:32
null
UTF-8
C++
false
false
19,146
h
LexRuntimeServiceClient.h
/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include <aws/lex/LexRuntimeService_EXPORTS.h> #include <aws/core/client/ClientConfiguration.h> #include <aws/core/client/AWSClient.h> #include <aws/core/client/AWSClientAsyncCRTP.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/lex/LexRuntimeServiceServiceClientModel.h> namespace Aws { namespace LexRuntimeService { /** * <p>Amazon Lex provides both build and runtime endpoints. Each endpoint provides * a set of operations (API). Your conversational bot uses the runtime API to * understand user utterances (user input text or voice). For example, suppose a * user says "I want pizza", your bot sends this input to Amazon Lex using the * runtime API. Amazon Lex recognizes that the user request is for the OrderPizza * intent (one of the intents defined in the bot). Then Amazon Lex engages in user * conversation on behalf of the bot to elicit required information (slot values, * such as pizza size and crust type), and then performs fulfillment activity (that * you configured when you created the bot). You use the build-time API to create * and manage your Amazon Lex bot. For a list of build-time operations, see the * build-time API, . </p> */ class AWS_LEXRUNTIMESERVICE_API LexRuntimeServiceClient : public Aws::Client::AWSJsonClient, public Aws::Client::ClientWithAsyncTemplateMethods<LexRuntimeServiceClient> { public: typedef Aws::Client::AWSJsonClient BASECLASS; static const char* SERVICE_NAME; static const char* ALLOCATION_TAG; typedef LexRuntimeServiceClientConfiguration ClientConfigurationType; typedef LexRuntimeServiceEndpointProvider EndpointProviderType; /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ LexRuntimeServiceClient(const Aws::LexRuntimeService::LexRuntimeServiceClientConfiguration& clientConfiguration = Aws::LexRuntimeService::LexRuntimeServiceClientConfiguration(), std::shared_ptr<LexRuntimeServiceEndpointProviderBase> endpointProvider = Aws::MakeShared<LexRuntimeServiceEndpointProvider>(ALLOCATION_TAG)); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ LexRuntimeServiceClient(const Aws::Auth::AWSCredentials& credentials, std::shared_ptr<LexRuntimeServiceEndpointProviderBase> endpointProvider = Aws::MakeShared<LexRuntimeServiceEndpointProvider>(ALLOCATION_TAG), const Aws::LexRuntimeService::LexRuntimeServiceClientConfiguration& clientConfiguration = Aws::LexRuntimeService::LexRuntimeServiceClientConfiguration()); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ LexRuntimeServiceClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider, std::shared_ptr<LexRuntimeServiceEndpointProviderBase> endpointProvider = Aws::MakeShared<LexRuntimeServiceEndpointProvider>(ALLOCATION_TAG), const Aws::LexRuntimeService::LexRuntimeServiceClientConfiguration& clientConfiguration = Aws::LexRuntimeService::LexRuntimeServiceClientConfiguration()); /* Legacy constructors due deprecation */ /** * Initializes client to use DefaultCredentialProviderChain, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ LexRuntimeServiceClient(const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use SimpleAWSCredentialsProvider, with default http client factory, and optional client config. If client config * is not specified, it will be initialized to default values. */ LexRuntimeServiceClient(const Aws::Auth::AWSCredentials& credentials, const Aws::Client::ClientConfiguration& clientConfiguration); /** * Initializes client to use specified credentials provider with specified client config. If http client factory is not supplied, * the default http client factory will be used */ LexRuntimeServiceClient(const std::shared_ptr<Aws::Auth::AWSCredentialsProvider>& credentialsProvider, const Aws::Client::ClientConfiguration& clientConfiguration); /* End of legacy constructors due deprecation */ virtual ~LexRuntimeServiceClient(); /** * <p>Removes session information for a specified bot, alias, and user ID. * </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/DeleteSession">AWS * API Reference</a></p> */ virtual Model::DeleteSessionOutcome DeleteSession(const Model::DeleteSessionRequest& request) const; /** * A Callable wrapper for DeleteSession that returns a future to the operation so that it can be executed in parallel to other requests. */ template<typename DeleteSessionRequestT = Model::DeleteSessionRequest> Model::DeleteSessionOutcomeCallable DeleteSessionCallable(const DeleteSessionRequestT& request) const { return SubmitCallable(&LexRuntimeServiceClient::DeleteSession, request); } /** * An Async wrapper for DeleteSession that queues the request into a thread executor and triggers associated callback when operation has finished. */ template<typename DeleteSessionRequestT = Model::DeleteSessionRequest> void DeleteSessionAsync(const DeleteSessionRequestT& request, const DeleteSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const { return SubmitAsync(&LexRuntimeServiceClient::DeleteSession, request, handler, context); } /** * <p>Returns session information for a specified bot, alias, and user * ID.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/GetSession">AWS * API Reference</a></p> */ virtual Model::GetSessionOutcome GetSession(const Model::GetSessionRequest& request) const; /** * A Callable wrapper for GetSession that returns a future to the operation so that it can be executed in parallel to other requests. */ template<typename GetSessionRequestT = Model::GetSessionRequest> Model::GetSessionOutcomeCallable GetSessionCallable(const GetSessionRequestT& request) const { return SubmitCallable(&LexRuntimeServiceClient::GetSession, request); } /** * An Async wrapper for GetSession that queues the request into a thread executor and triggers associated callback when operation has finished. */ template<typename GetSessionRequestT = Model::GetSessionRequest> void GetSessionAsync(const GetSessionRequestT& request, const GetSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const { return SubmitAsync(&LexRuntimeServiceClient::GetSession, request, handler, context); } /** * <p> Sends user input (text or speech) to Amazon Lex. Clients use this API to * send text and audio requests to Amazon Lex at runtime. Amazon Lex interprets the * user input using the machine learning model that it built for the bot. </p> * <p>The <code>PostContent</code> operation supports audio input at 8kHz and * 16kHz. You can use 8kHz audio to achieve higher speech recognition accuracy in * telephone audio applications. </p> <p> In response, Amazon Lex returns the next * message to convey to the user. Consider the following example messages: </p> * <ul> <li> <p> For a user input "I would like a pizza," Amazon Lex might return a * response with a message eliciting slot data (for example, * <code>PizzaSize</code>): "What size pizza would you like?". </p> </li> <li> <p> * After the user provides all of the pizza order information, Amazon Lex might * return a response with a message to get user confirmation: "Order the pizza?". * </p> </li> <li> <p> After the user replies "Yes" to the confirmation prompt, * Amazon Lex might return a conclusion statement: "Thank you, your cheese pizza * has been ordered.". </p> </li> </ul> <p> Not all Amazon Lex messages require a * response from the user. For example, conclusion statements do not require a * response. Some messages require only a yes or no response. In addition to the * <code>message</code>, Amazon Lex provides additional context about the message * in the response that you can use to enhance client behavior, such as displaying * the appropriate client user interface. Consider the following examples: </p> * <ul> <li> <p> If the message is to elicit slot data, Amazon Lex returns the * following context information: </p> <ul> <li> <p> * <code>x-amz-lex-dialog-state</code> header set to <code>ElicitSlot</code> </p> * </li> <li> <p> <code>x-amz-lex-intent-name</code> header set to the intent name * in the current context </p> </li> <li> <p> <code>x-amz-lex-slot-to-elicit</code> * header set to the slot name for which the <code>message</code> is eliciting * information </p> </li> <li> <p> <code>x-amz-lex-slots</code> header set to a map * of slots configured for the intent with their current values </p> </li> </ul> * </li> <li> <p> If the message is a confirmation prompt, the * <code>x-amz-lex-dialog-state</code> header is set to <code>Confirmation</code> * and the <code>x-amz-lex-slot-to-elicit</code> header is omitted. </p> </li> <li> * <p> If the message is a clarification prompt configured for the intent, * indicating that the user intent is not understood, the * <code>x-amz-dialog-state</code> header is set to <code>ElicitIntent</code> and * the <code>x-amz-slot-to-elicit</code> header is omitted. </p> </li> </ul> <p> In * addition, Amazon Lex also returns your application-specific * <code>sessionAttributes</code>. For more information, see <a * href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing * Conversation Context</a>. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostContent">AWS * API Reference</a></p> */ virtual Model::PostContentOutcome PostContent(const Model::PostContentRequest& request) const; /** * A Callable wrapper for PostContent that returns a future to the operation so that it can be executed in parallel to other requests. */ template<typename PostContentRequestT = Model::PostContentRequest> Model::PostContentOutcomeCallable PostContentCallable(const PostContentRequestT& request) const { return SubmitCallable(&LexRuntimeServiceClient::PostContent, request); } /** * An Async wrapper for PostContent that queues the request into a thread executor and triggers associated callback when operation has finished. */ template<typename PostContentRequestT = Model::PostContentRequest> void PostContentAsync(const PostContentRequestT& request, const PostContentResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const { return SubmitAsync(&LexRuntimeServiceClient::PostContent, request, handler, context); } /** * <p>Sends user input to Amazon Lex. Client applications can use this API to send * requests to Amazon Lex at runtime. Amazon Lex then interprets the user input * using the machine learning model it built for the bot. </p> <p> In response, * Amazon Lex returns the next <code>message</code> to convey to the user an * optional <code>responseCard</code> to display. Consider the following example * messages: </p> <ul> <li> <p> For a user input "I would like a pizza", Amazon Lex * might return a response with a message eliciting slot data (for example, * PizzaSize): "What size pizza would you like?" </p> </li> <li> <p> After the user * provides all of the pizza order information, Amazon Lex might return a response * with a message to obtain user confirmation "Proceed with the pizza order?". </p> * </li> <li> <p> After the user replies to a confirmation prompt with a "yes", * Amazon Lex might return a conclusion statement: "Thank you, your cheese pizza * has been ordered.". </p> </li> </ul> <p> Not all Amazon Lex messages require a * user response. For example, a conclusion statement does not require a response. * Some messages require only a "yes" or "no" user response. In addition to the * <code>message</code>, Amazon Lex provides additional context about the message * in the response that you might use to enhance client behavior, for example, to * display the appropriate client user interface. These are the * <code>slotToElicit</code>, <code>dialogState</code>, <code>intentName</code>, * and <code>slots</code> fields in the response. Consider the following examples: * </p> <ul> <li> <p>If the message is to elicit slot data, Amazon Lex returns the * following context information:</p> <ul> <li> <p> <code>dialogState</code> set to * ElicitSlot </p> </li> <li> <p> <code>intentName</code> set to the intent name in * the current context </p> </li> <li> <p> <code>slotToElicit</code> set to the * slot name for which the <code>message</code> is eliciting information </p> </li> * <li> <p> <code>slots</code> set to a map of slots, configured for the intent, * with currently known values </p> </li> </ul> </li> <li> <p> If the message is a * confirmation prompt, the <code>dialogState</code> is set to ConfirmIntent and * <code>SlotToElicit</code> is set to null. </p> </li> <li> <p>If the message is a * clarification prompt (configured for the intent) that indicates that user intent * is not understood, the <code>dialogState</code> is set to ElicitIntent and * <code>slotToElicit</code> is set to null. </p> </li> </ul> <p> In addition, * Amazon Lex also returns your application-specific * <code>sessionAttributes</code>. For more information, see <a * href="https://docs.aws.amazon.com/lex/latest/dg/context-mgmt.html">Managing * Conversation Context</a>. </p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PostText">AWS * API Reference</a></p> */ virtual Model::PostTextOutcome PostText(const Model::PostTextRequest& request) const; /** * A Callable wrapper for PostText that returns a future to the operation so that it can be executed in parallel to other requests. */ template<typename PostTextRequestT = Model::PostTextRequest> Model::PostTextOutcomeCallable PostTextCallable(const PostTextRequestT& request) const { return SubmitCallable(&LexRuntimeServiceClient::PostText, request); } /** * An Async wrapper for PostText that queues the request into a thread executor and triggers associated callback when operation has finished. */ template<typename PostTextRequestT = Model::PostTextRequest> void PostTextAsync(const PostTextRequestT& request, const PostTextResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const { return SubmitAsync(&LexRuntimeServiceClient::PostText, request, handler, context); } /** * <p>Creates a new session or modifies an existing session with an Amazon Lex bot. * Use this operation to enable your application to set the state of the bot.</p> * <p>For more information, see <a * href="https://docs.aws.amazon.com/lex/latest/dg/how-session-api.html">Managing * Sessions</a>.</p><p><h3>See Also:</h3> <a * href="http://docs.aws.amazon.com/goto/WebAPI/runtime.lex-2016-11-28/PutSession">AWS * API Reference</a></p> */ virtual Model::PutSessionOutcome PutSession(const Model::PutSessionRequest& request) const; /** * A Callable wrapper for PutSession that returns a future to the operation so that it can be executed in parallel to other requests. */ template<typename PutSessionRequestT = Model::PutSessionRequest> Model::PutSessionOutcomeCallable PutSessionCallable(const PutSessionRequestT& request) const { return SubmitCallable(&LexRuntimeServiceClient::PutSession, request); } /** * An Async wrapper for PutSession that queues the request into a thread executor and triggers associated callback when operation has finished. */ template<typename PutSessionRequestT = Model::PutSessionRequest> void PutSessionAsync(const PutSessionRequestT& request, const PutSessionResponseReceivedHandler& handler, const std::shared_ptr<const Aws::Client::AsyncCallerContext>& context = nullptr) const { return SubmitAsync(&LexRuntimeServiceClient::PutSession, request, handler, context); } void OverrideEndpoint(const Aws::String& endpoint); std::shared_ptr<LexRuntimeServiceEndpointProviderBase>& accessEndpointProvider(); private: friend class Aws::Client::ClientWithAsyncTemplateMethods<LexRuntimeServiceClient>; void init(const LexRuntimeServiceClientConfiguration& clientConfiguration); LexRuntimeServiceClientConfiguration m_clientConfiguration; std::shared_ptr<Aws::Utils::Threading::Executor> m_executor; std::shared_ptr<LexRuntimeServiceEndpointProviderBase> m_endpointProvider; }; } // namespace LexRuntimeService } // namespace Aws
56375a47732c108c225871b85872aa637b9684cc
56ba70566a4c63168b3cbee943c7b90d68a1126c
/MIDI_synth_test_assembler/MIDI_synth_test_assembler.ino
dad78a0914fb645d50972debc8142cae093afdc7
[]
no_license
theawsomeavr/arduino-midi-synth
70ab1f6685c3b847effa1f526031e2f0b122a698
8395a4e782f9a671d46d28c5507033fd7544c899
refs/heads/master
2021-05-12T10:59:27.234450
2018-01-13T20:27:22
2018-01-13T20:27:22
117,374,680
0
0
null
null
null
null
UTF-8
C++
false
false
11,522
ino
MIDI_synth_test_assembler.ino
/* Pin mappings 0 \__ serial, used for MIDI 1 / 2 3 4 5 button board slave select - HIGH to transfer data 6 matrix enable pin - LOW for matrix is on 7 matrix slave select pin - LOW to transfer data 8 9 \_ audio output pins - only 9 is wired up for now 10 / 11 SPI \__ MOSI and MISO, can't remember which is which 12 SPI / 13 SPI clock A0 \ A1 | A2 \__ the 6 knobs, from right to left A3 / A4 | A5 / */ #include "Sprites.h" #include "wavetables.h" #include <SPI.h> #include <MIDI.h> MIDI_CREATE_DEFAULT_INSTANCE(); #include "Drawing.h" #include "LEDMatrix.h" #include "Buttons.h" int NoteOn=0x90; int NoteOff=0x80; // A MIDI simple monophonic synth, with wavetable synthesis. const int notes[] = { 2093, 2217, 2349, // other octaves by dividing by power of 2 2489, 2637, 2794, 2960, //C7 - B7 3136, 3322, 3520, 3729, 3951 }; struct oscillatorStruct { volatile unsigned int ticks; volatile unsigned int phase; volatile byte waveform; // 0=square, 1=sawtooth, 2=triangle volatile byte dutyCycle; //square w/ dutycycle comes from comparing sawtooth to this volatile byte volume; }; struct oscillatorStruct oscillators[8]; //class declaring/initializing //MIDI_Class MIDI; matrix screen(7, 6); //MIDI MIDI variables byte currentNotes[4][8]; //byte currentVelocities[4][8]; byte lastWritten[4]; boolean newNotes[4][8]; byte maxPolyphony = 4; // volatile variables used in ISR volatile int outputA = 0; //volatile int outputB = 0; void setup() { MIDI.begin(MIDI_CHANNEL_OMNI); //initialize MIDI MIDI //===================================================================== //=========================== SPI THINGS =========================== //===================================================================== SPI.begin(); SPI.setBitOrder(LSBFIRST); screen.enable(); beginButtons(5); //===================================================================== //================= OUTPUT TIMER SETTINGS ====================== //===================================================================== pinMode(9, OUTPUT); //set OC1A pin to output pinMode(10, OUTPUT); //set OC1B pin to output //Setting up timer1 for fast pwm mode TCCR1A &= ~(1 << WGM10); TCCR1A |= 1 << WGM11; TCCR1B |= 1 << WGM12; TCCR1B |= 1 << WGM13; //Prescalar 1 TCCR1B |= 1<< CS10; TCCR1B &= ~(1 << CS11); TCCR1B &= ~(1 << CS12); TCCR1A &= ~(1 << COM1A0); TCCR1A |= 1 << COM1A1; TCCR1A &= ~(1 << COM1B0); TCCR1A |= 1 << COM1B1; ICR1 = 511; OCR1A = 0; OCR1B = 0; TIMSK1 |= 1 << TOIE1; sei(); //===================================================================== //======================== OTHER THINGS ======================== //===================================================================== setAllVolumes(0); setAllDutyCycles(127); pinMode(A0, OUTPUT); //set OC1A pin to output pinMode(A1, OUTPUT); pinMode(A2, OUTPUT); //set OC1A pin to output pinMode(A3, OUTPUT); pinMode(A4, OUTPUT); //set OC1A pin to output pinMode(A5, OUTPUT); digitalWrite(A0,1); digitalWrite(A2,1); digitalWrite(A3,1); digitalWrite(A4,1); digitalWrite(A5,1); digitalWrite(A1,1); } void loop() { //WILL BE REMOVED int reading = analogRead(5); if(reading < 350) { setAllWaveforms(0); } else if(reading > 700) { setAllWaveforms(2); } else { setAllWaveforms(1); } reading = analogRead(4); reading >>= 2; setAllDutyCycles(byte(reading)); //=========================================================================== //====================== MIDI MIDI HANDLING ============================ //=========================================================================== if(MIDI.read() == true) { //do we get signal byte channel = MIDI.getChannel() - 1; //MIDI function returns 1-16. we want 0-15, to use as array indices byte type = MIDI.getType(); byte data1 = MIDI.getData1(); byte data2 = MIDI.getData2(); if(channel <= 3) { // is it within the number of channels? if(type == NoteOn && data2 != 0) { //is it a noteOn event, and not with 0 velocity? for(int i = 0; i <= maxPolyphony; i++) { if(i == maxPolyphony) { currentNotes[channel][lastWritten[channel]] = data1; //currentVelocities[channel][lastWritten[channel]] = data2; newNotes[channel][lastWritten[channel]] = true; break; } else if(currentNotes[channel][i] == 0) { currentNotes[channel][i] = data1; //currentVelocities[channel][i] = data2; newNotes[channel][i] = true; lastWritten[channel] = i; break; } } } else if(type == NoteOff || data2 == 0) { //is it a NoteOff event, for(int i = 0; i < maxPolyphony; i++) { if(currentNotes[channel][i] == data1) { currentNotes[channel][i] = 0; newNotes[channel][i] = true; break; } } } } } // End of midi MIDI handling //WILL BE REMOVED/MODIFIED for(int i = 0; i < maxPolyphony; i++) { if(newNotes[0][i]==true) { newNotes[0][i] = false; if(currentNotes[0][i] == 0) { oscillators[i].volume = 0; } else { int freq = midi2Freq(currentNotes[0][i]); setFreq(i, freq); } } } screen.scan(); //============================================================= //======= TESTING SCREEN+CHAR DISPLAY ==================== clearGrid(screen.red); clearGrid(screen.green); if(oscillators[0].volume > 0) { drawChar(screen.green, digits[1], 0, 0); } if(oscillators[1].volume > 0) { drawChar(screen.red, digits[3], 4, 0); } if(oscillators[2].volume > 0) { drawChar(screen.green, digits[3], 8, 0); } if(oscillators[3].volume > 0) { drawChar(screen.red, digits[7], 12, 0); } } //=========================================================================== //======================= ISR+ASSEMBLER STUFF ============================= //=========================================================================== ISR(TIMER1_OVF_vect) { //ASSEMBLER WOOT unsigned int ticks; byte phaseLow; byte volume; byte waveform; byte duty; OCR1A = outputA; byte loopVar; __asm__ volatile ( "ldi %A[outputA],0" "\n\t" "ldi %B[outputA],0" "\n\t" "ldi %[loopVar],4" "\n\t" "LoopBegin:" "\n\t" //Loads the two bytes of the ticks variable, and then the two bytes of the phase variable //The high byte of the phase variable goes right to the low byte of the wavetable index "ld %A[ticks],%a[oscBaseAddress]+" "\n\t" "ld %B[ticks],%a[oscBaseAddress]+" "\n\t" "ld %[phaseLow],%a[oscBaseAddress]" "\n\t" "ldd %A[waveformAddress],%a[oscBaseAddress]+1" "\n\t" //Update the phase variable in SRAM. Add ticks to it, then store the two resulting bytes "add %[phaseLow],%A[ticks]" "\n\t" "adc %A[waveformAddress],%B[ticks]" "\n\t" "st %a[oscBaseAddress]+,%[phaseLow]" "\n\t" "st %a[oscBaseAddress]+,%A[waveformAddress]" "\n\t" //Load the waveform select byte, then the duty cycle byte //The duty cycle byte is unused unless the waveform select == 0. //But the pointer address still needs to be incremented past it anyway "ld %[waveform],%a[oscBaseAddress]+" "\n\t" "ld %[dutyVol],%a[oscBaseAddress]+" "\n\t" //Is the waveform select 0? i.e., square wave? "tst %[waveform]" "\n\t" "brne NotSquare" "\n\t" //Compare the waveform sample to the duty cycle-first waveform is a sawtooth, standard PWM procedure //Output is 256 if >= dutycycle, 0 if < dutycycle "ld %[phaseLow],%a[waveformAddress]" "\n\t" "cp %[phaseLow],%[dutyVol]" "\n\t" "brlo SquareOff" "\n\t" "ser %[phaseLow]" "\n\t" "rjmp VolumeMult" "\n\t" "SquareOff:" "\n\t" "clr %[phaseLow]" "\n\t" "rjmp VolumeMult" "\n\t" //All other waveforms //Must be decremented - sawtooth waveform index is 0, but waveform select is 1 //Adds resulting waveform select value to the high byte of the wavetable address //Loads the sample, then subtracts the waveform select value, to reset the address "NotSquare:" "\n\t" "dec %[waveform]" "\n\t" "add %B[waveformAddress],%[waveform]" "\n\t" "ld %[phaseLow],%a[waveformAddress]" "\n\t" "sub %B[waveformAddress],%[waveform]" "\n\t" //256 possible volume levels. So to get the right % volume, multiply by the volume byte // then divide by 256. Easy, the mult operation does this for us. Just take the high byte // of the multiplication result. Then add the result to the output variable. "VolumeMult:" "\n\t" "ld %[dutyVol],%a[oscBaseAddress]+" "\n\t" "mul %[phaseLow],%[dutyVol]" "\n\t" "clr r0" "\n\t" "add %A[outputA],r1" "\n\t" "adc %B[outputA],r0" "\n\t" //Increment the loop variable. If it hasn't wrapped around to 0, go back to beginning of loop. "dec %[loopVar]" "\n\t" "brne LoopBegin" "\n\t" : //outputs [ticks] "=&d" (ticks), [phaseLow] "=&d" (phaseLow), [waveform] "=&d" (waveform), [dutyVol] "=&d" (duty), [outputA] "=&d" (outputA), [loopVar] "=&d" (loopVar) : //MIDIs [oscBaseAddress] "y" (&oscillators[0].ticks), [waveformAddress] "z" (&waveforms[0][0]) : //clobbered "r1" ); } //=========================================================================== //====================== OTHER GLOBAL FUNCTIONS =========================== //=========================================================================== int midi2Freq(byte note) { byte noteIndex = (note) % 12; //figure which value in note array corresponds to // recieved MIDI note byte noteOctave = (note) / 12; //figure out what octave the note is int Hz = notes[noteIndex] / (0x200 >> noteOctave); return Hz; } /*void setFreq(int voice, int freq, byte velocity) { // Ticks = Hz * 65536 / 31250 int ticks = freq*65535UL/31250; oscillators[voice].ticks = ticks; oscillators[voice].volume = velocity; }*/ void setFreq(int voice, int freq) { // Ticks = Hz * 65536 / 31250 int ticks = freq*65535UL/31250; oscillators[voice].ticks = ticks; oscillators[voice].volume = 128; } void setAllWaveforms(byte waveform) { for(int i = 0; i<= 7; i++) { oscillators[i].waveform = waveform; } } void setAllVolumes(byte volume) { for(int i = 0; i<= 7; i++) { oscillators[i].volume = volume; } } void setAllDutyCycles(byte dutyCycle) { for(int i = 0; i<= 7; i++) { oscillators[i].dutyCycle = dutyCycle; } }
306aa499514015a70aef1099fc1eb9b8ea13d54a
52b62a8f8987d19a2261d965a24dca525bec9fae
/include/webgl_object.h
2c71a42981a017216e75628d5a4698947c9a94ee
[ "MIT" ]
permissive
blockspacer/libhtml5
1266b626cc935b6359b051662a42800ae235d824
46e18a9122097b4d681c91f0747aa78a20611cab
refs/heads/master
2020-08-27T18:26:46.528499
2019-09-10T03:36:48
2019-09-10T03:36:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
192
h
webgl_object.h
#pragma once #include "html5.h" NAMESPACE_HTML5_BEGIN; class WebGLObject : public Object { public: WebGLObject(emscripten::val v); virtual ~WebGLObject(); }; NAMESPACE_HTML5_END;
5bc52e96ba1ecd7b37b8ca2f903654794d7c3829
9ae5edf1371569f182ba3dd87bd2414ec98f523c
/uva/graph_connectivity.cpp
467caa716365996a3f0bd575bb801951fea82d33
[]
no_license
Manan007224/street-coding
19000ed422563ca776053ec33adcd4e0b2734a8d
d3337805e0406684bcb3392898df163d315db624
refs/heads/master
2020-03-08T02:01:33.063948
2019-09-16T04:33:22
2019-09-16T04:33:22
127,847,522
1
0
null
2019-07-06T13:06:05
2018-04-03T03:47:59
C++
UTF-8
C++
false
false
795
cpp
graph_connectivity.cpp
#include <bits/stdc++.h> using namespace std; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> pii; typedef long long i64; #define pb push_back #define fi first #define se second int find(vector<int> &arr, int x) { if(arr[x] == x) return x; arr[x] = find(arr, arr[x]); return arr[x]; } void join(vector<int> &arr, int x, int y) { arr[find(arr, x)] = arr[find(arr, y)]; } int main() { int T; cin >> T; for(int t=0; t<T; t++) { string large; cin >> large; vector<int> arr; for(int i=0;i<=large[0]-65; i++) arr.pb(i); while(1) { string x ; cin >> x; if(x.length()==0) break; join(arr, x[0]-65, x[1]-65); } set<int> subgraphs; for(int i=0; i<arr.size(); i++) subgraphs.insert(arr[i]); cout << subgraphs.size() << endl; } return 0; }
f8b26b7f468ac52d5c73ce1587238c95b6c14c2e
9de1a0e29ff7c9dc2933368440aff6f6d62e9eba
/20/puzzle20.cpp
77a29d8a9b66a258c1ef14744cce3f59810f7f6d
[]
no_license
oatflake/aquaq_challenges
250584181425e3b80b745626179298c1f99afc6d
2eb5222f57e7360b280e6adc1ff222a210a6c3a5
refs/heads/main
2023-05-24T00:52:00.604844
2021-06-19T05:05:50
2021-06-19T05:05:50
376,616,122
0
0
null
null
null
null
UTF-8
C++
false
false
1,215
cpp
puzzle20.cpp
#include <iostream> #include <string> #include "../helper.h" auto readInput() { std::vector<std::vector<int>> result; auto lambda = [&](const std::string& line){ auto parts = split(line, " "); std::vector<int> cards; for (const auto& part : parts) { if (part == "J" || part == "Q" || part == "K") cards.push_back(10); else if (part == "A") cards.push_back(1); else cards.push_back(std::stoi(part)); } result.push_back(cards); }; readInputFile(lambda); return result; } int main() { int wins = 0; auto input = readInput(); for (const auto& cards : input) { int score = 0; bool haveAce = false; for (int card : cards) { if (card == 1) haveAce = true; score += card; if (score == 21 || (haveAce && score == 11)) { score = 0; haveAce = false; wins++; } if (score > 21) { score = 0; haveAce = false; } } } std::cout << wins << std::endl; return 0; }
2670a528bf4843147cfff288b2f678f50e32a5e7
c9737f2433be94df20ce6a78605e3168d761391e
/Training/bfs.cpp
a7bdde42f18133f6f8aa32a737400e0e0928ad60
[]
no_license
leehosu/coding-test-cpp
b8d0e3f5830e3cf1bd21d7780b8a4ce40ba96a2b
3946ac32d913354119a137f60dbdd89cad7bd852
refs/heads/master
2020-12-02T04:52:09.277796
2020-02-19T11:24:52
2020-02-19T11:24:52
230,893,844
0
0
null
2020-02-19T11:24:53
2019-12-30T10:14:18
C++
UTF-8
C++
false
false
778
cpp
bfs.cpp
#include<iostream> #include <queue> #include <vector> using namespace std; int num = 7; int visited[7]; vector<int> a[8]; void bfs(int start){ queue<int> q; q.push(start); visited[start] = true; while(!q.empty()){ int x = q.front(); q.pop(); cout << x<< "\n"; for(int i=0;i<a[x].size();i++){ int y = a[x][i]; if(!visited[y]){ q.push(y); visited[y] = true; } } } } int main(){ a[1].push_back(2); a[2].push_back(1); a[1].push_back(3); a[3].push_back(1); a[2].push_back(3); a[3].push_back(2); a[2].push_back(4); a[4].push_back(2); a[2].push_back(5); a[5].push_back(2); a[4].push_back(5); a[5].push_back(4); a[3].push_back(6); a[6].push_back(3); a[6].push_back(7); a[7].push_back(6); bfs(1); return 0; }
1309b088d0cfce1c0ff3413f8fb7dc82840eeeef
a8eecd61118a0d67c447eb2e83682196530fb445
/src/Magma/Serializable.hpp
4d1dc75c5898c7bb29af7c0936671cf0de0ff627
[ "BSD-3-Clause", "Zlib" ]
permissive
RiscadoA/Magma-Engine-2
226d838d569836edfd6bcc03e11a73dc47dd50f5
8a1471f7dcdf597dea3ba0bdb03ae31b10f86294
refs/heads/master
2021-09-04T17:21:14.684829
2018-01-20T08:37:33
2018-01-20T08:37:33
115,653,338
1
0
null
null
null
null
UTF-8
C++
false
false
2,156
hpp
Serializable.hpp
#pragma once #include "Exception.hpp" #include <fstream> #include <string> namespace Magma { /// <summary> /// Thrown when an object's serialization fails /// </summary> class FailedToSerializeException : public Exception { public: inline FailedToSerializeException(const char* msg) : Exception(msg) {} }; /// <summary> /// Thrown when an object's deserialization fails /// </summary> class FailedToDeserializeException : public Exception { public: inline FailedToDeserializeException(const char* msg) : Exception(msg) {} }; /// <summary> /// Allows derived classes to be serialized and deserialized from streams /// </summary> class Serializable { public: /// <summary> /// Reads this serializable from a file /// </summary> /// <exception cref="std::ifstream::failure">Thrown when file fails to open</exception> /// <exception cref="FailedToDeserializeException">Thrown when object fails to deserialize</exception> /// <param name="path">File path</param> inline void ReadFromFile(const std::wstring& path) { std::wifstream ifs; ifs.exceptions(std::wifstream::failbit | std::wifstream::badbit); ifs.open(path); this->Deserialize(ifs); } /// <summary> /// Writes this serializable to a file /// </summary> /// <exception cref="std::ofstream::failure">Thrown when file fails to open</exception> /// <exception cref="FailedToSerializeException">Thrown when object fails to serialize</exception> /// <param name="path">File path</param> inline void WriteToFile(const std::wstring& path) { std::wofstream ofs; ofs.exceptions(std::wofstream::failbit | std::wofstream::badbit); ofs.open(path); this->Serialize(ofs); } private: friend inline std::wostream& operator<<(std::wostream& stream, const Serializable& serializable) { serializable.Serialize(stream); return stream; } friend inline std::wistream& operator>>(std::wistream& stream, Serializable& serializable) { serializable.Deserialize(stream); return stream; } virtual void Serialize(std::wostream& stream) const = 0; virtual void Deserialize(std::wistream& stream) = 0; }; }
1658029bf3097e60c96f6c1d77e331bdd493e21f
6027629419f1885c98dd5be07bc4c2719a667a17
/TimeFutebol/TimeFutebol/Empresa.cpp
395ac2fc6efe66a0d213e0615b026b2c2d293515
[]
no_license
luizaq/prog2cpp
b164d780746019a3d44f7f1de1b0eb1c23948eab
dd8c637ad2be9344b528d23ca0f7327a3be5e192
refs/heads/main
2023-06-02T00:27:17.878787
2021-06-19T23:58:01
2021-06-19T23:58:01
364,073,403
0
0
null
null
null
null
UTF-8
C++
false
false
21
cpp
Empresa.cpp
#include "Empresa.h"
fdea77b50de8d08076e8ef9236c22bd80dafade5
325850abbaf25c4392d1742a47a55e00209b0bfa
/Lesson 11/Project1/Project1/Person.cpp
09318c2de6504c18060cfb9bedadf667c2761205
[]
no_license
ushockit/CPlusPlus
3c88c8b494632def73a28eeab78b14486524b67c
c0142f12ed5c1216fdb457b3b5fa55903bc71ee8
refs/heads/master
2023-03-09T17:55:46.382556
2021-02-27T10:04:27
2021-02-27T10:04:27
322,824,979
0
0
null
null
null
null
UTF-8
C++
false
false
504
cpp
Person.cpp
#include "Person.h" Person::Person() { firstName = lastName = ""; age = 0; } Person::Person(string firstName, string lastName, int age) : firstName(firstName), lastName(lastName), age(age) {} int Person::getAge() const { return age; } string Person::getFirstName() const { return firstName; } string Person::getLastName() const { return lastName; } ostream& operator<<(ostream& os, const Person& obj) { cout << obj.lastName << " " << obj.firstName << " " << obj.age << "y.o."; return os; }
142281bb984f6d1e759a00af5983ed665fe46bc2
bbe104f353922f315373538d707748f4dacf2f1a
/OpenGL/NetBeans/OpenGLTuto/Material.cpp
f6bc9e79544dbdec4d14f369d82bc404ae2637de
[]
no_license
ZAO29/3D-2D
4ed4bf103e24f04f7ef2c80b0987a7c52fe00298
a73b91b48aaf4ee23f650ba84f739235444429bc
refs/heads/master
2023-04-30T06:21:43.716570
2023-04-20T09:27:40
2023-04-20T09:27:40
163,847,390
0
0
null
null
null
null
UTF-8
C++
false
false
403
cpp
Material.cpp
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Material.cpp * Author: nicolas * * Created on October 1, 2019, 3:35 PM */ #include "Material.h" Material::Material() { } Material::Material(const Material& orig) { } Material::~Material() { }
201dc98426fdca91bd82d24f3c5ad2a06458900c
af5e823352405d0fec2528733e90f90112862d83
/codechef/SNCKQL19/chef-and-operations.cpp
def4ae9b8b276d15b78ddb37f39dd99d33c2f7fc
[]
no_license
sahilbajaj82/my-code-repo
3705fb9c04eeb579c9f3bc299cd16bf144573e45
bffc72d7bc87d6682aa225139a28cc770e53f1e4
refs/heads/master
2022-12-04T07:02:50.286754
2020-08-18T07:30:37
2020-08-18T07:30:37
225,840,339
2
0
null
null
null
null
UTF-8
C++
false
false
574
cpp
chef-and-operations.cpp
#include<bits/stdc++.h> using namespace std; int main() { int t; cin>>t; while(t--) { int n; cin>>n; int *a=new int[n]; int *b=new int[n]; for(int i=0;i<n;i++) cin>>a[i]; int flag=1; for(int i=0;i<n;i++){ cin>>b[i]; b[i]=b[i]-a[i]; if(b[i]<0) flag=0; } for(int i=0;i<n-2;i++) { if(b[i]>0) { b[i+2]=b[i+2]-3*b[i]; b[i+1]=b[i+1]-2*b[i]; b[i]=0; } if(b[i]<0) { flag=0; break; } } if(b[n-2]!=0) flag=0; if(b[n-1]!=0) flag=0; if(flag) cout<<"TAK\n"; else cout<<"NIE\n"; } return 0; }
ac4e326311899bf69693c5c23569d5c70ce2d863
05a8a544e70d3f1ddd633137fee423fa7a453c6e
/include/Strat/stratlaymodgen.h
5287b91cc9127b1fcfcb79a66f498c6e35d82bdb
[]
no_license
whztt1989/OpendTect
c55de13e802b14dfd30b6d74ce03999c0bf39e1a
602a5516e4d801edaa981e9943c6da17e3e56672
refs/heads/master
2021-01-12T17:37:49.093038
2016-10-20T13:16:04
2016-10-20T13:16:04
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,193
h
stratlaymodgen.h
#pragma once /*+ ________________________________________________________________________ (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt Author: Bert Date: Oct 2010 ________________________________________________________________________ -*/ #include "stratmod.h" #include "executor.h" namespace Strat { class LayerModel; class LayerSequence; class LayerSequenceGenDesc; /*!\brief Generates LayerSequences. */ mExpClass(Strat) LayerModelGenerator : public Executor { mODTextTranslationClass(LayerModelGenerator); public: LayerModelGenerator(const LayerSequenceGenDesc&, LayerModel&,int nrseqs=100); void setNrSeq( int nr ) { nrseqs_ = nr; } void reset(); virtual od_int64 nrDone() const { return seqnr_; } virtual od_int64 totalNr() const { return nrseqs_; } virtual uiString uiNrDoneText() const { return tr("Sequences generated"); } virtual uiString uiMessage() const { return msg_; } virtual int nextStep(); protected: const LayerSequenceGenDesc& desc_; LayerModel& lm_; uiString msg_; od_int64 nrseqs_; od_int64 seqnr_; }; }; // namespace Strat
5b804f3affe4bdc337a819b6cff870150690aa2f
cec0178fdd48c945d8e64502f458ba3a8463e5b4
/Classes/Addons/Addon.cpp
04dca4a0539930b1660a8590d9c0926e5a00b915
[]
no_license
Stals/TilesFight
6ecc8ac670c9bf43c661144d3dd7ec395147ef60
1f1829ae396e5a1abc2b38e570a1b049286888b8
refs/heads/master
2020-12-30T19:45:10.880504
2014-06-01T14:58:36
2014-06-01T14:58:36
15,360,061
0
0
null
null
null
null
UTF-8
C++
false
false
334
cpp
Addon.cpp
// // Addon.cpp // SampleGame // // Created by Stanislav Korotaev on 1/26/14. // Copyright (c) 2014 Bullets in a Burning Box, Inc. All rights reserved. // #include "Addon.h" Addon::Addon(Hexagon* hex, Addon::Type type): hex(hex), addonType(type) { CCNode::init(); } Addon::Type Addon::getType() const { return addonType; }
a6d7793429be5faca41fb179a517b69f492a00ec
21a23e713a7121f1553d45a9bcf9c320f6e5a235
/src/src/ExecuteVictimInteraction.h
f794c9e26e127a64ac5ae35cd53c594ae5cdca18
[]
no_license
Shtivi/RDR2-Bounties-Expansion
0615941076dd0b5c331a0c76a1ec7070f6d9345c
cfe60086beb08e053d206db4bc352ce451b69ebd
refs/heads/master
2021-07-18T13:41:06.739209
2021-05-15T13:58:12
2021-05-15T13:58:12
248,749,278
4
5
null
2020-10-20T17:06:11
2020-03-20T12:24:57
C++
UTF-8
C++
false
false
659
h
ExecuteVictimInteraction.h
#include "Main.h"; class ExecuteVictimInteraction : public SyncPlayable { private: Ped victim; Ped killer; public: ExecuteVictimInteraction(Ped victim, Ped killer) { this->victim = victim; this->killer = killer; } void play() { Vector3 position = ENTITY::GET_ENTITY_COORDS(killer, 1, 1); Object seq; AI::OPEN_SEQUENCE_TASK(&seq); /*AI::TASK_GO_TO_ENTITY(0, victim, 10000, 1.0f, 1, 0, 0); AI::TASK_COMBAT_PED(0, victim, 0, 16);*/ AI::_0x779A2FFACEFAEA7B(0, victim, 0, 1, 1.0f, 1, 0); AI::CLOSE_SEQUENCE_TASK(seq); AI::CLEAR_PED_TASKS(killer, 1, 1); AI::TASK_PERFORM_SEQUENCE(killer, seq); AI::CLEAR_SEQUENCE_TASK(&seq); } };
db9cac13ab330822b9e0dbed1315f60f2f9fe9bc
842adb07f7901f2f9cf2d006eff6c4d5dc5d337b
/PA3/Scheduler.h
b2deb7e4ff0de0e0f43e5decba0bd83c96166308
[]
no_license
acckaufman/Doc-Office-Scheduler-AADS
0034bdd3d88510cf3118be63224a56dd08ae16ba
f14c45ba9b9d6040e2a634658ee714f9fa7669ef
refs/heads/master
2021-01-11T13:38:31.399930
2017-06-21T21:26:28
2017-06-21T21:26:28
95,047,420
0
0
null
null
null
null
UTF-8
C++
false
false
32,762
h
Scheduler.h
//Amanda Kaufman //CISS 350A //Programming Assignment 3 //This is a scheduler data structure that holds a list of exam rooms in a doctor's office //and has functions to check doctors and patients in and out of the clinic. #pragma once #include <iomanip> #include <string> #include <fstream> #include <cstddef> //For NULL #include <new> //For bad_alloc #include "QueType.h" using namespace std; //Structure to contain a doctor's information. struct Doctor { string name; string specialty; }; //For some reason, the program wanted the Patient struct in QueType.h and not here //Structure to hold an exam room's information and the waitlist of patients. struct ExamRoom { int roomNum; bool available; Doctor roomDoctor; Patient currentPatient; int waitLength; QueType WaitList; }; //Constant for the number of rooms at the doctor's office. const int NUM_ROOMS = 100; //Scheduler class that performs essential functions for a doctor's office, such as //doctor and patient check-in and check-out, and assigning patients to doctors. class Scheduler { private: //List of exam rooms at the doctor's office. ExamRoom roomList[NUM_ROOMS]; public: //########################################################################################### //Constructor/Destructor. # //########################################################################################### Scheduler() { //Initialize a blank Doctor object for use in the list. Doctor tempDoctor; tempDoctor.name = ""; tempDoctor.specialty = ""; //Initialize a blank Patient object for use in the list. Patient tempPatient; tempPatient.name = ""; tempPatient.age = 0; tempPatient.specialty = ""; tempPatient.emergency = false; //Initialize a set of defaults for the exam rooms in the doctor's office. ExamRoom tempRoom; tempRoom.available = true; tempRoom.roomDoctor = tempDoctor; tempRoom.currentPatient = tempPatient; tempRoom.waitLength = 0; //Assign the defaults to each ExamRoom item in the array. for (int index = 0; index < NUM_ROOMS; index++) { roomList[index] = tempRoom; roomList[index].roomNum = (index + 1); } } ~Scheduler() { //Make all wait lists empty. for (int index = 0; index < NUM_ROOMS; index++) { roomList[index].WaitList.makeEmpty(); //Deallocates any memory used by the waitlists. } } //########################################################################################### //Print functions. # //########################################################################################### //Function to print information about all rooms in the doctor's office. //Primarily used for debugging purposes. void printRoomList(ofstream &outFile) { //Output to screen cout << "Room List\n==============================================================================\n"; cout << left << setw(8) << "Room #"; cout << left << setw(10) << "Available"; cout << left << setw(20) << "Doctor's Name"; cout << left << setw(10) << "Specialty"; cout << left << setw(20) << "Current Patient"; cout << left << setw(10) << "Wait List"; cout << "\n------------------------------------------------------------------------------\n"; for (int index = 0; index < NUM_ROOMS; index++) { cout << left << setw(8) << roomList[index].roomNum; if (roomList[index].available == true) cout << left << setw(10) << "YES"; else cout << left << setw(10) << "NO"; cout << left << setw(20) << roomList[index].roomDoctor.name; cout << left << setw(10) << roomList[index].roomDoctor.specialty; cout << left << setw(20) << roomList[index].currentPatient.name; cout << left << setw(10) << roomList[index].waitLength; cout << endl; } cout << endl; //Echo to output file outFile << "Room List\n==========================================================\n"; outFile << left << setw(8) << "Room #"; outFile << left << setw(10) << "Available"; outFile << left << setw(20) << "Doctor's Name"; outFile << left << setw(10) << "Specialty"; outFile << left << setw(10) << "Wait List"; outFile << "----------------------------------------------------------\n"; for (int index = 0; index < NUM_ROOMS; index++) { outFile << left << setw(8) << roomList[index].roomNum; if (roomList[index].available == true) outFile << left << setw(10) << "YES"; else outFile << left << setw(10) << "NO"; outFile << left << setw(20) << roomList[index].roomDoctor.name; outFile << left << setw(10) << roomList[index].roomDoctor.specialty; outFile << left << setw(10) << roomList[index].waitLength; outFile << endl; } outFile << endl; system("pause"); } //Function to print waitlist information for a particular room passed as an argument. //Primarily used for debugging purposes. void printWaitList(int index, ofstream &outFile) { //Temporary patient object for display purposes. Patient temp; cout << "Room #" << (index + 1) << " waitlist currently has " << roomList[index].waitLength << " patients.\n"; cout << "They are:\n"; for (int count = 0; count < roomList[index].waitLength; count++) { temp = roomList[index].WaitList.getPatient(count); cout << temp.name << ", age " << temp.age << ", specialty code " << temp.specialty << endl; } system("pause"); } //########################################################################################### //Accessor functions. # //########################################################################################### //########################################################################################### //Mutator functions. # //########################################################################################### //Function to check in a doctor. Gets doctor's information and checks to see if the //preferred room is available. Assigns doctor to that room if it is free. void doctorCheckIn(ofstream &outFile) { //Temporary variables to hold information for check-in string doctorName; int specialtyInput; string specialtyCode; int prefRoomNum; //Get the doctor's name for check-in. cout << "\nEnter your name: "; outFile << "\nEnter your name: "; getline(cin, doctorName, '\n'); outFile << doctorName << endl; //Validate the doctor's name is not too long. while (doctorName.length() > 20) { cout << "Error! Name must be 20 characters or less. Please try again.\n"; outFile << "Error! Name must be 20 characters or less. Please try again.\n"; cout << "Enter your name: "; outFile << "Enter your name: "; getline(cin, doctorName, '\n'); outFile << doctorName << endl; } //Get the doctor's specialty code for check-in. cout << "What is your specialty code? Select from the list below:\n\n"; outFile << "What is your specialty code? Select from the list below:\n\n"; cout << "\t1. PED\t\tPediatrics\n" << "\t2. GEN\t\tGeneral Practice\n" << "\t3. INT\t\tInternal Medicine\n" << "\t4. CAR\t\tCardiology\n" << "\t5. SUR\t\tSurgeon\n" << "\t6. OBS\t\tObstetrics\n" << "\t7. PSY\t\tPsychiatry\n" << "\t8. NEU\t\tNeurology\n" << "\t9. ORT\t\tOrthopedics\n" << "\t10. DET\t\tDermatology\n" << "\t11. OPT\t\tOpthalmology\n" << "\t12. ENT\t\tEar, Nose, and Throat\n\n"; outFile << "\t1. PED\t\tPediatrics\n" << "\t2. GEN\t\tGeneral Practice\n" << "\t3. INT\t\tInternal Medicine\n" << "\t4. CAR\t\tCardiology\n" << "\t5. SUR\t\tSurgeon\n" << "\t6. OBS\t\tObstetrics\n" << "\t7. PSY\t\tPsychiatry\n" << "\t8. NEU\t\tNeurology\n" << "\t9. ORT\t\tOrthopedics\n" << "\t10. DET\t\tDermatology\n" << "\t11. OPT\t\tOpthalmology\n" << "\t12. ENT\t\tEar, Nose, and Throat\n\n"; cout << "Enter your selection: "; outFile << "Enter your selection: "; cin >> specialtyInput; outFile << specialtyInput << endl; //Validate the user's input. while (specialtyInput < 1 || specialtyInput > 12) { cout << "Error! That is not a valid menu choice. Please try again: "; outFile << "Error! That is not a valid menu choice. Please try again: "; cin >> specialtyInput; outFile << specialtyInput << endl; } //Assign a specialty code based on the number entered above. switch (specialtyInput) { case 1: specialtyCode = "PED"; break; case 2: specialtyCode = "GEN"; break; case 3: specialtyCode = "INT"; break; case 4: specialtyCode = "CAR"; break; case 5: specialtyCode = "SUR"; break; case 6: specialtyCode = "OBS"; break; case 7: specialtyCode = "PSY"; break; case 8: specialtyCode = "NEU"; break; case 9: specialtyCode = "ORT"; break; case 10: specialtyCode = "DET"; break; case 11: specialtyCode = "OPT"; break; case 12: specialtyCode = "ENT"; break; default: specialtyCode = "GEN"; break; } //Get the doctor's preferred room number. cout << "What room number do you prefer? (1-100): "; outFile << "What room number do you prefer? (1-100): "; cin >> prefRoomNum; outFile << prefRoomNum << endl; //Validate the user's input. while (prefRoomNum < 1 || prefRoomNum > 100) { cout << "Error! Must enter a room number between 1 and 100. Please try again.\n"; outFile << "Error! Must enter a room number between 1 and 100. Please try again.\n"; cout << "What room number do you prefer? (1-100): "; outFile << "What room number do you prefer? (1-100): "; cin >> prefRoomNum; outFile << prefRoomNum << endl; } //Check to see if the doctor's preferred room is available. //If it isn't, output an error message and ask for a new room number. while (roomList[prefRoomNum - 1].available == false) { cout << "\nThat room is currently taken. Please enter a different room number.\n"; outFile << "\nThat room is currently taken. Please enter a different room number.\n"; cout << "\nCurrently available rooms are:\n"; outFile << "\nCurrently available rooms are:\n"; for(int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].available == true) { cout << roomList[index].roomNum << " "; outFile << roomList[index].roomNum << " "; } } cout << "\n\nEnter your next room choice: "; outFile << "\n\nEnter your next room choice: "; cin >> prefRoomNum; outFile << prefRoomNum << endl; } //Assign the doctor to the room in question. //Set the room's availability to "false" in the roomList array. roomList[prefRoomNum - 1].available = false; //Create a temporary doctor object and assign the input from the user to its fields. Doctor tempDoctor; tempDoctor.name = doctorName; tempDoctor.specialty = specialtyCode; //Assign the Doctor object to the room in the roomList array. roomList[prefRoomNum - 1].roomDoctor = tempDoctor; //Output a message telling the doctor that he/she was successfully checked in. cout << "\nYou have been successfully checked in.\n\n"; outFile << "\nYou have been successfully checked in.\n\n"; system("pause"); } //Function to check in a patient. Gets patient's information and calls a function to //find a doctor for the patient. void patientCheckIn(ofstream &outFile) { //Temporary variables to hold information for check-in string patientName; int patientAge; int specialtyInput; string specialtyCode; char emergency; bool emergencyStatus; //Get the patient's name for check-in. cout << "\nEnter your name: "; outFile << "\nEnter your name: "; getline(cin, patientName, '\n'); outFile << patientName << endl; //Validate the patient's name is not too long. while (patientName.length() > 20) { cout << "Error! Name must be 20 characters or less. Please try again.\n"; outFile << "Error! Name must be 20 characters or less. Please try again.\n"; cout << "Enter your name: "; outFile << "Enter your name: "; getline(cin, patientName, '\n'); outFile << patientName << endl; } //Get the patient's age cout << "Enter your age: "; outFile << "Enter your age: "; cin >> patientAge; outFile << patientAge << endl; //Validate the input. while (patientAge < 0) { cout << "Error! You must enter a positive number. Please try again.\n"; outFile << "Error! You must enter a positive number. Please try again.\n"; cout << "Enter your age: "; outFile << "Enter your age: "; cin >> patientAge; outFile << patientAge << endl; } //Get the patient's specialty code for check-in. //If the patient is under 16 years of age, specialty is automatically PED. if (patientAge < 16) { specialtyInput = 1; cout << "Your specialty is: PED.\n"; outFile << "Your specialty is: PED.\n"; } //If the patient is 16 or older, find out what specialty they need. else { cout << "What specialty do you need? Select from the list below:\n\n"; outFile << "What specialty do you need? Select from the list below:\n\n"; cout << "\t1. PED\t\tPediatrics\n" << "\t2. GEN\t\tGeneral Practice\n" << "\t3. INT\t\tInternal Medicine\n" << "\t4. CAR\t\tCardiology\n" << "\t5. SUR\t\tSurgeon\n" << "\t6. OBS\t\tObstetrics\n" << "\t7. PSY\t\tPsychiatry\n" << "\t8. NEU\t\tNeurology\n" << "\t9. ORT\t\tOrthopedics\n" << "\t10. DET\t\tDermatology\n" << "\t11. OPT\t\tOpthalmology\n" << "\t12. ENT\t\tEar, Nose, and Throat\n\n"; outFile << "\t1. PED\t\tPediatrics\n" << "\t2. GEN\t\tGeneral Practice\n" << "\t3. INT\t\tInternal Medicine\n" << "\t4. CAR\t\tCardiology\n" << "\t5. SUR\t\tSurgeon\n" << "\t6. OBS\t\tObstetrics\n" << "\t7. PSY\t\tPsychiatry\n" << "\t8. NEU\t\tNeurology\n" << "\t9. ORT\t\tOrthopedics\n" << "\t10. DET\t\tDermatology\n" << "\t11. OPT\t\tOpthalmology\n" << "\t12. ENT\t\tEar, Nose, and Throat\n\n"; cout << "Enter your selection: "; outFile << "Enter your selection: "; cin >> specialtyInput; outFile << specialtyInput << endl; //Validate the user's input. while (specialtyInput < 1 || specialtyInput > 12) { cout << "Error! That is not a valid menu choice. Please try again: "; outFile << "Error! That is not a valid menu choice. Please try again: "; cin >> specialtyInput; outFile << specialtyInput << endl; } } //Assign a specialty code based on the number entered above. switch (specialtyInput) { case 1: specialtyCode = "PED"; break; case 2: specialtyCode = "GEN"; break; case 3: specialtyCode = "INT"; break; case 4: specialtyCode = "CAR"; break; case 5: specialtyCode = "SUR"; break; case 6: specialtyCode = "OBS"; break; case 7: specialtyCode = "PSY"; break; case 8: specialtyCode = "NEU"; break; case 9: specialtyCode = "ORT"; break; case 10: specialtyCode = "DET"; break; case 11: specialtyCode = "OPT"; break; case 12: specialtyCode = "ENT"; break; default: specialtyCode = "GEN"; break; } cin.ignore(); //Clear the keyboard buffer //Get the patient's emergency status. cout << "Is this an emergency? (y/n): "; outFile << "Is this an emergency? (y/n): "; emergency = cin.get(); //Assign an emergency status to the patient if they entered a y or Y. if (emergency == 'y' || emergency == 'Y') emergencyStatus = true; else emergencyStatus = false; //Create a temporary patient object to add to the waitlist. Patient tempPatient; tempPatient.name = patientName; tempPatient.age = patientAge; tempPatient.specialty = specialtyCode; tempPatient.emergency = emergencyStatus; //Pass the tempPatient object to a function that will assign it to a doctor and exam room //based on the information entered. assignDoctor(tempPatient, outFile); } //Function to assign a patient to a doctor and exam room. If there are no doctors available //with the patient's specialty, function outputs a message. If there are multiple doctors //with the patient's specialty, function assigns the patient to the doctor/exam room with the //shortest wait list. void assignDoctor(Patient newPatient, ofstream &outFile) { int shortestWaitIndex = 0; //Holds the index of the room with the shortest wait bool foundDoctor = false; //Flag to indicate when doctor is found //If patient is less than 16 years of age, assign them to a pediatrician. if (newPatient.age < 16) { //Search for the first pediatrician in the list, and assign shortestWaitIndex //to the index of that doctor. for (int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].roomDoctor.specialty == "PED") { // Assign the index of that room to the shortestWaitIndex variable for comparison shortestWaitIndex = index; foundDoctor = true; //Flag that we found at least one doctor index = NUM_ROOMS; //Stop the for loop from continuing } } //If no doctor was found, output a message to the user. if (!foundDoctor) { cout << "\nSorry, " << newPatient.name << ", there are currently no pediatricians available.\n" << "Please check back soon.\n\n"; outFile << "\nSorry, " << newPatient.name << ", there are currently no pediatricians available.\n" << "Please check back soon.\n\n"; system("pause"); } //Otherwise, if a doctor was found, go through the rest of the list and find other pediatricians, //using the shortestWaitIndex to find the index of the room with the shortest wait list. //Assign the patient to the room with the shortest wait list. else { for (int count = shortestWaitIndex; count < NUM_ROOMS; count++) { //If the doctor assigned to this room is a pediatrician and the wait list length of //the room is shorter than the list of the room at shortestWaitIndex, set the //shortestWaitIndex variable to this room. if (roomList[count].roomDoctor.specialty == "PED" && roomList[count].waitLength < roomList[shortestWaitIndex].waitLength) { shortestWaitIndex = count; } } //If the current patient's name in the room with the shortest wait list is blank, there is //not currently a patient in the room, so assign this patient as the current one and keep the //wait list length at 0. if (roomList[shortestWaitIndex].currentPatient.name == "") { roomList[shortestWaitIndex].currentPatient = newPatient; //Inform the patient that they can go get seen right away. cout << endl << newPatient.name << ", you can get seen right away by Dr. " << roomList[shortestWaitIndex].roomDoctor.name << "\n" << "in room " << (shortestWaitIndex + 1) << "! Please go there now.\n\n"; outFile << endl << newPatient.name << ", you can get seen right away by Dr. " << roomList[shortestWaitIndex].roomDoctor.name << "\n" << "in room " << (shortestWaitIndex + 1) << "! Please go there now.\n\n"; system("pause"); //Debugging purposes: print the wait list //printWaitList(shortestWaitIndex, outFile); } //Otherwise, add this patient to the wait list and increment the wait list length. else { try { roomList[shortestWaitIndex].WaitList.enqueue(newPatient); roomList[shortestWaitIndex].waitLength += 1; //Inform the user that they are on the wait list. cout << endl << newPatient.name << ", you will be number " << roomList[shortestWaitIndex].waitLength << " on the wait list to see\n" << "Dr. " << roomList[shortestWaitIndex].roomDoctor.name << " in room " << (shortestWaitIndex + 1) << ". " << "Please go there now.\n\n"; outFile << endl << newPatient.name << ", you will be number " << roomList[shortestWaitIndex].waitLength << " on the wait list to see\n" << "Dr. " << roomList[shortestWaitIndex].roomDoctor.name << " in room " << (shortestWaitIndex + 1) << ". " << "Please go there now.\n\n"; system("pause"); } catch (FullQueue exception) { cout << "Error! There is no more room in memory for another patient.\n\n"; outFile << "Error! There is no more room in memory for another patient.\n\n"; } } } } //End of if patient is younger than 16 //For all other patients, search for a doctor according to the specialty requested. //If no doctor is available, search for a general practitioner (GEN). //If there is no general practitioner, the patient is assigned to any doctor //with the shortest wait list. else { //Search for the first doctor in the list that matches the patient's specialty, //and assign shortestWaitIndex to the index of that doctor. for (int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].roomDoctor.specialty == newPatient.specialty) { // Assign the index of that room to the shortestWaitIndex variable for comparison shortestWaitIndex = index; foundDoctor = true; //Flag that we found at least one doctor index = NUM_ROOMS; //Stop the for loop from continuing } } //If a doctor was found, go through the rest of the list and search for any additional doctors //of the same specialty and find the one with the shortest wait list. if (foundDoctor) { for (int count = shortestWaitIndex; count < NUM_ROOMS; count++) { //If the doctor assigned to this room matches the patient's specialaty and the wait list length of //the room is shorter than the list of the room at shortestWaitIndex, set the shortestWaitIndex //variable to this room. if (roomList[count].roomDoctor.specialty == newPatient.specialty && (roomList[count].waitLength < roomList[shortestWaitIndex].waitLength || roomList[count].currentPatient.name == "")) { shortestWaitIndex = count; } } } //Otherwise, if no doctor matching the specialty of the patient was found, attempt to find //a general practitioner for the patient. else { //Search for the first general practitioner in the list, and assign shortestWaitIndex to the index of that doctor. for (int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].roomDoctor.specialty == "GEN") { // Assign the index of that room to the shortestWaitIndex variable for comparison shortestWaitIndex = index; foundDoctor = true; //Flag that we found at least one doctor index = NUM_ROOMS; //Stop the for loop from continuing } } //If a general practitioner was found, go through the rest of the list and search for any additional general //practitioners and find the one with the shortest wait list. if (foundDoctor) { for (int count = shortestWaitIndex; count < NUM_ROOMS; count++) { //If the doctor assigned to this room is a general practitioner and the wait list length of //the room is shorter than the list of the room at shortestWaitIndex, set the shortestWaitIndex //variable to this room. if (roomList[count].roomDoctor.specialty == "GEN" && (roomList[count].waitLength < roomList[shortestWaitIndex].waitLength || roomList[count].currentPatient.name == "")) { shortestWaitIndex = count; } } } //Otherwise, if no general practitioner was found, go through the entire list (regardless of specialty) //and find the doctor of any type with the shortest wait list to serve the patient. else { for (int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].roomDoctor.specialty != "") { // Assign the index of that room to the shortestWaitIndex variable for comparison shortestWaitIndex = index; foundDoctor = true; //Flag that we found at least one doctor index = NUM_ROOMS; //Stop the for loop from continuing } } //If any doctor was found, go through the rest of the list and search for any additional doctors //and find the one with the shortest wait list. if (foundDoctor) { for (int count = shortestWaitIndex; count < NUM_ROOMS; count++) { //If the wait list length of this room is shorter than the list of the room at shortestWaitIndex, //set the shortestWaitIndex variable to this room. if (roomList[count].roomDoctor.specialty != "" && (roomList[count].waitLength < roomList[shortestWaitIndex].waitLength || roomList[count].currentPatient.name == "")) { shortestWaitIndex = count; } } } } } //If a doctor was found, assign the patient to that room and doctor. if (foundDoctor) { //If the current patient's name in the room with the shortest wait list is blank, there is //not currently a patient in the room, so assign this patient as the current one and keep the //wait list length at 0. if (roomList[shortestWaitIndex].currentPatient.name == "") { roomList[shortestWaitIndex].currentPatient = newPatient; //Inform the patient that they can go get seen right away. cout << endl << newPatient.name << ", you can get seen right away by Dr. " << roomList[shortestWaitIndex].roomDoctor.name << "\n" << "in room " << (shortestWaitIndex + 1) << "! Please go there now.\n\n"; outFile << endl << newPatient.name << ", you can get seen right away by Dr. " << roomList[shortestWaitIndex].roomDoctor.name << "\n" << "in room " << (shortestWaitIndex + 1) << "! Please go there now.\n\n"; system("pause"); } //Otherwise, add this patient to the wait list and increment the wait list length. else { try { roomList[shortestWaitIndex].WaitList.enqueue(newPatient); roomList[shortestWaitIndex].waitLength += 1; //Inform the user that they are on the wait list. cout << endl << newPatient.name << ", you will be number " << roomList[shortestWaitIndex].waitLength << " on the wait list to see\n" << "Dr. " << roomList[shortestWaitIndex].roomDoctor.name << " in room " << (shortestWaitIndex + 1) << ". " << "Please go there now.\n\n"; outFile << endl << newPatient.name << ", you will be number " << roomList[shortestWaitIndex].waitLength << " on the wait list to see\n" << "Dr. " << roomList[shortestWaitIndex].roomDoctor.name << " in room " << (shortestWaitIndex + 1) << ". " << "Please go there now.\n\n"; system("pause"); } catch (FullQueue exception) { cout << "Error! There is no more room in memory for another patient.\n\n"; outFile << "Error! There is no more room in memory for another patient.\n\n"; } //Debugging purposes: print the wait list. //printWaitList(shortestWaitIndex, outFile); } } //Otherwise, if no doctor was found, inform the patient that there are currently no doctors in the clinic. else { cout << "\nSorry, " << newPatient.name << ", there are currently no doctors available.\n" << "Please check back soon.\n\n"; outFile << "\nSorry, " << newPatient.name << ", there are currently no doctors available.\n" << "Please check back soon.\n\n"; system("pause"); } } /* Debugging purposes: cout << "Debugging purposes:\n"; cout << "Room index " << shortestWaitIndex << " was modified.\n"; cout << "The wait list for room #" << (shortestWaitIndex + 1) << " now has " << roomList[shortestWaitIndex].waitLength << " patients.\n\n"; system("pause"); */ } //Function to check out a patient. Checks the room's wait list to see if there are any other //patients waiting. If there are, function dequeues the next patient from the front of the //wait list and assigns it to the current room, then subtracts 1 from waitlist length. void patientCheckOut(ofstream &outFile) { //String for patient's name input string patientName; cout << "\nEnter your name: "; outFile << "\nEnter your name: "; getline(cin, patientName, '\n'); outFile << patientName << endl; bool patientFound = false; for (int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].currentPatient.name == patientName) { patientFound = true; //Flag that we found a patient //If there is a wait list for the room, dequeue the next patient from the front //of the wait list and assign it to the currentPatient object in the room. //Decrement the length of the wait list. if (roomList[index].waitLength > 0) { try { roomList[index].WaitList.dequeue(roomList[index].currentPatient); roomList[index].waitLength -= 1; } catch (EmptyQueue exception) { cout << "Error! List is empty.\n\n"; outFile << "Error! List is empty.\n\n"; } } //Otherwise, if there is no wait list, clear all the fields in currentPatient. else { roomList[index].currentPatient.name = ""; roomList[index].currentPatient.age = 0; roomList[index].currentPatient.specialty = ""; roomList[index].currentPatient.emergency = false; } /* Debugging purposes cout << "Room index " << index << " was modified.\n"; cout << "The wait list for room #" << (index + 1) << " is now " << roomList[index].waitLength << " patients.\n\n"; //Debugging purposes: Print the wait list. printWaitList(index, outFile); */ //Output a message to the user saying that their check-out was successful. cout << endl << patientName << ", you have successfully checked out from room #" << (index + 1) << ".\n\n"; outFile << endl << patientName << ", you have successfully checked out from room #" << (index + 1) << ".\n\n"; index = NUM_ROOMS; //To stop the for loop from continuing } } if (!patientFound) { cout << "\nSorry, no patient with that name is currently being seen.\n" << "If you have checked in, please wait to be seen before you check out.\n\n"; outFile << "\nSorry, no patient with that name is currently being seen.\n" << "If you have checked in, please wait to be seen before you check out.\n\n"; } system("pause"); } //Function to check out a doctor. If the doctor has any patients on the wait list for his room, //those patients are assigned to other doctors. void doctorCheckOut(ofstream &outFile) { //Temporary holder for patients that need to get reassigned to new doctors. Patient reassignPatient; //String for doctor's name input string doctorName; cout << "\nEnter your name: "; outFile << "\nEnter your name: "; getline(cin, doctorName, '\n'); outFile << doctorName << endl; bool foundDoctor = false; //Flag for when doctor is found //Search the list of rooms for the doctor that is checking out. for (int index = 0; index < NUM_ROOMS; index++) { if (roomList[index].roomDoctor.name == doctorName) { foundDoctor = true; //Inform the user that the doctor was found and that they are being checked out. cout << "\nDoctor found. Now initiating doctor check-out process.\n\n"; outFile << "\nDoctor found. Now initiating doctor check-out process.\n\n"; //Clear the roomDoctor object so this doctor won't pop up when reassigning patients. roomList[index].roomDoctor.name = ""; roomList[index].roomDoctor.specialty = ""; //Clear any information on a patient currently being seen by the doctor. roomList[index].currentPatient.name = ""; roomList[index].currentPatient.age = 0; roomList[index].currentPatient.specialty = ""; roomList[index].currentPatient.emergency = false; //Set the room's status back to available roomList[index].available = true; //Pop each patient from the wait list and reassign them to other doctors in the clinic. for (int count = 0; count < roomList[index].waitLength; count++) { try { roomList[index].WaitList.dequeue(reassignPatient); cout << "Note: Patient named " << reassignPatient.name << " has been reassigned."; outFile << "Note: Patient named " << reassignPatient.name << " has been reassigned."; assignDoctor(reassignPatient, outFile); } catch (EmptyQueue exception) { cout << "Error! List is empty.\n\n"; outFile << "Error! List is empty.\n\n"; } } //Output a message to the doctor saying that their check-out was successful. cout << endl << doctorName << ", you have successfully checked out from room #" << (index + 1) << ".\n\n"; outFile << endl << doctorName << ", you have successfully checked out from room #" << (index + 1) << ".\n\n"; index = NUM_ROOMS; //Stop the for loop from continuing } } if (!foundDoctor) { cout << "\nSorry, we couldn't find a doctor with that name in the clinic right now.\n\n"; outFile << "\nSorry, we couldn't find a doctor with that name in the clinic right now.\n\n"; } system("pause"); } };
e4bf41a9a40ed4cad0a7983e7e5bcc05672afe9a
b88c23a80df02c5214bf62c968a0479d7f2b74f9
/test/test-600-others/sources/tools/synch/test-synch-cpp98.cpp
a12dbb273ba409fc2506a1d1af8740b78740fb95
[ "MIT" ]
permissive
Kartonagnick/tools
6458cab1754a9d521755781f4301428189780fad
5e4027d9e734adff375b6d56092ffb80364a0389
refs/heads/master
2023-04-28T15:15:42.141295
2021-05-16T20:39:09
2021-05-16T20:39:15
340,688,558
0
0
MIT
2021-03-17T20:34:52
2021-02-20T15:35:50
C++
UTF-8
C++
false
false
2,823
cpp
test-synch-cpp98.cpp
// [2021y-02m-21d][23:57:05] Idrisov Denis R. #include <mygtest/modern.hpp> //============================================================================== //============================================================================== #ifdef TEST_TOOLS_SYNCH #ifdef _MSC_VER #define dTEST_COMPONENT tools #define dTEST_METHOD synch #define dTEST_TAG cpp98 #include <tools/synch.hpp> #include <tools/windows.hpp> #include <process.h> namespace me = ::tools; //============================================================================== //=== TDD ====================================================================== namespace { struct param { bool dir; size_t limit; }; size_t begin = 0; size_t ready = 0; size_t value = 0; me::synch sync; void threadFunction(void* ptr) { ASSERT_TRUE(ptr); const param& ref = *static_cast<const param*>(ptr); dprint(std::cout << "started " << ref.dir << " " << ref.limit << std::endl); ++begin; while (begin != 2) ::Sleep(30); for (size_t i = 0; i < ref.limit; ++i) { if (ref.dir) { me::synch_guard lock(sync); ++value; } else { me::synch_guard lock(sync); --value; } } me::synch_guard lock(sync); ++ready; } size_t count_positive = 2000000; size_t count_negative = 1000000; void prepare() { count_negative = testing::stress ? 1000000 : 100; count_positive = count_negative * 2; begin = 0; ready = 0; value = 0; } } // namespace //============================================================================== //============================================================================== TEST_COMPONENT(000) { #ifdef INCLUDE_LONG_LONG_TESTS const size_t total = 10; #elif defined (INCLUDE_LONG_TESTS) const size_t total = 5; #else const size_t total = 1; #endif prepare(); ::param positive = { true , count_positive }; ::param negative = { false, count_negative }; for (size_t i = 0; i != total; ++i) { prepare(); dprint(std::cout << "generation(" << count_negative << "): " << i + 1 << "/" << total << '\n'); const uintptr_t re = ::_beginthread(::threadFunction, 0, &positive); ASSERT_TRUE(re != -1); ::threadFunction(&negative); while (ready != 2) ::Sleep(30); ASSERT_TRUE(value == count_negative) << "value = " << value << '\n'; } ::Sleep(30); } //============================================================================== #endif // !_MSC_VER #endif // !TEST_TOOLS_SYNCH
1c483d52e33c645668cae07c1053846784a7749b
03666e5f961946fc1a0ac67781ac1425562ef0d7
/src/avt/Pipeline/Pipeline/avtContract.h
ed64fcce257838596b1ed75332cd9eeae1ee779d
[ "BSD-3-Clause", "LicenseRef-scancode-unknown-license-reference" ]
permissive
visit-dav/visit
e9f81b4d4b9b9930a0db9d5282cd1bcabf465e2e
601ae46e0bef2e18425b482a755d03490ade0493
refs/heads/develop
2023-09-06T08:19:38.397058
2023-09-05T21:29:32
2023-09-05T21:29:32
165,565,988
335
120
BSD-3-Clause
2023-09-14T00:53:37
2019-01-13T23:27:26
C
UTF-8
C++
false
false
7,953
h
avtContract.h
// Copyright (c) Lawrence Livermore National Security, LLC and other VisIt // Project developers. See the top-level LICENSE file for dates and other // details. No copyright assignment is required to contribute to VisIt. // ************************************************************************* // // avtContract.h // // ************************************************************************* // #ifndef AVT_CONTRACT_H #define AVT_CONTRACT_H #include <iosfwd> #include <MapNode.h> #include <pipeline_exports.h> #include <ref_ptr.h> #include <avtDataRequest.h> class avtWebpage; class avtContract; typedef ref_ptr<avtContract> avtContract_p; // **************************************************************************** // Class: avtContract // // Purpose: // This is the specification of a pipeline. This includes the // specification of which data you want, as well as a pipeline index to // be used later for load balancing and a boolean value indicating if // streaming is possible. // // Programmer: Hank Childs // Creation: May 28, 2001 // // Modifications: // // Jeremy Meredith, Thu Jul 26 12:35:52 PDT 2001 // Added ShouldUseDynamicLoadBalancing. // // Hank Childs, Thu Feb 5 17:11:06 PST 2004 // Moved inlined destructor definition to .C file because certain compilers // have problems with them. // // Hank Childs, Sun Mar 13 09:49:16 PST 2005 // Added haveStructuredMeshOptimizations. // // Hank Childs, Fri Jun 15 12:41:41 PDT 2007 // Added support for DebugDump. // // Hank Childs, Tue Dec 18 10:04:43 PST 2007 // Define private copy constructor and modify definition of assignment // operator to prevent accidental use of default, bitwise copy // implementations. // // Hank Childs, Tue Feb 19 19:45:43 PST 2008 // Rename "dynamic" to "streaming", since we really care about whether we // are streaming, not about whether we are doing dynamic load balancing. // And the two are no longer synonymous. // // Hank Childs, Sun Mar 9 06:36:49 PST 2008 // Add new data member for on demand streaming. // // Tom Fogal, Sun May 3 17:52:35 MDT 2009 // I overloaded operator<< to allow for easier debugging. // // Cyrus Harrison, Sat Feb 20 21:37:24 PST 2010 // Added Print() which calls 'operator<<' to get around visiblity issues. // // Dave Pugmire, Tue May 25 10:15:35 EDT 2010 // Add domain single domain replication to all processors. // // Hank Childs, Wed Aug 25 22:45:04 PDT 2010 // Add data members for whether or not extents should be calculated. // // **************************************************************************** class PIPELINE_API avtContract { friend ostream& operator<<(ostream &, const avtContract&); public: avtContract(avtDataRequest_p, int); avtContract(avtContract_p); avtContract(avtContract_p, avtDataRequest_p); virtual ~avtContract(); bool ShouldUseStreaming(void) { return canDoStreaming; }; void NoStreaming(void) { canDoStreaming = false; }; void SetDataRequest(avtDataRequest_p ds) { data = ds; }; bool ShouldUseLoadBalancing(void) { return useLoadBalancing && !doingOnDemandStreaming; }; void UseLoadBalancing(bool); void SetHaveRectilinearMeshOptimizations(bool b) { haveRectilinearMeshOptimizations = b; }; bool GetHaveRectilinearMeshOptimizations(void) { return haveRectilinearMeshOptimizations; }; void SetHaveCurvilinearMeshOptimizations(bool b) { haveCurvilinearMeshOptimizations = b; }; bool GetHaveCurvilinearMeshOptimizations(void) { return haveCurvilinearMeshOptimizations; }; bool DoingOnDemandStreaming(void) { return doingOnDemandStreaming; }; void SetOnDemandStreaming(bool b) { doingOnDemandStreaming = b; }; bool ReplicateSingleDomainOnAllProcessors() { return replicateSingleDomainOnAllProcessors; } void SetReplicateSingleDomainOnAllProcessors(bool b) { replicateSingleDomainOnAllProcessors = b; } avtDataRequest_p GetDataRequest(void) { return data; }; int GetPipelineIndex(void) { return pipelineIndex; }; void AddFilter(void) { nFilters++; }; int GetNFilters(void) { return nFilters; }; void SetLineType( int type) { lineType = type; }; int GetLineType(void) { return lineType; }; bool ShouldCalculateMeshExtents(void) { return calculateMeshExtents; }; void SetCalculateMeshExtents(bool c) { calculateMeshExtents = c; }; bool ShouldCalculateVariableExtents(const std::string &s); void SetCalculateVariableExtents(const std::string &s, bool v); void SetCalculateVariableExtentsList(const std::vector<std::string> &l) { needExtentsForTheseVariables = l; }; const std::vector<std::string> & GetCalculateVariableExtentsList(void) { return needExtentsForTheseVariables; }; void DisableExtentsCalculations(void) { calculateMeshExtents = false; needExtentsForTheseVariables.clear(); }; template<class T> std::string SetAttribute( AttributeSubject *atts, int index, T val ); MapNode* GetAttribute( std::string ); avtContract &operator=(const avtContract &); void DebugDump(avtWebpage *); void Print(ostream &); protected: avtDataRequest_p data; int pipelineIndex; bool canDoStreaming; bool doingOnDemandStreaming; bool useLoadBalancing; bool haveCurvilinearMeshOptimizations; bool haveRectilinearMeshOptimizations; bool replicateSingleDomainOnAllProcessors; int nFilters; std::vector<std::string> needExtentsForTheseVariables; bool calculateMeshExtents; int lineType; MapNode attributeMap; private: // This method is defined to prevent accidental use of a bitwise copy // implementation. If you want to re-define it to do something // meaningful, that's fine. avtContract(const avtContract &) {;}; }; // **************************************************************************** // Method: avtContract::SetAttribute // // Purpose: // Add an operator or plot attribute to the contract so that // communication can happen within the pipeline. // // Programmer: Allen Sanderson // Creation: June 16, 2014 // // **************************************************************************** template<class T> std::string avtContract::SetAttribute( AttributeSubject *atts, int index, T value ) { // Create a key string that contains the attribute class name and // attribute name. std::string key = atts->TypeName(); key += std::string("::"); key += atts->GetFieldName( index ); if( attributeMap.HasEntry( key ) ) { return std::string(""); } attributeMap[ key ] = value; return key; } #endif
bc6db65f4dc4242f629e41339241114ef096745f
7096a8051fb3836e85c694de1e7cfb4d651139ba
/insert_operation.h
defc65c169e28d4c3d72a708d1d739d91d75378a
[]
no_license
imjch/jcSQL
b5832181a5ab7ba11dd870619955db62781ef3c5
e437b81a33ae2c121b0df47271cbc93733fe329f
refs/heads/master
2020-05-29T16:26:34.152158
2014-08-25T15:20:51
2014-08-25T15:20:51
null
0
0
null
null
null
null
UTF-8
C++
false
false
453
h
insert_operation.h
#pragma once #include "operation.h" #include <list> #include "attr_val_table.h" class insert_operation:public operation { public: insert_operation(const std::string&,attr_val_table&); insert_operation(); ~insert_operation(); void set_attr_val_table(attr_val_table&); void add_attr_val_pair(attr_val_pair&); attr_val_table get_attr_val_table(); //result_list insert_operation::execute(); private: attr_val_table list; };
c055bbe88621618e7c5b923ed3c26e4c0556957e
1217df68d508d3dc927e951a81b8ffbaf8832549
/acmicpc.net/2167.cpp
e1241159069b6758da1b64cb5a9dfb891facd708
[ "MIT" ]
permissive
kbu1564/SimpleAlgorithm
200ae0dbaa76d127881699a229a2258b358e696c
7e5b0d2fe19461417d88de0addd2235da55787d3
refs/heads/master
2021-01-16T23:57:10.112064
2017-04-23T03:44:12
2017-04-23T03:44:12
56,262,760
4
0
null
null
null
null
UTF-8
C++
false
false
404
cpp
2167.cpp
#include <iostream> using namespace std; int A[301][301],n,m,k,sx,sy,ex,ey; int main() { cin >> n >> m; for (int i = 0; i < n; i++) for (int j = 0; j < m; j++) cin >> A[i][j]; cin >> k; for (int i = 0; i < k; i++) { cin >> sx >> sy >> ex >> ey; int s = 0; for (int si = sy-1; si < ey; si++) for (int sj = sx-1; sj < ex; sj++) s += A[sj][si]; cout << s << endl; } return 0; }
77fec327d75e8fc50d17bc5e2cb57284d4c450e7
f82e503ba23799c1c55a5fe8cd06aa2e7f15b667
/source-code-c/06_15_soma_elementos.cpp
4c0db819629e805adf620ad97afd50dd19f470cf
[]
no_license
jknery/projetos-gerais-cpp
ac837dc4c6d0540099638ca7346ec7ab00307245
e496905b49478b144ebb8299beb5c7dbaafc95b0
refs/heads/master
2022-11-23T17:26:08.682887
2020-07-23T22:35:31
2020-07-23T22:35:31
null
0
0
null
null
null
null
ISO-8859-1
C++
false
false
2,267
cpp
06_15_soma_elementos.cpp
/******************************************************************** * Programa que lê, implime uma matriz e a manipula como um array * * para somar seus elementos * ********************************************************************/ #include <stdio.h> #include <stdlib.h> #define QUANT_LIN 2 /* quantidade de linhas da matriz */ #define QUANT_COL 3 /* quantidade de colunas da matriz */ void le_matriz(int[][QUANT_COL], int, int); void imprime_matriz(int[][QUANT_COL], int, int); int soma_elementos_matriz(int[], int, int); int main() { int matriz[QUANT_LIN][QUANT_COL], num_linhas, num_colunas, linha, coluna; printf("Programa que soma os elementos de uma matriz tratando-a como" " um array linear para somar seuas elementos:\n\n"); printf("Informe os %d elementos da matriz:\n", QUANT_LIN * QUANT_COL); le_matriz(matriz, QUANT_LIN, QUANT_COL); imprime_matriz(matriz, QUANT_LIN, QUANT_COL); /* Imprime somatório dos elementos da matriz, tratando-a como um array linear. Passa o endereço da primeira linha e trata as demais linhas como continuação de um array */ printf("\nO somatorio dos elementos da matriz eh %d\n", soma_elementos_matriz(matriz[0], QUANT_LIN, QUANT_COL)); /* finaliza programa */ printf ("\n\n"); system ("pause"); return 0; } void le_matriz(int mat[][QUANT_COL], int m, int n) { int i, j; for (i = 0; i < m; i++) for (j = 0; j < n; j++) { printf("\nElemento [%d][%d]: ", i, j); scanf("%d",&mat[i][j]); } return; } void imprime_matriz(int mat[][QUANT_COL], int m, int n) { int i, j; printf("\n\nMatriz\n"); for (i = 0; i < m; i++) { for (j = 0; j < n; j++) printf("%d ", mat[i][j]); printf("\n"); } return; } /* Recebe o endereço da primeira linha do array e trata esta linha como um array de QUANT_LIN * QUANT_COL elementos */ int soma_elementos_matriz(int array[], int m, int n) { int indice, soma = 0; for (indice = 0; indice < QUANT_LIN * QUANT_COL; indice++) soma += array[indice]; return soma; }
bfa19c93431946516f30def62a12ad9bea1f482c
e1fa70fbd8ba7b61689794856f35389c517fdd94
/UI/App/inc/Te2Settings.h
b07e02d956e000d2bfd496902844b693d49fda39
[ "MIT" ]
permissive
sunjinbo/Tetris2
e589ffbfebb8a7d0402dc603ee0f73c32dbf2b19
28b4d4c842b74fe1afc5874b16d0bd39b68f3b1c
refs/heads/master
2021-07-21T13:18:54.502342
2017-10-30T12:16:13
2017-10-30T12:16:13
108,845,993
1
0
null
null
null
null
UTF-8
C++
false
false
1,012
h
Te2Settings.h
/* ==================================================================== * File: Te2Settings.h * Created: 09/17/10 * Modifed: 09/17/10 * Author: Sun Jinbo * Copyright (c): Tieto, All rights reserved * ==================================================================== */ #ifndef T_TE2SETTINGS_H #define T_TE2SETTINGS_H // INCLUDE #include <e32def.h> #include "Tetris2.hrh" // FORWARD DECLARATION class RFs; // CLASS DECLARATION /** * TTe2Settings class */ class TTe2Settings { public: // Default C++ constructor TTe2Settings(); TTe2Settings( const TTe2Settings& aSettings ); TTe2Settings& operator=( const TTe2Settings& aSettings ); public: // New methods void InternalizedL(); void ExternalizedL(); private: // New methods void CreateDefaultSettingsL(); TInt GetFileName( TFileName& aFileName ); TInt GetPrivatePath( TFileName& aPrivatePath ); public: // Data RFs& iFs; TTe2Mode iMode; TTe2Audio iAudio; }; #endif // T_TE2SETTINGS_H // End Of File
f78ebc65cf783cddbfc6fa654a3e5a1cdbfb44b4
1850fe58a070c6fcf64ac3644a0982ec93bd1b74
/renderer/base/decoderobj.h
84c83ddee5a1a49e90cf58344f83d551897170bd
[ "MIT" ]
permissive
TheExceptionist/software-renderer
37ed80cc17675ef74756b32f306b22670d470de3
dfeb24eb4ac6f90552e65cc7e0cf97d7d693ad7b
refs/heads/master
2021-04-28T01:10:38.344736
2013-02-24T11:06:17
2013-02-24T11:06:17
null
0
0
null
null
null
null
UTF-8
C++
false
false
867
h
decoderobj.h
/* * decoderobj.h * * Author: flamingo * E-mail: epiforce57@gmail.com */ #ifndef DECODEROBJ_H #define DECODEROBJ_H #include "resourcedecoder.h" #include "math/vertex.h" namespace base { class DecoderOBJ : public ResourceDecoder { void appendVertex(std::string &line); void appendFace(std::string &line); void appendNormal(std::string &line); void triangulateModel(); std::vector<math::vertex> vertexList; std::vector<math::vec3> normalsList; struct FaceInfo { std::vector<int> indices; std::vector<int> normalIndices; }; std::vector<FaceInfo> faces; std::vector<int> resultTrianglesIndices; void clear(); public: DecoderOBJ() { } ~DecoderOBJ() { } sptr(Resource) decode(const std::string &path); std::string extension() const; }; } #endif // DECODEROBJ_H
7c28bf08541e429d3f3549a1dd1feb22d63de562
be8b9231c92e6c184f0692c92df9667be3770cb1
/Musical_Instruments_2017_2018/Musical_Glove/OLD CODE/gloves/Gloves_R/teensy/avr/libraries/Wire/Wire.h
86a15fbf4339545d6ab1cc9b4dfe0affba31f016
[ "MIT" ]
permissive
Pocketart/typhoonclawvex
def0f4a607c90b1bafb180466dfa12ddd8a480c1
eb4b523c13541b2b9136d32259bd0399b46a289e
refs/heads/master
2021-09-15T07:26:07.218099
2018-05-07T02:20:15
2018-05-07T02:20:15
105,268,399
4
3
MIT
2018-05-04T17:30:49
2017-09-29T12:12:32
C++
UTF-8
C++
false
false
3,222
h
Wire.h
/* TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts */ #ifndef TwoWire_h #define TwoWire_h #if defined(__arm__) && defined(TEENSYDUINO) #include "WireKinetis.h" #elif defined(__AVR__) #include <inttypes.h> #include "Arduino.h" #define BUFFER_LENGTH 32 #define WIRE_HAS_END 1 class TwoWire : public Stream { private: static uint8_t rxBuffer[]; static uint8_t rxBufferIndex; static uint8_t rxBufferLength; static uint8_t txAddress; static uint8_t txBuffer[]; static uint8_t txBufferIndex; static uint8_t txBufferLength; static uint8_t transmitting; static void onRequestService(void); static void onReceiveService(uint8_t*, int); static void (*user_onRequest)(void); static void (*user_onReceive)(int); static void sda_rising_isr(void); public: TwoWire(); void begin(); void begin(uint8_t); void begin(int); void end(); void setClock(uint32_t); void setSDA(uint8_t); void setSCL(uint8_t); void beginTransmission(uint8_t); void beginTransmission(int); uint8_t endTransmission(void); uint8_t endTransmission(uint8_t); uint8_t requestFrom(uint8_t, uint8_t); uint8_t requestFrom(uint8_t, uint8_t, uint8_t); uint8_t requestFrom(int, int); uint8_t requestFrom(int, int, int); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *, size_t); virtual int available(void); virtual int read(void); virtual int peek(void); virtual void flush(void); void onReceive( void (*)(int) ); void onRequest( void (*)(void) ); #ifdef CORE_TEENSY // added by Teensyduino installer, for compatibility // with pre-1.0 sketches and libraries void send(uint8_t b) { write(b); } void send(uint8_t *s, uint8_t n) { write(s, n); } void send(int n) { write((uint8_t)n); } void send(char *s) { write(s); } uint8_t receive(void) { int c = read(); if (c < 0) return 0; return c; } #endif inline size_t write(unsigned long n) { return write((uint8_t)n); } inline size_t write(long n) { return write((uint8_t)n); } inline size_t write(unsigned int n) { return write((uint8_t)n); } inline size_t write(int n) { return write((uint8_t)n); } using Print::write; }; extern TwoWire Wire; #endif #endif
0a7f2006ee95dcab8925ba9e13bf473134adf7e0
f6ab96101246c8764dc16073cbea72a188a0dc1a
/volume103/10311 - Goldbach and Euler.cpp
aa0a2d2fc121724c30701ebde86eb0d3f50dc8ea
[]
no_license
nealwu/UVa
c87ddc8a0bf07a9bd9cadbf88b7389790bc321cb
10ddd83a00271b0c9c259506aa17d03075850f60
refs/heads/master
2020-09-07T18:52:19.352699
2019-05-01T09:41:55
2019-05-01T09:41:55
220,883,015
3
2
null
2019-11-11T02:14:54
2019-11-11T02:14:54
null
UTF-8
C++
false
false
1,322
cpp
10311 - Goldbach and Euler.cpp
#include <stdio.h> #include <stdlib.h> #include <math.h> #define maxL (10000>>5)+1 #define GET(x) (mark[x>>5]>>(x&31)&1) #define SET(x) (mark[x>>5] |= 1<<(x&31)) int mark[maxL], p[5000], pt = 0; void sieve() { register int i, j, k; SET(1); int n = 10000; for(i = 2; i <= n; i++) { if(!GET(i)) { p[pt++] = i; for(k = n/i, j = i*k; k >= i; k--, j -= i) SET(j); } } } int isprime(int n) { if(n < 2) return 0; static int sq, i; sq = (int)sqrt(n); for(i = 0; i < pt && p[i] <= sq; i++) if(n%p[i] == 0) return 0; return 1; } int main() { sieve(); int n, i; while(scanf("%d", &n) == 1) { printf("%d is ", n); if(n&1) { if(isprime(n-2)) { printf("the sum of 2 and %d.\n", n-2); } else { puts("not the sum of two primes!"); } } else { int flag = 0; for(i = n/2-1; i >= 0; i--) { if(isprime(i) && isprime(n-i)) { printf("the sum of %d and %d.\n", i, n-i); flag = 1; break; } } if(!flag) puts("not the sum of two primes!"); } } return 0; }
1a77f66df31b078b1a93e7857cf37ca179a812e1
fb6245383e7e7d53ab94b6eb2bb09469db466c58
/mcast_lib/ldm7/SendNotifier.h
39172e991728390b494f243e1cf9a5a035322853
[ "BSD-2-Clause" ]
permissive
Unidata/LDM
99122b6e1fef032af263972be3b56eb83d3074fd
293344411b1a4fe35bd0e9c1eda8614a6d201d51
refs/heads/main
2023-09-03T01:06:51.376173
2023-02-16T18:40:06
2023-02-16T18:40:06
2,667,699
33
28
NOASSERTION
2022-12-28T22:03:54
2011-10-28T20:21:39
C
UTF-8
C++
false
false
1,599
h
SendNotifier.h
/** * Copyright 2014 University Corporation for Atmospheric Research. All rights * reserved. See the the file COPYRIGHT in the top-level source-directory for * licensing conditions. * * @file PerProdNotifier.h * * This file declares the API for a class that notifies the receiving * application of events on a per-file basis. * * @author: Steven R. Emmerson */ #ifndef PER_PROD_SENDING_NOTIFIER_H_ #define PER_PROD_SENDING_NOTIFIER_H_ #include "Authorizer.h" #include "fmtp.h" #include "SendProxy.h" #include <sys/types.h> class SendNotifier: public SendProxy { /// Function to call when the FMTP layer is done with a product. void (*eop_func)(FmtpProdIndex prodIndex); /// Authorization database Authorizer authorizer; public: /** * Constructs from the notification functions. * * @param[in] eop_func Function to call when the FMTP layer is * finished with a product. * @throws std::invalid_argument if `eop_func == NULL`. */ SendNotifier( void (*eop_func)(FmtpProdIndex prodIndex), Authorizer& authDb); ~SendNotifier() {} void notifyOfEop(FmtpProdIndex prodIndex); /** * Requests the application to vet an incoming connection request, and to * decide whether to accept or to reject the connection. * * @return `true` Receiver is acceptable * @retval `false` Receiver is not acceptable * @threadsafety Safe */ bool vetNewRcvr(int newsock); }; #endif /* PER_PROD_SENDING_NOTIFIER_H_ */
12c4e1a5bbf9261643c2dee604c6d4fbd1a12cc7
61c1b56f814f9cbdd7f8427cfdd10639017ad167
/Friends/Friends/ClassRemote.cpp
f9afe238dd59333d50f6749349cfeccc10fbfe25
[]
no_license
Wisnia144/Ch15_TVRemote
f12e23da510d1a6b8ef71c5da6481dfffb8e49f2
b8bddf3f796afb7990826bfbe7f86c745b427fc1
refs/heads/master
2021-01-20T06:17:06.656475
2017-04-30T15:53:30
2017-04-30T15:53:30
89,859,733
0
0
null
null
null
null
UTF-8
C++
false
false
642
cpp
ClassRemote.cpp
#include <iostream> #include "ClassRemote.h" #include "ClassTV.h" /* Remote():mode(1) {}; void OnOff(void); void volUp(void); void volDown(void); void chUp(void); void chDown(void); */ void RemoteX::OnOff(Tv & t) { std::cout << t.onoff(); } void RemoteX::volUp(Tv & t) { t.volume++; std::cout << "volUp:" << t.volume << "\n"; } void RemoteX::volDown(Tv & t) { t.volume--; std::cout << "volDown:" << t.volume << "\n"; } void RemoteX::chUp(Tv & t) { t.channel++; std::cout << "chUp:" << t.channel << "\n"; } void RemoteX::chDown(Tv & t) { t.channel--; std::cout << "chwn:" << t.channel << "\n"; }
2f05addaf84a1d1fe2e0964b0821a461929ffac8
e48ef962341d355b80d7f9eb2a74ab61e645d9e7
/src/lib/handler.cpp
832c2413fda451a5836e6a94690a8d94b09f1a8a
[ "Apache-2.0" ]
permissive
kinglee1982/FaceRecognitionTerminalDemo
a400c4145c8cbe2ee1eaacd63f079102a23187cf
5e197011a87403d2433f691b8390ec340432b2be
refs/heads/master
2022-07-19T12:27:51.286164
2020-05-15T03:04:33
2020-05-15T03:04:33
264,863,863
2
1
Apache-2.0
2020-05-18T07:37:16
2020-05-18T07:37:16
null
UTF-8
C++
false
false
848
cpp
handler.cpp
#include "handler.h" #include "app/face_detector.h" #include "app/face_extractor.h" using namespace suanzi; template <typename T> T MessageStack<T>::get() { std::unique_lock<std::mutex> lock(mutex_); while (stack_.empty()) cv_.wait_for(lock, std::chrono::milliseconds(10)); T ret = stack_.back(); stack_.pop_back(); return ret; } template <typename T> void MessageStack<T>::put(T &t) { std::unique_lock<std::mutex> lock(mutex_); stack_.push_back(t); if (stack_.size() > kMaxSize) stack_.erase(stack_.begin()); cv_.notify_one(); } template <typename T> void Handler<T>::run() { while (_bRunning) { T message = stack_.get(); handle(message); } } template <typename T> void Handler<T>::post(T message) { stack_.put(message); } template class Handler<ExtractionMessage>; template class Handler<DetectionMessage>;
bb046079d578e33b724b2dada5e8c70007928224
ece0cca97baaf9251482167873981ed0509ad531
/CSfundamental1/PointerExercise/puzzle1.cpp
48079cb0db177558788baef21d355faad7cb112a
[]
no_license
sabrinalokman/CSFundamentalSpecialization
7e0a4222f70f07d16b13b2e6ad061949aa2d7ac1
5f0ad1cb1703d463aba68b20d3d82e065c1ac8b9
refs/heads/master
2023-01-13T13:53:22.548298
2020-11-14T04:59:48
2020-11-14T04:59:48
299,151,159
1
0
null
null
null
null
UTF-8
C++
false
false
374
cpp
puzzle1.cpp
// heap memory Puzzle 1 #include <iostream> using namespace std; int main() { int i = 2; int *p = &i; int j = 4; int *q = &j; int k = 8; int *r = &k; k = i; cout << i << j << k << *p << *q << *r << endl; // 242242 p = q; cout << i << j << k << *p << *q << *r << endl; //242442 *q = *r; cout << i << j << k << *p << *q << *r << endl; //222222 return 0; }
9fa0b733ac292e4f61922291cc96889deb6ed22c
ed444c4a0ed1fe679da64b81ec6aa1ddf885a185
/Foundation/Math/Geometry/2d/Rect.cpp
e62ab47cc41b0f02f9cbe230d47898e896d81cbe
[]
no_license
swaphack/CodeLib
54e07db129d38be0fd55504ef917bbe522338aa6
fff8ed54afc334e1ff5e3dd34ec5cfcf6ce7bdc9
refs/heads/master
2022-05-16T20:31:45.123321
2022-05-12T03:38:45
2022-05-12T03:38:45
58,099,874
1
0
null
2016-05-11T09:46:07
2016-05-05T02:57:24
C++
UTF-8
C++
false
false
4,456
cpp
Rect.cpp
#include "Rect.h" using namespace math; Rect::Rect() { } Rect::Rect(float x, float y) { _origin.setX(x); _origin.setY(y); } Rect::Rect(float x, float y, float w, float h) { _origin.setX(x); _origin.setY(y); _size.setWidth(w); _size.setHeight(h); } Rect::Rect(const Vector2& orgin, const Size& size) { _origin = orgin; _size = size; } Rect::Rect(const Vector2& orgin, const Vector2& size) { _origin = orgin; _size = size; } Rect::~Rect() { } float Rect::getY() const { return _origin.getY(); } float Rect::getX() const { return _origin.getX(); } float Rect::getMinX() const { return getX(); } float math::Rect::getMiddleX() const { return getX() + getHalfWidth(); } float Rect::getMaxX() const { return getX() + getWidth(); } float Rect::getMinY() const { return getY(); } float math::Rect::getMiddleY() const { return getY() + getHalfHeight(); } float Rect::getMaxY() const { return getY() + getHeight(); } float Rect::getWidth() const { return _size.getWidth(); } float math::Rect::getHalfWidth() const { return 0.5f * getWidth(); } float Rect::getHeight() const { return _size.getHeight(); } float math::Rect::getHalfHeight() const { return 0.5f * getHeight(); } const Vector2& Rect::getOrigin() const { return _origin; } const Size& Rect::getSize() const { return _size; } void Rect::set(float x, float y, float w, float h) { _origin.setX(x); _origin.setY(y); _size.setWidth(w); _size.setHeight(h); } void Rect::set(const Vector2& origin, const Size& size) { _origin = origin; _size = size; } bool Rect::contains(float x, float y) const { return (x >= getMinX() && x <= getMaxX()) && (y >= getMinY() && y <= getMaxY()); } bool Rect::contains(const Vector2& point) const { return contains(point.getX(), point.getY()); } bool math::Rect::contains(const Vector3& point) const { return contains(point.getX(), point.getY()); } bool math::Rect::contains(const Rect& rect) const { return getMaxX() >= rect.getWidth() && getMinX() <= rect.getMinX() && getMaxY() >= rect.getHeight() && getMinY() <= rect.getMinY(); } bool math::Rect::includes(float x, float y) const { return (x > getMinX() && x < getMaxX()) && (y > getMinY() && y < getMaxY()); } bool math::Rect::includes(const Vector2& point) const { return includes(point.getX(), point.getY()); } bool math::Rect::includes(const Vector3& point) const { return includes(point.getX(), point.getY()); } bool math::Rect::includes(const Rect& rect) const { return getMaxX() > rect.getWidth() && getMinX() < rect.getMinX() && getMaxY() > rect.getHeight() && getMinY() < rect.getMinY(); } Rect Rect::intersectRect(const Rect& rect) const { if (!isOverlap(rect)) { return Rect(); } Rect* pRect = &(Rect&)rect; Rect merge = unionRect(rect); float x0 = this->getMinX() == merge.getMinX() ? pRect->getMinX() : this->getMinX(); float x1 = this->getMaxX() == merge.getMaxX() ? pRect->getMaxX() : this->getMaxX(); float y0 = this->getMinY() == merge.getMinY() ? pRect->getMinY() : this->getMinY(); float y1 = this->getMaxY() == merge.getMaxY() ? pRect->getMaxY() : this->getMaxY(); return Rect(x0, y0, x1 - x0, y1 - y0); } Rect Rect::unionRect(const Rect& rect) const { Rect* pRect = &(Rect&)rect; float x0 = this->getMinX() < pRect->getMinX() ? this->getMinX() : pRect->getMinX(); float x1 = this->getMaxX() > pRect->getMaxX() ? this->getMaxX() : pRect->getMaxX(); float y0 = this->getMinY() < pRect->getMinY() ? this->getMinY() : pRect->getMinY(); float y1 = this->getMaxY() > pRect->getMaxY() ? this->getMaxY() : pRect->getMaxY(); return Rect(x0, y0, x1 - x0, y1 - y0); } bool math::Rect::isOverlap(const Rect& rect) const { bool ret = true; if (getMaxX() < rect.getMinX() || getMaxY() < rect.getMinY() || rect.getMaxX() < getMinX() || rect.getMaxY() < getMinY()) { ret = false; } return ret; } math::Vector3 math::Rect::getAnchorPointByPosition(float x, float y) { return math::Vector3(); } Rect& Rect::operator=(const Rect& rect) { _origin = rect._origin; _size = rect._size; return *this; } bool Rect::operator==(const Rect& rect) const { return _origin == rect._origin && _size == rect._size; } void Rect::setOrigin(float x, float y) { this->_origin.set(x, y); } void math::Rect::setOrigin(const Vector2& origin) { this->_origin = origin; } void Rect::setSize(float x, float y) { this->_size.set(x, y); } void math::Rect::setSize(const Size& size) { this->_size = size; }
ebf6256428ccf666e31e6eb0164b3e4525f61180
ff4261edbce415345a676937d5b710e1fa9fb30c
/Sources/Parallel/ThreadManager.cpp
1ff5bb544b4aa2528d4776f122748f9eab26875b
[]
no_license
tiagosombrra/apMeshCenapad
93d9320b2203ed5680dbc57cefeb0bfaef6944fb
3263ad21059784e39c50319f387758b53a5cd466
refs/heads/main
2023-07-01T04:56:44.945203
2021-04-25T21:24:36
2021-04-25T21:24:36
361,541,250
0
0
null
null
null
null
UTF-8
C++
false
false
499
cpp
ThreadManager.cpp
#include "../../Headers/Parallel/ThreadManager.h" Parallel::ThreadManager::ThreadManager(bool sharedParallelismEnabled) { this->setSharedParallelismEnabled(sharedParallelismEnabled); } Parallel::ThreadManager::~ThreadManager() { } void Parallel::ThreadManager::setSharedParallelismEnabled(bool sharedParallelismEnabled) { this->sharedParallelismEnabled = sharedParallelismEnabled; } bool Parallel::ThreadManager::isSharedParallelismEnabled() const { return this->sharedParallelismEnabled; }
c2ecf52697519227d20f1c5baa670e6b41cda28c
89a410af9c2a2a3fc895e7b19062e07d02b9d03f
/Image.h
0015327ad8a1aad412381162b0676c03032a97ab
[]
no_license
makler322/cpp_game
e522c7e84b54dad7c02ed50acc7866a66ae0ac71
25b2baefabdc52e38ef4063a063785fcf219b1fb
refs/heads/master
2023-04-11T18:53:42.462843
2021-04-23T16:15:15
2021-04-23T16:15:15
357,995,115
0
0
null
null
null
null
UTF-8
C++
false
false
2,511
h
Image.h
#ifndef MAIN_IMAGE_H #define MAIN_IMAGE_H #include <string> #include <iostream> #include <map> #include <algorithm> #include <glad/glad.h> #include "stb_image.h" #define GLFW_DLL #include <GLFW/glfw3.h> constexpr int tileSize = 16; constexpr GLsizei WINDOW_WIDTH = 60*tileSize, WINDOW_HEIGHT = 60*tileSize; struct Pixel { uint8_t r; uint8_t g; uint8_t b; uint8_t a; }; struct Image { explicit Image(const std::string &a_path); int Save(const std::string &a_path); int Width() const { return width; } int Height() const { return height; } int Channels() const { return channels; } size_t Size() const { return size; } Pixel* Data() { return data; } Pixel GetPixel(int x, int y) { return data[width * y + x];} //void SetImage(Pixel* pixels, int x, int y, int heightOfImage, int wightOfImage); ~Image(); private: int width = -1; int height = -1; int channels = 3; size_t size = 0; Pixel *data = nullptr; bool self_allocated = false; }; struct Background { explicit Background(char const* path, bool perehod = false, GLFWwindow* window = nullptr); void Init(char const* path, bool perehod = false, GLFWwindow* window = nullptr); void SetPixel(int x, int y, Pixel p, int a); Pixel WhatPixel(int x, int y) { return data[width * y + x]; } int Save(const std::string &a_path); int Width() const { return width; } int Height() const { return height; } int Channels() const { return channels; } size_t Size() const { return size; } Pixel* Data() { return data; } int TypeOfPixel(int x, int y) { return typeOfPixel[width * y + x];} void SetSquare(Pixel *pixels, int x, int y, int typeOfPixels, bool maybeNextTime = false, bool transparentBackground = true); void SetImage(Pixel* pixels, int x, int y, int heightOfImage, int wightOfImage, bool transparentBackground = true); int GetInit_x() { return init_x; } int GetInit_y() { return init_y; } int GetInitFox_x() { return initFox_x; } int GetInitFox_y() { return initFox_y; } void BackgroundLight(int i, int j); private: int init_x = 150, init_y = 150; int initFox_x = 150, initFox_y = 150; int width = WINDOW_WIDTH; int height = WINDOW_HEIGHT; int channels = 4; size_t size = width * height * channels; bool self_allocated = false; bool animation = false; GLFWwindow* window = nullptr; Pixel *data = new Pixel[width * height]; int *typeOfPixel = new int[width * height]; }; #endif //MAIN_IMAGE_H
51cb3c188a0f2bac19cfd6d69dfc934cb2a58d28
7511ee6cc1721745cb3ccee35ce2b994363fdd89
/llvm/lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
79e4331f74d847b2120e361d9b9947b4dd70ce0d
[ "NCSA", "MIT" ]
permissive
sslab-gatech/apisan
a308fa7a707c6b870900895c9b33c24c6a383a66
9ff3d3bc04c8e119f4d659f03b38747395e58c3e
refs/heads/master
2021-11-06T05:06:35.221153
2021-11-05T04:57:33
2021-11-05T04:57:33
66,595,888
64
27
null
2019-12-20T16:57:29
2016-08-25T21:53:26
null
UTF-8
C++
false
false
7,830
cpp
X86IntelInstPrinter.cpp
//===-- X86IntelInstPrinter.cpp - Intel assembly instruction printing -----===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file includes code for rendering MCInst instances as Intel-style // assembly. // //===----------------------------------------------------------------------===// #include "X86IntelInstPrinter.h" #include "MCTargetDesc/X86BaseInfo.h" #include "MCTargetDesc/X86MCTargetDesc.h" #include "X86InstComments.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" #include "llvm/Support/ErrorHandling.h" #include "llvm/Support/FormattedStream.h" #include <cctype> using namespace llvm; #define DEBUG_TYPE "asm-printer" #include "X86GenAsmWriter1.inc" void X86IntelInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { OS << getRegisterName(RegNo); } void X86IntelInstPrinter::printInst(const MCInst *MI, raw_ostream &OS, StringRef Annot) { const MCInstrDesc &Desc = MII.get(MI->getOpcode()); uint64_t TSFlags = Desc.TSFlags; if (TSFlags & X86II::LOCK) OS << "\tlock\n"; printInstruction(MI, OS); // Next always print the annotation. printAnnotation(OS, Annot); // If verbose assembly is enabled, we can print some informative comments. if (CommentStream) EmitAnyX86InstComments(MI, *CommentStream, getRegisterName); } void X86IntelInstPrinter::printSSECC(const MCInst *MI, unsigned Op, raw_ostream &O) { int64_t Imm = MI->getOperand(Op).getImm() & 0xf; switch (Imm) { default: llvm_unreachable("Invalid ssecc argument!"); case 0: O << "eq"; break; case 1: O << "lt"; break; case 2: O << "le"; break; case 3: O << "unord"; break; case 4: O << "neq"; break; case 5: O << "nlt"; break; case 6: O << "nle"; break; case 7: O << "ord"; break; case 8: O << "eq_uq"; break; case 9: O << "nge"; break; case 0xa: O << "ngt"; break; case 0xb: O << "false"; break; case 0xc: O << "neq_oq"; break; case 0xd: O << "ge"; break; case 0xe: O << "gt"; break; case 0xf: O << "true"; break; } } void X86IntelInstPrinter::printAVXCC(const MCInst *MI, unsigned Op, raw_ostream &O) { int64_t Imm = MI->getOperand(Op).getImm() & 0x1f; switch (Imm) { default: llvm_unreachable("Invalid avxcc argument!"); case 0: O << "eq"; break; case 1: O << "lt"; break; case 2: O << "le"; break; case 3: O << "unord"; break; case 4: O << "neq"; break; case 5: O << "nlt"; break; case 6: O << "nle"; break; case 7: O << "ord"; break; case 8: O << "eq_uq"; break; case 9: O << "nge"; break; case 0xa: O << "ngt"; break; case 0xb: O << "false"; break; case 0xc: O << "neq_oq"; break; case 0xd: O << "ge"; break; case 0xe: O << "gt"; break; case 0xf: O << "true"; break; case 0x10: O << "eq_os"; break; case 0x11: O << "lt_oq"; break; case 0x12: O << "le_oq"; break; case 0x13: O << "unord_s"; break; case 0x14: O << "neq_us"; break; case 0x15: O << "nlt_uq"; break; case 0x16: O << "nle_uq"; break; case 0x17: O << "ord_s"; break; case 0x18: O << "eq_us"; break; case 0x19: O << "nge_uq"; break; case 0x1a: O << "ngt_uq"; break; case 0x1b: O << "false_os"; break; case 0x1c: O << "neq_os"; break; case 0x1d: O << "ge_oq"; break; case 0x1e: O << "gt_oq"; break; case 0x1f: O << "true_us"; break; } } void X86IntelInstPrinter::printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &O) { int64_t Imm = MI->getOperand(Op).getImm() & 0x3; switch (Imm) { case 0: O << "{rn-sae}"; break; case 1: O << "{rd-sae}"; break; case 2: O << "{ru-sae}"; break; case 3: O << "{rz-sae}"; break; } } /// printPCRelImm - This is used to print an immediate value that ends up /// being encoded as a pc-relative value. void X86IntelInstPrinter::printPCRelImm(const MCInst *MI, unsigned OpNo, raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNo); if (Op.isImm()) O << formatImm(Op.getImm()); else { assert(Op.isExpr() && "unknown pcrel immediate operand"); // If a symbolic branch target was added as a constant expression then print // that address in hex. const MCConstantExpr *BranchTarget = dyn_cast<MCConstantExpr>(Op.getExpr()); int64_t Address; if (BranchTarget && BranchTarget->EvaluateAsAbsolute(Address)) { O << formatHex((uint64_t)Address); } else { // Otherwise, just print the expression. O << *Op.getExpr(); } } } void X86IntelInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNo); if (Op.isReg()) { printRegName(O, Op.getReg()); } else if (Op.isImm()) { O << formatImm((int64_t)Op.getImm()); } else { assert(Op.isExpr() && "unknown operand kind in printOperand"); O << *Op.getExpr(); } } void X86IntelInstPrinter::printMemReference(const MCInst *MI, unsigned Op, raw_ostream &O) { const MCOperand &BaseReg = MI->getOperand(Op+X86::AddrBaseReg); unsigned ScaleVal = MI->getOperand(Op+X86::AddrScaleAmt).getImm(); const MCOperand &IndexReg = MI->getOperand(Op+X86::AddrIndexReg); const MCOperand &DispSpec = MI->getOperand(Op+X86::AddrDisp); const MCOperand &SegReg = MI->getOperand(Op+X86::AddrSegmentReg); // If this has a segment register, print it. if (SegReg.getReg()) { printOperand(MI, Op+X86::AddrSegmentReg, O); O << ':'; } O << '['; bool NeedPlus = false; if (BaseReg.getReg()) { printOperand(MI, Op+X86::AddrBaseReg, O); NeedPlus = true; } if (IndexReg.getReg()) { if (NeedPlus) O << " + "; if (ScaleVal != 1) O << ScaleVal << '*'; printOperand(MI, Op+X86::AddrIndexReg, O); NeedPlus = true; } if (!DispSpec.isImm()) { if (NeedPlus) O << " + "; assert(DispSpec.isExpr() && "non-immediate displacement for LEA?"); O << *DispSpec.getExpr(); } else { int64_t DispVal = DispSpec.getImm(); if (DispVal || (!IndexReg.getReg() && !BaseReg.getReg())) { if (NeedPlus) { if (DispVal > 0) O << " + "; else { O << " - "; DispVal = -DispVal; } } O << formatImm(DispVal); } } O << ']'; } void X86IntelInstPrinter::printSrcIdx(const MCInst *MI, unsigned Op, raw_ostream &O) { const MCOperand &SegReg = MI->getOperand(Op+1); // If this has a segment register, print it. if (SegReg.getReg()) { printOperand(MI, Op+1, O); O << ':'; } O << '['; printOperand(MI, Op, O); O << ']'; } void X86IntelInstPrinter::printDstIdx(const MCInst *MI, unsigned Op, raw_ostream &O) { // DI accesses are always ES-based. O << "es:["; printOperand(MI, Op, O); O << ']'; } void X86IntelInstPrinter::printMemOffset(const MCInst *MI, unsigned Op, raw_ostream &O) { const MCOperand &DispSpec = MI->getOperand(Op); const MCOperand &SegReg = MI->getOperand(Op+1); // If this has a segment register, print it. if (SegReg.getReg()) { printOperand(MI, Op+1, O); O << ':'; } O << '['; if (DispSpec.isImm()) { O << formatImm(DispSpec.getImm()); } else { assert(DispSpec.isExpr() && "non-immediate displacement?"); O << *DispSpec.getExpr(); } O << ']'; }
62939ec8099bb6d850d1cb7a9b3c7c57bb809b63
9692c1602d113c9f58705d4c8e1c098d129d9fb2
/implementation/examples/GAMSA/MsaGenotypeCrsOnePoint.cpp
a0a6356e0d1f89d05d31f16c8b990798a3b03e2f
[]
no_license
PatrikOkanovic/Bachelor-Thesis
acbafd0b8cf7628e648cd13e1027f8245961c0fb
444d3efb2282522ee47bc35a02bfd856f7d439f4
refs/heads/master
2022-11-16T10:59:35.622214
2020-07-12T10:25:29
2020-07-12T10:25:29
278,910,084
0
0
null
null
null
null
UTF-8
C++
false
false
2,626
cpp
MsaGenotypeCrsOnePoint.cpp
#include "ECF/ECF_base.h" #include "MsaGenotype.h" #include "FastaParser.h" namespace MsaGenotype { void MsaGenotypeCrsOnePoint::registerParameters(StateP state) { myGenotype_->registerParameter(state, "crx.onepoint", (voidP) new double(0), ECF::DOUBLE); } bool MsaGenotypeCrsOnePoint::initialize(StateP state) { voidP sptr = myGenotype_->getParameterValue(state, "crx.onepoint"); probability_ = *((double*)sptr.get()); return true; } bool MsaGenotypeCrsOnePoint::mate(GenotypeP gen1, GenotypeP gen2, GenotypeP child) { MsaGenotype *p1 = (MsaGenotype *) (gen1.get()); MsaGenotype *p2 = (MsaGenotype *) (gen2.get()); MsaGenotype *ch = (MsaGenotype *) (child.get()); int cross_point; int first_parent = 0; while(true) { cross_point = state_->getRandomizer()->getRandomInteger(std::min(p1->alignment[0].size(), p2->alignment[0].size())); first_parent = state_->getRandomizer()->getRandomInteger(0, 1); if (p2->alignment[0].size() >= FastaParser::n) break; if(p1->alignment[0].size() >= FastaParser::n) break; } switch (first_parent) { case 0: for(int i = 0; i < p1->alignment.size(); i++) { ch->alignment[i] = p1->alignment[i].substr(0, cross_point) + p2->alignment[i].substr(cross_point); } break; case 1: for (int i = 0; i < p1->alignment.size(); i++) { ch->alignment[i] = p2->alignment[i].substr(0, cross_point) + p1->alignment[i].substr(cross_point); } } std::vector<int> indexes; for(int i = 0; i < ch->alignment[0].size(); i++) { if (ch->alignment[0][i] == '-') { bool all_gaps = true; for (int j = 1; j < ch->alignment.size(); j++) { if (ch->alignment[j][i] != '-') { all_gaps = false; break; } } if (all_gaps) indexes.push_back(i); } } int index_counter = 0; for(auto index : indexes) { for(int i = 0; i < ch->alignment.size(); i++) { ch->alignment[i].erase(ch->alignment[i].begin() + index - index_counter); } index_counter++; } return true; } }
e9247e89230a385dfb01b03028dcb81700968b0e
db74a54e34ae0b915a7a6f72a5fe30d100e6b3ff
/manager.cpp
86b2e52d44d22643a07b9bea91a46330625368ab
[]
no_license
BoyZel/lab3
0e5cdae9424fb462407f6dba857d156c933f646a
d9ad7f438092a7f9a8d4ce6c172ae523affca9b5
refs/heads/master
2020-04-14T23:28:44.053732
2019-04-07T09:21:12
2019-04-07T09:21:12
164,203,611
0
0
null
null
null
null
UTF-8
C++
false
false
1,043
cpp
manager.cpp
#include "manager.hpp" using namespace std; void Manager :: CreateInvoice( Product p, Date d, Client *c, int i){ Invoice actual; actual.SetDate(d); actual.SetBuyer(c); actual.SetNumber(i); list.push_back(actual); sort(list.begin(), list.end() ); } void Manager :: Add( Product p, int n){ list[n].Add(p); } void Manager :: ChangeDate( Date d, int n){ list[n].SetDate(d); } void Manager :: ChangeBuyer( Client *c, int n){ list[n].SetBuyer(c); } void Manager :: ChangeNumber( int p, int n){ list[n].SetNumber(p); sort(list.begin(), list.end() ); } int Manager :: HowManyInv(){ return list.size(); } Product Manager :: Getproduct( int i, int p){ return list[i].GetProduct(p); } Date Manager :: GetDate ( int i ){ return list[i].GetDate(); } int Manager :: GetNumber ( int i ){ return list[i].GetNumber(); } Client* Manager :: GetBuyer ( int i ){ return list[i].GetBuyer(); } int Manager :: Search ( int sea ){ for( int i=0; i < HowManyInv(); i++ ){ if( list[i].GetNumber() == sea ) return i; } return -1; }
4c75bea2426a2cb095474b5814d28ef43f3e5993
c51796fb45639b37c005aae67dfa00c16760fada
/HLS_Proj/Synth_IP/solution1/syn/systemc/FM_Synth_notes.h
6f78f92632b6edb8c52f0a0087608b08d88cf050
[]
no_license
liolliaustin/FMSYNTH
25e652ff58104c4e9cf350eeb075dae34232b8bd
46f57bd344ac3cb0e50179a0c60dcf86542a04e5
refs/heads/master
2020-05-03T05:54:54.128650
2019-04-24T20:58:53
2019-04-24T20:58:53
178,461,166
0
0
null
2019-04-24T18:35:40
2019-03-29T18:58:29
VHDL
UTF-8
C++
false
false
227,971
h
FM_Synth_notes.h
// ============================================================== // File generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC // Version: 2017.2 // Copyright (C) 1986-2017 Xilinx, Inc. All Rights Reserved. // // ============================================================== #ifndef __FM_Synth_notes_H__ #define __FM_Synth_notes_H__ #include <systemc> using namespace sc_core; using namespace sc_dt; #include <iostream> #include <fstream> struct FM_Synth_notes_ram : public sc_core::sc_module { static const unsigned DataWidth = 32; static const unsigned AddressRange = 5244; static const unsigned AddressWidth = 13; //latency = 1 //input_reg = 1 //output_reg = 0 sc_core::sc_in <sc_lv<AddressWidth> > address0; sc_core::sc_in <sc_logic> ce0; sc_core::sc_out <sc_lv<DataWidth> > q0; sc_core::sc_in <sc_lv<AddressWidth> > address1; sc_core::sc_in <sc_logic> ce1; sc_core::sc_out <sc_lv<DataWidth> > q1; sc_core::sc_in<sc_logic> reset; sc_core::sc_in<bool> clk; sc_lv<DataWidth> ram[AddressRange]; SC_CTOR(FM_Synth_notes_ram) { ram[0] = "0b00000000000000000000000000000000"; ram[1] = "0b00111100011010111110011110110010"; ram[2] = "0b00111100111010111110000101110000"; ram[3] = "0b00111101001100001110000101000001"; ram[4] = "0b00111101011010111100100001100110"; ram[5] = "0b00111101100100110101000110000100"; ram[6] = "0b00111101101100001011011100000011"; ram[7] = "0b00111101110011100001001100100001"; ram[8] = "0b00111101111010110110010001001111"; ram[9] = "0b00111110000001000101010001111111"; ram[10] = "0b00111110000100101110111111010001"; ram[11] = "0b00111110001000011000001101010111"; ram[12] = "0b00111110001100000000111001001001"; ram[13] = "0b00111110001111101000111111100100"; ram[14] = "0b00111110010011010000011101100001"; ram[15] = "0b00111110010110110111001111111101"; ram[16] = "0b00111110011010011101010011110011"; ram[17] = "0b00111110011110000010100101111111"; ram[18] = "0b00111110100000110011100001110000"; ram[19] = "0b00111110100010100101010100101001"; ram[20] = "0b00111110100100010110101010001011"; ram[21] = "0b00111110100110000111100000110101"; ram[22] = "0b00111110100111110111110111001000"; ram[23] = "0b00111110101001100111101011100011"; ram[24] = "0b00111110101011010110111100101000"; ram[25] = "0b00111110101101000101101000111001"; ram[26] = "0b00111110101110110011101110110111"; ram[27] = "0b00111110110000100001001101000101"; ram[28] = "0b00111110110010001110000010000110"; ram[29] = "0b00111110110011111010001100011110"; ram[30] = "0b00111110110101100101101010110000"; ram[31] = "0b00111110110111010000011011100010"; ram[32] = "0b00111110111000111010011101011001"; ram[33] = "0b00111110111010100011101110111011"; ram[34] = "0b00111110111100001100001110101110"; ram[35] = "0b00111110111101110011111011011001"; ram[36] = "0b00111110111111011010110011100110"; ram[37] = "0b00111111000000100000011010111101"; ram[38] = "0b00111111000001010011000000100001"; ram[39] = "0b00111111000010000101001001110100"; ram[40] = "0b00111111000010110110110110001010"; ram[41] = "0b00111111000011101000000100111001"; ram[42] = "0b00111111000100011000110101011000"; ram[43] = "0b00111111000101001001000110111110"; ram[44] = "0b00111111000101111000111001000001"; ram[45] = "0b00111111000110101000001010111001"; ram[46] = "0b00111111000111010110111011111101"; ram[47] = "0b00111111001000000101001011100110"; ram[48] = "0b00111111001000110010111001001101"; ram[49] = "0b00111111001001100000000100001010"; ram[50] = "0b00111111001010001100101011111000"; ram[51] = "0b00111111001010111000101111110001"; ram[52] = "0b00111111001011100100001111001111"; ram[53] = "0b00111111001100001111001001101100"; ram[54] = "0b00111111001100111001011110100110"; ram[55] = "0b00111111001101100011001101010111"; ram[56] = "0b00111111001110001100010101011101"; ram[57] = "0b00111111001110110100110110010100"; ram[58] = "0b00111111001111011100101111011011"; ram[59] = "0b00111111010000000100000000001110"; ram[60] = "0b00111111010000101010101000001101"; ram[61] = "0b00111111010001010000100110110111"; ram[62] = "0b00111111010001110101111011101100"; ram[63] = "0b00111111010010011010100110001100"; ram[64] = "0b00111111010010111110100101111000"; ram[65] = "0b00111111010011100001111010010010"; ram[66] = "0b00111111010100000100100010111010"; ram[67] = "0b00111111010100100110011111010101"; ram[68] = "0b00111111010101000111101111000101"; ram[69] = "0b00111111010101101000010001101101"; ram[70] = "0b00111111010110001000000110110011"; ram[71] = "0b00111111010110100111001101111100"; ram[72] = "0b00111111010111000101100110101100"; ram[73] = "0b00111111010111100011010000101010"; ram[74] = "0b00111111011000000000001011011100"; ram[75] = "0b00111111011000011100010110101100"; ram[76] = "0b00111111011000110111110001111111"; ram[77] = "0b00111111011001010010011100111111"; ram[78] = "0b00111111011001101100010111010110"; ram[79] = "0b00111111011010000101100000101110"; ram[80] = "0b00111111011010011101111000110000"; ram[81] = "0b00111111011010110101011111001000"; ram[82] = "0b00111111011011001100010011100011"; ram[83] = "0b00111111011011100010010101101101"; ram[84] = "0b00111111011011110111100101010011"; ram[85] = "0b00111111011100001100000010000100"; ram[86] = "0b00111111011100011111101011101101"; ram[87] = "0b00111111011100110010100001111110"; ram[88] = "0b00111111011101000100100100100111"; ram[89] = "0b00111111011101010101110011011001"; ram[90] = "0b00111111011101100110001110000101"; ram[91] = "0b00111111011101110101110100011110"; ram[92] = "0b00111111011110000100100110010101"; ram[93] = "0b00111111011110010010100011011111"; ram[94] = "0b00111111011110011111101011101111"; ram[95] = "0b00111111011110101011111110111011"; ram[96] = "0b00111111011110110111011100111000"; ram[97] = "0b00111111011111000010000101011011"; ram[98] = "0b00111111011111001011111000011110"; ram[99] = "0b00111111011111010100110101110110"; ram[100] = "0b00111111011111011100111101011100"; ram[101] = "0b00111111011111100100001111001010"; ram[102] = "0b00111111011111101010101010111001"; ram[103] = "0b00111111011111110000010000100011"; ram[104] = "0b00111111011111110101000000000101"; ram[105] = "0b00111111011111111000111001011001"; ram[106] = "0b00111111011111111011111100011101"; ram[107] = "0b00111111011111111110001001001111"; ram[108] = "0b00111111011111111111011111101011"; ram[109] = "0b00111111011111111111111111110010"; ram[110] = "0b00111111011111111111101001100010"; ram[111] = "0b00111111011111111110011100111100"; ram[112] = "0b00111111011111111100011010000001"; ram[113] = "0b00111111011111111001100000110011"; ram[114] = "0b00111111011111110101110001010011"; ram[115] = "0b00111111011111110001001011100110"; ram[116] = "0b00111111011111101011101111110000"; ram[117] = "0b00111111011111100101011101110100"; ram[118] = "0b00111111011111011110010101111000"; ram[119] = "0b00111111011111010110011000000011"; ram[120] = "0b00111111011111001101100100011010"; ram[121] = "0b00111111011111000011111011000110"; ram[122] = "0b00111111011110111001011100001110"; ram[123] = "0b00111111011110101110000111111101"; ram[124] = "0b00111111011110100001111110011010"; ram[125] = "0b00111111011110010100111111110000"; ram[126] = "0b00111111011110000111001100001100"; ram[127] = "0b00111111011101111000100011110111"; ram[128] = "0b00111111011101101001000110111111"; ram[129] = "0b00111111011101011000110101110001"; ram[130] = "0b00111111011101000111110000011010"; ram[131] = "0b00111111011100110101110111001010"; ram[132] = "0b00111111011100100011001010001110"; ram[133] = "0b00111111011100001111101001111000"; ram[134] = "0b00111111011011111011010110011000"; ram[135] = "0b00111111011011100110001111111110"; ram[136] = "0b00111111011011010000010110111110"; ram[137] = "0b00111111011010111001101011101001"; ram[138] = "0b00111111011010100010001110010010"; ram[139] = "0b00111111011010001001111111001111"; ram[140] = "0b00111111011001110000111110110010"; ram[141] = "0b00111111011001010111001101010010"; ram[142] = "0b00111111011000111100101011000101"; ram[143] = "0b00111111011000100001011000100000"; ram[144] = "0b00111111011000000101010101111011"; ram[145] = "0b00111111010111101000100011101110"; ram[146] = "0b00111111010111001011000010010010"; ram[147] = "0b00111111010110101100110001111111"; ram[148] = "0b00111111010110001101110011001111"; ram[149] = "0b00111111010101101110000110011100"; ram[150] = "0b00111111010101001101101100000010"; ram[151] = "0b00111111010100101100100100011100"; ram[152] = "0b00111111010100001010110000000101"; ram[153] = "0b00111111010011101000001111011100"; ram[154] = "0b00111111010011000101000010111100"; ram[155] = "0b00111111010010100001001011000100"; ram[156] = "0b00111111010001111100101000010010"; ram[157] = "0b00111111010001010111011011000110"; ram[158] = "0b00111111010000110001100011111111"; ram[159] = "0b00111111010000001011000011011101"; ram[160] = "0b00111111001111100011111010000001"; ram[161] = "0b00111111001110111100001000001100"; ram[162] = "0b00111111001110010011101110011111"; ram[163] = "0b00111111001101101010101101011110"; ram[164] = "0b00111111001101000001000101101011"; ram[165] = "0b00111111001100010110110111101001"; ram[166] = "0b00111111001011101100000011111101"; ram[167] = "0b00111111001011000000101011001010"; ram[168] = "0b00111111001010010100101101110101"; ram[169] = "0b00111111001001101000001100100100"; ram[170] = "0b00111111001000111011000111111100"; ram[171] = "0b00111111001000001101100000100101"; ram[172] = "0b00111111000111011111010111000100"; ram[173] = "0b00111111000110110000101100000000"; ram[174] = "0b00111111000110000001100000000010"; ram[175] = "0b00111111000101010001110011110010"; ram[176] = "0b00111111000100100001100111110111"; ram[177] = "0b00111111000011110000111100111011"; ram[178] = "0b00111111000010111111110011101000"; ram[179] = "0b00111111000010001110001100100110"; ram[180] = "0b00111111000001011100001000100001"; ram[181] = "0b00111111000000101001101000000010"; ram[182] = "0b00111110111111101101010111101000"; ram[183] = "0b00111110111110000110101001000110"; ram[184] = "0b00111110111100011111000101110101"; ram[185] = "0b00111110111010110110101111001101"; ram[186] = "0b00111110111001001101100110100110"; ram[187] = "0b00111110110111100011101101011001"; ram[188] = "0b00111110110101111001000101000001"; ram[189] = "0b00111110110100001101101110111000"; ram[190] = "0b00111110110010100001101100011001"; ram[191] = "0b00111110110000110100111111000000"; ram[192] = "0b00111110101111000111101000001001"; ram[193] = "0b00111110101101011001101001010001"; ram[194] = "0b00111110101011101011000011110101"; ram[195] = "0b00111110101001111011111001010100"; ram[196] = "0b00111110101000001100001011001100"; ram[197] = "0b00111110100110011011111010111100"; ram[198] = "0b00111110100100101011001010000010"; ram[199] = "0b00111110100010111001111010000000"; ram[200] = "0b00111110100001001000001100010100"; ram[201] = "0b00111110011110101100000100111111"; ram[202] = "0b00111110011011000110111100000111"; ram[203] = "0b00111110010111100001000001000011"; ram[204] = "0b00111110010011111010010110110110"; ram[205] = "0b00111110010000010011000000100011"; ram[206] = "0b00111110001100101011000001001111"; ram[207] = "0b00111110001001000010011011111111"; ram[208] = "0b00111110000101011001010011111001"; ram[209] = "0b00111110000001101111101100000011"; ram[210] = "0b00111101111100001011001111000100"; ram[211] = "0b00111101110100110110010010111100"; ram[212] = "0b00111101101101100000101001111100"; ram[213] = "0b00111101100110001010011010010011"; ram[214] = "0b00111101011101100111010100011110"; ram[215] = "0b00111101001110111001000000000010"; ram[216] = "0b00111101000000001010000011110010"; ram[217] = "0b00111100100010110101011000011100"; ram[218] = "0b00111011001010110001011101110011"; ram[219] = "0b10111100010000010010001011000011"; ram[220] = "0b10111100110101101000000010010010"; ram[221] = "0b10111101001001100011001000110000"; ram[222] = "0b10111101011000010001101101000100"; ram[223] = "0b10111101100011011111110000110011"; ram[224] = "0b10111101101010110110001100111011"; ram[225] = "0b10111101110010001100000100101010"; ram[226] = "0b10111101111001100001010001110001"; ram[227] = "0b10111110000000011010110111000001"; ram[228] = "0b10111110000100000100101001101000"; ram[229] = "0b10111110000111101101111101100110"; ram[230] = "0b10111110001011010110101111110101"; ram[231] = "0b10111110001110111110111101010000"; ram[232] = "0b10111110010010100110100010110001"; ram[233] = "0b10111110010110001101011101010101"; ram[234] = "0b10111110011001110011101001110110"; ram[235] = "0b10111110011101011001000101010001"; ram[236] = "0b10111110100000011110110110010010"; ram[237] = "0b10111110100010010000101110010101"; ram[238] = "0b10111110100100000010001001010011"; ram[239] = "0b10111110100101110011000101101011"; ram[240] = "0b10111110100111100011100001111100"; ram[241] = "0b10111110101001010011011100100111"; ram[242] = "0b10111110101011000010110100001101"; ram[243] = "0b10111110101100110001100111010000"; ram[244] = "0b10111110101110011111110100010010"; ram[245] = "0b10111110110000001101011001110100"; ram[246] = "0b10111110110001111010010110011010"; ram[247] = "0b10111110110011100110101000100111"; ram[248] = "0b10111110110101010010001111000000"; ram[249] = "0b10111110110110111101001000001001"; ram[250] = "0b10111110111000100111010010100111"; ram[251] = "0b10111110111010010000101101000000"; ram[252] = "0b10111110111011111001010101111011"; ram[253] = "0b10111110111101100001001011111110"; ram[254] = "0b10111110111111001000001101110010"; ram[255] = "0b10111111000000010111001100111111"; ram[256] = "0b10111111000001001001110111100111"; ram[257] = "0b10111111000001111100000110000100"; ram[258] = "0b10111111000010101101110111101101"; ram[259] = "0b10111111000011011111001011110111"; ram[260] = "0b10111111000100010000000001111001"; ram[261] = "0b10111111000101000000011001001000"; ram[262] = "0b10111111000101110000010000111100"; ram[263] = "0b10111111000110011111101000101100"; ram[264] = "0b10111111000111001110011111110000"; ram[265] = "0b10111111000111111100110101100000"; ram[266] = "0b10111111001000101010101001010100"; ram[267] = "0b10111111001001010111111010100111"; ram[268] = "0b10111111001010000100101000110001"; ram[269] = "0b10111111001010110000110011001100"; ram[270] = "0b10111111001011011100011001010011"; ram[271] = "0b10111111001100000111011010100001"; ram[272] = "0b10111111001100110001110110010001"; ram[273] = "0b10111111001101011011101011111111"; ram[274] = "0b10111111001110000100111011001000"; ram[275] = "0b10111111001110101101100011001001"; ram[276] = "0b10111111001111010101100011100000"; ram[277] = "0b10111111001111111100111011101001"; ram[278] = "0b10111111010000100011101011000100"; ram[279] = "0b10111111010001001001110001010000"; ram[280] = "0b10111111010001101111001101101101"; ram[281] = "0b10111111010010010011111111111011"; ram[282] = "0b10111111010010111000000111011010"; ram[283] = "0b10111111010011011011100011101100"; ram[284] = "0b10111111010011111110010100010010"; ram[285] = "0b10111111010100100000011000110000"; ram[286] = "0b10111111010101000001110000101001"; ram[287] = "0b10111111010101100010011011011111"; ram[288] = "0b10111111010110000010011000110111"; ram[289] = "0b10111111010110100001101000010111"; ram[290] = "0b10111111010111000000001001100011"; ram[291] = "0b10111111010111011101111100000001"; ram[292] = "0b10111111010111111010111111011010"; ram[293] = "0b10111111011000010111010011010010"; ram[294] = "0b10111111011000110010110111010100"; ram[295] = "0b10111111011001001101101011000110"; ram[296] = "0b10111111011001100111101110010011"; ram[297] = "0b10111111011010000001000000100101"; ram[298] = "0b10111111011010011001100001100101"; ram[299] = "0b10111111011010110001010000111111"; ram[300] = "0b10111111011011001000001110011111"; ram[301] = "0b10111111011011011110011001110010"; ram[302] = "0b10111111011011110011110010100100"; ram[303] = "0b10111111011100001000011000100011"; ram[304] = "0b10111111011100011100001011011111"; ram[305] = "0b10111111011100101111001011000101"; ram[306] = "0b10111111011101000001010111000111"; ram[307] = "0b10111111011101010010101111010100"; ram[308] = "0b10111111011101100011010011011101"; ram[309] = "0b10111111011101110011000011010110"; ram[310] = "0b10111111011110000001111110101111"; ram[311] = "0b10111111011110010000000101011110"; ram[312] = "0b10111111011110011101010111010101"; ram[313] = "0b10111111011110101001110100001001"; ram[314] = "0b10111111011110110101011011110000"; ram[315] = "0b10111111011111000000001110000000"; ram[316] = "0b10111111011111001010001010110000"; ram[317] = "0b10111111011111010011010001111000"; ram[318] = "0b10111111011111011011100011001110"; ram[319] = "0b10111111011111100010111110101110"; ram[320] = "0b10111111011111101001100100010000"; ram[321] = "0b10111111011111101111010011101110"; ram[322] = "0b10111111011111110100001101000100"; ram[323] = "0b10111111011111111000010000001110"; ram[324] = "0b10111111011111111011011101001000"; ram[325] = "0b10111111011111111101110011101111"; ram[326] = "0b10111111011111111111010100000010"; ram[327] = "0b10111111011111111111111101111111"; ram[328] = "0b10111111011111111111110001100110"; ram[329] = "0b10111111011111111110101110110111"; ram[330] = "0b10111111011111111100110101110010"; ram[331] = "0b10111111011111111010000110011010"; ram[332] = "0b10111111011111110110100000110000"; ram[333] = "0b10111111011111110010000100111000"; ram[334] = "0b10111111011111101100110010110101"; ram[335] = "0b10111111011111100110101010101100"; ram[336] = "0b10111111011111011111101100100011"; ram[337] = "0b10111111011111010111111000011110"; ram[338] = "0b10111111011111001111001110100101"; ram[339] = "0b10111111011111000101101111000000"; ram[340] = "0b10111111011110111011011001110101"; ram[341] = "0b10111111011110110000001111001110"; ram[342] = "0b10111111011110100100001111010101"; ram[343] = "0b10111111011110010111011010010011"; ram[344] = "0b10111111011110001001110000010011"; ram[345] = "0b10111111011101111011010001100010"; ram[346] = "0b10111111011101101011111110001011"; ram[347] = "0b10111111011101011011110110011011"; ram[348] = "0b10111111011101001010111010100000"; ram[349] = "0b10111111011100111001001010101001"; ram[350] = "0b10111111011100100110100111000100"; ram[351] = "0b10111111011100010011010000000001"; ram[352] = "0b10111111011011111111000101110001"; ram[353] = "0b10111111011011101010001000100101"; ram[354] = "0b10111111011011010100011000101110"; ram[355] = "0b10111111011010111101110110100000"; ram[356] = "0b10111111011010100110100010001100"; ram[357] = "0b10111111011010001110011100001000"; ram[358] = "0b10111111011001110101100100100111"; ram[359] = "0b10111111011001011011111011111111"; ram[360] = "0b10111111011001000001100010100101"; ram[361] = "0b10111111011000100110011000101111"; ram[362] = "0b10111111011000001010011110110110"; ram[363] = "0b10111111010111101101110101010000"; ram[364] = "0b10111111010111010000011100010110"; ram[365] = "0b10111111010110110010010100100001"; ram[366] = "0b10111111010110010011011110001010"; ram[367] = "0b10111111010101110011111001101011"; ram[368] = "0b10111111010101010011100111100001"; ram[369] = "0b10111111010100110010101000000100"; ram[370] = "0b10111111010100010000111011110011"; ram[371] = "0b10111111010011101110100011001001"; ram[372] = "0b10111111010011001011011110100100"; ram[373] = "0b10111111010010100111101110100001"; ram[374] = "0b10111111010010000011010011011111"; ram[375] = "0b10111111010001011110001101111101"; ram[376] = "0b10111111010000111000011110011010"; ram[377] = "0b10111111010000010010000101010110"; ram[378] = "0b10111111001111101011000011010010"; ram[379] = "0b10111111001111000011011000101111"; ram[380] = "0b10111111001110011011000110001111"; ram[381] = "0b10111111001101110010001100010011"; ram[382] = "0b10111111001101001000101011100000"; ram[383] = "0b10111111001100011110100100010111"; ram[384] = "0b10111111001011110011110111011101"; ram[385] = "0b10111111001011001000100101010101"; ram[386] = "0b10111111001010011100101110100110"; ram[387] = "0b10111111001001110000010011110011"; ram[388] = "0b10111111001001000011010101100011"; ram[389] = "0b10111111001000010101110100011100"; ram[390] = "0b10111111000111100111110001000100"; ram[391] = "0b10111111000110111001001100000011"; ram[392] = "0b10111111000110001010000110000000"; ram[393] = "0b10111111000101011010011111100011"; ram[394] = "0b10111111000100101010011001010101"; ram[395] = "0b10111111000011111001110011111110"; ram[396] = "0b10111111000011001000110000000111"; ram[397] = "0b10111111000010010111001110011100"; ram[398] = "0b10111111000001100101001111100100"; ram[399] = "0b10111111000000110010110100001011"; ram[400] = "0b10111110111111111111111001111001"; ram[401] = "0b10111110111110011001010101000100"; ram[402] = "0b10111110111100110001111011010001"; ram[403] = "0b10111110111011001001101101110110"; ram[404] = "0b10111110111001100000101110001100"; ram[405] = "0b10111110110111110110111101101100"; ram[406] = "0b10111110110110001100011101110001"; ram[407] = "0b10111110110100100001001111110100"; ram[408] = "0b10111110110010110101010101010001"; ram[409] = "0b10111110110001001000101111100011"; ram[410] = "0b10111110101111011011100000000110"; ram[411] = "0b10111110101101101101101000011000"; ram[412] = "0b10111110101011111111001001110101"; ram[413] = "0b10111110101010010000000101111011"; ram[414] = "0b10111110101000100000011110001001"; ram[415] = "0b10111110100110110000010011111110"; ram[416] = "0b10111110100100111111101000111000"; ram[417] = "0b10111110100011001110011110010111"; ram[418] = "0b10111110100001011100110101111100"; ram[419] = "0b10111110011111010101100010001111"; ram[420] = "0b10111110011011110000100010110010"; ram[421] = "0b10111110011000001010110000100110"; ram[422] = "0b10111110010100100100001110101101"; ram[423] = "0b10111110010000111101000000001011"; ram[424] = "0b10111110001101010101001000000101"; ram[425] = "0b10111110001001101100101001011111"; ram[426] = "0b10111110000110000011100111011110"; ram[427] = "0b10111110000010011010000101001001"; ram[428] = "0b10111101111101100000001011001101"; ram[429] = "0b10111101110110001011010111111001"; ram[430] = "0b10111101101110110101110110100100"; ram[431] = "0b10111101100111011111101101011110"; ram[432] = "0b10111101100000001001000010110100"; ram[433] = "0b10111101010001100011111001110001"; ram[434] = "0b10111101000010110101000011110011"; ram[435] = "0b10111100101000001011100000100000"; ram[436] = "0b10111011101010110001011101001101"; ram[437] = "0b00000000000000000000000000000000"; ram[438] = "0b00111100011110011110110110100000"; ram[439] = "0b00111100111110011110011000101110"; ram[440] = "0b00111101001110110110001101010101"; ram[441] = "0b00111101011110011100100001101000"; ram[442] = "0b00111101100111000000111101001101"; ram[443] = "0b00111101101110110011000100011010"; ram[444] = "0b00111101110110100100011111000001"; ram[445] = "0b00111101111110010101000101100110"; ram[446] = "0b00111110000011000010011000011000"; ram[447] = "0b00111110000110111001101100100101"; ram[448] = "0b00111110001010110000011011101011"; ram[449] = "0b00111110001110100110100010000010"; ram[450] = "0b00111110010010011011111011111110"; ram[451] = "0b00111110010110010000100101110101"; ram[452] = "0b00111110011010000100011011111110"; ram[453] = "0b00111110011101110111011010110000"; ram[454] = "0b00111110100000110100101111010010"; ram[455] = "0b00111110100010101101010001111010"; ram[456] = "0b00111110100100100101010011011101"; ram[457] = "0b00111110100110011100110010000111"; ram[458] = "0b00111110101000010011101100001001"; ram[459] = "0b00111110101010001001111111101111"; ram[460] = "0b00111110101011111111101011001010"; ram[461] = "0b00111110101101110100101100101001"; ram[462] = "0b00111110101111101001000010011100"; ram[463] = "0b00111110110001011100101010110101"; ram[464] = "0b00111110110011001111100100000110"; ram[465] = "0b00111110110101000001101100100000"; ram[466] = "0b00111110110110110011000010011000"; ram[467] = "0b00111110111000100011100100000001"; ram[468] = "0b00111110111010010011001111110000"; ram[469] = "0b00111110111100000010000011111010"; ram[470] = "0b00111110111101101111111110110110"; ram[471] = "0b00111110111111011100111110111100"; ram[472] = "0b00111111000000100100100001010001"; ram[473] = "0b00111111000001011010000100000001"; ram[474] = "0b00111111000010001111000110111011"; ram[475] = "0b00111111000011000011101001001101"; ram[476] = "0b00111111000011110111101010000100"; ram[477] = "0b00111111000100101011001000101111"; ram[478] = "0b00111111000101011110000100011101"; ram[479] = "0b00111111000110010000011100011101"; ram[480] = "0b00111111000111000010001111111111"; ram[481] = "0b00111111000111110011011110010100"; ram[482] = "0b00111111001000100100000110101100"; ram[483] = "0b00111111001001010100001000011010"; ram[484] = "0b00111111001010000011100010110000"; ram[485] = "0b00111111001010110010010101000000"; ram[486] = "0b00111111001011100000011110011110"; ram[487] = "0b00111111001100001101111110011110"; ram[488] = "0b00111111001100111010110100010101"; ram[489] = "0b00111111001101100110111111010111"; ram[490] = "0b00111111001110010010011110111011"; ram[491] = "0b00111111001110111101010010010111"; ram[492] = "0b00111111001111100111011001000010"; ram[493] = "0b00111111010000010000110010010101"; ram[494] = "0b00111111010000111001011101101000"; ram[495] = "0b00111111010001100001011010010011"; ram[496] = "0b00111111010010001000100111110010"; ram[497] = "0b00111111010010101111000101011110"; ram[498] = "0b00111111010011010100110010110011"; ram[499] = "0b00111111010011111001101111001110"; ram[500] = "0b00111111010100011101111010001010"; ram[501] = "0b00111111010101000001010011000101"; ram[502] = "0b00111111010101100011111001011110"; ram[503] = "0b00111111010110000101101100110011"; ram[504] = "0b00111111010110100110101100100101"; ram[505] = "0b00111111010111000110111000010100"; ram[506] = "0b00111111010111100110001111100000"; ram[507] = "0b00111111011000000100110001101110"; ram[508] = "0b00111111011000100010011110011110"; ram[509] = "0b00111111011000111111010101010110"; ram[510] = "0b00111111011001011011010101111001"; ram[511] = "0b00111111011001110110011111101100"; ram[512] = "0b00111111011010010000110010010111"; ram[513] = "0b00111111011010101010001101011111"; ram[514] = "0b00111111011011000010110000101101"; ram[515] = "0b00111111011011011010011011101001"; ram[516] = "0b00111111011011110001001101111100"; ram[517] = "0b00111111011100000111000111010010"; ram[518] = "0b00111111011100011100000111010100"; ram[519] = "0b00111111011100110000001101101111"; ram[520] = "0b00111111011101000011011010010001"; ram[521] = "0b00111111011101010101101100100101"; ram[522] = "0b00111111011101100111000100011100"; ram[523] = "0b00111111011101110111100001100101"; ram[524] = "0b00111111011110000111000011101111"; ram[525] = "0b00111111011110010101101010101100"; ram[526] = "0b00111111011110100011010110001111"; ram[527] = "0b00111111011110110000000110001001"; ram[528] = "0b00111111011110111011111010001111"; ram[529] = "0b00111111011111000110110010010110"; ram[530] = "0b00111111011111010000101110010100"; ram[531] = "0b00111111011111011001101101111110"; ram[532] = "0b00111111011111100001110001001100"; ram[533] = "0b00111111011111101000110111110111"; ram[534] = "0b00111111011111101111000001111000"; ram[535] = "0b00111111011111110100001111001001"; ram[536] = "0b00111111011111111000011111100101"; ram[537] = "0b00111111011111111011110011001000"; ram[538] = "0b00111111011111111110001001101110"; ram[539] = "0b00111111011111111111100011010110"; ram[540] = "0b00111111011111111111111111111110"; ram[541] = "0b00111111011111111111011111100110"; ram[542] = "0b00111111011111111110000010001110"; ram[543] = "0b00111111011111111011100111111000"; ram[544] = "0b00111111011111111000010000100110"; ram[545] = "0b00111111011111110011111100011011"; ram[546] = "0b00111111011111101110101011011011"; ram[547] = "0b00111111011111101000011101101011"; ram[548] = "0b00111111011111100001010011010010"; ram[549] = "0b00111111011111011001001100010110"; ram[550] = "0b00111111011111010000001000111110"; ram[551] = "0b00111111011111000110001001010100"; ram[552] = "0b00111111011110111011001101100001"; ram[553] = "0b00111111011110101111010101101111"; ram[554] = "0b00111111011110100010100010001001"; ram[555] = "0b00111111011110010100110010111101"; ram[556] = "0b00111111011110000110001000010110"; ram[557] = "0b00111111011101110110100010100100"; ram[558] = "0b00111111011101100110000001110100"; ram[559] = "0b00111111011101010100100110010111"; ram[560] = "0b00111111011101000010010000011101"; ram[561] = "0b00111111011100101111000000010111"; ram[562] = "0b00111111011100011010110110011001"; ram[563] = "0b00111111011100000101110010110100"; ram[564] = "0b00111111011011101111110101111110"; ram[565] = "0b00111111011011011001000000001100"; ram[566] = "0b00111111011011000001010001110010"; ram[567] = "0b00111111011010101000101011000111"; ram[568] = "0b00111111011010001111001100100100"; ram[569] = "0b00111111011001110100110110100000"; ram[570] = "0b00111111011001011001101001010100"; ram[571] = "0b00111111011000111101100101011011"; ram[572] = "0b00111111011000100000101011001111"; ram[573] = "0b00111111011000000010111011001011"; ram[574] = "0b00111111010111100100010101101101"; ram[575] = "0b00111111010111000100111011010000"; ram[576] = "0b00111111010110100100101100010100"; ram[577] = "0b00111111010110000011101001010111"; ram[578] = "0b00111111010101100001110010110111"; ram[579] = "0b00111111010100111111001001010111"; ram[580] = "0b00111111010100011011101101010110"; ram[581] = "0b00111111010011110111011111010111"; ram[582] = "0b00111111010011010010011111111011"; ram[583] = "0b00111111010010101100101111100111"; ram[584] = "0b00111111010010000110001110111101"; ram[585] = "0b00111111010001011110111110100100"; ram[586] = "0b00111111010000110110111111000000"; ram[587] = "0b00111111010000001110010000110111"; ram[588] = "0b00111111001111100100110100110001"; ram[589] = "0b00111111001110111010101011010100"; ram[590] = "0b00111111001110001111110101001001"; ram[591] = "0b00111111001101100100010010111001"; ram[592] = "0b00111111001100111000000101001110"; ram[593] = "0b00111111001100001011001100110000"; ram[594] = "0b00111111001011011101101010001100"; ram[595] = "0b00111111001010101111011110001100"; ram[596] = "0b00111111001010000000101001011101"; ram[597] = "0b00111111001001010001001100101011"; ram[598] = "0b00111111001000100001001000100100"; ram[599] = "0b00111111000111110000011101110101"; ram[600] = "0b00111111000110111111001101001100"; ram[601] = "0b00111111000110001101010111011001"; ram[602] = "0b00111111000101011010111101001100"; ram[603] = "0b00111111000100100111111111010011"; ram[604] = "0b00111111000011110100011110100000"; ram[605] = "0b00111111000011000000011011100100"; ram[606] = "0b00111111000010001011110111010001"; ram[607] = "0b00111111000001010110110010011000"; ram[608] = "0b00111111000000100001001101101100"; ram[609] = "0b00111110111111010110010100000001"; ram[610] = "0b00111110111101101001010000010001"; ram[611] = "0b00111110111011111011010001110001"; ram[612] = "0b00111110111010001100011010001001"; ram[613] = "0b00111110111000011100101011000011"; ram[614] = "0b00111110110110101100000110001010"; ram[615] = "0b00111110110100111010101101001000"; ram[616] = "0b00111110110011001000100001101010"; ram[617] = "0b00111110110001010101100101011101"; ram[618] = "0b00111110101111100001111010001110"; ram[619] = "0b00111110101101101101100001101100"; ram[620] = "0b00111110101011111000011101100101"; ram[621] = "0b00111110101010000010101111101001"; ram[622] = "0b00111110101000001100011001101000"; ram[623] = "0b00111110100110010101011101010011"; ram[624] = "0b00111110100100011101111100011100"; ram[625] = "0b00111110100010100101111000110100"; ram[626] = "0b00111110100000101101010100001110"; ram[627] = "0b00111110011101101000100000111001"; ram[628] = "0b00111110011001110101011110100110"; ram[629] = "0b00111110010110000001100101001011"; ram[630] = "0b00111110010010001100111000010001"; ram[631] = "0b00111110001110010111011011100000"; ram[632] = "0b00111110001010100001010010100010"; ram[633] = "0b00111110000110101010100001000010"; ram[634] = "0b00111110000010110011001010101100"; ram[635] = "0b00111101111101110110100110010110"; ram[636] = "0b00111101110110000101111100010111"; ram[637] = "0b00111101101110010100011110110011"; ram[638] = "0b00111101100110100010010101000110"; ram[639] = "0b00111101011101011111001101010101"; ram[640] = "0b00111101001101111000110101110110"; ram[641] = "0b00111100111100100011100101001111"; ram[642] = "0b00111100011010101001001010001010"; ram[643] = "0b10111010011101011011100000111110"; ram[644] = "0b10111100100001001010010001010100"; ram[645] = "0b10111101000000001100100101111111"; ram[646] = "0b10111101001111110011100100101001"; ram[647] = "0b10111101011111011001110101101110"; ram[648] = "0b10111101100111011111100101001100"; ram[649] = "0b10111101101111010001101001110111"; ram[650] = "0b10111101110111000011000001011110"; ram[651] = "0b10111101111110110011100100101000"; ram[652] = "0b10111110000011010001100101111101"; ram[653] = "0b10111110000111001000110111111110"; ram[654] = "0b10111110001010111111100100101011"; ram[655] = "0b10111110001110110101101000011010"; ram[656] = "0b10111110010010101010111111011111"; ram[657] = "0b10111110010110011111100110010010"; ram[658] = "0b10111110011010010011011001001000"; ram[659] = "0b10111110011110000110010100011001"; ram[660] = "0b10111110100000111100001010001111"; ram[661] = "0b10111110100010110100101010111000"; ram[662] = "0b10111110100100101100101010010101"; ram[663] = "0b10111110100110100100000110110011"; ram[664] = "0b10111110101000011010111110100000"; ram[665] = "0b10111110101010010001001111101100"; ram[666] = "0b10111110101100000110111000100101"; ram[667] = "0b10111110101101111011110111011011"; ram[668] = "0b10111110101111110000001010011111"; ram[669] = "0b10111110110001100011110000000010"; ram[670] = "0b10111110110011010110100110010110"; ram[671] = "0b10111110110101001000101011101101"; ram[672] = "0b10111110110110111001111110011010"; ram[673] = "0b10111110111000101010011100110010"; ram[674] = "0b10111110111010011010000101001010"; ram[675] = "0b10111110111100001000110101110110"; ram[676] = "0b10111110111101110110101101001101"; ram[677] = "0b10111110111111100011101001101000"; ram[678] = "0b10111111000000100111110100101110"; ram[679] = "0b10111111000001011101010101100011"; ram[680] = "0b10111111000010010010010110011110"; ram[681] = "0b10111111000011000110110110101110"; ram[682] = "0b10111111000011111010110101100000"; ram[683] = "0b10111111000100101110010010000011"; ram[684] = "0b10111111000101100001001011100110"; ram[685] = "0b10111111000110010011100001011000"; ram[686] = "0b10111111000111000101010010101001"; ram[687] = "0b10111111000111110110011110101010"; ram[688] = "0b10111111001000100111000100101011"; ram[689] = "0b10111111001001010111000100000000"; ram[690] = "0b10111111001010000110011011111001"; ram[691] = "0b10111111001010110101001011101010"; ram[692] = "0b10111111001011100011010010100111"; ram[693] = "0b10111111001100010000110000000010"; ram[694] = "0b10111111001100111101100011010001"; ram[695] = "0b10111111001101101001101011101010"; ram[696] = "0b10111111001110010101001000100001"; ram[697] = "0b10111111001110111111111001001111"; ram[698] = "0b10111111001111101001111101001001"; ram[699] = "0b10111111010000010011010011101000"; ram[700] = "0b10111111010000111011111100000100"; ram[701] = "0b10111111010001100011110101110111"; ram[702] = "0b10111111010010001011000000011011"; ram[703] = "0b10111111010010110001011011001010"; ram[704] = "0b10111111010011010111000101100000"; ram[705] = "0b10111111010011111011111110111001"; ram[706] = "0b10111111010100100000000110110001"; ram[707] = "0b10111111010101000011011100100111"; ram[708] = "0b10111111010101100101111111111000"; ram[709] = "0b10111111010110000111110000000011"; ram[710] = "0b10111111010110101000101100101001"; ram[711] = "0b10111111010111001000110101001010"; ram[712] = "0b10111111010111101000001001000111"; ram[713] = "0b10111111011000000110101000000011"; ram[714] = "0b10111111011000100100010001100001"; ram[715] = "0b10111111011001000001000101000011"; ram[716] = "0b10111111011001011101000010010000"; ram[717] = "0b10111111011001111000001000101011"; ram[718] = "0b10111111011010010010010111111100"; ram[719] = "0b10111111011010101011101111101001"; ram[720] = "0b10111111011011000100001111011010"; ram[721] = "0b10111111011011011011110110111000"; ram[722] = "0b10111111011011110010100101101100"; ram[723] = "0b10111111011100001000011011100001"; ram[724] = "0b10111111011100011101011000000001"; ram[725] = "0b10111111011100110001011010111010"; ram[726] = "0b10111111011101000100100011110111"; ram[727] = "0b10111111011101010110110010100110"; ram[728] = "0b10111111011101101000000110110110"; ram[729] = "0b10111111011101111000100000010111"; ram[730] = "0b10111111011110000111111110111001"; ram[731] = "0b10111111011110010110100010001101"; ram[732] = "0b10111111011110100100001010000101"; ram[733] = "0b10111111011110110000110110010101"; ram[734] = "0b10111111011110111100100110110000"; ram[735] = "0b10111111011111000111011011001010"; ram[736] = "0b10111111011111010001010011011011"; ram[737] = "0b10111111011111011010001111011000"; ram[738] = "0b10111111011111100010001110111000"; ram[739] = "0b10111111011111101001010001110101"; ram[740] = "0b10111111011111101111011000000111"; ram[741] = "0b10111111011111110100100001101001"; ram[742] = "0b10111111011111111000101110010101"; ram[743] = "0b10111111011111111011111110001000"; ram[744] = "0b10111111011111111110010000111111"; ram[745] = "0b10111111011111111111100110110111"; ram[746] = "0b10111111011111111111111111101111"; ram[747] = "0b10111111011111111111011011100111"; ram[748] = "0b10111111011111111101111010100000"; ram[749] = "0b10111111011111111011011100011010"; ram[750] = "0b10111111011111111000000001011000"; ram[751] = "0b10111111011111110011101001011110"; ram[752] = "0b10111111011111101110010100101111"; ram[753] = "0b10111111011111101000000011010001"; ram[754] = "0b10111111011111100000110101001001"; ram[755] = "0b10111111011111011000101010011111"; ram[756] = "0b10111111011111001111100011011010"; ram[757] = "0b10111111011111000101100000000011"; ram[758] = "0b10111111011110111010100000100011"; ram[759] = "0b10111111011110101110100101000110"; ram[760] = "0b10111111011110100001101101110110"; ram[761] = "0b10111111011110010011111010111111"; ram[762] = "0b10111111011110000101001100110000"; ram[763] = "0b10111111011101110101100011010101"; ram[764] = "0b10111111011101100100111110111110"; ram[765] = "0b10111111011101010011011111111010"; ram[766] = "0b10111111011101000001000110011011"; ram[767] = "0b10111111011100101101110010110001"; ram[768] = "0b10111111011100011001100101010000"; ram[769] = "0b10111111011100000100011110001001"; ram[770] = "0b10111111011011101110011101110011"; ram[771] = "0b10111111011011010111100100100001"; ram[772] = "0b10111111011010111111110010101001"; ram[773] = "0b10111111011010100111001000100010"; ram[774] = "0b10111111011010001101100110100100"; ram[775] = "0b10111111011001110011001101000110"; ram[776] = "0b10111111011001010111111100100011"; ram[777] = "0b10111111011000111011110101010011"; ram[778] = "0b10111111011000011110110111110010"; ram[779] = "0b10111111011000000001000100011100"; ram[780] = "0b10111111010111100010011011101100"; ram[781] = "0b10111111010111000010111110000000"; ram[782] = "0b10111111010110100010101011110111"; ram[783] = "0b10111111010110000001100101101110"; ram[784] = "0b10111111010101011111101100000101"; ram[785] = "0b10111111010100111100111111011101"; ram[786] = "0b10111111010100011001100000010110"; ram[787] = "0b10111111010011110101001111010100"; ram[788] = "0b10111111010011010000001100110111"; ram[789] = "0b10111111010010101010011001100011"; ram[790] = "0b10111111010010000011110101111101"; ram[791] = "0b10111111010001011100100010101001"; ram[792] = "0b10111111010000110100100000001101"; ram[793] = "0b10111111010000001011101111001110"; ram[794] = "0b10111111001111100010010000010100"; ram[795] = "0b10111111001110111000000100000111"; ram[796] = "0b10111111001110001101001011001101"; ram[797] = "0b10111111001101100001100110010001"; ram[798] = "0b10111111001100110101010101111100"; ram[799] = "0b10111111001100001000011010111000"; ram[800] = "0b10111111001011011010110101101111"; ram[801] = "0b10111111001010101100100111001110"; ram[802] = "0b10111111001001111101110000000000"; ram[803] = "0b10111111001001001110010000110010"; ram[804] = "0b10111111001000011110001010010010"; ram[805] = "0b10111111000111101101011101001100"; ram[806] = "0b10111111000110111100001010010000"; ram[807] = "0b10111111000110001010010010001101"; ram[808] = "0b10111111000101010111110101110010"; ram[809] = "0b10111111000100100100110101101110"; ram[810] = "0b10111111000011110001010010110100"; ram[811] = "0b10111111000010111101001101110011"; ram[812] = "0b10111111000010001000100111011110"; ram[813] = "0b10111111000001010011100000100111"; ram[814] = "0b10111111000000011101111001111111"; ram[815] = "0b10111110111111001111101000110111"; ram[816] = "0b10111110111101100010100001011110"; ram[817] = "0b10111110111011110100011111011010"; ram[818] = "0b10111110111010000101100100010101"; ram[819] = "0b10111110111000010101110001111000"; ram[820] = "0b10111110110110100101001001101111"; ram[821] = "0b10111110110100110011101101100011"; ram[822] = "0b10111110110011000001011111000011"; ram[823] = "0b10111110110001001110011111111010"; ram[824] = "0b10111110101111011010110001110101"; ram[825] = "0b10111110101101100110010110100100"; ram[826] = "0b10111110101011110001001111110110"; ram[827] = "0b10111110101001111011011111011001"; ram[828] = "0b10111110101000000101000110111110"; ram[829] = "0b10111110100110001110001000010111"; ram[830] = "0b10111110100100010110100101010011"; ram[831] = "0b10111110100010011110011111100110"; ram[832] = "0b10111110100000100101111001000010"; ram[833] = "0b10111110011101011001100110110100"; ram[834] = "0b10111110011001100110100001000010"; ram[835] = "0b10111110010101110010100100010110"; ram[836] = "0b10111110010001111101110100011000"; ram[837] = "0b10111110001110001000010100110010"; ram[838] = "0b10111110001010010010001001001110"; ram[839] = "0b10111110000110011011010101010111"; ram[840] = "0b10111110000010100011111100111000"; ram[841] = "0b10111101111101011000000110111000"; ram[842] = "0b10111101110101100111011001100000"; ram[843] = "0b10111101101101110101111001000001"; ram[844] = "0b10111101100110000011101100110110"; ram[845] = "0b10111101011100100001111000110011"; ram[846] = "0b10111101001100111011011110001100"; ram[847] = "0b10111100111010101000110001100011"; ram[848] = "0b10111100010110110011011101100111"; for (unsigned i = 849; i < 875 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[875] = "0b00111100100001000110010100011101"; ram[876] = "0b00111101000001000110000010110000"; ram[877] = "0b00111101010001101000010111110111"; ram[878] = "0b00111101100001000100111011111100"; ram[879] = "0b00111101101001010101001000100100"; ram[880] = "0b00111101110001100100101000111101"; ram[881] = "0b00111101111001110011010100010100"; ram[882] = "0b00111110000001000000100000111010"; ram[883] = "0b00111110000101000110110100010111"; ram[884] = "0b00111110001001001100100000000110"; ram[885] = "0b00111110001101010001011111110001"; ram[886] = "0b00111110010001010101101110111111"; ram[887] = "0b00111110010101011001001001011011"; ram[888] = "0b00111110011001011011101010101111"; ram[889] = "0b00111110011101011101001110100110"; ram[890] = "0b00111110100000101110111000010110"; ram[891] = "0b00111110100010101110100110011001"; ram[892] = "0b00111110100100101101101111010001"; ram[893] = "0b00111110100110101100010000110111"; ram[894] = "0b00111110101000101010001001000011"; ram[895] = "0b00111110101010100111010101110000"; ram[896] = "0b00111110101100100011110100110111"; ram[897] = "0b00111110101110011111100100010010"; ram[898] = "0b00111110110000011010100001111110"; ram[899] = "0b00111110110010010100101011110110"; ram[900] = "0b00111110110100001101111111111001"; ram[901] = "0b00111110110110000110011100000100"; ram[902] = "0b00111110110111111101111110010110"; ram[903] = "0b00111110111001110100100100110000"; ram[904] = "0b00111110111011101010001101010011"; ram[905] = "0b00111110111101011110110110000000"; ram[906] = "0b00111110111111010010011100111100"; ram[907] = "0b00111111000000100010100000000101"; ram[908] = "0b00111111000001011011001110111000"; ram[909] = "0b00111111000010010011011001111010"; ram[910] = "0b00111111000011001011000000001111"; ram[911] = "0b00111111000100000010000000111100"; ram[912] = "0b00111111000100111000011011000101"; ram[913] = "0b00111111000101101110001101110001"; ram[914] = "0b00111111000110100011011000000110"; ram[915] = "0b00111111000111010111111001001011"; ram[916] = "0b00111111001000001011110000001000"; ram[917] = "0b00111111001000111110111100000110"; ram[918] = "0b00111111001001110001011100001101"; ram[919] = "0b00111111001010100011001111100111"; ram[920] = "0b00111111001011010100010101100000"; ram[921] = "0b00111111001100000100101101000011"; ram[922] = "0b00111111001100110100010101011100"; ram[923] = "0b00111111001101100011001101111000"; ram[924] = "0b00111111001110010001010101100101"; ram[925] = "0b00111111001110111110101011110010"; ram[926] = "0b00111111001111101011001111101110"; ram[927] = "0b00111111010000010111000000101001"; ram[928] = "0b00111111010001000001111101110101"; ram[929] = "0b00111111010001101100000110100011"; ram[930] = "0b00111111010010010101011010000111"; ram[931] = "0b00111111010010111101110111110100"; ram[932] = "0b00111111010011100101011110111111"; ram[933] = "0b00111111010100001100001110111110"; ram[934] = "0b00111111010100110010000111001000"; ram[935] = "0b00111111010101010111000110110010"; ram[936] = "0b00111111010101111011001101010111"; ram[937] = "0b00111111010110011110011010010000"; ram[938] = "0b00111111010111000000101100110110"; ram[939] = "0b00111111010111100010000100100110"; ram[940] = "0b00111111011000000010100000111010"; ram[941] = "0b00111111011000100010000001010010"; ram[942] = "0b00111111011001000000100101001011"; ram[943] = "0b00111111011001011110001100000011"; ram[944] = "0b00111111011001111010110101011101"; ram[945] = "0b00111111011010010110100000111000"; ram[946] = "0b00111111011010110001001101111000"; ram[947] = "0b00111111011011001010111100000000"; ram[948] = "0b00111111011011100011101010110100"; ram[949] = "0b00111111011011111011011001111010"; ram[950] = "0b00111111011100010010001000111000"; ram[951] = "0b00111111011100100111110111010110"; ram[952] = "0b00111111011100111100100100111101"; ram[953] = "0b00111111011101010000010001010111"; ram[954] = "0b00111111011101100010111100001110"; ram[955] = "0b00111111011101110100100101001111"; ram[956] = "0b00111111011110000101001100000111"; ram[957] = "0b00111111011110010100110000100100"; ram[958] = "0b00111111011110100011010010010101"; ram[959] = "0b00111111011110110000110001001011"; ram[960] = "0b00111111011110111101001100111000"; ram[961] = "0b00111111011111001000100101001101"; ram[962] = "0b00111111011111010010111010000000"; ram[963] = "0b00111111011111011100001011000100"; ram[964] = "0b00111111011111100100011000010000"; ram[965] = "0b00111111011111101011100001011011"; ram[966] = "0b00111111011111110001100110011110"; ram[967] = "0b00111111011111110110100111010010"; ram[968] = "0b00111111011111111010100011110001"; ram[969] = "0b00111111011111111101011011111000"; ram[970] = "0b00111111011111111111001111100100"; ram[971] = "0b00111111011111111111111110110001"; ram[972] = "0b00111111011111111111101001100001"; ram[973] = "0b00111111011111111110001111110010"; ram[974] = "0b00111111011111111011110001100111"; ram[975] = "0b00111111011111111000001111000010"; ram[976] = "0b00111111011111110011101000000110"; ram[977] = "0b00111111011111101101111100111010"; ram[978] = "0b00111111011111100111001101100011"; ram[979] = "0b00111111011111011111011010000111"; ram[980] = "0b00111111011111010110100010110001"; ram[981] = "0b00111111011111001100100111101000"; ram[982] = "0b00111111011111000001101000110111"; ram[983] = "0b00111111011110110101100110101011"; ram[984] = "0b00111111011110101000100001010001"; ram[985] = "0b00111111011110011010011000110101"; ram[986] = "0b00111111011110001011001101101000"; ram[987] = "0b00111111011101111010111111111001"; ram[988] = "0b00111111011101101001101111111011"; ram[989] = "0b00111111011101010111011101111110"; ram[990] = "0b00111111011101000100001010011000"; ram[991] = "0b00111111011100101111110101011100"; ram[992] = "0b00111111011100011010011111100000"; ram[993] = "0b00111111011100000100001000111100"; ram[994] = "0b00111111011011101100110010000110"; ram[995] = "0b00111111011011010100011011011001"; ram[996] = "0b00111111011010111011000101001110"; ram[997] = "0b00111111011010100000110000000000"; ram[998] = "0b00111111011010000101011100001100"; ram[999] = "0b00111111011001101001001010001110"; ram[1000] = "0b00111111011001001011111010100101"; ram[1001] = "0b00111111011000101101101101110000"; ram[1002] = "0b00111111011000001110100100010000"; ram[1003] = "0b00111111010111101110011110100101"; ram[1004] = "0b00111111010111001101011101010011"; ram[1005] = "0b00111111010110101011100000111100"; ram[1006] = "0b00111111010110001000101010000101"; ram[1007] = "0b00111111010101100100111001010011"; ram[1008] = "0b00111111010101000000001111001101"; ram[1009] = "0b00111111010100011010101100011001"; ram[1010] = "0b00111111010011110100010001100000"; ram[1011] = "0b00111111010011001100111111001010"; ram[1012] = "0b00111111010010100100110110000011"; ram[1013] = "0b00111111010001111011110110110100"; ram[1014] = "0b00111111010001010010000010001010"; ram[1015] = "0b00111111010000100111011000110001"; ram[1016] = "0b00111111001111111011111011011000"; ram[1017] = "0b00111111001111001111101010101100"; ram[1018] = "0b00111111001110100010100111011101"; ram[1019] = "0b00111111001101110100110010011011"; ram[1020] = "0b00111111001101000110001100010111"; ram[1021] = "0b00111111001100010110110110000100"; ram[1022] = "0b00111111001011100110110000010011"; ram[1023] = "0b00111111001010110101111011111000"; ram[1024] = "0b00111111001010000100011001100111"; ram[1025] = "0b00111111001001010010001010010110"; ram[1026] = "0b00111111001000011111001110111010"; ram[1027] = "0b00111111000111101011101000001001"; ram[1028] = "0b00111111000110110111010110111011"; ram[1029] = "0b00111111000110000010011100001000"; ram[1030] = "0b00111111000101001100111000101000"; ram[1031] = "0b00111111000100010110101101010101"; ram[1032] = "0b00111111000011011111111011001001"; ram[1033] = "0b00111111000010101000100010111110"; ram[1034] = "0b00111111000001110000100101101111"; ram[1035] = "0b00111111000000111000000100011000"; ram[1036] = "0b00111110111111111101111111101110"; ram[1037] = "0b00111110111110001010110010001110"; ram[1038] = "0b00111110111100010110100010001110"; ram[1039] = "0b00111110111010100001010001101001"; ram[1040] = "0b00111110111000101011000010011100"; ram[1041] = "0b00111110110110110011110110100111"; ram[1042] = "0b00111110110100111011110000001001"; ram[1043] = "0b00111110110011000010110001000011"; ram[1044] = "0b00111110110001001000111011010101"; ram[1045] = "0b00111110101111001110010001000010"; ram[1046] = "0b00111110101101010010110100001110"; ram[1047] = "0b00111110101011010110100110111101"; ram[1048] = "0b00111110101001011001101011010010"; ram[1049] = "0b00111110100111011100000011010101"; ram[1050] = "0b00111110100101011101110001001011"; ram[1051] = "0b00111110100011011110110110111100"; ram[1052] = "0b00111110100001011111010110101111"; ram[1053] = "0b00111110011110111110100101011010"; ram[1054] = "0b00111110011010111101011001111110"; ram[1055] = "0b00111110010110111011001111011100"; ram[1056] = "0b00111110010010111000001010001001"; ram[1057] = "0b00111110001110110100001110011011"; ram[1058] = "0b00111110001010101111100000100110"; ram[1059] = "0b00111110000110101010000101000011"; ram[1060] = "0b00111110000010100100000000001001"; ram[1061] = "0b00111101111100111010101100100000"; ram[1062] = "0b00111101110100101100010111100011"; ram[1063] = "0b00111101101100011101001010001110"; ram[1064] = "0b00111101100100001101001101010101"; ram[1065] = "0b00111101010111111001010011011001"; ram[1066] = "0b00111101000111010111010000010100"; ram[1067] = "0b00111100101101101001000110010001"; ram[1068] = "0b00111011110010001011101100010000"; ram[1069] = "0b10111100001001000110111011001000"; ram[1070] = "0b10111100110101101001100000001101"; ram[1071] = "0b10111101001011010111010100101110"; ram[1072] = "0b10111101011011111001001010111100"; ram[1073] = "0b10111101100110001101000000100010"; ram[1074] = "0b10111101101110011100110010101111"; ram[1075] = "0b10111101110110101011110011001111"; ram[1076] = "0b10111101111110111001111001001110"; ram[1077] = "0b10111110000011100011011101111101"; ram[1078] = "0b10111110000111101001011001010000"; ram[1079] = "0b10111110001011101110101010001001"; ram[1080] = "0b10111110001111110011001100001111"; ram[1081] = "0b10111110010011110110111011001100"; ram[1082] = "0b10111110010111111001110010101011"; ram[1083] = "0b10111110011011111011101110010101"; ram[1084] = "0b10111110011111111100101001110111"; ram[1085] = "0b10111110100001111110010000011111"; ram[1086] = "0b10111110100011111101100111101101"; ram[1087] = "0b10111110100101111100011000011100"; ram[1088] = "0b10111110100111111010100000100100"; ram[1089] = "0b10111110101001110111111110000000"; ram[1090] = "0b10111110101011110100101110101000"; ram[1091] = "0b10111110101101110000110000011000"; ram[1092] = "0b10111110101111101100000001001010"; ram[1093] = "0b10111110110001100110011110111010"; ram[1094] = "0b10111110110011100000000111100110"; ram[1095] = "0b10111110110101011000111001001100"; ram[1096] = "0b10111110110111010000110001101001"; ram[1097] = "0b10111110111001000111101110111111"; ram[1098] = "0b10111110111010111101101111001101"; ram[1099] = "0b10111110111100110010110000010110"; ram[1100] = "0b10111110111110100110110000011100"; ram[1101] = "0b10111111000000001100110110110001"; ram[1102] = "0b10111111000001000101110010111000"; ram[1103] = "0b10111111000001111110001011100100"; ram[1104] = "0b10111111000010110101111111111011"; ram[1105] = "0b10111111000011101101001110111111"; ram[1106] = "0b10111111000100100011110111110111"; ram[1107] = "0b10111111000101011001111001100111"; ram[1108] = "0b10111111000110001111010011010110"; ram[1109] = "0b10111111000111000100000100001010"; ram[1110] = "0b10111111000111111000001011001011"; ram[1111] = "0b10111111001000101011100111100010"; ram[1112] = "0b10111111001001011110011000010111"; ram[1113] = "0b10111111001010010000011100110101"; ram[1114] = "0b10111111001011000001110100000100"; ram[1115] = "0b10111111001011110010011101010010"; ram[1116] = "0b10111111001100100010010111101000"; ram[1117] = "0b10111111001101010001100010010110"; ram[1118] = "0b10111111001101111111111100100111"; ram[1119] = "0b10111111001110101101100101101010"; ram[1120] = "0b10111111001111011010011100101111"; ram[1121] = "0b10111111010000000110100001000101"; ram[1122] = "0b10111111010000110001110001111101"; ram[1123] = "0b10111111010001011100001110101001"; ram[1124] = "0b10111111010010000101110110011100"; ram[1125] = "0b10111111010010101110101000101001"; ram[1126] = "0b10111111010011010110100100100100"; ram[1127] = "0b10111111010011111101101001100010"; ram[1128] = "0b10111111010100100011110110111011"; ram[1129] = "0b10111111010101001001001100000101"; ram[1130] = "0b10111111010101101101101000010111"; ram[1131] = "0b10111111010110010001001011001100"; ram[1132] = "0b10111111010110110011110011111100"; ram[1133] = "0b10111111010111010101100010000011"; ram[1134] = "0b10111111010111110110010100111110"; ram[1135] = "0b10111111011000010110001100001000"; ram[1136] = "0b10111111011000110101000110111111"; ram[1137] = "0b10111111011001010011000101000100"; ram[1138] = "0b10111111011001110000000101110100"; ram[1139] = "0b10111111011010001100001000110011"; ram[1140] = "0b10111111011010100111001101100000"; ram[1141] = "0b10111111011011000001010011100000"; ram[1142] = "0b10111111011011011010011010010111"; ram[1143] = "0b10111111011011110010100001101010"; ram[1144] = "0b10111111011100001001101000111110"; ram[1145] = "0b10111111011100011111101111111100"; ram[1146] = "0b10111111011100110100110110001011"; ram[1147] = "0b10111111011101001000111011010101"; ram[1148] = "0b10111111011101011011111111000101"; ram[1149] = "0b10111111011101101110000001000110"; ram[1150] = "0b10111111011101111111000001000100"; ram[1151] = "0b10111111011110001110111110101110"; ram[1152] = "0b10111111011110011101111001110011"; ram[1153] = "0b10111111011110101011110010000010"; ram[1154] = "0b10111111011110111000100111001101"; ram[1155] = "0b10111111011111000100011001000110"; ram[1156] = "0b10111111011111001111000111100000"; ram[1157] = "0b10111111011111011000110010010000"; ram[1158] = "0b10111111011111100001011001001100"; ram[1159] = "0b10111111011111101000111100001010"; ram[1160] = "0b10111111011111101111011011000010"; ram[1161] = "0b10111111011111110100110101101110"; ram[1162] = "0b10111111011111111001001100000111"; ram[1163] = "0b10111111011111111100011110001010"; ram[1164] = "0b10111111011111111110101011110001"; ram[1165] = "0b10111111011111111111110100111100"; ram[1166] = "0b10111111011111111111111001101000"; ram[1167] = "0b10111111011111111110111001110110"; ram[1168] = "0b10111111011111111100110101100111"; ram[1169] = "0b10111111011111111001101100111101"; ram[1170] = "0b10111111011111110101011111111011"; ram[1171] = "0b10111111011111110000001110100110"; ram[1172] = "0b10111111011111101001111001000100"; ram[1173] = "0b10111111011111100010011111011010"; ram[1174] = "0b10111111011111011010000001110010"; ram[1175] = "0b10111111011111010000100000010100"; ram[1176] = "0b10111111011111000101111011001011"; ram[1177] = "0b10111111011110111010010010100001"; ram[1178] = "0b10111111011110101101100110100100"; ram[1179] = "0b10111111011110011111110111100000"; ram[1180] = "0b10111111011110010001000101100101"; ram[1181] = "0b10111111011110000001010001000010"; ram[1182] = "0b10111111011101110000011010001000"; ram[1183] = "0b10111111011101011110100001001010"; ram[1184] = "0b10111111011101001011100110011001"; ram[1185] = "0b10111111011100110111101010001100"; ram[1186] = "0b10111111011100100010101100110110"; ram[1187] = "0b10111111011100001100101110101111"; ram[1188] = "0b10111111011011110101110000001110"; ram[1189] = "0b10111111011011011101110001101011"; ram[1190] = "0b10111111011011000100110011100000"; ram[1191] = "0b10111111011010101010110110001000"; ram[1192] = "0b10111111011010001111111001111111"; ram[1193] = "0b10111111011001110011111111100001"; ram[1194] = "0b10111111011001010111000111001101"; ram[1195] = "0b10111111011000111001010001100000"; ram[1196] = "0b10111111011000011010011110111100"; ram[1197] = "0b10111111010111111010110000000001"; ram[1198] = "0b10111111010111011010000101010001"; ram[1199] = "0b10111111010110111000011111001111"; ram[1200] = "0b10111111010110010101111110011111"; ram[1201] = "0b10111111010101110010100011100101"; ram[1202] = "0b10111111010101001110001111001001"; ram[1203] = "0b10111111010100101001000001110000"; ram[1204] = "0b10111111010100000010111100000010"; ram[1205] = "0b10111111010011011011111110101001"; ram[1206] = "0b10111111010010110100001010001101"; ram[1207] = "0b10111111010010001011011111011010"; ram[1208] = "0b10111111010001100001111110111011"; ram[1209] = "0b10111111010000110111101001011100"; ram[1210] = "0b10111111010000001100011111101011"; ram[1211] = "0b10111111001111100000100010010101"; ram[1212] = "0b10111111001110110011110010001011"; ram[1213] = "0b10111111001110000110001111111011"; ram[1214] = "0b10111111001101010111111100010111"; ram[1215] = "0b10111111001100101000111000010000"; ram[1216] = "0b10111111001011111001000100011000"; ram[1217] = "0b10111111001011001000100001100010"; ram[1218] = "0b10111111001010010111010000100011"; ram[1219] = "0b10111111001001100101010010010000"; ram[1220] = "0b10111111001000110010100111011101"; ram[1221] = "0b10111111000111111111010001000000"; ram[1222] = "0b10111111000111001011001111110010"; ram[1223] = "0b10111111000110010110100100101001"; ram[1224] = "0b10111111000101100001010000011110"; ram[1225] = "0b10111111000100101011010100001001"; ram[1226] = "0b10111111000011110100110000100110"; ram[1227] = "0b10111111000010111101100110101101"; ram[1228] = "0b10111111000010000101110111011010"; ram[1229] = "0b10111111000001001101100011101000"; ram[1230] = "0b10111111000000010100101100010101"; ram[1231] = "0b10111110111110110110100100111000"; ram[1232] = "0b10111110111101000010101101110111"; ram[1233] = "0b10111110111011001101110101100001"; ram[1234] = "0b10111110111001010111111101110101"; ram[1235] = "0b10111110110111100001001000110000"; ram[1236] = "0b10111110110101101001011000010010"; ram[1237] = "0b10111110110011110000101110011010"; ram[1238] = "0b10111110110001110111001101001001"; ram[1239] = "0b10111110101111111100110110100011"; ram[1240] = "0b10111110101110000001101100101001"; ram[1241] = "0b10111110101100000101110001011111"; ram[1242] = "0b10111110101010001001000111001010"; ram[1243] = "0b10111110101000001011101111101111"; ram[1244] = "0b10111110100110001101101101010101"; ram[1245] = "0b10111110100100001111000010000011"; ram[1246] = "0b10111110100010001111101111111111"; ram[1247] = "0b10111110100000001111111001010010"; ram[1248] = "0b10111110011100011111000000001001"; ram[1249] = "0b10111110011000011101001101000001"; ram[1250] = "0b10111110010100011010011101011111"; ram[1251] = "0b10111110010000010110110101111000"; ram[1252] = "0b10111110001100010010011010100010"; ram[1253] = "0b10111110001000001101001111110011"; ram[1254] = "0b10111110000100000111011010000100"; ram[1255] = "0b10111110000000000000111101101011"; ram[1256] = "0b10111101110111110011111110000011"; ram[1257] = "0b10111101101111100101000101000011"; ram[1258] = "0b10111101100111010101011001001001"; ram[1259] = "0b10111101011110001010000110010100"; ram[1260] = "0b10111101001101101000010111110101"; ram[1261] = "0b10111100111010001011110001000100"; ram[1262] = "0b10111100010010001011101000011001"; for (unsigned i = 1263; i < 1312 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[1312] = "0b00111100100011000100011111111001"; ram[1313] = "0b00111101000011000100001010110101"; ram[1314] = "0b00111101010100100101011011100110"; ram[1315] = "0b00111101100011000010110110100110"; ram[1316] = "0b00111101101011110010010101010011"; ram[1317] = "0b00111101110100100000111111011010"; ram[1318] = "0b00111101111101001110101010011100"; ram[1319] = "0b00111110000010111101100101111101"; ram[1320] = "0b00111110000111010011001100101101"; ram[1321] = "0b00111110001011101000000100001111"; ram[1322] = "0b00111110001111111100000111011000"; ram[1323] = "0b00111110010100001111010000111011"; ram[1324] = "0b00111110011000100001011011101110"; ram[1325] = "0b00111110011100110010100010101000"; ram[1326] = "0b00111110100000100001010000010001"; ram[1327] = "0b00111110100010101000101000001001"; ram[1328] = "0b00111110100100101111010110011011"; ram[1329] = "0b00111110100110110101011000100100"; ram[1330] = "0b00111110101000111010101100000100"; ram[1331] = "0b00111110101010111111001110011011"; ram[1332] = "0b00111110101101000010111101001001"; ram[1333] = "0b00111110101111000101110101101111"; ram[1334] = "0b00111110110001000111110101110010"; ram[1335] = "0b00111110110011001000111010110100"; ram[1336] = "0b00111110110101001001000010011011"; ram[1337] = "0b00111110110111001000001010001101"; ram[1338] = "0b00111110111001000110001111110001"; ram[1339] = "0b00111110111011000011010000101111"; ram[1340] = "0b00111110111100111111001010110001"; ram[1341] = "0b00111110111110111001111011100011"; ram[1342] = "0b00111111000000011001110000011001"; ram[1343] = "0b00111111000001010101111100000101"; ram[1344] = "0b00111111000010010001011111101110"; ram[1345] = "0b00111111000011001100011010001100"; ram[1346] = "0b00111111000100000110101010011001"; ram[1347] = "0b00111111000101000000001111001110"; ram[1348] = "0b00111111000101111001000111100110"; ram[1349] = "0b00111111000110110001010010011101"; ram[1350] = "0b00111111000111101000101110110000"; ram[1351] = "0b00111111001000011111011011011100"; ram[1352] = "0b00111111001001010101010111011111"; ram[1353] = "0b00111111001010001010100001111000"; ram[1354] = "0b00111111001010111110111001101000"; ram[1355] = "0b00111111001011110010011101110000"; ram[1356] = "0b00111111001100100101001101010001"; ram[1357] = "0b00111111001101010111000111001111"; ram[1358] = "0b00111111001110001000001010101110"; ram[1359] = "0b00111111001110111000010110110011"; ram[1360] = "0b00111111001111100111101010100011"; ram[1361] = "0b00111111010000010110000101000111"; ram[1362] = "0b00111111010001000011100101100111"; ram[1363] = "0b00111111010001110000001011001011"; ram[1364] = "0b00111111010010011011110100111110"; ram[1365] = "0b00111111010011000110100010001100"; ram[1366] = "0b00111111010011110000010010000010"; ram[1367] = "0b00111111010100011001000011101101"; ram[1368] = "0b00111111010101000000110110011100"; ram[1369] = "0b00111111010101100111101001100000"; ram[1370] = "0b00111111010110001101011100001010"; ram[1371] = "0b00111111010110110010001101101100"; ram[1372] = "0b00111111010111010101111101011011"; ram[1373] = "0b00111111010111111000101010101011"; ram[1374] = "0b00111111011000011010010100110011"; ram[1375] = "0b00111111011000111010111011001011"; ram[1376] = "0b00111111011001011010011101001010"; ram[1377] = "0b00111111011001111000111010001100"; ram[1378] = "0b00111111011010010110010001101011"; ram[1379] = "0b00111111011010110010100011000101"; ram[1380] = "0b00111111011011001101101101110111"; ram[1381] = "0b00111111011011100111110001100010"; ram[1382] = "0b00111111011100000000101101100100"; ram[1383] = "0b00111111011100011000100001100010"; ram[1384] = "0b00111111011100101111001100111101"; ram[1385] = "0b00111111011101000100101111011011"; ram[1386] = "0b00111111011101011001001000100010"; ram[1387] = "0b00111111011101101100010111111001"; ram[1388] = "0b00111111011101111110011101001010"; ram[1389] = "0b00111111011110001111010111111110"; ram[1390] = "0b00111111011110011111001000000010"; ram[1391] = "0b00111111011110101101101101000001"; ram[1392] = "0b00111111011110111011000110101100"; ram[1393] = "0b00111111011111000111010100110001"; ram[1394] = "0b00111111011111010010010111000010"; ram[1395] = "0b00111111011111011100001101010010"; ram[1396] = "0b00111111011111100100110111010101"; ram[1397] = "0b00111111011111101100010101000000"; ram[1398] = "0b00111111011111110010100110001011"; ram[1399] = "0b00111111011111110111101010101110"; ram[1400] = "0b00111111011111111011100010100011"; ram[1401] = "0b00111111011111111110001101100101"; ram[1402] = "0b00111111011111111111101011110010"; ram[1403] = "0b00111111011111111111111101000110"; ram[1404] = "0b00111111011111111111000001100011"; ram[1405] = "0b00111111011111111100111001001001"; ram[1406] = "0b00111111011111111001100011111010"; ram[1407] = "0b00111111011111110101000001111011"; ram[1408] = "0b00111111011111101111010011010010"; ram[1409] = "0b00111111011111101000011000000100"; ram[1410] = "0b00111111011111100000010000011010"; ram[1411] = "0b00111111011111010110111100011111"; ram[1412] = "0b00111111011111001100011100011101"; ram[1413] = "0b00111111011111000000110000100001"; ram[1414] = "0b00111111011110110011111000111000"; ram[1415] = "0b00111111011110100101110101110011"; ram[1416] = "0b00111111011110010110100111100010"; ram[1417] = "0b00111111011110000110001110011000"; ram[1418] = "0b00111111011101110100101010101000"; ram[1419] = "0b00111111011101100001111100101000"; ram[1420] = "0b00111111011101001110000100101101"; ram[1421] = "0b00111111011100111001000011001111"; ram[1422] = "0b00111111011100100010111000101001"; ram[1423] = "0b00111111011100001011100101010100"; ram[1424] = "0b00111111011011110011001001101101"; ram[1425] = "0b00111111011011011001100110010000"; ram[1426] = "0b00111111011010111110111011011110"; ram[1427] = "0b00111111011010100011001001110100"; ram[1428] = "0b00111111011010000110010001110110"; ram[1429] = "0b00111111011001101000010100000110"; ram[1430] = "0b00111111011001001001010001000111"; ram[1431] = "0b00111111011000101001001001011111"; ram[1432] = "0b00111111011000000111111101110100"; ram[1433] = "0b00111111010111100101101110101111"; ram[1434] = "0b00111111010111000010011100111000"; ram[1435] = "0b00111111010110011110001000111011"; ram[1436] = "0b00111111010101111000110011100001"; ram[1437] = "0b00111111010101010010011101011010"; ram[1438] = "0b00111111010100101011000111010001"; ram[1439] = "0b00111111010100000010110001110111"; ram[1440] = "0b00111111010011011001011101111100"; ram[1441] = "0b00111111010010101111001100010010"; ram[1442] = "0b00111111010010000011111101101100"; ram[1443] = "0b00111111010001010111110010111101"; ram[1444] = "0b00111111010000101010101100111010"; ram[1445] = "0b00111111001111111100101100011011"; ram[1446] = "0b00111111001111001101110010010101"; ram[1447] = "0b00111111001110011101111111100001"; ram[1448] = "0b00111111001101101101010100111001"; ram[1449] = "0b00111111001100111011110011010111"; ram[1450] = "0b00111111001100001001011011110111"; ram[1451] = "0b00111111001011010110001111010101"; ram[1452] = "0b00111111001010100010001110101110"; ram[1453] = "0b00111111001001101101011011000010"; ram[1454] = "0b00111111001000110111110101001111"; ram[1455] = "0b00111111001000000001011110010110"; ram[1456] = "0b00111111000111001010010111011000"; ram[1457] = "0b00111111000110010010100001011000"; ram[1458] = "0b00111111000101011001111101011000"; ram[1459] = "0b00111111000100100000101100011100"; ram[1460] = "0b00111111000011100110101111101010"; ram[1461] = "0b00111111000010101100001000000111"; ram[1462] = "0b00111111000001110000110110111000"; ram[1463] = "0b00111111000000110100111101000110"; ram[1464] = "0b00111110111111110000110111110010"; ram[1465] = "0b00111110111101110110101000110001"; ram[1466] = "0b00111110111011111011001111011101"; ram[1467] = "0b00111110111001111110101110001010"; ram[1468] = "0b00111110111000000001000111001110"; ram[1469] = "0b00111110110110000010011100111111"; ram[1470] = "0b00111110110100000010110001110110"; ram[1471] = "0b00111110110010000010001000001101"; ram[1472] = "0b00111110110000000000100010011101"; ram[1473] = "0b00111110101101111110000011000010"; ram[1474] = "0b00111110101011111010101100011001"; ram[1475] = "0b00111110101001110110100001000001"; ram[1476] = "0b00111110100111110001100011010110"; ram[1477] = "0b00111110100101101011110101111010"; ram[1478] = "0b00111110100011100101011011001101"; ram[1479] = "0b00111110100001011110010101110001"; ram[1480] = "0b00111110011110101101010000001110"; ram[1481] = "0b00111110011010011100101001100101"; ram[1482] = "0b00111110010110001010111100110000"; ram[1483] = "0b00111110010001111000001110110101"; ram[1484] = "0b00111110001101100100100101000001"; ram[1485] = "0b00111110001001010000000100011101"; ram[1486] = "0b00111110000100111010110010010101"; ram[1487] = "0b00111110000000100100110011111000"; ram[1488] = "0b00111101111000011100011100100101"; ram[1489] = "0b00111101101111101110001101100110"; ram[1490] = "0b00111101100110111111000101010011"; ram[1491] = "0b00111101011100011110011100010101"; ram[1492] = "0b00111101001010111101100101011100"; ram[1493] = "0b00111100110010110111110101110110"; ram[1494] = "0b00111011111111001110001110111010"; ram[1495] = "0b10111100000110100010000010110000"; ram[1496] = "0b10111100110110010101001111010110"; ram[1497] = "0b10111101001100101100001110000001"; ram[1498] = "0b10111101011110001100111110101100"; ram[1499] = "0b10111101100111110110010010010100"; ram[1500] = "0b10111101110000100101010101011100"; ram[1501] = "0b10111101111001010011011110001100"; ram[1502] = "0b10111110000001000000010001000011"; ram[1503] = "0b10111110000101010110001011010111"; ram[1504] = "0b10111110001001101011011000110101"; ram[1505] = "0b10111110001101111111110100001110"; ram[1506] = "0b10111110010010010011011000010111"; ram[1507] = "0b10111110010110100110000000000101"; ram[1508] = "0b10111110011010110111100110001110"; ram[1509] = "0b10111110011111001000000101101001"; ram[1510] = "0b10111110100001101011101100101000"; ram[1511] = "0b10111110100011110010101101111110"; ram[1512] = "0b10111110100101111001000100010100"; ram[1513] = "0b10111110100111111110101101001001"; ram[1514] = "0b10111110101010000011100101111101"; ram[1515] = "0b10111110101100000111101100010000"; ram[1516] = "0b10111110101110001010111101100011"; ram[1517] = "0b10111110110000001101010111011000"; ram[1518] = "0b10111110110010001110110111010100"; ram[1519] = "0b10111110110100001111011010111010"; ram[1520] = "0b10111110110110001110111111101111"; ram[1521] = "0b10111110111000001101100011011100"; ram[1522] = "0b10111110111010001011000011100111"; ram[1523] = "0b10111110111100000111011101111010"; ram[1524] = "0b10111110111110000010101111111111"; ram[1525] = "0b10111110111111111100110111100011"; ram[1526] = "0b10111111000000111010111001001001"; ram[1527] = "0b10111111000001110110101110111110"; ram[1528] = "0b10111111000010110001111100001001"; ram[1529] = "0b10111111000011101100011111100001"; ram[1530] = "0b10111111000100100110011000000010"; ram[1531] = "0b10111111000101011111100100100100"; ram[1532] = "0b10111111000110011000000100000101"; ram[1533] = "0b10111111000111001111110101011111"; ram[1534] = "0b10111111001000000110110111110000"; ram[1535] = "0b10111111001000111101001001110110"; ram[1536] = "0b10111111001001110010101010101111"; ram[1537] = "0b10111111001010100111011001011100"; ram[1538] = "0b10111111001011011011010100111100"; ram[1539] = "0b10111111001100001110011100010010"; ram[1540] = "0b10111111001101000000101110100001"; ram[1541] = "0b10111111001101110010001010101010"; ram[1542] = "0b10111111001110100010101111110100"; ram[1543] = "0b10111111001111010010011101000100"; ram[1544] = "0b10111111010000000001010001100001"; ram[1545] = "0b10111111010000101111001100010010"; ram[1546] = "0b10111111010001011100001100100001"; ram[1547] = "0b10111111010010001000010001010110"; ram[1548] = "0b10111111010010110011011001111110"; ram[1549] = "0b10111111010011011101100101100101"; ram[1550] = "0b10111111010100000110110011010111"; ram[1551] = "0b10111111010100101111000010100011"; ram[1552] = "0b10111111010101010110010010011010"; ram[1553] = "0b10111111010101111100100010001011"; ram[1554] = "0b10111111010110100001110001001001"; ram[1555] = "0b10111111010111000101111110100111"; ram[1556] = "0b10111111010111101001001001111010"; ram[1557] = "0b10111111011000001011010010010111"; ram[1558] = "0b10111111011000101100010111010110"; ram[1559] = "0b10111111011001001100011000001110"; ram[1560] = "0b10111111011001101011010100011001"; ram[1561] = "0b10111111011010001001001011010011"; ram[1562] = "0b10111111011010100101111100010111"; ram[1563] = "0b10111111011011000001100111000010"; ram[1564] = "0b10111111011011011100001010110100"; ram[1565] = "0b10111111011011110101100111001100"; ram[1566] = "0b10111111011100001101111011101100"; ram[1567] = "0b10111111011100100101000111110111"; ram[1568] = "0b10111111011100111011001011010000"; ram[1569] = "0b10111111011101010000000101011110"; ram[1570] = "0b10111111011101100011110110000111"; ram[1571] = "0b10111111011101110110011100110100"; ram[1572] = "0b10111111011110000111111001001110"; ram[1573] = "0b10111111011110011000001011000000"; ram[1574] = "0b10111111011110100111010001110111"; ram[1575] = "0b10111111011110110101001101100000"; ram[1576] = "0b10111111011111000001111101101011"; ram[1577] = "0b10111111011111001101100010001001"; ram[1578] = "0b10111111011111010111111010101011"; ram[1579] = "0b10111111011111100001000111000101"; ram[1580] = "0b10111111011111101001000111001100"; ram[1581] = "0b10111111011111101111111010110111"; ram[1582] = "0b10111111011111110101100001111101"; ram[1583] = "0b10111111011111111001111100010111"; ram[1584] = "0b10111111011111111101001010000001"; ram[1585] = "0b10111111011111111111001010110110"; ram[1586] = "0b10111111011111111111111110110100"; ram[1587] = "0b10111111011111111111100101111010"; ram[1588] = "0b10111111011111111110000000001000"; ram[1589] = "0b10111111011111111011001101100001"; ram[1590] = "0b10111111011111110111001110000111"; ram[1591] = "0b10111111011111110010000010000000"; ram[1592] = "0b10111111011111101011101001010001"; ram[1593] = "0b10111111011111100100000100000011"; ram[1594] = "0b10111111011111011011010010011111"; ram[1595] = "0b10111111011111010001010100101110"; ram[1596] = "0b10111111011111000110001010111110"; ram[1597] = "0b10111111011110111001110101011011"; ram[1598] = "0b10111111011110101100010100010100"; ram[1599] = "0b10111111011110011101100111111001"; ram[1600] = "0b10111111011110001101110000011101"; ram[1601] = "0b10111111011101111100101110010010"; ram[1602] = "0b10111111011101101010100001101100"; ram[1603] = "0b10111111011101010111001011000010"; ram[1604] = "0b10111111011101000010101010101011"; ram[1605] = "0b10111111011100101101000000111111"; ram[1606] = "0b10111111011100010110001110011000"; ram[1607] = "0b10111111011011111110010011010010"; ram[1608] = "0b10111111011011100101010000001010"; ram[1609] = "0b10111111011011001011000101011101"; ram[1610] = "0b10111111011010101111110011101100"; ram[1611] = "0b10111111011010010011011011010110"; ram[1612] = "0b10111111011001110101111100111101"; ram[1613] = "0b10111111011001010111011001000110"; ram[1614] = "0b10111111011000110111110000010110"; ram[1615] = "0b10111111011000010111000011010001"; ram[1616] = "0b10111111010111110101010010011111"; ram[1617] = "0b10111111010111010010011110101001"; ram[1618] = "0b10111111010110101110101000011001"; ram[1619] = "0b10111111010110001001110000011001"; ram[1620] = "0b10111111010101100011110111010111"; ram[1621] = "0b10111111010100111100111101111111"; ram[1622] = "0b10111111010100010101000101000000"; ram[1623] = "0b10111111010011101100001101001010"; ram[1624] = "0b10111111010011000010010111001111"; ram[1625] = "0b10111111010010010111100100000000"; ram[1626] = "0b10111111010001101011110100010000"; ram[1627] = "0b10111111010000111111001000110110"; ram[1628] = "0b10111111010000010001100010100101"; ram[1629] = "0b10111111001111100011000010010110"; ram[1630] = "0b10111111001110110011101000111111"; ram[1631] = "0b10111111001110000011010111011001"; ram[1632] = "0b10111111001101010010001110100000"; ram[1633] = "0b10111111001100100000001111001101"; ram[1634] = "0b10111111001011101101011010011101"; ram[1635] = "0b10111111001010111001110001001100"; ram[1636] = "0b10111111001010000101010100011010"; ram[1637] = "0b10111111001001010000000101000100"; ram[1638] = "0b10111111001000011010000100001011"; ram[1639] = "0b10111111000111100011010010110000"; ram[1640] = "0b10111111000110101011110001110100"; ram[1641] = "0b10111111000101110011100010011010"; ram[1642] = "0b10111111000100111010100101100110"; ram[1643] = "0b10111111000100000000111100011100"; ram[1644] = "0b10111111000011000110101000000010"; ram[1645] = "0b10111111000010001011101001011100"; ram[1646] = "0b10111111000001010000000001110011"; ram[1647] = "0b10111111000000010011110010001110"; ram[1648] = "0b10111110111110101101110111101010"; ram[1649] = "0b10111110111100110010111111100011"; ram[1650] = "0b10111110111010110110111110011010"; ram[1651] = "0b10111110111000111001110110100100"; ram[1652] = "0b10111110110110111011101010010111"; ram[1653] = "0b10111110110100111100011100001100"; ram[1654] = "0b10111110110010111100001110011010"; ram[1655] = "0b10111110110000111011000011011100"; ram[1656] = "0b10111110101110111000111101101110"; ram[1657] = "0b10111110101100110101111111101010"; ram[1658] = "0b10111110101010110010001011101111"; ram[1659] = "0b10111110101000101101100100011011"; ram[1660] = "0b10111110100110101000001100001110"; ram[1661] = "0b10111110100100100010000101100110"; ram[1662] = "0b10111110100010011011010011000110"; ram[1663] = "0b10111110100000010011110111010000"; ram[1664] = "0b10111110011100010111101001001100"; ram[1665] = "0b10111110011000000110011011010110"; ram[1666] = "0b10111110010011110100001010001000"; ram[1667] = "0b10111110001111100000111010101010"; ram[1668] = "0b10111110001011001100110010001000"; ram[1669] = "0b10111110000110110111110101101101"; ram[1670] = "0b10111110000010100010001010100101"; ram[1671] = "0b10111101111100010111101011111110"; ram[1672] = "0b10111101110011101001111010010000"; ram[1673] = "0b10111101101010111011001010011111"; ram[1674] = "0b10111101100010001011100111001010"; ram[1675] = "0b10111101010010110110110101100011"; ram[1676] = "0b10111101000001010101011111101101"; ram[1677] = "0b10111100011111001110000111001101"; for (unsigned i = 1678; i < 1749 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[1749] = "0b00111100100101001001101001011001"; ram[1750] = "0b00111101000101001001010000010111"; ram[1751] = "0b00111101010111101100111001111100"; ram[1752] = "0b00111101100101000111101100001110"; ram[1753] = "0b00111101101110011000001001011100"; ram[1754] = "0b00111101110111100111101000001001"; ram[1755] = "0b00111110000000011010111101111100"; ram[1756] = "0b00111110000101000001011100000111"; ram[1757] = "0b00111110001001100111001000010111"; ram[1758] = "0b00111110001110001011111100100010"; ram[1759] = "0b00111110010010101111110010011101"; ram[1760] = "0b00111110010111010010100011111101"; ram[1761] = "0b00111110011011110100001010111100"; ram[1762] = "0b00111110100000001010010000101001"; ram[1763] = "0b00111110100010011001110000011110"; ram[1764] = "0b00111110100100101000100001111011"; ram[1765] = "0b00111110100110110110100010000000"; ram[1766] = "0b00111110101001000011101101101101"; ram[1767] = "0b00111110101011010000000010000101"; ram[1768] = "0b00111110101101011011011100001001"; ram[1769] = "0b00111110101111100101111000111101"; ram[1770] = "0b00111110110001101111010101101001"; ram[1771] = "0b00111110110011110111101111010001"; ram[1772] = "0b00111110110101111111000010111111"; ram[1773] = "0b00111110111000000101001101111011"; ram[1774] = "0b00111110111010001010001101010001"; ram[1775] = "0b00111110111100001101111110001110"; ram[1776] = "0b00111110111110010000011110000000"; ram[1777] = "0b00111111000000001000110100111100"; ram[1778] = "0b00111111000001001000101111100011"; ram[1779] = "0b00111111000010000111111101011111"; ram[1780] = "0b00111111000011000110011101011100"; ram[1781] = "0b00111111000100000100001110000100"; ram[1782] = "0b00111111000101000001001110000110"; ram[1783] = "0b00111111000101111101011100001101"; ram[1784] = "0b00111111000110111000110111001010"; ram[1785] = "0b00111111000111110011011101101100"; ram[1786] = "0b00111111001000101101001110100101"; ram[1787] = "0b00111111001001100110001000100101"; ram[1788] = "0b00111111001010011110001010100001"; ram[1789] = "0b00111111001011010101010011001101"; ram[1790] = "0b00111111001100001011100001011111"; ram[1791] = "0b00111111001101000000110100001110"; ram[1792] = "0b00111111001101110101001010010010"; ram[1793] = "0b00111111001110101000100010100011"; ram[1794] = "0b00111111001111011010111011111110"; ram[1795] = "0b00111111010000001100010101011110"; ram[1796] = "0b00111111010000111100101110000000"; ram[1797] = "0b00111111010001101100000100100100"; ram[1798] = "0b00111111010010011010011000001001"; ram[1799] = "0b00111111010011000111100111110001"; ram[1800] = "0b00111111010011110011110010100000"; ram[1801] = "0b00111111010100011110110111011000"; ram[1802] = "0b00111111010101001000110101100001"; ram[1803] = "0b00111111010101110001101100000011"; ram[1804] = "0b00111111010110011001011010000100"; ram[1805] = "0b00111111010110111111111110110010"; ram[1806] = "0b00111111010111100101011001010110"; ram[1807] = "0b00111111011000001001101000111111"; ram[1808] = "0b00111111011000101100101100111100"; ram[1809] = "0b00111111011001001110100100011110"; ram[1810] = "0b00111111011001101111001110110111"; ram[1811] = "0b00111111011010001110101011011100"; ram[1812] = "0b00111111011010101100111001100000"; ram[1813] = "0b00111111011011001001111000011101"; ram[1814] = "0b00111111011011100101100111101011"; ram[1815] = "0b00111111011100000000000110100100"; ram[1816] = "0b00111111011100011001010100100100"; ram[1817] = "0b00111111011100110001010001001011"; ram[1818] = "0b00111111011101000111111011110111"; ram[1819] = "0b00111111011101011101010100001010"; ram[1820] = "0b00111111011101110001011001100111"; ram[1821] = "0b00111111011110000100001011110011"; ram[1822] = "0b00111111011110010101101010010101"; ram[1823] = "0b00111111011110100101110100110101"; ram[1824] = "0b00111111011110110100101010111110"; ram[1825] = "0b00111111011111000010001100011011"; ram[1826] = "0b00111111011111001110011000111010"; ram[1827] = "0b00111111011111011001010000001011"; ram[1828] = "0b00111111011111100010110001111110"; ram[1829] = "0b00111111011111101010111110001000"; ram[1830] = "0b00111111011111110001110100011110"; ram[1831] = "0b00111111011111110111010100110101"; ram[1832] = "0b00111111011111111011011111000111"; ram[1833] = "0b00111111011111111110010011001101"; ram[1834] = "0b00111111011111111111110001000101"; ram[1835] = "0b00111111011111111111111000101100"; ram[1836] = "0b00111111011111111110101010000010"; ram[1837] = "0b00111111011111111100000101001000"; ram[1838] = "0b00111111011111111000001010000011"; ram[1839] = "0b00111111011111110010111000110111"; ram[1840] = "0b00111111011111101100010001101100"; ram[1841] = "0b00111111011111100100010100101010"; ram[1842] = "0b00111111011111011011000001111100"; ram[1843] = "0b00111111011111010000011001101111"; ram[1844] = "0b00111111011111000100011100010001"; ram[1845] = "0b00111111011110110111001001110001"; ram[1846] = "0b00111111011110101000100010100011"; ram[1847] = "0b00111111011110011000100110111010"; ram[1848] = "0b00111111011110000111010111001011"; ram[1849] = "0b00111111011101110100110011101101"; ram[1850] = "0b00111111011101100000111100111010"; ram[1851] = "0b00111111011101001011110011001100"; ram[1852] = "0b00111111011100110101010111000000"; ram[1853] = "0b00111111011100011101101000110100"; ram[1854] = "0b00111111011100000100101001001000"; ram[1855] = "0b00111111011011101010011000011101"; ram[1856] = "0b00111111011011001110110111011000"; ram[1857] = "0b00111111011010110010000110011100"; ram[1858] = "0b00111111011010010100000110010010"; ram[1859] = "0b00111111011001110100110111100001"; ram[1860] = "0b00111111011001010100011010110011"; ram[1861] = "0b00111111011000110010110000110100"; ram[1862] = "0b00111111011000001111111010010010"; ram[1863] = "0b00111111010111101011110111111100"; ram[1864] = "0b00111111010111000110101010100010"; ram[1865] = "0b00111111010110100000010010110110"; ram[1866] = "0b00111111010101111000110001101100"; ram[1867] = "0b00111111010101010000000111111001"; ram[1868] = "0b00111111010100100110010110010100"; ram[1869] = "0b00111111010011111011011101110110"; ram[1870] = "0b00111111010011001111011111011000"; ram[1871] = "0b00111111010010100010011011110101"; ram[1872] = "0b00111111010001110100010100001010"; ram[1873] = "0b00111111010001000101001001010110"; ram[1874] = "0b00111111010000010100111100011000"; ram[1875] = "0b00111111001111100011101110010001"; ram[1876] = "0b00111111001110110001100000000010"; ram[1877] = "0b00111111001101111110010010110001"; ram[1878] = "0b00111111001101001010000111100010"; ram[1879] = "0b00111111001100010100111111011011"; ram[1880] = "0b00111111001011011110111011100100"; ram[1881] = "0b00111111001010100111111101000110"; ram[1882] = "0b00111111001001110000000101001010"; ram[1883] = "0b00111111001000110111010100111101"; ram[1884] = "0b00111111000111111101101101101011"; ram[1885] = "0b00111111000111000011010000100001"; ram[1886] = "0b00111111000110000111111110101110"; ram[1887] = "0b00111111000101001011111001100010"; ram[1888] = "0b00111111000100001111000010001110"; ram[1889] = "0b00111111000011010001011010000100"; ram[1890] = "0b00111111000010010011000010010111"; ram[1891] = "0b00111111000001010011111100011100"; ram[1892] = "0b00111111000000010100001001100111"; ram[1893] = "0b00111110111110100111010110011100"; ram[1894] = "0b00111110111100100101000101010000"; ram[1895] = "0b00111110111010100001100010011011"; ram[1896] = "0b00111110111000011100110000101101"; ram[1897] = "0b00111110110110010110110010111000"; ram[1898] = "0b00111110110100001111101011110011"; ram[1899] = "0b00111110110010000111011110010011"; ram[1900] = "0b00111110101111111110001101001111"; ram[1901] = "0b00111110101101110011111011100001"; ram[1902] = "0b00111110101011101000101100000010"; ram[1903] = "0b00111110101001011100100001101111"; ram[1904] = "0b00111110100111001111011111100101"; ram[1905] = "0b00111110100101000001101000100010"; ram[1906] = "0b00111110100010110010111111100100"; ram[1907] = "0b00111110100000100011100111101101"; ram[1908] = "0b00111110011100100111000111111001"; ram[1909] = "0b00111110011000000101101110101100"; ram[1910] = "0b00111110010011100011001001111000"; ram[1911] = "0b00111110001110111111011111100101"; ram[1912] = "0b00111110001010011010110101111100"; ram[1913] = "0b00111110000101110101010011001000"; ram[1914] = "0b00111110000001001110111101010100"; ram[1915] = "0b00111101111001001111110101011011"; ram[1916] = "0b00111101110000000000100011000010"; ram[1917] = "0b00111101100110110000001111111100"; ram[1918] = "0b00111101011010111110010001001101"; ram[1919] = "0b00111101001000011010110011000010"; ram[1920] = "0b00111100101011101100111100110011"; ram[1921] = "0b00111011010100011011000100110000"; ram[1922] = "0b10111100011101001100101000111000"; ram[1923] = "0b10111101000001110111101100000111"; ram[1924] = "0b10111101010100011011100000010110"; ram[1925] = "0b10111101100011011111000110111101"; ram[1926] = "0b10111101101100101111101101111010"; ram[1927] = "0b10111101110101111111011000100011"; ram[1928] = "0b10111101111111001101111010011001"; ram[1929] = "0b10111110000100001101100011100001"; ram[1930] = "0b10111110001000110011011001000010"; ram[1931] = "0b10111110001101011000010111100011"; ram[1932] = "0b10111110010001111100011000111001"; ram[1933] = "0b10111110010110011111010110111010"; ram[1934] = "0b10111110011011000001001011011111"; ram[1935] = "0b10111110011111100001110000100000"; ram[1936] = "0b10111110100010000000011111111100"; ram[1937] = "0b10111110100100001111011001110011"; ram[1938] = "0b10111110100110011101100010110011"; ram[1939] = "0b10111110101000101010110111111101"; ram[1940] = "0b10111110101010110111010110010011"; ram[1941] = "0b10111110101101000010111010110111"; ram[1942] = "0b10111110101111001101100010101100"; ram[1943] = "0b10111110110001010111001010111001"; ram[1944] = "0b10111110110011011111110000100100"; ram[1945] = "0b10111110110101100111010000110100"; ram[1946] = "0b10111110110111101101101000110011"; ram[1947] = "0b10111110111001110010110101101011"; ram[1948] = "0b10111110111011110110110100101010"; ram[1949] = "0b10111110111101111001100010111101"; ram[1950] = "0b10111110111111111010111101110100"; ram[1951] = "0b10111111000000111101100001010001"; ram[1952] = "0b10111111000001111100110111001100"; ram[1953] = "0b10111111000010111011011111010110"; ram[1954] = "0b10111111000011111001011000011010"; ram[1955] = "0b10111111000100110110100001000110"; ram[1956] = "0b10111111000101110010111000000111"; ram[1957] = "0b10111111000110101110011100001011"; ram[1958] = "0b10111111000111101001001100000011"; ram[1959] = "0b10111111001000100011000110011111"; ram[1960] = "0b10111111001001011100001010010000"; ram[1961] = "0b10111111001010010100010110001011"; ram[1962] = "0b10111111001011001011101001000011"; ram[1963] = "0b10111111001100000010000001101101"; ram[1964] = "0b10111111001100110111011111000001"; ram[1965] = "0b10111111001101101011111111110111"; ram[1966] = "0b10111111001110011111100011000111"; ram[1967] = "0b10111111001111010010000111101100"; ram[1968] = "0b10111111010000000011101100100011"; ram[1969] = "0b10111111010000110100010000100111"; ram[1970] = "0b10111111010001100011110010111000"; ram[1971] = "0b10111111010010010010010010010110"; ram[1972] = "0b10111111010010111111101110000010"; ram[1973] = "0b10111111010011101100000100111110"; ram[1974] = "0b10111111010100010111010110001111"; ram[1975] = "0b10111111010101000001100000111011"; ram[1976] = "0b10111111010101101010100100001001"; ram[1977] = "0b10111111010110010010011111000001"; ram[1978] = "0b10111111010110111001010000101110"; ram[1979] = "0b10111111010111011110111000011011"; ram[1980] = "0b10111111011000000011010101010101"; ram[1981] = "0b10111111011000100110100110101100"; ram[1982] = "0b10111111011001001000101011110000"; ram[1983] = "0b10111111011001101001100011110011"; ram[1984] = "0b10111111011010001001001110001001"; ram[1985] = "0b10111111011010100111101010000111"; ram[1986] = "0b10111111011011000100110111000100"; ram[1987] = "0b10111111011011100000110100011000"; ram[1988] = "0b10111111011011111011100001011110"; ram[1989] = "0b10111111011100010100111101110011"; ram[1990] = "0b10111111011100101101001000110011"; ram[1991] = "0b10111111011101000100000001111110"; ram[1992] = "0b10111111011101011001101000110101"; ram[1993] = "0b10111111011101101101111100111011"; ram[1994] = "0b10111111011110000000111101110101"; ram[1995] = "0b10111111011110010010101011001001"; ram[1996] = "0b10111111011110100011000100011111"; ram[1997] = "0b10111111011110110010001001100010"; ram[1998] = "0b10111111011110111111111001111100"; ram[1999] = "0b10111111011111001100010101011011"; ram[2000] = "0b10111111011111010111011011101111"; ram[2001] = "0b10111111011111100001001100101001"; ram[2002] = "0b10111111011111101001100111111010"; ram[2003] = "0b10111111011111110000101101011001"; ram[2004] = "0b10111111011111110110011100111011"; ram[2005] = "0b10111111011111111010110110011001"; ram[2006] = "0b10111111011111111101111001101101"; ram[2007] = "0b10111111011111111111100110110010"; ram[2008] = "0b10111111011111111111111101100111"; ram[2009] = "0b10111111011111111110111110001011"; ram[2010] = "0b10111111011111111100101000011110"; ram[2011] = "0b10111111011111111000111100100110"; ram[2012] = "0b10111111011111110011111010100101"; ram[2013] = "0b10111111011111101101100010100100"; ram[2014] = "0b10111111011111100101110100101010"; ram[2015] = "0b10111111011111011100110001000011"; ram[2016] = "0b10111111011111010010010111111010"; ram[2017] = "0b10111111011111000110101001011101"; ram[2018] = "0b10111111011110111001100101111100"; ram[2019] = "0b10111111011110101011001101101001"; ram[2020] = "0b10111111011110011011100000111000"; ram[2021] = "0b10111111011110001010011111111100"; ram[2022] = "0b10111111011101111000001011001110"; ram[2023] = "0b10111111011101100100100011000101"; ram[2024] = "0b10111111011101001111100111111110"; ram[2025] = "0b10111111011100111001011010010010"; ram[2026] = "0b10111111011100100001111010100001"; ram[2027] = "0b10111111011100001001001001001011"; ram[2028] = "0b10111111011011101111000110110000"; ram[2029] = "0b10111111011011010011110011110011"; ram[2030] = "0b10111111011010110111010000111010"; ram[2031] = "0b10111111011010011001011110101011"; ram[2032] = "0b10111111011001111010011101101110"; ram[2033] = "0b10111111011001011010001110101101"; ram[2034] = "0b10111111011000111000110010010100"; ram[2035] = "0b10111111011000010110001001001111"; ram[2036] = "0b10111111010111110010010100001101"; ram[2037] = "0b10111111010111001101010011111110"; ram[2038] = "0b10111111010110100111001001010101"; ram[2039] = "0b10111111010101111111110101000100"; ram[2040] = "0b10111111010101010111011000000010"; ram[2041] = "0b10111111010100101101110011000011"; ram[2042] = "0b10111111010100000011000111000001"; ram[2043] = "0b10111111010011010111010100110101"; ram[2044] = "0b10111111010010101010011101011001"; ram[2045] = "0b10111111010001111100100001101011"; ram[2046] = "0b10111111010001001101100010101000"; ram[2047] = "0b10111111010000011101100001010000"; ram[2048] = "0b10111111001111101100011110100011"; ram[2049] = "0b10111111001110111010011011100100"; ram[2050] = "0b10111111001110000111011001010110"; ram[2051] = "0b10111111001101010011011000111101"; ram[2052] = "0b10111111001100011110011011100000"; ram[2053] = "0b10111111001011101000100010000110"; ram[2054] = "0b10111111001010110001101101111000"; ram[2055] = "0b10111111001001111010000000000000"; ram[2056] = "0b10111111001001000001011001101000"; ram[2057] = "0b10111111001000000111111011111110"; ram[2058] = "0b10111111000111001101101000001110"; ram[2059] = "0b10111111000110010010011111101000"; ram[2060] = "0b10111111000101010110100011011010"; ram[2061] = "0b10111111000100011001110100110110"; ram[2062] = "0b10111111000011011100010101001110"; ram[2063] = "0b10111111000010011110000101110011"; ram[2064] = "0b10111111000001011111000111111100"; ram[2065] = "0b10111111000000011111011100111011"; ram[2066] = "0b10111110111110111110001100010000"; ram[2067] = "0b10111110111100111100001001110000"; ram[2068] = "0b10111110111010111000110101000111"; ram[2069] = "0b10111110111000110100010001000111"; ram[2070] = "0b10111110110110101110100000100000"; ram[2071] = "0b10111110110100100111100110001001"; ram[2072] = "0b10111110110010011111100100110110"; ram[2073] = "0b10111110110000010110011111100000"; ram[2074] = "0b10111110101110001100011000111110"; ram[2075] = "0b10111110101100000001010100001011"; ram[2076] = "0b10111110101001110101010100000010"; ram[2077] = "0b10111110100111101000011011100001"; ram[2078] = "0b10111110100101011010101101100101"; ram[2079] = "0b10111110100011001100001101001100"; ram[2080] = "0b10111110100000111100111101011000"; ram[2081] = "0b10111110011101011010000010010011"; ram[2082] = "0b10111110011000111000110111000100"; ram[2083] = "0b10111110010100010110011111001001"; ram[2084] = "0b10111110001111110011000000101010"; ram[2085] = "0b10111110001011001110100001110000"; ram[2086] = "0b10111110000110101001001000100101"; ram[2087] = "0b10111110000010000010111011010011"; ram[2088] = "0b10111101111010111000000000010010"; ram[2089] = "0b10111101110001101000111010100111"; ram[2090] = "0b10111101101000011000110010000001"; ram[2091] = "0b10111101011110001111100101111111"; ram[2092] = "0b10111101001011101100010100000010"; ram[2093] = "0b10111100110010010000001110010111"; ram[2094] = "0b10111011110100011011000011101010"; for (unsigned i = 2095; i < 2186 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[2186] = "0b00111100100111010111000011001000"; ram[2187] = "0b00111101000111010110100101010110"; ram[2188] = "0b00111101011011000000101101100101"; ram[2189] = "0b00111101100111010100101110010001"; ram[2190] = "0b00111101110001001000001010010000"; ram[2191] = "0b00111101111010111010011011111001"; ram[2192] = "0b00111110000010010101101010001101"; ram[2193] = "0b00111110000111001101010010100000"; ram[2194] = "0b00111110001100000011111111011110"; ram[2195] = "0b00111110010000111001101001110010"; ram[2196] = "0b00111110010101101110001010000110"; ram[2197] = "0b00111110011010100001011001001000"; ram[2198] = "0b00111110011111010011001111100111"; ram[2199] = "0b00111110100010000001110011001010"; ram[2200] = "0b00111110100100011001001011000010"; ram[2201] = "0b00111110100110101111101011110101"; ram[2202] = "0b00111110101001000101010010000001"; ram[2203] = "0b00111110101011011001111010000010"; ram[2204] = "0b00111110101101101101100000011001"; ram[2205] = "0b00111110110000000000000001100100"; ram[2206] = "0b00111110110010010001011010001000"; ram[2207] = "0b00111110110100100001100110101000"; ram[2208] = "0b00111110110110110000100011101001"; ram[2209] = "0b00111110111000111110001101110100"; ram[2210] = "0b00111110111011001010100001110001"; ram[2211] = "0b00111110111101010101011100001110"; ram[2212] = "0b00111110111111011110111001110111"; ram[2213] = "0b00111111000000110011011011101110"; ram[2214] = "0b00111111000001110110101000111001"; ram[2215] = "0b00111111000010111001000010110101"; ram[2216] = "0b00111111000011111010100111111110"; ram[2217] = "0b00111111000100111011010110110010"; ram[2218] = "0b00111111000101111011001101101101"; ram[2219] = "0b00111111000110111010001011010001"; ram[2220] = "0b00111111000111111000001101111100"; ram[2221] = "0b00111111001000110101010100010010"; ram[2222] = "0b00111111001001110001011100110101"; ram[2223] = "0b00111111001010101100100110001100"; ram[2224] = "0b00111111001011100110101110111100"; ram[2225] = "0b00111111001100011111110101101101"; ram[2226] = "0b00111111001101010111111001001010"; ram[2227] = "0b00111111001110001110110111111101"; ram[2228] = "0b00111111001111000100110000110011"; ram[2229] = "0b00111111001111111001100010011010"; ram[2230] = "0b00111111010000101101001011100011"; ram[2231] = "0b00111111010001011111101011000000"; ram[2232] = "0b00111111010010010000111111100100"; ram[2233] = "0b00111111010011000001001000000100"; ram[2234] = "0b00111111010011110000000011011000"; ram[2235] = "0b00111111010100011101110000011001"; ram[2236] = "0b00111111010101001010001110000001"; ram[2237] = "0b00111111010101110101011011001110"; ram[2238] = "0b00111111010110011111010110111101"; ram[2239] = "0b00111111010111001000000000010000"; ram[2240] = "0b00111111010111101111010110001001"; ram[2241] = "0b00111111011000010101010111101101"; ram[2242] = "0b00111111011000111010000100000001"; ram[2243] = "0b00111111011001011101011010001110"; ram[2244] = "0b00111111011001111111011001100000"; ram[2245] = "0b00111111011010100000000001000010"; ram[2246] = "0b00111111011010111111010000000011"; ram[2247] = "0b00111111011011011101000101110100"; ram[2248] = "0b00111111011011111001100001100111"; ram[2249] = "0b00111111011100010100100010110011"; ram[2250] = "0b00111111011100101110001000101101"; ram[2251] = "0b00111111011101000110010010101111"; ram[2252] = "0b00111111011101011101000000010101"; ram[2253] = "0b00111111011101110010010000111100"; ram[2254] = "0b00111111011110000110000100000100"; ram[2255] = "0b00111111011110011000011001001111"; ram[2256] = "0b00111111011110101001010000000001"; ram[2257] = "0b00111111011110111000101000000001"; ram[2258] = "0b00111111011111000110100000110111"; ram[2259] = "0b00111111011111010010111010001111"; ram[2260] = "0b00111111011111011101110011110110"; ram[2261] = "0b00111111011111100111001101011100"; ram[2262] = "0b00111111011111101111000110110001"; ram[2263] = "0b00111111011111110101011111101010"; ram[2264] = "0b00111111011111111010010111111110"; ram[2265] = "0b00111111011111111101101111100101"; ram[2266] = "0b00111111011111111111100110011001"; ram[2267] = "0b00111111011111111111111100011001"; ram[2268] = "0b00111111011111111110110001100100"; ram[2269] = "0b00111111011111111100000101111011"; ram[2270] = "0b00111111011111110111111001100010"; ram[2271] = "0b00111111011111110010001100100001"; ram[2272] = "0b00111111011111101010111110111110"; ram[2273] = "0b00111111011111100010010001000110"; ram[2274] = "0b00111111011111011000000011000110"; ram[2275] = "0b00111111011111001100010101001100"; ram[2276] = "0b00111111011110111111000111101100"; ram[2277] = "0b00111111011110110000011010110111"; ram[2278] = "0b00111111011110100000001111000110"; ram[2279] = "0b00111111011110001110100100110001"; ram[2280] = "0b00111111011101111011011100010001"; ram[2281] = "0b00111111011101100110110110000101"; ram[2282] = "0b00111111011101010000110010101011"; ram[2283] = "0b00111111011100111001010010100100"; ram[2284] = "0b00111111011100100000010110010101"; ram[2285] = "0b00111111011100000101111110100011"; ram[2286] = "0b00111111011011101010001011110101"; ram[2287] = "0b00111111011011001100111110110111"; ram[2288] = "0b00111111011010101110011000010011"; ram[2289] = "0b00111111011010001110011000111001"; ram[2290] = "0b00111111011001101101000001011001"; ram[2291] = "0b00111111011001001010010010100101"; ram[2292] = "0b00111111011000100110001101010010"; ram[2293] = "0b00111111011000000000110010010110"; ram[2294] = "0b00111111010111011010000010101010"; ram[2295] = "0b00111111010110110001111111001001"; ram[2296] = "0b00111111010110001000101000101111"; ram[2297] = "0b00111111010101011110000000011011"; ram[2298] = "0b00111111010100110010000111001110"; ram[2299] = "0b00111111010100000100111110001001"; ram[2300] = "0b00111111010011010110100110010001"; ram[2301] = "0b00111111010010100111000000101100"; ram[2302] = "0b00111111010001110110001110100011"; ram[2303] = "0b00111111010001000100010000111110"; ram[2304] = "0b00111111010000010001001001001011"; ram[2305] = "0b00111111001111011100111000010101"; ram[2306] = "0b00111111001110100111011111101100"; ram[2307] = "0b00111111001101110001000000100001"; ram[2308] = "0b00111111001100111001011100000110"; ram[2309] = "0b00111111001100000000110011110000"; ram[2310] = "0b00111111001011000111001000110100"; ram[2311] = "0b00111111001010001100011100101001"; ram[2312] = "0b00111111001001010000110000101000"; ram[2313] = "0b00111111001000010100000110001011"; ram[2314] = "0b00111111000111010110011110101111"; ram[2315] = "0b00111111000110010111111011110000"; ram[2316] = "0b00111111000101011000011110101101"; ram[2317] = "0b00111111000100011000001001000110"; ram[2318] = "0b00111111000011010110111100011101"; ram[2319] = "0b00111111000010010100111010010011"; ram[2320] = "0b00111111000001010010000100001110"; ram[2321] = "0b00111111000000001110011011110010"; ram[2322] = "0b00111110111110010100000101001001"; ram[2323] = "0b00111110111100001001110100011110"; ram[2324] = "0b00111110111001111110001000110001"; ram[2325] = "0b00111110110111110001000101010110"; ram[2326] = "0b00111110110101100010101101100011"; ram[2327] = "0b00111110110011010011000100110000"; ram[2328] = "0b00111110110001000010001110010101"; ram[2329] = "0b00111110101110110000001101101110"; ram[2330] = "0b00111110101100011101000110010111"; ram[2331] = "0b00111110101010001000111011110000"; ram[2332] = "0b00111110100111110011110001010111"; ram[2333] = "0b00111110100101011101101010110001"; ram[2334] = "0b00111110100011000110101011011110"; ram[2335] = "0b00111110100000101110110111000100"; ram[2336] = "0b00111110011100101100100010010000"; ram[2337] = "0b00111110010111111001111010100011"; ram[2338] = "0b00111110010011000101111110010001"; ram[2339] = "0b00111110001110010000110100101011"; ram[2340] = "0b00111110001001011010100101000101"; ram[2341] = "0b00111110000100100011010110110101"; ram[2342] = "0b00111101111111010110100010100001"; ram[2343] = "0b00111101110101100100110111100011"; ram[2344] = "0b00111101101011110001111011100000"; ram[2345] = "0b00111101100001111101111101001110"; ram[2346] = "0b00111101010000010010010111000101"; ram[2347] = "0b00111100111001001111010101010100"; ram[2348] = "0b00111100000011110001001011110000"; ram[2349] = "0b10111100001010111101001001010000"; ram[2350] = "0b10111100111100110101001110101000"; ram[2351] = "0b10111101010010000101001110010011"; ram[2352] = "0b10111101100010110111010100110000"; ram[2353] = "0b10111101101100101011001101100111"; ram[2354] = "0b10111101110110011110000010110111"; ram[2355] = "0b10111110000000000111110010110110"; ram[2356] = "0b10111110000100111111110011101011"; ram[2357] = "0b10111110001001110110111100100001"; ram[2358] = "0b10111110001110101101000110000001"; ram[2359] = "0b10111110010011100010001000110111"; ram[2360] = "0b10111110011000010101111101101110"; ram[2361] = "0b10111110011101001000011101010110"; ram[2362] = "0b10111110100000111100110000001111"; ram[2363] = "0b10111110100011010100011111111100"; ram[2364] = "0b10111110100101101011011010001101"; ram[2365] = "0b10111110101000000001011011011101"; ram[2366] = "0b10111110101010010110100000001010"; ram[2367] = "0b10111110101100101010100100110010"; ram[2368] = "0b10111110101110111101100101110100"; ram[2369] = "0b10111110110001001111011111110011"; ram[2370] = "0b10111110110011100000001111010010"; ram[2371] = "0b10111110110101101111110000110101"; ram[2372] = "0b10111110110111111110000001000100"; ram[2373] = "0b10111110111010001010111100100110"; ram[2374] = "0b10111110111100010110100000001000"; ram[2375] = "0b10111110111110100000101000010110"; ram[2376] = "0b10111111000000010100101000111111"; ram[2377] = "0b10111111000001011000001100111010"; ram[2378] = "0b10111111000010011010111110010100"; ram[2379] = "0b10111111000011011100111011101001"; ram[2380] = "0b10111111000100011110000011010101"; ram[2381] = "0b10111111000101011110010011110101"; ram[2382] = "0b10111111000110011101101011101000"; ram[2383] = "0b10111111000111011100001001001111"; ram[2384] = "0b10111111001000011001101011001011"; ram[2385] = "0b10111111001001010110001111111111"; ram[2386] = "0b10111111001010010001110110001110"; ram[2387] = "0b10111111001011001100011100100000"; ram[2388] = "0b10111111001100000110000001011011"; ram[2389] = "0b10111111001100111110100011101000"; ram[2390] = "0b10111111001101110110000001110001"; ram[2391] = "0b10111111001110101100011010100100"; ram[2392] = "0b10111111001111100001101100101100"; ram[2393] = "0b10111111010000010101110110111011"; ram[2394] = "0b10111111010001001000111000000000"; ram[2395] = "0b10111111010001111010101110101111"; ram[2396] = "0b10111111010010101011011001111100"; ram[2397] = "0b10111111010011011010111000011101"; ram[2398] = "0b10111111010100001001001001001100"; ram[2399] = "0b10111111010100110110001011000001"; ram[2400] = "0b10111111010101100001111100111000"; ram[2401] = "0b10111111010110001100011101110000"; ram[2402] = "0b10111111010110110101101100101001"; ram[2403] = "0b10111111010111011101101000100010"; ram[2404] = "0b10111111011000000100010000100001"; ram[2405] = "0b10111111011000101001100011101011"; ram[2406] = "0b10111111011001001101100001000111"; ram[2407] = "0b10111111011001110000000111111111"; ram[2408] = "0b10111111011010010001010111011111"; ram[2409] = "0b10111111011010110001001110110100"; ram[2410] = "0b10111111011011001111101101001110"; ram[2411] = "0b10111111011011101100110001111111"; ram[2412] = "0b10111111011100001000011100011010"; ram[2413] = "0b10111111011100100010101011110111"; ram[2414] = "0b10111111011100111011011111101110"; ram[2415] = "0b10111111011101010010110111011000"; ram[2416] = "0b10111111011101101000110010010011"; ram[2417] = "0b10111111011101111101001111111101"; ram[2418] = "0b10111111011110010000001111111000"; ram[2419] = "0b10111111011110100001110001100110"; ram[2420] = "0b10111111011110110001110100101101"; ram[2421] = "0b10111111011111000000011000110101"; ram[2422] = "0b10111111011111001101011101101000"; ram[2423] = "0b10111111011111011001000010110010"; ram[2424] = "0b10111111011111100011001000000001"; ram[2425] = "0b10111111011111101011101101000111"; ram[2426] = "0b10111111011111110010110001110110"; ram[2427] = "0b10111111011111111000010110000011"; ram[2428] = "0b10111111011111111100011001100111"; ram[2429] = "0b10111111011111111110111100011010"; ram[2430] = "0b10111111011111111111111110011010"; ram[2431] = "0b10111111011111111111011111100100"; ram[2432] = "0b10111111011111111101011111111010"; ram[2433] = "0b10111111011111111001111111011110"; ram[2434] = "0b10111111011111110100111110010101"; ram[2435] = "0b10111111011111101110011100101000"; ram[2436] = "0b10111111011111100110011010100000"; ram[2437] = "0b10111111011111011100111000001001"; ram[2438] = "0b10111111011111010001110101110010"; ram[2439] = "0b10111111011111000101010011101011"; ram[2440] = "0b10111111011110110111010010001000"; ram[2441] = "0b10111111011110100111110001011101"; ram[2442] = "0b10111111011110010110110010000010"; ram[2443] = "0b10111111011110000100010100010001"; ram[2444] = "0b10111111011101110000011000100110"; ram[2445] = "0b10111111011101011010111111011110"; ram[2446] = "0b10111111011101000100001001011011"; ram[2447] = "0b10111111011100101011110110111110"; ram[2448] = "0b10111111011100010010001000101101"; ram[2449] = "0b10111111011011110110111111001110"; ram[2450] = "0b10111111011011011010011011001011"; ram[2451] = "0b10111111011010111100011101001111"; ram[2452] = "0b10111111011010011101000110000111"; ram[2453] = "0b10111111011001111100010110100010"; ram[2454] = "0b10111111011001011010001111010011"; ram[2455] = "0b10111111011000110110110001001100"; ram[2456] = "0b10111111011000010001111101000011"; ram[2457] = "0b10111111010111101011110011110001"; ram[2458] = "0b10111111010111000100010110001110"; ram[2459] = "0b10111111010110011011100101010111"; ram[2460] = "0b10111111010101110001100010001001"; ram[2461] = "0b10111111010101000110001101100011"; ram[2462] = "0b10111111010100011001101000101000"; ram[2463] = "0b10111111010011101011110100011011"; ram[2464] = "0b10111111010010111100110010000001"; ram[2465] = "0b10111111010010001100100010100001"; ram[2466] = "0b10111111010001011011000111000101"; ram[2467] = "0b10111111010000101000100000110110"; ram[2468] = "0b10111111001111110100110001000010"; ram[2469] = "0b10111111001110111111111000110111"; ram[2470] = "0b10111111001110001001111001100101"; ram[2471] = "0b10111111001101010010110100011110"; ram[2472] = "0b10111111001100011010101010110100"; ram[2473] = "0b10111111001011100001011101111110"; ram[2474] = "0b10111111001010100111001111010001"; ram[2475] = "0b10111111001001101100000000000101"; ram[2476] = "0b10111111001000101111110001110101"; ram[2477] = "0b10111111000111110010100101111010"; ram[2478] = "0b10111111000110110100011101110011"; ram[2479] = "0b10111111000101110101011010111101"; ram[2480] = "0b10111111000100110101011110110111"; ram[2481] = "0b10111111000011110100101011000010"; ram[2482] = "0b10111111000010110011000001000000"; ram[2483] = "0b10111111000001110000100010010100"; ram[2484] = "0b10111111000000101101010000100011"; ram[2485] = "0b10111110111111010010011010100111"; ram[2486] = "0b10111110111101001000110100010111"; ram[2487] = "0b10111110111010111101110001100111"; ram[2488] = "0b10111110111000110001010101101001"; ram[2489] = "0b10111110110110100011100011110001"; ram[2490] = "0b10111110110100010100011111010110"; ram[2491] = "0b10111110110010000100001011110001"; ram[2492] = "0b10111110101111110010101100011100"; ram[2493] = "0b10111110101101100000000100110011"; ram[2494] = "0b10111110101011001100011000010100"; ram[2495] = "0b10111110101000110111101010011110"; ram[2496] = "0b10111110100110100001111110110010"; ram[2497] = "0b10111110100100001011011000110100"; ram[2498] = "0b10111110100001110011111100000110"; ram[2499] = "0b10111110011110110111011000011011"; ram[2500] = "0b10111110011010000101011001100011"; ram[2501] = "0b10111110010101010010000010110011"; ram[2502] = "0b10111110010000011101011011011011"; ram[2503] = "0b10111110001011100111101010101110"; ram[2504] = "0b10111110000110110000111000000010"; ram[2505] = "0b10111110000001111001001010101100"; ram[2506] = "0b10111101111010000001010100000111"; ram[2507] = "0b10111101110000001110111011000100"; ram[2508] = "0b10111101100110011011011001000010"; ram[2509] = "0b10111101011001001101111001101111"; ram[2510] = "0b10111101000101100011101010110100"; ram[2511] = "0b10111100100011110001000110001011"; for (unsigned i = 2512; i < 2623 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[2623] = "0b00111100101001101100110101011011"; ram[2624] = "0b00111101001001101100010010000001"; ram[2625] = "0b00111101011110100001000010100000"; ram[2626] = "0b00111101101001101010000100011010"; ram[2627] = "0b00111101110100000010100000110100"; ram[2628] = "0b00111101111110011001100100110110"; ram[2629] = "0b00111110000100010111011111011101"; ram[2630] = "0b00111110001001100001001110101101"; ram[2631] = "0b00111110001110101001110111011101"; ram[2632] = "0b00111110010011110001010000111110"; ram[2633] = "0b00111110011000110111010010100100"; ram[2634] = "0b00111110011101111011110011100101"; ram[2635] = "0b00111110100001011111010101101101"; ram[2636] = "0b00111110100011111111111000101111"; ram[2637] = "0b00111110100110011111011110101001"; ram[2638] = "0b00111110101000111110000011001010"; ram[2639] = "0b00111110101011011011100010000111"; ram[2640] = "0b00111110101101110111110111010010"; ram[2641] = "0b00111110110000010010111110100100"; ram[2642] = "0b00111110110010101100110011110100"; ram[2643] = "0b00111110110101000101010010111101"; ram[2644] = "0b00111110110111011100010111111101"; ram[2645] = "0b00111110111001110001111110110010"; ram[2646] = "0b00111110111100000110000011011111"; ram[2647] = "0b00111110111110011000100010000111"; ram[2648] = "0b00111111000000010100101011011001"; ram[2649] = "0b00111111000001011100001110110110"; ram[2650] = "0b00111111000010100010111001100000"; ram[2651] = "0b00111111000011101000101001011111"; ram[2652] = "0b00111111000100101101011100111100"; ram[2653] = "0b00111111000101110001010010000011"; ram[2654] = "0b00111111000110110100000111000001"; ram[2655] = "0b00111111000111110101111010000100"; ram[2656] = "0b00111111001000110110101001011100"; ram[2657] = "0b00111111001001110110010011011100"; ram[2658] = "0b00111111001010110100110110010111"; ram[2659] = "0b00111111001011110010010000100011"; ram[2660] = "0b00111111001100101110100000011000"; ram[2661] = "0b00111111001101101001100100001111"; ram[2662] = "0b00111111001110100011011010100101"; ram[2663] = "0b00111111001111011100000001110110"; ram[2664] = "0b00111111010000010011011000100011"; ram[2665] = "0b00111111010001001001011101001110"; ram[2666] = "0b00111111010001111110001110011011"; ram[2667] = "0b00111111010010110001101010110000"; ram[2668] = "0b00111111010011100011110000110110"; ram[2669] = "0b00111111010100010100011111010111"; ram[2670] = "0b00111111010101000011110101000010"; ram[2671] = "0b00111111010101110001110000100110"; ram[2672] = "0b00111111010110011110010000110100"; ram[2673] = "0b00111111010111001001010100100001"; ram[2674] = "0b00111111010111110010111010100100"; ram[2675] = "0b00111111011000011011000001110111"; ram[2676] = "0b00111111011001000001101001010100"; ram[2677] = "0b00111111011001100110101111111100"; ram[2678] = "0b00111111011010001010010100101110"; ram[2679] = "0b00111111011010101100010110101110"; ram[2680] = "0b00111111011011001100110101000010"; ram[2681] = "0b00111111011011101011101110110100"; ram[2682] = "0b00111111011100001001000011001110"; ram[2683] = "0b00111111011100100100110001100000"; ram[2684] = "0b00111111011100111110111000111001"; ram[2685] = "0b00111111011101010111011000101110"; ram[2686] = "0b00111111011101101110010000010100"; ram[2687] = "0b00111111011110000011011111000110"; ram[2688] = "0b00111111011110010111000100011111"; ram[2689] = "0b00111111011110101000111111111101"; ram[2690] = "0b00111111011110111001010001000011"; ram[2691] = "0b00111111011111000111110111010100"; ram[2692] = "0b00111111011111010100110010011001"; ram[2693] = "0b00111111011111100000000001111010"; ram[2694] = "0b00111111011111101001100101100101"; ram[2695] = "0b00111111011111110001011101001010"; ram[2696] = "0b00111111011111110111101000011010"; ram[2697] = "0b00111111011111111100000111001101"; ram[2698] = "0b00111111011111111110111001011010"; ram[2699] = "0b00111111011111111111111110111100"; ram[2700] = "0b00111111011111111111010111110010"; ram[2701] = "0b00111111011111111101000011111100"; ram[2702] = "0b00111111011111111001000011011111"; ram[2703] = "0b00111111011111110011010110100001"; ram[2704] = "0b00111111011111101011111101001101"; ram[2705] = "0b00111111011111100010110111101110"; ram[2706] = "0b00111111011111011000000110010011"; ram[2707] = "0b00111111011111001011101001010001"; ram[2708] = "0b00111111011110111101100000111010"; ram[2709] = "0b00111111011110101101101101101000"; ram[2710] = "0b00111111011110011100001111110110"; ram[2711] = "0b00111111011110001001001000000000"; ram[2712] = "0b00111111011101110100010110101000"; ram[2713] = "0b00111111011101011101111100010000"; ram[2714] = "0b00111111011101000101111001011111"; ram[2715] = "0b00111111011100101100001110111110"; ram[2716] = "0b00111111011100010000111101011000"; ram[2717] = "0b00111111011011110100000101011100"; ram[2718] = "0b00111111011011010101100111111010"; ram[2719] = "0b00111111011010110101100101100110"; ram[2720] = "0b00111111011010010011111111010111"; ram[2721] = "0b00111111011001110000110110000110"; ram[2722] = "0b00111111011001001100001010101110"; ram[2723] = "0b00111111011000100101111110001110"; ram[2724] = "0b00111111010111111110010001100111"; ram[2725] = "0b00111111010111010101000101111100"; ram[2726] = "0b00111111010110101010011100010010"; ram[2727] = "0b00111111010101111110010101110011"; ram[2728] = "0b00111111010101010000110011101001"; ram[2729] = "0b00111111010100100001110111000010"; ram[2730] = "0b00111111010011110001100001001110"; ram[2731] = "0b00111111010010111111110011011110"; ram[2732] = "0b00111111010010001100101111000110"; ram[2733] = "0b00111111010001011000010101011111"; ram[2734] = "0b00111111010000100010100111111111"; ram[2735] = "0b00111111001111101011101000000100"; ram[2736] = "0b00111111001110110011010111001010"; ram[2737] = "0b00111111001101111001110110110001"; ram[2738] = "0b00111111001100111111001000011011"; ram[2739] = "0b00111111001100000011001101101010"; ram[2740] = "0b00111111001011000110001000000110"; ram[2741] = "0b00111111001010000111111001010101"; ram[2742] = "0b00111111001001001000100011000010"; ram[2743] = "0b00111111001000001000000110110111"; ram[2744] = "0b00111111000111000110100110100011"; ram[2745] = "0b00111111000110000100000011110101"; ram[2746] = "0b00111111000101000000100000011110"; ram[2747] = "0b00111111000011111011111110010000"; ram[2748] = "0b00111111000010110110011110111111"; ram[2749] = "0b00111111000001110000000100100011"; ram[2750] = "0b00111111000000101000110000110010"; ram[2751] = "0b00111110111111000001001011001011"; ram[2752] = "0b00111110111100101111001001110001"; ram[2753] = "0b00111110111010011011100001001100"; ram[2754] = "0b00111110111000000110010101011001"; ram[2755] = "0b00111110110101101111101010010100"; ram[2756] = "0b00111110110011010111100011111101"; ram[2757] = "0b00111110110000111110000110010111"; ram[2758] = "0b00111110101110100011010101100110"; ram[2759] = "0b00111110101100000111010101110001"; ram[2760] = "0b00111110101001101010001011000001"; ram[2761] = "0b00111110100111001011111001100000"; ram[2762] = "0b00111110100100101100100101011101"; ram[2763] = "0b00111110100010001100010011000101"; ram[2764] = "0b00111110011111010110001101010000"; ram[2765] = "0b00111110011010010010001000110001"; ram[2766] = "0b00111110010101001100100001010011"; ram[2767] = "0b00111110010000000101011111011111"; ram[2768] = "0b00111110001010111101001100000000"; ram[2769] = "0b00111110000101110011101111100101"; ram[2770] = "0b00111110000000101001010010111011"; ram[2771] = "0b00111101110110111011111101101011"; ram[2772] = "0b00111101101100100011111000001100"; ram[2773] = "0b00111101100010001010100111000001"; ram[2774] = "0b00111101001111100000110111101010"; ram[2775] = "0b00111100110101010110100001001010"; ram[2776] = "0b00111011101110100111100001101000"; ram[2777] = "0b10111100011100000110001000010011"; ram[2778] = "0b10111101000011110111100110110101"; ram[2779] = "0b10111101011000101100101110101011"; ram[2780] = "0b10111101100110110000001011000111"; ram[2781] = "0b10111101110001001000111101000100"; ram[2782] = "0b10111101111011100000011011100100"; ram[2783] = "0b10111110000010111011001010100000"; ram[2784] = "0b10111110001000000101001011111010"; ram[2785] = "0b10111110001101001110001001001111"; ram[2786] = "0b10111110010010010101111001110001"; ram[2787] = "0b10111110010111011100010100110011"; ram[2788] = "0b10111110011100100001010001101011"; ram[2789] = "0b10111110100000110010010011111000"; ram[2790] = "0b10111110100011010011000111001111"; ram[2791] = "0b10111110100101110010111110101010"; ram[2792] = "0b10111110101000010001110101111000"; ram[2793] = "0b10111110101010101111101000101100"; ram[2794] = "0b10111110101101001100010010111010"; ram[2795] = "0b10111110101111100111110000010111"; ram[2796] = "0b10111110110010000001111100111101"; ram[2797] = "0b10111110110100011010110100100100"; ram[2798] = "0b10111110110110110010010011001010"; ram[2799] = "0b10111110111001001000010100101101"; ram[2800] = "0b10111110111011011100110101001110"; ram[2801] = "0b10111110111101101111110000110001"; ram[2802] = "0b10111111000000000000100001101111"; ram[2803] = "0b10111111000001001000010100101101"; ram[2804] = "0b10111111000010001111001111011011"; ram[2805] = "0b10111111000011010101001111111111"; ram[2806] = "0b10111111000100011010010100100011"; ram[2807] = "0b10111111000101011110011011010001"; ram[2808] = "0b10111111000110100001100010010110"; ram[2809] = "0b10111111000111100011100111111111"; ram[2810] = "0b10111111001000100100101010011101"; ram[2811] = "0b10111111001001100100101000000000"; ram[2812] = "0b10111111001010100011011110111101"; ram[2813] = "0b10111111001011100001001101101001"; ram[2814] = "0b10111111001100011101110010011010"; ram[2815] = "0b10111111001101011001001011101010"; ram[2816] = "0b10111111001110010011010111110100"; ram[2817] = "0b10111111001111001100010101010101"; ram[2818] = "0b10111111010000000100000010101101"; ram[2819] = "0b10111111010000111010011110011100"; ram[2820] = "0b10111111010001101111100111000111"; ram[2821] = "0b10111111010010100011011011010011"; ram[2822] = "0b10111111010011010101111001101000"; ram[2823] = "0b10111111010100000111000000110000"; ram[2824] = "0b10111111010100110110101111011000"; ram[2825] = "0b10111111010101100101000100001111"; ram[2826] = "0b10111111010110010001111110000111"; ram[2827] = "0b10111111010110111101011011110010"; ram[2828] = "0b10111111010111100111011100001000"; ram[2829] = "0b10111111011000001111111110000000"; ram[2830] = "0b10111111011000110111000000010110"; ram[2831] = "0b10111111011001011100100010001000"; ram[2832] = "0b10111111011010000000100010010110"; ram[2833] = "0b10111111011010100011000000000011"; ram[2834] = "0b10111111011011000011111010010100"; ram[2835] = "0b10111111011011100011010000010001"; ram[2836] = "0b10111111011100000001000001000110"; ram[2837] = "0b10111111011100011101001011111111"; ram[2838] = "0b10111111011100110111110000001101"; ram[2839] = "0b10111111011101010000101101000010"; ram[2840] = "0b10111111011101101000000001110101"; ram[2841] = "0b10111111011101111101101101111101"; ram[2842] = "0b10111111011110010001110000110110"; ram[2843] = "0b10111111011110100100001001111110"; ram[2844] = "0b10111111011110110100111000110110"; ram[2845] = "0b10111111011111000011111101000000"; ram[2846] = "0b10111111011111010001010110000100"; ram[2847] = "0b10111111011111011101000011101011"; ram[2848] = "0b10111111011111100111000101100001"; ram[2849] = "0b10111111011111101111011011010100"; ram[2850] = "0b10111111011111110110000100110111"; ram[2851] = "0b10111111011111111011000001111111"; ram[2852] = "0b10111111011111111110010010100011"; ram[2853] = "0b10111111011111111111110110011101"; ram[2854] = "0b10111111011111111111101101101011"; ram[2855] = "0b10111111011111111101111000001100"; ram[2856] = "0b10111111011111111010010110000110"; ram[2857] = "0b10111111011111110101000111011100"; ram[2858] = "0b10111111011111101110001100011000"; ram[2859] = "0b10111111011111100101100101000110"; ram[2860] = "0b10111111011111011011010001110100"; ram[2861] = "0b10111111011111001111010010110100"; ram[2862] = "0b10111111011111000001101000011011"; ram[2863] = "0b10111111011110110010010010111111"; ram[2864] = "0b10111111011110100001010010111010"; ram[2865] = "0b10111111011110001110101000101010"; ram[2866] = "0b10111111011101111010010100101110"; ram[2867] = "0b10111111011101100100010111101001"; ram[2868] = "0b10111111011101001100110001111111"; ram[2869] = "0b10111111011100110011100100011001"; ram[2870] = "0b10111111011100011000101111100010"; ram[2871] = "0b10111111011011111100010100001000"; ram[2872] = "0b10111111011011011110010010111010"; ram[2873] = "0b10111111011010111110101100101011"; ram[2874] = "0b10111111011010011101100010010010"; ram[2875] = "0b10111111011001111010110100100110"; ram[2876] = "0b10111111011001010110100100100011"; ram[2877] = "0b10111111011000110000110011000101"; ram[2878] = "0b10111111011000001001100001001110"; ram[2879] = "0b10111111010111100000110000000000"; ram[2880] = "0b10111111010110110110100000100001"; ram[2881] = "0b10111111010110001010110011110111"; ram[2882] = "0b10111111010101011101101011001101"; ram[2883] = "0b10111111010100101111000111110000"; ram[2884] = "0b10111111010011111111001010101110"; ram[2885] = "0b10111111010011001101110101011010"; ram[2886] = "0b10111111010010011011001001001000"; ram[2887] = "0b10111111010001100111000111001100"; ram[2888] = "0b10111111010000110001110001000000"; ram[2889] = "0b10111111001111111011000111111110"; ram[2890] = "0b10111111001111000011001101100011"; ram[2891] = "0b10111111001110001010000011001101"; ram[2892] = "0b10111111001101001111101010011111"; ram[2893] = "0b10111111001100010100000100111011"; ram[2894] = "0b10111111001011010111010100000110"; ram[2895] = "0b10111111001010011001011001101000"; ram[2896] = "0b10111111001001011010010111001001"; ram[2897] = "0b10111111001000011010001110010110"; ram[2898] = "0b10111111000111011001000000111010"; ram[2899] = "0b10111111000110010110110000100100"; ram[2900] = "0b10111111000101010011011111000101"; ram[2901] = "0b10111111000100001111001110001111"; ram[2902] = "0b10111111000011001001111111110111"; ram[2903] = "0b10111111000010000011110101110001"; ram[2904] = "0b10111111000000111100110001110101"; ram[2905] = "0b10111110111111101001101011111000"; ram[2906] = "0b10111110111101011000000111111111"; ram[2907] = "0b10111110111011000100111011110111"; ram[2908] = "0b10111110111000110000001011011001"; ram[2909] = "0b10111110110110011001111010100010"; ram[2910] = "0b10111110110100000010001101010010"; ram[2911] = "0b10111110110001101001000111101010"; ram[2912] = "0b10111110101111001110101101101110"; ram[2913] = "0b10111110101100110011000011100100"; ram[2914] = "0b10111110101010010110001101010110"; ram[2915] = "0b10111110100111111000001111001100"; ram[2916] = "0b10111110100101011001001101010011"; ram[2917] = "0b10111110100010111001001011111011"; ram[2918] = "0b10111110100000011000001111010001"; ram[2919] = "0b10111110011011101100110111010000"; ram[2920] = "0b10111110010110100111101010100101"; ram[2921] = "0b10111110010001100001000001001001"; ram[2922] = "0b10111110001100011001000011100111"; ram[2923] = "0b10111110000111001111111010101011"; ram[2924] = "0b10111110000010000101101111000110"; ram[2925] = "0b10111101111001110101010011001110"; ram[2926] = "0b10111101101111011101100110000011"; ram[2927] = "0b10111101100101000100101000010000"; ram[2928] = "0b10111101010101010101010111000000"; ram[2929] = "0b10111101000000100000000010111010"; ram[2930] = "0b10111100001110100111011110100010"; for (unsigned i = 2931; i < 3060 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[3060] = "0b00111100101100001011100001110011"; ram[3061] = "0b00111101001100001010110111101011"; ram[3062] = "0b00111101100001000111010101001000"; ram[3063] = "0b00111101101100001000001111010011"; ram[3064] = "0b00111101110111000111110101010101"; ram[3065] = "0b00111110000001000010111001001001"; ram[3066] = "0b00111110000110100000111000101000"; ram[3067] = "0b00111110001011111101101110101100"; ram[3068] = "0b00111110010001011001010000111011"; ram[3069] = "0b00111110010110110011010101000001"; ram[3070] = "0b00111110011100001011110000101000"; ram[3071] = "0b00111110100000110001001100110000"; ram[3072] = "0b00111110100011011011100010101110"; ram[3073] = "0b00111110100110000100110101001010"; ram[3074] = "0b00111110101000101100111111000000"; ram[3075] = "0b00111110101011010011111011001111"; ram[3076] = "0b00111110101101111001100100111011"; ram[3077] = "0b00111110110000011101110111000111"; ram[3078] = "0b00111110110011000000101100111001"; ram[3079] = "0b00111110110101100010000001011011"; ram[3080] = "0b00111110111000000001101111111011"; ram[3081] = "0b00111110111010011111110011100110"; ram[3082] = "0b00111110111100111100000111110001"; ram[3083] = "0b00111110111111010110100111110001"; ram[3084] = "0b00111111000000110111100111011111"; ram[3085] = "0b00111111000010000010111100011100"; ram[3086] = "0b00111111000011001101010000011111"; ram[3087] = "0b00111111000100010110100001011010"; ram[3088] = "0b00111111000101011110101101000011"; ram[3089] = "0b00111111000110100101110001001110"; ram[3090] = "0b00111111000111101011101011110101"; ram[3091] = "0b00111111001000110000011010110011"; ram[3092] = "0b00111111001001110011111100000100"; ram[3093] = "0b00111111001010110110001101101000"; ram[3094] = "0b00111111001011110111001101100000"; ram[3095] = "0b00111111001100110110111001110000"; ram[3096] = "0b00111111001101110101010000100000"; ram[3097] = "0b00111111001110110010001111110111"; ram[3098] = "0b00111111001111101101110110000011"; ram[3099] = "0b00111111010000101000000001010001"; ram[3100] = "0b00111111010001100000101111110010"; ram[3101] = "0b00111111010010010111111111111011"; ram[3102] = "0b00111111010011001101110000000001"; ram[3103] = "0b00111111010100000001111110011111"; ram[3104] = "0b00111111010100110100101001110001"; ram[3105] = "0b00111111010101100101110000010110"; ram[3106] = "0b00111111010110010101010000110001"; ram[3107] = "0b00111111010111000011001001100110"; ram[3108] = "0b00111111010111101111011001100000"; ram[3109] = "0b00111111011000011001111111001000"; ram[3110] = "0b00111111011001000010111001001111"; ram[3111] = "0b00111111011001101010000110100110"; ram[3112] = "0b00111111011010001111100110000010"; ram[3113] = "0b00111111011010110011010110011100"; ram[3114] = "0b00111111011011010101010110110000"; ram[3115] = "0b00111111011011110101100101111100"; ram[3116] = "0b00111111011100010100000011000100"; ram[3117] = "0b00111111011100110000101101001110"; ram[3118] = "0b00111111011101001011100011100010"; ram[3119] = "0b00111111011101100100100101001101"; ram[3120] = "0b00111111011101111011110001100001"; ram[3121] = "0b00111111011110010001000111110000"; ram[3122] = "0b00111111011110100100100111010010"; ram[3123] = "0b00111111011110110110001111100010"; ram[3124] = "0b00111111011111000101111111111110"; ram[3125] = "0b00111111011111010011111000001000"; ram[3126] = "0b00111111011111011111110111100110"; ram[3127] = "0b00111111011111101001111110000001"; ram[3128] = "0b00111111011111110010001011000101"; ram[3129] = "0b00111111011111111000011110100011"; ram[3130] = "0b00111111011111111100111000001111"; ram[3131] = "0b00111111011111111111011000000000"; ram[3132] = "0b00111111011111111111111101110011"; ram[3133] = "0b00111111011111111110101001100100"; ram[3134] = "0b00111111011111111011011011011000"; ram[3135] = "0b00111111011111110110010011010101"; ram[3136] = "0b00111111011111101111010001100011"; ram[3137] = "0b00111111011111100110010110010001"; ram[3138] = "0b00111111011111011011100001101111"; ram[3139] = "0b00111111011111001110110100010010"; ram[3140] = "0b00111111011111000000001110010011"; ram[3141] = "0b00111111011110101111110000001101"; ram[3142] = "0b00111111011110011101011010011111"; ram[3143] = "0b00111111011110001001001101101101"; ram[3144] = "0b00111111011101110011001010011101"; ram[3145] = "0b00111111011101011011010001011001"; ram[3146] = "0b00111111011101000001100011001110"; ram[3147] = "0b00111111011100100110000000101110"; ram[3148] = "0b00111111011100001000101010101101"; ram[3149] = "0b00111111011011101001100010000100"; ram[3150] = "0b00111111011011001000100111101100"; ram[3151] = "0b00111111011010100101111100100110"; ram[3152] = "0b00111111011010000001100001110011"; ram[3153] = "0b00111111011001011011011000011001"; ram[3154] = "0b00111111011000110011100001100000"; ram[3155] = "0b00111111011000001001111110010101"; ram[3156] = "0b00111111010111011110110000000110"; ram[3157] = "0b00111111010110110001111000000110"; ram[3158] = "0b00111111010110000011010111101011"; ram[3159] = "0b00111111010101010011010000001101"; ram[3160] = "0b00111111010100100001100011001000"; ram[3161] = "0b00111111010011101110010001111010"; ram[3162] = "0b00111111010010111001011110000110"; ram[3163] = "0b00111111010010000011001001010000"; ram[3164] = "0b00111111010001001011010101000000"; ram[3165] = "0b00111111010000010010000011000000"; ram[3166] = "0b00111111001111010111010100111101"; ram[3167] = "0b00111111001110011011001100100111"; ram[3168] = "0b00111111001101011101101011110001"; ram[3169] = "0b00111111001100011110110100010000"; ram[3170] = "0b00111111001011011110100111111100"; ram[3171] = "0b00111111001010011101001000110000"; ram[3172] = "0b00111111001001011010011000100111"; ram[3173] = "0b00111111001000010110011001100010"; ram[3174] = "0b00111111000111010001001101100011"; ram[3175] = "0b00111111000110001010110110101100"; ram[3176] = "0b00111111000101000011010111000100"; ram[3177] = "0b00111111000011111010110000110011"; ram[3178] = "0b00111111000010110001000110000100"; ram[3179] = "0b00111111000001100110011001000011"; ram[3180] = "0b00111111000000011010101011111111"; ram[3181] = "0b00111110111110011100000010010000"; ram[3182] = "0b00111110111100000000110101011111"; ram[3183] = "0b00111110111001100011110110010101"; ram[3184] = "0b00111110110111000101001001011100"; ram[3185] = "0b00111110110100100100110011100011"; ram[3186] = "0b00111110110010000010111001011011"; ram[3187] = "0b00111110101111011111011111111001"; ram[3188] = "0b00111110101100111010101011110101"; ram[3189] = "0b00111110101010010100100010001001"; ram[3190] = "0b00111110100111101101000111110001"; ram[3191] = "0b00111110100101000100100001101101"; ram[3192] = "0b00111110100010011010110100111111"; ram[3193] = "0b00111110011111100000001101010001"; ram[3194] = "0b00111110011010001000110111100000"; ram[3195] = "0b00111110010100101111110010111011"; ram[3196] = "0b00111110001111010101001001110010"; ram[3197] = "0b00111110001001111001000110011010"; ram[3198] = "0b00111110000100011011110011001011"; ram[3199] = "0b00111101111101111010110100111110"; ram[3200] = "0b00111101110010111100001101100100"; ram[3201] = "0b00111101100111111100000101000010"; ram[3202] = "0b00111101011001110101100000101111"; ram[3203] = "0b00111101000011110001001001001001"; ram[3204] = "0b00111100010110101110110101011101"; ram[3205] = "0b10111100000001101000100001111111"; ram[3206] = "0b10111100111100111111011100101010"; ram[3207] = "0b10111101010100100100011010000001"; ram[3208] = "0b10111101100101010011110000110000"; ram[3209] = "0b10111101110000010100001101010111"; ram[3210] = "0b10111101111011010011001101111000"; ram[3211] = "0b10111110000011001000001110101011"; ram[3212] = "0b10111110001000100101110011011100"; ram[3213] = "0b10111110001110000010001010110100"; ram[3214] = "0b10111110010011011101001010011100"; ram[3215] = "0b10111110011000110110100111111110"; ram[3216] = "0b10111110011110001110011001001000"; ram[3217] = "0b10111110100001110010001001110101"; ram[3218] = "0b10111110100100011100000110101100"; ram[3219] = "0b10111110100111000100111110000101"; ram[3220] = "0b10111110101001101100101010111110"; ram[3221] = "0b10111110101100010011001000011000"; ram[3222] = "0b10111110101110111000010001010110"; ram[3223] = "0b10111110110001011100000000111011"; ram[3224] = "0b10111110110011111110010010010001"; ram[3225] = "0b10111110110110011111000000100010"; ram[3226] = "0b10111110111000111110000110111011"; ram[3227] = "0b10111110111011011011100000101110"; ram[3228] = "0b10111110111101110111001001001101"; ram[3229] = "0b10111111000000001000011101111001"; ram[3230] = "0b10111111000001010100011001111010"; ram[3231] = "0b10111111000010011111010110011011"; ram[3232] = "0b10111111000011101001010001001100"; ram[3233] = "0b10111111000100110010000111111111"; ram[3234] = "0b10111111000101111001111000101011"; ram[3235] = "0b10111111000111000000100001000110"; ram[3236] = "0b10111111001000000101111111001010"; ram[3237] = "0b10111111001001001010010000110011"; ram[3238] = "0b10111111001010001101010011111101"; ram[3239] = "0b10111111001011001111000110101010"; ram[3240] = "0b10111111001100001111100110111100"; ram[3241] = "0b10111111001101001110110010110111"; ram[3242] = "0b10111111001110001100101000100100"; ram[3243] = "0b10111111001111001001000110001101"; ram[3244] = "0b10111111010000000100001001111110"; ram[3245] = "0b10111111010000111101110010000111"; ram[3246] = "0b10111111010001110101111100111010"; ram[3247] = "0b10111111010010101100101000101011"; ram[3248] = "0b10111111010011100001110011110011"; ram[3249] = "0b10111111010100010101011100101100"; ram[3250] = "0b10111111010101000111100001110100"; ram[3251] = "0b10111111010101111000000001101100"; ram[3252] = "0b10111111010110100110111010110110"; ram[3253] = "0b10111111010111010100001011111001"; ram[3254] = "0b10111111010111111111110011100000"; ram[3255] = "0b10111111011000101001110000010111"; ram[3256] = "0b10111111011001010010000001001101"; ram[3257] = "0b10111111011001111000100100110111"; ram[3258] = "0b10111111011010011101011010001011"; ram[3259] = "0b10111111011011000000100000000010"; ram[3260] = "0b10111111011011100001110101011010"; ram[3261] = "0b10111111011100000001011001010011"; ram[3262] = "0b10111111011100011111001010110001"; ram[3263] = "0b10111111011100111011001000111011"; ram[3264] = "0b10111111011101010101010010111100"; ram[3265] = "0b10111111011101101101101000000010"; ram[3266] = "0b10111111011110000100000111011110"; ram[3267] = "0b10111111011110011000110000100111"; ram[3268] = "0b10111111011110101011100010110011"; ram[3269] = "0b10111111011110111100011101100000"; ram[3270] = "0b10111111011111001011100000001110"; ram[3271] = "0b10111111011111011000101010011111"; ram[3272] = "0b10111111011111100011111011111010"; ram[3273] = "0b10111111011111101101010100001011"; ram[3274] = "0b10111111011111110100110010111111"; ram[3275] = "0b10111111011111111010011000001000"; ram[3276] = "0b10111111011111111110000011011011"; ram[3277] = "0b10111111011111111111110100110001"; ram[3278] = "0b10111111011111111111101100000111"; ram[3279] = "0b10111111011111111101101001011110"; ram[3280] = "0b10111111011111111001101100111000"; ram[3281] = "0b10111111011111110011110110011110"; ram[3282] = "0b10111111011111101100000110011011"; ram[3283] = "0b10111111011111100010011100111101"; ram[3284] = "0b10111111011111010110111010010111"; ram[3285] = "0b10111111011111001001011110111111"; ram[3286] = "0b10111111011110111010001011001110"; ram[3287] = "0b10111111011110101000111111100011"; ram[3288] = "0b10111111011110010101111100011100"; ram[3289] = "0b10111111011110000001000010011111"; ram[3290] = "0b10111111011101101010010010010100"; ram[3291] = "0b10111111011101010001101100100110"; ram[3292] = "0b10111111011100110111010010000100"; ram[3293] = "0b10111111011100011011000011100000"; ram[3294] = "0b10111111011011111101000001110000"; ram[3295] = "0b10111111011011011101001101101101"; ram[3296] = "0b10111111011010111011101000010100"; ram[3297] = "0b10111111011010011000010010100101"; ram[3298] = "0b10111111011001110011001101100011"; ram[3299] = "0b10111111011001001100011010010101"; ram[3300] = "0b10111111011000100011111010000101"; ram[3301] = "0b10111111010111111001101110000001"; ram[3302] = "0b10111111010111001101110111011000"; ram[3303] = "0b10111111010110100000010111011110"; ram[3304] = "0b10111111010101110001001111101010"; ram[3305] = "0b10111111010101000000100001010110"; ram[3306] = "0b10111111010100001110001101111110"; ram[3307] = "0b10111111010011011010010111000011"; ram[3308] = "0b10111111010010100100111110000111"; ram[3309] = "0b10111111010001101110000100110001"; ram[3310] = "0b10111111010000110101101100101000"; ram[3311] = "0b10111111001111111011110111011001"; ram[3312] = "0b10111111001111000000100110110001"; ram[3313] = "0b10111111001110000011111100100010"; ram[3314] = "0b10111111001101000101111010011111"; ram[3315] = "0b10111111001100000110100010011110"; ram[3316] = "0b10111111001011000101110110011001"; ram[3317] = "0b10111111001010000011111000001010"; ram[3318] = "0b10111111001001000000101001101111"; ram[3319] = "0b10111111000111111100001101001001"; ram[3320] = "0b10111111000110110110100100011010"; ram[3321] = "0b10111111000101101111110001100110"; ram[3322] = "0b10111111000100100111110110110110"; ram[3323] = "0b10111111000011011110110110010001"; ram[3324] = "0b10111111000010010100110010000011"; ram[3325] = "0b10111111000001001001101100011001"; ram[3326] = "0b10111110111111111011001111000100"; ram[3327] = "0b10111110111101100001001011011111"; ram[3328] = "0b10111110111011000101010010101001"; ram[3329] = "0b10111110111000100111101001001010"; ram[3330] = "0b10111110110110001000010011110000"; ram[3331] = "0b10111110110011100111010111001001"; ram[3332] = "0b10111110110001000100111000001000"; ram[3333] = "0b10111110101110100000111011100100"; ram[3334] = "0b10111110101011111011100110010101"; ram[3335] = "0b10111110101001010100111101010110"; ram[3336] = "0b10111110100110101101000101100101"; ram[3337] = "0b10111110100100000100000100000010"; ram[3338] = "0b10111110100001011001111101101110"; ram[3339] = "0b10111110011101011101101111011111"; ram[3340] = "0b10111110011000000101101110010101"; ram[3341] = "0b10111110010010101100000010010001"; ram[3342] = "0b10111110001101010000110101100100"; ram[3343] = "0b10111110000111110100010010100100"; ram[3344] = "0b10111110000010010110100011101011"; ram[3345] = "0b10111101111001101111100110100100"; ram[3346] = "0b10111101101110110000010111101110"; ram[3347] = "0b10111101100011101111101111101111"; ram[3348] = "0b10111101010001011100000111001110"; ram[3349] = "0b10111100110110101110100001011100"; ram[3350] = "0b10111011101010001100110000011011"; for (unsigned i = 3351; i < 3497 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[3497] = "0b00111100101110110011101001101110"; ram[3498] = "0b00111101001110110010110111101001"; ram[3499] = "0b00111101100011000101001011001001"; ram[3500] = "0b00111101101110101111101111011010"; ram[3501] = "0b00111101111010011000101111101000"; ram[3502] = "0b00111110000010111111111001011101"; ram[3503] = "0b00111110001000110010010000001110"; ram[3504] = "0b00111110001110100011001111101100"; ram[3505] = "0b00111110010100010010101011100100"; ram[3506] = "0b00111110011010000000010111100010"; ram[3507] = "0b00111110011111101100000111011001"; ram[3508] = "0b00111110100010101010110111011111"; ram[3509] = "0b00111110100101011110100001000101"; ram[3510] = "0b00111110101000010000111010011111"; ram[3511] = "0b00111110101011000001111101101110"; ram[3512] = "0b00111110101101110001100100111001"; ram[3513] = "0b00111110110000011111101010000110"; ram[3514] = "0b00111110110011001100000111100011"; ram[3515] = "0b00111110110101110110110111011101"; ram[3516] = "0b00111110111000011111110100000111"; ram[3517] = "0b00111110111011000110110111111001"; ram[3518] = "0b00111110111101101011111101001011"; ram[3519] = "0b00111111000000000111011111001111"; ram[3520] = "0b00111111000001010111111011001010"; ram[3521] = "0b00111111000010100111001111101010"; ram[3522] = "0b00111111000011110101011010000110"; ram[3523] = "0b00111111000101000010010111110111"; ram[3524] = "0b00111111000110001110000110010111"; ram[3525] = "0b00111111000111011000100011000101"; ram[3526] = "0b00111111001000100001101011100010"; ram[3527] = "0b00111111001001101001011101010000"; ram[3528] = "0b00111111001010101111110101110111"; ram[3529] = "0b00111111001011110100110011000000"; ram[3530] = "0b00111111001100111000010010010111"; ram[3531] = "0b00111111001101111010010001101100"; ram[3532] = "0b00111111001110111010101110110001"; ram[3533] = "0b00111111001111111001100111011101"; ram[3534] = "0b00111111010000110110111001101001"; ram[3535] = "0b00111111010001110010100011010010"; ram[3536] = "0b00111111010010101100100010011000"; ram[3537] = "0b00111111010011100100110101000000"; ram[3538] = "0b00111111010100011011011001010000"; ram[3539] = "0b00111111010101010000001101010101"; ram[3540] = "0b00111111010110000011001111011100"; ram[3541] = "0b00111111010110110100011101111001"; ram[3542] = "0b00111111010111100011110111000011"; ram[3543] = "0b00111111011000010001011001010011"; ram[3544] = "0b00111111011000111101000011001010"; ram[3545] = "0b00111111011001100110110011001000"; ram[3546] = "0b00111111011010001110100111110110"; ram[3547] = "0b00111111011010110100011111111101"; ram[3548] = "0b00111111011011011000011010001101"; ram[3549] = "0b00111111011011111010010101011000"; ram[3550] = "0b00111111011100011010010000010111"; ram[3551] = "0b00111111011100111000001010000100"; ram[3552] = "0b00111111011101010100000001100001"; ram[3553] = "0b00111111011101101101110101110000"; ram[3554] = "0b00111111011110000101100101111100"; ram[3555] = "0b00111111011110011011010001010001"; ram[3556] = "0b00111111011110101110110111000000"; ram[3557] = "0b00111111011111000000010110100001"; ram[3558] = "0b00111111011111001111101111001101"; ram[3559] = "0b00111111011111011101000000100011"; ram[3560] = "0b00111111011111101000001010001000"; ram[3561] = "0b00111111011111110001001011100011"; ram[3562] = "0b00111111011111111000000100100000"; ram[3563] = "0b00111111011111111100110100110011"; ram[3564] = "0b00111111011111111111011100001111"; ram[3565] = "0b00111111011111111111111010101111"; ram[3566] = "0b00111111011111111110010000010011"; ram[3567] = "0b00111111011111111010011100111110"; ram[3568] = "0b00111111011111110100100000111000"; ram[3569] = "0b00111111011111101100011100001110"; ram[3570] = "0b00111111011111100010001111010001"; ram[3571] = "0b00111111011111010101111010010111"; ram[3572] = "0b00111111011111000111011101111010"; ram[3573] = "0b00111111011110110110111010011010"; ram[3574] = "0b00111111011110100100010000011001"; ram[3575] = "0b00111111011110001111100000100000"; ram[3576] = "0b00111111011101111000101011011010"; ram[3577] = "0b00111111011101011111110001111010"; ram[3578] = "0b00111111011101000100110100110011"; ram[3579] = "0b00111111011100100111110101000001"; ram[3580] = "0b00111111011100001000110011100000"; ram[3581] = "0b00111111011011100111110001010011"; ram[3582] = "0b00111111011011000100101111100010"; ram[3583] = "0b00111111011010011111101111010110"; ram[3584] = "0b00111111011001111000110001111111"; ram[3585] = "0b00111111011001001111111000110000"; ram[3586] = "0b00111111011000100101000101000010"; ram[3587] = "0b00111111010111111000011000001111"; ram[3588] = "0b00111111010111001001110011110111"; ram[3589] = "0b00111111010110011001011001011110"; ram[3590] = "0b00111111010101100111001010101011"; ram[3591] = "0b00111111010100110011001001001010"; ram[3592] = "0b00111111010011111101010110101011"; ram[3593] = "0b00111111010011000101110101000000"; ram[3594] = "0b00111111010010001100100101111111"; ram[3595] = "0b00111111010001010001101011100101"; ram[3596] = "0b00111111010000010101000111101110"; ram[3597] = "0b00111111001111010110111100011100"; ram[3598] = "0b00111111001110010111001011110101"; ram[3599] = "0b00111111001101010101111000000000"; ram[3600] = "0b00111111001100010011000011001010"; ram[3601] = "0b00111111001011001110101111100001"; ram[3602] = "0b00111111001010001000111111011000"; ram[3603] = "0b00111111001001000001110101000100"; ram[3604] = "0b00111111000111111001010010111101"; ram[3605] = "0b00111111000110101111011011011110"; ram[3606] = "0b00111111000101100100010001000110"; ram[3607] = "0b00111111000100010111110110010101"; ram[3608] = "0b00111111000011001010001101101111"; ram[3609] = "0b00111111000001111011011001111010"; ram[3610] = "0b00111111000000101011011101011110"; ram[3611] = "0b00111110111110110100110110001111"; ram[3612] = "0b00111110111100010000101011000101"; ram[3613] = "0b00111110111001101010011110111110"; ram[3614] = "0b00111110110111000010010111011110"; ram[3615] = "0b00111110110100011000011010001110"; ram[3616] = "0b00111110110001101100101100110111"; ram[3617] = "0b00111110101110111111010101001010"; ram[3618] = "0b00111110101100010000011000111011"; ram[3619] = "0b00111110101001011111111101111110"; ram[3620] = "0b00111110100110101110001010001110"; ram[3621] = "0b00111110100011111011000011100111"; ram[3622] = "0b00111110100001000110110000001001"; ram[3623] = "0b00111110011100100010101011101001"; ram[3624] = "0b00111110010110110101110101011110"; ram[3625] = "0b00111110010001000111001001111100"; ram[3626] = "0b00111110001011010110110101010100"; ram[3627] = "0b00111110000101100101000011111011"; ram[3628] = "0b00111101111111100100000100001101"; ram[3629] = "0b00111101110011111011111000100101"; ram[3630] = "0b00111101101000010001111101110011"; ram[3631] = "0b00111101011001001101011001101011"; ram[3632] = "0b00111101000001110100111101010101"; ram[3633] = "0b00111100001001101101100010011010"; ram[3634] = "0b10111100010011111010001001110010"; ram[3635] = "0b10111101000100011000000001101110"; ram[3636] = "0b10111101011011110000010011001010"; ram[3637] = "0b10111101101001100011010010011000"; ram[3638] = "0b10111101110101001101000010001111"; ram[3639] = "0b10111110000000011010100000001001"; ram[3640] = "0b10111110000110001101011001110010"; ram[3641] = "0b10111110001011111111000001101011"; ram[3642] = "0b10111110010001101111001011011101"; ram[3643] = "0b10111110010111011101101010110011"; ram[3644] = "0b10111110011101001010010011011101"; ram[3645] = "0b10111110100001011010011100101000"; ram[3646] = "0b10111110100100001110101000000001"; ram[3647] = "0b10111110100111000001100101111001"; ram[3648] = "0b10111110101001110011010000010000"; ram[3649] = "0b10111110101100100011100001001011"; ram[3650] = "0b10111110101111010010010010110000"; ram[3651] = "0b10111110110001111111011111001001"; ram[3652] = "0b10111110110100101011000000100100"; ram[3653] = "0b10111110110111010100110001010001"; ram[3654] = "0b10111110111001111100101011100110"; ram[3655] = "0b10111110111100100010101001111011"; ram[3656] = "0b10111110111111000110100110101100"; ram[3657] = "0b10111111000000110100001110001110"; ram[3658] = "0b10111111000010000100000010111000"; ram[3659] = "0b10111111000011010010101110101001"; ram[3660] = "0b10111111000100100000001110111000"; ram[3661] = "0b10111111000101101100100001000001"; ram[3662] = "0b10111111000110110111100010011111"; ram[3663] = "0b10111111001000000001010000110010"; ram[3664] = "0b10111111001001001001101001011100"; ram[3665] = "0b10111111001010010000101010000011"; ram[3666] = "0b10111111001011010110010000001111"; ram[3667] = "0b10111111001100011010011001101010"; ram[3668] = "0b10111111001101011101000100000010"; ram[3669] = "0b10111111001110011110001101001010"; ram[3670] = "0b10111111001111011101110010110110"; ram[3671] = "0b10111111010000011011110010111101"; ram[3672] = "0b10111111010001011000001011011011"; ram[3673] = "0b10111111010010010010111010001111"; ram[3674] = "0b10111111010011001011111101011011"; ram[3675] = "0b10111111010100000011010011000101"; ram[3676] = "0b10111111010100111000111001010110"; ram[3677] = "0b10111111010101101100101110011100"; ram[3678] = "0b10111111010110011110110000101001"; ram[3679] = "0b10111111010111001110111110010000"; ram[3680] = "0b10111111010111111101010101101011"; ram[3681] = "0b10111111011000101001110101010111"; ram[3682] = "0b10111111011001010100011011110100"; ram[3683] = "0b10111111011001111101000111100111"; ram[3684] = "0b10111111011010100011110111011001"; ram[3685] = "0b10111111011011001000101001110111"; ram[3686] = "0b10111111011011101011011101110011"; ram[3687] = "0b10111111011100001100010010000010"; ram[3688] = "0b10111111011100101011000101011110"; ram[3689] = "0b10111111011101000111110111000100"; ram[3690] = "0b10111111011101100010100101111000"; ram[3691] = "0b10111111011101111011010001000000"; ram[3692] = "0b10111111011110010001110111100111"; ram[3693] = "0b10111111011110100110011000111101"; ram[3694] = "0b10111111011110111000110100010110"; ram[3695] = "0b10111111011111001001001001001011"; ram[3696] = "0b10111111011111010111010110111000"; ram[3697] = "0b10111111011111100011011101000000"; ram[3698] = "0b10111111011111101101011011000111"; ram[3699] = "0b10111111011111110101010000111010"; ram[3700] = "0b10111111011111111010111110000111"; ram[3701] = "0b10111111011111111110100010100010"; ram[3702] = "0b10111111011111111111111110000100"; ram[3703] = "0b10111111011111111111010000101001"; ram[3704] = "0b10111111011111111100011010010010"; ram[3705] = "0b10111111011111110111011011000111"; ram[3706] = "0b10111111011111110000010011010001"; ram[3707] = "0b10111111011111100111000011000000"; ram[3708] = "0b10111111011111011011101010100111"; ram[3709] = "0b10111111011111001110001010100000"; ram[3710] = "0b10111111011110111110100011000111"; ram[3711] = "0b10111111011110101100110100111100"; ram[3712] = "0b10111111011110011001000000100111"; ram[3713] = "0b10111111011110000011000110110010"; ram[3714] = "0b10111111011101101011001000001011"; ram[3715] = "0b10111111011101010001000101100110"; ram[3716] = "0b10111111011100110100111111111011"; ram[3717] = "0b10111111011100010110111000000101"; ram[3718] = "0b10111111011011110110101111000101"; ram[3719] = "0b10111111011011010100100110000000"; ram[3720] = "0b10111111011010110000011101111111"; ram[3721] = "0b10111111011010001010011000010000"; ram[3722] = "0b10111111011001100010010110000011"; ram[3723] = "0b10111111011000111000011000101110"; ram[3724] = "0b10111111011000001100100001101100"; ram[3725] = "0b10111111010111011110110010011010"; ram[3726] = "0b10111111010110101111001100011001"; ram[3727] = "0b10111111010101111101110001010001"; ram[3728] = "0b10111111010101001010100010101001"; ram[3729] = "0b10111111010100010101100010010001"; ram[3730] = "0b10111111010011011110110001111010"; ram[3731] = "0b10111111010010100110010011011000"; ram[3732] = "0b10111111010001101100001000100101"; ram[3733] = "0b10111111010000110000010011011101"; ram[3734] = "0b10111111001111110010110110000000"; ram[3735] = "0b10111111001110110011110010010010"; ram[3736] = "0b10111111001101110011001010011001"; ram[3737] = "0b10111111001100110001000000100000"; ram[3738] = "0b10111111001011101101010110110100"; ram[3739] = "0b10111111001010101000001111100110"; ram[3740] = "0b10111111001001100001101101001011"; ram[3741] = "0b10111111001000011001110001111000"; ram[3742] = "0b10111111000111010000100000001000"; ram[3743] = "0b10111111000110000101111010011000"; ram[3744] = "0b10111111000100111010000011001000"; ram[3745] = "0b10111111000011101100111100111000"; ram[3746] = "0b10111111000010011110101010010000"; ram[3747] = "0b10111111000001001111001101110101"; ram[3748] = "0b10111110111111111101010100100110"; ram[3749] = "0b10111110111101011010000100101010"; ram[3750] = "0b10111110111010110100110001010101"; ram[3751] = "0b10111110111000001101100000000111"; ram[3752] = "0b10111110110101100100010110101000"; ram[3753] = "0b10111110110010111001011010100001"; ram[3754] = "0b10111110110000001100110001011111"; ram[3755] = "0b10111110101101011110100001010100"; ram[3756] = "0b10111110101010101110101111110101"; ram[3757] = "0b10111110100111111101100010111011"; ram[3758] = "0b10111110100101001011000000011111"; ram[3759] = "0b10111110100010010111001110100001"; ram[3760] = "0b10111110011111000100100110000010"; ram[3761] = "0b10111110011001011000101000000101"; ram[3762] = "0b10111110010011101010101111010100"; ram[3763] = "0b10111110001101111011001000000000"; ram[3764] = "0b10111110001000001001111110011010"; ram[3765] = "0b10111110000010010111011110111001"; ram[3766] = "0b10111101111001000111101011101100"; ram[3767] = "0b10111101101101011110011111010111"; ram[3768] = "0b10111101100001110011110001101101"; ram[3769] = "0b10111101001100001111110111011100"; ram[3770] = "0b10111100101001101101011001100011"; for (unsigned i = 3771; i < 3934 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[3934] = "0b00111100110001100101101110101011"; ram[3935] = "0b00111101010001100100110011001000"; ram[3936] = "0b00111101100101001010011011111011"; ram[3937] = "0b00111101110001100001000101000001"; ram[3938] = "0b00111101111101110101110111001100"; ram[3939] = "0b00111110000101000100001010011010"; ram[3940] = "0b00111110001011001100000000001101"; ram[3941] = "0b00111110010001010010001110010001"; ram[3942] = "0b00111110010111010110100101111101"; ram[3943] = "0b00111110011101011000111000101100"; ram[3944] = "0b00111110100001101100011100000000"; ram[3945] = "0b00111110100100101011001010101110"; ram[3946] = "0b00111110100111101000100001010110"; ram[3947] = "0b00111110101010100100011000110010"; ram[3948] = "0b00111110101101011110101001111111"; ram[3949] = "0b00111110110000010111001101111101"; ram[3950] = "0b00111110110011001101111101110000"; ram[3951] = "0b00111110110110000010110010100010"; ram[3952] = "0b00111110111000110101100101100001"; ram[3953] = "0b00111110111011100110001111111111"; ram[3954] = "0b00111110111110010100101011010100"; ram[3955] = "0b00111111000000100000011000011110"; ram[3956] = "0b00111111000001110101001101001110"; ram[3957] = "0b00111111000011001000110000101101"; ram[3958] = "0b00111111000100011010111111110011"; ram[3959] = "0b00111111000101101011110111011010"; ram[3960] = "0b00111111000110111011010100100001"; ram[3961] = "0b00111111001000001001010100000111"; ram[3962] = "0b00111111001001010101110011010011"; ram[3963] = "0b00111111001010100000101111001100"; ram[3964] = "0b00111111001011101010000100111110"; ram[3965] = "0b00111111001100110001110001111001"; ram[3966] = "0b00111111001101110111110011010001"; ram[3967] = "0b00111111001110111100000110011110"; ram[3968] = "0b00111111001111111110101000111011"; ram[3969] = "0b00111111010000111111011000001001"; ram[3970] = "0b00111111010001111110010001101100"; ram[3971] = "0b00111111010010111011010011001110"; ram[3972] = "0b00111111010011110110011010011011"; ram[3973] = "0b00111111010100101111100101000111"; ram[3974] = "0b00111111010101100110110001000110"; ram[3975] = "0b00111111010110011011111100010101"; ram[3976] = "0b00111111010111001111000100110101"; ram[3977] = "0b00111111011000000000001000101010"; ram[3978] = "0b00111111011000101111000101111110"; ram[3979] = "0b00111111011001011011111011000001"; ram[3980] = "0b00111111011010000110100110000111"; ram[3981] = "0b00111111011010101111000101101010"; ram[3982] = "0b00111111011011010101011000001000"; ram[3983] = "0b00111111011011111001011100000101"; ram[3984] = "0b00111111011100011011010000001011"; ram[3985] = "0b00111111011100111010110011001000"; ram[3986] = "0b00111111011101011000000011110001"; ram[3987] = "0b00111111011101110011000001000000"; ram[3988] = "0b00111111011110001011101001110011"; ram[3989] = "0b00111111011110100001111101010000"; ram[3990] = "0b00111111011110110101111010100001"; ram[3991] = "0b00111111011111000111100000110101"; ram[3992] = "0b00111111011111010110101111100100"; ram[3993] = "0b00111111011111100011100110001000"; ram[3994] = "0b00111111011111101110000100000010"; ram[3995] = "0b00111111011111110110001000111001"; ram[3996] = "0b00111111011111111011110100011010"; ram[3997] = "0b00111111011111111111000110010111"; ram[3998] = "0b00111111011111111111111110101000"; ram[3999] = "0b00111111011111111110011101001011"; ram[4000] = "0b00111111011111111010100010000100"; ram[4001] = "0b00111111011111110100001101011101"; ram[4002] = "0b00111111011111101011011111100011"; ram[4003] = "0b00111111011111100000011000101101"; ram[4004] = "0b00111111011111010010111001010110"; ram[4005] = "0b00111111011111000011000001111100"; ram[4006] = "0b00111111011110110000110011000111"; ram[4007] = "0b00111111011110011100001101100010"; ram[4008] = "0b00111111011110000101010001111111"; ram[4009] = "0b00111111011101101100000001010101"; ram[4010] = "0b00111111011101010000011100100001"; ram[4011] = "0b00111111011100110010100100100100"; ram[4012] = "0b00111111011100010010011010100110"; ram[4013] = "0b00111111011011101111111111110110"; ram[4014] = "0b00111111011011001011010101100100"; ram[4015] = "0b00111111011010100100011101001011"; ram[4016] = "0b00111111011001111011011000000101"; ram[4017] = "0b00111111011001010000000111111000"; ram[4018] = "0b00111111011000100010101110001010"; ram[4019] = "0b00111111010111110011001100101000"; ram[4020] = "0b00111111010111000001100101000101"; ram[4021] = "0b00111111010110001101111001010111"; ram[4022] = "0b00111111010101011000001011011100"; ram[4023] = "0b00111111010100100000011101010011"; ram[4024] = "0b00111111010011100110110001000011"; ram[4025] = "0b00111111010010101011001000110110"; ram[4026] = "0b00111111010001101101100110111100"; ram[4027] = "0b00111111010000101110001101101000"; ram[4028] = "0b00111111001111101100111111010011"; ram[4029] = "0b00111111001110101001111110011001"; ram[4030] = "0b00111111001101100101001101011011"; ram[4031] = "0b00111111001100011110101110111110"; ram[4032] = "0b00111111001011010110100101101100"; ram[4033] = "0b00111111001010001100110100010010"; ram[4034] = "0b00111111001001000001011101100001"; ram[4035] = "0b00111111000111110100100100001110"; ram[4036] = "0b00111111000110100110001011010010"; ram[4037] = "0b00111111000101010110010101101001"; ram[4038] = "0b00111111000100000101000110010011"; ram[4039] = "0b00111111000010110010100000010010"; ram[4040] = "0b00111111000001011110100110101110"; ram[4041] = "0b00111111000000001001011100110000"; ram[4042] = "0b00111110111101100110001011001000"; ram[4043] = "0b00111110111010110111001000110100"; ram[4044] = "0b00111110111000000101111001000111"; ram[4045] = "0b00111110110101010010100010101101"; ram[4046] = "0b00111110110010011101001100010010"; ram[4047] = "0b00111110101111100101111100101100"; ram[4048] = "0b00111110101100101100111010110010"; ram[4049] = "0b00111110101001110010001101100000"; ram[4050] = "0b00111110100110110101111011110111"; ram[4051] = "0b00111110100011111000001100111100"; ram[4052] = "0b00111110100000111001000111110101"; ram[4053] = "0b00111110011011110001100111011101"; ram[4054] = "0b00111110010101101110101111101011"; ram[4055] = "0b00111110001111101001110110110110"; ram[4056] = "0b00111110001001100011001011100011"; ram[4057] = "0b00111110000011011010111100011110"; ram[4058] = "0b00111101111010100010110000100111"; ram[4059] = "0b00111101101110001101011011101011"; ram[4060] = "0b00111101100001110110010111110000"; ram[4061] = "0b00111101001010111100000101000011"; ram[4062] = "0b00111100100100010011100110111100"; ram[4063] = "0b10111011110101001001001101101101"; ram[4064] = "0b10111100111110110111101101111000"; ram[4065] = "0b10111101011000001101011000101010"; ram[4066] = "0b10111101101000011110011001101100"; ram[4067] = "0b10111101110100110100100101110101"; ram[4068] = "0b10111110000000100100011001100011"; ram[4069] = "0b10111110000110101101010001111110"; ram[4070] = "0b10111110001100110100101101011010"; ram[4071] = "0b10111110010010111010011101001100"; ram[4072] = "0b10111110011000111110010010101100"; ram[4073] = "0b10111110011110111111111111010110"; ram[4074] = "0b10111110100010011111101010010110"; ram[4075] = "0b10111110100101011110000010001011"; ram[4076] = "0b10111110101000011011000000000000"; ram[4077] = "0b10111110101011010110011100101111"; ram[4078] = "0b10111110101110010000010001010110"; ram[4079] = "0b10111110110001001000010110111000"; ram[4080] = "0b10111110110011111110100110011001"; ram[4081] = "0b10111110110110110010111001000100"; ram[4082] = "0b10111110111001100101001000001000"; ram[4083] = "0b10111110111100010101001100111010"; ram[4084] = "0b10111110111111000011000000110001"; ram[4085] = "0b10111111000000110111001110100110"; ram[4086] = "0b10111111000010001011101101111001"; ram[4087] = "0b10111111000011011110111011000100"; ram[4088] = "0b10111111000100110000110011000010"; ram[4089] = "0b10111111000110000001010010101100"; ram[4090] = "0b10111111000111010000010111000010"; ram[4091] = "0b10111111001000011101111101000110"; ram[4092] = "0b10111111001001101010000001111101"; ram[4093] = "0b10111111001010110100100010110000"; ram[4094] = "0b10111111001011111101011100101110"; ram[4095] = "0b10111111001101000100101101000101"; ram[4096] = "0b10111111001110001010010001001101"; ram[4097] = "0b10111111001111001110000110011100"; ram[4098] = "0b10111111010000010000001010010001"; ram[4099] = "0b10111111010001010000011010001101"; ram[4100] = "0b10111111010010001110110011110101"; ram[4101] = "0b10111111010011001011010100110100"; ram[4102] = "0b10111111010100000101111010111000"; ram[4103] = "0b10111111010100111110100011110100"; ram[4104] = "0b10111111010101110101001101100001"; ram[4105] = "0b10111111010110101001110101111011"; ram[4106] = "0b10111111010111011100011011000100"; ram[4107] = "0b10111111011000001100111011000010"; ram[4108] = "0b10111111011000111011010100000001"; ram[4109] = "0b10111111011001100111100100010001"; ram[4110] = "0b10111111011010010001101010001000"; ram[4111] = "0b10111111011010111001100100000001"; ram[4112] = "0b10111111011011011111010000011100"; ram[4113] = "0b10111111011100000010101101111111"; ram[4114] = "0b10111111011100100011111011010101"; ram[4115] = "0b10111111011101000010110111001100"; ram[4116] = "0b10111111011101011111100000011101"; ram[4117] = "0b10111111011101111001110110000001"; ram[4118] = "0b10111111011110010001110110111001"; ram[4119] = "0b10111111011110100111100010001100"; ram[4120] = "0b10111111011110111010110111000101"; ram[4121] = "0b10111111011111001011110100110110"; ram[4122] = "0b10111111011111011010011010110111"; ram[4123] = "0b10111111011111100110101000100100"; ram[4124] = "0b10111111011111110000011101100001"; ram[4125] = "0b10111111011111110111111001010100"; ram[4126] = "0b10111111011111111100111011101101"; ram[4127] = "0b10111111011111111111100100100000"; ram[4128] = "0b10111111011111111111110011100110"; ram[4129] = "0b10111111011111111101101000111110"; ram[4130] = "0b10111111011111111001000100101110"; ram[4131] = "0b10111111011111110010000111000001"; ram[4132] = "0b10111111011111101000110000000111"; ram[4133] = "0b10111111011111011101000000010111"; ram[4134] = "0b10111111011111001110111000001101"; ram[4135] = "0b10111111011110111110011000001011"; ram[4136] = "0b10111111011110101011100000111001"; ram[4137] = "0b10111111011110010110010011000100"; ram[4138] = "0b10111111011101111110101111011111"; ram[4139] = "0b10111111011101100100110111000010"; ram[4140] = "0b10111111011101001000101010101100"; ram[4141] = "0b10111111011100101010001011100001"; ram[4142] = "0b10111111011100001001011010101001"; ram[4143] = "0b10111111011011100110011001010011"; ram[4144] = "0b10111111011011000001001000110100"; ram[4145] = "0b10111111011010011001101010100101"; ram[4146] = "0b10111111011001110000000000000101"; ram[4147] = "0b10111111011001000100001010110111"; ram[4148] = "0b10111111011000010110001100100110"; ram[4149] = "0b10111111010111100110000110111111"; ram[4150] = "0b10111111010110110011111011110110"; ram[4151] = "0b10111111010101111111101101000011"; ram[4152] = "0b10111111010101001001011100100100"; ram[4153] = "0b10111111010100010001001100011100"; ram[4154] = "0b10111111010011010110111110110001"; ram[4155] = "0b10111111010010011010110101110000"; ram[4156] = "0b10111111010001011100110011101000"; ram[4157] = "0b10111111010000011100111010101110"; ram[4158] = "0b10111111001111011011001101011101"; ram[4159] = "0b10111111001110010111101110010010"; ram[4160] = "0b10111111001101010010011111101110"; ram[4161] = "0b10111111001100001011100100011001"; ram[4162] = "0b10111111001011000010111110111101"; ram[4163] = "0b10111111001001111000110010000111"; ram[4164] = "0b10111111001000101101000000101011"; ram[4165] = "0b10111111000111011111101101011110"; ram[4166] = "0b10111111000110010000111011011010"; ram[4167] = "0b10111111000101000000101101011100"; ram[4168] = "0b10111111000011101111000110100100"; ram[4169] = "0b10111111000010011100001001111000"; ram[4170] = "0b10111111000001000111111010011101"; ram[4171] = "0b10111110111111100100110110111110"; ram[4172] = "0b10111110111100110111100000010100"; ram[4173] = "0b10111110111010000111110111011111"; ram[4174] = "0b10111110110111010110000011000010"; ram[4175] = "0b10111110110100100010001001101011"; ram[4176] = "0b10111110110001101100010010001000"; ram[4177] = "0b10111110101110110100100011001110"; ram[4178] = "0b10111110101011111011000011110111"; ram[4179] = "0b10111110101000111111111011000001"; ram[4180] = "0b10111110100110000011001111101100"; ram[4181] = "0b10111110100011000101001000111110"; ram[4182] = "0b10111110100000000101101110000000"; ram[4183] = "0b10111110011010001010001011111010"; ram[4184] = "0b10111110010100000110110000001000"; ram[4185] = "0b10111110001110000001010111001101"; ram[4186] = "0b10111110000111111010001111101111"; ram[4187] = "0b10111110000001110001101000011010"; ram[4188] = "0b10111101110111001111011111111011"; ram[4189] = "0b10111101101010111001101010010111"; ram[4190] = "0b10111101011101000100011011011110"; ram[4191] = "0b10111101000100010011001111100100"; ram[4192] = "0b10111100001110000010110001110111"; for (unsigned i = 4193; i < 4371 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[4371] = "0b00111100110100100010011010100001"; ram[4372] = "0b00111101010100100001010011101101"; ram[4373] = "0b00111101100111010111100110010001"; ram[4374] = "0b00111101110100011100111000100100"; ram[4375] = "0b00111110000000101111111110101110"; ram[4376] = "0b00111110000111010000001000110111"; ram[4377] = "0b00111110001101101110101001001100"; ram[4378] = "0b00111110010100001011001110001111"; ram[4379] = "0b00111110011010100101100110100111"; ram[4380] = "0b00111110100000011110110000100001"; ram[4381] = "0b00111110100011101001010110001011"; ram[4382] = "0b00111110100110110010011011101110"; ram[4383] = "0b00111110101001111001111000101100"; ram[4384] = "0b00111110101100111111100100101101"; ram[4385] = "0b00111110110000000011010111011010"; ram[4386] = "0b00111110110011000101001000100100"; ram[4387] = "0b00111110110110000100110000000000"; ram[4388] = "0b00111110111001000010000101101010"; ram[4389] = "0b00111110111011111101000001100100"; ram[4390] = "0b00111110111110110101011011110110"; ram[4391] = "0b00111111000000110101100110010111"; ram[4392] = "0b00111111000010001111000110010001"; ram[4393] = "0b00111111000011100111001001111000"; ram[4394] = "0b00111111000100111101101101011110"; ram[4395] = "0b00111111000110010010101101011011"; ram[4396] = "0b00111111000111100110000110001000"; ram[4397] = "0b00111111001000110111110100000110"; ram[4398] = "0b00111111001010000111110011111000"; ram[4399] = "0b00111111001011010110000010000101"; ram[4400] = "0b00111111001100100010011011011100"; ram[4401] = "0b00111111001101101100111100101111"; ram[4402] = "0b00111111001110110101100010110100"; ram[4403] = "0b00111111001111111100001010100111"; ram[4404] = "0b00111111010001000000110001001011"; ram[4405] = "0b00111111010010000011010011100111"; ram[4406] = "0b00111111010011000011101111000110"; ram[4407] = "0b00111111010100000010000000111011"; ram[4408] = "0b00111111010100111110000110011111"; ram[4409] = "0b00111111010101110111111101010000"; ram[4410] = "0b00111111010110101111100010110001"; ram[4411] = "0b00111111010111100100110100101100"; ram[4412] = "0b00111111011000010111110000110011"; ram[4413] = "0b00111111011001001000010100111011"; ram[4414] = "0b00111111011001110110011111000001"; ram[4415] = "0b00111111011010100010001101001010"; ram[4416] = "0b00111111011011001011011101011111"; ram[4417] = "0b00111111011011110010001110010010"; ram[4418] = "0b00111111011100010110011101111001"; ram[4419] = "0b00111111011100111000001010110011"; ram[4420] = "0b00111111011101010111010011100101"; ram[4421] = "0b00111111011101110011110110111011"; ram[4422] = "0b00111111011110001101110011101000"; ram[4423] = "0b00111111011110100101001000100111"; ram[4424] = "0b00111111011110111001110100111000"; ram[4425] = "0b00111111011111001011110111100011"; ram[4426] = "0b00111111011111011011001111111000"; ram[4427] = "0b00111111011111100111111101001110"; ram[4428] = "0b00111111011111110001111111000010"; ram[4429] = "0b00111111011111111001010100111000"; ram[4430] = "0b00111111011111111101111110011111"; ram[4431] = "0b00111111011111111111111011101000"; ram[4432] = "0b00111111011111111111001100001110"; ram[4433] = "0b00111111011111111011110000010100"; ram[4434] = "0b00111111011111110101101000000011"; ram[4435] = "0b00111111011111101100110011101011"; ram[4436] = "0b00111111011111100001010011100100"; ram[4437] = "0b00111111011111010011001000001110"; ram[4438] = "0b00111111011111000010010010001101"; ram[4439] = "0b00111111011110101110110010010001"; ram[4440] = "0b00111111011110011000101001001100"; ram[4441] = "0b00111111011101111111110111111100"; ram[4442] = "0b00111111011101100100011111100010"; ram[4443] = "0b00111111011101000110100001001001"; ram[4444] = "0b00111111011100100101111110000001"; ram[4445] = "0b00111111011100000010110111100011"; ram[4446] = "0b00111111011011011101001111001100"; ram[4447] = "0b00111111011010110101000110100010"; ram[4448] = "0b00111111011010001010011111010010"; ram[4449] = "0b00111111011001011101011011001110"; ram[4450] = "0b00111111011000101101111100010000"; ram[4451] = "0b00111111010111111100000100011000"; ram[4452] = "0b00111111010111000111110101101100"; ram[4453] = "0b00111111010110010001010010011001"; ram[4454] = "0b00111111010101011000011100110010"; ram[4455] = "0b00111111010100011101010111010001"; ram[4456] = "0b00111111010011100000000100010100"; ram[4457] = "0b00111111010010100000100110100001"; ram[4458] = "0b00111111010001011111000000100100"; ram[4459] = "0b00111111010000011011010101001100"; ram[4460] = "0b00111111001111010101100111010000"; ram[4461] = "0b00111111001110001101111001101101"; ram[4462] = "0b00111111001101000100001111100011"; ram[4463] = "0b00111111001011111000101011111010"; ram[4464] = "0b00111111001010101011010001111100"; ram[4465] = "0b00111111001001011100000100111011"; ram[4466] = "0b00111111001000001011001000001100"; ram[4467] = "0b00111111000110111000011111001001"; ram[4468] = "0b00111111000101100100001101010010"; ram[4469] = "0b00111111000100001110010110001000"; ram[4470] = "0b00111111000010110110111101010101"; ram[4471] = "0b00111111000001011110000110100011"; ram[4472] = "0b00111111000000000011110101100010"; ram[4473] = "0b00111110111101010000011100001011"; ram[4474] = "0b00111110111010010110101000001001"; ram[4475] = "0b00111110110111011010010110110001"; ram[4476] = "0b00111110110100011011110000000010"; ram[4477] = "0b00111110110001011010111011111011"; ram[4478] = "0b00111110101110011000000010100101"; ram[4479] = "0b00111110101011010011001100001101"; ram[4480] = "0b00111110101000001100100001000110"; ram[4481] = "0b00111110100101000100001001101000"; ram[4482] = "0b00111110100001111010001110001110"; ram[4483] = "0b00111110011101011101101110110100"; ram[4484] = "0b00111110010111000100011011011110"; ram[4485] = "0b00111110010000101000110011101011"; ram[4486] = "0b00111110001010001011001000101111"; ram[4487] = "0b00111110000011101011101100000111"; ram[4488] = "0b00111101111010010101011110100100"; ram[4489] = "0b00111101101101010001000111101000"; ram[4490] = "0b00111101100000001010110110101010"; ram[4491] = "0b00111101000110000110011101111011"; ram[4492] = "0b00111100001111010110011111010001"; ram[4493] = "0b10111100011001101110111000110110"; ram[4494] = "0b10111101001000101100011101010101"; ram[4495] = "0b10111101100001011101101111010111"; ram[4496] = "0b10111101101110100011110101110110"; ram[4497] = "0b10111101111011100111111110110011"; ram[4498] = "0b10111110000100010100110011100000"; ram[4499] = "0b10111110001010110100000101101100"; ram[4500] = "0b10111110010001010001100100011100"; ram[4501] = "0b10111110010111101100111110010110"; ram[4502] = "0b10111110011110000110000010000101"; ram[4503] = "0b10111110100010001110001111001101"; ram[4504] = "0b10111110100101011000000001000111"; ram[4505] = "0b10111110101000100000001110010000"; ram[4506] = "0b10111110101011100110101110001100"; ram[4507] = "0b10111110101110101011011000100101"; ram[4508] = "0b10111110110001101110000101001000"; ram[4509] = "0b10111110110100101110101011101000"; ram[4510] = "0b10111110110111101101000011111110"; ram[4511] = "0b10111110111010101001000110001001"; ram[4512] = "0b10111110111101100010101010001110"; ram[4513] = "0b10111111000000001100110100001100"; ram[4514] = "0b10111111000001100110111100011101"; ram[4515] = "0b10111111000010111111101010000111"; ram[4516] = "0b10111111000100010110111001011100"; ram[4517] = "0b10111111000101101100100110101111"; ram[4518] = "0b10111111000111000000101110011010"; ram[4519] = "0b10111111001000010011001100111001"; ram[4520] = "0b10111111001001100011111110110000"; ram[4521] = "0b10111111001010110011000000100011"; ram[4522] = "0b10111111001100000000001110111101"; ram[4523] = "0b10111111001101001011100110110000"; ram[4524] = "0b10111111001110010101000100101110"; ram[4525] = "0b10111111001111011100100101110011"; ram[4526] = "0b10111111010000100010000110111110"; ram[4527] = "0b10111111010001100101100101010010"; ram[4528] = "0b10111111010010100110111101111011"; ram[4529] = "0b10111111010011100110001110000111"; ram[4530] = "0b10111111010100100011010011001101"; ram[4531] = "0b10111111010101011110001010100111"; ram[4532] = "0b10111111010110010110110001111000"; ram[4533] = "0b10111111010111001101000110100101"; ram[4534] = "0b10111111011000000001000110011110"; ram[4535] = "0b10111111011000110010101111010101"; ram[4536] = "0b10111111011001100001111111000101"; ram[4537] = "0b10111111011010001110110011101111"; ram[4538] = "0b10111111011010111001001011011001"; ram[4539] = "0b10111111011011100001000100010010"; ram[4540] = "0b10111111011100000110011100101110"; ram[4541] = "0b10111111011100101001010011001000"; ram[4542] = "0b10111111011101001001100110000010"; ram[4543] = "0b10111111011101100111010100000101"; ram[4544] = "0b10111111011110000010011100000001"; ram[4545] = "0b10111111011110011010111100101100"; ram[4546] = "0b10111111011110110000110101000110"; ram[4547] = "0b10111111011111000100000100010010"; ram[4548] = "0b10111111011111010100101001011110"; ram[4549] = "0b10111111011111100010100011111011"; ram[4550] = "0b10111111011111101101110011000101"; ram[4551] = "0b10111111011111110110010110011110"; ram[4552] = "0b10111111011111111100001101101110"; ram[4553] = "0b10111111011111111111011000100110"; ram[4554] = "0b10111111011111111111110110111100"; ram[4555] = "0b10111111011111111101101000110000"; ram[4556] = "0b10111111011111111000101110001000"; ram[4557] = "0b10111111011111110001000111010001"; ram[4558] = "0b10111111011111100110110100011111"; ram[4559] = "0b10111111011111011001110110001111"; ram[4560] = "0b10111111011111001010001101000011"; ram[4561] = "0b10111111011110110111111001100101"; ram[4562] = "0b10111111011110100010111100100111"; ram[4563] = "0b10111111011110001011010111000001"; ram[4564] = "0b10111111011101110001001001110010"; ram[4565] = "0b10111111011101010100010110000011"; ram[4566] = "0b10111111011100110100111100111111"; ram[4567] = "0b10111111011100010010111111111100"; ram[4568] = "0b10111111011011101110100000010110"; ram[4569] = "0b10111111011011000111011111101110"; ram[4570] = "0b10111111011010011101111111101101"; ram[4571] = "0b10111111011001110010000010000101"; ram[4572] = "0b10111111011001000011101000101011"; ram[4573] = "0b10111111011000010010110101011100"; ram[4574] = "0b10111111010111011111101010011100"; ram[4575] = "0b10111111010110101010001001110101"; ram[4576] = "0b10111111010101110010010101110111"; ram[4577] = "0b10111111010100111000010000111001"; ram[4578] = "0b10111111010011111011111101010110"; ram[4579] = "0b10111111010010111101011101110011"; ram[4580] = "0b10111111010001111100110100110110"; ram[4581] = "0b10111111010000111010000101010000"; ram[4582] = "0b10111111001111110101010001110010"; ram[4583] = "0b10111111001110101110011101011000"; ram[4584] = "0b10111111001101100101101010111111"; ram[4585] = "0b10111111001100011010111101101100"; ram[4586] = "0b10111111001011001110011000101001"; ram[4587] = "0b10111111001001111111111111000100"; ram[4588] = "0b10111111001000101111110100010000"; ram[4589] = "0b10111111000111011101111011100101"; ram[4590] = "0b10111111000110001010011000100001"; ram[4591] = "0b10111111000100110101001110100100"; ram[4592] = "0b10111111000011011110100001010100"; ram[4593] = "0b10111111000010000110010100011011"; ram[4594] = "0b10111111000000101100101011100110"; ram[4595] = "0b10111110111110100011010101010000"; ram[4596] = "0b10111110111011101010101010101010"; ram[4597] = "0b10111110111000101111011111001110"; ram[4598] = "0b10111110110101110001111010110010"; ram[4599] = "0b10111110110010110010000101011000"; ram[4600] = "0b10111110101111110000000111000100"; ram[4601] = "0b10111110101100101100001000000000"; ram[4602] = "0b10111110101001100110010000011110"; ram[4603] = "0b10111110100110011110101000110010"; ram[4604] = "0b10111110100011010101011001010111"; ram[4605] = "0b10111110100000001010101010101100"; ram[4606] = "0b10111110011001111101001010100100"; ram[4607] = "0b10111110010011100010100011100001"; ram[4608] = "0b10111110001101000101110001100001"; ram[4609] = "0b10111110000110100111000101111110"; ram[4610] = "0b10111110000000000110110010010100"; ram[4611] = "0b10111101110011001010010000001101"; ram[4612] = "0b10111101100110000100110001110111"; ram[4613] = "0b10111101010001111011011001101111"; ram[4614] = "0b10111100101111010110010010010011"; for (unsigned i = 4615; i < 4808 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } ram[4808] = "0b00111100110111101010010111000100"; ram[4809] = "0b00111101010111101001000010110110"; ram[4810] = "0b00111101101001101101001000111001"; ram[4811] = "0b00111101110111100011110010001001"; ram[4812] = "0b00111110000010101011111001101001"; ram[4813] = "0b00111110001001100100010001001111"; ram[4814] = "0b00111110010000011010101011000010"; ram[4815] = "0b00111110010111001110110010010101"; ram[4816] = "0b00111110011110000000010010011110"; ram[4817] = "0b00111110100010010111011011100000"; ram[4818] = "0b00111110100101101101000101110000"; ram[4819] = "0b00111110101001000000111101111010"; ram[4820] = "0b00111110101100010010111001111100"; ram[4821] = "0b00111110101111100010101111111100"; ram[4822] = "0b00111110110010110000010110000011"; ram[4823] = "0b00111110110101111011100010100101"; ram[4824] = "0b00111110111001000100001011111001"; ram[4825] = "0b00111110111100001010001000100001"; ram[4826] = "0b00111110111111001101001111000110"; ram[4827] = "0b00111111000001000110101011001101"; ram[4828] = "0b00111111000010100101001010101011"; ram[4829] = "0b00111111000100000010000001100000"; ram[4830] = "0b00111111000101011101001011010010"; ram[4831] = "0b00111111000110110110100011101110"; ram[4832] = "0b00111111001000001110000110100101"; ram[4833] = "0b00111111001001100011101111101110"; ram[4834] = "0b00111111001010110111011011000111"; ram[4835] = "0b00111111001100001001000100110001"; ram[4836] = "0b00111111001101011000101000110110"; ram[4837] = "0b00111111001110100110000011100101"; ram[4838] = "0b00111111001111110001010001010100"; ram[4839] = "0b00111111010000111010001110011111"; ram[4840] = "0b00111111010010000000110111101010"; ram[4841] = "0b00111111010011000101001001011110"; ram[4842] = "0b00111111010100000111000000101101"; ram[4843] = "0b00111111010101000110011010001111"; ram[4844] = "0b00111111010110000011010011000101"; ram[4845] = "0b00111111010110111101101000010111"; ram[4846] = "0b00111111010111110101010111010100"; ram[4847] = "0b00111111011000101010011101010011"; ram[4848] = "0b00111111011001011100110111110100"; ram[4849] = "0b00111111011010001100100100011110"; ram[4850] = "0b00111111011010111001100001000000"; ram[4851] = "0b00111111011011100011101011010100"; ram[4852] = "0b00111111011100001011000001011000"; ram[4853] = "0b00111111011100101111100001010111"; ram[4854] = "0b00111111011101010001001001100001"; ram[4855] = "0b00111111011101101111111000010001"; ram[4856] = "0b00111111011110001011101100001010"; ram[4857] = "0b00111111011110100100100011111000"; ram[4858] = "0b00111111011110111010011110001111"; ram[4859] = "0b00111111011111001101011010001101"; ram[4860] = "0b00111111011111011101010110111001"; ram[4861] = "0b00111111011111101010010011100011"; ram[4862] = "0b00111111011111110100001111100011"; ram[4863] = "0b00111111011111111011001010011011"; ram[4864] = "0b00111111011111111111000011110110"; ram[4865] = "0b00111111011111111111111011101010"; ram[4866] = "0b00111111011111111101110001110010"; ram[4867] = "0b00111111011111111000100110010110"; ram[4868] = "0b00111111011111110000011001100100"; ram[4869] = "0b00111111011111100101001011110111"; ram[4870] = "0b00111111011111010110111101110000"; ram[4871] = "0b00111111011111000101101111111001"; ram[4872] = "0b00111111011110110001100011001000"; ram[4873] = "0b00111111011110011010011000011000"; ram[4874] = "0b00111111011110000000010000110001"; ram[4875] = "0b00111111011101100011001101100001"; ram[4876] = "0b00111111011101000011010000000001"; ram[4877] = "0b00111111011100100000011001110000"; ram[4878] = "0b00111111011011111010101100011001"; ram[4879] = "0b00111111011011010010001001101101"; ram[4880] = "0b00111111011010100110110011100111"; ram[4881] = "0b00111111011001111000101100001011"; ram[4882] = "0b00111111011001000111110101100011"; ram[4883] = "0b00111111011000010100010010000101"; ram[4884] = "0b00111111010111011110000100001011"; ram[4885] = "0b00111111010110100101001110011010"; ram[4886] = "0b00111111010101101001110011011110"; ram[4887] = "0b00111111010100101011110110001010"; ram[4888] = "0b00111111010011101011011001011011"; ram[4889] = "0b00111111010010101000100000010011"; ram[4890] = "0b00111111010001100011001101111100"; ram[4891] = "0b00111111010000011011100101101001"; ram[4892] = "0b00111111001111010001101010110001"; ram[4893] = "0b00111111001110000101100000110110"; ram[4894] = "0b00111111001100110111001011011101"; ram[4895] = "0b00111111001011100110101110010011"; ram[4896] = "0b00111111001010010100001101001100"; ram[4897] = "0b00111111001000111111101100000001"; ram[4898] = "0b00111111000111101001001110110010"; ram[4899] = "0b00111111000110010000111001100110"; ram[4900] = "0b00111111000100110110110000100110"; ram[4901] = "0b00111111000011011010111000000100"; ram[4902] = "0b00111111000001111101010100010111"; ram[4903] = "0b00111111000000011110001001111000"; ram[4904] = "0b00111110111101111010111010010010"; ram[4905] = "0b00111110111010110110100101011011"; ram[4906] = "0b00111110110111101111011110011110"; ram[4907] = "0b00111110110100100101101110110100"; ram[4908] = "0b00111110110001011001100000000001"; ram[4909] = "0b00111110101110001010111011101111"; ram[4910] = "0b00111110101010111010001011101111"; ram[4911] = "0b00111110100111100111011001111000"; ram[4912] = "0b00111110100100010010110000001001"; ram[4913] = "0b00111110100000111100011000100101"; ram[4914] = "0b00111110011011001000111010101000"; ram[4915] = "0b00111110010100010110010001001000"; ram[4916] = "0b00111110001101100001001001001110"; ram[4917] = "0b00111110000110101001110111100101"; ram[4918] = "0b00111101111111100001100001111001"; ram[4919] = "0b00111101110001101100010100011010"; ram[4920] = "0b00111101100011110100110000100011"; ram[4921] = "0b00111101001011110111000000100010"; ram[4922] = "0b00111100100000000100110110011111"; ram[4923] = "0b10111100001111001011101010010010"; ram[4924] = "0b10111101000111100111101100101100"; ram[4925] = "0b10111101100001101101010011011101"; ram[4926] = "0b10111101101111100101001010100100"; ram[4927] = "0b10111101111101011010110001101100"; ram[4928] = "0b10111110000101100110101111011110"; ram[4929] = "0b10111110001100011110010100010011"; ram[4930] = "0b10111110010011010011110010100010"; ram[4931] = "0b10111110011010000110110101100000"; ram[4932] = "0b10111110100000011011100100010100"; ram[4933] = "0b10111110100011110010001011101111"; ram[4934] = "0b10111110100111000111000110111000"; ram[4935] = "0b10111110101010011010001011101001"; ram[4936] = "0b10111110101101101011010000000101"; ram[4937] = "0b10111110110000111010001010010011"; ram[4938] = "0b10111110110100000110110000100000"; ram[4939] = "0b10111110110111010000111001000001"; ram[4940] = "0b10111110111010011000011010010100"; ram[4941] = "0b10111110111101011101001010111011"; ram[4942] = "0b10111111000000001111100000110010"; ram[4943] = "0b10111111000001101110111010100010"; ram[4944] = "0b10111111000011001100101110001100"; ram[4945] = "0b10111111000100101000110111010101"; ram[4946] = "0b10111111000110000011010001100111"; ram[4947] = "0b10111111000111011011111000101110"; ram[4948] = "0b10111111001000110010101000100000"; ram[4949] = "0b10111111001010000111011100110110"; ram[4950] = "0b10111111001011011010010001101111"; ram[4951] = "0b10111111001100101011000011010000"; ram[4952] = "0b10111111001101111001101101100101"; ram[4953] = "0b10111111001111000110001101000000"; ram[4954] = "0b10111111010000010000011101111010"; ram[4955] = "0b10111111010001011000011100110001"; ram[4956] = "0b10111111010010011110000110001100"; ram[4957] = "0b10111111010011100001010110111000"; ram[4958] = "0b10111111010100100010001011101010"; ram[4959] = "0b10111111010101100000100001011101"; ram[4960] = "0b10111111010110011100010101010101"; ram[4961] = "0b10111111010111010101100100011101"; ram[4962] = "0b10111111011000001100001100000111"; ram[4963] = "0b10111111011001000000001001101111"; ram[4964] = "0b10111111011001110001011010110110"; ram[4965] = "0b10111111011010011111111101001000"; ram[4966] = "0b10111111011011001011101110011001"; ram[4967] = "0b10111111011011110100101100100011"; ram[4968] = "0b10111111011100011010110101101011"; ram[4969] = "0b10111111011100111110000111111101"; ram[4970] = "0b10111111011101011110100001101110"; ram[4971] = "0b10111111011101111100000001011101"; ram[4972] = "0b10111111011110010110100101110000"; ram[4973] = "0b10111111011110101110001101010111"; ram[4974] = "0b10111111011111000010110111001001"; ram[4975] = "0b10111111011111010100100010001010"; ram[4976] = "0b10111111011111100011001101100011"; ram[4977] = "0b10111111011111101110111000101000"; ram[4978] = "0b10111111011111110111100010110101"; ram[4979] = "0b10111111011111111101001011110001"; ram[4980] = "0b10111111011111111111110011001001"; ram[4981] = "0b10111111011111111111011000111000"; ram[4982] = "0b10111111011111111011111100111100"; ram[4983] = "0b10111111011111110101011111100010"; ram[4984] = "0b10111111011111101100000000111100"; ram[4985] = "0b10111111011111011111100001101000"; ram[4986] = "0b10111111011111010000000010001010"; ram[4987] = "0b10111111011110111101100011010011"; ram[4988] = "0b10111111011110101000000101111001"; ram[4989] = "0b10111111011110001111101010111110"; ram[4990] = "0b10111111011101110100010011101011"; ram[4991] = "0b10111111011101010110000001010100"; ram[4992] = "0b10111111011100110100110101010101"; ram[4993] = "0b10111111011100010000110001010000"; ram[4994] = "0b10111111011011101001110110110101"; ram[4995] = "0b10111111011011000000000111111000"; ram[4996] = "0b10111111011010010011100110010111"; ram[4997] = "0b10111111011001100100010100011010"; ram[4998] = "0b10111111011000110010010100010000"; ram[4999] = "0b10111111010111111101101000001111"; ram[5000] = "0b10111111010111000110010010111000"; ram[5001] = "0b10111111010110001100010110110010"; ram[5002] = "0b10111111010101001111110110101100"; ram[5003] = "0b10111111010100010000110101011100"; ram[5004] = "0b10111111010011001111010110000011"; ram[5005] = "0b10111111010010001011011011100110"; ram[5006] = "0b10111111010001000101001001010011"; ram[5007] = "0b10111111001111111100100010011101"; ram[5008] = "0b10111111001110110001101010100010"; ram[5009] = "0b10111111001101100100100101000011"; ram[5010] = "0b10111111001100010101010101101011"; ram[5011] = "0b10111111001011000100000000001000"; ram[5012] = "0b10111111001001110000101000010000"; ram[5013] = "0b10111111001000011011010010000001"; ram[5014] = "0b10111111000111000100000001011101"; ram[5015] = "0b10111111000101101010111010101010"; ram[5016] = "0b10111111000100010000000001111000"; ram[5017] = "0b10111111000010110011011011011001"; ram[5018] = "0b10111111000001010101001011100110"; ram[5019] = "0b10111110111111101010101101110101"; ram[5020] = "0b10111110111100101000000011110100"; ram[5021] = "0b10111110111001100010100010010110"; ram[5022] = "0b10111110110110011010010010101111"; ram[5023] = "0b10111110110011001111011110011110"; ram[5024] = "0b10111110110000000010001111001001"; ram[5025] = "0b10111110101100110010101110011101"; ram[5026] = "0b10111110101001100001000110001101"; ram[5027] = "0b10111110100110001101100000010101"; ram[5028] = "0b10111110100010111000000110110100"; ram[5029] = "0b10111110011111000010000111100000"; ram[5030] = "0b10111110011000010001000010101000"; ram[5031] = "0b10111110010001011101010011011111"; ram[5032] = "0b10111110001010100111001110101011"; ram[5033] = "0b10111110000011101111001000111010"; ram[5034] = "0b10111101111001101010101110000000"; ram[5035] = "0b10111101101011110100011011101011"; ram[5036] = "0b10111101011011111000001001011101"; ram[5037] = "0b10111101000000000100100110011000"; ram[5038] = "0b10111011100001111100010001111011"; for (unsigned i = 5039; i < 5244 ; i = i + 1) { ram[i] = "0b00000000000000000000000000000000"; } SC_METHOD(prc_write_0); sensitive<<clk.pos(); SC_METHOD(prc_write_1); sensitive<<clk.pos(); } void prc_write_0() { if (ce0.read() == sc_dt::Log_1) { if(address0.read().is_01() && address0.read().to_uint()<AddressRange) q0 = ram[address0.read().to_uint()]; else q0 = sc_lv<DataWidth>(); } } void prc_write_1() { if (ce1.read() == sc_dt::Log_1) { if(address1.read().is_01() && address1.read().to_uint()<AddressRange) q1 = ram[address1.read().to_uint()]; else q1 = sc_lv<DataWidth>(); } } }; //endmodule SC_MODULE(FM_Synth_notes) { static const unsigned DataWidth = 32; static const unsigned AddressRange = 5244; static const unsigned AddressWidth = 13; sc_core::sc_in <sc_lv<AddressWidth> > address0; sc_core::sc_in<sc_logic> ce0; sc_core::sc_out <sc_lv<DataWidth> > q0; sc_core::sc_in <sc_lv<AddressWidth> > address1; sc_core::sc_in<sc_logic> ce1; sc_core::sc_out <sc_lv<DataWidth> > q1; sc_core::sc_in<sc_logic> reset; sc_core::sc_in<bool> clk; FM_Synth_notes_ram* meminst; SC_CTOR(FM_Synth_notes) { meminst = new FM_Synth_notes_ram("FM_Synth_notes_ram"); meminst->address0(address0); meminst->ce0(ce0); meminst->q0(q0); meminst->address1(address1); meminst->ce1(ce1); meminst->q1(q1); meminst->reset(reset); meminst->clk(clk); } ~FM_Synth_notes() { delete meminst; } };//endmodule #endif
e86d67d484b89ddaf0e521249ea0e0fa10c8794d
3ff1fe3888e34cd3576d91319bf0f08ca955940f
/cpdp/src/v20190820/model/QueryOpenBankExternalSubMerchantBankAccountData.cpp
2d320953689482998ff6c43ed3998c1685a27248
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-cpp
9f5df8220eaaf72f7eaee07b2ede94f89313651f
42a76b812b81d1b52ec6a217fafc8faa135e06ca
refs/heads/master
2023-08-30T03:22:45.269556
2023-08-30T00:45:39
2023-08-30T00:45:39
188,991,963
55
37
Apache-2.0
2023-08-17T03:13:20
2019-05-28T08:56:08
C++
UTF-8
C++
false
false
7,374
cpp
QueryOpenBankExternalSubMerchantBankAccountData.cpp
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <tencentcloud/cpdp/v20190820/model/QueryOpenBankExternalSubMerchantBankAccountData.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Cpdp::V20190820::Model; using namespace std; QueryOpenBankExternalSubMerchantBankAccountData::QueryOpenBankExternalSubMerchantBankAccountData() : m_accountBankHasBeenSet(false), m_bindSerialNoHasBeenSet(false), m_accountTypeHasBeenSet(false), m_bankBranchIdHasBeenSet(false), m_accountNumberLastFourHasBeenSet(false) { } CoreInternalOutcome QueryOpenBankExternalSubMerchantBankAccountData::Deserialize(const rapidjson::Value &value) { string requestId = ""; if (value.HasMember("AccountBank") && !value["AccountBank"].IsNull()) { if (!value["AccountBank"].IsString()) { return CoreInternalOutcome(Core::Error("response `QueryOpenBankExternalSubMerchantBankAccountData.AccountBank` IsString=false incorrectly").SetRequestId(requestId)); } m_accountBank = string(value["AccountBank"].GetString()); m_accountBankHasBeenSet = true; } if (value.HasMember("BindSerialNo") && !value["BindSerialNo"].IsNull()) { if (!value["BindSerialNo"].IsString()) { return CoreInternalOutcome(Core::Error("response `QueryOpenBankExternalSubMerchantBankAccountData.BindSerialNo` IsString=false incorrectly").SetRequestId(requestId)); } m_bindSerialNo = string(value["BindSerialNo"].GetString()); m_bindSerialNoHasBeenSet = true; } if (value.HasMember("AccountType") && !value["AccountType"].IsNull()) { if (!value["AccountType"].IsString()) { return CoreInternalOutcome(Core::Error("response `QueryOpenBankExternalSubMerchantBankAccountData.AccountType` IsString=false incorrectly").SetRequestId(requestId)); } m_accountType = string(value["AccountType"].GetString()); m_accountTypeHasBeenSet = true; } if (value.HasMember("BankBranchId") && !value["BankBranchId"].IsNull()) { if (!value["BankBranchId"].IsString()) { return CoreInternalOutcome(Core::Error("response `QueryOpenBankExternalSubMerchantBankAccountData.BankBranchId` IsString=false incorrectly").SetRequestId(requestId)); } m_bankBranchId = string(value["BankBranchId"].GetString()); m_bankBranchIdHasBeenSet = true; } if (value.HasMember("AccountNumberLastFour") && !value["AccountNumberLastFour"].IsNull()) { if (!value["AccountNumberLastFour"].IsString()) { return CoreInternalOutcome(Core::Error("response `QueryOpenBankExternalSubMerchantBankAccountData.AccountNumberLastFour` IsString=false incorrectly").SetRequestId(requestId)); } m_accountNumberLastFour = string(value["AccountNumberLastFour"].GetString()); m_accountNumberLastFourHasBeenSet = true; } return CoreInternalOutcome(true); } void QueryOpenBankExternalSubMerchantBankAccountData::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const { if (m_accountBankHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "AccountBank"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_accountBank.c_str(), allocator).Move(), allocator); } if (m_bindSerialNoHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "BindSerialNo"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_bindSerialNo.c_str(), allocator).Move(), allocator); } if (m_accountTypeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "AccountType"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_accountType.c_str(), allocator).Move(), allocator); } if (m_bankBranchIdHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "BankBranchId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_bankBranchId.c_str(), allocator).Move(), allocator); } if (m_accountNumberLastFourHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "AccountNumberLastFour"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_accountNumberLastFour.c_str(), allocator).Move(), allocator); } } string QueryOpenBankExternalSubMerchantBankAccountData::GetAccountBank() const { return m_accountBank; } void QueryOpenBankExternalSubMerchantBankAccountData::SetAccountBank(const string& _accountBank) { m_accountBank = _accountBank; m_accountBankHasBeenSet = true; } bool QueryOpenBankExternalSubMerchantBankAccountData::AccountBankHasBeenSet() const { return m_accountBankHasBeenSet; } string QueryOpenBankExternalSubMerchantBankAccountData::GetBindSerialNo() const { return m_bindSerialNo; } void QueryOpenBankExternalSubMerchantBankAccountData::SetBindSerialNo(const string& _bindSerialNo) { m_bindSerialNo = _bindSerialNo; m_bindSerialNoHasBeenSet = true; } bool QueryOpenBankExternalSubMerchantBankAccountData::BindSerialNoHasBeenSet() const { return m_bindSerialNoHasBeenSet; } string QueryOpenBankExternalSubMerchantBankAccountData::GetAccountType() const { return m_accountType; } void QueryOpenBankExternalSubMerchantBankAccountData::SetAccountType(const string& _accountType) { m_accountType = _accountType; m_accountTypeHasBeenSet = true; } bool QueryOpenBankExternalSubMerchantBankAccountData::AccountTypeHasBeenSet() const { return m_accountTypeHasBeenSet; } string QueryOpenBankExternalSubMerchantBankAccountData::GetBankBranchId() const { return m_bankBranchId; } void QueryOpenBankExternalSubMerchantBankAccountData::SetBankBranchId(const string& _bankBranchId) { m_bankBranchId = _bankBranchId; m_bankBranchIdHasBeenSet = true; } bool QueryOpenBankExternalSubMerchantBankAccountData::BankBranchIdHasBeenSet() const { return m_bankBranchIdHasBeenSet; } string QueryOpenBankExternalSubMerchantBankAccountData::GetAccountNumberLastFour() const { return m_accountNumberLastFour; } void QueryOpenBankExternalSubMerchantBankAccountData::SetAccountNumberLastFour(const string& _accountNumberLastFour) { m_accountNumberLastFour = _accountNumberLastFour; m_accountNumberLastFourHasBeenSet = true; } bool QueryOpenBankExternalSubMerchantBankAccountData::AccountNumberLastFourHasBeenSet() const { return m_accountNumberLastFourHasBeenSet; }