text stringlengths 8 6.88M |
|---|
#include "SphereModelClass.h"
SphereModelClass::SphereModelClass()
{
m_Model = 0;
}
SphereModelClass::SphereModelClass(const SphereModelClass& other)
{
}
SphereModelClass::~SphereModelClass()
{
}
bool SphereModelClass::Initialize(ID3D10Device *device)
{
if (!LoadModelFromTXT("Data/Models/Sphere.txt"))
return f... |
#include<iostream>
using namespace std;
class integer{
int i;
public :
integer() {}
integer(int x) : i(x) {}
const integer& operator+ (const integer& rv) { // we can write: integer operator+(integer rv)
cout << "opeartor +" <<endl;
integer temp;
temp.i=i+rv.i;
return temp;
}
integer operator +=(const... |
#include "RtcClock.h"
void TimeUpdateHandler(TimerHandle_t xTimer);
void (*RtcClock::timeUpdateCallback)(void);
RtcClock::RtcClock(int _timeZone) : lastSyncTick(1000000UL), synhronized(false)
{
timeZone = _timeZone;
}
void RtcClock::Process()
{
if ((xTaskGetTickCount() - lastSyncTick) / c... |
#ifndef PLATAFORMA_H
#define PLATAFORMA_H
#include "SDL/SDL.h"
#include "SDL/SDL_image.h"
#include <iostream>
using namespace std;
class Plataforma
{
public:
int posX, posY, width, height;
string tipo;
SDL_Surface* imagen;
Plataforma();
virtual ~Plataforma();
virtu... |
#pragma once
#include "bricks/io/streamnavigator.h"
#include "bricks/io/endian.h"
namespace Bricks { namespace IO {
class StreamWriter : public StreamNavigator
{
public:
StreamWriter(Stream* stream, Endian::Enum endianness = Endian::Native);
void WriteInt(u16 value, Endian::Enum endian = Endian::Unknown);
v... |
#pragma once
#include <cstdint>
#include <ostream>
namespace dot_pp { namespace lexer {
enum class TokenType : uint8_t {
string,
string_literal,
keyword, // graph | digraph
l_paren, // {
r_paren, // }
e... |
//
// Package2.h
// ClientGame
//
// Created by liuxun on 15/3/4.
//
//
#include "stdafx.h"
#ifndef __ClientGame__Package2__
#define __ClientGame__Package2__
class Package2: public PhysicsActor{
public:
Package2(Vector2 position);
virtual void Update(float dt);
};
#endif /* defined(__... |
#include "Module/EventManager.h"
#include "Module/WindowManager.h"
#include "Module/Application.h"
//#include "Module/GraphicsManager.h"
//#include "Common/Mallocator.h"
#include <GLFW/glfw3.h>
using namespace Rocket;
EventManager* EventManager::s_Instance = nullptr;
ElapseTimer* Rocket::g_EventTimer;
EventManager*... |
#include <tf/transform_listener.h>
#include "visual_servoing_node.h"
enum Mode { STOP=0, FOLLOW=1 ,SQUARE=2, WORK=3, OBSTACLE=4 };
Mode operation_mode=STOP;
void initWayPoints(){
geometry_msgs::Pose2D primo;
primo.x=0;
primo.y=1;
primo.theta=1.57;
pose.push_back(primo);
primo.x=1;
primo.y=1;
primo.theta=0;
pos... |
/****************************************************************
File Name: phase3.C
Author: Tian Zhang, CS Dept., Univ. of Wisconsin-Madison, 1995
Copyright(c) 1995 by Tian Zhang
All Rights Reserved
Permission to use, copy and modify this software must be granted
by the author a... |
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: StateFactory.h
* Author: ssridhar
*
* Created on October 11, 2017, 1:06 PM
*/
#ifndef STATE_FACTORY_H
#... |
#include <iostream>
#include <forward_list>
/*
* NOTE: This solution fails to imagine the possibility that the heads
* of two linked lists merge into single linked list. This isn't possible
* with forward_lists, but is possible with a more basic linked list.
*
*/
using namespace std;
/*
* Runs O(n)
*
*/
bool... |
#pragma warning(disable:4786)
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:16777216")
#include <bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);
#define endl '\n'
#define gc getchar
#define file freopen("iceflux.in","r",stdin);
#define terminate exit (EXIT_FAILURE)
#... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2007 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
/** \file
*
* \brief Implement the OpMemDebug class.
*
* Call su... |
#include <string>
#include <fstream>
#include <new>
#include <cstring>
#include <sys/stat.h>
#include <sys/mman.h>
#include <unistd.h>
#include <fcntl.h>
#include "../include/easylogging++.h"
#include "../include/http_connection.h"
namespace miniserver {
HttpConnection HttpConnection::_http_connection;
std::map<... |
//
// Created by 송지원 on 2020/07/21.
//
#include <iostream>
using namespace std;
int N, S;
int arr[22];
int binaryArray[22];
int CNT;
void makeBinay(int input) {
fill(binaryArray, binaryArray+22, 0);
for (int i=0; i<N; i++) {
binaryArray[i] = input%2;
input /=2;
}
}
int main() {
ios::... |
#include<bits/stdc++.h>
using namespace std;
#define PI 3.1415926535897932
int main(){
int a=2,b=5,c=8;
printf("%d\n", (5 - 2) * (5 - 2) + (8 - (5 - 2)) * (8 + (5 - 2)));
printf("%d\n", (b - a) * (b - a) + (c - (b - a)) * (c + (b - a)));
return 0;
}
|
#include <iostream>
using std::cin; using std::cout; using std::endl;
#include <fstream>
#include <vector>
using std::vector;
#include <string>
using std::string;
void read_from_file(const string& file_name)
{
std::ifstream ifs(file_name);
string line;
vector<string> line_list;
while(ifs >> line) {
... |
#include <iberbar/Paper2d/TimeController.h>
iberbar::Paper2d::CTimeController::CTimeController()
: m_nTimeScale( 1.0f )
{
}
void iberbar::Paper2d::CTimeController::Update( float nDelta )
{
CNode::Update( nDelta * m_nTimeScale );
} |
#pragma once
#ifdef VK_USE_PLATFORM_ANDROID_KHR
#include <android/log.h>
#include <kompute_vk_ndk_wrapper.hpp>
// VK_NO_PROTOTYPES required before vulkan import but after wrapper.hpp
#undef VK_NO_PROTOTYPES
static const char* KOMPUTE_LOG_TAG = "KomputeLog";
#endif
#include <vulkan/vulkan.hpp>
// Typedefs to simplify... |
// Copyright (c) 2017-2022, University of Cincinnati, developed by Henry Schreiner
// under NSF AWARD 1414736 and by the respective contributors.
// All rights reserved.
//
// SPDX-License-Identifier: BSD-3-Clause
#pragma once
// On GCC < 4.8, the following define is often missing. Due to the
// fact that this librar... |
/***********************************************************************
h£ºrender module for mesh
************************************************************************/
#pragma once
namespace Noise3D
{
class /*_declspec(dllexport)*/ IRenderModuleForMesh :
IBaseRenderModule
{
pub... |
// Created on: 1993-01-11
// Created by: CKY / Contract Toubro-Larsen ( SIVA )
// Copyright (c) 1993-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
... |
#include "AllinProcess.h"
#include "HallHandler.h"
#include "Logger.h"
#include "Configure.h"
#include "GameServerConnect.h"
#include "PlayerManager.h"
#include "GameCmd.h"
#include "ProcessManager.h"
#include "RobotDefine.h"
#include <string>
using namespace std;
AllinProcess::AllinProcess()
{
this->name = "AllinPro... |
/* Public Domain */
#ifndef BUILDING_NODE_EXTENSION
# define BUILDING_NODE_EXTENSION
#endif
#include <node.h>
#include <v8.h>
// the windows header already defines MOUSE_MOVED
#ifdef MOUSE_MOVED
# undef MOUSE_MOVED
#endif
#include <curses.h>
#include <stdint.h>
#include "ptrwrap.h"
using namespace v8;
// checks... |
#include "ProgressTag.h"
ProgressTag::ProgressTag()
{
TextureManager::Instance()->load("../Assets/textures/enemiesLeft0.png", "enemiesLeft0");
TextureManager::Instance()->load("../Assets/textures/enemiesLeft1.png", "enemiesLeft1");
TextureManager::Instance()->load("../Assets/textures/enemiesLeft2.png", "enemiesLeft... |
#include "Packet.h"
#include "Player.h"
#include "PlayerManager.h"
#include "ProcessManager.h"
#include "Logger.h"
#include "GameCmd.h"
#include "GameLogic.h"
#include "MahjongAI.h"
#include "Protocol.h"
static std::string card_data_to_string(uint8_t* cards, size_t len)
{
std::string tmp;
for (size_t i = 0; i < len... |
#ifndef TIMING_H
#define TIMING_H
//
#include<QString>
#include<QDate>
#include<iostream>
#include<iomanip>
#include"exception.h"
using namespace std;
namespace TIME {
/*! \class Duree
\brief Classe permettant de manipuler des durees
L'utilisation de cette classe nécessite des dates vali... |
#include <stdio.h>
#include <assert.h>
#include "rest.h"
extern int32_t NUM_REST_ENTRIES;
/////////////////////////////////////////////////////////////
// Init function initializes the Reservation Station
/////////////////////////////////////////////////////////////
REST* REST_init(void){
int ii;
REST *t = (RES... |
/**
* (C) 2014 cryptosource GmbH
* (C) 2014 Falko Strenzke fstrenzke@cryptosource.de
*
* Botan is released under the Simplified BSD License (see license.txt)
*
*/
#include <botan/mce_kem.h>
#include <botan/sha2_64.h>
namespace Botan {
McEliece_KEM_Encryptor::McEliece_KEM_Encryptor(const McEliece_PublicKey& pub... |
#include <iostream>
using namespace std;
int n;
long long memo[91];
long long fib(int n){
if(n == 1){
return memo[n];
}else if(n == 2){
return memo[n];
}else{
if(memo[n-1] == 0){
memo[n-1] = fib(n-1);
}
if(memo[n-2] == 0){
memo[n-2] = fib(n-2... |
#pragma once
#include "point.hpp"
#include "ai.hpp"
namespace ai {
AI::script_ptr make_do_at(point destination, int duration, std::string description, int walkrate = 5);
}
|
#include "pch.h"
#include "Primitive.h"
namespace Hourglass
{
} |
#include<iostream>
using namespace std;
int MinIndex(int a[], int n)
{
int i = 0;
int min = a[0];
int minIndex = 0;
for (; i < n; i++)
{
if (a[i] < min)
{
minIndex = i;
min = a[i];
}
}
return minIndex;
}
int MaxIndex(int a[], int n)
{
int i = 0;
int max = a[0];
int maxIndex = 0;
for (; i < n; i... |
#include <string>
#include <iostream>
int main()
{
std::string msg("HI THIS IS BRAIN");
const std::string *ptr_to_msg = &msg;
const std::string &ref_to_msg = msg;
std::cout << "String by pointer: " << *ptr_to_msg << "\nString by referebce: " << ref_to_msg << std::endl;
return (0);
} |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
#define INF 0x3f3f3f3f
#define eps 1e-8
#define pi acos(-1.0)
using namespace std;
typedef long long L... |
#include "ImageManager.h"
CImageManager::CImageManager(void)
{
}
CImageManager::~CImageManager(void)
{
}
|
#pragma once
#define N 7
class Blocks
{
private:
int block[N][N];
const int width = 85;
const int height = 29;
public:
Blocks();
int Width();
int Height();
void decrease(int j, int i);
int value(int j, int i);
void Reset();
};
|
//
// Created by micky on 15. 5. 24.
//
#include "JudgeManager.h"
JudgeManager::JudgeManager(int cnt) {
_judges.resize(cnt);
}
Judge& JudgeManager::nextJudge() {
int min = 0x7fffffff;
int min_idx = 0;
for(auto it=_judges.begin(); it!= _judges.end() ;it++) {
if(it->remain() < min) {
... |
#include "arz.h"
// will need to use the old files to get at what we are expecting and
// hopefully use that to figure out how it has changed...
NormalPool::NormalPool()
{
name = weight = levelVar = -1;
}
ChampionPool::ChampionPool()
{
limit = minPClevel = -1;
}
//
// Record class
//
Record::... |
#pragma once
#include <string>
#include <set>
#include <functional>
#include <mutex>
#define invalid_atom 0
using namespace std;
namespace nora {
static_assert(sizeof(const char *) == sizeof(size_t), "not a 64bit machine?");
using atom = size_t;
static string atom_to_string(const ... |
//NAME: StackArray.cpp
//DESC: array implementation of stack
//USAGE: #include "StackArray.cpp"
//COMPILER: GNU g++ compiler on Linux
//AUTHOR: Bri Schmidt
//LAST UPDATED: September 30, 2018 19:03
#include <StackArray.h>
//default constructor
//precondition: max stack specified in Stack.h
//postcondition: empty stack... |
// Copyright (c) 2020 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include <pika/config.hpp>
#include <pika/functional/detail/invoke.hpp>
... |
#include "engine/audio/AudioMaster.hpp"
AudioMaster::AudioMaster() :
device(NULL),
context(NULL)
{
}
AudioMaster::~AudioMaster()
{
}
void AudioMaster::free()
{
if (context != NULL) {
alcMakeContextCurrent(NULL);
alcDestroyContext(context);
}
if (device != NULL) {
alcCloseDevice(device);
}
alutExit();
}
... |
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<conio.h>
#include<malloc.h>
#include<stdlib.h>
struct node
{
int Java;
int id;
struct node* link;
};
int Convert(char *cp){
int val = 0;
for (int i = 0; cp[i] != '\0'; i++)
{
val *= 10;
val += cp[i] - '0';
}
return val;
}
void append(struct node ... |
#include "StdAfx.h"
#include "GraphicsManager.h"
#include <curses.h>
#include "CurrentGameInfo.h"
GraphicsManager::GraphicsManager(void)
{
}
GraphicsManager::~GraphicsManager(void)
{
}
GraphicsManager* GraphicsManager::getInstance(void)
{
static GraphicsManager instance;
return &instance;
}
void GraphicsManager:... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define r... |
#pragma once
#include "ARPG.h"
#include "Components/BoxComponent.h"
#include "EnemySpawnerComponent.generated.h"
UCLASS()
class ARPG_API UEnemySpawnerComponent : public UBoxComponent
{
GENERATED_BODY()
private :
class UDataTable* DT_EnemySpawnRegionInfo;
private :
// 스폰 지점이 X 축 방향으로 몇개 위치하도록 할 것인지를 지정합니다.
UP... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
//
// Copyright (C) 1995-2009 Opera Software ASA. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Adam Minchinton
//
#ifndef __MAILE... |
#include "menu_def.h"
#include "base.h"
#ifdef ARDUINO_LOLIN32
// ESP32 timer
void IRAM_ATTR onTimer() {clickEncoder.service();}
hw_timer_t *timer = NULL;
portMUX_TYPE timerMux = portMUX_INITIALIZER_UNLOCKED;
#else
//teensy timer
void timerIsr() {clickEncoder.service();}
#endif
// rotary encoder pins
#def... |
/* Naive pattern search.
Given a block of text and a pattern, write a function that returns
all occurances of pattern in the text.
*/
#include <string>
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
// Function for naive search
void naivesearch(char* pattern, char* txt){
// now we run ... |
#include "menuHeader.h"
#include "checkerHeader.h"
#include "linkedListHeader.h"
#include "utilityHeader.h"
void mainMenu(schoolYear defaultsc, semester defaultsmt) {
system("cls");
int option;
cout << "Your default school year is currently set to: " << setw(4) << setfill('0') << defaultsc.startYear << "-" << setw(... |
#include <iostream>
#include <string>
#include <fstream>
#include "tracer.h"
using namespace std;
int main() {
Tracer trace;
//Scene newscene;
trace.init("test.obj");
trace.render();
trace.savepic("test.png");
trace.ins("test.png");
return 0;
} |
#include"Loader.h"
void OBJLoader::load(string filename)
{
reader.open(filename.c_str(), ios::in | ios::binary);
string line;
int mat_length = strlen("mtllib");
int vlen = strlen("v");
int vnlen = strlen("vn");
int vtlen = strlen("vt");
int flen = strlen("f");
while (getline(reader, line))
{
if (line[0] ==... |
#include <vector>
#include <cassert>
#include "../RandomPoints3D.h"
#include "stdnormal_test.h"
int main(void)
{
int count = 10000;
// generate the points;
RandomPoints3D random;
random.setPointCount(count);
random.generate();
std::vector<Point3D> pts = random.getPoints();
assert(pts.size... |
/*****************************************************************************************************************
* File Name : binarysearchtree.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\tutorials\nptel\DSAndAlgo\lecture08\binarysearchtree.h
* Created on : Dec 30, 2013 :: 7:02:06 ... |
#include "ActionStateSystem.h"
#include "Player.h"
#include "World.h"
#include "SkeletonAnimations.h"
#include "Components/InputComponent.h"
#include "Components/ActionStateComponent.h"
#include "Physics/CollisionTestRequest.h"
#include "CollisionSystem.h"
#include "Components/CombatComponent.h"
#include "Attack.h"
... |
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int main() {
vector<int> v = {11,20,-3,4,9};
priority_queue<int> q(v.begin(), v.end());
while( !q.empty() ) {
cout << q.top() << endl;
q.pop();
}
}
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef SCOPE_OVERLAY_H
#define SCOPE_OVERLAY_H
#ifdef SCOPE_OVERLAY
... |
/**
* @file
* @author Aapo Kyrola <akyrola@cs.cmu.edu>
* @version 1.0
*
* @section LICENSE
*
* Copyright [2012] [Aapo Kyrola, Guy Blelloch, Carlos Guestrin / Carnegie Mellon University]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with ... |
#include <cstring>
#include <vector>
#include <iostream>
#include "gl.h"
#include "image.h"
#include <node.h>
#include <node_buffer.h>
#include <GL/glew.h>
#include <GL/glu.h>
#ifdef _WIN32
#define strcasestr(s, t) strstr(strupr(s), t)
#endif
namespace gl {
using namespace node;
using namespace v8;
usi... |
#include <iostream>
using namespace std;
int main() {
std::pair<string,int> p1("hahaha",3999);
std::pair<float,int> p2(3.14,2);
p1 = make_pair("somchai",200);
p2 = make_pair(55.33, 9999);
p1 = { "asdf", 111};
std::cout << p1.first << " : " << p1.second << std::endl;
std::cout << p2.first << " : " <<... |
#include <vector>
#include <utility>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "llvm/IR/Module.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Verifier.h"
#include "llvm/IR/Constant.h"
#include "llvm/IR/IRBuilder.h"
#include "llvm/IR/LLVMContex... |
// Fill out your copyright notice in the Description page of Project Settings.
#include "S05_TestingGrounds.h"
#include "ChooseNextWaypoint.h"
#include "BehaviorTree/BlackboardComponent.h"
#include "AIController.h"
#include "PatrolLoop.h"
EBTNodeResult::Type UChooseNextWaypoint::ExecuteTask(UBehaviorTreeComponent & O... |
#include <iostream>
#include <memory>
#include <sstream>
#include <string>
using namespace std;
struct Image {
virtual ~Image() = default;
virtual void draw() = 0;
};
struct Bitmap : Image {
Bitmap(const string& filename) { cout << "Loading image from " << filename << endl; }
void draw() override { cout << ... |
#include <iostream>
#include <vector>
class List
{
private:
/* data */
public:
List(/* args */)
{
//constructor
}
~List()
{
//destructor
}
std::vector<std::vector<std::string>> mainList;
std::vector<std::string> list;
std::string name;
int currentUserIndex;
... |
#include <iostream>
#include <string>
using namespace std;
int main() {
int a = 0;
int b = 0;
int c = 0;
cin >> a >> b >> c;
int digit[10] = {0};
string str = to_string(a * b * c);
int len = str.length();
for (int i = 0; i < len; i++) {
digit[str[i] - '0']++;
}
for (int i = 0; i < 10; i+... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) Opera Software ASA, 2001-2011
*
* Automatic proxy configuration through Javascript.
* Lars T Hansen
*/
#include "core/pch.h"
#ifdef SUPPORT_AUTO_PROXY_CONFIGURATION
#include "modules/hardcore/... |
#include "pch.h"
#include "TitleScene.h"
#include "SceneCommons.h"
#include "Framework/SceneManager.h"
using namespace DirectX;
void TitleScene::Build(GameContext& context)
{
auto obj = GameObject::Create();
auto text = obj->AddComponent<FontObject>(L"Resources/Fonts/logofont.spritefont", L"タイトルシーン");
context << o... |
/*
Copyright 2021 University of Manchester
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 agreed to in writing, s... |
#include "bossweapon.h"
#include <iostream>
BossWeapon::BossWeapon()
{
image.load("axe.png"); //loads image
rect = image.rect(); //assigns image
resetState();
xdir = -0; //start moving right 1 pixel at a time
ydir = 0; //start moving down 1 pixel at a time
}
BossWeapon::~BossWeapon() {
std::cout << ("BossWeapo... |
#include <lvgl.h>
#include <Ticker.h>
// =========== LCD ===========
// Pin Control
#define LCD_RS 26 // Data or Command
#define LCD_WR 27 // Write
// #define LCD_RD 34 // Read
// #define LCD_CS 35 // Chip select
// #define LCD_RESET 31 // Reset
/*
* ==== Wireing ====
* LCD | K210(... |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef ORBIT_CORE_LINUX_TRACING_BUFFER_H_
#define ORBIT_CORE_LINUX_TRACING_BUFFER_H_
#include "EventBuffer.h"
#include "KeyAndString.h"
#include "Scope... |
class Solution {
private:
vector<int> delta = {0,1,0,-1,0};
public:
bool exist(vector<vector<char>>& board, string word) {
if(board.empty() || board[0].empty()) return false;
for(int i = 0; i < board.size(); ++i){
for(int j = 0; j < board[0].size(); ++j){
if(findword(... |
// VERY basic implementation of a spinlock, thanks to osdev wiki
#include <ksync.h>
void acquire_spinlock(spinlock_t *spinlock) {
while (!__sync_bool_compare_and_swap(spinlock, 0, 1)) {
asm("pause");
}
}
void release_spinlock(spinlock_t *spinlock) {
*spinlock = 0;
}
|
#include "ShopItemWidget.h"
#include "Single/GameInstance/RPGGameInst.h"
#include "Single/PlayerManager/PlayerManager.h"
#include "Actor/Controller/PlayerController/BasePlayerController.h"
#include "Widget/WidgetControllerWidget/WidgetControllerWidget.h"
#include "Widget/ClosableWnd/NpcShopWnd/NpcShopWnd.h"
#includ... |
#include "../include/SelectionTool.h"
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2009 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @shuais
*/
#ifndef CRASH_LOGGING_DIALOG_H
#define CRASH_LOGGIN... |
/*****************************************************************************************************************
* File Name : multiplication.h
* File Location : C:\Users\AVINASH\Desktop\CC++\Programming\src\fun\maths\school\class05\multiplication.h
* Created on : Dec 26, 2013 :: 11:15:22 PM
* Author ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#ifdef M2_SUPPORT
#ifdef _BITTORRENT_SUP... |
#include <jni.h>
#include <string>
#include <android/native_window_jni.h>
#include "XLog.h"
#include "IPlayerPorxy.h"
extern "C"
JNIEXPORT
jint JNI_OnLoad(JavaVM *vm,void *res) {
IPlayerPorxy::Get()->Init(vm);
IPlayerPorxy::Get()->SetHardDecode(false);
return JNI_VERSION_1_4;
}
extern "C"
JNIEXPORT void J... |
#include <iostream>
#include <cstring>
#include <queue>
#define MAX 3000001
std::queue<int> q;
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
int L, ML, MK, MINE;
bool ALIVE = true;
std::cin >> L >> ML >> MK >> MINE;
for(int i = 1; i <= L; i++)
{
int zombie, rang... |
/**********************************************************************
*
* Filename: circbuf.cpp
*
* Description: An easy-to-use circular buffer class.
*
* Notes: Relies on the Mutex class to protect buffer contents.
*
*
* Copyright (c) 1998 by Michael Barr. This software is placed into
... |
#include<cstdio>
#include<cstring>
using namespace std;
const int M = 505;
bool vis[M],dia[M][M];
int mat[M];
int n,m;
bool dfs(int k)
{
for(int i=1;i<=n;++i){
if(dia[k][i] && !vis[i]){
vis[i] = 1;
if(mat[i]==-1 || dfs(mat[i])){
mat[i] = k;
... |
#include "stdafx.h"
#include "AIEditLine.h"
#include "AIEditNodeOrder.h"
#include "AIEditNode.h"
#include "../GameCursor.h"
#include "AIEditNodeTarget.h"
#include "AIEditNodeProcess.h"
#include"AIEditNodeSelectFonts.h"
//camera
#include "../../GameCamera.h"
AIEditLine::~AIEditLine()
{
}
void AIEditLine::OnDestroy()... |
#include "hook.h"
#include "hooks/io.h"
static hook_t __hooks[] = {
ADDHOOK( /system/lib/libjavacore.so, open ),
ADDHOOK( /system/lib/libjavacore.so, connect ),
ADDHOOK( /system/lib/libbinder.so, ioctl)
};
#define NHOOKS ( sizeof(__hooks) / sizeof(__hooks[0] ) )
uintptr_t find_original( const char *name ... |
#include "SqlNativeTransaction.hpp"
#ifndef ELYSIUM_CORE_DATA_SQLNATIVECLIENT_SQLHELPER
#include "SqlHelper.hpp"
#endif
#ifndef ELYSIUM_CORE_EXCEPTION
#include "../Elysium.Core/Exception.hpp"
#endif
Elysium::Core::Data::SqlNativeClient::SqlNativeTransaction::SqlNativeTransaction(SqlNativeConnection* Connec... |
#include "Engine.cpp.h"
Engine.cpp::Engine.cpp()
{
//ctor
}
Engine.cpp::~Engine.cpp()
{
//dtor
}
|
#pragma once
#include "scene/log.hpp"
#define SBI_TLOG __TLOG << setw(20) << "[SCENEBI] "
#define SBI_DLOG __DLOG << setw(20) << "[SCENEBI] "
#define SBI_ILOG __ILOG << setw(20) << "[SCENEBI] "
#define SBI_ELOG __ELOG << setw(20) << "[SCENEBI] "
|
// Created on: 2007-12-25
// Created by: Alexander GRIGORIEV
// Copyright (c) 2007-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License version ... |
#ifndef RECOGNIZER_HH
#define RECOGNIZER_HH
#include <pthread.h>
#include "FeatureGenerator.hh"
#include "HmmSet.hh"
#include "msg.hh"
#include "Process.hh"
#include "Adapter.hh"
class Recognizer {
public:
// If you change these, remember to change ac_state_str in Recognizer.cc
enum AcState { A_STARTING,
... |
#include "joint_tracker.h"
namespace imagio
{
void joint_tracker::new_frame(wimgui::vertex* vertices, unsigned int vertices_count)
{
points = vertices;
points_count = vertices_count;
calculate_visibility_k();
calculate_alpha_kn();
calculate_force_k();
// to be continued...
}
void joint_tracker::calculate_vis... |
#pragma once
#include "plbase/PluginBase.h"
#include "CTask.h"
#pragma pack(push, 4)
class PLUGIN_API CTaskSimple : public CTask {
CTaskSimple() = delete;
protected:
CTaskSimple(plugin::dummy_func_t a) : CTask(a) {}
public:
virtual bool ProcessPed(class CPed *ped);//=0
virtual bool SetPedPosition(class CPed... |
#pragma once
#include"RepoFile.h"
#include "RepoTemplate.h"
#include "Entity.h"
using namespace std;
class Service
{
private:
//RepositoryFile repo;
RepositoryTemplate<Car> &repo;
//RepositoryFile undo[100];
int psize;
int maxc;
int cars;
public:
int max;
//Service();
//Service(const RepoTem... |
#include<iostream>
#include<cstring>
using namespace std;
string s;
int m;
long long int L1,R1,L2,R2;
int biji(int L1,int R1,int L2,int R2){
if(L1>R1){
int t= R1;
R1=L1;
L1=t;
}
if(L2>R2){
int a= R2;
R2=L2;
L2=a;
}
return 0;
}
string a,b;
int main(){
cin >> s;
cin >> m;
while(m--){
scanf("%lld%lld%lld%... |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
FILE *file=NULL;
struct Node //用作树节点结构
{
struct Node * next[9];
};
Node * New () //函数用作创建新的树节点
{
struct Node * q =(str... |
/*****************************************************************
* Copyright (C) 2017-2018 Robert Valler - All rights reserved.
*
* This file is part of the project: DevPlatformAppCMake.
*
* This project can not be copied and/or distributed
* without the express permission of the copyright holder
******... |
class Category_527 {
class 8Rnd_B_Saiga12_74Slug {
type = "trade_items";
buy[] = {5,"ItemSilverBar"};
sell[] = {3,"ItemSilverBar"};
};
class 8Rnd_B_Saiga12_Pellets {
type = "trade_items";
buy[] = {5,"ItemSilverBar"};
sell[] = {3,"ItemSilverBar"};
};
class 20Rnd_B_AA12_Pellets {
type = "trade_items";
... |
#ifndef Circulo_h
#define Circulo_h
#include "Figura.h"
using namespace std;
class Circulo:public Figura{
private:
double radio;
public:
Circulo(double);
void setRadio(double);
double getRadio();
double calcArea();
double calcPerimetro();
void muestraQueSoy();
};
Circulo::Circulo(double r):F... |
#include <iostream>
#include "Duck.h"
#include "DuckFactory.h"
#include <memory>
using std::cout;
std::unique_ptr<Duck> createDuck();
void operateDuck(Duck&);
REGISTER_FACTORY(MallardDuck);
REGISTER_FACTORY(ModelDuck);
int main() {
DuckFactory::showClasses();
cout << endl;
std::unique_ptr<Duck> objMalla... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.