text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef JAYARITHDECODER_H
#define JAYARITHDECODER_H
#include "mo... |
#pragma once
class GameCursor;
// THIS IS CAMERA.
class GameCamera;
class AIEditNodeHp;
class AIEditNodeInequ;
class AIEditNodeButton;
class AIEditNodeTechnique;
class AIEditNodeAbnormalState;
class AIEditNodeProcess;
class AIEditNodeOrder;
class AIEditNode : public GameObject
{
public:
~AIEditNode();
bool Start(... |
#include<cstdio>
#include<malloc.h>
#include<stdlib.h>
#include<conio.h>
struct node
{
int a;
struct node *next;
};
void removeLoop(struct node *loop_node, struct node *head);
void insert(struct node **ptr,int data)
{
struct node *newnode;
if(*ptr==NULL)
{
... |
#ifndef UICURVE_H
#define UICURVE_H
#include "uielement.h"
#include "uirectangle.h"
#include <iostream>
class QPainterPath;
class UiRectangle;
class UiCurve : public UiElement
{
Q_OBJECT
public:
UiCurve(QWidget *parent);
void change(UiRectangle* p1, UiRectangle* p2, UiRectangle* p3, UiRectangle* p4);
void chang... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
*
* Copyright (C) 2010-2012 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 MEDIA_... |
#ifndef tmptools__coretools__instance_of__hpp
#define tmptools__coretools__instance_of__hpp
namespace tmp {
template <typename T>
struct instance_of {
typedef T type;
instance_of(int = 0) {}
};
} // tmp
#endif // tmptools__coretools__instance_of__hpp
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 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"
#include "modules/hardcore/mh/messobj.h"
#... |
#pragma once
#include "IComponent.h"
namespace Hourglass
{
class AudioSource : public IComponent
{
DECLARE_COMPONENT_TYPEID
public:
void Start();
void Shutdown();
IComponent* MakeCopyDerived() const;
void PostAudioEvent(uint64_t eventId) const;
};
} |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef WBXML_DECODER_H
#define WBXML_DECODER_H
#include "mo... |
// you can use includes, for example:
// #include <algorithm>
// you can write to stdout for debugging purposes, e.g.
// cout << "this is a debug message" << endl;
/////////////// better one /////////////////
int solution(vector<int> &A) {
// write your code in C++14 (g++ 6.2.0)
vector<int> opt(A.size(),0); ... |
#ifndef DATA_H
#define DATA_H
#include "../StdIncl.hpp"
namespace uipf{
/**
The elements of Type declare all possible Type-sorts the data objects can be.
For creating a new Type-sort:
- add an enum in Type
- case: standard class: create a new .hpp and .cpp classes, which derive from the class Data.hpp
- case: templ... |
#include "engine.h"
Camera::Camera(int width, int height, Vector *orig, Matrix *orientation,
double fov, double near, double far)
{
this->origin = orig;
this->translation = new Matrix(TRANSLATION, -orig->x, -orig->y, -orig->z);
this->rotation = orientation;
this->view = this->rotation->mult(this->translation);
... |
#include "pch.h"
#include "Component.h"
#include "GameObject.h"
Component::Component() noexcept
{
printf("creating Component: ");
}
void Component::SetOwner(GameObject& aOwner) noexcept
{
m_owner = &aOwner;
} |
#ifndef _VECTOR_4_H
#define _VECTOR_4_H
#include "BaseVector4.h"
class Vector4 : public BaseVector4
{
// constructor and destructor
public:
Vector4(void);
Vector4(float x, float y, float z, float w);
~Vector4(void);
// Operator Overloads
public:
Vector4& operator= (const Vector4& rhs);
Vector4 operator... |
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
using namespace std;
int size=0;
int error=0;
struct node {
int data;
struct node *left;
struct node *right;
}*p,*q,*root;
const char error_msg[][50] = {
"",
"BST duuren!",
"BST xooson!",
};
void insert(int item){
p=(struct node*)malloc(sizeof(... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 10005
int dp[maxn][4];
string buf[maxn][4];
string str;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
set<string> res;
cin>>str;
int len=str.size();
dp[len][2]=1;
buf[len][2]="";
for(int i=len-2; i>=5; i-... |
/* STM32F103C8 Black Pill ( PB12)
Serialport set and display RTC clock , Write by CSNOL https://github.com/csnol/STM32-Examples
based on https://github.com/rogerclarkmelbourne/Arduino_STM32
1. Blink on PB12 per 1s.
2. change to your timezone in the sketch; .
3. get Unix epoch time from https://www.epochco... |
#include "lnumber.h"
#pragma comment(lib,"winmm.lib")
#include<windows.h>
#pragma comment(lib,"winmm.lib")
void main(void){
string temp;
string x1;
string x2;
int lines = 0;
char symbol;
cout << "input the operation : + - * /:" << endl;
cin >> temp;
symbol = temp[0];
cout << "input first number" << endl;
... |
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int n, x;
set<int> s;
int main()
{
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> x;
//s<T>.lower_bound(x) 返回第一个大于或等于x的数的迭代器
//set<int>::iterator it = s.lower_bound(x);
auto it = s.lower_bound(x);
... |
//
// main.cpp
// Tarea4Ejercicio1
//
// Created by Daniel on 15/10/14.
// Copyright (c) 2014 Gotomo. All rights reserved.
//
#include <iostream>
#include "Pila.h"
int main(int argc, const char * argv[]) {
std::string expresion;
std::cout<<"Inserte la expresión: ";
std::cin>>expresion;
Pila<c... |
void code_dir(){
std::fstream f("D:\\DS project\\station.txt", std::ios_base::in);
char temp[50];
int var;
cout << " ------------------------------- "<<'\n';
cout << " Station Code "<<'\n';
cout << " -------------------------------... |
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
void calculate_the_maximum(int n, int k)
{
int i,j,add,orr,xorr;
for(i=1;i<=n;i++)
{
for(j=i+1;j<=n;j++)
{
add=i&j;
orr=i|j;
xorr=i^j;
}
}
for(i=1;i<=n;i++)
{
for(j=i+1;j<=n;j++)
{
printf("%d\... |
//Phoenix_RK
//https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/
/*
Given the array candies and the integer extraCandies, where candies[i] represents the number of candies that the ith kid has.
For each kid check if there is a way to distribute extraCandies among the kids such that he or she can ... |
#include<bits/stdc++.h>
using namespace std;
double force(double arr[], double i, int n){ // total force at a given point
double x=0;
for(int j=0;j<n;j++)
x += (1/double(i-arr[j]));
return x;
}
int main()
{
// only gravity will pull me down
// Magnet Array Problem
int t, n, flg... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
**
** Copyright (C) 1995-2007 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef _STYLE_MANAGER_
#define _STYLE_MANAGER_
#include "mod... |
#include <iostream>
#include "vector.hpp"
void isValue(int& number) {
while (std::cin.fail()) {
std::cin.clear();
std::cin.ignore(256,'\n');
std::cout << "Please enter the intager number: ";
std::cin >> number;
}
}
void chooseFunction(const int function, Vector& vector)... |
#include<iostream>
using namespace std;
int main()
{
int k,t, i = 0;
cin>>k;
while(cin>>t) {
if(k != i )
cout<<t<<" ";
i++;
}
return 0;
} |
#include "kg/util/log.hh"
#include <Windows.h>
kg::log::~log() {
_stream << "\r\n";
std::string s = _stream.str();
wchar_t * buf = new wchar_t[s.length() + 1] { 0 };
mbstowcs_s(nullptr, buf, s.length(), s.c_str(), _TRUNCATE);
OutputDebugStringW(buf);
delete[] buf;
}
|
#include <iostream>
using namespace std;
int main()
{
int x;
int kapinajums;
cout << "Ievadi skaitli kuru gribi kapinat kvadrata" << endl;
cin >> x;
if(x > 0){
//Sis izpildisies ja x ir lielaks par 0
cout << "X ir lielaks par 0" << endl;
kapinajums = x*x;
cout << "Tavs skaitlis " << x << "... |
#include "shoot.h"
Motor_C610 Turnplate[1] = {Motor_C610(1)};
Motor_C620 FriMotor[3] = {Motor_C620(3),Motor_C620(4),Motor_C620(1)};
void C_Shoot :: Control(E_ShootMode shoot_mode,
E_ShootCtrlMode ctrl_mode,
E_FriWheelState fri_wheel_stste,
E_LaserState laser_... |
#include <iostream>
class B {
public:
virtual void f() {
std::cout << "B ";
}
};
class D : public B {
public:
virtual void f() {
std::cout << "D ";
}
};
int main() {
B b;
D d;
B &rb = d; // q1: what is the object slicing problem?
B &pb = b;
rb.f(); // q2: What is the output of b.f() and why is th... |
#include <iostream>
using namespace std;
int main()
{
int n, k, idx = 0, lsc = 0, acount = 0, bcount = 0, ans = 0; //lsc = left most char
string s;
cin >> n >> k >> s;
while (idx < n)
{
if (s[idx] == 'a')
acount++;
else
bcount++;
if (aco... |
#include<bits/stdc++.h>
using namespace std;
bool subsetSum(int arr[],int n,int sum)
{
int dp[n+1][sum+1];
for(int i=0;i<n+1;i++)
{
for(int j=0;j<sum+1;j++)
{
if(i==0) dp[i][j] = false;
if(j==0) dp[i][j] = true;
}
}
for(int i=1;i<n+1;i++)
... |
#include "../include/houghCirclesContrast.h"
houghCirclesContrast::houghCirclesContrast(double param1, double param2, double minDist, int minRadius, int maxRadius)
{
this->param1 = param1; //thresh canny
this->param2 = param2; //thresh acumulador
this->minDist = minDist; //min distance between balls
th... |
/********************************************************************
created: 2008/05/24
created: 24:5:2008 13:14
filename: /rpc/rpc.hpp
author: Содм
purpose: A simple rpc implementation.
Copyright (C) 2008 , all rights reserved.
********************************************************************... |
#pragma once
#include "TerrainTextureCombineDialog.h"
// CTerrainDialog 对话框
class CTerrainDialog : public CDialog
{
DECLARE_DYNCREATE(CTerrainDialog)
public:
CTerrainDialog(CWnd* pParent = NULL); // 标准构造函数
virtual ~CTerrainDialog();
// 对话框数据
enum { IDD = IDD_TERRAIN };
protected:
virtua... |
#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;
typedef long long L... |
#include <bits/stdc++.h>
#define REP(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define fastio ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define vi vector<int>
#define ii pair<int, int>
#define ll long long int
#define MAX 20001... |
// Copyright 2011 Yandex
#include <gtest/gtest.h>
#include <vector>
#include "ltr/crossvalidation/crossvalidation.h"
#include "ltr/learners/best_feature_learner/best_feature_learner.h"
#include "ltr/data/object.h"
#include "ltr/data/feature_info.h"
#include "ltr/measures/abs_error.h"
#include "ltr/measures/measure.h"... |
#ifndef CFBOARD_HPP
#define CFBOARD_HPP
#include <iostream>
enum GameState {X_WON, O_WON, DRAW, UNFINISHED}; //Declaring enum type
class CFBoard //CFBoard class declaration
{
private:
char board[6][7];
GameState gameState;
public:
CFBoard(){ //default constructor
std::cout << "1234567" << ... |
#include "civilian.h"
#include <iostream>
Civilian::Civilian()
{
xdir=-5; //moves left
ydir=0; //doesnt move up or down
image.load("civilian.png");
rect=image.rect(); //assigns image to object
resetState(); //respawn
}
Civilian::~Civilian()
{
std::cout<<("Civilian deleted\n");
}
void Civilian::resetState()
{
rect... |
#include "texture.h"
#include "..\\core\filesystem.h"
Texture::~Texture() {
Texture::Destroy();
}
bool Texture::Create(const Name& image_name) {
bool start_success = true;
texture_ = IMG_LoadTexture(renderer_->GetSDLRenderer(), image_name.c_str());
return start_success;
}
bool Texture::CreateFromFont(Font* f... |
// MIT License
// Copyright (c) 2020 Marnix van den Berg <m.a.vdberg88@gmail.com>
// 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 ri... |
/*
Earl Kirkland
Shader Development
Original Code by Jamie King
*/
#include <gl\glew.h>
#include <iostream>
#include "MeOpenGl.h"
#include <cassert>
#include <glm\glm.hpp>
#include <glm\gtc\matrix_transform.hpp>
#include <glm\gtx\transform.hpp>
#include "ShapeGenerator.h"
#include <fstream>
#include <QtGui\qmouseeven... |
#include "BuitInShaders.h"
const char* defaultVert = ""
"#version 130\n"
"#extension GL_ARB_explicit_attrib_location : require\n"
"#extension GL_ARB_explicit_uniform_location : require\n"
"layout(location = 0) in vec3 vertex_position;"
"layout(location = 1) in vec2 in_texture_coordinates;"
"out vec2 texture_coor... |
//
// main.cpp
// GameProject
//
// Created by Orin Elmquist on 6/12/18.
// Copyright © 2018 Orin Elmquist. All rights reserved.
//
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include "Game.hpp"
//const unsigned int SEED = 143245543;
//Seed Error
//1529537124 Unconnected part of cave
in... |
#include <iberbar/Poster/Elements/ElementLabel.h>
#include <iberbar/Poster/Font.h>
iberbar::Poster::CElementLabel::CElementLabel()
: m_font( nullptr )
, m_text( U"" )
, m_textOptions()
{
}
iberbar::Poster::CElementLabel::~CElementLabel()
{
UNKNOWN_SAFE_RELEASE_NULL( m_font );
}
void iberbar::Poster::CElementLa... |
boolean flag = true;
void setup() {
pinMode(7,OUTPUT);
pinMode(3,INPUT);
pinMode(4,INPUT);
pinMode(5,INPUT);
pinMode(6,OUTPUT);
digitalWrite(6,LOW);
}
void loop() {
for ( int x = 0; x < 100; x++){
work();
}
//delay(5000);// если нужно убрать паузу, удали это
}
void work(){
for( int i = 0; i... |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int sharp[1000000] = {0};
int dot[1000000] = {0};
int main()
{
int n;
cin >> n;
string s;
cin >> s;
int sums = 0;
for(int i = 0; i < n; i++)
{
if(s[i] == '#'){
sums++;
}
sharp[i] = sums;... |
#include "Curve.h"
struct point
{
double x,y,z;
};
Curve::Curve()
{
}
Curve::~Curve()
{
}
void Curve::init()
{
this->control_points_pos = {
{ 0.0, 8.5, -2.0 },
{ -3.0, 11.0, 2.3 },
{ -6.0, 8.5, -2.5 },
{ -4.0, 5.5, 2.8 },
{ 1.0, 2.0, -4.0 },
{ 4.0, 2.0, 3.0 },
{ 7.0, 8.0, ... |
/*
* Copyright (c) 2014-2019 Detlef Vollmann, vollmann engineering gmbh
*
* 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)
*/
#include "staticVector.hh"
#include "staticVector.tt"
#include <string>
#include <... |
/*
COMMON MISTAKE -
next node has a prev too
which needs to be taken care of
*/
#include <iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
Node *prev;
};
void push(Node **head_ref, int new_data)
{
// new node added in front and first node's
//prev is always null
... |
#include <GL/glut.h>
#include <GL/GL.h>
#include <GL/GLU.h>
#include <iostream>
#include <string>
#include "Client.hpp"
using namespace std;
class Vector2d {
public:
double x = 0.0, y = 0.0;
};
constexpr auto PORT = 45678;
constexpr auto SERVER_IP = "114.29.136.181";
class Game {
public:
Game() : client(SERVER_I... |
/*
* Program: ImageStitching.cpp
* Usage: Start image stitching
*/
#ifndef IMAGE_STITCHING_H
#define IMAGE_STITCHING_H
#include <vector>
#include <queue>
#include "SIFT.h"
#include "Utils.h"
#include "Matching.h"
#include "Warping.h"
#include "Blending.h"
class Stitcher{
public:
Stitcher(vector<CImg<unsigned char>> ... |
// Copyright (c) 2020 ETH Zurich
//
// SPDX-License-Identifier: BSL-1.0
// 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 <pika/config.hpp>
#if defined(PIKA_HAVE_STDEXEC)
# include <pika/e... |
#pragma once
#include "data.h"
#include "linearregression.h"
namespace hdd::gamma
{
class Gamma
{
public:
Gamma(const Data& data, uint32_t pMax, uint32_t numMoments = MomentsMin());
friend std::ostream& operator<<(std::ostream& os, const Gamma& g);
static constexpr uint32_t Moments... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef OP_EDIT_COMMON_H
#define OP_EDIT_COMMON_H
// This header... |
#include<stdio.h>
main()
{
char str[1000];
int i,num=0,word=0;
char c;
printf("input a string:\n");
gets(str);
for(i=0;((c=str[i])!='\0');i++)
if(c==' ')
word=0;
else if(word==0)
{
word=1;
num++;
}
printf("there are %d words in... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2011 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 SECMAN_USERCONSENT
#include "modul... |
#pragma once
#ifndef functions
#define functions
#include <vector>
std::vector<float> posFromLightHouse(float gamma, float theta);
std::vector<float> equationSystem(float a, float b, float c, float ap, float bp, float cp);
float Gamma(float scanning_G_D, float period);
float Theta(float scanning_B_H, float period);
s... |
#include <CQNascom.h>
#include <CNascom.h>
#include <CQZ80Dbg.h>
#include <CArgs.h>
#include <CQApp.h>
#include <CQImageUtil.h>
#include <CQUtil.h>
#include <CQUtilEvent.h>
#include <CQUtilRGBA.h>
#include <CImageLib.h>
#include <QWidget>
#include <QPainter>
#include <QTimer>
int
main(int argc, char **argv)
{
CQAp... |
// Created by: Peter KURNEV
// 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 Lesser General Public License version 2.1 as published
// by the Free S... |
#include <iostream>
#include <vector>
#include <map>
#include <cmath>
#include <cstdlib>
#include "common.h"
using namespace std;
/**
* Day 10 - Monitoring Station
*
*/
class Asteroid
{
public:
unsigned int x = 0;
unsigned int y = 0;
unsigned int nrOfViews = 0;
double angle;
unsigned int dista... |
//
// Created by Alejandro Ibarra on 2019-03-07.
//
#include "Node.h"
|
//
// include: convert.h
//
// last update: '18.xx.xx
// author: matchey
//
// memo:
//
#ifndef PERFECT_VELODYNE_CONVERT_H
#define PERFECT_VELODYNE_CONVERT_H
#include <ros/ros.h>
#include <sensor_msgs/PointCloud2.h>
#include <dynamic_reconfigure/server.h>
#include <perfect_velodyne/CloudNodeConfig.h>
#include "pe... |
/**
* \file hello_world.cpp the hello_world example for expatpp library
*
* See LICENSE for copyright information.
*/
#include <iostream>
#include "expatpp.hpp"
using std::cout;
using std::endl;
/** a parser delegate which extracts the character data from an xml element*/
class element_delegate : public xmlpp::a... |
#include "Sphere.h"
#include <OgreEntity.h>
#include <OgreSceneNode.h>
#include <OgreSceneManager.h>
#include <OgreMeshManager.h>
#ifndef __Room_h_
#define __Room_h_
class Room
{
public:
int roomHeight;
int roomLength;
int roomWidth;
int xOffset;
int yOffset;
int zOffset;
Room();
Room(Ogre::SceneManag... |
#pragma once
#include <eotiolib/memory.hpp>
#include <eotiolib/stdlib.hpp>
#include <vector>
namespace eotio {
using std::vector;
typedef std::vector<char> bytes;
} /// namespace eotio
|
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include "Trigger.h"
#include "../rapidxml/rapidxml.hpp"
#include "../rapidxml/rapidxml_utils.hpp"
#include "../rapidxml/rapidxml_print.hpp"
using namespace std;
using namespace rapidxml;
Trigger::Trigger(xml_node<> * triggerTag){
xml_node<... |
//
// talkcases.cpp
// AutoCaller
//
// Created by Micheal Chen on 2017/8/2.
//
//
#include "talkcases.hpp"
#include "YouMeHttpRequest.hpp"
#include "YMRenderTexture.h"
#include "YouMeTalk.h"
void TalkCasesController::init()
{
SetServerMode(SERVER_MODE_TEST);
IYouMeVoiceEngine* engine = IYouMeVoiceEngi... |
#pragma once
#ifndef _PRODUC_CLASS_
#define _PRODUC_CLASS_
#include <iostream>
#include <vector>
#include "Base.h"
using namespace std;
//产生式类
class Produc
{
private:
//产生式字符串
string str;
//产生式左侧
string left;
//产生式推导符
string arrow;
//产生式右侧符号集
vector<string> right;
public:
string getStr();
string getLeft();... |
// Copyright 2020 Erik Teichmann <kontakt.teichmann@gmail.com>
#include <vector>
#include "test/catch.hpp"
#include "test/harmonic_oscillator_ode.hpp"
#include "include/sam/analysis/period.hpp"
#include "include/sam/system/rk4_system.hpp"
TEST_CASE("single harmonic oscillator") {
// omega = 1 -> T = 2*pi
sam::Pe... |
// C++ code
//
void setup()
{
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}
void loop()
{
for(int i =2; i<=9; i++){
digitalWrite(i, HIGH);
delay(200);
digitalWrite(i, LOW)... |
#pragma once
namespace console
{
typedef void (* ConsoleCommandArgs)(int argc, char* argv[], void* user);
typedef void (* ConsoleCommand)(char* cmd, char* cmdline, void* user);
typedef void (* ConsoleCommandNoArgs)();
void toggle_int(char* cmd, char* cmdline, void* user);
void init();
void print(const char* f... |
/*
* Program Name:
* Color_Transform.h
* Class Name:
* Color_Transformer
* Input: Source image one to provide color, source image two to sccept color
* Output: Processed image after color transformation
* Usage:
* ./Image_Equalizater srcImgOne srcImgTwo
*/
#ifndef COLOR_TRANSFORM_H
#define COLOR_TRANSFORM_H
... |
#include "Region.h"
Region::Region(double xl, double xr, double yl, double yr) : a11(xl),
a12(xr),
a21(yl),
a22(yr)
{
}
Region::Region()... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "UE4Coop.h"
#include "Modules/ModuleManager.h"
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, UE4Coop, "UE4Coop" );
|
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "GlPanel.h"
#include "CaptureWindow.h"
std::unique_ptr<GlPanel> GlPanel::Create(StatsMode stats_mode) {
return std::make_unique<CaptureWindo... |
#include "Ball.h"
Ball::Ball()
{
posX = OX + ((FWIDTH - size) / 2);
posY = OY + FHEIGHT - size * 2;
horStep = 10;
vertStep = -10;
}
int Ball::X()
{
return posX;
}
int Ball::Y()
{
return posY;
}
void Ball::Move(Blocks* blocks, Player player)
{
//столкновение со стенами и блоками
if (horStep > 0)
{
if (posY ... |
/**
*
*
* [RU]
*
* Даны значения температуры, наблюдавшиеся в течение N подряд идущих дней. Найдите номера дней (в нумерации с нуля) со значением температуры
* выше среднего арифметического за все N дней.
*
* Гарантируется, что среднее арифметическое значений температуры является целым числом.
*
* Ф... |
/*
SegaCDI - Sega Dreamcast cdi image validator.
FlatMemoryIterator.h - Custom iterator to iterate through a
collection of objects in a continous block of memory.
Dec 20th, 2015
- Initial creation.
*/
#pragma once
#include "../stdafx.h"
#include <iterator>
template<class T>
class FlatMemoryIte... |
/* -*- 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.
*/
#include "core/pch.h"
#include "platforms/mac/util/AppleEventUti... |
#ifndef OwnDot_HPP
#define OwnDot_HPP
#include <QObject>
// Object source comes with a .moc include
class OwnDotPrivate;
class OwnDot : public QObject
{
Q_OBJECT
public:
OwnDot();
~OwnDot();
private:
OwnDotPrivate* const d;
};
#endif
|
#ifndef DISPLAYRENDER_H
#define DISPLAYRENDER_H
#include <Arduino.h>
#include "Display.h"
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#if defined(__AVR_ATtiny85__)
if (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
class DisplayRender
{
public:
Adafruit_NeoPixel ... |
#include <vector>
struct point
{
float x;
float y;
float z;
};
struct face
{
int vtx[3];
};
struct model
{
std::vector< face > vertexIndices, normalIndices;
std::vector< point > obj_points;
std::vector< point > normals;
};
//-------- Functions ----------------------------... |
#include <stdio.h>
#include <math.h>
#include <fstream>
#include <iomanip>
using namespace std;
double mans_exp ( double x ){
double a , S ,R;
int k=0;
a = (1+x)*pow(x,k)/(1.);
S = a;
while(k<=1000)
{
k++;
R = x/k;
a = a*R;
S = S+a;
// printf("%.2f %.2f %.2f\n",x,a,S);
if(k == 999... |
/*
* Copyright (c) 2017 Ensign Energy Incorporated
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Ensign Energy Incorporated and its suppliers,
* if any. The intellectual and technical concepts contained
* herein are proprietary to Ensign Energy Incorpor... |
//
// Created by 史浩 on 2020-01-12.
//
#include "GLLooper.h"
GLLooper::GLLooper() {
mRender=new GLRender();
}
GLLooper::~GLLooper() {
delete mRender;
mRender=0;
}
void GLLooper::handleMessage(LooperMessage *msg) {
if(mRender==NULL){
return;
}
switch (msg->what){
case kMsgSurfa... |
#pragma once
#include "window.h"
#include "fps.h"
#include "scene_controller.h"
class GameInst {
Window window;
FPS fps;
SceneController scenes;
bool running = true;
bool resetResources = false;
public:
GameInst(const GameInst&) = delete;
GameInst& operator=(const GameInst&) = delete;
static GameInst& GetI... |
#include<opencv.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main(int argc, char** argv)
{
cout << "OpenCV Version: " << CV_VERSION << endl;
Mat image;
image = imread("images/photo.jpg");
if (!image.data)
{
printf("No image data \n");
return -1;
}
... |
/*
* 根据某个数值val将单链表分为两部分,一部分大于val,另一部分小于val
*/
#include <bits/stdc++.h>
using namespace std;
struct ListNode{
int data;
ListNode *next;
ListNode(int x):data(x),next(NULL){}
};
class Solution{
public:
ListNode* list_partition(ListNode *head,int val){
if(head == NULL){
return head;
... |
#include "StdAfx.h"
#include "View2.h"
#include "KEGIESDoc.h"
#include "KEGIESView.h"
#include "MainFrm.h"
#include "GL\glut.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
IMPLEMENT_DYNCREATE(View2, CView)
BEGIN_MESSAGE_MAP(View2, CView)
//
ON_WM_CREATE()
ON_WM_KEYDOWN()
ON_WM_SIZE()
ON_WM_LBUTTONDOWN()
... |
#pragma once
#include "IBehavior.h"
#include <vector>
namespace Hourglass
{
class Parallel : public IBehavior
{
public:
virtual void LoadFromXML( tinyxml2::XMLElement* data );
void AddBehavior( IBehavior* behavior );
void Clear() { m_NumChildren = 0; }
virtual void DestroyDerived();
virtual bool IsR... |
/*
有这样一道智力题:“某商店规定:三个空汽水瓶可以换一瓶汽水。
小张手上有十个空汽水瓶,她最多可以换多少瓶汽水喝?”答案是5瓶,
方法如下:先用9个空瓶子换3瓶汽水,喝掉3瓶满的,喝完以后4个空瓶子,用3个再换一瓶,喝掉这瓶满的,这时候剩2个空瓶子。然后你让老板先借给你一瓶汽水,喝掉这瓶满的,喝完以后用3个空瓶子换一瓶满的还给老板。
如果小张手上有n个空汽水瓶,最多可以换多少瓶汽水喝?
*/
#include "iostream"
using namespace std;
int main(){
int num;
int temp;
int amount;
while(cin >> num &... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
const int inf = 1e9 + 7;
int a[110],sum[110],f[110][110];
int query(int l,int r) {... |
/*! \file */ //Copyright 2011-2016 Tyler Gilbert; All Rights Reserved
#ifndef FILE_HPP_
#define FILE_HPP_
#include "../hal/Dev.hpp"
#include "../var/String.hpp"
#ifdef fileno
#undef fileno
#endif
namespace sys {
/*! \brief File Class
* \details This class is used to file access. It uses the POSIX functions open(... |
//
// Created by Guillaume Doucet on 2020-10-07.
//
#ifndef EX2_ECBOPERATIONMODE_H
#define EX2_ECBOPERATIONMODE_H
#include <string>
#include "Base/OperationModeBase.h"
class ECBOperationMode : protected OperationModeBase {
public:
std::string encryptDecrypt(const std::string& targetText, const std::string& ke... |
#include <stdio.h>
#include <stdlib.h>
long long potencia(int base, int expoente);
int main()
{
int r;
long long x;
scanf("%d", &r);
x = potencia(3,r);
printf("%lli\n", x);
return 0;
}
long long potencia(int base, int expoente){
long long retorno = base;
if(expoente == ... |
#include <core/Godot.hpp>
#include <utils.h>
#include "gdnative_setup.h"
#include "gast_loader.h"
#include "gast_node.h"
void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *options) {
godot::Godot::gdnative_init(options);
}
void GDN_EXPORT godot_gdnative_singleton() {}
void GDN_EXPORT godot_nativesc... |
#include "SubOwnDot.hpp"
#include "SubOwnDot_p.hpp"
namespace InIncludes {
class SubOwnDotLocal : public QObject
{
Q_OBJECT
public:
SubOwnDotLocal();
~SubOwnDotLocal();
};
SubOwnDotLocal::SubOwnDotLocal()
{
}
SubOwnDotLocal::~SubOwnDotLocal()
{
}
SubOwnDotPrivate::SubOwnDotPrivate()
{
}
SubOwnDotPrivate::~... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.