text
stringlengths
8
6.88M
class Solution { public: unordered_set<int> notselect; unordered_set<int>::iterator iter, jter; int len; int getdiff(string &s1, string &s2) { int result = 0, i; for (i = 0; i < len; i++) { if (s1[i] != s2[i]) { result++; ...
#include "../headers/IvestiesMetodai.h" void Ivedimas(double *&pazymiai, int &size, double &egz) { cout << "Iveskite egzamino bala" << endl << endl; cin >> egz; cout << "Iveskite pazymius, ivedus 0 ivedimas baigtas\n"; int capacity = 1; double k{-1.0}; while (k) { cin >> k; ...
#include <iostream> #include <fstream> #include <string.h> #include "matriz_bit.h" #include "matriz_operaciones.h" using namespace std; int main(int argc, char const *argv[]) { //____________ const bool traspuesta = !strcmp(argv[1],"TRS"), infimo = !strcmp(argv[1],"AND"), supremo = !strcmp(argv[1],"OR")...
/* DO NOT EDIT THIS FILE - it is machine generated */ #include <jni.h> #include "jniutil.h" #include "imagehandle.h" #include "facehandle.h" /* Header for class com_tangzhongliang_imagetranslate_ImageHandle */ #ifndef _Included_com_tangzhongliang_imagetranslate_ImageHandle #define _Included_com_tangzhongliang_...
#include <iostream> #include <vector> #include <opencv2/opencv.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> using namespace std; using namespace cv; int main(int argc, char** argv) { // 初始化 FileStorage fs2("test.yaml", FileStorage::READ); // 第一种方法, 对FileNode...
#pragma once #include "Misc.hpp" #include <vector> // Got from: // http://stackoverflow.com/questions/10060046/drawing-lines-with-bresenhams-line-algorithm class Bresenham { public: static void bhm_line_count(Misc::Point p1, Misc::Point p2, int &numPixels) { int x1 = p1.x, x2 = p2.x, y1 = p1.y, y2 = p2.y; in...
/* 14499. 주사위 굴리기 */ #include <iostream> #include <vector> using namespace std; int N, M, r, c, K, D; int board[20][20]; int dr[5] = {0,0,0,-1,1}; int dc[5] = {0,1,-1,0,0}; vector<int> dir; int dice[4][4]; void move(int d) { if(d == 1) { int e = dice[1][3]; for(int i = 2; i >= 0; i--) ...
#include "gun.h" #include "gameobjects/weapons/rocket/rocket.h" #include "gameobjects/weapons/pistol/pistol.h" #include "gameobjects/weapons/piercer/pierce.h" #include "gameobjects/weapons/ricochet/bounce.h" #include "gameobjects/weapons/flame/flame.h" #include <cmath> #include <iostream> inline double dist_sq(doubl...
#include <bits/stdc++.h> using namespace std; // Complete the makeAnagram function below. int makeAnagram(string a, string b) { vector<int> freq(26,0); for (int i=0 ; i<a.length(); i++) { freq[((int)a[i] % 97)] ++ ; } for (int i=0 ; i<b.length(); i++) { freq[((int)b[i] % 97)...
#ifndef SPAN_SRC_SPAN_IO_STREAMS_SOCKETSTREAM_HH_ #define SPAN_SRC_SPAN_IO_STREAMS_SOCKETSTREAM_HH_ #include <memory> #include "span/io/streams/Stream.hh" #include "span/third_party/slimsig/slimsig.hh" namespace span { namespace io { class Socket; namespace streams { class SocketStream : public Stre...
/* Rares Cristea, 12.03.2021 Example of a REST endpoint with routing using Mathieu Stefani's example, 07 février 2016 */ #include <algorithm> #include <fstream> #include <pistache/net.h> #include <pistache/http.h> #include <pistache/peer.h> #include <pistache/http_headers.h> #include <pistache/cookie.h> #incl...
#ifndef ZOMBIE_HORDE_H # define ZOMBIE_HORDE_H # include "Zombie.hpp" class ZombieHorde { public: ZombieHorde(int n); ~ZombieHorde(void); Zombie *zombies; int size; void announce(void); }; #endif
#include<bits/stdc++.h> using namespace std; int solve(int* arr,int n) { int cur = 0; int max_value = INT_MIN; int left =0; int left_max = -1; int right_max = -1; for(int i=0;i<n;i++) { cur+=arr[i]; if(cur > max_value) { max_value = cur; left_max = left; right_max = i; } if(cur < 0) { cu...
#include<bits/stdc++.h> using namespace std; #define mod % 1000000007 long v[1000100]; void processa(){ v[0] = 0; long last = 0; for(int i=1;i<1000050;i++){ last = ( ( ( (last mod) + (i mod) )mod ) + ( ( (last mod) * (i mod) ) mod ) )mod ; v[i] = last; } } ...
#include <DS3231.h> #include <avr/interrupt.h> #include <Wire.h> #include <SPI.h> #include <Adafruit_GFX.h> #include <Adafruit_PCD8544.h> #include <OneWire.h> //dodaj biblitekę OneWire #include <DallasTemperature.h> //dodaj biblitekę obsługującą DS18B20 #define DS3231_I2C_ADDRESS...
/* 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 <RumiCar.h> void setup() { RC_setup(); } void loop() { RC_steer(RIGHT); delay(500); RC_steer(LEFT); delay(500); }
#include <stdio.h> #include <string.h> #include <metis.h> #include <stddef.h> #include <omp.h> #include "matrix.h" #include "memory.h" fun3d::Matrix::Matrix(const size_t nrows, const unsigned int bs, const unsigned int nthreads, const unsigned int ilu_sweeps, const unsigned int jacobi_sweeps) { this->nrows = nrows; ...
#include<bits/stdc++.h> using namespace std; int Vm, Mm, n, v[60], m[60], cal[60], dp[510][510]; int main() { scanf("%d %d", &Vm, &Mm); scanf("%d", &n); for (int i = 1; i <= n; ++i) scanf("%d %d %d", &v[i], &m[i], &cal[i]); for (int i = 1; i <= n; ++i) for (int j = Mm; j >= m[i]; --j) for (int k = Vm; k >=...
#pragma once #include "texture.h" #include "../renderer.h" namespace lu { struct DepthStencilTarget { DepthStencilTarget() : pTexture(NULL), depthStencilTarget(LU_INVALID_HANDLE) {} bool isValid() { return depthStencilTarget != LU_INVALID_HANDLE; } const Texture* pTexture; handle_t depthStencilTarget; }; ...
#include "ray.h" Ray::Ray() { origin = Cvec3f(0., 0., 0.); direction = Cvec3f(0., 0., 0.); } Ray::Ray(const Cvec3f &origin_, Cvec3f &direction_) { origin = origin_; direction = direction_; }
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: QTSSExpirationDate.cpp Description: Routine that checks to see if software is ...
#include <QWidget> #include <QVBoxLayout> #include <QLabel> #include <QLineEdit> #include <QTextEdit> #include <QPushButton> #include <QListWidget> #include <QComboBox> #include <QRadioButton> #include <string> #include <vector> #include "product.h" #include "datastore.h" #include "mydatastore.h" #include "db_parser...
printf("Bonan Tagon");
// Copyright (c) The HLSL2GLSLFork Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE.txt file. #pragma once #include <sstream> #include "../Include/Common.h" #include "mslFunction.h" namespace hlslang { namespace MetalCodeGen { ...
#include "basicheaders.h" #include "radixSort.h" #include "console.h" #include "partitioncustom.h" radixSort::radixSort(bool sortFlag, bool stepFlag, bool consoleMode) { this->stepFlag = stepFlag; this->sortFlag = sortFlag; this->consoleMode = consoleMode; this->printResFlag = false; lsb = 0; ...
#include "COREDrive.h" using namespace CORE; COREDrive::COREDrive() { PreLoopTask(); } void COREDrive::SetRotation(double rotation) { m_rot = rotation; } double COREDrive::GetRotation() { return m_rot; } void COREDrive::SetThottle(double throttle) { m_throttle = throttle; } double COREDrive::GetTh...
#pragma once #include "Core/AppItems/mvAppItem.h" namespace Marvel { //----------------------------------------------------------------------------- // mvNoneItemBase //----------------------------------------------------------------------------- class mvNoneItemBase : public mvAppItem { public: mvNoneItem...
#include <string> #include <vector> #include <math.h> #include <cmath> class EvaluatorBase { public: EvaluatorBase() { } virtual float Evaluate() = 0; };
// // Created by twome on 10/05/2020. // #ifndef GAMEOFLIFE_OPENGL_CHECKBOX_H #define GAMEOFLIFE_OPENGL_CHECKBOX_H #include "../base/TextComponent.h" #include "../../util/AnimatedColor.h" class CheckBox : public TextComponent { private: AnimatedColor checkContentColor = glm::vec3(0.1529, 0.1922, 0.2118); bo...
// C program to demonstrate // working of binary arithmetic // operators #include <stdio.h> int main() { int a = 10, b = 4, res; // printing a and b printf("a is %d and b is %d\n", a, b); res = a + b; // addition printf("a+b is %d\n", res); res = a - b; // subtraction printf("a-b is %d\n", re...
#ifndef BSCHEDULER_KERNEL_KERNEL_HEADER_HH #define BSCHEDULER_KERNEL_KERNEL_HEADER_HH #include <iosfwd> #include <memory> #include <unistdx/net/socket_address> #include <bscheduler/ppl/application.hh> #include <bscheduler/ppl/kernel_header_flag.hh> namespace bsc { class kernel_header { public: typedef std::un...
//************************************************************************** // // Copyright (c) 1997. // Richard D. Irwin, Inc. // // This software may not be distributed further without permission from // Richard D. Irwin, Inc. // // This software is distributed WITHOUT ANY WARRANTY. No claims are made ...
/* File: doublylinked.h * Name: Paulo Lemus * Date: 2/21/2017 */ #ifndef EE_DOUBLYLINKED_H_ #define EE_DOUBLYLINKED_H_ /* The declaration for Doubly Linked List elements. * This file contains two classes, a DoublyLinkedList, and the * DNode class to populate the list. */ struct DNode{ int value; DNode*...
/*************************************************************************** cabrillo.cpp - description ------------------- begin : Thu Dec 5 2002 copyright : (C) 2002 by ARRL author : Jon Bloom email ...
#define SKP_SET_STRING_BODY(proc, _ref, msg) { \ char *name = PyUnicode_AsUTF8AndSize(value, NULL); \ \ if (name == NULL) { \ PyErr_SetString(PyExc_TypeError, msg); \ return -1; \ } \ \ SUResult res = proc(self->_ref, name); \ if (checkerror(res, msg)) return -1; \ \ return 0; \ }
// // JumpText.h // Boids // // Created by Yanjie Chen on 3/16/15. // // #ifndef __Boids__JumpText__ #define __Boids__JumpText__ #include "UnitNodeComponent.h" class JumpText : public UnitNodeComponent { public: JumpText(); virtual ~JumpText(); static JumpText* create( const std::string& text, co...
// // Created by Petio Petrov on 2020-12-27. // #include <Arduino.h> #include "ultrasonic_sensor.h" #define echo_pin 14 #define trig_pin 15 #define trig_pulse_us 10 #define cm_factor 58 // high level time * velocity (340M/S) / 2 void UltrasonicSensor::us_init() { pinMode(echo_pin, INPUT); pinMode(trig_pin, OUTP...
#include <limits> #include <sstream> #include <stdexcept> #include <type_traits> #include <gtest/gtest.h> #include <libndgpp/strto.hpp> /* * 1. type conversion {valid, invalid, overflow, underflow} * 2. change min and max * 3. oct, dec, and hex bases */ template <class T> class conversion_test: public ::testing...
#include "Arduino.h" #include "SPI.h" #define MAX_NUM_BYTES 10 class ShiftRegister { volatile byte bits [MAX_NUM_BYTES]; int dataPin; int clockPin; int latchEnablePin; int outputEnablePin; int numBytes; public: ShiftRegister(int dataPin, int clockPin, int latchEnablePin, int outputEnablePi...
/** * Interface ViewportController * @author Patricio Ferreira <3dimentionar@gmail.com> * Copyright (c) 2017 nahuelio. All rights reserved. **/ #ifndef GAME_VIEWPORTCONTROLLER_H #define GAME_VIEWPORTCONTROLLER_H #include "../../headers/Controller.h" #include "glad/glad.h" namespace game_controller { class V...
#include <bits/stdc++.h> using namespace std; #define pb push_back #define endl '\n' #define int long long #define print(v) for(auto x:v){cout<<x<<" ";}cout<<endl; int mod=1000000007; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin>>t; while(t-- > 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...
#pragma once //MouseScrollingToTop.h #ifndef _MOUSESCROLLINGTOTOP_H #define _MOUSESCROLLINGTOTOP_H #include "MouseAction.h" using namespace std; class Form; class MouseScrollingToTop : public MouseAction { public: MouseScrollingToTop(Form *form = 0); MouseScrollingToTop(const MouseScrollingToTop& source); ~MouseS...
#ifndef _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_NORMAL_MATRIX_MAX_DIAGONAL_VALUE_CALCULATOR_HPP_ #define _HS_SFM_BUNDLE_ADJUSTMENT_CAMERA_SHARED_NORMAL_MATRIX_MAX_DIAGONAL_VALUE_CALCULATOR_HPP_ #include <algorithm> #include <limits> #include "hs_math/linear_algebra/eigen_macro.hpp" #include "hs_sfm/bundle_adjustmen...
/* 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<bits/stdc++.h> using namespace std; int n, m, t, sx, sy, fx, fy, ans; int mg[6][6], now[6][6]; int go[4][2] = {{-1, 0}, {0, 1}, {1, 0}, {0, -1}}; void dfs(int x, int y) { int x2, y2; if (x == fx && y == fy) ans++; else { for (int i = 0; i < 4; ++i) { x2 = x + go[i][0]; y2 = y + go[i][1]; if ...
// num_7.cpp: From "The Bank", #7 // Eric Farkas, CUS 1144 MWF 7:00AM // 1.23.02 // b) Repeat part (a) with a while loop using a test for a sentinel value // (i.e., special value indicating end of data). // Question 'B' #include <fstream.h> void main() { int x = 0, i = 0; while (x != -9999) { cout<<"Enter number...
#pragma once #include "Quadtrees/QTBase.h" #include <cstdint> #include <cmath> #include "Point.h" namespace QT { struct AABB { uint32_t minX, minY, maxX, maxY; AABB(uint32_t TopLeftX, uint32_t TopLeftY, uint32_t BottomRightX, uint32_t BottomRightY) :minX(TopLeftX), minY(TopLeftY), maxX(BottomRightX), maxY(Bot...
#ifndef ___plotbuffer__aera_h___ #define ___plotbuffer__aera_h___ namespace plot { class darray { public: DEFINE_ERROR(out_of_range, "darray::out_of_range"); darray(unsigned width, unsigned height) : width_(width), height_(height), buffer_(new int[width *height]) { std::fill_n(buffer_.get...
#include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> using namespace std; int main(){ int n; cin >> n; int j = 0,k = 0; for(int i = 0; i < n ;i++) { while(j< n-1-i) { cout<<" "; j++; } while(k ...
#include<iostream> #include<vector> #include<deque> #include<algorithm> #include<string> using namespace std; // 有5名选手(ABCDE),10个评委分别对每一个选手打分,去掉最高分和最低分,取平均分 //选手类 class Person { public: Person(string name,int score) { this->m_name = name; this->m_socre = score; } string m_name; int ...
/*====================================================================* - 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...
#include "Matrix.h" Matrix::Matrix() {} Vec3 Matrix::operator*(Vec3 other) { return Vec3(other.x * vals[0][0] + other.y * vals[0][1] + other.z * vals[0][2], other.x * vals[1][0] + other.y * vals[1][1] + other.z * vals[1][2], other.x * vals[2][0] + other.y * vals[2][1] + other.z * vals[2][2]); } Matrix M...
/* The MIT License (MIT) Copyright 2016 Luca Beldi 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, publis...
#include "../inc.h" long long encode(int a, int b, int c, int d) { if (a > c) swap(a, c); if (b > d) swap(b, d); long long r = (a & 0xFF); r = (r << 8) + (b & 0xFF); r = (r << 8) + (c & 0xFF); r = (r << 8) + (d & 0xFF); return r; } long long solve(int width, ...
#include "polylineitem.h" #include <QPainter> /*Не коректне підключення хідер файла. ???*/ #include "../componentfactory.h" #include <QDebug> PolylineItem::PolylineItem(int id) : GrawItem(id) { setFlag(QGraphicsItem::ItemIsSelectable, false); setFlag(QGraphicsItem::ItemIsMovable, false); _Propertic->addPr...
#ifndef CWINDOW_H #define CWINDOW_H #include "CGuiPanel.h" #include "listeners/CListenerMemberFn.h" class CWindow: public CGuiPanel { public: CWindow(const vec2d& position, const vec2d& size, const String& label, double bottomHeight = 0., bool hasTitle=true); virtual void draw(); virtual void...
using namespace std; #include <iostream> #include <windows.h> int * max_vect(int size, int a[], int b[]); int main() { SetConsoleOutputCP(1251); SetConsoleCP(1251); int a[] = { 1,2,3,4,5,6,7,2 }; int b[] = { 7,6,5,4,3,2,1,3 }; int kc = sizeof(a) / sizeof(a[0]); int *c; c = max_vect(kc, a, b); for (int i = 0...
// // Created by troels on 6/30/16. // #include <iostream> #include "SRSRawFile.h" SRSRawFile::SRSRawFile(std::string fileName, const std::vector<size_t >& _daqMap) : buffer(NULL) , bufferSize(0) , daqMap(_daqMap) , events(0) { file.exceptions(std::ifstream::failbit | std::ifstream...
#include <FastCG/World/WorldSystem.h> #include <FastCG/World/Transform.h> #include <FastCG/World/GameObject.h> #include <FastCG/World/Component.h> #include <FastCG/Rendering/Renderable.h> #include <FastCG/Core/Exception.h> #include <cassert> #include <algorithm> namespace FastCG { GameObject::GameObject() : mpTransf...
#ifndef MYELLIPSEITEM_H #define MYELLIPSEITEM_H #include<QGraphicsEllipseItem> #include<QGraphicsSceneHoverEvent> #include<QCursor> #include<QWidget> #include"Information.h" class MyEllipseItem : public QGraphicsEllipseItem { public: MyEllipseItem(QWidget *parent=0); MyEllipseItem(int key,QWidget *parent=0 ); ...
#include <iostream> #include <algorithm> #include <cmath> #include <vector> using namespace std; const int MAX = 5; // 乘客上限 int INF; int cnt = 0; int* total_time; vector<int> pos; struct Passenger { // 存储乘客信息 Passenger() { } Passenger(int msg) { request_time = msg; } int request_time; // 请求时刻 int initial_floo...
/*Max Sum of the subarray. The following are some instances:(-2,11,-4,13,-5,-2), the max sum is 20*/ #include<stdio.h> #include<stdlib.h> int getMaxSumOfSubarray(int[],int); int main(){ int edata[]={-2,11,-4,13,-5,-2}; int len=6; printf("biggest sum = %d\n",getMaxSumOfTwoNumber(edata,len)); return 0; } int getMaxSu...
#include "Information.h" #include "../CWE/CWEUsefullyMacro.h" using namespace CWE; const wchar_t VERTEX_SHADER_ERROR_MS[] =L"Failed to create the vertex shader.\nThere is a possibility that the file is broken."; const wchar_t PIXEL_SHADER_ERROR_MS[] =L"Failed to create the pixel shader.\nThere is a possibility that...
#pragma once #include <stdint.h> #include "context.h" namespace render { class IDrawBuffer { public: IDrawBuffer() = default; virtual ~IDrawBuffer() = default; virtual void DrawTriangleFan(const Vertex *v, int count) = 0; virtual void DrawLineStripAA(int count, const Vertex *v, float thickness...
#include "utils.h" glm::dvec3 randomVector(double scale) { return glm::dvec3((rand() / (RAND_MAX + 1.0) - 0.5)*2*scale, (rand() / (RAND_MAX + 1.0) - 0.5)*2*scale, (rand() / (RAND_MAX + 1.0) - 0.5)*2*scale); }
#pragma once #include <string> #include <vector> #include "Student.h" using namespace std; class Course { private: string name; vector<Student*> studentlist; public: Course(string name_) { name = name_; } ~Course() {}; string getName() { return name; } void addStudent(Student* stu) { studentlist....
/* * Pi 2 is connected to the ImP/IMU via UART, Camera via CSI, Burn Wire Relay * via GPIO and Pi 1 via Ethernet and GPIO for LO, SOE and SODS signals. * * This program controls most of the main logic and for the PIOneERs mission * on board REXUS. */ #include <stdio.h> #include <cstdint> #include <unistd.h> //Fo...
#include "calcwindow.h" #include "ui_calcwindow.h" #include <QHBoxLayout> #include <buttonsclick.h> #include <string> #include <QLineEdit> #include <vector> #include <QDebug> #include <QScriptEngine> #include <iostream> #include <QDebug> ButtonsClick *resulter = new ButtonsClick; bool isOperationPerformed...
/*********************************************************************** created: Sun Jan 11 2009 author: Paul D Turner *************************************************************************/ /*************************************************************************** * Copyright (C) 2004 - 2009 Pa...
#include<iostream> using namespace std; int main(){ cout <<"enter the name"<<endl; // cin >> "str"; return 0; }
/** * [Question] * - 与えられた整数の配列において重複した数字を探すにはどうすればよいですか? * * [Solution] * - 連想配列を使って既出かどうか調べながら線形探索 */ #include <iostream> #include <vector> #include <unordered_map> #include <string> int main() { /* INPUT */ std::vector<int> v = {1, 1, 2, 2, 3, 4, 5}; /* SOLVE */ // 重複する文字列を探す std::u...
/** * @file NfcEmuDeviceCfg.h * @author Lukas Schuller * @date Tue Sep 24 20:56:40 2013 * * @brief * */ #ifndef NFCEMUDEVICECFG_H #define NFCEMUDEVICECFG_H #include "NfcConstants.h" enum NfcEmuMode { eIdleMode = 0x00, eAmDemodMode = 0x10, eNfcSnifferMode = 0x20,...
/** * Copyright (C) 2017 Alibaba Group Holding Limited. 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 * * ...
#include <iostream> #include <GL/glut.h> #include <random> using namespace std; typedef uniform_real_distribution<> urd; class balls{ private: float radius; //radius of the ball float *vel; // velocity of balls in 3 coordinates float *color; //color of the ball float *cord; //coordinates of the ball public: ...
#pragma once #include "Particle.h" ///< A triplet, used in the sparse triplet representation for matrices. enum ConstraintType { EDGE_CONSTRAINT, FIX_CONSTRAINT, HINGE_CONSTRAINT }; class Constraint { protected: vector<Particle*> m_constrained_particles; public: virtual void solveLocal()=0; virtual Const...
#pragma once // CViewPanel 窗体视图 class CViewPanel : public CFormView { DECLARE_DYNCREATE(CViewPanel) protected: CViewPanel(); // 动态创建所使用的受保护的构造函数 virtual ~CViewPanel(); public: #ifdef AFX_DESIGN_TIME enum { IDD = IDD_VIEWPANEL }; #endif #ifdef _DEBUG virtual void AssertValid() const; #ifndef _WIN32...
#include "platform.hpp" namespace doodle { Platform::Platform(SDL_Texture *gamesheet, SDL_Rect &platformBounds, int x, int y, int scale): moving(false) { platform = new ge::Sprite(gamesheet, platformBounds, x, y ); platform->setScale(scale); } Platform::~Platform(){} void Platform::u...
#include <iostream> #include <dsnutil/reference_counted.hpp> #include <dsnutil/throwing_assert.h> /// \brief Increase reference count /// /// This increases the object's reference count and puts it one step further away from suicide. void dsn::reference_counted::ref() const { m_reference_count++; } /// \brief Decrea...
// Serial I/O based on example http://forum.arduino.cc/index.php?topic=396450 //Arduino function code based on: https://www.instructables.com/id/Control-LED-Using-Serial-Monitor/ // Serial communication const byte numChars = 32; char receivedChars[numChars]; char tempChars[numChars]; char messageFromPC[numChars] = {0}...
#include "AttributeInitializer.h" #include "LoopAttribute.h" #include "debug.h" namespace StencilTranslator { AttributeInitializer::AttributeInitializer () {} void AttributeInitializer::visit (SgNode * n) { if (isSgExpression(n)) { SgExpression * e = isSgExpression(n); std::cout << "visit: " << e->unpa...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
#include "common.h" #include "MIDIController.h" #include "SoundSystem.h" namespace CMI { MIDIController::MIDIController() : _soundOutput(0), _delegate(0) { } MIDIController::~MIDIController() { } void MIDIController::Initialise(UInt32 deviceIndex, Delegate *delegate) { _delegate = delegate; } void MIDIController:...
#ifndef __DENSE_CPP #define __DENSE_CPP #include "dense.h" /************************************************************************************************** Constructor(s)/Destructor */ /* */ Dense::Dense(unsigned int inputs, unsigned int nodes) { unsigned int x, y; W = new MatrixXf(inputs + 1, nodes...
#include "list_relasi.h" void createList(list_relasi &L){ first(L) = NULL; } void insertFirst(list_relasi &L, address_relasi P){ if (first(L) == NULL){ first(L) = P; }else{ next(P) = first(L); first(L) = P; } } void insertLast(list_relasi &L, addre...
// C++ for the Windows Runtime vv1.0.170303.6 // Copyright (c) 2017 Microsoft Corporation. All rights reserved. #pragma once #include "../base.h" #include "Windows.Data.Xml.Dom.0.h" #include "Windows.Foundation.0.h" #include "Windows.Storage.0.h" #include "Windows.Storage.Streams.0.h" #include "Windows.Foundation.Col...
#include<cstdio> #include<iostream> #include<algorithm> #include<vector> using namespace std; vector<vector<string> > ans; bool isok(vector<int>& record, int row) { for(int i = 0; i < row; i++) { if(record[i] == record[row] || row-record[row] == i-record[i] || row+record[row] == i+record[i]) ...
#include <iostream> using namespace std; int main(){ const int size = 16; for(int i = 0; i < size; i++){ for(int y = 0; y < size; y++){ cout << ( (i&y) ? " " : "#") << ' '; } cout << '\n'; } return 0; }
#pragma once //ShiftCtrlRightArrowKey.h #ifndef _SHIFTCTRLRIGHTARROWKEY_H #define _SHIFTCTRLRIGHTARROWKEY_H #include "KeyAction.h" class ShiftCtrlRightArrowKey :public KeyAction { public: ShiftCtrlRightArrowKey(Form *form = 0); ShiftCtrlRightArrowKey(const ShiftCtrlRightArrowKey& source); ~ShiftCtrlRightArrowKey(...
/* --COPYRIGHT--,BSD * Copyright (c) 2011, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copy...
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include <vector> #include "Neuron.h" class Net { public: Net(const std::vector<unsigned int> topology, float upperBound); ~Net(); bool feedForward(const std::vector<float> inputVals); // bool as the input may not be sui...
#include "Game.h" #include "Audio.h" #include "Sprites.h" #include "Misc.h" #include "Rect.h" #include "Entity.h" #include "InputComponent.h" #include "GraphicsComponent.h" #include "InputMapping.h" #include "RessourceManager.h" #include "Physics.h" #include "World.h" #include "EntityGenerators.h" #include "Counter.h"...
#include<Servo.h> Servo servoFrontLeft; Servo baseServoFrontLeft; Servo invbaseservoright; int pos = 90; int basepos=90; int invpos=90; int Servopins[6]={3,5,6,9,10,11}; void setup() { // put your setup code here, to run once: int i; servoFrontLeft.attach(Servopins[5]); baseServoFrontLeft.attach(Servopins[0]);//ba...
// // Created by wiktor on 09.04.18. // #include "TextPool.h" namespace pool{ TextPool::TextPool(TextPool &&input) { swap(words_,input.words_); } TextPool &TextPool::operator=(TextPool &&input) { if (this == &input) { return *this; } swap(words_,input.words_);...
#include <iostream> #include <iomanip> using namespace std; int igr[20], in, ik = 1, is, kl; float ip,y; int main() { setlocale(LC_CTYPE, "Russian"); printf("Введите количество элементов последовательности:"); cin >> in; if (in <= 0) { printf("Количество элементов последовательности должно быть число, больше нул...
/*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=* ** Copyright UCAR (c) 1992 - 1999 ** University Corporation for Atmospheric Research(UCAR) ** National Center for Atmospheric Research(NCAR) ** Research Applications Program(RAP) ** P.O.Box 3000, Boulder, Colorado, 80307-3000, USA ** All rights reserved. ...
#pragma once #include "../allocator.h" #include "../../renderer/mesh.h" namespace lu { namespace loader { bool CreateMeshFromOBJFile(const RendererDevice& device, IAllocator& allocator, const void* pFileData, uint64_t fileDataSize, Mesh& mesh); bool OpenOBJFileAndCreateMesh(const RendererDevice& device, IAlloca...
#include<bits/stdc++.h> using namespace std; vector<int> edge[100]; vector<int> cost[100]; int prev[100],key[100]; bool cycle; void bellmanford(int var) { for(int i=0;i<var;i++) key[i]=INT_MAX; key[0]=0; prev[0]=-1; for(int i=0;i<var-1;i++){ for(int u=0;u<var;u++){ for(int v=0;v<edge[u]...
int x = 0; int row = 0; void setup() { Serial.begin(9600); // opens serial port, sets data rate to 9600 bps Serial.println("CLEARDATA"); Serial.println("LABEL,Time,x,sin(x),pippo"); //LABEL serve ad indicare che trattasi di intestazione, mentre gli altri valori costituiranno l'intestazione del foglio di stile. }...