text
stringlengths
8
6.88M
// Copyright (c) 2015, Baidu.com, Inc. All Rights Reserved // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Copyright (c) 2011 The LevelDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the ...
#ifndef Student_hpp #define Student_hpp #include <string> using namespace std; class Room; class Student { private: Room* currRoom; public: string name; Student(string name); void setRoom(Room* room); }; #endif
int led1 = 4; int led2 = 5; int led3 = 6; int led4 = 9; int led5 = 10; int potValue; int ledValue; void setup() { } void loop() { potValue = analogRead(0); ledValue = map(potValue, 1023, 0, 0, 255); analogWrite(led1, ledValue); analogWrite(led2, ledValue); analogWrite(led3, ledValue); analogWrite(...
#include <ros/ros.h> #include <nav_msgs/Odometry.h> #include <tf/tf.h> void callback ( const nav_msgs::OdometryConstPtr &msg){ double yaw = tf::getYaw(msg->pose.pose.orientation); yaw = (yaw*180/M_PI); ROS_INFO ("yaw: %lf", yaw); } int main(int argc, char **argv){ ros::init(argc,argv,"qYaw"); ros::NodeHandle n...
#include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> #include <set> #include <stack> #include <sstream> #include <string> using namespace std; struct TreeNode { int val; TreeNode* left; Tr...
#include "renderer/ShaderProgram.h" namespace revel { namespace renderer { ShaderProgram::ShaderProgram() { } ShaderProgram::~ShaderProgram() { } } // ::revel::renderer } // ::revel
//! @file soundmanager.h //! @brief SoundManagerクラスの宣言 /** * LynxOPS * * Copyright (c) 2015 Nilpaca * * Licensed under the MIT License. * https://github.com/Nilpaca/LynxOPS/blob/master/LICENSE */ //-------------------------------------------------------------------------------- // // OpenXOPS // Copyright (c)...
#include "holereview.h" HoleReview::HoleReview(QGraphicsItem *parent) : BoardPart(parent), black(false), white(false) { } QRectF HoleReview::boundingRect() const { return QRectF(0, 0, 50, 50); } void HoleReview::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(opti...
#ifndef INVALIDMAPPEDFILESTATE_H_INCLUDED #define INVALIDMAPPEDFILESTATE_H_INCLUDED #include <exception> namespace Utilities { class InvalidMappedFileState : public std::exception { std::string _Message; public: InvalidMappedFileState(std::string message) : _Message(message) { } virtual ~InvalidMappedFileStat...
// // Compiler/AST/Context.h // // Brian T. Kelley <brian@briantkelley.com> // Copyright (c) 2007, 2008, 2011, 2012, 2014 Brian T. Kelley // // Chris Leahy <leahycm@gmail.com> // Copyright (c) 2007 Chris Leahy // // This software is licensed as described in the file LICENSE, which you should have received as part of th...
#include <iostream> #include <string> #include <vector> #include "eBook.h" #include "DocumentConverter.h" // Delimiter for metadata in the .txt file that stores eBook contents const char DELIM = '|'; eBook::eBook() { } // Filename constructor // Loads all appropriate information from the file eBook::eBoo...
// avvinci - summers 18 // #include"prettyprint.hpp" #include<bits/stdc++.h> using namespace std; typedef pair<long long,long long > P; #define mod 1000000007 #define pb emplace_back #define fs first #define sc second #define ll long long #define fr(it,st,en) for(it=st;it<en;it++) #define all(container) contai...
/******************************************************************************* * Cristian Alexandrescu * * 2163013577ba2bc237f22b3f4d006856 * * 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ...
#include <whiskey/Parsing/ParserRule.hpp> #include <whiskey/Core/Verbose.hpp> #include <whiskey/Parsing/ParserResult.hpp> #include <whiskey/Parsing/ParserContext.hpp> namespace whiskey { ParserRule::ParserRule(std::string name, std::string expected) : name(name), expected(expected) {} std::string &ParserRule::getNam...
// simple countdown from user input #include <iostream> using namespace std; int main() { int n; cout << "Enter an integer between 1 and 100:"; cin >> n; while (n > 0) { cout << n << ", "; --n; } cout << "BOOM \n"; return 0; }
//--------------------------------------------------------------------- #include <vcl.h> #pragma hdrstop #include "Unit3.h" #include "Unit1.h" //--------------------------------------------------------------------- #pragma resource "*.dfm" TAboutBox *AboutBox; //-------------------------------------------------------...
#include <cstdio> int main() { char str[100]; int i = 0, count = 0, pos[80] = {-1}; // init pos[count++] = 0; while(scanf("%c", str+i) != EOF) { if(str[i] == ' ') { pos[count++] = i+1; // printf("--%d--\n", i-1); } i++; } int tmp = 0; // printf("==Count: %d==\n", count-1);...
#include <cstdio> #include <algorithm> using namespace std; const int MAXTYPE = 2000; typedef struct{ double remain; // WARNING: 审题不仔细 double profit; // **$/T double total_val; } Cake; bool cmp (Cake a, Cake b); int main() { int cnum, demand; double tmp, wealth = 0; Cake cakes[MAXTYPE]; scanf("%d %d...
#include <bits/stdc++.h> using namespace std; class Solution { public: void sortColors(vector<int> &nums) { map<int, int> m; for (int a : nums) m[a]++; nums.clear(); for (auto item : m) { int k = item.second; while (k--) ...
/****************************************************************************** ** ** Copyright (C) 2015 The Qt Company Ltd. ** Contact: http://www.qt.io/licensing/ ** ** This file is part of the Qt PDF Module. ** ** $QT_BEGIN_LICENSE:COMM$ ** ** Commercial License Usage ** Licensees holding valid commercial Qt license...
#include <iostream> int main() // int : 결과의 자료형; main : 함수의 이름; () : 인수 { // 표준 출력 스트림으로 문장을 출력함 int a; std::cout << "나의 첫 번째 C++프로그램" << std::endl; //문장의끝은 ;(세미콜론) std::cin >> a; std::cout << a << "가 입력되었습니다." << std::endl; return 0; // 0이 리턴되면 정상적인 종료로 보통 판단 }
/* * ConfigTranslator.cpp * * Created on: 24 Mar 2011 * Author: "SevenMachines <SevenMachines@yahoo.co.uk>" */ //#define CONFIGTRANSLATOR_DEBUG #include "ConfigTranslator.h" namespace cryomesh { namespace config { ConfigTranslator::ConfigTranslator(std::istream & is) : entries() { // open file this->rea...
//! 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) scanf("...
/* Copyright (c) 2011 Andrew Wall 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 without limitation the rights to use, copy, modify, merge, publish, distribute, sub...
/************************************************* * Publicly released by Rhoban System, August 2012 * www.rhoban-system.fr * * Freely usable for non-commercial purposes * * Licence Creative Commons *CC BY-NC-SA * http://creativecommons.org/licenses/by-nc-sa/3.0 *************************************...
/* THIS CODE IS FOR CALIBRATION OF SOIL MOISTURE SENSOR * * 1. Open the serial port monitor and set the baud rate to 9600 * 2. Record the sensor value when the probe is exposed to the air * as "Value 1". This is the boundary value of dry soil “Humidity: 0%RH” * 3. Take a cup of water and insert the probe into...
#include <stdio.h> #include <iostream> using namespace std; typedef int Element; const int PRIME_BASE = 29; const int MAXTAM = 100000; void Reverse(string* str){ int n = (*str).size() - 1; for(int i = 0; i < (*str).size() / 2; i++){ swap( (*str)[i], (*str)[n] ); n--; } } string IntToStrin...
#pragma once #include <cstdint> #include "asylo/platform/primitives/primitives.h" namespace asylo { namespace primitives { static constexpr uint64_t keat_goldEnclaveSelector = kSelectorUser + 6 static constexpr uint64_t kcollisionEnclaveSelector = kSelectorUser + 5 static constexpr uint64_t kcollide_objectEnclaveSe...
//-------------------------------------------------------------- //-------------------------------------------------------------- // // AngraConstantMgr implementation file // // Authors: P.Chimenti // // 25-3-2010, v0.01 // //-------------------------------------------------------------- //-----------------------...
#include "EvenElevator.h" bool EvenElevator::availableInFloor(int floor) { return floor > 0 && floor <= this->maxFloor && (floor == 1 || !(floor & 1)); } std::string EvenElevator::type() const { return "EvenElevator"; } void EvenElevator::outputPosition(std::ofstream& fout) const { fout << "EvenElevator\t\t" << t...
// This file is subject to the terms and conditions defined in 'LICENSE' in the source code package #ifndef JACTORIO_INCLUDE_GAME_PLAYER_PLAYER_ACTION_H #define JACTORIO_INCLUDE_GAME_PLAYER_PLAYER_ACTION_H #pragma once #include <array> #include <functional> #include "jactorio.h" namespace jactorio::render { cla...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** This program is free software; you can redistribute it and/or //** modify it under the terms of the GNU General Public License //** as published by the Free Software Foundation; either ...
#include <stdio.h> #include<algorithm> using namespace std; #define MAXN 105 bool cmp(int a,int b){ return a>b; } int main(){ int K,n[MAXN]; int tag[MAXN] = {0}; scanf("%d",&K); for(int i = 0;i<K;i++){ scanf("%d",&n[i]); int tmp = n[i]; if(tmp%2==0) tmp/=2; else tmp...
/* // Copyright 2007 Alexandros Panagopoulos // // This software is distributed under the terms of the GNU Lesser General Public Licence // // This file is part of Be3D library. // // Be3D is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public Licen...
#ifndef SEARCH_ITEMS_H #define SEARCH_ITEMS_H #include <QDialog> #include <QtSql> #include<QCompleter> #include<QMenuBar> #include<QMenu> #include<QDate> #include<QSqlQuery> #include<QMessageBox> #include<QByteArray> #include<QtNetwork/QNetworkInterface> #include<QBuffer> #include<QFile> #include<QIODev...
#ifndef FUNC_H #define FUNC_H #include <iostream> #include <cstring> void init(unsigned char *s, unsigned char *k, const int r); unsigned char get_gamma(unsigned char *q1, unsigned char *q2, unsigned char *s); void encode(unsigned char *plain_text, int size, unsigned char *k, int r); void decode(unsigned char *pla...
/* EE 205 Lab 2 * * Name: Paulo Lemus * File: Bank.cpp * Date: 1/19/2017 * * Create a bank account struct with account number, name, balance. * Create 3 basic account customers: alice, bob, charlie. * Store them in an aarray of structs * */ #include <cstdlib> #include <iostream> #include <ctime> // f...
#include "Block.h" #include <iostream> Block::Block(float x , float y) { position = sf::Vector2f(x , y); } Block::~Block() {} bool Block::Collision(character* obj , int* result , sf::Vector2u& mySize , sf::Vector2u& objSize) { if (!(obj->position.x + objSize.x < position.x || //left side col...
#include "Player2Factory.h" Player2 *Player2Factory::choice(int choice) { if(choice == 2) return new HumanPlayer(24 / 2, 80 - 3); else if (choice == 1) return new EasyComputer(24 / 2, 80 - 3); else if (choice == 3) return new HardComputer(24 / 2, 80 - 3); else return NULL; }
#ifndef SRC_EXCEPCOES_H_ #define SRC_EXCEPCOES_H_ #include <iostream> #include "Date.h" using namespace std; /* * Excepcoes */ /** * Excepçao quando um cliente ja existe * */ class ClienteExistente{ string nome; public: ClienteExistente(string nome){ this->nome = nome;} string getNome() const{return nome;} };...
// // Created by Lennart Oymanns on 03.05.17. // #ifndef NumberRepr_hpp #define NumberRepr_hpp #include <cmath> #include <cstdlib> #include <iomanip> #include <sstream> #include <string> #include <boost/multiprecision/cpp_int.hpp> namespace Equation { using Integer_t = boost::multiprecision::cpp_int; using Ration...
#pragma once #include "CHandler.h" #include "CShaderManager.h" struct SDrawingInfo { string PolygonName; string Program; T4Double Global_Color; int DrawMode; //optional T4Double Line_Color; }; class CDrawing : public CHandler { public: CShaderManager* V_PSM; SVerArray V_Array; string V_Program; // what pro...
#pragma once #include "process.hh" #include <functional> #include <mutex> #include <thread> #define LOCK_GUARD(X) std::lock_guard<decltype(X)> l(X) #define DELETE_COPY_MOVE(X) \ X(X&) = delete; \ X(const X&) = delete; \ X& operator=(X&) = delete; \ X& operator=(const X&) = delete namespace...
#pragma once #include<glad/glad.h> #include<iostream> #include<string> #include"stb_image.h" class CTexture { public: CTexture(); ~CTexture(); CTexture(const char* picPath, GLint picColorType, bool flip_vertic); unsigned int m_TexID; private: }; CTexture::CTexture() { } CTexture::~CTexture() { } inline CTextur...
/* Rishabh Arora IIIT-Hyderabad */ #include <bits/stdc++.h> using namespace std; typedef pair<int,int> II; typedef vector<int> VI; typedef vector<II> VII; typedef long long int LL; typedef unsigned long long int ULL; #define MAXSIZE 400005 #define mod 1000000007 #define rep(i, a, b) for(i = a; i < b; i++) #def...
// This file has been generated by Py++. #ifndef WidgetComponentMap_hpp__pyplusplus_wrapper #define WidgetComponentMap_hpp__pyplusplus_wrapper void register_WidgetComponentMap_class(); #endif//WidgetComponentMap_hpp__pyplusplus_wrapper
#pragma warning(disable : 4996) #include "hashTable.h" using namespace std; HashTable::HashTable() { studnum = 100; ht = new ListHead*[studnum]; for (int i = 0; i < studnum; i++) { ht[i] = NULL; } } int HashTable::hashFunc(int key) { return key % studnum; } void HashTable::insertStudent(int key, Student* st...
#include "particles\Singularity.Particles.h" using namespace Singularity; using namespace Singularity::Graphics; using namespace Singularity::Threading; using namespace Singularity::Components; namespace Singularity { namespace Particles { IMPLEMENT_OBJECT_TYPE(Singularity.Particles, ParticleExtension,...
#include"SnakeCell.h" SnakeCell::SnakeCell(int _x, int _y) :Cell(_x, _y){}
#include "Model.h" #include "ObjReader.h" #include <iostream> void Model::printModel() { std::cout << "Model stats: " << std::endl; for (const Model::Vertex& v : this->vertexData) { std::cout << "vertex" << std::endl; std::cout << "positions: " << v.posX << ' ' << v.posY << ' ' << v.posZ << std::end...
/** * Copyright (c) 2015 TheWalkingBot. For more information, see * * Authors : Xavier BOUVARD, Josselin Pochon, Maxime Vast * * 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 ...
#include <characters/warrior.h> using namespace lab3::characters; using namespace lab3; Warrior::Warrior(const std::string &name, Place *place) :Human(name, TYPE_HUMAN, place), skill_(WARRIOR_INITIAL_SKILL) { this->talk_msgs_ = { "Hi, I am a Warrior. I am here to protect the city from the animals ...
#include <eosiolib/eosio.hpp> #include <eosiolib/print.hpp> using namespace eosio; class summ : public eosio::contract { public: using contract::contract; void add(uint64_t a,uint64_t b) { uint64_t c=a+b; print("sum",a,b,c); } }; EOSIO_ABI( summ, (add))
#include<cstdio> #include<iostream> #include<queue> #include<cmath> using namespace std; const int maxn = 1010; int x[maxn],y[maxn]; priority_queue<long long> q; int main() { int n,k1,k2; while(cin >> n >> k1 >> k2) { while(!q.empty()) q.pop(); for(int i=0; i<n; i++) ...
#include "../header/restaurant.hpp" Restaurant::Restaurant(const string &restaurant_category) { this->restaurant_category = restaurant_category; } const string &Restaurant::get_restaurant_category() const { return this->restaurant_category; } void Restaurant::set_restaurant_category(const string &restaurant_...
#include <dsnutil/log/init.h> #include <dsnutil/log/sinkmanager.h> #include <dsnutil/null_deleter.h> #include <boost/log/trivial.hpp> #include <boost/log/utility/setup/common_attributes.hpp> #include <boost/log/utility/setup/file.hpp> #include <boost/log/utility/setup/formatter_parser.hpp> /** \brief Initialize defau...
#ifndef NAVE_H #define NAVE_H #include <Entidad.h> class Juego; enum Movimiento { Izquierda, Derecha, Arriba, Abajo, NoMov }; class Nave : public Entidad { public: Nave(); void procesar_evento(sf::Event); void accion(Juego&); void pintar(sf...
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> #include<cstring> using namespace std; int lengthOfLI(vector<int>& nums) { vector<int> res; for(int i = 0; i < nums.size(); i++) { vector<int>::iterator it = std::lower_bound(res.begin(),res.end(),nums[i]); if(it == res.e...
class Solution { public: unordered_map<long long, int> dict; unordered_map<long long, int>::iterator iter; string fractionToDecimal(int numerator, int denominator) { if (numerator == 0) return "0"; dict.clear(); char *result = (char*)malloc(sizeof(char)*10000); in...
#include<bits/stdc++.h> using namespace std; int solve(int** input,int row,int col) { int** output = new int*[row]; for(int i=0;i<row;i++) { output[i]=new int[col](); } // first col intialized for(int i=0;i<row;i++) { if(input[i][0] == 1) { output[i][0] = 0; } else if(input[i][0] == 0) { outpu...
#include <iostream> #include <vector> #include <string> #include <map> #include "Token.h" #ifndef __TiBasic_h_ #define __TiBasic_h_ class TiBasic { public: TiBasic(std::vector<std::string> programVector); void clrhome() const; void tiGoto(std::string label); void disp(std::string output) const; void prompt...
#include <string> #include <iostream> #include "FileSystem.h" #include "Commands.h" #include "GlobalVariables.h" using namespace std; HistoryCommand::HistoryCommand(string args, const vector<BaseCommand *> & history):BaseCommand(args), history(history){ } void HistoryCommand::execute(FileSystem & fs) { if (verbo...
#include <LiquidCrystal.h> #include "DHT.h" //////////////////////////////////////////////////////////////////////// //Display initializing #define LCD_LIGHT_PIN A4 const int buttonPin = 6; LiquidCrystal lcd(12, 11, 5, 4, 3, 2); int buttonState = 0; ////////////////////////////////////////////////////////////////////...
#include <cmath> #include <iostream> #include <list> #include <map> #include <numeric> #include <queue> #include <unordered_map> #include <unordered_set> #include <vector> #include <set> #include <stack> #include <sstream> #include <string> using namespace std; struct TreeNode { int val; TreeNode* left; Tr...
#include <iostream> #include <vector> #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <regex> using namespace std; using namespace cv; int main(int argc, char** argv) { // [1]载入原始图和Mat变量定义 Mat srcImage = imread("jianzhu.png"); Mat m...
#ifndef INC_MismatchedCharException_hpp__ #define INC_MismatchedCharException_hpp__ /** * <b>SOFTWARE RIGHTS</b> * <p> * ANTLR 2.6.0 MageLang Insitute, 1999 * <p> * We reserve no legal rights to the ANTLR--it is fully in the * public domain. An individual or company may do whatever * they wish with source code ...
#include "easytf/operators/op_reverse.h" #include "easytf/easytf_assert.h" #include "easytf/easytf_logger.h" //meta string const std::string easytf::OP_Reverse::meta_unit_dim = "reverse_unit_dim"; easytf::OP_Reverse::OP_Reverse(const uint32_t unit_dim) { Param param; param.put_item(meta_unit_dim, Any(unit_dim)); in...
#ifndef __Boids_Replay_h_ #define __Boids_Replay_h_ #include <vector> #include <map> #include <string> #include "cocos2d.h" #include <cstdint> class SnapshotUnit : public cocos2d::Point { public: double hp; SnapshotUnit(const cocos2d::Point& pt) : cocos2d::Point(pt), hp(-1.0) { } SnapshotUnit() ...
/*! * \file TFeedBackForm.cpp * \author GoZone * \date * \brief UI: 用户反馈 * * \ref CopyRight * =======================================================================<br> * Copyright ? 2010-2012 GOZONE <br> * All Rights Reserved.<br> * The file is generated by Kaixin_Component Wizard for T...
//===--- TypeCheckRequests.cpp - Type Checking Requests ------------------===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LI...
// Player.cpp #include <iostream> #include "Player.h" #include "Random.h" #include <string> using namespace std; // Default Constructor // Initialises the data members to default values Player::Player() { mName = "Default"; mClassName = "Default"; mAccuracy = 0; mHitPoints = 0; mMaxHitPoints = ...
#include "OrderService.h" OrderService::OrderService() { //ctor } void OrderService::viewOrderList(){ char selection; while(selection != '4'){ service_header(); cout << "1. Edit last order" << endl; cout << "2. View orders" << endl; cout << "\n4. Back" << endl; cin...
#ifndef DeviceDisplayBinary_h #define DeviceDisplayBinary_h #include "Arduino.h" namespace ART { class DeviceDisplay; class DeviceDisplayBinary { public: DeviceDisplayBinary(DeviceDisplay* deviceDisplay); ~DeviceDisplayBinary(); static void create(DeviceDisplayBinary* (&deviceDisplayBinary), DeviceDis...
#include "graph/from_node.hpp" #include <string> #include "graph/node.hpp" #include "graph/unary_node.hpp" namespace flow { FromNode::FromNode(const std::string &name, NodePtr input) : UnaryNode(name), m_input(input) { } }
/*********************************************** * * DESCRIPTION: Atomic Model User Equipment (UE) * * AUTHOR: Misagh Tavanpour * * DATE: 19/09/2014 * ***********************************************/ #include "UE.h" #include "message.h" // InternalMessage .... UE::UE( const std::stri...
/// Copyright (c) Vito Domenico Tagliente #pragma once #include <map> #include <string> #include <vector> #include "builder.h" #include "common.h" #include "fsm.h" #include "node.h"
#include <iostream> #include <fstream> #include <cstring> using namespace std; ifstream fin("robots.in"); ofstream fout("robots.out"); int **matrice,Lungime_Stack = 20,Pozitie_Stack = 0; int *nrBoxes; struct deque{ char CommandType[11]; int Line,Column,Boxes,ID,Timee; deque *next,*back; }**roboti; stru...
#include"main.h" #include"physics.h" #include <iostream> using namespace std; #include<math.h> void ball_collision(float cmi[3][50],float veli[3][50], float cmj[3][50],float velj[3][50],int i,int k) { //cout<<"abhi"; //cout<<veli[2]<<endl; //cout<<velj[2]<<endl; //float r=0.2; float radial_vec_x =cmj[0][k]-cm...
class Solution { public: vector<vector<int>> matrixReshape(vector<vector<int>>& nums, int r, int c) { if (int(nums.size()) == 0 || r * c != int(nums.size()) * int(nums[0].size())) { return nums; } else { // initialize 2 d vector, otherwise there will be a bad ...
class Solution { public: int myAtoi(string str) { long res = 0; int negative_sign = 1; int cur = 0; bool has_number = true; while(cur < str.length()) { if(str[cur] == ' ' || str[cur] - '0' == 0) { cur++; continue...
#ifndef _BinaryCarLot_h_ #define _BinaryCarLot_h_ #include "Car.h" struct BinaryCarLot { private: struct Node { Node* parent; Node* left; Node* right; Car val; }; Node *root; unsigned int length; public: BinaryCarLot(void) { this->length = 0; this->...
/* * Author:zjj * Date:2014/11/8 10:20 * Desc:九度OJ1510,请实现一个函数,将一个字符串中的空格替换成“%20”。 例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy * Method:根据空格与替换字符的长度求出原串和新串的长度,从后往前替换即可 */ #include<stdio.h> #include<string.h> #define MAX 1000000 void replaceSpace(char *str) { int strLen; int newStrLen; char *p=NULL;...
// For a given string "ashs100shsdh200" the output should be the sum of the two numbers which is 300 #include<iostream> #include "bits/stdc++.h" using namespace std; int sum(string s){ string a; int flag = 0; int sum = 0; for(int i=0; i<s.size();i++){ flag = 0; a = ""; while(s...
//============================================================================ // Name : a.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostre...
#include "widimagelist.h" #include <QStringList> DualLabel::DualLabel(QWidget *parent) : QWidget(parent) { QHBoxLayout *hlayout = new QHBoxLayout(); QLabel *lab1 = new QLabel("left"); QLabel *lab2 = new QLabel("right"); lab1->setFixedSize(80, 50); lab2->setFixedSize(80, 50); hlayout->addWidget(lab1); hlayout->...
/********************************************************************* * Nixie Clock * Author: Hamid Ebrahimi Kahaki * Version 0.3 * *******************************************************************/ #include "i2c8Bit.h" #include <iostream> #include <ctime> #include <unistd.h> #define SADDR 0x20 #define MADDR ...
#ifndef VECTOR_H #define VECTOR_H #include "ext_math.h" #include "simple_math.h" #include "defs.h" struct Vector3: public Vector3Base { public: Vector3(void); Vector3(float x, float y, float z); Vector3(float x); Vector3(int x, int y, int z); Vector3(const Vector3& v); #ifdef _WIN32 Vector3( __m128 v4 ); #endif...
/************************************************************* Author : qmeng MailTo : qmeng1128@163.com QQ : 1163306125 Blog : http://blog.csdn.net/Mq_Go/ Create : 2018-03-15 21:19:35 Version: 1.0 **************************************************************/ #include <cstdio> #include <iostream> #include <vec...
void setup() { Serial.begin(9600); pinMode(9, INPUT); pinMode(10, OUTPUT); } void loop() { analogWrite(10, map(pulseIn(9, HIGH), 1100, 1900, 0, 255)); delay(20); }
#include "vista_automapa.h" using namespace App_Juego_Automapa; Vista_automapa::Vista_automapa(int pw, int ph) :w_vista(pw), h_vista(ph), margen_w(w_vista/2), margen_h(h_vista/2) { if(! (w_vista % 2) || !(h_vista % 2)) { throw new std::runtime_error("La vista de automapa debe inicializarse con valores impares"...
#include "energyOptimal.h" #include <unsupported/Eigen/MatrixFunctions> void energyOptimalWps(Eigen::Matrix3Xd& control, const Waypoint* wps, const double* times, const int len, const OrbitalParams& p){ } //Given multiple waypoints "" "", genereate the optimal interim velocities void optimalVelocityAlg(Eigen::...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Character.hpp :+: :+: :+: ...
// Copyright Marc Bodmer 2011-2012. // 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) #pragma once #include "detail/constants.hpp" #include "detail/types.hpp" #include "detail/exceptions.hpp...
//frien class example accessing private variable #include<iostream> using namespace std; class B; class A{ private: int meter; public: A():meter(5) { cout<<"constructor called from A : \n"; } friend int func(A a1,B b1); }; class B{ private: int meter; public: B():meter(10) { cout<<"Constructor...
#include <iostream> using namespace std; int main() { int t; cin>>t; while(t--) { int a; cin>>a; int i=2048,menus = 0; while(i>0) { if(a>=i) { menus++; a = a - i; } else i = i/2; } cout<<...
/* * SPDX-FileCopyrightText: (C) 2017-2022 Matthias Fehring <mf@huessenbergnetz.de> * SPDX-License-Identifier: BSD-3-Clause */ #ifndef CUTELYSTVALIDATORREGEX_P_H #define CUTELYSTVALIDATORREGEX_P_H #include "validatorregularexpression.h" #include "validatorrule_p.h" namespace Cutelyst { class ValidatorRegularExpre...
/// \file This is a implementation file for diff_drive.hpp #include<rigid2d/diff_drive.hpp> #include<stdexcept> #include<iostream> namespace rigid2d { DiffDrive ::DiffDrive() { // initial params theta = 0.0; x = 0.0; y = 0.0; // fixed geometry from nuturtle_description config wheel_base = 0...
/* 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...
/* NO WARRANTY * * BECAUSE THE PROGRAM IS IN THE PUBLIC DOMAIN, THERE IS NO * WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE * LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE AUTHORS * AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT * WARRANTY OF ANY KIND, EITHER E...
#include "stdafx.h" #include "NormalRenderItem.h" #include "ImmutableMeshGeometry.h" #include "SubmeshGeometry.h" using namespace GraphicsEngine; void NormalRenderItem::Render(ID3D11DeviceContext* deviceContext) const { SetInputAssemblerData(deviceContext); const auto& submesh = GetSubmesh(); deviceContext->Draw...