text stringlengths 8 6.88M |
|---|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef DOM_MEDIALIST_H
#define DOM_MEDIALIST_H
#include "mod... |
#include <iostream>
#include <uwebsockets/App.h>
#include <regex>
#include <map>
struct UserConnection {
std::string name;
unsigned long user_id;
uWS::WebSocket<false, true>* ws;
void virtual sendMessage(std::string message, UserConnection& sender) {
ws->send("[" + sender.name + "]: " + message... |
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
/* compile with g++ main.cpp -lpthread -o example.out */
#define N 10000
#define KB(x) ((size_t) (x) << 10)
#define MB(x) ((size_t) (x) << 20)
#define MBEXTRA 1000000
pthread_attr_t attr;
void* do_work(void* arg) {
/*
A large double array of double, ... |
/*********************************************************\
* 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... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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 _URL_DEBUG_H_
#define _URL_DEBUG... |
#include <ToolKits.h>
#include <BinomialQueue.h>
int main(void)
{
BinomialQueue bq;
doub_time dt(10.0);
Simulation(bq, dt);
}
|
// -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
/* Strings referenced in adjunct/m2/.
*
* Comment lines of both forms valid in C++ are ignored. Preprocessor
* directives are allowed: the #if-ery around each string tag should reflect the
* #if-ery around its use in the indicated file(s). Strings tags may be... |
#include "role.h"
Role::Role(QObject *parent) : BaseObject(parent), _HP(3)
{}
Role::Role(int x,
int y,
int width,
int height,
const QString& imgPath,
int speed,
int HP,
... |
#include <iostream>
#include <climits>
using namespace std;
int res = INT_MAX ; //Variable to store the final answer
//Cells marked 0 are not in the board
//Cells marked 1 are in the board but not visited
//Cells marked 2 are in the board and visited already
bool knight(int board[][15],int n,int r,int c,in... |
// Strings for ns4plugins -*- Mode: c++; tab-width: 4 -*-
#ifdef _PLUGIN_SUPPORT_
S_PLUGIN_TRANSFER_STATUS
#ifdef _WINDOWLESS_PLUGIN_SUPPORT_
# if defined(MSWIN) || defined(_MACINTOSH_) || defined(WINGOGI)
# ifdef MANUAL_PLUGIN_ACTIVATION
D_PLUGIN_ACTIVATE
# endif
# endif
#endif
#ifdef MANUAL_PLUGIN_ACTIVATION
D_P... |
#include "CartridgeReader.h"
#include <fstream>
static uint8_t CR_mirroring = 0;
static uint8_t CR_mapper = 0;
static bool CR_hasBatteryBackedRAM = false;
static uint8_t *CR_PRGROM = nullptr;
static uint8_t *CR_CHRROM = nullptr;
static uint8_t CR_PRGBankCount = 0;
static uint8_t CR_CHRBankCount = 0;
static uint8_t CR... |
#include "Packet.h"
Packet::Packet() {
}
Packet::~Packet() {
}
|
#include "Coordenada.h"
#ifndef RECTANGULO_H
#define RECTANGULO_H
class Rectangulo
{
private:
Coordenada c1, c2, c3, c4;
Coordenada *coordenadas[4] = {&c1, &c2, &c3, &c4};
public:
Rectangulo(Coordenada = Coordenada(1.0,1.0), Coordenada = Coordenada(1.0,2.0), Coordenada = Coordenada(2.0,2.0), Coorden... |
#include <QApplication>
#include <QFile>
#include <QFileInfo>
#include <QDebug>
#include "waittingpage.h"
#include "hintpage.h"
#include "aboutpage.h"
#include "gamepage.h"
#include "pausingpage.h"
#include "global.h"
#include "game/GreedySnakeGame.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
... |
#include "factory.hpp"
class MainForm {
private:
SpliterFactory *factory;
public:
MainForm(SpliterFactory *f) : factory(f) {}
void click() {
ISpliter *s = factory->CreateSpliter("main.cc", 4);
s->split();
}
};
int main() {
BinarySpliterFactory bsf;
PictureSpliterFactory psf;
VideoSpliterFactor... |
#ifndef __MOCK_OP_HPP__
#define __MOCK_OP_HPP__
#include "base.hpp"
class EightOpMock : public Base {
public:
EightOpMock() {}
virtual double evaluate() { return 8.0; }
virtual std::string stringify() { return "8.0"; }
};
class SixOpMock : public Base {
public:
SixOpMock() {}
virtual do... |
#include "stdafx.h"
#include "KruskalListAlgorithm.h"
#include <iostream>
KruskalListAlgorithm::KruskalListAlgorithm(Graph2 & graph):KruskalMatrixAlgorithm(graph)
{
}
KruskalListAlgorithm::~KruskalListAlgorithm()
{
}
void KruskalListAlgorithm::fillEdgesQueue()
{
for (int i = 0; i < numberOfVertices; i++)
{
int ... |
#include <iostream>
// swap using pointers
void swap(int &a, int &b) {
int temp(a);
a = b;
b = temp;
}
int main(void) {
int a = 1;
int b = 2;
std::cout << "a = " << a << ", b = " << b << std::endl;
swap(a, b);
std::cout << "a = " << a << ", b = " << b << std::endl;
return EXIT_SUCCESS;
}
|
#ifndef _LOG_2_JENS_H_
#define _LOG_2_JENS_H_
#include <stdio.h>
class Log
{
private:
bool enabled;
FILE *fp;
char name[64];
char *spacePtr;
Ptr notifierLog[2]; // flip-flop buffer
SInt8 currLog; // which buffer is active
public:
Log(char *filename);
~Log();
int Open();
void Close(... |
#pragma once
#include <list>
#include <GL/glew.h>
#include <glm/glm.hpp>
#include "../interfaces/Module.h"
#include "../../resources/RenderObject.h"
#include "../../structs/ShaderData.h"
#include "../../structs/RenderStructure.h"
#include "../../structs/CameraData.h"
namespace Game
{
class DrawModule: public Module
{... |
#include "defs.h"
#include "TimerOne.h"
#include <EEPROM.h>
#include <avr/io.h>
#include <avr/wdt.h>
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
#endif
//Open source Foucault Pendulum program
//this program will drive the portab... |
#include "Shader.h"
static GLchar *ReadShaderSource(const char *name){
// ファイル名が NULL なら NULL を返す
if (name == NULL) return NULL;
// ソースファイルを開く
std::ifstream file(name, std::ios::binary);
// ファイルが開けなければ戻る
if (!file)
{
std::cerr << "Error: Can't open source file: " << name << std::endl;
return NULL;
}
//... |
/* -*- 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.
*/
/**
* @file SecurityInformationDialog.cpp
*
* Contains function definitions for the... |
// Created on: 1991-03-29
// Created by: Remi GILET
// Copyright (c) 1991-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 Les... |
/* -*- 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.
**
** Jan Borsodi
*/
#include "core/pch.h"
#ifdef SCOPE_SUPPORT
# ifdef ... |
#ifndef MAGMA_AST_TRANSLATIONUNIT_H
#define MAGMA_AST_TRANSLATIONUNIT_H
#include "node.h"
namespace magma { namespace ast {
/// AST node representing a complete translation unit.
class translation_unit : public node {
public:
static auto create() -> std::unique_ptr<translation_unit>;
void accept(visitor &) over... |
// Color Match
// January 28, 2012
// by George Gardner
int pwmrgb[] = {11, 9, 10}; //sets the r,g,b cathode pins for the pwm led (must be pwm pins)
int rgbbias[] = {100, 15, 0}; //sets the bias for the illuminated RGB LED: higher number = less intense (max 255)
int rgbds[] = {255, 255, 255};
int maxwhite[] = {773, ... |
/*
* Stopping Times
* Copyright (C) Leonardo Marchetti 2011 <leonardomarchetti@gmail.com>
*/
#include "maximizer.h"
/* Class Maximizer has template methods. To see their implementation look at maximizer.inl file. */
namespace StoppingTimes{
}
|
#pragma once
#include "mapper.hpp"
#include "ppu.hpp"
class Mapper7 : public Mapper
{
uint8_t regs[1];
void apply();
public:
Mapper7(uint8_t* rom) : Mapper(rom)
{
regs[0] = 0;
apply();
}
uint8_t write(uint16_t addr, uint8_t v);
uint8_t chr_write(uint16_t... |
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <fstream> //files
#include <errno.h> //errors
#include <stdio.h> //printf
#include <unistd.h> // sys calls
#include <sys/types.h> // O_ constants
#include <sys/ipc.h> // IPC... |
//
// Created by giofn on 08/01/2020.
//
#ifndef CELLE_FORMULAMEAN_H
#define CELLE_FORMULAMEAN_H
#include "Formula.h"
class FormulaMean: public Formula {
public:
FormulaMean() : Formula(),mean(0) {}
~FormulaMean() {}
void update() override ;
float calculate() override ;
private:
float me... |
// Created on: 1995-01-27
// Created by: Marie Jose MARTZ
// Copyright (c) 1995-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 G... |
#pragma once
#include "Production.h"
class ProductionStack :
public Production
{
/*
这个类是 在LR(1)文法中的,产生式,包含 follow集合(是LR(1)意义上的follow集合)
以及当前stack的状态(就是小点点)
还有一个标记是该式子是否被访问过了
*/
public:
ProductionStack(NonTerminator* head, int production_id);
void stateInit();
virtual bool operator==(const ProductionStack& p)co... |
// Copyright 2011 Yandex
#ifndef LTR_DATA_UTILITY_OBJECT_UTILITY_H_
#define LTR_DATA_UTILITY_OBJECT_UTILITY_H_
#include "ltr/utility/numerical.h"
namespace ltr {
/**
* Function checks the sameness of two vectors of features
*/
bool DoubleEqualWithNaN(const Features& lhs, const Features& rhs) {
if (lhs.size... |
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <strings.h>
#include <string.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
//域套接字定义
#define SOCKET_PATH "./domainsocket"
#define MSG_SIZE 2048
int main(){
int socket_fd,accept_fd;
... |
/*
* Created by Peng Qixiang on 2018/7/31.
*/
/*
* 从上往下打印出二叉树的每个节点,同层节点从左至右打印。
*
*/
# include <iostream>
# include <queue>
using namespace std;
struct TreeNode {
int val;
struct TreeNode *left;
struct TreeNode *right;
TreeNode(int x) :
val(x), left(NULL), right(NULL) {
}
};
cla... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* Allowed #if-ery: SYSTEM_* defines.
*/
#ifndef POSIX_SYS_DECLARE_POSIX_H
#define POSI... |
#pragma once
namespace doo {
namespace metrodriver {
class SystemUtils
{
public:
static Platform::String^ GetSIDForCurrentUser();
};
}
}
|
#include "extensions/filters/http/cache/cache_filter.h"
#include "common/http/headers.h"
#include "extensions/filters/http/cache/cache_filter_utils.h"
#include "absl/strings/string_view.h"
namespace Envoy {
namespace Extensions {
namespace HttpFilters {
namespace Cache {
struct CacheResponseCodeDetailValues {
co... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) Opera Software ASA 2005
*
* Initialization of precompiled JS libraries
* Lars T Hansen
*/
#include "core/pch.h"
#ifdef SUPPORT_AUTO_PROXY_CONFIGURATION
#include "modules/autoproxy/autoproxy_... |
/*====================================================================
Copyright(c) 2018 Adam Rankin
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 without limitati... |
// This file was generated based on /Users/r0xstation/18app/src/.uno/ux13/app18.unoproj.g.uno.
// WARNING: Changes might be lost if you edit this file directly.
#pragma once
#include <Uno.Object.h>
#include <Uno.UX.Property-1.h>
namespace g{namespace Uno{namespace UX{struct PropertyObject;}}}
namespace g{namespace Uno... |
#ifndef _WAVEFRONT_OBJ_H_
#define _WAVEFRONT_OBJ_H_
#include <vector>
#include <array>
#include <utility>
#include <GL/GL.h>
class wavefront_obj_t {
public:
static constexpr GLuint gl_primitive_mode = GL_POLYGON;
using double2 = std::array<double, 2>;
using double3 = std::array<double, 3>;
struct fac... |
#include <iostream>
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <time.h>
#include <Windows.h>
#include <opencv2/core/core.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <intraface\FaceA... |
//
// main.cc
//
// Author:
// Alexander Nusov
//
// Copyright (C) 2014 Alexander Nusov
//
// 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
// without limi... |
// Created on: 1995-12-01
// Created by: EXPRESS->CDL V0.2 Translator
// Copyright (c) 1995-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 te... |
#include"dataflow.h"
#define N_experiment 15
void DataflowAnalysis(const char* _pe_file, const char* _statement_file,
const char* _mapping_file, int inner_cycle=1)
{
PEArray pe;
if (!pe.Load(_pe_file))
{
fprintf(stderr, "Load PE failed\n");
return;
}
Statement st;
if (!st.Load(_statement_file))
{
fprint... |
// Copyright (C) 2004 Id Software, Inc.
//
#ifndef __LISTGUI_H__
#define __LISTGUI_H__
/*
===============================================================================
feed data to a listDef
each item has an id and a display string
===============================================================================
... |
#pragma once
#include <string>
#include <vector>
#include <QMetaType>
#include <QString>
#include <FuzzySearch.h>
struct HistoryItemData
{
std::string m_Text;
size_t m_TextHash{0};
size_t m_Timestamp{0};
};
Q_DECLARE_METATYPE(HistoryItemData)
struct HistoryItem
{
HistoryItem(HistoryItemData item_data);
Hist... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#include "PushOutCard.h"
#include "HallHandler.h"
#include "Logger.h"
#include "GameCmd.h"
#include "GameServerConnect.h"
#include "PlayerManager.h"
#include "ProcessManager.h"
#include <string>
using namespace std;
REGISTER_PROCESS(CLIENT_MSG_OUT_CARD, PushOutCard)
PushOutCard::PushOutCard()
{
this->name = "PushOut... |
//
// Created by Omer on 22/01/2018.
//
#ifndef ASSIGNMENT4_RIVER_H
#define ASSIGNMENT4_RIVER_H
#include "Area.h"
using std::vector;
namespace mtm {
class River : public Area {
public:
/**
* Constructor
* @param name The name of the area
* @throws AreaInvalidArguments If ... |
#include "Header.h"
/**
*@author Umaralikhon Kayumov
*/
void menu();
int main();
void innerMenu();
template <class Tx>
void sortArr(Tx **arr, size_t col, size_t row) {
Tx x;
Tx summa; //Общая сумма
Tx sumUpRight, sumUpLeft, sumDownRight, sumDownLeft; //Суммы элементов по четвертям
Tx change; //Изменяемый элемент... |
/* -*- 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.
*/
#ifndef SETTINGS_LISTENER_H
#define SETTINGS_LISTENER_H
class De... |
class equip_lever
{
weight = 0.5;
};
class ItemSledgeHead
{
weight = 9;
};
class ItemSledgeHandle
{
weight = 1;
};
class equip_Crossbow_Kit
{
weight = 4;
};
class equip_crossbow_stock
{
weight = 4;
}; |
/*
Taj Mahal is one of the seven wonders of the world. Aahad loves to travel places and wants to visit Taj Mahal.
He visited Agra to view Taj Mahal. There is a ticketing system at Taj Mahal.
There are total ‘n’ windows which provide the tickets to get entry into Taj Mahal.
There are ‘Ai’ people already present at eac... |
/*
By downloading, copying, installing or using the software you agree to this license.
If you do not agree to this license, do not download, install,
copy or use the software.
License Agreement
For Open Source Computer Vision Library
(3-clause B... |
#include "WaterColorCanvas.h"
WaterColorCanvas::WaterColorCanvas() {
noiseShader.load("shader.vert", "simplexNoise.frag");
waterBleedingShader.load("shader.vert", "waterBleeding.frag");
waterRenderShader.load("shader.vert", "waterRender.frag");
pigmentFixShader.load("shader.vert", "pigmentFix.frag");
... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* @author Patricia Aas (psmaas)
*/
#include "core/pch.h"
#include "platforms/viewix/... |
// -*- 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.
//
// shuais
//
#ifndef __REDIRECTION_MANAGER_H__
#define __REDIRECTION_M... |
/* leetcode 11
*
*
*
*/
class Solution {
public:
int maxArea(vector<int>& height) {
int l, r, width, minIdx;
l = 0;
r = height.size() - 1;
int maxArea = 0;
while(l < r) {
if (height.at(l) < height.at(r)) {
width = r - l;
maxArea... |
#include<cstdio>
#include<algorithm>
using namespace std;
struct baka9
{
int h;
int s1;
}c[5002];
bool cmp(baka9 a,baka9 b)
{
if(a.s1<b.s1)
return true;
return false;
}
int main()
{
int n,s,a,b;
scanf("%d%d%d%d",&n,&s,&a,&b);
for(int i=0;i<n;i++)
{
scanf("%d%d",&c[i].h,&c[i].s1);
... |
// @before-stub-for-debug-begin
#include <vector>
#include <string>
#include "commoncppproblem300.h"
using namespace std;
// @before-stub-for-debug-end
/*
* @lc app=leetcode.cn id=300 lang=cpp
*
* [300] 最长上升子序列
*/
// @lc code=start
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
c... |
vector<int> nCr(int n) {
vector<int> dp(n + 1, 0);
dp[0] = dp[1] = 1;
for (int i = 2; i <= n; i++) {
dp[i] = dp[i - 1] * i;
}
return dp;
}
vector<int> Solution::getRow(int k) {
vector<int> dp = nCr(k);
vector<int> ans;
for (int i = 1; i <= r ; i++) {
int nCr = 1;
... |
#pragma once
namespace ariel{
enum class Unit{
KM,M,CM,
HOUR,MIN,SEC,
TON, KG, G
};
} |
/*
calculator08buggy.cpp
Helpful comments removed.
We have inserted 3 bugs that the compiler will catch and 3 that it won't.
*/
#include "Consts.h"
#include "std_lib_facilities.h"
#include "Token.h"
#include "Variable.h"
#include "Structure.h"
using namespace std;
void calculate()
{
while (true)
... |
//
// Created by OLD MAN on 2020/2/27.
//
//密文\A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
//
//明文\V W X Y Z A B C D E F G H I J K L M N O P Q R S T U
#include <iostream>
using namespace std;
string sec(string x){
for (int i = 0; i < x.length(); ++i) {
if (x[i]+21 > 90){
x[i]= (x[i]+21)... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2005 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 "SecurityProtocolsDialog.h"
//#inc... |
#include "brickstest.hpp"
#include <bricks/core/autopointer.h>
#include <bricks/core/exception.h>
#include <bricks/audio/ffmpegaudiodecoder.h>
#include <bricks/io/filestream.h>
using namespace Bricks;
using namespace Bricks::IO;
using namespace Bricks::Audio;
class BricksAudioFFmpegTest : public testing::Test
{
prot... |
// Created on: 1996-12-25
// Created by: Alexander BRIVIN
// Copyright (c) 1996-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 G... |
#include<stdio.h>
#include"mpi.h"
int main(void)
{
int rank,value,size;
MPI_Status status;
MPI_Init(NULL,NULL);
MPI_Comm_rank(MPI_COMM_WORLD,&rank);
MPI_Comm_size(MPI_COMM_WORLD,&size);
do{
if(rank==0){
fprintf(stderr, "\nplesase give new value = ");
scanf("%d",&value);
fprintf(stderr,... |
// hijackfuns.cc
// 6/3/2015 jichi
#include "hijack/hijackfuns.h"
#include "hijack/hijackhelper.h"
#include "hijack/hijacksettings.h"
#include "hijack/hijackmanager.h"
#include "engine/enginedef.h"
#include "engine/enginehash.h"
#include "engine/enginecontroller.h"
#include "util/dyncodec.h"
#include "util/textutil.h"
... |
#include "waterdragon.h"
#include "observerlist.h"
WaterDragon::WaterDragon(SDL_Surface *s, int x, int y)
: AISprite(s,x,y)
{
Position *p = new Position(100,100,0);
addTarget(*p);
moving(this);
}
WaterDragon::WaterDragon()
{}
WaterDragon::~WaterDragon()
{}
void WaterDragon::update(Observerlist *l)
{
}
voi... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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.
*/
#ifndef VEGARASTERIZER_H
#define VEGAR... |
/* -*- 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.
*
*/
#ifndef EXTENSION_BUTTON_COMPOSITE_H
#define EXTENSION_BUTTON_... |
#ifndef PLAYER_H
#define PLAYER_H
#include <json/json.h>
#include <string.h>
#include <time.h>
#include <stdint.h>
#include "GameLogic.h"
#include "HallHandler.h"
#include "PlayerTimer.h"
using namespace std;
const int GAME_PLAYER = 5;
#define STATUS_TABLE_CLOSE -1 //桌子关闭
#define STATUS_TABLE_EMPTY 0 //桌子空
#define ... |
#include <iostream>
#include <climits>
using namespace std;
#define N 150010
#define FASTIO \
ios_base::sync_with_stdio(false); \
cin.tie(0); \
cout.tie(0);
#define INF INT_MAX
#define pb push_back
#define x first
#define y second
typedef long long ll;
typedef p... |
#include "sdk_init.hpp"
#define APPLICATION_NAME "oss-rtld"
#define APPLICATION_NAME_LEN 8
struct ApplicationName {
int unknown;
int name_lengh;
char name[APPLICATION_NAME_LEN + 1];
};
__attribute__((section(".rodata.module_name")))
ApplicationName application_name = {
.unknown = 0, .name_lengh = APP... |
#include "./platform/UnitTestSupport.hpp"
#include <Dot++/Exceptions.hpp>
#include <Dot++/NullConstructionPolicy.hpp>
#include <Dot++/lexer/TokenInfo.hpp>
#include <Dot++/parser/states/ReadVertexAttributeEqualState.hpp>
namespace {
using namespace dot_pp::lexer;
using namespace dot_pp::parser;
... |
#ifndef PCH_H
#define PCH_H
#include <string>
#include <iostream>
#include <cstdint>
#include <vector>
#include "core/Hash.h"
#include "core/NativeEngine.h"
#include "core/NativeNames.h"
#include "alt-log.h"
#define DLL_EXPORT __declspec(dllexport)
using namespace alt;
#endif //PCH_H
|
#include "StdAfx.h"
#include "Dialog.h"
//#include "KEGIESView.h"
BEGIN_MESSAGE_MAP(dialogVoxel, CDialog)
ON_BN_CLICKED(IDC_BUTTON1, &dialogVoxel::OnBnClickedButton1)
ON_EN_CHANGE(IDC_EDIT1, &dialogVoxel::OnEnChangeEdit1)
END_MESSAGE_MAP()
Dialog::Dialog()
{
}
Dialog::~Dialog()
{
}
void dialogVoxel::DoDataExcha... |
#include <iostream>
#include <cstdio>
#include <vector>
#include <set>
using namespace std;
void ReadGraph(char file[], Graph &G) {
int V;
bool isDigraph = false;
FILE *src = fopen(file,"r");
// First 4 lines
char line[200];
fscanf(src,"%[^\n]\n",line);
if (line[2]=='D') isDigraph = true;
fscanf(src,"%*[^\... |
//-----------------------------------------------------------------------------------------------------------
// GAME AESTHETICS: Array Review part 1
//-----------------------------------------------------------------------------------------------------------
// its super important that we understand these basics.
// o... |
#pragma once
#include <QWidget>
#include "Entities/Question/Question.h"
#include "Forms/FormulationForm/FormulationForm.h"
#include "Forms/AnswerOptionsContainer/AnswerOptionsContainer.h"
class QuestionForm : public QWidget {
Q_OBJECT
public:
explicit QuestionForm(const uint& number,
... |
#pragma once
#include "global.h"
#ifndef DRAWING_H
#define DRAWING_H
enum class SpriteType {LINE, TRIANGLE, RECT, TEXTURE, CIRCLE};
//struct SpritePoint {
// float X, Y;
// float Weight;
// Velocity Velocity;
// Color Color;
// SpritePoint (float X = 0, float Y = 0) : X(X), Y(Y) {}
//};
//SPRITE CLASS
class Sprite {... |
/*
Name: 如何添加运算符
Copyright:
Author: Hill bamboo
Date: 2019-08-19 13:37
Description: 小米
*/
#include <bits/stdc++.h>
using namespace std;
int n, t;
int ans;
void solve(int pos, int now, int buf) {
if (pos >= n + 1 && now == t) {
printf("pos = %d, now = %d, buf = %d\n", pos, now, buf);
cout << now <... |
// MpegTSAnalyser.cpp : Defines the entry point for the console application.
//
#include "Source.hpp"
#include <iostream>
int main()
{
LibMpegTS::Source source;
source.load<LibMpegTS::Source::FILE>("resource/00.ts");
const uint32_t dataSize = 50;
uint8_t* pData = new uint8_t[dataSize];
const uint32_t sizeWritt... |
#include "SquareDensityBrush.h"
SquareDensityCubeBrush::SquareDensityCubeBrush(int brushSize)
{
_brushSize = brushSize;
}
void SquareDensityCubeBrush::UpdateDensityCube(UberCube* cube, int x, int y, int z)
{
cube->mDensityCube[x][y][z] = true;
for(int i=0; i < _brushSize / 2; ++i)
{
cube->mD... |
#include <iostream>
#include <vector>
#include <cstring>
#define MAX 100001
using namespace std;
bool foundLoop, visited[MAX];
vector<pair<int, int>> loopEdges;
vector<int> edges[MAX];
vector<int> setNumber(MAX);
void dfs(int parent, int source)
{
visited[source] = true;
for (auto dest : edges[source])
{
... |
/* XMRig
* Copyright 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright 2016-2020 XMRig <https://github.com/xmrig>, <support@xmrig.com>
*
* 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 Fr... |
#ifndef _DCUdataToCondDB_hh_
#define _DCUdataToCondDB_hh_
#ifdef USE_CONDDB
#include "DCUCondDBInterface.hh"
#endif
#include <string>
class DCUdataToCondDB
{
public:
DCUdataToCondDB(int FedId, const std::string& SMName,const std::string CondDBpwd );
~DCUdataToCondDB();
const std::string& getName() const { r... |
#include <iostream>
#include <cmath>
#include <string>
using namespace std;
int main() {
string s; cin >> s;
int ans = 1000000;
for (int i = 0; i < s.length() - 2; i++) {
int a = s[i] - '0';
int b = s[i + 1] - '0';
int c = s[i + 2] - '0';
int x = 100 * a + 10 * b + c;
... |
#pragma once
#include <vector>
#include <string>
namespace RomanNumeralTest
{
std::vector<std::string> td_invalidRomanNumerals = {
"ABC",
"123",
"IC",
"IXX",
"XDC",
"iv",
"Once Upon A Midnight Dreary",
"",
"0W0",
};
std::vector<std::pair<int, std::string>> td_validValues = {
{1, "I"},
{2, "II... |
#ifndef DATA_STRUCTURES_H
#define DATA_STRUCTURES_H
#include <cstdint>
const uint32_t COLUMN_USERNAME_SIZE = 32;
const uint32_t COLUMN_EMAIL_SIZE = 255;
struct Row {
uint32_t id;
char username[COLUMN_USERNAME_SIZE];
char email[COLUMN_EMAIL_SIZE];
};
#endif
|
#include<iostream>
using namespace std;
//worst case o((n-m+1)*m)
//IDEA: calculate hash of the pattern. Then calculate hash of every window using rolling hash
//keep comparing the hash. If hash matches confirm that its not a superious hit by matching the pattern to window
void karp(char text[],int n,char pat[],int m... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2011-2012 Bryce Adelstein-Lelbach
//
// 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... |
#include "Gpio.h"
#include <Arduino.h>
using namespace Codingfield::Brew::Actuators::Relays;
Gpio::Gpio(int pin, States initialState) : Relay(initialState) {
this->pin = pin;
pinMode(pin, OUTPUT);
digitalWrite(pin, StateToHighLow(state));
}
States Gpio::State() const {
return state;
}
void Gpio::State(State... |
#include<iostream>
#include<cstdio>
#include<string.h>
#include<malloc.h>
using namespace std;
struct box{
char *imprint=(char*)malloc(10010*sizeof(char));//修改的这解决了1
int num;
};
int match(char*a,char*b,int result,int n){
for(int i=0;i<n;i++){//2:‘n’在此作用域中尚未声明
if(b[i]==a[0]){
int num=i;
int sign=9;
... |
#include<iostream>
using namespace std;
#include<string>
//#include "Colors.h"
#include<fstream>
#include<iomanip>
#include <map>
#include "Instruction.h"
#include "R_Instructions.h"
#include "I_Instructions.h"
map<string, Instruction*> instructions;
void init() {
//R Type
instructions.insert(make_pair("0000000000... |
#include<iostream>
#include<string>
#include<vector>
#include<iterator>
#include<unordered_map>
#include <climits>
#include<stdio.h>
using namespace std;
char getchlin()
{
char c;
char test;
scanf("%c",&c);
return (c);
}
void Time(string processes[], int n,int bt[], int wt[], int quantum, int tat[])
{
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.