text
stringlengths
8
6.88M
#include <stdio.h> #include <limits.h> #include <time.h> #include <stdlib.h> #include "resource.h" #ifdef _WIN32 #define XTRACE_SUPPLEMENT #include <xtrace.h> #endif #include <SDL2/SDL.h> #include <SDL2/SDL_mixer.h> #include <SDL2/SDL_ttf.h> #include <SDL2/SDL_FontCache.c> #include "res/nunito.h" #include "lyrics....
//$Id: DSNTwoWayDoppler.cpp 1398 2011-04-21 20:39:37Z $ //------------------------------------------------------------------------------ // DSNTwoWayDoppler //------------------------------------------------------------------------------ // GMAT: General Mission Analysis Tool // // Copyright (c...
#pragma once #include "cocos2d.h" using namespace cocos2d; enum { EMOTION_ID_DEFUALT, EMOTION_ID_HAPPY, EMOTION_ID_QUEST, EMOTION_ID_SAD, }; class TextLayer; class StudyScene : public Scene { public: static Scene* createScene(std::string& worldName, int level, std::string& text) { StudyScene* pRes = Stud...
#ifndef OPERATOR_NEGATE_H #define OPERATOR_NEGATE_H #include "operator.h" #include "../type.h" #include "../visitors/operatorvisitor.h" using namespace std; /** * Operator for the boolean NOT */ class NegateOp: public Operator { public: NegateOp(): Operator("!") { } virtual bool canHandle(Type t)...
#include "HDREnvironment.h" #include <tinyxml2.h> HDREnvironment::HDREnvironment() { } HDREnvironment::~HDREnvironment() { } void HDREnvironment::Deserialization( tinyxml2::XMLElement* RootElement ) { const char* name = RootElement->Attribute( "filename" ); mFilename.insert( mFilename.size() , name , strlen( nam...
#ifndef SPROGRESS_CPP #define SPROGRESS_CPP #define _WIN32_IE 0x0500 #include <windows.h> #include <commctrl.h> #include "SApp.h" #include "SWindow.h" #include "SProgress.h" SProgress::SProgress(SWindow * pWin): SWindow(pWin->GetSApp(), PROGRESS_CLASS, pWin->GetHwnd(), 0, WS_CHILD) { pWin->AddChild(...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #include <gtest/gtest.h> #include "game/world/chunk_tile.h" #include "data/cereal/register_type.h" // Just has to be included somewhere once #include "jactorioTests.h" namespace jactorio::game { class ChunkTileTe...
#include "SolarFarm.hpp" SolarFarm::SolarFarm(SDL_Renderer *renderer, Texture *texture, int level) : Building(renderer, texture, "Solar Farm", level) { spriteClip = { 1670, 0, 345, 250 }; }
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source c...
// bbox.h // //////////////////////////////////////////////////////////////////////// #if !defined(__BBOX_H) #define __BBOX_H #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #include "..\fwlib\factory.h" #include "..\fwlib\fwunknown.h" #include "boundplus.h" #include "kinetemplate.h" ////...
// This file has been generated by Py++. #ifndef ConstBaseIterator_663c592fa58613dab4f9509d04eb6cc1_hpp__pyplusplus_wrapper #define ConstBaseIterator_663c592fa58613dab4f9509d04eb6cc1_hpp__pyplusplus_wrapper void register_ConstBaseIterator_663c592fa58613dab4f9509d04eb6cc1_class(); #endif//ConstBaseIterator_663c592fa5...
#include <iostream> #include<bitset> using namespace std; string panagram(string str) { bitset<26> b; for(int i=0;i<str.length();i++) { if(isalpha(str[i])) b[tolower(str[i])-97]=1; } if(b.count()==26) return "pangram"; return "not pangram"; } int main() { // your code goes here string str; getline(cin,str)...
// ------------------------------------------------------------------------------------------------ #include "Library/IO/INI.hpp" // ------------------------------------------------------------------------------------------------ #include <cerrno> // -------------------------------------------------------------------...
#ifndef FUZZYCORE_SPACE_DELETION_VIEW_H #define FUZZYCORE_SPACE_DELETION_VIEW_H #include "../abstractView/AbstractView.h" #include "../../models/space/Space.h" class SpaceDeletionView : public AbstractView { private: std::vector<Space> spaces; void display_spaces() const; public: SpaceDeletionView(); ...
#include <bits/stdc++.h> using namespace std; class conversion { void stack_op(stack<string> &values, stack<char> &opr, bool is_postfix) { auto b = values.top(); values.pop(); auto a = values.top(); values.pop(); char op = opr.top(); opr.pop(); string tem...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#define FILED_GATE_MAX 12 #define FIELD_MAX 256 #define FIELD_AMBENT_MAX 80 class sFIELD; //필드의 게이트 struct sFGATE { int x,z,y; //필드 게이트 위치 sFIELD *lpsField; //필드 포인터 }; //필드의 게이트 struct sWARPGATE { int x,z,y; //필드 게이트 위치 int height,size; //범위 sFGATE OutGate[FILED_GATE_MAX]; //출구 위치 int ...
#ifndef COUNTING_WORDS_TIME_MEASURE_H #define COUNTING_WORDS_TIME_MEASURE_H #include <chrono> #include <atomic> inline std::chrono::steady_clock::time_point get_current_time_fenced() { static_assert(std::chrono::steady_clock::is_steady, "Timer should be steady (monotonic)."); std::atomic_...
#include<iostream> #include<vector> #include<string> #include<algorithm> #include<iterator> #include<cassert> using namespace std; void insert_sorted(vector<string> &v,const string &word) { const auto insert_pos (lower_bound(begin(v),end(v),word)); v.insert(insert_pos,word); } int main() { vector<string> v{"some"...
#include<stdio.h> int main() { int n=62; int a,b,m; printf("%d\n",m); return 0; }
/* * Copyright (C) 2018-2019 wuuhii. All rights reserved. * * The file is encoding with utf-8 (with BOM). It is a part of QtSwissArmyKnife * project. The project is a open source project, you can get the source from: * https://github.com/wuuhii/QtSwissArmyKnife * https://gitee.com/wuuhii/QtSwissArmyKnife...
#ifndef SMART_TEMPERATURE_LCDSCREEN_H #define SMART_TEMPERATURE_LCDSCREEN_H #include <LiquidCrystal.h> class LcdScreen { public: virtual void display(const char *message); virtual void initialize(); explicit LcdScreen(LiquidCrystal *pLiquidCrystal, uint8_t backLightPin) { this->pLiquidCrystal = pLiquidCrys...
//Dalton Hook //4/24/2018 #include <iostream> #include <cstdlib> #include <ctime> using namespace std; int main() { srand(static_cast<unsigned int>(time(0))); int tries = 0; int toGuess; bool error = false; enum statusTypes { NADA, HIGH, LOW, CORRECT }; int status = NADA; int min = 0; int max = 101; i...
#include "Player2.h" Player2::Player2() { x = 0; y = 0; }
struct Coordinate { double x; double y; }; struct DetectionResult { Coordinate* topLeft; Coordinate* topRight; Coordinate* bottomLeft; Coordinate* bottomRight; }; extern "C" struct ProcessingInput { char* path; DetectionResult detectionResult; }; extern "C" struct DetectionResult *det...
class Solution { public: int findDuplicate(vector<int>& num) { int fast=num[0]; int slow=num[0]; do{ slow=num[slow]; fast=num[num[fast]]; }while(fast!=slow); fast=num[0]; while(fast!=slow) { fast=num[fast]; slow=...
#pragma once #include "Array2D.h" #include "DungeonGenerator.h" class Level { private: int width, height, floor; Room* startRoom; Room* stairRoom; Room* bossRoom; RandomInt rnd; public: Array2D* dungeon; Level(int width, int height, int floor); ~Level(); void chooseStartRoom(); void chooseBossRoom(); void ...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include "audio.h" Audio::Audio() : Binary() { } Audio::Audio(const QString& id, const QString& titre, const QString &path, const QString &desc) : Binary(id,titre,path,desc) { } Note::NoteType Audio::getType() const{ return AUDIO; }
#include "MissionImpossible/derivatives.hpp" using namespace MissionImpossible; int main() { AD<double> x0(3), x1(4), y; y = (1 - x0) * (1 - x0) + 10 * (x1 - x0 * x0) * (x1 - x0 * x0); std::cout << y.tape() << std::endl; // auto grad = gradient(y); std::cout << "f value \n" << y.value(); std::co...
/************************************************************* Author : qmeng MailTo : qmeng1128@163.com QQ : 1163306125 Blog : http://blog.csdn.net/Mq_Go/ Create : 2018-03-24 09:29:00 Version: 1.0 **************************************************************/ #include <cstdio> #include <iostream> #include <str...
#ifndef CFONTMGR_H #define CFONTMGR_H #include <map> #include <FTGL/ftgl.h> #include "typedefs.h" class Font; class CFontMgr{ typedef std::map<String, Font*> FontList; public: Font* getFont(const String& name, const double size); FTGLTextureFont* loadFont(const String& name, const double siz...
#include <algorithm> // copy #include <iostream> // cin, cout, streamsize #include <iterator> // back_inserter, istream_iterator #include <limits> // numeric_limits #include <sstream> // istringstream #include <string> // getline, string #include <vector> // vector int storage_optimization(int n, int m, std::vector<in...
#ifndef MULTICYCLE_SIM_H #define MULTICYCLE_SIM_H #include "elf_reader.h" #include "reg_def.h" #include "if.h" #include "id.h" #include "ex.h" #include "mem.h" #include "wb.h" #include <cstdio> #include <iostream> #define FS_MAX_MEMORY (4 * 1024 * 1024) #define FS_SP_DEFAULT (FS_MAX_MEMORY - 10000) class Multicycle_...
#include <stdio.h> #include <opencv2/opencv.hpp> using namespace cv; using namespace std; int main( ) { Mat image; image = imread("robot.png", 1 );//图像与.cpp文件在同一目录下 if (!image.data) { printf("No image data \n"); return -1; } // 文件顺利读取, 首先输出一些基本信息 cout<<"图像宽为"<<image.cols<<",高为"<<image.rows<<",通道数为"<<image.channels...
#include "object.h" Object::Object(bool moon, float baseSc, float baseOS, float baseSS) { /* # Blender File for a Cube o Cube v 1.000000 -1.000000 -1.000000 v 1.000000 -1.000000 1.000000 v -1.000000 -1.000000 1.000000 v -1.000000 -1.000000 -1.000000 v 1.000000 1.000000 -0.999999 v 0...
#include "physics\Singularity.Physics.h" namespace Singularity { namespace Physics { class PhysicsMotionState : public btMotionState { public: #pragma region Variables Vector3 m_kCenterOfMass; Singularity::Components::Transform* m_pBoundTransform; bool m_bLockRotation...
#ifndef MENU_CHICKFILA #define MENU_CHICKFILA #include "../../menu_component.hpp" #include <iostream> using namespace std; class menu_chickfila : public menu_component { protected: string menu_name_chickfila; string menu_description_chickfila; vector<menu_component *> v_menu_chickfila; public: menu_c...
// This file has been generated by Py++. #include "boost/python.hpp" #include "generators/include/python_CEGUI.h" #include "ImagePropertyDim.pypp.hpp" namespace bp = boost::python; struct ImagePropertyDim_wrapper : CEGUI::ImagePropertyDim, bp::wrapper< CEGUI::ImagePropertyDim > { ImagePropertyDim_wrapper(CEGUI:...
#include <bits/stdc++.h> using namespace std; class StackArray{ int *data; int nextindex; int capacity; public: StackArray(int totalsize){ data=new int[4]; nextindex=0; capacity=4; } //return the number of elements present in the stack int size(){ return nextindex; } bool is...
#include "../include/Outils.h" #include <openssl/sha.h> #include <sstream> #include <iostream> #include <math.h> #include <fstream> #include <stdlib.h> std::vector<int> outils::chaine_to_ascii(const std::string& message) { std::vector<int> tab_ascii; for (unsigned int i = 0; i < message.size(); ++i) tab_ascii...
#include "Sphere.h" #include <assert.h> // Implements Gear integration. // Computes the positions, velocities and higher-order time derivatives as Taylor expansions of the present values. void Sphere::predict(double dt) { double a1 = dt; double a2 = a1 * dt / 2; double a3 = a2 * dt / 3; double a4 = a3 * dt / 4; ...
#include "hdivider_test.h" void worker_func(void *a) { worker_args *args = (worker_args*)a; HdividerWorker *hdivider = args->hdivider; map<InputId, int > *input_data = args->input_data; vector<int> *result = args->result; while (!hdivider->isFinished()) { vector<int64_t> ids = hdiv...
#include <iostream> #include <set> #include <vector> /** The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? */ static std::set<std::uint32_t> CreatedPrimeNumbers = {2, 3, 5, 7}; void generatePrimeNumber(std::uint32_t targetNumber) { auto lastPrimeNumber...
#pragma once #include <utility> #include <vector> #include <string> #include <landstalker-lib/tools/json.hpp> #include "world_node.hpp" class HintSource { private: std::vector<uint16_t> _text_ids; std::string _description; WorldNode* _node = nullptr; bool _small_textbox = false; std::string _tex...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#include "physics\Singularity.Physics.h" namespace Singularity { namespace Physics { class BooleanCollider : public Collider { public: #pragma region Variables bool IsPositiveSpace; BooleanCollider* Container; #pragma endregion protected: #pragma region Methods b...
#include <stdio.h> #include <algorithm> using namespace std; int russia[100]; int korea[100]; int n; int main() { int c; scanf("%d",&c); while(c--) { scanf("%d",&n); for(int i=0;i<n;i++) scanf("%d",&russia[i]); for(int i=0;i<n;i++) scanf("%d",&korea[i]); sort(russia,russia+n); sort(korea,korea+n)...
// input channel angle from remote long roll, pitch, throttle, yaw, AUX1; //This function will return a mapping value(in range out_min-out_min) for the input x(in range in_min-in_max) long map(long x, long in_min, long in_max, long out_min, long out_max) { return (x - in_min)* (out_max - out_min)/(in_max - in_min)...
#include "Zombie.h" #include <QGraphicsScene> #include <QList> #include "Plant.h" #include "Nut.h" #include "CherryBomb.h" Zombie::Zombie(const int& pixPer40MiliSec , QTimer *timer ,const int lives , QGraphicsItem *parent , bool isLord ) : QObject () , QGraphicsPixmapItem (parent) , pixPer40Mi...
#include <iostream> using namespace std; class point; class anotherPoint //anotherPoint类定义 { private: double x; double y; public: anotherPoint(double xx = 1, double yy = 1) { x = xx; y = yy; } void print() { cout << "( " << x << " , " << y << " )"...
// Copyright (C) 2017 Elviss Strazdins // This file is part of the Ouzel engine. #include "PerspectiveSample.h" #include "MainMenu.h" using namespace std; using namespace ouzel; PerspectiveSample::PerspectiveSample() { cursor.init(input::SystemCursor::CROSS); sharedEngine->getInput()->setCursor(&cursor); ...
struct BinaryTreeNode { int m_nValue; BinaryTreeNode* m_pLeft; BinaryTreeNode* m_pRight; }; void Print(BinaryTreeNode* pRoot) { if(pRoot==nullptr) return ; std::stack<BinaryTreeNode*> levels[2]; int current=0; int next=1; levels[current].push(pRoot); while(!levels[0...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "Windows.Phone.PersonalInformation.Provisioning.2.h" WINRT_EXPORT namespace winrt { namespace Windows::Phone::PersonalInformation::Provisioning { struct ContactPartnerProvisioningMa...
#include "span/fibers/WorkerPool.hh" #include "span/fibers/Fiber.hh" #include "glog/logging.h" namespace span { namespace fibers { WorkerPool::WorkerPool(size_t threads, bool useCaller, size_t batchSize) : Scheduler(threads, useCaller, batchSize) { start(); } void WorkerPool::idle() { ...
#include <immintrin.h> #include <cstring> #include <fcntl.h> #include <immintrin.h> #include <iostream> #include <stdexcept> #include <sys/mman.h> #include <unistd.h> #include "log.hpp" #include "nontemporal.h" #include "../utils/macros.hpp" namespace mcsLog { LogEntry::LogEntry(const char *entry) { _value = e...
#ifndef CAMERA_H #define CAMERA_H #include "gfp.h" #include "utility.h" #include <vector> using namespace std; // header file CAMERA.H for class camera class Camera { public: void setCamera( float eyex, float eyey, float eyez, float lookx, float looky, float lookz, float upx, float upy, float upz); void ro...
/* Copyright (c) 2005-2023, University of Oxford. All rights reserved. University of Oxford means the Chancellor, Masters and Scholars of the University of Oxford, having an administrative office at Wellington Square, Oxford OX1 2JD, UK. This file is part of Chaste. Redistribution and use in source and binary forms...
#pragma once #define NULL 0 #include <string.h> #include <malloc.h> class String { public: String::String(const char *cstr) { init(); if (cstr) copy(cstr, strlen(cstr)); } String::String() { init(); } String & String::copy(const char *cstr, unsigned int length) { if (!reserve(length)) { inv...
#include "mainwidget.h" #include "types.h" #include <QtWidgets/QApplication> #include <QtDebug> int main(int argc, char *argv[]) { QApplication aplication(argc, argv); MainWidget w; w.show(); return aplication.exec(); }
// github.com/andy489 #include <stdio.h> #define MAXREM 100 int main(){ int n,k,i,a,res(0); int* r = new int[MAXREM]; scanf("%d%d",&n,&k); for(i=0;i<n;++i){ scanf("%d",&a); ++r[a%k]; } int end=(k+1)/2; for(i=1;i<end;++i){ res+=(r[i]>r[k-i]?r[i]:r[k-i]); } if(r[0])...
#include <vector> #include "externals.h" #include "typedValue.h" #include "stack.h" #include "word.h" #include "context.h" #include "mathMacro.h" void ShowStack(Stack& inStack,const char *inStackName); void InitDict_Control() { Install(new Word("_branch-if-false",WORD_FUNC { if(inContext.DS.size()<1) { return inC...
#include <string> #include <fstream> #include <iostream> using namespace std; void drawdot(int count, int SCC_count, string names[], int SCC[], int edges[], int labelling[]);
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* AMateria.hpp :+: :+: :+: ...
#pragma once #include <iostream> #include <string> #include <algorithm> #include "University.h" #include "Variables.h" class FieldOfStudy; class Faculty; double maximum_advanced_science(Faculty x, double AdvancedMaturaResults[8]); double maximum_advanced_language(Faculty x, double AdvancedMaturaResults[8]); University ...
#include <iostream> #include <conio.h> #include <math.h> using namespace std; int rotation(int ); int result,rotatednum; int main(){ int numb,numb2,numb3; cout<<"\nInput any integer number "; cin>>numb; cout<<"\nThe rotated number is "<<rotation(numb); cout<<"\nInput any integer number "; ...
#pragma once #include "Graphics.h" #include "Font.h" #include "Vei2.h" class Scorecounter { private: int score = 0; const Font& font; Vei2 displayPos; Color color; public: Scorecounter(const Font& font_in, const Vei2& displayPos_in, const Color color_in); void add(const int points); int get() const; void dis...
#include "LatticeEngine.h" #include <algorithm> void LatticeEngine::step() { make_ilist(); integrate(); check_dump(); } void LatticeEngine::make_ilist() { for (unsigned int i{ 0 }; i < particle.size(); i++) { double x{ particle[i].x() }, y{ particle[i].y() }; if ((x >= x_0) && (x < x_0 + lx) && (y >= y_0) && ...
#ifndef CLEXICON_H #define CLEXICON_H #include <QMap> #include <QMapIterator> #include <QString> #include <QList> #include <QPair> #include <QSet> #include <QStatusBar> #include "SignatureCollection.h" #include "Typedefs.h" class MainWindow; class CWordCollection; class CStemCollection; class CSuffixCollection; class ...
// // ProgressPopup.cpp // SMFrameWork // // Created by SteveMac on 2018. 5. 24.. // #include "ProgressPopup.h" #include "PopupManager.h" #include "../Base/ShaderNode.h" #include "../UI/ProgressView.h" #include "../Base/ViewAction.h" #include "../Util/ViewUtil.h" #define POPUP_ID_PROGRESS (0xFFFFFE) #define ACT...
#include <sstream> #include <iostream> #include <windows.h> using namespace std; void kylskapMedWhileTrue() { SetConsoleOutputCP(1252); cout << "Välkommen till kylskåpsloopen 1" << endl; while (true) { int temp2; string temp; cout << "Vilken temp har kylskåpet? " <<...
#include <iostream> using namespace std; class MyClass { int x; public: MyClass() : x(0) { cout << "Default Constructor" << endl; } MyClass(int i) : x(i) { cout << "Parameter Constructor" << endl; } MyClass(const MyClass& other) : x(other.x) ...
class Solution { public: int removeDuplicatesI(int A[], int n) { if(n <= 0) return 0; int c = 0; for(int i = 1;i < n;++i) if(A[c] != A[i]) A[++c] = A[i]; return c + 1; } int removeDuplicatesII(int A[], int n) { if(n ...
#include <mutex> #include <thread> #include <condition_variable> #include <queue> class data_chunk { }; std::mutex mut; std::queue<int> data_queue; // 1 std::condition_variable data_cond; void data_preparation_thread() { while (true) { int data = 1; std::lock_guard<std::mutex> lk(mut); ...
// Problem: K-th beautiful String // Link: https://codeforces.com/contest/1328/problem/B #include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t>0){ unsigned long long n, k, num; cin >> n >> k; unsigned long long pos1, pos2; ...
#include "include2.h" #include "include1.h" int main(int argc, char* argv[]) { importantthing s1; something2 s3; s1.x = OPTION1; s1.y = OPTION2; return 0; }
/* * row.h * * Created on: Feb 24, 2016 * Author: Todd */ #ifndef ROW_H_ #define ROW_H_ #include "common.h" #include "cell.h" #include "grid.h" class Row { Grid& grid; int rowNo; public: Row(Grid& grid, int rowNo); Row(const Row& row); class Iterator: iterator<input_iterator_tag, int> { publ...
#pragma once /* Enable Naked Mode * PATCHES: XXX.dll * * CTRL+H "EnableNakedMode" */ #include "../Main.h" #include "../Singleton.h" #include "GenericPatcher.h" class CPatcher_EnableNakedMode : public IGenericPatcher { public: CPatcher_EnableNakedMode(); bool ReadINI(void); bool WriteINI(void); private: // H...
#include "FuGenPipelineEdge.h" #include <iostream> void FuGenPipelineEdge::mouseReleaseEvent(QGraphicsSceneMouseEvent *Event) { QGraphicsLineItem::mouseReleaseEvent(Event); // if (Event->button() == Qt::LeftButton) { for(IPipelineEdgeListener *Listener : Listeners) { Listener->OnClicked(); } } } void ...
#ifndef MCEVENT_H #define MCEVENT_H #include <map> #include <vector> #include "TTree.h" class MCGeometry; class TFile; class TH2F; class MCEvent { public: //------------------------------------- MCEvent(const char* dataFileName=""); virtual ~MCEvent(); // methods TTree* Tree() { return simTree;...
#include "../../include/primitives/HashOpenSSL.hpp" OpenSSLHash::OpenSSLHash(string hashName) { //Instantiates a hash object in OpenSSL. We keep a pointer to the created hash object in c++. //Remember to delete it using the finalize method. EVP_MD_CTX* mdctx; const EVP_MD *md; OpenSSL_add_all_digests();...
#ifndef GTS_PAINTSHAPE_H #define GTS_PAINTSHAPE_H #include<QPoint> #include<QPainter> ///////////////////////////////////////////////////////////////////////////////////////// class Shape2D { public: enum shapeType{LINE, RECT, POLYGON, CURVES}; Shape2D(); void setStartPoint(QPoint s){start_ = s; } ...
/* CTC GO! MOTION PROJECT - SPIN-A-WHEEL This sketch is written to accompany Stage 5 of the SPIN-A-WHEEL project */ #include <Servo.h> Servo servo_wheel; Servo servo_pointer; int button_1 = 2; int button_2 = 3; int yellowLED = 4; int blueLED = 5; int piezo = 8; int buttonState_1; int buttonState_2; int cou...
/* Copyright 2017-2018 All Rights Reserved. * Gyeonghwan Hong (redcarrottt@gmail.com) * * [Contact] * Gyeonghwan Hong (redcarrottt@gmail.com) * * 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 Lic...
// // marketdata.cpp // #include "marketdata.hpp" #include "database.hpp" static size_t WriteCallback(void *contents, size_t size, size_t nmemb, void *userp) { ((std::string*)userp)->append((char*)contents, size * nmemb); return size * nmemb; } int RetrieveMarketData(string url_request, string & read...
#include "Collidable.h" #include "Utilities/Logger/Log.h" #include "../Physics/Movable.h" namespace liman { const char* Collidable::g_Name = "CollisionComponent"; Collidable::Collidable() = default; // TODO: place somewhere in settings // const float g_paramColision = 1; // TIP: Collision result logic math...
void setUpRF() { Serial.println("-----------------------------"); Serial.println("Iniciando RF"); radio.begin(); radio.setChannel(115); radio.setPALevel(RF24_PA_LOW); radio.setPayloadSize(32); radio.openWritingPipe(direccion[0]); radio.stopListening(); Serial.println("RF iniciado!"); Serial.println(...
#include <iostream> #include <vector> using namespace std; int lowerBound(vector<int> &nums, int target) { int low = 0, high = nums.size(); // high not be nums.size() to void that all elements less than target, then nums.size() return while (low < high) { // if low <= high, maybe infinite loop //cout ...
// // Copyright (c) 2003--2009 // Toon Knapen, Karl Meerbergen, Kresimir Fresl, // Thomas Klimpel and Rutger ter Borg // // 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) // // THIS FILE IS AUTOMATICALLY GENERATED ...
#ifndef _SERVER_H_ #define _SERVER_H_ #include <string.h> #ifdef WIN32 #include <winsock2.h> // #include <Ws2tcpip.h> #else #include <sys/socket.h> #include <arpa/inet.h> #include <netdb.h> /* Needed for getaddrinfo() and freeaddrinfo() */ #include <unistd.h> /* Needed for close() */ #endif #include "jso...
#include <sstream> #include <string> template <class T> bool transfChaine (const string chaine, T &tmp){ bool res = false; istringstream iss(chaine); if(iss>>tmp){ res = true; } return res ; } template <class T> bool verifType (const string chaine, T tmp){ // créer un flux à ...
#include <bits/stdc++.h> using namespace std; bool isPal(long int); int main() { freopen("out", "w", stdout); int n = 0, a[2470]; for(int i=100; i<1000; i++) { for(int j=100; j<1000; j++) { if(isPal(i*j)) { cout<<i*j<<", "; n++; } } } cout<<"\n\n"<<n; return 0; } bool isPal(long int n)...
/**************************************** * * INSERT-PROJECT-NAME-HERE - INSERT-GENERIC-NAME-HERE * Copyright (C) 2021 Victor Tran * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundati...
#ifndef TEXTURE #define TEXTURE #include "init.hpp" class Image{ public: Image( std::string path ); Image( std::string path , const int x, const int y, const int w, const int h ); ~Image( ); int render( const int x, const int y ); int render( const int x, const int y, const double multipX, const d...
#include <iostream> using namespace std; void hanoy(int, int, int, int); int main() { hanoy(3, 1, 2, 3); cout << endl; return 0; } // val - количество дисков. // start - 1 стержень (стартовый). // buff - 2 стержень (переходный). // end - 3 стержень (куда надо переместить). void hanoy(int val, i...
class Solution { public: int maxSubArray(vector<int>& nums) { if (nums.empty()) return 0; return helper(nums, 0, nums.size() - 1); } int helper(vector<int> & nums, int left, int right) { if (left >= right) return nums[left]; // must be >=, not == int mid = left + (right - lef...
#include "Node.h" template <class T> Node<T>::Node(T value) { this->data = value; } template <class T> Node<T>::~Node() { delete this->next; } template <class T> T Node<T>::getData() const { return this->data; } template <class T> void Node<T>::setData(T data) { this->data = data; } template <class T> Node<T>*...
//! Bismillahi-Rahamanirahim. /** ========================================** ** @Author: Md. Abu Farhad ( RUET, CSE'15) ** @Category: /** ========================================**/ #include<bits/stdc++.h> #include<stdio.h> using namespace std; #define ll long long #define scl(n) scan...
#include<iostream> #include<algorithm> using namespace std; typedef struct line { int l,r; int value; }; int dp[1000001]; bool cmp(const line &a,const line &b) { return a.r<b.r; } line l[1000]; int main() { int n; cin >>n; for(int j=0;j<=1000000;j++) { dp[j]=0; } for(int i=0;i<n;i++) { cin >>l[i]....
#include<stdio.h> #include<assert.h> #include<stdlib.h> struct node{ int data; struct node *next; }; int delete_node(struct node *); int push(struct node **,int); int print(struct node *); int main(){ struct node* head=NULL; push(&head,23); push(&head,65); push(&head,11); push(&head,33); printf("before de...