text stringlengths 8 6.88M |
|---|
#include "PKW.h"
#include <iostream>
#include <iomanip>
using namespace std;
extern double dGlobaleZeit;
extern double tInkrement;
PKW::PKW()
{
vInitialisierung();
}
PKW::~PKW()
{
}
PKW::PKW(const PKW& pkw) :Fahrzeug(pkw.p_sName,pkw.p_dMaxGeschwindigkeit)
{
vInitialisierung();
}
PKW::PKW(string namestr, double... |
/*
* SPDX-FileCopyrightText: 2008 Till Harbaum <till@harbaum.org>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#pragma once
#include <memory>
#include <osm2go_platform.h>
#include <osm2go_stl.h>
class gps_state_t;
class icon_t;
class iconbar_t;
class MainUi;
class map_t;
class osm_t;
class presets_items;
st... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: QTSSUserProfile.h
Description: An object to store User Profile, for authentica... |
//
// AccumulationEncoder.cpp
// PianoPlayer
//
// Created by Ben Smith on 10/31/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#include "AccumulationEncoder.h"
AccumulationEncoder::AccumulationEncoder(int tokenCount, float accumulation, bool dynamic) : SpatialEncoder(tokenCount, dynamic), accu... |
#include <stdio.h>
#include <stdlib.h>
#include "avtuner.h"
void log_packet( const AVPacket *pkt )
{
wprintf( L"pkt->pts = %d\t", pkt->pts );
wprintf( L"pkt->dts = %d\t", pkt->dts );
wprintf( L"pkt->duration = %d\t", pkt->duration );
wprintf( L"pkt->stream_index = %d\n", pkt->stream_index );
}
bool ... |
#include<iostream>
using namespace std;
//判断二进制数中1的个数 1011 与 1 按位与(&)
int fun(int num) {
int count = 0;
unsigned int flag = 1;
while (flag) { //需要循环32次
if (num&flag) {
count++;
}
flag = flag << 1;
}
return count;
}
int fun1(int num) { //一个数减一 相当于最右边的1(位置为9index)变为0 后边的0全变为1
int count = 0; //index之... |
///////////////////////////////////////////////////////////////////
//Copyright 2019-2020 Perekupenko Stanislav. All Rights Reserved.//
//@Author Perekupenko Stanislav (stanislavperekupenko@gmail.com) //
///////////////////////////////////////////////////////////////////
#include "CPPW_Quit.h"
#include "Kismet/KismetSy... |
#ifndef PORTAL_H
#define PORTAL_H
#include <memory>
#include <vector>
#define GLEW_STATIC
#include <GL/glew.h>
#include <glm/gtc/type_ptr.hpp>
#include "Program.h"
using namespace std;
class Portal {
public:
Portal(GLfloat *, int, GLuint *, int, glm::vec3&);
void Draw(const shared_ptr<Program> prog) const;
pri... |
#include "Object.h"
Object::Object(string filePath) {
centerX = 0.0f;
centerY = 0.0f;
translation = glm::mat4(1);
rotation = glm::mat4(1);
scaling = glm::mat4(1);
this->model = translation * rotation * scaling;
this->selected = false;
this->filePath = filePath;
}
bool Object::isSelected() {
return this->se... |
/*
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<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
int* arr = new int[n];
for(int i=0;i<n;i++)
{
cin >> arr[i];
}
// first > second > third
int first = INT_MIN;
int second = INT_MIN;
int third = INT_MIN;
for(int i=0;i<n;i++)
{
if(arr[i] > first)
{
third = second;
second... |
#ifndef VERKOOP_EVALUATOR_H_
#define VERKOOP_EVALUATOR_H_
#include <sstream>
#include <map>
#include <iostream>
template<typename Derived>
class Evaluator {
public:
using Command = void(Derived::*)(std::stringstream&);
private:
std::map<std::string, Command> commands_;
void stopEvaluation(std::stringstream... |
#ifndef SPRING_FORCE_H
#define SPRING_FORCE_H
#include <memory>
#include <chrono>
#include "simphys/force_generator.h"
namespace simphys {
class Particle;
class vec3;
typedef std::chrono::duration<float, std::ratio<1,1> > fsecond;
using std::shared_ptr;
class SpringForce : public ForceGenerator {
priva... |
bool check(long n,long m)
{
long long temp=m*m;
return temp<=n;
}
int Solution::sqrt(int n) {
long l=1,h=n;
long ans=0;
while(h>=l)
{
long m=l+(h-l)/2;
if(check(n,m))
{
ans=m;
l=m+1;
}
else
h=m-1;
}
return ans;
}... |
// Copyright (c) 2015 University of Szeged.
// Copyright (c) 2015 The Chromium Authors.
// All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Defines all the "sprocket" command-line switches.
#ifndef SPROCKET_COMMON_SWITCHES_H_
#define SPROC... |
#include <iostream>
#include "Parser.h"
using namespace std;
int main() {
//Parser p("test.txt");
} |
#include "serial_lib.hpp"
VRCSerialParser::VRCSerialParser(Adafruit_USBD_CDC port, cppQueue queue_q)
{
serial_bus = port;
serial_bus.begin(115200);
q = queue_q;
}
void VRCSerialParser::poll(void)
{
if (serial_bus.available())
{
uint8_t byte = serial_bus.read();
last_byte_received... |
#include <Rcpp.h>
using namespace Rcpp;
// all()
// [[Rcpp::export]]
bool allC(LogicalVector x) {
int n = x.size();
int total = 0;
for (int i = 0; i < n; ++i) {
if (x[i]) total += 1;
}
if (total == n) return true;
return false;
}
// cumprod()
// [[Rcpp::export]]
NumericVector cumprodC(Numeric... |
#include "StudentCycle.h"
StudentCycle::StudentCycle(int _startYear, int _totalStudents) : startYear(_startYear), totalStudents(_totalStudents), numOfFailedStudents(0), numOfDegreedStudents(0) {}
void StudentCycle::addStudent(Student& student) {
currentStudents.push_back(&student);
totalStudents++;
}
bool StudentC... |
/*
Given an array nums of integers, return how many of them contain an even number of digits.
Example 1:
Input: nums = [12,345,2,6,7896]
Output: 2
Explanation:
12 contains 2 digits (even number of digits).
345 contains 3 digits (odd number of digits).
2 contains 1 digit (odd number of digits).
6 contains 1 digit... |
#pragma once
class StateContext;
class IState
{
public:
virtual void Unlock(StateContext* context) {}
virtual void Open(StateContext* context) {}
virtual void Close(StateContext* context) {}
virtual void Lock(StateContext* context){}
};
|
#include <iostream>
#include <vector>
#include "gpu_nms.hpp"
using namespace std;
int main() {
int num = 3;
vector<int> keep_idxes(3, 0);
float arr[] = {
10, 10, 20, 20, 0.5,
15, 15, 20, 20, 0.3,
20, 20, 25, 25, 0.1
};
float interS = (20 - 15 + 1) * (20 - 15 + 1);
float Sa = (11 * 11);
floa... |
// LogConvert.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <direct.h>
#include <regex>
#include <ctime>
#include <thread>
#include <chrono>
using namespace std;
using namespace std::regex_constants;
/*
原始... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "Windows.UI.Xaml.Controls.Primitives.1.h"
#include "Windows.UI.Xaml.1.h"
#include "Windows.UI.Xaml.Controls.1.h"
#include "Windows.UI.Xaml.Data.1.h"
#include "Windows.UI.Xaml.2.h"
#inc... |
# include <iostream>
# include <string>
using namespace std;
int main() {
int N;
string texto;
cin >> N;
cin.ignore();
for (int i = 0; i < N; ++i) {
getline(cin, texto);
for (char &c : texto)
if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122))
c += 3;... |
#pragma once
#include <iostream>
#include <string>
#include "Faculty.h"
#include "Variables.h"
Faculty EmptyFaculty;
class FieldOfStudy
{
public:
FieldOfStudy(std::string name = " ", double thres = 0, bool engineer = false, bool master = false, double hard_work = 0, double work_during = 0,
double work_after = 0, int... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, k, p, s = 0;
cin>>n>>k>>p;
int a[n];
for(int i=0; i<n; i++) cin>>a[i];
string b;
cin>>b;
for(int i=0; i<p; i++)
{
if(b[i]=='!') s--;
else
{
int mx = 0;
for(int j=0; j<n; j++)
{
int c = 0, pi = j+s;
while(pi<0) pi += n;
... |
//
// Created by Peter Chen on 5/29/16.
//
#ifndef CUBEWORLD_BASEGAMEPLAY_H
#define CUBEWORLD_BASEGAMEPLAY_H
class BaseGameplay {
};
#endif //CUBEWORLD_BASEGAMEPLAY_H
|
//Code created by Russell Fischer on May 08 2017
//CS 236 lab 01
#include iostream
using namespace std;
int main(int arg, char* args[]){
;
}
|
// -*- 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... |
/*
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... |
class Solution {
public:
vector<vector<int>> criticalConnections(int n, vector<vector<int>>& connections) {
// time: dfs access orders, low: lowest time among all accessable nodes
vector<int> time(n), low(n);
unordered_map<int, vector<int>> graph;
vector<vector<int>> res;
in... |
#include <cstdio>
#include <cstdlib>
template<class T>
T add(T m, T n)
{
return m + n;
}
int main()
{
float i;
i = add<float>(4.1, 7);
printf("%f\n",i);
system("pause");
return 0;
}
//11.100000
|
/*
K th smallest element
Tips:
implemet max heap by priority_queue
check queue size>k then pop
in last queue top element is result
*/
#include <iostream>
#include <vector>
#include<queue>
using namespace std;
int main() {
cout<<"Kth smallest element :\n";
int arr[]={1,3,2,4,11,5,7,9,10};
int k=3... |
#define CL_HPP_ENABLE_EXCEPTIONS
#include <iostream>
// Import glew and glfw3 ORDER MATTERS
#include "GL/glew.h" // Include GLEW - OpenGL Extension Wrangler
#include "GLFW/glfw3.h" // GLFW provides a cross-platform interface for creating a graphical context,
// initializing OpenGL and binding inputs
#include "glm/gtc... |
/*
* MainTester.h
*
* Created on: Aug 13, 2017
* Author: user
*/
#ifndef MAINTESTER_H_
#define MAINTESTER_H_
#include "ServerManager.h"
#include "Client.h"
using namespace npl;
using namespace std;
class MainTester : public ClientHandler {
private:
int lastCmd;
string lastMsg;
public:
void onCommandRec... |
#ifndef SOXIPLOADBMP_H
#define SOXIPLOADBMP_H
#include <Inventor/engines/SoSubEngine.h>
#include <Inventor/fields/SoSFString.h>
#include <Inventor/fields/SoSFBool.h>
#include <xip/inventor/core/SbXipImage.h>
#include <xip/inventor/core/SoXipDataImage.h>
#include <xip/inventor/core/SoXipSFDataImage.h>
class SoXipLoadB... |
/**
* ConcreteAggregate.h
* ConcreteAggregate class
**/
#ifndef __CONCRETE_AGGREGATE__
#define __CONCRETE_AGGREGATE__
#include "IAggregate.h"
#include "Person.h"
class ConcreteAggregate : IAggregate
{
private:
const int m_max;
int m_count;
Person **m_correction;
public:
private:
public:
ConcreteAggregat... |
#ifndef __LAP_HH__
#define __LAP_HH__
#include <queue>
#include "time.hh"
struct LapData {
std::string message;
Clock timeOccurrence;
};
class TimeLap : public std::queue<LapData>{
private:
static constexpr const char* BEGIN = "__BEGIN";
unsigned int fullSize = 128;
unsigned int size = 0;
boo... |
//Programmer: Ryan Hoffman
//Date: 2/2/14
//Description: header file for the tree class. needs node to work right.
// node may need Move but that can be changed easily
#ifndef TREE_H
#define TREE_H
#include "node.h"
//#define MAXDEPTH 5 //consider delete
/* Class Tree
// Description: is the class that h... |
// 004OpenGL窗口.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <GLFW/glfw3.h>
#include <assert.h>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(640, ... |
#include "ofMain.h"
#include "ofApp.h"
#include "ofAppGLFWWindow.h"
#include "staticSettings.h"
//========================================================================
int main( ){
ofGLFWWindowSettings settings;
// settings for main window
settings.width = windowWidth;
settings.height = windowHeigh... |
#pragma once
#include "shader.h"
#include "texture.h"
#include <vector>
#include <map>
#include <ctime>
#include <string>
using namespace std;
class Grammar {
private:
std::string Gname;
int level;
std::string start;
std::string result;
vector<pair<char, vector<std::string> > >generations;
public:
Grammar() {}... |
#include <stdio.h>
#include<stdlib.h>
#include "DynaSeqList.h"
int main()
{
// TODO: Place your test code here
SqList ml;
ElemType p;
int b;
if(InitList(&ml)==true)
printf("True!\n");
else
printf("False!\n");
printf("长度为:%d\n",ListLength(ml));
ListInsert(&ml, 1,9);
ListInsert(&ml, 1,6);
ListInsert(&ml, 1... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int r, c;
cin>>r>>c;
string a[r];
for(int i=0; i<r; i++) cin>>a[i];
if(r%3!=0 && c%3!=0)
{
cout<<"NO"<<endl;
return 0;
}
bool rs = 1;
char prev = a[0][0];
for(int i=1; i<r; i++)
{
if(a[i][0]!=prev)
{
rs = 0;
break;
}
}
if(rs)
{
... |
#include "Game.hpp"
#include "GameLayer.hpp"
Game::Game() {
if (SDL_Init(SDL_INIT_EVERYTHING) < 0) {
cout << "Error SDL_Init" << SDL_GetError() << endl;
}
this ->window = SDL_CreateWindow("Pong",
SDL_WINDOWPOS_CENTERED,
SDL_W... |
# include <Player.hpp>
Player::Player(const std::string & folder)
: Entity(folder, 0.f),
m_bullets(nullptr)
{
# ifdef DEBUG
Report::report_id(Report::report::player_created);
# endif // DEBUG
}
Player::~Player()
{
# ifdef DEBUG
Report::report_id(Report::report::player_killed);
# endif // DEBUG
m_... |
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
typedef long long ll;
const int BASE = 100000000, WIDTH = 8;
// d[0]存放最低位,高位往后面加
struct bigint {
int len, data[3005];
bigint() { init(); }
// 整数
bigint(ll a) {
init();
// 特殊情况0
if (a == 0)
... |
using namespace std;
class Benua{
public:
void luas wilayah(string luas);
string pendapatan, jumlah penduduk;
};
|
/*************************************************************
Author : qmeng
MailTo : qmeng1128@163.com
QQ : 1163306125
Blog : http://blog.csdn.net/Mq_Go/
Create : 2018-03-28 15:35:32
Version: 1.0
**************************************************************/
#include <cstdio>
#include <iostream>
#include <alg... |
#include<stdio.h>
int number = 9;
int heap[9] = {7, 6, 5, 8, 3, 5, 9, 1, 6};
int main(){
//먼저 전체 트리구조를 최대 힙 구조로 바꿉니다.
for(int i=0;i<number;i++){
int c = i; //자기 자신
do{
int root = (c -1)/2; //자기 자신의 부모
if(heap[root] < heap[c]){ //부모의 값보다 자식의 값이 크다면
int temp = heap[root]; //위치 바꿔줌.
heap[root] ... |
#include <bits/stdc++.h>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
using namespace std;
inline int read()
{
int x = 0, f = 1; char ch = getchar();
while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
return x * f;
}... |
/*!
* \file KaiXinApp_Notice.cpp
* \author pengzhixiong@GoZone
* \date 2010-11-4
* \brief 解析与UI: 获取新消息通知
*
* \ref CopyRight
* =======================================================================<br>
* Copyright ? 2010-2012 GOZONE <br>
* All Rights Reserved.<br>
* The file is generated... |
//
// Created by Tidesun on 2019-04-25.
//
#ifndef BFBGRAPH_TRAVERSE_ALGORITHM_HPP
#define BFBGRAPH_TRAVERSE_ALGORITHM_HPP
#include "bfb_algorithm.hpp"
using namespace std;
class TraverseAlgorithm: public BFBAlgorithm {
public:
explicit TraverseAlgorithm(Graph* g, double _costThreshold = 0.0,char _baseDir ... |
/*************************************************************
* > File Name : P4782.cpp
* > Author : Tony
* > Created Time : 2019/09/14 14:25:57
* > Algorithm : 2-SAT
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inli... |
/*
C++ program to read time in seconds and convert in time format (HH:MM:SS) using class
*/
#include<iostream>
class DateTime {
private:
int hrs, mins, secs;
public:
void setTime(int);
void getTime();
};
void DateTime::setTime(int seconds) {
hrs = 0;
mins = 0;
secs = 0;
if(seconds >= 3600... |
/*
Button
*/
// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 3; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin
// Pin 13: Arduino has an LED connected on pin 13
// Pin 11: Teensy 2.0 has the LED on pin 11
// Pin 6: ... |
//$Id: GmatODDopplerType.cpp 1398 2013-09-18 20:39:37Z tdnguyen $
//------------------------------------------------------------------------------
// GmatODDopplerType
//------------------------------------------------------------------------------
// GMAT: General Mission Analysis Tool
//
... |
#include "vacationdb.hpp"
#include "gtest/gtest.h"
TEST(DB_EMPLOYEE_CATALOG, AddDelete) {
Vacationdb::Database db;
auto a = db.add_employee("Blah", 2015, 2, 23, "1");
ASSERT_EQ(db.get_employee_count(), size_t{1});
db.delete_employee(a);
ASSERT_EQ(db.get_employee_count(), size_t{0});
}
TEST(DB_EMPLOYEE_CATALOG, ... |
#pragma once
#include "Platform.h"
#include <vector>
namespace vkw
{
class VulkanDevice;
class DescriptorSet;
class DescriptorPool
{
public:
DescriptorPool(VulkanDevice* pDevice);
~DescriptorPool();
void AddDescriptorSet(DescriptorSet* pDescriptorSet);
void Allocate();
VkDescriptorPool GetHandle();
pr... |
/*main.cpp*/
//
// <Kirun Haque>
// U. of Illinois, Chicago
// Fall 2019
// Description: GradeUtil UI (Console Application)
// This program is C++11 dependent
//
#include <iostream>
#include "gradeutil.h"
#include <iomanip>
#include <fstream>
#include <string>
#include <sstream>
#include <map>
#include <algorithm>
#i... |
#include "JsonParameter.h"
using std::string;
JsonParameter::JsonParameter(string name_)
: name(name_)
{
}
string JsonParameter::getName()
{
return name;
}
bool JsonParameter::canDeserialize(const Json::Value &json)
{
(void)json;
return true;
}
JsonParameter *JsonParameter::setAttribute(std::strin... |
#ifndef VM_TRANSLATOR_CodeWriter_h
#define VM_TRANSLATOR_CodeWriter_h
#include <iostream>
#include <string>
#include <fstream>
#include <assert.h>
#include "Parser.h"
using namespace std;
class CodeWriter{
public:
CodeWriter(string outFileName);
CodeWriter();
~CodeWriter();
void setFileName(st... |
// Copyright [2014] <lgb (LiuGuangBao)>
//=====================================================================================
//
// Filename: session.cpp
//
// Description: 服务器框架会话接口
//
// Version: 1.0
// Created: 2013年04月07日 13时02分52秒
// Revision: none
// Compiler: gcc
//
// ... |
/********************************************************************************
** Form generated from reading UI file 'loginadmin.ui'
**
** Created by: Qt User Interface Compiler version 5.4.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
****************************************... |
#include<stdio.h>
#include<string.h>
void input(char st[]);
void output(char st[]);
void letter(char x[],char y[]);
int main()
{
char s1[20],s2[10];
input(s1);
letter(s1,s2);
output(s2);
return 0;
}
void input(char st[])
{
printf("ÇëÊäÈë×Ö·û´®:");
gets(st);
}
void letter(char x[],char y[])
{
int n=strlen(x);
f... |
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll i, j, k, n;
string s, s1 , b;
cin>>n>>k>>s;
b=s;
for(i=k ; i<n; i++) b[i]=b[i-k];
if(b>=s)cout<<n<<endl<<b<<endl;
else
{
for(i=k-1; i>=0; i--)
{
if(b[i]=='9' )b[i]='0';
... |
#include "LibClient.h"
int main()
{
SetConsoleTitle(TEXT("Xỗ Số Kiến Thiết - Client"));
resizeConsole(800, 700);
AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0);
AfxSocketInit(NULL);
CSocket client;
char sAdd[1000];
unsigned int port = 1234;
AfxSocketInit(NULL);
client.Create();
cout <... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "../base.h"
#include "Windows.Phone.Notification.Management.0.h"
#include "Windows.ApplicationModel.Appointments.0.h"
#include "Windows.ApplicationModel.Email.0.h"
#include "Windows.Fo... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
/********************************************************************
created: 2014/08/22
created: 22:8:2014 15:27
author: lic
*********************************************************************/
#ifndef __CONFIGLANGUAGESETTING__H__
#define __CONFIGLANGUAGESETTING__H__
#include <string>
#include <map>
#inclu... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: StringFormatter.h
Description: Utility class for formatting text to a buffer.Construct objec... |
// -*- 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... |
#pragma once
#include <iostream>
#include"Player.hpp"
#include <string>
#include <utility> //std::pair
#include "Log.hpp"
#define DEFAULT_ID 10000
#include <unordered_map>
#include <pthread.h>
using namespace std;
class PlayerManager
{
private:
unordered_map<uint32_t,Player> Player_set;//<key,value>用户集 <id,p... |
#ifndef KKTLP_H
#define KKTLP_H
#include <string>
#include <iostream>
//#include "kktecqfunc.h"
#include "kktmatrix.h"
using namespace std;
//class KKTlp: public KKTEcqFunc {
//class KKTlp: public KKTMatrix {
class KKTlp {
public:
int m, n, na, ng;
double *a, *g; // const parameters
double ... |
#include <iostream>
#include <string>
#include <map>
class Mapleton {
public:
// Returns a reference to static instance of this class
// based on provided string identifier
static Mapleton& instance(const std::string& id) {
static std::map<std::string, Mapleton> instances;
auto it = instanc... |
#include "AnimationController.h"
using namespace std;
AnimationController::AnimationController()
{
//loads each animation
LoadAnimation("Resources/Robot/RobotIdleAnim.dae");
LoadAnimation("Resources/Robot/RobotDieAnim.dae");
LoadAnimation("Resources/Robot/RobotAttackAnim.dae");
//Additional animations could b... |
#include <ros/ros.h>
#include <math.h>
#include <cmath>
#include <stdio.h>
#include <tf/tf.h>
#include <tf/transform_listener.h>
#include <tf/transform_datatypes.h>
#include <visualization_msgs/MarkerArray.h>
#include <nav_msgs/OccupancyGrid.h>
#include <cstdlib>
int cell_x = 128;
int cell_y = 128;
double frequency =... |
#include"Header.h"
/*
* this library is about graph
* Before using this library,please read this document
* if this library'sfunction not work,please check
* the souce code,then change the way of your using
*/
namespace GRAPH
{
#define _Max_Vertex 100
#define _Max_Edge 100
#define _Inf_ 0x7fffffff
/*******... |
#include "Score.h"
#include "Game.h"
#include <QFont>
extern Game * game;
Score::Score(QGraphicsItem *parent): QGraphicsTextItem(parent){
// draw the text
setPlainText(QString("Score: ") + QString::number(game->scores)); // Score: 0
setDefaultTextColor(Qt::black);
setFont(QFont("times",10));... |
#include <opencv.hpp>
#include <iostream>
#include <cstdlib>
using namespace cv;
using std::cout;
using std::endl;
int main(int argc, char **argv){
setlocale(LC_ALL, ""); // функция поддержки кириллических символов
char mainWindow[] = "Main";
char trackbarWindow[] = "Trackbar";
char thresh... |
// keyuz4Helper.hpp
// ICS46 Winter 2021 Project 3
// Name: Keyu Zhang
// ID: 19898090
// UCINetID: keyuz4
// header file for my helper functions
#ifndef KEYUZ4_HELPER_HPP
#define KEYUZ4_HELPER_HPP
#include "OthelloAI.hpp"
#include <vector>
namespace keyuz4
{
// find all valid moves
std::vector<std::pai... |
/*************************************************************************
> File Name : data/data.h
> Author : YangShuai
> Created Time: 2016年07月11日 星期一 15时42分41秒
> Description : 1 该文件实现定义基本的数据结构,对外只提供操作接口,实现细节
不可见;
2 函数返回值:成功 返回数据大小,失败 返回-1
3 对于每... |
#ifndef UTILS_HPP
#define UTILS_HPP
#include <stdlib.h>
#include <math.h>
#include <sstream>
#include <string>
#include <iostream>
#include <vector>
#include <limits>
#include "Assert.h"
#include "Random.h"
#ifdef USE_BOOST_PYTHON
#include "boost/shared_ptr.hpp"
#include "boost/python.hpp"
#include "b... |
#include "ItemHexView.h"
#include "Log.h"
#include "Testing.h"
#include "Timer.h"
#include "ResourceManager.h"
ItemHexView::ItemHexView( uint id, ProtoItem* proto ): ItemView( id, proto )
{
const_cast< EntityType& >( Type ) = EntityType::ItemHexView;
// Hex
HexScrX = nullptr;
HexScrY = nul... |
// AppViewerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FirstServer.h"
#include "AppViewerDlg.h"
#include "afxdialogex.h"
#include "clValidateServer.h"
#include "..\include\Util\\errMessage.h"
#include "..\include\Util\FileRec.h"
//#include "C:\home\holdem\Strategy\Source\CalcSitEV.h"
//#include "... |
#include "cpptools_Files.hpp"
#include <fstream>
#include <sys/stat.h>
#include "cpptools_Logger.hpp"
namespace imog {
bool Files::ok(const std::string& path, bool log) {
bool ok = std::fstream(path).good();
if (log && !ok) LOGD("Problems with file {}", path);
return ok;
}
bool Files::pathExists(const std::... |
#include <cstdio>
#include <iostream>
using namespace std;
int main()
{
long long int n,i,sum,arr[100000];
while(scanf("%lld",&n)!=EOF)
{
sum=0;
if(n==0)
break;
i=0;
while(1)
{
arr[i]=n%2;
if(n%2==1)
{
... |
#pragma once
#ifndef RULEZ_H
#define RULEZ_H
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <vector>
#include "predicate.h"
//#include "parser.h"
using namespace std;
class rulez {
public:
rulez() {};
void set_head(predicate headPred);
void add_predicate(p... |
#include "bouncegui.h"
BounceGui::BounceGui() {
setFixedSize(320, 240);
arena_ = new Arena(width(), height());
new Ball(arena_, 40, 80);
new Ball(arena_, 80, 40);
new Ghost(arena_, 60, 60);
turtle_ = new Turtle(arena_, 80, 80);
startTimer(1000 / 30); // 30 fps
}
void BounceGui::timerEven... |
#ifndef CLIENT_H
#define CLIENT_H
#include <string>
struct Client
{
std::string name;
uint8_t voice_channel;
};
#endif // CLIENT_H
|
// This file has been generated by Py++.
#include "boost/python.hpp"
#include "generators/include/python_CEGUI.h"
#include "Event.pypp.hpp"
namespace bp = boost::python;
struct Event_wrapper : CEGUI::Event, bp::wrapper< CEGUI::Event > {
Event_wrapper(::CEGUI::String const & name )
: CEGUI::Event( boost::ref... |
/*
* E-UAE - The portable Amiga Emulator
*
* Support for traps
*
* Copyright Richard Drummond 2005
*
* Inspired by code from UAE:
* Copyright 1995, 1996 Bernd Schmidt
* Copyright 1996 Ed Hanway
*/
#include "sysconfig.h"
#include "sysdeps.h"
#define NEW_TRAP_DEBUG 0
#include "options.h"
#include "memory.h"
#include "... |
#pragma once
#include "types.h"
namespace transprecision_floating_point
{
namespace simple_ml_lib
{
template<typename Type>
struct backward_grads
{
backward_grads(tensor<Type>* weights, tensor<Type>&& grad_weights, tensor<Type>* bias, tensor<Type>&& grad_bias);
tensor<Type>& weights();
tensor<Type>& g... |
#include "WaterFactory.h"
#include "ColaFactory.h"
#include "JuiceFactory.h"
int main(int argc, char *argv[])
{
std::shared_ptr<IFactory> factory = std::make_shared<WaterFactory>();
std::shared_ptr<IDrink> water = factory->create();
water->drink();
factory = std::make_shared<ColaFactory>();
std::s... |
//======================================================================================
// Game Institute - C++ Module 1 Textbook Exercises
// Main.cpp The main Program Entry point.
// Exercise 6.10.2 - To-Upper
// TODO: - 1. Ask the user to enter up to a line of text and store it in string s.
// 2. Transform each ... |
/*
@Copyright:LintCode
@Author: goni0202
@Problem: http://www.lintcode.com/problem/intersection-of-two-arrays-ii
@Language: C++
@Datetime: 16-08-10 15:21
*/
#include <set>
class Solution {
public:
/**
* @param nums1 an integer array
* @param nums2 an integer array
* @return an integer array
... |
#ifndef USERCONTROLLER_HPP
#define USERCONTROLLER_HPP
#include <QObject>
#include "model/entity/UserDto.hpp"
class UserController : public QObject
{
Q_OBJECT
public:
explicit UserController(QObject *parent = 0);
signals:
void requireDeleteUser (const qint32 &id);
void requireRefreshUserList ();
v... |
#include "sort.h"
#include <string>
#include <iterator>
#include <vector>
#include <algorithm>
#include <cctype>
#include <sstream>
#include <iostream>
#include <fstream>
#include <ostream>
#include <set>
#include <utility>
namespace
{
struct Line : public std::string {};
std::istream & operator >> (std::istream ... |
#include "AreaLight.h"
#include "tinyxml2.h"
#include "Base/ParseHelper.h"
#include "Base/PCH.h"
AreaLight::AreaLight()
{
mParenetPtr = nullptr;
}
AreaLight::~AreaLight()
{
}
void AreaLight::Deserialization( tinyxml2::XMLElement* RootElement )
{
ParseVector( RootElement->Attribute( "Le" ) , &mEmission[0] );
}
vo... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.