text stringlengths 8 6.88M |
|---|
#include "device.h" // Device header
#include "shape.h"
#include "colors16bit.h"
#ifndef VERLINE_H
#define VERLINE_H
class Verline : public Shape
{
private:
uint16_t x, y, length;
uint8_t thick;
uint16_t * color;
public:
Verline (uint16_t x_, uint16_t y_, uint16_t * color_, uint16_t length_, uint8_... |
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstdlib>
#include "instruction.h"
#include <dlfcn.h>
int main(int argc, char **argv)
{
if (argc != 2)
{
std::cout << "usage: ./testInstruction <instruction in hex>" << std::endl;
exit(1);
}
Instruction myInstruction;
unsigned char ... |
//
// MosquittoClient.cpp
// IPCT
//
// Created by SteveKim on 2020/03/04.
//
#include "MosquittoClient.h"
#include "libmosquitto/mosquitto.h"
#include "../../Classes/SMFrameWork/Util/encrypt/AES.h"
#include <sstream>
bool MosquittoClient::_init = false;
static void on_connect(void *ptr, int rc)
{
MosquittoC... |
#ifndef _GLX_MAT4X4_MATH_INLINE_H_
#define _GLX_MAT4X4_MATH_INLINE_H_
#include "GLXVec3.h"
#include "GLXMat4x4.h"
/*
Supports only floats
resets do identity matrix
*/
template<class T>
inline void glx::mat4<T>::Clear()
{
m[0][0] = m[1][1] = m[3][3] = T(1);
m[0][1] = m[0][2] = m[0][3] =
m[1][0] = m[1][2] = m[1][3... |
#include <bits/stdc++.h>
using namespace std;
int strLen(char* s){
int count = 0;
while(*s != '\0') {
count++;
s +=1;
}
return count;
}
void delete_char(char *S, char c){
char* pr = S, * pw = S;
while (*pr !='\0') {
*pw = *(pr++);
if(*pw != c) pw++;
}
*p... |
// It sets pre and suc as predecessor and successor respectively
void findPreSuc(Node* root, Node*& pre, Node*& suc, int key)
{
if(root==NULL)
{
return ;
}
if(root->key == key)
{
if(root->left!=NULL)
{
Node* temp = root->left;
while(temp!=NULL && temp-... |
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int main()
{
char str[6 + 1];
while (scanf("%s", str) != EOF)
{
int len = strlen(str);
do
{
for (int i = 0; i < len; i++)
{
printf("%c", str[i]);
}
... |
#include <iostream>
#include <stdlib.h>
#include <time.h>
#include "inout.h"
#include "assign.h"
#include "wyarray.h"
#include "solver.h"
using namespace std;
/* -------------------------------------------------
* algorithm
*
* while (r2/r1 - 1 > eps)
* compute dx
* while (dr > 0)
* step = step * be... |
#ifndef CATEGORY
#define CATEGORY
// Entity/scene node category used to dispatch commands
namespace Category
{
enum Type
{
None = 0,
SceneAirLayer = 1 << 0,
PlayerCharacter = 1 << 1,
AlliedCharacter = 1 << 2,
NeutralCharacter = 1 << 3,
EnemyCharacter = 1 << 4,
... |
// Copyright 2016 Tamas Palagyi
#ifndef APP_SRC_DICOM_H_
#define APP_SRC_DICOM_H_
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <stdexcept>
#include <sstream>
#include <set>
// Since DCMTK does not manage blocking select - it is not able to
// give a NULL timeout... |
#include "PanelConsole.h"
PanelConsole::PanelConsole(std::string name, bool active, std::vector<SDL_Scancode> shortcuts): Panel(name, active, shortcuts)
{
}
PanelConsole::~PanelConsole()
{
output.clear();
}
void PanelConsole::Log(const char * sentence)
{
output.appendf(sentence);
}
void PanelConsole::Draw()
{
I... |
// SPDX-License-Identifier: LGPL-2.1
/*
* Copyright (C) 2017 VMware Inc, Yordan Karadzhov <ykaradzhov@vmware.com>
*/
/**
* @file KsUtils.cpp
* @brief KernelShark Utils.
*/
// C
#include <dlfcn.h>
// KernelShark
#include "libkshark-plugin.h"
#include "libkshark-tepdata.h"
#include "KsUtils.hpp"
#include ... |
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int x, y;
cin>>x>>y;
if(x<y) cout<<"No Number"<<endl;
else if(x%2==0 && y%2==0 && (x==y || x-2==y)) cout<<x+y<<endl;
else if(x%2!=0 && y%2!=0 && (x==y || x-2==y)) cout<<x+y-1<<endl;
else cout<<"No Number"<<endl;
}
... |
#include <iostream>
using namespace std;
int main() {
int str[3], i, max, min;
for (i = 0; i < 3; i++) {
cin >> str[i];
}
max = min = str[0];
for (i = 0; i < 3; i++) {
if(str[i] > max) max = str[i];
if (str[i] < min) min = str[i];
}
cout << max << ' ' << min << endl;
}
|
/*
#include <iostream>
//#include <scriptstdstring/scriptstdstring.h>
#include "as/ScriptContext.hpp"
#include "as/ScriptEngine.hpp"
#include "as/ScriptModule.hpp"
namespace
{
int add( int a, int b )
{
return a + b;
}
void mult( int a, int b, int& out )
{
out = a * b;
}
struct MyClass
{
float f;
do... |
// Tencent is pleased to support the open source community by making ncnn available.
//
// Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
//
// Licensed under the BSD 3-Clause License (the "License"); you may not use this file except
// in compliance with the License. You may obtain a copy ... |
#include <zmq.hpp>
#include <string>
#include <iostream>
#include "Usuario.hpp"
#include "PosicionUsuario.hpp"
#include <json/json.h>
#include <sstream>
#include <thread> // std::this_thread::sleep_for
#include <chrono> // std::chrono::seconds
std::string enviarObjetoServer(zmq::socket_t* soc, std::s... |
/*
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... |
/*
* myEvents.h
*
* Created on: Jul 8, 2015
* Author: shapa
*/
#ifndef MYEVENTS_H_
#define MYEVENTS_H_
#include "qp_port.h"
#include <stdint.h>
namespace QP {
class DataEvt : public QEvt {
public:
union {
void *ptr;
char *string;
uint32_t uint32;
uint16_t uint16;
uint8_t uint8;
char... |
/***********************************************************************
created: 13/4/2004
author: Paul D Turner
purpose: Interface to base class for ButtonBase widget
*************************************************************************/
/**********************************************************************... |
/*=========================================================================
Library : project/applications
Module : $RCSfile: blur.cc,v $
Authors : (C)opyright Daniel Rueckert and Julia Schnabel 1994-2000++
See COPYRIGHT statement in top level directory.
Purpose :
Date : $Date: 2... |
//Jason Strange
//The tree is the fundamental building block behind our database.
#include "Tree.h"
#include "Comparable.h"
#define NULL 0
Tree::Tree () {
root = NULL;
}
Tree::~Tree () {
delete root;
}
void Tree::setroot (TreeNode *r) {
root = r;
}//setting root
//Adding a node to the tree
vo... |
/*************************************************************
* > File Name : c1080_1.cpp
* > Author : Tony
* > Created Time : 2019/10/28 13:02:57
* > Algorithm :
**************************************************************/
#include <bits/stdc++.h>
using namespace std;
typedef ... |
#ifndef SAMPLE_SETTINGS_HPP
#define SAMPLE_SETTINGS_HPP
namespace Model
{
enum CurrencyUnit
{
CURRENCY_UNIT_EURO = 0,
CURRENCY_UNIT_DOLLAR,
CURRENCY_UNIT_POUND,
CURRENCY_UNIT_YEN,
};
inline QString currencyUnitToString(CurrencyUnit unit)
{
switch (unit)
{
case CURRENCY_UNIT_EURO: ret... |
#ifndef GUARD_NETLIST_H
#define GUARD_NETLIST_H
#include "module.h"
#include <sstream>
#include "gates.h"
using namespace std;
class netlist;
class net;
class pin;
class gate;
class net
{
//net() {}
net(string name);
net(const net &);
net &operator=(const net &);
~net() {}
friend class n... |
#include <windows.h>
#include <gl/glut.h>
void DoDisplay();
void DoReshape(GLsizei width, GLsizei height);
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance
,LPSTR lpszCmdParam,int nCmdShow)
{
glutCreateWindow("OpenGL");
glutDisplayFunc(DoDisplay);
glutReshapeFunc(DoReshape);
glutMainLoop();
re... |
#pragma once
#include <string>
#include <iostream>
class bill_format
{
public:
bill_format();
bill_format(float amount, std::string * namelist , unsigned int noOfPeople) {
myAmount = amount;
myNameList = namelist;
myNoOfPeople = noOfPeople;
}
void set_bill_format(float amount, std::string * namelist, unsign... |
#pragma once
extern "C"
{
#include "SDL.h"
#include "SDL_thread.h"
}
// VideoWindow 对话框
class VideoWindow : public CDialogEx
{
DECLARE_DYNAMIC(VideoWindow)
public:
VideoWindow(CWnd* pParent = NULL); // 标准构造函数
virtual ~VideoWindow();
HDC hDC;
// 对话框数据
enum { IDD = IDD_DIALOG1 };
SDL_Window * screen;
int wi... |
#include <fcntl.h>
#include <fstream>
#include <linux/fb.h>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <sys/ioctl.h>
struct framebuffer_info
{
uint32_t bits_per_pixel; // framebuffer depth
uint32_t xres_virtual; // how many pixel in a row in virtual screen
}... |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
std::random_device rd;
mt19937 gen(rd());
const uint32_t PRIME = 4294967291;
class hashSet {
uint32_t cnt, a, b, p = PRIME;
uint32_t sz;
vector<list<uint32_t> > table;
vector<list<uint32_t> > newTable;
public:
hashSet() {
... |
#ifndef RANDOM_H
#define RANDOM_H
class BasicRandom
{
public:
BasicRandom(unsigned int seed=0) : mRnd(seed) {}
~BasicRandom() {}
__forceinline void setSeed(unsigned int seed) { mRnd = seed; }
__forceinline unsigned int getCurrentValue() const { return mRnd; ... |
#include "Room.hpp"
Room::Room(string title)
{
this->title = title;
this->currNumOfDoors = 0;
}
void Room::addDoor(Door* door)
{
int i = this->currNumOfDoors;
this->collectionOfDoors[i] = door;
this->currNumOfDoors++;
} |
//! Bismillahi-Rahamanirahim.
/** ========================================**
** @Author: Md. Abu Farhad ( RUET, CSE'15)
** @Category:
/** ========================================**/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct Seller
{
ll first,second,diff;
} a[200005];
bool cmp(Sell... |
#pragma once
#include <array>
class RotationMatrix {
private:
std::array<std::array<float, 3>, 3> m_matrix;
public:
RotationMatrix();
RotationMatrix(const std::array<float, 3> &row_1, const std::array<float, 3> &row_2, const std::array<float, 3> &row_3);
std::array<float, 3> &operator[](const int index);
... |
#ifndef SLICE_H
#define SLICE_H
#include <string>
class Slice {
public:
explicit Slice();
explicit Slice(unsigned char* key, int key_size, unsigned char* value, int value_size);
explicit Slice(unsigned char* key, int key_size, unsigned char* value, int value_size, bool is_deleted);
~Slice();
unsigned char* getKey... |
#ifndef GAME_H
#define GAME_H
#include <fstream>
class Game
{
private:
//Enums
enum class GameStates{ mainMenu, gameRunning, gameOver };
enum GameStates m_currentGameState;
//Integers
int m_currentScore;
int m_highScore;
//Objects
//Resources
std::ifstream m_highScoreFile;
//Strings
std::string m_scoreFile... |
#ifndef LOGICSRV_CONNNODE_LOGICSRV_H
#define LOGICSRV_CONNNODE_LOGICSRV_H
#include "../../zcomm/activeconnnodebase.h"
// 未避免理解上和 gateserver 相冲突
namespace logicsrv
{
class ConnNodeLogicSrv:public ActiveConnNodeBase
{
public:
ConnNodeLogicSrv();
~ConnNodeLogicSrv();
public:
// 接收 gatesrver::connnode_logicsrv 发送来... |
//https://www.hackerrank.com/contests/sda-2019-2020-test3/challenges/tree-specific-print/
#include <bits/stdc++.h>
using namespace std;
struct Node
{
Node* l=nullptr,*r=nullptr;
int data;
Node(int data):data(data){}
};
Node* root;
Node* add(Node* root, int a)
{
if(root==nullptr) return new Node(a);
... |
//#include "mpi.h"
// for local development
#include "/usr/lib/openmpi/include/mpi.h"
#include "mpi_tournament_barrier.h"
#define ROUND 100
int main(int argc, char** argv){
int my_id, num_processors;
MPI_Init(&argc, &argv);
MPI_Comm_size(MPI_COMM_WORLD, &num_processors);
MPI_Comm_rank(MPI_COMM_WORLD, &my_id);
do... |
//********************************************************
//
// Michael J Phillips
// Copyright 2015
// All rights reserved.
//
//********************************************************
#ifndef _EUROPTION_H_
#define _EUROPTION_H_
#include <cmath>
static const double PI = 4.0 * std::atan(1.0);
class... |
#include <bits/stdc++.h>
using namespace std;
#define loop(i, n) for (int i = 0; i < n; i++)
int input()
{
int n;
cin >> n;
return n;
}
void print(int a, int b)
{
cout << a << " " << b;
}
int main()
{
int arr[5];
loop(i, 5) arr[i] = input();
loop(i, 2) swap((int)i, 5 - (int)i);
loop(i, 5... |
#pragma once
#include "gtest/gtest.h"
#include "gmock/gmock.h"
#include "Engine/Common/SmallVector.h"
namespace {
using namespace Engine;
TEST(SmallVector, emplace_back_and_access_to_fit) {
SmallVector<int, 3> vector;
vector.push_back(2);
ASSERT_EQ(vector[0], 2);
vector.push_... |
#pragma once
#include <math.h>
#include <omp.h>
#include <vector>
#include <cassert>
void interp_cic_par(const int nz, const int ny, const int nx, const double *vals,
const int N, const double *z, const double dz,
const double *y, const double dy,
const dou... |
//map.find(key),返回键为key的映射的迭代器,时间复杂度为O(logN)
#include<stdio.h>
#include<map>
using namespace std;
int main()
{
map<char,int> mp;
mp['m']=10;
mp['r']=20;
mp['a']=40;
map<char,int>::iterator it=mp.find('r');
printf("%c %d",it->first,it->second);
return 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... |
#ifndef NOSTA_H
#define NOSTA_H
#include <QDialog>
#include <dllmysql.h>
namespace Ui {
class Nosta;
}
class Nosta : public QDialog
{
Q_OBJECT
public:
explicit Nosta(QWidget *parent = nullptr);
~Nosta();
public slots:
void asetaSaldo(double s){saldo=s;}
void asetaTili(int t){idTili=t;}
privat... |
// 53. Maximum (continuous) Subarray
// Greedy: O(n)
class Solution {
public:
int maxSubArray(vector<int>& nums) {
int res = INT_MIN, curSum = 0;
for (int num : nums) {
curSum = max(curSum + num, num);
res = max(res, curSum);
}
return res;
}
};
// DC : O(l... |
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
const double pi = 3.141592;
int radius = 3;
double circumference;
circumference = 2 * pi * radius;
double area1;
double area2;
area1 = pi * (radius * radius);
area2 = pi * pow((double) radius, 2);
double volu... |
/*
* Copyright (C) 2007-2015 Frank Mertens.
*
* Use of this source is governed by a BSD-style license that can be
* found in the LICENSE file.
*
*/
#include "ServiceDelegate.h"
namespace fluxnode {
class EchoDelegate: public ServiceDelegate
{
public:
static Ref<EchoDelegate> create(ServiceWorker *worker) {... |
#include <iostream>
#include <iomanip>
float sum, x, y; int n;
using namespace std;
int main()
{
for (n = 1; n <= 6; n++)
{
setlocale(LC_CTYPE, "Russian");
printf("Введите x%i: ",n); cin >> x;
printf("Введите y%i: ",n); cin >> y;
sum += x * y;
}
printf("Сумма произведений данных x и y равна: %f", sum);
... |
#ifndef JUNCTION_MESH_GENERATOR_H
#define JUNCTION_MESH_GENERATOR_H
#include <Data/MultiMesh.h>
class JunctionMeshGenerator
{
private:
MyMesh &JunctionMesh;
float DeltaUV;
//
public:
//
void ParametrizeHalfedge();
//
JunctionMeshGenerator(MyMesh &junction_mesh,float delta_uv)
:JunctionMesh(junction_mesh),Del... |
#include "headerFiles/akinatorHeader.h"
int main()
{
Processing();
return 0;
} |
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
ListNode* Solution::rotateRight(ListNode* A, int B) {
if(A==NULL)return A;
int len=0;
ListNode* head=A;
ListNode* tail=A;
ListNode* ans=A;
... |
/*
* The Akafugu Nixie Clock
* (C) 2012-13 Akafugu Corporation
*
* 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 (at your option) any later
* version.
... |
#include "BoostedTTH/BoostedAnalyzer/interface/THQJetSelection.hpp"
using namespace std;
THQJetSelection::THQJetSelection (){}
THQJetSelection::~THQJetSelection (){}
void THQJetSelection::InitCutflow(Cutflow& cutflow){
cutflow.AddStep(">= 4 single top jets >= 30 GeV");
cutflow.AddStep(">= 3 b-tagged single ... |
#include <iostream>
using namespace std;
/**
* Leia um valor inteiro N. Este valor será a quantidade de valores
* inteiros X que serão lidos em seguida. Mostre, ao final do programa,
* quantos destes valores X estão dentro do intervalo [10,20]
* e quantos estão fora do intervalo
*/
int main ()
{
int n, x, l... |
#ifndef _HS_SFM_SFM_PIPELINE_GCP_SIMILAR_TRANSFORM_ESTIMATOR_HPP_
#define _HS_SFM_SFM_PIPELINE_GCP_SIMILAR_TRANSFORM_ESTIMATOR_HPP_
#include "hs_math/linear_algebra/eigen_macro.hpp"
#include "hs_sfm/sfm_utility/camera_type.hpp"
#include "hs_sfm/sfm_utility/key_type.hpp"
#include "hs_sfm/sfm_utility/match_type.hpp"
#... |
#include "Patcher_UseDataFolder.h"
#include "../Addr.h"
#include "../FileSystem.h"
//-----------------------------------------------------------------------------
// Constructor
CPatcher_UseDataFolder::CPatcher_UseDataFolder( void )
{
patchname = "Use Data Folder";
LPBYTE addrSetLookUpOrder = CAddr::Addr(CFileSyst... |
// Filename: cPetBrain.h
// Created by: darren (13Jul04)
//
////////////////////////////////////////////////////////////////////
#include "cPetBrain.h"
#include "luse.h"
////////////////////////////////////////////////////////////////////
// Function: CPetBrain::Constructor
// Access: Published
// Descrip... |
#include "facerecognize.hpp"
#include "caffe_mtcnn.hpp"
#include "preprocess.h"
#include "face_align.hpp"
#include "scale_angle.h"
#include "opencv2/opencv.hpp"
#include "opencv2/core/core_c.h"
#include "opencv2/core/types_c.h"
#include <chrono>
#include <time.h>
#include <string.h>
#include <stdlib.h>
#include<sys/t... |
// Copyright (c) Facebook, Inc. and its affiliates.
// All rights reserved.
//
// Copyright 2019 Google LLC
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
//
// Auto-generated file. Do not edit!
// Specification: test/q8-dwconv.ya... |
#include <iostream>
#include <fstream>
#include <vector>
#include <cstdlib>
#include "omp.h"
#include <algorithm>
#include <list>
#include <string>
#include <map>
#include <numeric>
#include <math.h>
std::vector<int> vectore;
std::map<int, int> user;
std::list<double> list;
// Funcion cambia formato hora 00
std::stri... |
#pragma once
#include <vector>
#include "Datastructs.h"
#include "Model.h"
#include "OBJimporter.h"
#include "LightSource.h"
#include "Compute.h"
#include "QuadTree.h"
#include <iostream>
#include <SDL\SDL.h>
#include <GL/glew.h>
#include <Windows.h>
#include "Player.h"
#include "GLSLprogram.h"
class App {
private:... |
// github.com/andy489
// https://www.spoj.com/problems/LCA/
#include <iostream>
#include <vector>
#include <list>
using namespace std;
#define ios ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define pb push_back
int timer, n, N, K;
vector<list<int>> adj;
vector<int> first, euler, dep, flog;
v... |
#include<iostream>
#include<opencv2/opencv.hpp>
cv::Mat Thersdhold_process(cv::Mat img,int thershold)
{
int width=img.cols;
int height=img.rows;
cv::Mat gary=cv::Mat::zeros(height,width,CV_8UC1);
cv::Mat out=cv::Mat::zeros(height,width,CV_8UC1);
cvtColor(img,gary,cv::COLOR_BGR2GRAY);
for (int... |
/*
* Project MQ5
* Description: Seeed Studio TCS3472 I2C Color Sensor V2
* Author: Patrick Bolton
* Date: 05/27/21
*/
#include "Particle.h"
#include "math.h"
#include "Adafruit_TCS34725.h"
SYSTEM_THREAD(ENABLED);
boolean commonAnode = false;
char szInfo[128];
Adafruit_TCS34725 tcs = Adafruit_TCS34725(TCS347... |
#include "mainwindow.h"
#include <QApplication>
#include <stdio.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
union
{
int i;
struct
{
... |
// ==============================================================
// RTL generated by Vivado(TM) HLS - High-Level Synthesis from C, C++ and SystemC
// Version: 2013.4
// Copyright (C) 2013 Xilinx Inc. All rights reserved.
//
// ===========================================================
#include "load_points_buffer.h... |
#include <stdio.h>
#include <stdlib.h>
#include <sys/signal.h>
#include "transx_def.hpp"
#include "transx_manager.hpp"
#include "transx_extern.hpp"
#include <unistd.h>
#include <iostream>
#include <fstream>
#include <pthread.h>
#include <ctime>
#include <sys/types.h>
#include <sys/syscall.h>
#define gettid() syscall(SY... |
#include "globals.h"
namespace
{
ColorVectorMap InitColorMap()
{
ColorVectorMap map;
map['F'] = std::tr1::shared_ptr<ColorVector>(new ColorVector(1.0f, 0.0f, 0.0f));
map['B'] = std::tr1::shared_ptr<ColorVector>(new ColorVector(0.0f, 1.0f, 0.0f));
map['U'] = std::tr1::shared_ptr<... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
for (int x=1; x<=n; ++x){
for (int y=1; y<=n; ++y){
if (y<x){
cout << " ";
} else {
cout << "*";
}
}
cout << "\n";
}
}
|
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<assert.h>
#include<stdlib.h>
#include"glut.h"
#define GET_ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
#define quadsR (.5f)
#define height (14)
#define width (78)
int* map;
int* readCsv(char* _fileName, const int _width, const int _height){
char buff[256];
i... |
#define VC_EXTRALEAN
#define _USE_MATH_DEFINES
#include <windows.h>
#include <commctrl.h>
#include <scrnsave.h>
#include <gdiplus.h>
#include <time.h>
#include <math.h>
#include <string>
#include "resource.h"
#pragma comment(lib, "scrnsavw.lib")
#pragma comment (lib, "comctl32.lib")
using namespace Gdiplus;
#pragma... |
#include <string>
#include <vector>
#include <iostream>
using namespace std;
string solution(string s) {
string answer = "";
if (s.size()%2==0){
int tmp = s.size()/2 -1;
cout<<s[tmp]<<s[tmp+1]<<endl;
answer+=s[tmp];
answer+=s[tmp+1];
}
else{
int tmp = s.size()/... |
#include "Commands.h"
#include "iostream"
#include "GlobalVariables.h"
MvCommand::MvCommand(string args):BaseCommand(args){
}
void MvCommand::execute(FileSystem & fs) {
if (verbose == 2 || verbose == 3)
cout << toString() + " " + getArgs() << endl;
int whereSpace = getArgs().find_first_of(' ');
s... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "./HealthAndDamageComponent.h"
#include "./DefenceBuffBaseComponent.h"
#include "Net/UnrealNetwork.h"
UHealthAndDamageComponent::UHealthAndDamageComponent(const class FObjectInitializer& PCIP) : Super(PCIP)
{
N_MaxHealth = 100;... |
#include "graph.h"
#include <fstream>
#include <random>
#include <chrono>
#include <algorithm>
void generate_data () {
const std::vector<int> dist_sizes {1000, 10000, 100000};
const int upper_bound_diameter = 5000000;
const int upper_bound_clustering = 500000;
const int reps = 5;
const int d = 5;
... |
// C++ for the Windows Runtime vv1.0.170303.6
// Copyright (c) 2017 Microsoft Corporation. All rights reserved.
#pragma once
#include "base.h"
WINRT_WARNING_PUSH
#include "internal/Windows.Foundation.3.h"
#include "internal/Windows.Foundation.Collections.3.h"
#include "internal/Windows.System.Diagnostics.3.h"
#inclu... |
#include "Tree.h"
MP::Tree::Tree(sf::Texture* texturePtr, sf::Vector2f coord, float treeScale)
{
aAnimation.loadObjectTextures( texturePtr, 2, 2, 64);
setObjectCoord(coord);
aAnimation.setOrigin(32, 55);
aAnimation.setScale(treeScale, treeScale);
_obj_animation_sleep_time = sf::milliseconds(RiD::ConfigurationL... |
#ifndef __ATOM__
#define __ATOM__
#include <string>
#include <sstream>
#include <vector>
#include "element.h"
#include "vec.h"
class atom
{
public:
// index of type to atom
int type;
// pointer to the element
element *ele;
// position
vec pos;
// force
vec force;
// define whether movable, 0, not movable; 1,... |
#pragma once
#include "Cubemap.h"
#include "client\Graphics\Shader.h"
class Skybox {
private:
GLuint skyboxVAO;
GLuint skyboxVBO;
GLuint cubemap;
Shader *shader;
public:
Skybox();
~Skybox();
void setupVAO(string directory);
void draw();
};
|
/***********************************************************************
created: 5/7/2004
author: Paul D Turner
purpose: Interface to XML parser for GUILayout files
*************************************************************************/
/************************************************************************... |
#include <iostream>
#include "UDP_listener.hpp"
int main (int args, char ** argv)
{
UDP_listener udpd(1234);
udpd.run();
return 0;
}
|
/* 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... |
/*
* SPDX-FileCopyrightText: 2020 Rolf Eike Beer <eike@sf-mail.de>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#include "RelationMemberModel.h"
#include <osm.h>
#include <osm_objects.h>
#include <QDataStream>
#include <QHash>
#include <QMimeData>
#include "osm2go_i18n.h"
#include "osm2go_platform_qt.h"
na... |
#pragma once
#include "EnemySpaceshipRange.h"
#include <SFML/Graphics.hpp>
constexpr float DeathballShape{ 5.0f };
struct AlienBullets
{
sf::CircleShape deathball;
float CourseUp = 0;
float CourseGoUp = 0;
bool Active = 0;
AlienBullets();
void setPos(float X, float Y);
void Shoot(float deltat... |
// @copyright 2017 - 2018 Shaun Ostoic
// Distributed under the MIT License.
// (See accompanying file LICENSE.md or copy at https://opensource.org/licenses/MIT)
#pragma once
#include <boost/winapi/basic_types.hpp>
namespace boost::winapi
{
#if !defined (BOOST_USE_WINDOWS_H)
constexpr boost::winapi::DWORD_ ANYSIZ... |
//
// TicTacToe.cpp
//
// Created by Olivier Cuisenaire on 18.02.15.
// Copyright (c) 2015 Olivier Cuisenaire. All rights reserved.
//
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <limits>
using namespace std;
//
// Variables globales
//
// les joueurs sont +1 et -1. 0 pour les cases vides
con... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
vector<int> v(n),v1;
set<int>s;
for(int i=0;i<n;i++){
cin>>v[i];
s.insert(v[i]);
}
for(auto x:s)
v1.push_back(x);
for(auto x:s)
{
for(int i=0;i<v1.size();i++)
{
... |
/*
* File: main.h
* Author: gmena
*
* Created on 23 de agosto de 2014, 02:21 PM
*/
#include "Service.h"
#include "Processor.h"
#include "Array.h"
#include "PackGestor.h"
#include "Console.h"
#include "File.h"
#include <unistd.h>
#include <libini.h>
#ifndef MAIN_H
#define MAIN_H
using namespace std;
#end... |
/// @file symbol_test.cc
/// @brief Symbol のテストプログラム
/// @author Yusuke Matsunaga (松永 裕介)
///
/// Copyright (C) 2013 Yusuke Matsunaga
/// All rights reserved.
#include "led_nsdef.h"
#include "Symbol.h"
BEGIN_NAMESPACE_YM_LED
class SymbolTestWidget :
public QWidget
{
public:
/// @brief コンストラクタ
/// @param[i... |
#ifndef ESA_EWDL_ETHERCAT_TXPDO_H
#define ESA_EWDL_ETHERCAT_TXPDO_H
namespace esa { namespace ewdl { namespace ethercat { namespace pdo {
struct TxPDO1
{
uint16 error_code;
uint16 status_word;
int8 mode_of_operation_display;
int32 position_actual_value;
int32 follow_error_actual_value;
uint16 touch_prob... |
#include <stdint.h>
#include <stdio.h>
#include <chrono>
#include <iostream>
#include <random>
#define TREE_DEPTH 16ull
#define TREE_SIZE (-1 + (1ull << (TREE_DEPTH + 1ull)))
#define boolean(arg) (!!(arg))
extern "C"
{
uint64_t retrieve_lvl_ht(uint64_t offset)
{
uint8_t lvl = 0;
while(
... |
#include <SD.h>
#include <SPI.h>
#include <Servo.h>
#define s0 9
#define s1 8
#define s2 7
#define s3 6
#define out 5
#define servoYpin 3
#define servoXpin 4
#define CLK 13
#define MISO 12
#define MOSI 11
#define CS 10
#define NUMBER_OF_MEASUREMENTS 50
#define DEBUG 0
Servo servoX;
Servo servoY;
int _ready = 0;
int ... |
/*题目:给你一个大小为?m* n的方阵?mat,方阵由若干军人和平民组成,分别用
1 和 0 表示。请你返回方阵中战斗力最弱的k行的索引,按从最弱到最强排序。
如果第i行的军人数量少于第j行,或者两行军人数量相同但 i 小于 j,那么我
们认为第 i 行的战斗力比第j行弱。军人 总是 排在一行中的靠前位置,也就是
说 1 总是出现在 0 之前。*/
/*思路:本题采用 快速排序法,其中采用了一个特殊的技巧,就是将下标和下标对应的数值
进行合并,再之后快速排序时,可以让下标和数值同时影响结果,方法是将数值乘以数组长
度再加上下标值,这样的话,数值不同时按数值排序,数值相同时按照下标排序,最后结果
对数组长度取... |
/* Snowman sample
* by R. Teather
* Edited by Noel Brett
*/
/*
Borna Kalantar kalantb 001207031
Rebecca Tran tranr5 001425611
Neil Robichaud robichne 001425566
Sean McKay mckaysm 001423885
*/
#ifdef __APPLE__
# include <OpenGL/gl.h>
# include <OpenGL/glu.h>
# include <GLUT/glut.h>
#else
# include <GL/gl.... |
#define BOOST_TEST_MAIN
#include "task_13.h"
#include <boost/test/unit_test.hpp>
//testcase 1
BOOST_AUTO_TEST_CASE(test_1){
int m = 5;
int n = 3;
string actual = task::getMatrix(m, n);
stringstream ss_test;
ss_test << " 1 2 4 7 10" << endl <<
" 3 5 8 11 13" << ... |
#ifndef ROSE_GENERIC_DATAFLOW_COMMON_H
#define ROSE_GENERIC_DATAFLOW_COMMON_H
#include <sage3.h>
#include <list>
using std::list;
#include <map>
using std::map;
using std::pair;
using std::make_pair;
#include <set>
using std::set;
#include <vector>
using std::vector;
#include <string>
using std::string;
#include <iost... |
/*******************************************************************************
* Cristian Alexandrescu *
* 2163013577ba2bc237f22b3f4d006856 *
* 11a4bb2c77aca6a9927b85f259d9af10db791ce5cf884bb31e7f7a889d4fb385 ... |
/*****************************************************************************************************
* 剑指offer第64题
* 如何得到一个数据流中的中位数?如果从数据流中读出奇数个数值,那么中位数就是所有数值排序之后位于中间
的数值。如果从数据流中读出偶数个数值,那么中位数就是所有数值排序之后中间两个数的平均值。我们使用
Insert()方法读取数据流,使用GetMedian()方法获取当前读取数据的中位数。
*
* Input: 数据流
* Output: 数据流的... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.