text
stringlengths
8
6.88M
#include "u_interface_classes.h" #include <complex> #include "math_vector.h" #include <iostream> #include <vector> #include "test_dynamic_array.h" #include "test_linked_list.h" #include "test_sequence.h" #include "test_math_vector.h" #include "u_interface_utils.h" #include <stdlib.h> #include <time.h> using namespace ...
#pragma once //====================================================================== #include <upl/common.hpp> #include <upl/errors.hpp> //====================================================================== namespace UPL { //====================================================================== class InputStr...
#include <iostream> #include <string> #include <vector> using namespace std; int Myadd(int a, int b) { cout << "普通函数" << endl; return a + b; } template <class T> T Myadd(T a, T b) { cout << "函数模板" << endl; return a + b; } void test01() { int a = 10; char b = 20; Myadd(a, a); // 先调用普通...
#include <iostream> #include<string> #include "util.hpp" #include<sstream> void HttpResponse(const std::string& body) { std::cout<<"Content-Length:"<<body.size()<<"\n"; std::cout<<"\n"; //http协议中的空行 std::cout<<body; return ; } int main() { //1.先获取到method const char* method = getenv("REQUEST_ME...
//#include "units.h" // //ofstream &operator<< (ofstream &lhs, Unit &rhs) //{ // // // // return lhs; //} //FlowLine SimulateFlowLine(FlowLine &FL, ifstream & ReadUnitFile, int &i, int &j) //{ // //int i = FL.TheWorkArea.size() - 1; // //int j = FL.TheWorkArea[i].Stations.size() - 1; // //Unit TempUnit; // //string Te...
/** * Tests for DBClientProxy class for leveldb * @author Bo Liu (newpoo.liu@gmail.com) * Copyright 2012 Facebook */ #include <algorithm> #include <vector> #include <string> #include <protocol/TBinaryProtocol.h> #include <transport/TSocket.h> #include <transport/TBufferTransports.h> #include <util/testharness.h> #...
#include "e.h" #include "f.h" #include "g.h" #include "c.h" using namespace std; void c(){ e(); f(); g(); }
#include "Application.h" #include "GREEN.h" #include "ModuleCollision.h" GREEN::GREEN(int x, int y) : Enemy(x, y) { backward.PushBack({ 24, 37, 32, 30 }); backward.PushBack({ 86, 34, 30, 30 }); backward.PushBack({ 132, 34, 30, 30 }); backward.PushBack({ 177,34,30,30 }); path.PushBack({ -0.5f, 0 }, 250, &b...
// VRHostControllerUIDlg.cpp : implementation file // #include "stdafx.h" #include "VRHostControllerUI.h" #include "VRHostControllerUIDlg.h" #include "RemoteClientManager.h" #include <string> #ifdef _DEBUG #define new DEBUG_NEW #endif // CAboutDlg dialog used for App About class CAboutDlg : public CDialogEx { pub...
/*********************************************************\ * Copyright (c) 2012-2018 The Unrimp Team * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software * and associated documentation files (the "Software"), to deal in the Software without * restriction, including wit...
#include "../include/TAP.h"
#pragma once #include "bplustree.hpp" #include "tool.h" #include "trainBase.h" #include "exceptions.h" #include "index.h" struct keyInfo { int userID; char catalog; shortString trainID, from, to; date Date; keyInfo() = default; keyInfo(const int &u, const date &d, const char &c, const String &t, const String...
// This file was generated based on /usr/local/share/uno/Packages/Fuse.Navigation/1.3.1/Router.ScriptClass.uno. // WARNING: Changes might be lost if you edit this file directly. #pragma once #include <Fuse.Navigation.RouterRequest.h> namespace g{namespace Fuse{namespace Navigation{struct Router__ScriptRouterRequest;}}...
/*M/////////////////////////////////////////////////////////////////////////////////////// // // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. // // By downloading, copying, installing or using the software you agree to this license. // If you do not agree to this license, do not download, instal...
#include <iostream> #include <windows.h> #include <vector> #include <TlHelp32.h> #include <string.h> using std::vector; using std::cout; using std::endl; int Error(const char* text) { cout << text << " " << GetLastError() << endl; return 1; } vector<DWORD> GetProcessThreads(DWORD pid) { vector<DWORD> tids; au...
#include <iostream> using namespace std; struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int...
#include "am_pm_clock.h" #include <iostream> #include <string> /** @brief (one liner) * * (documentation goes here) */ am_pm_clock::am_pm_clock() { hours=12; minutes=0; seconds=0; am=true; } am_pm_clock::am_pm_clock(unsigned int hrs, unsigned int mins, unsigned int secs, bo...
// Author: Avery VanAusdal // Assignment Number: Lab 3 // File Name: recursivePower.cpp // Course/Section: COSC 1337 Section 3 // Date: 9/25/2018 // Instructor: Bernard Ku /* Requirements: Recursive power function Base double, exponent int Basic positive & negative power required Exception handling for wrong data types...
#include "ButtonImage.h" Gui::ButtonImage::ButtonImage(Ren::Context &ctx, const char *tex_normal, const Vec2f uvs_normal[2], const char *tex_focused, const Vec2f uvs_focused[2], const char *tex_pressed, const Vec2f uvs_press...
// Created on: 1993-10-12 // Created by: Remi LEQUETTE // Copyright (c) 1993-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU ...
#ifndef INCLUDE_FIG_H #define INCLUDE_FIG_H #include <iostream> #include <string> #include <vector> #include <stack> using namespace std; class Fig { public: enum ObjectType { Ellipse = 1, Polyline = 2, Spline = 3, Text = 4, Arc = 5, Compound = 6 }; enum PolylineSubtype { PolylineST ...
// Autor: heph1030 // Datum: 04.01.2021 // Zweck: Zeitraffervorrichtung: // - 2 Servos // - 1 OLED-Display // - 3 Taster // Bibliotheken: #include <ESP32Servo.h> // Version 0.6.2 #include <Adafruit_GFX.h> ...
// // Created by 周华 on 2021/5/1. // #ifndef RAYTRACING_SPHERE_H #define RAYTRACING_SPHERE_H #include "../Math/Vector.h" #include "Geometry.h" class Sphere : public Geometry { public: //这里const保证参数不被修改,引用保证结构不需要在参数化时进行值拷贝 Sphere(const Vector3& Center, float Radius) { this->Center = Center; thi...
#include <Arduino.h> #include <WiFi.h> #include <WiFiMulti.h> #include <ESPmDNS.h> #include <ArduinoOTA.h> #include "config.h" #include "OpenWeatherMap.h" OpenWeatherMap owm(OPEN_WEATHERMAP_API_KEY, OPEN_WEATHERMAP_CITY_CODE); #include <PubSubClient.h> static WiFiClient wifi_mqtt_client; static PubSubClient mqtt_c...
/* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */ /* Selftest for broken html */ group "layout.broken"; require init; include "modules/doc/frm_doc.h"; include "modules/layout/box/box.h"; include "modules/layout/cascade.h"; include "modules/layout/layoutprops.h"; include "modules/logdoc/htm_elm.h"; include "m...
#include<opencv.hpp> #include <opencv2/ximgproc.hpp> #include<iostream> #include<ctime> #include<io.h> //#include<msclr\marshal_cppstd.h> //用于数据类型转换 //using namespace msclr::interop; // //#using "PhotoEXIF.dll" //#pragma managed //托管代码 //using namespace PhotoEXIF; //dll中的命名空间 using name...
//------------------------------------- #include<iostream.h> #include<ctime> #include<conio.h> //---------------------------------------- // int const CLK_TKE=1000; class Watch { double begin; double end; public: Watch(); Watch(clock_t); void Start(); void Stop(); void Show(); }; //---------...
#include <Servo.h> Servo servo2; void setup() { servo2.attach(12); } void loop() { int position; int desiredposition = 0; servo2.write (180); delay(5000); servo2.write (0); delay(2000); servo2.write (180); delay(5000); servo2.write (0); for (position = 180; position >= 0; position -=...
/* *@author: profgrammer *@date: 08-01-2019 */ #include <bits/stdc++.h> using namespace std; int sum_digits(int n){ if(n < 10) return n; return n%10 + sum_digits(n/10); } int main() { int n; cin>>n; cout<<num_digits(n)<<endl; }
// Include important C++ libraries here #include <sstream> #include <SFML/Graphics.hpp> #include <SFML/Audio.hpp> //#include <switch.h> #include <dirent.h> #include <stdint.h> #include <cstdio> #include <stdint.h> #include "cloud.cpp" // Define the switch resolution here we are using the switch's fullscre...
#include <bits/stdc++.h> using namespace std; //Linked list node structure struct node { const char *str; // store pointer to string struct node *next; // store pointer to node }; //create new node by allocating memory struct node *getnode(const char *s) { struct node *newnode = (struct node *)malloc(size...
= その場のノリで軽率に技術同人誌を初執筆した上で感じたこと //flushright{ 七海 @nanami_seisaku @<br>{} 七海周遊記 //} == 著書の紹介 しがない大学院生の七海です。 ESP32というマイコンを使った電子工作とかUnityを使った音ゲー制作をしています。 == 技術同人誌に触れたきっかけ 技術同人誌というものの存在を知ったきっかけは、 2019年11月23日に大阪難波にて開催された銭けっと第三回大会です。 そのイベントには一般参加者として参加しましたが、「コミケでの技術系ブースみたいなもんかなぁ」と思ってルンルン気分で会場に向かったことを覚えています。 == 技術同人誌を書き始め...
// // Created by FF on 2019-06-20. // #include <cstring> #include "AudioChannel.h" #include "macro.h" /** * 音频首帧数据,包含编码器信息 * @return */ RTMPPacket *AudioChannel::getAudioTag() { u_char *buf; u_long len; // 编码器信息,需要音频第一帧发送,通知后面音频如何解码 faacEncGetDecoderSpecificInfo(audioCodec, &buf, &len); int bod...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ #include "core/pch.h" #include "module...
#pragma once #include <vector> #include <string> using namespace std; void ComputePrefixFunction(vector<int> &pi, string prefix); bool StringMatcher(string pattern, string text); unsigned int PartialStringMatcher(string pattern, string text);
#include "UpdateTabStatusProc.h" #include "HallHandler.h" #include "PlayerManager.h" #include "GameCmd.h" #include "ProcessManager.h" #include "Configure.h" REGISTER_PROCESS(GMSERVER_MSG_TABSTATUS, UpdateTabStatusProc) int UpdateTabStatusProc::doRequest(CDLSocketHandler* client, InputPacket* pPacket, Context* pt ) { ...
#ifndef _SERVER_DATABASE_HPP_ #define _SERVER_DATABASE_HPP_ #include <memory> #include "Constants.hpp" #include "DataManager.hpp" class Database { public: Database(Database const&) = delete; void operator=(Database const&) = delete; static Database& GetInstance() noexcept { static Database...
#include <iostream> using namespace std; // Fallen Ihnen irgendwelche Aehnlichkeiten auf? int main() { // Feld mit Startwerten int feld[] = {2, 4, 6, 8, 10}; // bilde die Summe aller Elemente // Variable fuer die Summe int summe = 0; // Fuer jedes Element: erhoehe Summe for(int i = 0...
// standard includes #include <cmath> #include <cstdlib> // system includes #include <ros/ros.h> #include <sensor_msgs/JointState.h> std::string basename(const std::string& path) { // search for the last directory separator std::string::size_type pos = path.find_last_of('/'); if (pos == std::string::npos)...
#include "GroupsResultsAssembler.h" #include "../Model/GroupsResultsColumnIndex.h" #include "../Model/GroupsResultsModel.h" GroupsResultsForm *GroupsResultsAssembler::assembly(const QList<GroupResults> &groupsResults, QWidget *parent) { auto view = new GroupsResul...
#include <iostream> #include <cassert> #include <dax/Types.h> #include "PointLocator.h" int main(void) { // fake points, we just need to number of points std::vector<dax::Vector3> pts128(128); std::vector<dax::Vector3> pts129(129); // PointLocator to automatically calculate the divisions PointLo...
#include <iostream> #include <string.h> using namespace std; int matrix[15][15]; void setMatrix(){ memset(matrix, 0, sizeof(matrix)); for(int i = 1; i < 15; i++){ matrix[0][i] = i; matrix[i][1] = 1; } } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); int tc; cin ...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
/**************************************************************************** * Copyright (c) 2011 GeoMind Srl. www.geomind.it * All rights reserved. * *--------------------------------------------------------------------------- * This software is part of the GeoTree library by GeoMind Srl; * it is not allowed t...
bool serial_write(String input) { char* cString = (char*) malloc(sizeof(char)*(input.length() + 1)); input.toCharArray(cString, input.length() + 1); Serial1.write(cString); } bool serial_write_debug(String input) { input = "\n DEBUG ARDUINO " + input +"\n"; char* cString = (char*) malloc(sizeof(char) * (inpu...
// Created on: 1997-12-05 // Created by: Philippe MANGIN // Copyright (c) 1997-1999 Matra Datavision // Copyright (c) 1999-2014 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GN...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** ** Copyright (C) 1995-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef _PLUGINMEMORYHANDLER_H_INC_ #define _PLUGINMEMORYHANDL...
// // Created by 钟奇龙 on 2019-05-16. // #include <iostream> #include <vector> using namespace std; int getLessIndex(vector<int> helper,int target){ int left = 0; int right = helper.size()-1; int res = -1; while(left <= right){ int mid = left + (right-left)/2; if(helper[mid] >= target){ ...
#ifndef __POLE_H_INCLUDED__ #define ___POLE_H_INCLUDED__ #include "Plate.h" class Pole{ Plate* plates; int plate_size; public: int value; Pole(); Pole(int max); Pole(int max, int initial_plate); void add(Plate plate); void print_status(); void print_status_visual(int h, int maxi); int get_plate_size(); P...
//File: cooperative_robots_final.cpp // Date: 11/02/21 // Description: 2 robot mapping // Author: Athena Petropoulou // Modifications: #include <include/headers.h> #include <include/functions.h> #include <src/util.cpp> #include <src/odometry.cpp> #include <src/pathPlanning.cpp> #include <s...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "Engine/World.h" #include "Tile.generated.h" UCLASS() class SURVIVING_GROUNDS_API ATile : public AActor { GENERATED_BODY() public: // Sets default values...
#include"conio.h" #include"stdio.h" void main(void) { int birthYear, currentYear, myAge, Days, Month; clrscr(); printf ("enter the birthYear: "); scanf ("%d", & birthYear); printf ("enter the currentYear: "); scanf ("%d", & currentYear); myAge=currentYear-birthYear; printf ("\n U r now %d years old",myAge); Day...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Yngve Pettersen ** */ // URL Server Name // URL Name #ifndef ...
/* * This node is to display all the cars are waiting to be parked * Inputs: * ROS message(string) * Outputs: * hardware modbus operation */ #include <stdio.h> #include <stdlib.h> #include <errno.h> #include <sys/time.h> #include <modbus/modbus.h> #include <iconv.h> using namespace std; #include <mutex> ...
#include <iostream> using namespace std; char s[51][51]; int vx[] = { 0, 1, 1, 1, 0, -1, -1, -1}; int vy[] = {-1, -1, 0, 1, 1, 1, 0, -1}; // 周囲にMineがいくつあるかカウントする int countMine(int h, int w, int x, int y) { int cnt = 0; for (int i = 0; i < 8; i++) { if (((x + vx[i] < w && x + vx[i] >= 0) || (y + ...
// Copyright (c) 2020 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** Copyright (C) 2008 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #include "core/pch.h" #ifdef OPERASPEEDDI...
// mpi #include <mpi.h> // std #include <cstdio> #include <cmath> const double g_pi = 3.14159265358979323846264338327950288419716939937510582; // calculate partial integral of 4/(1+x^2) on [0,1) and returns partial integral double partial_integral(const int myid, const int numprocs, const int intervals){ const do...
#pragma once #include "pch.h" class IndexBuffer { private: Microsoft::WRL::ComPtr<ID3D11Buffer> indexBufferPtr; UINT size; public: IndexBuffer() { indexBufferPtr = nullptr; size = 0; } void init(ID3D11Device* device, DWORD* data, const UINT nrOf) { size = nrOf; D3D11_SUBRESOURCE_DATA bufferData; bu...
#include <ffw/utils/ringbuffer.h> #define CATCH_CONFIG_MAIN #include "catch.hpp" TEST_CASE("Testing RingBuffer", "ffw::RingBuffer") { ffw::RingBuffer<int> buffer; REQUIRE(buffer.getSize() == 0); REQUIRE(buffer.back() == NULL); REQUIRE(buffer.range() == 0); buffer.create(8); REQUIRE(buffer.ge...
#ifndef M2V_POST_H #define M2V_POST_H #include "M2VData.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <3ds.h> class M2VTextPost{ private: //char username[USERNAME_MAX_LENGTH]; char * username; //int usernameSize; //char title[TITLE_MAX_LENGTH]; //char text[TEXT_MAX_LENGTH]; char * ti...
#include<iostream> using namespace std; class base{ private: int real,imag; public: base(int r, int i){ real=r; imag=i; } base(){ } void info() { cout<<real<<" "<<imag<<endl; } base operator+(base const &b) { base d; d.real=real+b.real; d.imag=imag+b.imag; return d; } }; in...
#include<iostream> #include<vector> #include<algorithm> #include<stack> using namespace std; struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode(int x) : val(x), left(NULL), right(NULL) {} }; #define inf 9999 void Init_TreeNode(TreeNode** T, vector<int>& vec, int& pos) { if (vec[pos] == inf || vec...
#include"pch.h" #include"WinState.h" void WinState::readHighScoreFromFile() { std::ifstream inStream; inStream.open(m_fileToRead); int score = 0; std::string name = ""; if (inStream.is_open()) { while (!inStream.eof() && m_nrOfHighScore != 10) { inStream >> name; inStream >> score; if (name != "") ...
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; const int maxn = 1e...
// Copyright (c) 2016 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special ...
#pragma once #include <map> #include <SFML/System/Vector2.hpp> #include "Map.hpp" class Player { public: Player(Map *map); Player(Map *map, const sf::Vector2f &pos, const sf::Vector2f &look, float fov, float height=0.5f); void SetPosition(const sf::Vector2f &pos); const sf::Vector2f &GetPosition() const; cons...
// // tutorialPolygon.cpp // OpenGLProjects // // Created by Dayuan Chen on 9/5/19. // Copyright © 2019 N33MO. All rights reserved. // #include <iostream> #include <GL/glew.h> #include <GLFW/glfw3.h> // set Window Size const GLuint WINDOW_WIDTH = 800, WINDOW_HEIGHT = 640; int main( void ) { GLFWwindow *wind...
#pragma once #include "../../structs/Transform.h" namespace Game { class PhysicsTransform { public: virtual Transform fromPhysics() = 0; virtual void setTransform(Transform transform) = 0; }; }
/* this holds data for interfacing with the graphics card, both from OpenGl and OpenCL. These data * are held in buffered objects. Buffer objects are also how OpenGL and OpenCL share information * and as such this class will also be responsible for creating the interopability between them on * these buffer objects. ...
// BEGIN CUT HERE // PROBLEM STATEMENT // There are several skyscrapers arranged in a row. You're // interested in finding the one from which the maximal // number of other skyscrapers can be seen. The i-th // skyscraper can be represented as a line segment on a plane // with endpoints (i, 0) and (i, heights[i])....
#ifndef _ComingGameProc_H_ #define _ComingGameProc_H_ #include "IProcess.h" class ComingGameProc :public IProcess { public: ComingGameProc(); virtual ~ComingGameProc(); virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket,Context* pt) ; virtual int doResponse(CDLSocketHandler* cli...
#include "Camera.h" #include <string> #include <iostream> Camera::Camera(int width, int height, glm::vec3 position) : c_Width(width), c_Height(height), c_Position(position) { } Camera::~Camera() { } void Camera::updateMatrix(float FOVdeg, float nearPlane, float farPlane) { glm::mat4 view = glm::...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- ** ** Copyright (C) 2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** */ #include "core/pch.h" #ifdef CRYPTO_XML_DIGITAL_SIGNING_SUPPOR...
/* * Forward Declarations * Nana C++ Library(http://www.nanapro.org) * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) * * 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) * * @file: _GUI/fwd.h * */ #pr...
/* spotlight.cpp Colin Fitt -- cfitt -- C6312039 Course CpSci 1020, Prof. Catherine Hochrine Major Programming Assignment #3: Due 11:59pm Sunday, April 20th The spotlight_t is a derived class of light_t. The spotlight will illuminate the hit location if and only if a vector from the location of the spotlight (light...
#include <bits/stdc++.h> using namespace std; #define TESTC "" #define PROBLEM "11743" #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) int main(int argc, char const *argv[]) { #ifdef DBG freopen("uva" PROBLEM TESTC ".in", "r", stdin); freopen("uva" PROBLEM ".out", "w", stdout); #endif string str;...
//my bluetooth adress A086:C6:8F4506 #include <Arduino.h> #include "button.h" #include "BTmodule.h" #include "usersideConfiguration.h" int buttonPin = 14; //D5 int rxPin = 13; int txPin = 15; int pin34Pin = 12; //D6 int relayPin = 16; //D0 //the array of adresses and the configurator object for it String adresses[5]...
// Copyright (c) 2017 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special ...
#include <iostream> #include <stdio.h> #include <cstring> #include <algorithm> #include <queue> using namespace std; /* A:小活活 T: 唐 僧 W: 悟 空 Y: 妖 怪 [当前劫难+1] X: 西 经 P: 禁 地 数字: [当前劫难+数字-'0'] 走一步需要耗费一天时间 */ const int maxn = 150; const int maxm = 150; const int maxs = 1<<2; // 3个状态 int dir[] = {0...
#ifndef EMOTIC_H #define EMOTIC_H #include <QObject> #include "include/constants.h" #include "hidapi/hidapi.h" #include "mcrypt.h" class emotic : public QObject { Q_OBJECT public: explicit emotic(QObject *parent = 0); signals: public slots: private: ptr_emokit_device device; }; #endif // EMOTIC_H
void store(char move[]){ //Stores each string in storage.txt after binary searching for the optimum place to put it, and shifting all other strigs in file afterwards while(l<r){ int m=l+(r-l)/2; if(strcmp(move,stringToCheck)<=-1){l=m;}//in this line, store a cursor position called "cursor" else {r=m;} } //fpr...
#pragma once #include "CalContourLines.h" #include "opencv2/core.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/imgproc/imgproc.hpp" using namespace cv; class CDrawContourLines { public: CDrawContourLines(vector<MeasureData> vecHeightDots, double dImgW = 800.0, double dImgH = 600.0, int nGridW = 5, ...
#include "stdafx.h" #include "Game.h" int WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT ) { // Create application object Game app; try { app.go(); } catch( Ogre::Exception& e ) { MessageBox( NULL, e.getFullDescription().c_str(), "An exception has ...
/* * File: * Author: Elijah De Vera * Created on January 21, 2021 * Purpose: Inflation Problem */ //System Libraries #include <iostream> //Input/Output Library #include <iomanip> using namespace std; //User Libraries //Global Constants, no Global Variables are allowed //Math/Physics/Conversi...
#include "stdafx.h" #include "TransformerSkeleton.h" #include "MeshCutting.h" #include <iostream> TransformerSkeleton::TransformerSkeleton() { transformerRootBone = nullptr; showSkeleton = true; showMesh = true; } TransformerSkeleton::~TransformerSkeleton() { if (transformerRootBone){ delete transformerRootBon...
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. #include "Project_152.h" #include "Project_152Character.h" #include "PaperFlipbookComponent.h" #include "Components/TextRenderComponent.h" #include "Components/ArrowComponent.h" #include "Project_152GameMode.h" #include "EngineGlobals.h" #include "Engine.h" ...
// // Created by OLD MAN on 2020/1/7. // //救生船从大本营出发,营救若干屋顶上的人回到大本营,屋顶数目以及每个屋顶的坐标和人数都将由输入决定,求出所有人都到达大本营并登陆所用的时间。 // //在直角坐标系的原点是大本营,救生船每次从大本营出发,救了人之后将人送回大本营。坐标系中的点代表屋顶,每个屋顶由其位置坐标和其上的人数表示。 // //救生船每次从大本营出发,以速度 50 米/分钟驶向下一个屋顶。达到一个屋顶后,救下其上的所有人,每人上船 1 分钟。然后船原路返回,回到大本营,每人下船 0.5 分钟。假设原点与任意一个屋顶的连线不穿过其它屋顶。 // //输入格式 \ //第一行,一个...
#include<bits/stdc++.h> using namespace std; main() { long long int i, j; char s1[100000]; while(gets(s1)) { long long int sum1=0, sum2=0, sum3, len; len = strlen(s1); if(s1[0]=='0' && len==1)break; for(i=0; i<len; i=i+2) sum1+=s1[i]-'\0'; for(j=1; j<...
#define F_CPU 8000000UL #include <avr/io.h> #include <avr/interrupt.h> #define PIN (1<<PB1) void init_timer1(unsigned long freq) { TCCR1 = 0; // stop the counter TCNT1 = 0; OCR1C = 0; if(freq==0) return; int prescale = 1; while(freq * 256 * (1<<(prescale-1)) < F_CPU)...
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4; -*- * * Copyright (C) 2007-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef POSIX_IPC_EVENT_HANDLER_H #define POSIX_IPC_EVENT_HANDLER_H class IpcHandle;...
void main_code(void) { tempC_ambient = SL19.getAmbientTempC(); // Temperature in Celcuis tempC_object = SL19.getObjectTempC(); // Temperature in Celcuis OD01.set2X(); OD01.print(" "); OD01.print(tempC_object); OD01.println(" C"); OD01.set1X(); OD01.println(" Object Temp above"); OD01.println(""); O...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2008 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef MODULES_HISTORY_HISTORY_MODULE_H #define MODULES_HISTORY...
#ifndef CHUNKRENDERER_H #define CHUNKRENDERER_H #include "shader/chunkshader.h" #include <vector> class ChunkMesh; class Camera; class ChunkRenderer { public: friend class RenderManager; void add(const ChunkMesh &chunkMesh); void render(const Camera &camera); private: ChunkRenderer() = default; ...
#include <ball.h> #include <sstream> Ball::Ball(double x, double y) { this->x = x; this->y = y; this->x_vel = 0; this->y_vel = 0; this->size = 5; this->max_vel = 8; } Ball::Ball(double x, double y, double x_vel, double y_vel, int size, double max_vel) { this->x = x; this->y = y; ...
#include "std_lib_facilities.h" vector<int> gv = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512}; void f (vector<int> v) { vector<int> lv(10); lv = v; for (int i = 0; i < lv.size(); ++i) cout << lv[i] << '\t'; cout << endl; vector<int> lv2 = v; for (int i = 0; i < lv2.size(); ++i) cout << lv2[i] << '\t'; cout << e...
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <float.h> #include "main_aux.h" #include "sp_image_proc_util.h" #define NUMBER_OF_HISTOGRAMS_COLORS (3) calcPicResultEnum calcPicturesInfo(char imgsPath[], char imgsPre[], char imgsSuf[], int imgsCount, int nBins, int maxNumberOfFeatures, ...
#include<iostream> #include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<string.h> using namespace std; int lru_ref8(int ibuf[BUFSIZ],int len,int frames) { int arr[frames][2],pos=0,flag=0,pointer=0,pagerep=0,min=0; for(int i=0;i<frames;i++) { arr[i][0]=-1; arr[i][1]=0x00; } for(int i=0;i<len;i++) { ...
/* Author : AMAN JAIN DATE: 03-07-2020 PROGRAM -> Quick Sort Time complexity : Overall Time complexity O(nlogn) 1. Best Case O(nlogn) (where n is the size of the array) -> When array is not random 2. Worst Case O(n*n) (Where n is the size of the array) -> When array is sorted increasingly or decreasingly *...
#include <iostream> #include "Board.h" #include "Location.h" #include "Human.h" #include "Computer.h" using namespace std; int main() { Board b; b.show(); Computer c; c.placeShips(); Human h; cout << "Game start!" << endl; cout << "Your turn" << endl; c.showBoard(); while (!c.isAll...