text stringlengths 8 6.88M |
|---|
/* A Bison parser, made by GNU Bison 2.4.1. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the term... |
//
// Created by 钟奇龙 on 2019-05-05.
//
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<vector<int> > getDpArray(string s1,string s2){
int row = s1.size();
int col = s2.size();
vector<vector<int> > dp(row,vector<int> (col,0));
dp[0][0] = s1[0] == s2[0] ? 1:0;
for(... |
#include <cstdlib>
#include <string>
#include <iostream>
// using namespace std;
// void function(string str, int pOs);
// int main()
// {
// string names = "Adam and Eve";
// function(names, 0);
// return 0;
// }
// void function(string str, int pOs)
// {
// //cout << str.length() << "\t" << pOs << "\t" << str... |
#include <bits/stdc++.h>
using namespace std;
long long int n,d,a,b;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0);
cin >> n >> d;
a = n/d;
b = n%d;
cout << a;
if(b) cout << " " << b << "/" << d;
return 0;
} |
#ifndef _MAPSELECTION_
#define _MAPSELECTION_
//
//#include "cocos2d.h"
//
//#include "cocos-ext.h"
//#include "ui/CocosGUI.h"
#include "AbstractMenu.h"
//
//USING_NS_CC;
//
//
//USING_NS_CC_EXT;
using namespace ui;
class GamePlayDemo;
class ModeShipVSTower;
class TutorialShipVsTower... |
#pragma once
#include "provider.h"
#include "../time.h"
#include "../mainengine.h"
#include <memory>
namespace sbg {
Provider<Time> makeMainEngineTimeProvider(std::weak_ptr<const MainEngine> mainEngine);
}
|
#ifndef GAMESCENE_HH
#define GAMESCENE_HH
#include <QGraphicsView>
#include <QGraphicsScene>
#include <QObject>
#include "wheel.hh"
#include <QMouseEvent>
#include "hexboard.hh"
#include "basebox.hh"
#include "gamecode.hh"
enum turnAction {
Move,
Sink
};
class gamescene : public QGraphicsView {
Q_OBJECT
... |
//Автор: Воротилов Владислав
#include "TokenTypes.h"
//И числа с плавающей точкой и десятичные
const std::tr1::regex CTexToken::numberRegex("([0-9]+\\.[0-9]*)|(\\.[0-9]+)|([0-9]+)");
const std::tr1::regex CTexToken::variableRegex("[a-z]*");
|
#include "main.h"
void setPixel(int x, int y, Uint32 pixel) {
Uint32 *pixels = (Uint32 *)screen->pixels;
pixels[(y * screen->w) + x] = pixel;
}
Uint32 getWallColor(int x, int y) {
int num = worldMap[x][y];
if (num == 1) {
return SDL_MapRGB(screen->format, 0xFF, 0, 0);
}
else if (num == 2) {
return SDL_MapRG... |
#pragma once
#define BUFFER_SIZE 1024
#define QUEUE_SIZE 1000
#include <vector>
#include <algorithm>
using namespace std;
class CResultQueue
{
public:
CResultQueue()
{
m_resultQueue.resize(QUEUE_SIZE + 1);
m_nMaxIndex = QUEUE_SIZE;
}
~CResultQueue()
{
}
void Resize(unsigned long ulSize)
{
m_resultQu... |
#include <crtdbg.h>
#include <assert.h>
#include "../VFS/BlockManager.h"
#include "../VFS/IFile.h"
int main()
{
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
IFile *pFile = OpenDiskFile("test.pkg", IFile::O_Truncate);
BlockManager* pMgr = new BlockManager(pFile, true, offset_type(1024))... |
#pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
#include "Window.h"
#include "LevelManager.h"
#include "Music.h"
class ClosingCredits
{
static float time;
static sf::Font headerFont;
static sf::Font font;
static sf::Text gameName;
static sf::Text thanks;
static sf::Text authors;
static sf::Text a... |
/** Copyright (c) 2018 Mozart Alexander Louis. All rights reserved. */
#ifndef __THREAD_UTILS_HXX__
#define __THREAD_UTILS_HXX__
/**
* Includes
*/
#include "globals.hxx"
class ThreadUtils {
public:
/**
* Runs a function on an async thread using the AsyncTaskPool.
*
* @param func ~ Function to run.
*... |
//
// Created by Brady Bodily on 4/22/17.
//
#include "KeyValue.hpp"
#include <string>
#include <vector>
KeyValue::KeyValue(std::string key, std::vector<UserIP> value) {
Key = key;
Value = value; }
void KeyValue::SetValue(std::vector<UserIP> value) { Value = value; }
void KeyValue::AddValue(UserIP ValueToAdd... |
#include <GL/glut.h>
#include "Input.h"
Input::Input() {
}
double Input::getPotenza() {
return potenza;
}
double Input::getDirezione() {
return direzione;
}
void Input::setPotenza(double var) {
potenza = var;
}
void Input::setDirezione(double var) {
direzione = var;
} |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_GRAPHICS_RENDERING_VULKAN_SEMAPHOREVK
#define ELYSIUM_GRAPHICS_RENDERING_VULKAN_SEMAPHORE... |
//
// RigidBody.cpp
// closedFrameworks
//
// Created by William Meaton on 12/05/2016.
// Copyright © 2016 WillMeaton.uk. All rights reserved.
//
#include "RigidBody.hpp"
RigidBody::RigidBody(){
} |
#include <fstream>
#include <iostream>
#include "Mesh.h"
#include "ClosestPointQuery.h"
#include "Node.h"
int main(int argc, char *argv[])
{
// Get query inputs
const char * filename = argv[1]; // mesh obj file
const char * pointValues = argv[2]; // txt file containing point values to query
float maxDist = std::a... |
#ifndef ABSTRACT_PASSWORD_FORM_H
#define ABSTRACT_PASSWORD_FORM_H
#include <QCoreApplication>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QMessageBox>
#include <QLineEdit>
#include <QCheckBox>
#include <QDebug>
#include <QFile>
#include <QPixmap>
#include <QPushButton>
#include <QSettings... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2011 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef OPCOOKIEMANAGER_H
#define OPCOOKIEMANAGER_H
#ifdef _ASK_COOKI... |
#include "drone.h"
#include <Servo.h>
Drone::Drone(GPSSensor *gps_sensor) {
this->gps_sensor = gps_sensor;
accel_sensor = new SmoothedAccelSensor();
drone_esc = new DroneESC(PIN_NW, PIN_NE, PIN_SE, PIN_SW);
drone_balancer = new DroneBalancer(accel_sensor, drone_esc);
speed_controller = new SpeedController(gps_se... |
#pragma once
#include "Token.h"
#include <map>
#include <sstream>
template<typename T>
class Symbol;
struct cmp_length_then_alpha;
template<typename T>
class Parser
{
public:
Parser();
void RecognizeToken(Symbol<T>* sym)
{
tokens[sym->GetToken()] = sym;
}
T eval()
{
itr = out.end() - 1;
return (*itr)->... |
// Copyright (c) 2014 Hartmut Kaiser
// Copyright (c) 2014 Patricia Grubel
//
// 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 <fmt/format.h>
#include ... |
#include <json/json.h>
#include <string>
#include "Configure.h"
#include "GetSvrCfg.h"
#include "GameCmd.h"
#include "Room.h"
#include "Logger.h"
#include "ProcessManager.h"
#include "ProtocolServerId.h"
REGISTER_PROCESS(ADMIN_GET_SYS_CFG, GetSvrCfg)
using namespace std;
int GetSvrCfg::doRequest(CDLSocketHandler* ... |
#pragma once
#include "log.hpp"
#include <mutex>
#include <map>
using namespace std;
namespace nora {
enum instance_class_type {
ICT_CPLAYER = 0,
ICT_PLAYER = 10,
ICT_INIT_PLAYER = 11,
ICT_CHECK_LOGIN_PLAYER = 12,
ICT_FIND_ROLE_... |
do_configure_prepend() {
# Fix configure error: "error: required file './ABOUT-NLS' not found"
sed -i 's/^AM_INIT_AUTOMAKE$/AM_INIT_AUTOMAKE(\[foreign\])/' configure.ac
}
|
#include<iostream>
#include<string.h>
using namespace std;
class Employee{
public:
int Employee_id;
string Employee_name;
int Get_Employee_id(){
return Employee_id;
}
string Get_Employee_name(){
return Employee_name;
}
};
int main(){
Employee obj1;
obj1.Employee_id=20... |
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <string>
#include <iostream>
#include <vector>
#include "GameLogic.h"
//////////////////////////////////////////////////////////////////////////
//扑克数据
BYTE GameLogic::m_cbCardListData[52] =
{
0x01,0x02,0x03,0x04,0x05,0x06,0x07,... |
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
using namespace std;
class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
//基本思想:单调栈,维护长度为3的递增栈,如果当前元素比栈顶大,入栈;否则当前元素替换掉栈中刚好比它大的元素;
//这样替换的好处是并不影响递增子序列的长度
//为什么对于当前遍历nums的元素需要用它覆盖掉栈中比它大于或等于的元素中... |
#ifndef ZENFIRE_EXAMPLES_COMPAT_HPP_INCLUDED
#define ZENFIRE_EXAMPLES_COMPAT_HPP_INCLUDED
// compat
#if defined(_MSC_VER)
# include "windows.h"
# define COMPAT_SLEEP(a) Sleep((a * 1000))
# define COMPAT_MSLEEP(a) Sleep(a)
#else
# include <unistd.h>
# define COMPAT_SLEEP(a) sleep(a)
# define COMPAT_MSLEEP(a) usle... |
#ifndef PLAYER_H
#define PLAYER_H
#include <string.h>
#include <time.h>
#include <stdint.h>
#include "wtypedef.h"
#include "TaskManager.h"
using namespace std;
#define STATUS_PLAYER_LOGOUT 0
#define STATUS_PLAYER_LOGIN 1 //登陆,未入座
#define STATUS_PLAYER_COMING 2 //入座
#define STATUS_PLAYER_RSTART 3 //入座,准备开始
#defin... |
/*********************************************************\
* Copyright (c) 2012-2018 The Unrimp Team
*
* 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 wit... |
/*
* Copyright (c) 2012, Morten Kjaergaard
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this lis... |
#include <bits/stdc++.h>
using namespace std;
int main(){
int n,m;
char a, b, c;
cin>>n>>m;
char s[n];
for (int i = 0; i < n; i++) {
cin>>s[i];
}
int z=0;
int r=0;
while(m--){
cin>>a>>b>>c;
int f=c/2;
if(a=='2'){
while(f--){
if(s[b+z-1]==s[c-z-1]){
r++;
z++;
}
}... |
/*****************************************************************************/
/*!
\file Ocean.cpp
\author Joe Centeno
\par email: joe.centeno\@digipen.edu
\par DigiPen login: joe.centeno
\par Course: CS170
\par Section: A
\par Assignment #1
\date 5/25/2021
\brief
This file contains... |
#include "Constants.hpp"
const size_t Constants::MaxDatabaseSize = 3 * 1024;
const std::string Constants::serializedDataLocation = std::string("./bin/serializedData/");
const std::string Constants::endOfFile = std::string("<EOF>");
|
// Copyright 2018 Benjamin Bader
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
// Copyright (c) 1999-2020 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 Software Foundation, with spe... |
#include "LeetCodeLib.h"
#include "map"
#include "queue"
#include "set"
#include "stack"
int LeetCodeLib::numPairsDivisibleBy60(vector<int>& time) {
if (time.size() < 2) return 0;
int result = 0;
vector<int> remains(60, 0);
for (int i:time){
result += remains[(60 - i % 60) % 60];
remains[i % 60]++;
}
return r... |
// Include necessary modules for Adafruit motor shield
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"
#define A_pin 2
#define B_pin 3
#define num_ticks 1440
// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield... |
#pragma once
#include "ssVector2.h"
#include "ssVector3.h"
#include "ssVector4.h"
#include "ssBBox.h"
#include "ssMatrix3.h"
#include "ssMatrix4.h"
#include "ssPlane.h"
#include "ssPoint3.h"
#include "ssQuaternion.h"
#include "ssRay.h"
#include "ssSphere.h"
#include "serialize.h"
namespace ssMath {
template<class Arc... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* @author Patryk Obara (pobara)
*/
#include "platforms/quix/toolkits/gtk2/GtkPorting... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "10924"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
bool isPrime(int k){
for(int i = 2 ; i <= sqrt(k) ; i++ )
if( k%i == 0 )
return false;
return true;
}
int main(int argc, char const *argv[])
{
#ifdef DBG
freo... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Krefting
*/
#include "core/pch.h"
#include "modules/en... |
// processmanager.cc
//
// ProcessManager class similiar memory manager function, return an unused process
// id, clear a process id respectively by using a bitmap, store PCBs in an array of PCB*.
//// Might not need to include here
#include "system.h"
/////
#include "processmanager.h"
//---------------------------... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <stack>
using namespace std;
typedef long long ll;
#define INF 10e10
#define rep(i,n) for(int i=0; i<... |
/*
* A new PINTOOL which calculates how many times the instructions of each routine of each thread are
* executed.
*
* Author: Gustavo CIOTTO PINTON
* Computer Architecture II MO601B
*/
#include <iostream>
#include <fstream>
#include <string.h>
#include "pin.H"
#define MAX_ROUTINES_PER_THREAD 10
#define STATIC... |
#include "stdafx.h"
#include <iostream>
#include <list>
#include <map>
#include <deque>
#include <string>
#include <iterator>
#include <initializer_list>
#include <memory>
#include "List.h"
using namespace std;
void main() {
setlocale(LC_CTYPE, "rus");
List* element1 = new List; element1->add(1);
... |
#include "randomnumbergenerator.h"
#include "math.h"
#include <stdlib.h>
#include <time.h>
bool RandomNumberGenerator::initiated = false;
int RandomNumberGenerator::randomInt(int from, int tillIncl)
{
checkIfInitiated();
return rand() % (tillIncl - from + 1) + from;
}
double RandomNumberGenerator::randomDouble(dou... |
#include <stdio.h>
void addtime(int *hours, int *mins, int ETime)
{
int temp;
temp=(*mins+ETime);
*hours=((temp/60)+*hours);
temp=(temp%60);
*mins=temp;
}
int main()
{
int hr, mn, et;
printf("enter hour:");
scanf("%d",&hr);
printf("enter minutes:");
scanf("%d",&mn);
printf("enter ... |
#include "QueueT.h"
|
#pragma once
namespace cvfn {
public ref class Rect
{
public:
int X, Y, Width, Height;
Rect( int x, int y, int width, int height );
virtual ~Rect(void);
};
}; |
#ifndef PLAYERNEO_H
#define PLAYERNEO_H
#include "Object.h"
#include "Array.h"
class Vector;
class PlayerNeo : public Object
{
public:
explicit PlayerNeo(const char*);
PlayerNeo(const PlayerNeo&);
virtual ~PlayerNeo(void);
virtual void update(void);
virtual char whichClass(void);
void moveShoulder(float);
v... |
#pragma once
#include <vector>
#include <string>
#include <set>
#include "vec2.h"
#include <Eigen/Dense>
namespace cellogram
{
namespace PointsUntangler
{
struct Edge;
struct Face{
int vi[3];
int ei[3];
bool fixed = false;
int operator[](int i) const {return vi[i];}
int& operator[](int i){retur... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2011 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef STRINGTOKENLIST_ATTRIBUTE_H
#define STRINGTOKENLIST_ATTRIBUTE_... |
#include <cstdio>
#include <vector>
using namespace std;
const int MAXV = 510;
const int INF = 0xfffffff;
int adj[MAXV][MAXV], fee[MAXV][MAXV];
vector<int> pre[MAXV];
vector<int> path, tempPath;
int d[MAXV];
bool vis[MAXV] = {false};
int n, m, s, b;
int optValue = INF;
void dijkstra(int begin){
fill(d, d + MAXV, ... |
// Implementation of the MyGLWidget class
// Your scene graph will be created and called from here and OpenGL calls to display it.
#include <QtWidgets>
#include <QtOpenGL> // Note that some of the OpenGL calls are Qt specific and not standard OpenGL
#include "myglwidget.h"
#include "window.h"
#include <GL/glu.h>
M... |
/**
* @file src/yaramod.h
* @brief Declaration of yaramod interface.
* @copyright (c) 2017 Avast Software, licensed under the MIT license
*/
#pragma once
#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define YARAMOD_VERSION_MAJOR 2
#define YARAMOD_VERSION_MINOR 9
#define YARAMOD_VERSION_PATCH 0
#define Y... |
#include "LED13.h"
LED13::LED13(byte pin) {
this->pin = pin;
pinMode(this->pin, OUTPUT);
}
void LED13::on() {
digitalWrite(this->pin, HIGH);
}
void LED13::off() {
digitalWrite(this->pin, LOW);
}
void LED13::blink(int time) {
on();
delay(time/2);
off();
delay(time/2);
}
|
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/server/TThreadedServer.h>
#include <thrift/transport/TServerSocket.h>
#include <thrift/transport/TBufferTransports.h>
#include <signal.h>
#include "../utils.h"
#include "OrderBeverageHandler.h"
using json = nlohmann::json;
using apache::thrift::s... |
#include "UFOLayer.h"
UFOLayer::UFOLayer(void)
{
m_pAllMutiBullets = __Array::create();
m_pAllMutiBullets->retain();
m_pAllBigBoom = __Array::create();
m_pAllBigBoom->retain();
}
UFOLayer::~UFOLayer(void)
{
m_pAllMutiBullets->release();
m_pAllMutiBullets = nullptr;
m_pAllBigBoom->release();
m_p... |
#include "stdafx.h"
#include "IFile.h"
IFile::~IFile(void)
{
}
|
#pragma once
#include "../Updatable.hpp"
#include "../GameObjects/Paddle.hpp"
#include "../GameObjects/Ball.hpp"
class TwoPlayerState : public Updatable {
public:
TwoPlayerState();
void update(const sf::Time& deltaTime) override;
private:
Paddle paddleLeft;
Paddle paddleRight;
Ball ball;
sf::... |
/**************************************************************************************
* File Name : EnemyUnits.hpp
* Project Name : Keyboard Warriors
* Primary Author : Wonju Cho
* Secondary Author : Doyeong Yi
* Copyright Information :
* "All content 2019 DigiPen (USA) Corporation, all ri... |
#include <string>
#include <iostream>
#include <fstream>
#include <stdexcept>
#include <algorithm>
#include <array>
#include "ItemCollection.hpp"
using std::string;
using std::ifstream;
using std::cout;
using std::endl;
// function to return the hash value based on the first digit
unsigned int hashfct1(unsi... |
/* -*- Mode: C++ -*-
* mccp.y
* Copyright © 2000-04, 07, 08 Laboratoire de Biologie Informatique et Théorique.
* Author : Martin Larose
* Created On : Tue Aug 22 11:43:17 2000
* $Revision$
* $Id$
*/
%{
#include <vector>
#include <utility>
#include <sstream>
... |
#pragma once
#include <Windows.h>
#include <string>
HMODULE WINAPI GetRemoteModuleHandleW(HANDLE hProcess, LPCWSTR lpModuleName);
FARPROC WINAPI GetRemoteProcAddressW(HANDLE hProcess, HMODULE hModule, LPCWSTR lpProcName, UINT Ordinal = 0, BOOL UseOrdinal = FALSE);
class CInjector
{
HANDLE process;
public:
CInjecto... |
#pragma once
#include "pch.h"
#include "framework.h"
#include <DirectXCollision.h>
class ModelBFF
{
public:
MeshBFF mesh;
VertexBFF* vertexArr;
MaterialBFF material;
CameraBFF camera;
std::string fileName;
bool loaded = false;
bool loadSucceded() {
return mesh.nrOfVertex != 0;
}
}; |
/* -*- 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"
#include "modules/encodings/utility/charse... |
/**
* created: 2013-4-8 15:03
* filename: FKCldInitSeg
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#include <wchar.h>
#include "Dump/FKDumpErrorBase.h"
#include "Dump/FKDumpError.h"
#include "STLTemplate/FKSyncList.h"
#include... |
#include "getwifidata.h"
#include "sniff80211.h"
#include "wifilist.h"
#include "maclist.h"
#include "device.h"
#include <QList>
#include <QDebug>
extern char wlanName[100];
getWifiData::getWifiData(QThread *parent) : QThread(parent)
{
// this->mlist=*mlist;
// this->wlist=*wlist;
flag=false;
}
getWifiData::... |
#include "pawn.h"
#include "board.h"
//constructor; args: x position, y position, team
//Implementation of pawn class, includes functions that get all possible moves for the rook (based on how to piece is allowed to move following the conventional rules of chess)
pawn::pawn(int x, int y,bool team):piece(x,y,team){ //p... |
#include <iostream>
using namespace std;
// function calculates the result every time separately from previous calculations;
// void returns smth
int large_number = 0;
void print(int) ;
void print (int, int);
// the loop counts how many times to repeat and gives a new number every time.
int main (){
for(int i=0; i... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
**
** Yngve Pettersen
*/
#ifndef LIBSSL_SSLHAND3_H
#define LIBSSL_SS... |
#include <iostream>
#include <string>
#include <stdlib.h>
using namespace std;
struct Node{
int key;
Node *parent, *left, *right;
};
Node *root, *NIL;
void insert(int k){
Node *y = NIL;
Node *x = root;
Node *z;
z = (Node *)malloc(sizeof(Node));
z -> key = k;
z -> right = NIL;
z -> left = NIL;
w... |
// clear every pixel in matrix
void clearMatrix()
{
for(int i = 0; i < 12; i++)
{
for(int j = 0; j < 12; j++)
{
matrix[i][j].active = false;
matrix[i][j].r = 0;
matrix[i][j].g = 0;
matrix[i][j].b = 0;
}
}
}
// xxxxxxxxxxxx
// <--
// xxxxxxxxxxxx
// -->
// xxx... |
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <cstring>
#include <math.h>
#include <fstream>
#include <string>
#define P_P 1
#define P_N 2
#define N_P 3
#define N_N 4
#define m_pi 3.1415926535898
using namespace std;
|
#pragma once
#include "MomentsRecognizer.h"
class NV_Recognizer :
public MomentsRecognizer
{
public:
NV_Recognizer();
~NV_Recognizer();
cv::Mat MomentsToInput(fe::ComplexMoments& moments);
std::string OutputToValue(cv::Mat output);
bool Train(
std::map<std::string, std::vector<fe::ComplexMoments>> m... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* @author Espen Sand
*/
#ifndef X11_TOOLKIT_COLOR_CHOOSER_H
#define X11_TOOLKIT_COLOR... |
#include "stdafx.h"
#include "TestScene.h"
TestScene::TestScene()
{
}
TestScene::~TestScene()
{
}
HRESULT TestScene::Init()
{
isDebug = false;
for (int i = 0; i < TILEY; i++) {
for (int j = 0; j < TILEX; j++) {
ZeroMemory(&tiles[j + i * TILEX], sizeof(tagTile));
tiles[j + i * TILEX].rc = RectMake(
(... |
//
// Created by manout on 18-3-27.
//
#include <vector>
using namespace std;
vector<int> magic_bracelet(vector<int> data)
{
}
|
#include "LevelManager.h"
int LevelManager::actualLevel = 0;
bool LevelManager::animation = false;
sf::Text LevelManager::text;
sf::Font LevelManager::font;
void LevelManager::create()
{
font.loadFromFile("Images/arial.ttf");
text.setFont(font);
text.setCharacterSize(100);
text.setFillColor(sf::Color::White);
te... |
#pragma once
#include "Vector3.h"
#include "Collider\Collider.h"
#include "../GenericEntity.h"
class Mesh;
class CPlayerInfo;
class CProjectile : public GenericEntity
{
public:
CProjectile(void);
CProjectile(Mesh* _modelMesh);
~CProjectile(void);
public:
enum PROJECTILE_TYPE
{
NONE,
BULLET,
LASER,
ROCKET... |
const int ledPin = 6; // the pin that the LED is attached to
int key = 4; // pin that the button is attached to
int incomingByte; // a variable to read incoming serial data into
void setup() {
// initialize serial communication:
Serial.begin(9600);
// initialize the LED pin as an output:
pinMode(... |
#include "TestClass.h"
// RsaToolbox
using namespace RsaToolbox;
TestClass::TestClass(QObject *parent) :
QObject(parent)
{
//
}
TestClass::~TestClass() {
//
}
void TestClass::initTestCase() {
}
void TestClass::cleanupTestCase() {
}
void TestClass::init() {
}
void TestClass::cleanup() {
}
|
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.... |
// 实现一个最简单的 HTTP 服务器
// HTTP 服务器实际是一个 TCP 服务器,不过是应用数据处理是 HTTP 协议格式
// 处理数据的时候:
// 1. 获取 HTTP 头部(首行 + 头部)
// 2. 获取数据
// 3. 根据头部中的请求处理数据
// 处理方式:接收到浏览器的请求之后,打印请求的数据,并且响应:
// <html><body><h1>Hello World</h1></body></html>
#include <sstream>
#include "tcp_thread_server.hpp"
int main(void)
{
TcpThreadServer serve... |
#define PWDN_GPIO_NUM 32
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 0
#define SIOD_GPIO_NUM 26
#define SIOC_GPIO_NUM 27
#define Y9_GPIO_NUM 35
#define Y8_GPIO_NUM 34
#define Y7_GPIO_NUM 39
#define Y6_GPIO_NUM 36
#define Y5_GPIO_NUM 21
#define Y4_GPIO_NUM 19
#... |
// Created on: 1999-03-10
// Created by: data exchange team
// Copyright (c) 1999 Matra Datavision
// 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 ... |
#ifndef _TITLE_H_
#define _TITLE_H_
using namespace irr;
using namespace core;
using namespace io;
using namespace gui;
using namespace video;
using namespace scene;
class CEvent;
class Title
{
public:
Title(IrrlichtDevice *, CEvent*);
int run();
private:
void loadFont();
int getX();
... |
#ifndef _HTTP_REQUEST_H_
#define _HTTP_REQUEST_H_
#include <string>
#include "Message.h"
class httpRequest :public Message
{
public:
public:
httpRequest();
~httpRequest();
void setUrl(std::string url){ myUrl = url; }
std::string getUrl(){ return myUrl; }
private:
std::string myUrl;
};
#endif |
/*
*
*
* Created on: Sep 26, 2019
* Author: jacoboffersen
*/
#ifndef DISPLAY_DRIVER_H_
#define DISPLAY_DRIVER_H_
#include <iostream> // std::cout
#include <string> // std::string
#include <bitset> // std::bitset
#include "gpio.h"
#include "sleep.h"
#define DISPLAY_RS_PIN 1012
#defi... |
// -----------------------------------------------------------------------------
// G4Basic | DetectorConstruction.cpp
//
//
// -----------------------------------------------------------------------------
#include "DetectorConstruction.h"
#include "TrackingSD.h"
#include <G4Box.hh>
#include <G4Tubs.hh>
#include <G... |
/*
** EPITECH PROJECT, 2019
** tek3
** File description:
** Contact
*/
#ifndef CONTACT_HPP_
#define CONTACT_HPP_
#include <QtWidgets>
#include <QLabel>
#include <QSharedPointer>
#include <QMenu>
#include <memory>
#include <iostream>
#define DEFAULT_BACKGROUND_COLOR 230, 230, 230
#define SELECTED_BACKGROUND_COLOR 255... |
#include<iostream>
#include<stdexcept>
#include"Database.cpp"
#include"Employee.cpp"
using namespace std;
int displayMenu();
void doHire(Database& inDB);
void doFire(Database& inDB);
void doPromote(Database& inDB);
void doDemote(Database& inDB);
int displayMenu()
{
int selection;
cout<<endl;
cout<<"Employee D... |
#include <iostream>
int main()
{
std::cout << "No solutions implemented yet." << '\n';
}
|
#include<stdio.h>
#include<conio.h>
void read(int *,int);
void dis(int *,int);
void main()
{
int a[5],b[5],c[5],i;
printf("Enter the elements of first list \n");
read(a,5);
printf("The elements of first list are \n");
dis(a,5);
}
void read(int c[],int i)
{
int j;
... |
#include "ScavTrap.hpp"
std::string ScavTrap::_challengeNames[5] = {
"#bottleflipchallenge",
"#mannequinchallenge",
"#icebucketchallenge",
"#10yearchallenge",
"#kikichallenge"
};
ScavTrap::ScavTrap(const std::string &name)
: ClapTrap(name, "ScavTrap")
{
_lvl = 1;
_hitPoints = 100;
_maxHitPoints = 100;
_ener... |
/*
Transform source-code into a structured token's tree.
(2013) Tivins <https://github.com/tivins>
*/
#ifndef V_COMPILER_H
#define V_COMPILER_H
#include "tokens.h"
namespace v {
class Unilex {
public:
Unilex() ;
~Unilex() ;
bool parse(char *source) ;
private:
bool lexicalAnalysis(char * sour... |
/*
*
*
* Created on: Oct 24, 2019
* Author: jacoboffersen
*/
#ifndef DISPLAY_DRIVER_TASK_H_
#define DISPLAY_DRIVER_TASK_H_
#include "sleep.h"
#include "display_driver.h"
#include "common.h"
#include <pthread.h>
#include <mqueue.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <iostre... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.