text stringlengths 8 6.88M |
|---|
/////////////////////////////////////////////////////////////////////////////////////////////
// Copyright 2017 Intel Corporation
//
// 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
//
... |
// Wave Player
#include "xbwaveplayer.h"
//LPDIRECTSOUND8 m_pDSound; // DirectSound object
//LPDIRECTSOUNDBUFFER8 m_p3DBuffer; // 3D buffer from audiopath
void temp()
{
//m_p3DBuffer->
}
//CXBSound *m_DPadUPSnd = new CXBSound();
/*void PlaySound(CXBSound *pSound)
{
if (pSound) { ... |
//
// UICallBack.cpp
// cocostudio
//
// Created by wangpeng on 15/8/12.
//
//
#include "UICallBack.h"
#include "ui/UIText.h"
#include "cocostudio/CCObjectExtensionData.h"
#include "SimpleAudioEngine.h"
#include "Game.h"
USING_NS_CC;
using namespace std;
using namespace cocos2d::ui;
using namespace CocosDenshion... |
#pragma once
#include <iostream>
#include "base_ds.h"
#include "node.h"
#include "iterator.h"
namespace ds
{
template <class T>
class List : public BaseDs<T>
{
friend Iterator<T>;
private:
//public:
Node<T>* _begin;
Node<T>* _end;
public:
List();
void push_front(const T& x);
void push_back(const T& x);... |
#ifndef DIAGON_API_H
#define DIAGON_API_H
extern "C" const char* API();
#endif /* end of include guard: DIAGON_API_H */
|
#include <iostream>
#include <iomanip>
#include <cstdlib>
void print(int arr[], int size)
{
for(int i = 0; i < size; ++i)
{
std :: cout << arr[i] << " ";
}
std :: cout << '\n';
}
void rand(int arr[], int size)
{
for(int i = 0; i < size; ++i)
{
arr[i] = rand() % 100;
}
}
void delete_i(int arr[], int i, int... |
#include <iostream>
#include "boo_export.h"
int foo();
BOO_EXPORT int boo() {
std::cout << "boo: " << foo() << std::endl;
return 42;
}
|
/********************************************************************/
/* MODULO : MAIN.C */
/* PROGRAMMA : JOBSHOP.EXE */
/* VERSIONE : Vedi fine main.c */
/* PROGRAMMATORE : Ghirardi Marco */
/* ALTRI MODULI : BeB.C, Bounds.C, Branch.C, ... |
#include <iostream>
#include <string>
#include <fstream>
#include <vector>
#include <sstream>
#include <cassert>
#include <stdio.h>
#include <stdlib.h>
#include <cmath>
#include <ctime>
#include <algorithm>
using namespace std;
// is sushkov using his mac or not?
const int MAC = 0;
// Filenames
const char dataFileP... |
#include <type_traits>
#include <iostream>
#include "Commands.h"
#include "GlobalVariables.h"
using namespace std;
PwdCommand::PwdCommand(string args):BaseCommand(args){
}
void PwdCommand::execute(FileSystem & fs){
if (verbose==2||verbose==3)
cout<<toString()+" "+getArgs()<<endl;
std::cout<<fs.getWork... |
/*
author:zjj
data:2020.10.29
modify:
*/
#include "PointCloudMap.h"
#include "AffinePosture.h"
using namespace gtsam;
using namespace std;
CPointCloudMap::CPointCloudMap()
{
poses.clear();
clouds.clear();
input_cloud_count = 0;//控制往缓存中添加cloud的数量
input_ndtcloud_count = 0;
}
bool CPointCloudMap::AddCloudandPose(... |
#include "GameObject.h"
#include <iostream>
GameObject::GameObject(AllKit::Sprite _sprite, int _x, int _y)
{
InitFields();
x = _x;
y = _y;
sprite = _sprite;
radius = 20;
}
int GameObject::GetWidth()
{
return AllKit::Get().GetWidth(sprite);
}
int GameObject::GetHeight()
{
return AllKit::Get().GetHeight(sprite)... |
#pragma once
#include "ofMain.h"
#include "ofxCv.h"
#include "ofxOpenCv.h"
#define CROPX 200
#define CROPY 30
#define CROPW 100
#define CROPH 100
#define CAMW 640
#define CAMH 480
class ofApp : public ofBaseApp {
public:
void setup();
void update();
void draw();
void keyPressed(int key);
ofVideoGrabber cam;
... |
#include "lista.h"
lista::lista()
{
this->diaUno=NULL;
}
void lista::crearActividad(const std::string& dia,const std::string& hora, const std::string& act)
{
int hr = stoi(hora.substr(0,hora.length()-2));
nodoCabecera* cabDia = new nodoCabecera(dia);
nodoCabHora* cabHora = new nodoCabHora(hora,hr);
... |
#include <bits/stdc++.h>
using namespace std;
int main() {
srand (time(NULL));
if ((rand() % 2) == 0)
cout << rand() % 500 + 1 << " " << rand() % 500 + 1 << endl;
else {
int teste = rand() % 250 + 1;
cout << teste << " ";
cout << teste * (rand() % 10) << endl;
}
return 0;
} |
// UNKNOWN: a Mini Library for DLL COM Servers
// Facilitates creating COM DLL server modules without use of ATL
//
// Provides:
// - template-based UNKNOWN base class with full implementation for IUnknown interface
//
// Does not require linking to CPP or importing LIB files
// long g_cComponents variable must ... |
/********************************************************************************
** Form generated from reading UI file 'mainwidget.ui'
**
** Created by: Qt User Interface Compiler version 5.15.1
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
***************************************... |
#pragma once
#include "swizzle.h"
#include <intrin.h>
#include <string.h>
#include <stdint.h>
#include <iostream>
#include <assert.h>
struct alignas(16) Vec4f
{
__m128 data;
Vec4f()
{
assert(((const ptrdiff_t)this) % alignof(Vec4f) == 0);
Load(0);
}
__forceinline Vec4f(float x)
{
assert(((const ptrdiff_t)... |
/***************************************************************************
Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD
FileName: XMLPrefsParser.cpp
Description: A object that modify items and re-create the DT... |
// Section 14
// Overloading copy assignment
#include <iostream>
#include <vector>
#include "Mystring.h"
using namespace std;
int main() {
//161. OVERLOADING ASSIGNMENT OPERATOR (MOVE)
Mystring a{"Hello"}; //Overloaded constructor
a = Mystring{"Hola"}; //Overloaded constructor then move assignmenet... |
/****************************************************************************
** Meta object code from reading C++ file 'application.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.10.0)
**
** WARNING! All changes made in this file will be lost!
********************************************************... |
#ifndef SOUVEDIT_H
#define SOUVEDIT_H
#include <QDialog>
namespace Ui {
class SouvEdit;
}
class SouvEdit : public QDialog
{
Q_OBJECT
public:
explicit SouvEdit(QWidget *parent = 0, QString selectedStadium = " ");
~SouvEdit();
private slots:
void on_pushButton_2_clicked();
void on_pushButton_3_... |
// stonewt.cpp -- Stonewt methods
#include <iostream>
#include "stonewt.h"
// construct Stonewt object from double value
Stonewt::Stonewt(double lbs, Mode s)
{
stone = int (lbs) / Lbs_per_stn; // integer division
pds_left = int (lbs) % Lbs_per_stn + lbs - int(lbs);
pounds = lbs;
status = s;
}
// co... |
#include "pch.h"
#include "svgrenderer.h"
#include "processrunner.h"
#include "strings.h"
namespace {
QDomDocument _CloneDocRoot( QDomDocument& doc ) {
QDomDocument skeletonDoc( doc.doctype( ) );
skeletonDoc.appendChild( doc.childNodes( ).item( 0 ).cloneNode( false ) );
skeletonDoc.appen... |
/*************************************************************
* > File Name : P2761.cpp
* > Author : Tony
* > Created Time : 2020/04/15 09:13:33
* > Algorithm : 状压+最短路
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
inl... |
#include <iostream>
using namespace std;
void main()
{
//TASK 01//
char symb;
cout << "Vvedit 1 symvol" << endl;
cin >> symb;
if (symb >= '0' && symb <= '9')
{
cout << "Vu vvelu chislo " << symb << endl;
}
else if (symb >= 'a' && symb <= 'z')
{
cout << "Vu vvelu bykvu " << symb << endl;... |
// ===============================================
// @file defender.h
// @author janeQuinn
// @practical defender
// @brief Header file for PSP+GLFW(OpenGL) dfender game
// ===============================================
#include "defender.h"
// state for main game loop
GameState gameState = GAME_INTRO;
// frame... |
#include "MoveController.h"
#include "GameScene.h"
#include "TransPos.h"
bool MoveController::init()
{
initMenu();
buttonDown = false;
isMoving = false;
return true;
}
bool MoveController::initMenu()
{
//上下左右按钮
CCScale9Sprite *upNormal = CCScale9Sprite::create("UpNormal.png");
CCControlButton *upButton = CC... |
//lr2.3
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
struct BinKor;
//Груз ::= Гирька | БинКор
struct Load {
bool isWeight;
union {
int weight;
BinKor* binKor;
} data;
};
//Плечо ::= (Длина Груз)
struct Side {
short length;
Load* load;
};
//БинКор ... |
/***********************************************************************
created: Sun, 6th April 2014
author: Lukas E Meindl
*************************************************************************/
/***************************************************************************
* Copyright (C) 2004 - 20... |
#include "UtilRandom.h"
// declare and initialize the private static instance variable
UtilRandom *UtilRandom::_instance = 0;
// initialize the mersenne twister using the standard random_device for the platform
UtilRandom::UtilRandom() : mt(std::random_device()())
{
}
UtilRandom::~UtilRandom()
{
}
float UtilRando... |
/*
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... |
/*
d64view - a d64 disk image viewer
Copyright (c) 2002,2003,2016 Michael Fink
*/
/*! \file canvas.cpp
\brief canvas implementation
canvas implementation; drawing is done using the charset class that
contains a bitmap of all viewable chars.
*/
// needed includes
#include "common.hpp"
#include "canvas... |
#ifndef _EXAMPLE_CERES_H_
#define _EXAMPLE_CERES_H_
#include <ceres/ceres.h>
#include <glog/logging.h>
using ceres::AutoDiffCostFunction;
using ceres::CostFunction;
using ceres::Problem;
using ceres::Solver;
using ceres::Solve;
// A templated cost functor that implements the residual r = 10 -
// x. The method opera... |
#include "LayerFood.h"
#include "AppMacros.h"
bool LayerFood::init()
{
CCLayer::init();
m_pbigBoomArray = CCArray::create();
CC_SAFE_RETAIN(m_pbigBoomArray);
schedule(schedule_selector(LayerFood::addBigBoom), 5.0f);
return true;
}
void LayerFood::addBigBoom(float dt)
{
C... |
#pragma once
#ifndef _CONTEST_HPP_
#define _CONTEST_HPP_
#include "Algorithm.hpp"
#include "DataSet.hpp"
#include <memory>
class CContest
{
public:
// set the algorithm used for writing the output data based on the input received
void setAlgorithm(std::unique_ptr<IAlgorithm> algorithm)
{
mAlgorithm = s... |
#include <iostream>
using namespace std;
int ncr(int n, int r)
{
if(r==0 || n==r){
return 1;
}
return ncr(n-1, r-1) + ncr(n-1, r);
}
int main()
{
cout << ncr(4,2) << endl;
return 0;
}
|
#ifndef __WHISKEY_Passes_VerificationScope_HPP
#define __WHISKEY_Passes_VerificationScope_HPP
#include <whiskey/AST/Pass.hpp>
namespace whiskey {
class VerificationScope : public Pass {
protected:
Node stripNonScopeDeclVariable(Node value);
Node stripNonScopeDeclFunction(Node value);
Node stripNonScopeDeclClass(No... |
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
const int inf = 1e9, NMAX=105;
#define forn(i, n) for (int i = 0; i < (int) n; ++i)
#define seta(a, b) memset(a, b, sizeof(a))
int n, m, k;
char s[NMAX];
int p[NMAX][NMAX], ans[NMAX][NMAX][27];
int main() {
cin >> s >> k >> m;
... |
/*
* SkyBox.cpp
*
* Created on: 10 сент. 2017 г.
* Author: Соня
*/
#include "SkyBox.h"
SkyBox::SkyBox(String frontImage, String backImage, String leftImage, String rightImage, String topImage, String bottomImage) {
}
SkyBox::~SkyBox() {
}
|
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll cnt[200006];
map<ll,ll>mp;
priority_queue <pair<ll,ll>>v;
int main()
{
ll m,n,k,i,j;
cin>>n>>k;
ll a[n];
for(i=0;i<n;i++)cin>>a[i], cnt[a[i]]++, mp[a[i] ]++;
ll d=mp.size();
for(i=0;i<mp.size();i++)
{
for(j=1;j<=m... |
#include "ModuleFileSystem.h"
#include "Application.h"
#include <fstream>
ModuleFileSystem::ModuleFileSystem(bool start_enabled) : Module(start_enabled)
{
this->SetName("FileSystem");
}
ModuleFileSystem::~ModuleFileSystem()
{
this->SetName("FileSystem");
}
bool ModuleFileSystem::Init()
{
// Settings
/* CreateF... |
#include <iostream>
#include <string>
#include "CDate.h"
CDate::CDate(void){
m_year = m_month = m_day = 0;
}
CDate::CDate(int year, int month, int day){
setDate( year, month, day );
}
CDate::CDate(int year, std::string month, int day){
setDate(year, month, day) ;
}
bool CDate::isValidDate(int year, in... |
#include <cstdio>
#include <iostream>
#include <map>
#include <vector>
#include <queue>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
int res,ans;
map<string,int>rupa;
void bfs(string a,string b,map<string,vector<string> >sagar)
{
res=0;
ans=2;
queue<string>q;
q.push(a);
... |
/*
* File.cpp
*
* Created on: Jun 3, 2017
* Author: user
*/
#include "File.h"
#include <fstream>
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
namespace npl {
File::File(char* path) {
fileName=path;
}
void File::closeSock() {
fclose(fPointer);
cout<<"File closed!"<... |
// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "Matrix4x4.h"
#include "FuncSplit.h"
#include <emmintrin.h>
#include <xmmintrin.h>
#include <sstream>
namespace MathsLib
{
//... |
//**************************************************************************
//**
//** 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 <iostream>
using namespace std;
void main() {
char a;
cout << "소문자 입력: ";
cin >> a;
cout << a << "는 " << (int)(a - 'a') << "번째 영어 소문자" << endl;
}
|
/**
* $Source: /backup/cvsroot/project/pnids/zdk/zls/zfc/Hash.cpp,v $
*
* $Date: 2001/11/14 17:25:11 $
*
* $Revision: 1.3 $
*
* $Name: $
*
* $Author: zls $
*
* Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved.
*
* lisong.zheng@gmail.com
*
* $State: Exp $
*/
#inclu... |
/*
* distances.h
*
* Created on: Feb 7, 2014
* Author: vbonnici
*/
#ifndef DISTANCES_H_
#define DISTANCES_H_
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <string>
#include <sstream>
#include <set>
#include "data_ts.h"
#include "trim.h"
#include "DNA5Alphabet.h"
#i... |
#include "RBT.h"
#include <fstream>
bool RBT::is_empty()
{
if (root == nullptr)
{
return true;
}
else
{
return false;
}
}
int RBT::count()
{
Node* current = root;
int c = leaf(current);
return c;
}
int RBT::leaf(Node* current)
{
if (current == nullptr)
{
return 0;
}
... |
/*
===============================================================================
Name : main.c
Author : $(author)
Version :
Copyright : $(copyright)
Description : main definition
===============================================================================
*/
#if defined (__USE_LPCOPEN)
#if ... |
#ifndef __CLUCK2SESAME_PLATFORM_MOTOR_WAITSTATE_INC
#define __CLUCK2SESAME_PLATFORM_MOTOR_WAITSTATE_INC
#include "Platform.inc"
#include "States.inc"
#include "Timer0.inc"
radix decimal
.module MOTOR
#define MOTOR_WAIT_PARAM_INITIAL_TICKS motorStateParameter0
#define MOTOR_WAIT_PARAM_NUMBER_OF_TICKS motorSt... |
#if 0
#include<iostream>
#include"PosList.h"
using namespace std;
template<typename T>
PosList<T>::PosList(int arrlen)
{
m_nArrLen = arrlen;
m_pArray = new T[arrlen];
}
template<typename T>
PosList<T>::~PosList()
{
delete[] m_pArray;
}
template<typename T>
bool PosList<T>::SetPos(int index, T pos)
{
if (index < 0... |
//
// Created by zhxh on 2018/7/23.
//
#include <jni.h>
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <android/log.h>
#include <string.h>
#define LOG_TAG "nativeCodeWithLog"
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
extern "C" JNIEXPORT jstr... |
/***************************************************************************
Copyright (c) 2020 Philip Fortier
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 version 2
of the License, or... |
#include "AnimatedGraphic.h"
#ifdef __linux__
//linux code goes here
#include <SDL2/SDL.h>
#elif _WIN32
//windows code goes here
#include <SDL.h>
#endif
#include "InputHandler.h"
AnimatedGraphic::AnimatedGraphic() : SDLGameObject() {}
void AnimatedGraphic::load(const LoaderParams* pParams) {
SDLGameObjec... |
#include<bits/stdc++.h>
using namespace std;
void ArrayUpdate(vector<int> arr,int k) {
vector<int> temp;
for(int i=0; i<arr.size(); i++) {
if(arr[i]<k) {
temp.push_back(arr[i]);
}
}
for(auto j : temp) {
cout<<j<<" ";
}
int max = 0,temp1;
for(int i=0; i<temp.size(); i++) {
temp1 = k - temp[i];
if(... |
#ifndef CUSTOMBOTTOM_H
#define CUSTOMBOTTOM_H
#include <QWidget>
#include "Common/ulity.h"
#include "loadres.h"
class QPushButton;
class QDialogButtonBox;
class QVBoxLayout;
class CustomBottom : public QWidget
{
Q_OBJECT
public:
explicit CustomBottom(QWidget *parent = 0,int flag = 0,LoadRes* pRes = 0);
v... |
#include "ExpensesManager.h"
void ExpensesManager::addExpense() {
Expense expense;
system("cls");
cout << " >>> DODAWANIE NOWEGO WYDATKU <<<" << endl << endl;
expense = insertNewExpense();
expenses.push_back(expense);
if (fileWithExpenses.addExpenseToFile(expense)) {
cout << "Dodano no... |
#ifndef SENSORS_H
#define SENSORS_H
#include <webots/Robot.hpp>
#include <webots/Servo.hpp>
#include <iostream>
#include <map>
#include "Kinematics.h"
#include "SampleRobot.h"
#include <vector>
using namespace Kinematics;
using namespace webots;
//typedef Servo* WBDevicePtr;
class Sensors:public Robot
{
public:
Sen... |
// MathLibrary.cpp : Defines the exported functions for the DLL application.
// Compile by using: cl /EHsc /DMATHLIBRARY_EXPORTS /LD MathLibrary.cpp
#include "stdafx.h"
#include <iostream>
#include "Logging.h"
#include <fstream>
#include <sstream>
#include <stdlib.h>
#include <stdio.h>
using namespace std;
#pragma w... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "UE4VoxelTerrain.h"
#include "SystemInfoWidget.h"
#include "TerrainController.h"
ATerrainController* USystemInfoWidget::getController() {
if (controller == NULL || !controller->IsValidLowLevel()) {
for (TActorIterator... |
#include "EspRobotControl/Utility/Timer.hpp"
Timer::Timer(float period_, Print &printer_):
period(period_),
last_time_micros(0),
current_time_micros(0),
start_time_micros(0),
{
period_micros = period*1000000.0;
}
Timer::~Timer()
{
}
void Timer::start(){
start_time_micros = micros();
last_... |
//Дан массив A размера N. Вывести вначале его элементы с нечетными номерами в порядке возрастания номеров,
//а затем — элементы с четными номерами в порядке убывания номеров
#include <iostream>
#include <locale.h>
using namespace std;
int main()
{
int N, k, i;
setlocale(LC_ALL, "Rus");
k = 0;
cout << "введите ... |
/**
* $Source: /backup/cvsroot/project/pnids/zdk/zls/zvm/demo1.cpp,v $
*
* $Date: 2001/11/14 18:29:37 $
*
* $Revision: 1.3 $
*
* $Name: $
*
* $Author: zls $
*
* Copyright(C) since 1998 by Albert Zheng - 郑立松, All Rights Reserved.
*
* lisong.zheng@gmail.com
*
* $State: Exp $
*/
#include <zls/zvm/CVirt... |
#ifndef ___filterlexer__aera_h___
#define ___filterlexer__aera_h___
#include <boost/optional.hpp>
namespace filtering
{
enum lextype_t { apunctuator, anumber, asymbol, areference, } ;
typedef std::map<std::string, int> vars_t;
//////////////////////////////////////////////////////////////////////////
class lexer;
... |
#include<iostream>
using namespace std;
int c = 45;
int main()
{
int a, b, c;
float d 34.4
cout<<"enter th value of a:"<<endl;
cin>>a;
cout<<"enter the value of b:"<<endl;
cin>>b;
c = a + b;
cout<<"the sum is "<<c<<endl;
// :: tihs is scope resolution operator
cout<<"the flobal c is "<<::c;
return 0... |
#include "StdAfx.h"
#include "FrmFactoryMode.h"
|
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// # DARK PLUGIN - POWERED BY FIRE TEAM
// # GAME SERVER: 99.60T (C) WEBZEN.
// # VERSÃO: 1.0.0.0
// # Autor: Maykon
// # Skype: Maykon.ale
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// # O Sen... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
float a[n], b[n], tongHeSo=0, tongDiem=0;
for (int i=0; i<n; ++i){
cin >> a[i] >> b[i];
if (a[i]<0 || a[i]>10){
cout << "Sai diem so";
tongDiem = 0;
tongHeSo = 0;
... |
#include <queue>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
const int MAXV = 512;
int n, m;
vector<int> Adj[MAXV];
int inDegree[MAXV];
int s[MAXV];
bool topologicalSort()
{
int num = 0;
priority_queue<int, vector<int>, greater<int>> q;
// bug2:编号错误,不是从0开始
for (int i... |
#include<bits/stdc++.h>
using namespace std;
struct node
{
int even=0;
int odd = 0;
};
void build_tree(int* arr,node* tree,int start,int end,int tree_node)
{
if(start==end)
{
if(arr[start]%2==0)
{
tree[tree_node].even = 1;
}
else
{
tree[tree_node].odd = 1;
}
return ;
}
int mid = start + (... |
#include "services/content-service.h"
#include <fstream>
#include <sstream>
ContentService::ContentService(const std::string &pages_dir) {
this->pages_dir_ = boost::filesystem::path(pages_dir);
};
std::unique_ptr<HttpResponse> ContentService::Handle(const std::unique_ptr<HttpRequest> &request) {
if(!resource_exis... |
#include "SK___t__service.h"
#include "dn.h"
#include "iComm.h"
using namespace Comm;
int __T__Service :: SKGetMetainfo(std::string& tResponse )
{
return 0;
}
int __T__Service :: SKEcho( const std::string& request,
std::string& response )
{
response = request;
LogDebug("%s(%d) %s", __func__, __LINE__, request.... |
#pragma once
#include "entity.h"
#include "room.h"
#include "SFML/Graphics/CircleShape.hpp"
class Floor : public Entity{
friend int main();
friend class Game;
friend class Player;
friend class FloorCT;
std::unordered_map<int, Room> rooms;
sf::Vector2f origin = sf::Vector2f(0, 0); // is... |
//-----------------------------------------------
//
// This file is part of the Siv3D Engine.
//
// Copyright (c) 2008-2018 Ryo Suzuki
// Copyright (c) 2016-2018 OpenSiv3D Project
//
// Licensed under the MIT License.
//
//-----------------------------------------------
# include "../Siv3DEngine.hpp"
# include "../A... |
#ifndef AVL_H
#define AVL_H
#include "node.h"
using namespace std;
class avl
{
public:
avl();
int insertNode(node* newNode, node* headNode);
bool treeInsertNode(node* newNode);
void deleteNode(node* victimNode);
node* searchKey(int, node*);
node* treeSearchKey(int)... |
#include "dna.h"
/*
Write code for function get_gc_content that accepts
a const reference string parameter and returns a double.
Calculate GC content:
Iterate string count Gs and Cs, divide count by string length.
Return quotient.
*/
double get_gc_content(const std::string& dna)
{
int gc_count = 0;
double gc_content;... |
// CommomClientConfig.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "CommomClientConfig.h"
#include "CommomClientConfigDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// CCommomClientConfigApp
BEGIN_MESSAGE_MAP(CCommomClientConfigApp, CWinApp)
ON_COMMAND(I... |
//ejercicio 1
#include <iostream>
using namespace std;
void paso_por_valor(int a,int b){
a=5,b=6;
}
void paso_por_referencia(int &a,int &b){
a=8,b=9;
}
int main(){
int a=1,b=2;
paso_por_valor(a,b);
cout<<"paso x valor="<<a<<" "<<b<<endl;
paso_por_referencia(a,b);
cout<<"paso x refencia="<<a<<" "<<b... |
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
const int MAX_NUM=100000;
long long s[MAX_NUM];
long long n,k;
bool _bin_search(int left,int right,long long &num)
{
int mid=floor((left+right)/2.0);
if(s[mid]==num)
{
return true;
}
if(left>=right)return false;
... |
#include "Client.h"
#include "RaftRPC.pb.h"
#include <iostream>
#include <thread>
/* How long the client should wait before trying another server, in ms. */
const int REQUEST_TIMEOUT = 3000;
using std::string, std::optional;
/**
* Construct a client instance at the given address to be serviced by the
* given clus... |
//**************************************************************************
//**
//** 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 ... |
#pragma once
#include "Condition.h"
#ifdef HELIUM_OS_WIN
# include "Platform/PipeWin.h"
#else
# include "POSIX/Pipe.h"
#endif
const static uint32_t IPC_PIPE_BUFFER_SIZE = 8192;
namespace Helium
{
HELIUM_PLATFORM_API bool InitializePipes();
HELIUM_PLATFORM_API void CleanupPipes();
HELIUM_PLATFORM_API bo... |
// MainFrm.cpp : implmentation of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "resource.h"
#include "aboutdlg.h"
#include "MainFrmT.h"
#include "TVBallView.h"
#include "TVSquareView.h"
BOOL CMainFrame::PreTranslateMessage(MSG *pM... |
//
// Firmware for the mini-GNI unit.
// Version 7
// Frequency: 900 MHz
// v2 -- 10/01/2018 Changed the myservo.attach() calls to happen right before we want to move the servo. This prevents
// the servo from moving right when the unit is powered on.
// v5 -- 04/01/2019 Added support for th... |
//
// proxy_test.cpp
// design_pattern
//
// Created by jack on 14-7-22.
// Copyright (c) 2014年 jack. All rights reserved.
//
#include "proxy_test.h"
int main(int argv, char** argc)
{
/**
* 虚代理
*/
std::string image_name="proxy.jpg";
Image *image=new BigImageProxy(image_name);//代理
image-... |
#include <stdio.h>
#include "BCD.h"
using namespace BCD;
#include <string>
#include <sstream>
using namespace std;
#include <map>
string GetBCDObjectTypeName(int BCDObjectTypeId)
{
static map<int, string> MapOfBCDObjectTypeName = {
{ BCDObject::GlobalSettings, "Windows Boot Manager" },
{ BCDObject::WindowsLoade... |
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "UObject/Interface.h"
#include "Globals/GlobalTypes.h"
#include "PlayerFSMComponent.h"
#include "PlayerPawnState.generated.h"
// This class does not need to be modified.
UINTERFACE(MinimalAPI... |
#include "mainwindow.h"
#include <QApplication>
#include <QFile>
#include <QSysInfo>
#include <QDir>
#include <QDebug>
#include <QMessageBox>
#include "ll1.h"
#include "lr1.h"
#include "lexer.cpp"
int main(int argc, char *argv[])
{
lexerinit(argc, argv);
if(QSysInfo::productType() == "windows" ||
... |
#include<stdio.h>
#include<stdlib.h>
struct node
{
int data; //data field
struct node *next; //pointer or address field
};
struct node *start = NULL;
struct node * newnode(int data)
{
struct node *ptr = (struct node *)malloc(sizeof(struct node));
ptr->data = data;
ptr->next = NULL;... |
#include <iostream>
using namespace std;
#include "solution.h"
int main() {
CustomFunction fun;
Solution sol;
auto res = sol.findSolution(fun, 5);
for (auto elem : res) {
cout << "[" << elem[0] << ", " << elem[1] << "], ";
}
cout << "\b\b " << endl;
return 0;
} |
/*
* zMovement.h
*
* Created on: 04/09/2013
* Author: ztronics
*/
#ifndef ZMOVEMENT_H_
#define ZMOVEMENT_H_
#include "zIncludes.h"
class zMovement {
public:
zMovement();
virtual ~zMovement();
void andarFrente(int tempo);
void andarFrente();
void pararRobo();
void pegarObjeto();
void virarDireita();... |
#ifndef _TNA_SOLDIER_H_
#define _TNA_SOLDIER_H_ value
#include <furious/components.h>
#include "../engine/math/vector.h"
namespace tna
{
struct soldier_t
{
FURIOUS_COMPONENT(soldier_t);
}; /* tna */
}
#endif /* ifndef _TNA_ROTATION_SPEED_H */
|
//---------------------------------------------------------------------------
#ifndef UnitFrameState0H
#define UnitFrameState0H
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ComCtrls.hp... |
/*
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 "../headers/expression.h"
|
//
// c64intro - C64 Intro using SDL
// Copyright (C) 2003-2016 Michael Fink
//
/// \file Intro/stdafx.cpp Precompiled header support
//
// includes
#include "stdafx.h"
|
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1331.h>
#include <SPI.h>
#define sck 18
#define sda 23
#define cs 17
#define res 5
#define dc 16
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.