text stringlengths 8 6.88M |
|---|
/*
* Copyright 2019 LogMeIn
*
* 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 w... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
#define showm(m) for(auto i: m){cout << m.x << " ";}
typedef long long ll;
typedef pair<int, int> P;
int main()
{
string s;
cin >> s;
... |
#include "spawnEvent.h"
spawnEvent::spawnEvent(GameObject a, GameObject b) {
this->a = a;
this->b = b;
}
GameObject spawnEvent::getObjA() {
return a;
}
GameObject spawnEvent::getObjB() {
return b;
}
eventType spawnEvent::getType() {
return spawnEvent_type;
}
char spawnEvent::getKeyPress() {... |
/* -*- Mode: c++; tab-width: 4; 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.
*
* @author Arjan van Leeuwen (arjanl)
*/
#ifndef ASYNC_QUEUE_H
#define ASYNC_QUEUE_H
... |
#ifndef AOC_5_H
#define AOC_5_H
#include <vector>
#include "Classes/IntCodeCPU/IntCodeCPU.h"
namespace AoC_5 {
long long AB(std::vector<long long> program, long long systemID) {
IntCodeCPU computer(program);
computer.Input(systemID);
computer.RunToEnd();
return computer.Output();
... |
#include <string>
#include <vector>
#include <array>
#include <cstring>
#include <sstream>
#include "searchpool.hpp"
using namespace std;
namespace search {
SearchPool::SearchPool() {
this->charMap = vector<string>();
}
SearchPool::SearchPool(int rows, const char* blob ) {
int cols = strlen(blob) / rows;
... |
#include "Deck57.hpp"
Deck57::Deck57() :Deck56(){
//Jeu de 56 + Joker
const Card Joker = Card ();
(*this)+=Joker;
}
|
#ifndef FATE_H
#define FATE_H
#include <string>
#include <vector>
#include "BigInt.h"
class CSkill;
class CMonster;
class CFate
{
friend class CConfig;
public:
~CFate();
void init();
CSkill* getSkill(int nIndex) { return m_oSkills[nIndex]; }
int getSkillCount() { return (int)m_oSkills.size(); }
... |
#ifndef CAMERA_H
#define CAMERA_H
#include "core/object.h" // Base class: Object
namespace pb
{
class Camera : public Object
{
private:
Camera(const Camera& rhs);
Camera& operator=(const Camera& rhs);
public:
Camera();
virtual ~Camera();
inline const Mat4& VP();
private:
PBError init()... |
#include "Bragg.h"
#include "ParamConfig.h"
#include "Utility.h"
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
#include <TFile.h>
#include <TNtuple.h>
#include <TDirectory.h>
#include <TH1.h>
#include <TH2.h>
#include <TH3.h>
#include <TCut.h>
#include <TF1.h>
#include <TParameter.h>
... |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */
#include "core/pch.h"
#include "modules/ecmascript/carakan/src/es_pch.h"
#include "modules/ecmascript/carakan/src/object/es_special_property.h"
#include "modules/ecmascript/carakan/src/object/es_object.h"
#incl... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2006-2007 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/pref... |
/***************************************************************************//**
* \brief
* \copyright Michael Coutlakis 2021
* \license MIT License, see the LICENSE file.
*******************************************************************************/
#pragma once
#include <flatbuffers/flatbuffers.h>
#include <boost... |
#ifndef ARRAY_H
#define ARRAY_H
#include "Punto.h"
using namespace std;
class PointArray{
private:
Punto *points;
int _size;
void resize(const int x);
public:
PointArray();
PointArray(const Punto points[], const int _size);
PointArray(const PointArray &p);
~PointArray();
... |
#pragma once
class CSamplerState : Noncopyable
{
public:
CSamplerState();
~CSamplerState();
bool Create(const D3D11_SAMPLER_DESC& desc);
/*!
* @brief 明示的な開放処理。
*/
void Release()
{
if (m_samplerState != nullptr) {
m_samplerState->Release();
m_samplerState = nullptr;
}
}
/*!
* @brief サンプラステートを取得。
*/... |
// Author : chenwj
// Time : 2017/1/16
// Copyright :All rights reserved by chenwj @copyright 2017 ~ 2018.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the License file.
////////////////////////////////////////////////////////////////////////
#ifndef _CODE_H_
#define _COD... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
#include "core/pch.h"
#ifdef _PNG_SUPPORT_
#include "modules/zlib/zlib.h"
#include "modules/minpng/minpng.h"
#include "modules/minpng/png_int.h"
#ifndef MINPNG_NO_GAMMA_SUPPORT
static void _set_gamma(float gamma, minpng_state* s)
{
int i;... |
/// Include the header file created for this assignment
#include "TicTacToe.h"
/**
* @brief This is the main function to run the game
*
*/
int main(){
// Utilize srand and time to seed the random number generator
srand(time(0));
// Create a humanPlayer instance
humanPlayer Tony("Tony");
// Crea... |
/*
* cDiInfo - An application to get information via the Windows SetupDi... APIs
* Charles Machalow - MIT License - (C) 2016
* Registry.cpp - Windows Registry interfacing implementation file
*/
// Local includes
#include "Registry.h"
namespace cdi
{
namespace registry
{
bool getStringFromRegistry(HKEY... |
#include "CSoftInstallResultSendTh.h"
#include "Markup.h"
#include "CClientLog.h"
#include "NetClass.h"
#include "CMessageEventMediator.h"
#include "NetClt.h"
#include "CMessageDataMediator.h"
#include "CMisc.h"
#include <QtCore/QCoreApplication>
CSoftInstallResultSendThread::CSoftInstallResultSendThread(QObject *paren... |
#ifndef __DLGSELECTCLS_CTRLPNL_H
#define __DLGSELECTCLS_CTRLPNL_H
#include "VObjCatalogCtrl.h"
namespace wh{
class CatDlg:
public wxDialog
,public ctrlWithResMgr
{
public:
typedef std::function<bool(const wh::rec::Cls*,const wh::rec::Obj*)> TargetValidator;
CatDlg(wxWindow* parent,
wxWindowID id = wxID_ANY,... |
#include <Arduino.h>
#include "xfm2.h"
#include "XFM2_vars.h"
int program=0;
void change_unit() {
// Default to unit 1
if (active_unit == 1) {
active_unit = 2;
//swap unit params
//or do 2 memcpy's
for(int i=0;i<n_params;i++) {
unit1_params[i]=params[i];
par... |
#include <stdio.h>
int main() {
float tank = 20;
float avgMPGrd = 21.5;
float avgMPGhwy = 26.8;
float distRd = tank*avgMPGrd;
float distHwy = tank*avgMPGhwy;
printf("Distance on road: %f\nDistance on High-way: %f\n", distRd,distHwy);
return 0;
}
|
#include <conio.h>
#include <iostream.h>
#include <stdio.h>
#include <salman.h>
#include <main.h>
void main () {
int op,op1,op2,op3,op4;
// Start of Main while
clrscr();
cout <<"\n\t\tOPTIONAL SOFTWARE\n";
Main1();
cout <<"\n\n\tEnter your choice: ";
cin >>op;
while (op!=4) {
switch (op) {
... |
#include <Drawables/Mesh.h>
CMesh::CMesh(const std::vector<SVertex> &vertices, const std::vector<unsigned> &indices)
: CIndexedDrawable(GL_TRIANGLES, static_cast<GLsizei>(indices.size()), GL_UNSIGNED_INT)
{
updateVertices(vertices.size() * sizeof(SVertex), vertices.data(), GL_STATIC_DRAW);
for (unsigned j ... |
//: C11:PmemFunDefinition.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
class Simple2 {
public:
int f(float) const { return 1; }
};
int (Simple2::*fp)(float) const;
int (Simple2::*fp2... |
//
// Created by 史浩 on 2020-01-12.
//
#include "BaseEGLSurface.h"
BaseEGLSurface::BaseEGLSurface(EGLCore *eglCore) {
this->mEGLCore=eglCore;
this->mEGLSurface=EGL_NO_SURFACE;
mWidth=-1;
mHeight=-1;
}
BaseEGLSurface::~BaseEGLSurface() {}
void BaseEGLSurface::createWindowSurface(ANativeWindow *window) {... |
#pragma once
#include "mt4part\MT4ServerEmulator.h"
#include "BaseExecutionSignal.h"
class OpenOrderSignal : public BaseExecutionSignal
{
public:
OpenOrderSignal();
OpenOrderSignal(int login, std::string symbol, double volume, int cmd, std::string comment, MT4Server* server, double commission);
~OpenOrderSignal(voi... |
#pragma once
#include "DynamicObjectController.h"
#include "DynamicObjectModel.h"
#include "DynamicObjectLogicCalculator.h"
#include "DynamicObjectView.h"
#include "Vector4.h"
#include "LevelModel.h"
#include "LevelView.h"
class DynamicObjectFactory
{
public:
static DynamicObjectController* create(LevelModel* levelMo... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
/* Citation and Sources...
Final Project Milestone 1
Module: Menu
Filename: Menu.h
Version 1.0
Author John Doe
Revision History
-----------------------------------------------------------
Date Reason
2020/11/13 Preliminary release
2020/11/13 Debugged DMA
-----------------------------------------------... |
#pragma once
#include "Module.h"
#include "p2List.h"
#include "p2Point.h"
#include "Globals.h"
#include "ModuleTextures.h"
class PhysBody;
struct Sprite;
class ModuleSceneIntro : public Module
{
public:
ModuleSceneIntro(Application* app, bool start_enabled = true);
~ModuleSceneIntro();
bool Start();
update_stat... |
class WoodenGate_ghost_DZ: NonStrategic
{
scope = 2;
displayName = $STR_BLD_name_WoodenGate_1_ghost;
model = "z\addons\dayz_buildings\models\gates\gate_wood_ghost.p3d";
armor = 1000;
};
class WoodenGate_foundation_DZ: DZE_Housebase
{
scope = 2;
displayName = $STR_BLD_name_WoodenGate_Foundation;
model = "z\add... |
/******************************************************************************
Fichier: fichiers.cpp
Auteur: William Fecteau et Jordan Gagnon
Utilité: Implémentation des fonctions permettant de gérer les fichiers
"./mtg.txt" et "./nom_carte.index"
****************************************************************... |
#ifndef __CTRL_UNDO_H
#define __CTRL_UNDO_H
#include "CtrlWindowBase.h"
#include "IViewUndo.h"
#include "ModelUndo.h"
namespace wh{
//-----------------------------------------------------------------------------
class CtrlUndoWindow final : public CtrlWindowBase<IViewUndoWindow, ModelUndoWindow>
{
sig::scoped_conne... |
#include "global.h"
float ***v,***at;
bool SHOW_INFO = false;
bool SAVE_AT_INTERFACE = false;
bool INIT_AT_INTERFACE = false;
void process_args(int argc,char* argv[]) {
if (argc < 5) {
cout<<"a TEST or WRONG input params:"<<endl;
cout<<argc<<endl;
for (int i=0;i<argc;i++)
cout<<argv[i]<<endl;
argv[... |
// Copyright 2017 Google Inc. All rights reserved.
//
// 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 limitation the
// rights to use, copy, modify, ... |
#include "mutantstack.hpp"
# include <iostream>
# include <list>
int main()
{
MutantStack<int> mstack;
std::cout << "-Push: 5\n";
mstack.push(5);
std::cout << "-Push: 17\n";
mstack.push(17);
std::cout << "at TOP: " << mstack.top() << std::endl;
std::cout << "-Pop\n";
mstack.pop();
std::cout << "Stack size: "<... |
#pragma once
#include "Scene.h"
#include "TextField.h"
#include "Button.h"
class LevelEditorSkyboxLoader {
public:
enum SKYBOX_LOCATION {TOP = 0, BOTTOM = 1, LEFT = 2, RIGHT = 3, FRONT = 4, BACK = 5};
LevelEditorSkyboxLoader(Scene &scene, Font &font);
virtual ~LevelEditorSkyboxLoader();
void setVisibl... |
//
// Camera.h
// Odin.MacOSX
//
// Created by Daniel on 04/06/15.
// Copyright (c) 2015 DG. All rights reserved.
//
#ifndef __Odin_MacOSX__Camera__
#define __Odin_MacOSX__Camera__
#include "Math.h"
namespace odin
{
namespace render
{
class Camera
{
public:
... |
#include<cstdio>
#include<ctype.h>
#define R register
//==================================================
struct node
{
int x,y;
}a[15];
int n,ans;
bool vis[15];
//==================================================
inline int read()
{
int fl=1,w=0;char ch=getchar();
while(!isdigit(ch)) if(ch=='-') {fl... |
#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 <iostream>
#include <string>
#include "SeatUpholstery.hpp"
#pragma warning (disable:4996)
SeatUpholstery::SeatUpholstery(): color(colors::black)
{
this->product_name = product::seatUpholstery;
}
SeatUpholstery::SeatUpholstery(const std::string& mark, const double& price, const unsigned int& count, const col... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#include "module... |
#include "sphere.h"
sphere::sphere() {
}
sphere::~sphere() {
}
//--------------------------------------------------------------
void sphere::setup(int posX, int posY, int posZ, int size) {
sphereRadius = size;
sphereRes = 3;
spherePulse = 0;
ofSetSphereResolution(sphereRes);
s... |
#pragma once
#include "EdushiPipeline.h"
#include "AppFrameWork2.h"
#include "CarSimulation.h"
#include "InteractionControler.h"
#include "GUIWrapper.h"
#include "socketSceneLoader\SceneLoader.h"
using namespace Block;
struct EdushiConfig {
Vector3 cameraPos;
Vector3 cameraUp;
Vector3 LookCenter;
bool cameraReset... |
#ifndef __BOX_HPP__
#define __BOX_HPP__
class Box {
private:
int id;
public:
Box();
Box(int);
Box(const Box&);
Box& operator=(const Box&);
~Box();
void peek();
};
#endif
|
#include<bits/stdc++.h>
using namespace std;
main()
{
char s1[300], s2[300], s3[300];
while(cin>>s1>>s2)
{
int j=0;
int len = strlen(s2);
for(int i=len-1; i>=0; i--)
{
s3[j] = s2[i];
j++;
}
s3[j] = '\0';
if(strcmp(s1, s3)==0)
... |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
class TheSimilarNumbers {
public:
int find(int lower,int upper)
{
int count = 0;
int countFromUpper = 0;
int countFromLower = 0;
int work = upper;
while (work > lower) {
++countFromUpper;
work /= 10;
}
work = lower;... |
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const ull base=131;
const ull mod=212370440130137957ll;
ull a[10005];
char s[10005];
ull Hash(char s[]){
int i;
ull ans=0;
for(i=0;s[i];i++)
ans=(ans*base+(ull)s[i])%mod;
return ans;
}
|
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <sstream>
#include <iterator>
#include <regex>
using namespace std;
struct Bus {
int id;
int idx;
Bus(int id, int idx) : id(id), idx(idx){}
};
using ull = unsigned long long;
using ll = long long;
ull extendedEuclidean(ull... |
/* -*- 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 DROPZONE_ATTRIBUTE_H
#define DROPZONE_ATTRIBUTE_H
#ifdef DRAG... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005-2011 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
*/
#if !defined OPCONSOLEENGINE_H && defined O... |
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <string>
#include <cstdio>
#include <cstring>
#include <climits>
#include <set>
using namespace std;
int main() {
int n;
cin >> n;
vec... |
//知识点:模拟
/*
By:Luckyblock
题目要求:
进行区间矩阵修改,所有修改完成后,查询单点权值
发现询问是离线的,并且只有一次
所以可以将修改操作也进行离线处理 ,
对于区间矩阵修改,
只需要判断它对查询单点有无影响即可
如果矩阵覆盖了 单点,
那么将单点的权值,更改为修改后的权值
*/
#include<cstdio>
#include<ctype.h>
const int MARX = 1e5+10;
//=============================================================
int x,y,n,p=-1, a[... |
/*
* 题目:203. 移除链表元素
* 链接:https://leetcode-cn.com/problems/remove-linked-list-elements/
* 知识点:链表的遍历与节点删除
*/
class Solution {
public:
ListNode* removeElements(ListNode* head, int val) {
ListNode *tHead = new ListNode();
tHead->next = head;
ListNode *p = tHead;
while (p != nullptr &... |
#pragma once
class CUserManager : public CMultiThreadSync<CUserManager>
{
public:
CUserManager();
~CUserManager();
private:
std::vector<CUserSession*> m_UserSessionVector;
SOCKET m_ListenSocket;
public:
BOOL Begin(DWORD maxUserCount, SOCKET listenSocket);
BOOL End(VOID);
BOOL AcceptAll(VOID);
BOOL Wri... |
#pragma once
//======================================================================
#include <upl/common.hpp>
#include <upl/definitions.hpp>
#include <set>
#include <unordered_map>
#include <utility>
//======================================================================
#ifdef __GNUG__
/*
* GCC seems to not ... |
// Author: Kirill Gavrilov
// Copyright (c) 2016-2019 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 So... |
#include <iostream>
#include "cqueue.h"
#include <string.h>
using namespace std;
CQueue::CQueue() //constructor
{
front=MAX-1;
rear=MAX-1;
}
bool CQueue::IsEmpty()
{
bool emp;
if(front == rear)
emp= 1;
else emp=0;
return emp;
}
bool CQueue::IsFull()
{
bool ful;
if((rear+1)%MAX == f... |
#include "stdafx.h"
#include "ModifyDialog.h"
ModifyDialog::ModifyDialog(int row, QString num, QWidget* parent)
: QDialog(parent)
{
ui.setupUi(this);
m_sqlOprtor = new SQLiteOperator(this);
m_row = row;
m_oUser = m_sqlOprtor->queryTable(num);
m_nUser = m_sqlOprtor->queryTable(num);
ui.edit_name... |
//
// Created by Cristian Marastoni on 23/04/15.
//
#include "Debug.h"
#include <stdarg.h>
#include <stdio.h>
void Debug::Log(const char *ctx, const char *fmt, ...) {
va_list va;
va_start(va, fmt);
vprintf(fmt, va);
va_end(va);
}
void Debug::Error(const char *ctx, const char *fmt, ...) {
va_list ... |
/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <quic/server/async_tran/QuicServerAsyncTransport.h>
#include <folly/Conv.h>
namespace quic {
void QuicServerAsyncTran... |
#include <bits/stdc++.h>
using namespace std;
#define MAX 1000
Class Stack{
int top;
public:
int a[MAX];
Stack(){ top = -1; }
bool push(int x);
int pop();
bool isEmpty();
}
bool Stack::push(int x){
if(top
}
|
#include <stdio.h>
int main()
{
int remain=0;
int reverse=0.0;
int num;
printf("enter numbers\n");
scanf("%d",&num);
while(num !=0)
{
remain = num % 10;
reverse = reverse * 10 + remain;
num /=10;
}
printf("here is the reverse: %d\n",reverse);
return 0;
}
|
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
using namespace std;
string IsTriangle(int a, int b, int c)
{
return "Error";
}
|
#ifndef COMMANDE_H
#define COMMANDE_H
#include <QWidget>
#include <clienttcp.h>
namespace Ui {
class commande;
}
class commande : public QWidget
{
Q_OBJECT
public:
explicit commande(QWidget *parent = 0);
~commande();
int number;
void connexion();
private slots:
void on_pushButton_ca... |
/**
* created: 2013-4-7 0:15
* filename: FKClass
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#include <string.h>
#include <stdlib.h>
#include "../Include/FKLogger.h"
#include "../Include/RTTI/FKReflect.h"
//-------------------... |
#pragma once
#include <string>
namespace Codingfield {
namespace Brew {
namespace Actuators {
namespace Relays {
enum class States { Unknown, Open, Closed };
class Relay {
public:
Relay(States initialState);
virtual ~Relay() = default;
virtual States... |
#include<iostream>
using namespace std;
int main() {
const int a = 0;
int b = 3, c = 7;
int result = a + b + c;
cout << result << endl;
a = result; // Считается ошибкой, т.к. константы не перезаписываются
cout << a << endl;
return 0;
} |
/* XMRig
* Copyright 2010 Jeff Garzik <jgarzik@pobox.com>
* Copyright 2012-2014 pooler <pooler@litecoinpool.org>
* Copyright 2014 Lucas Jones <https://github.com/lucasjones>
* Copyright 2014-2016 Wolf9466 <https://github.com/OhGodAPet>
* Copyright 2016 Jay D Dee <jayddee246@gmail.com>
* C... |
//
// Created by fab on 27/02/2020.
//
#ifndef DUMBERENGINE_WORLD_HPP
#define DUMBERENGINE_WORLD_HPP
#include "Chunk.hpp"
#include "../IComponent.hpp"
#include "../../rendering/helper/Shader.hpp"
#include "../../rendering/renderer/opengl/Texture2D.hpp"
#include "../../debug/CubeDebug.hpp"
class World : public ICompo... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* 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.
*/
#ifndef DOM_DOMCALLLSTATE_H
#define DOM_DOMCALLLSTATE_H
#inclu... |
// Copyright 2015 Intelligent Robotics Group, NASA ARC
#include <handrail_detect/handrail_detect_general.h>
namespace handrail_detect_node {
HandrailDetect::HandrailDetect(ros::NodeHandle* nh, ros::NodeHandle* private_nh) {
srand (time(NULL));
std::cout<<std::fixed;
std::cout.precision(3);
const float pi = ... |
/*******************************************************************************
* filename: CMatrix.hpp
* description: Adapter class for a unified matrix interface
* author: Moritz Beber
* created: 2010-04-12
* copyright: Jacobs University Bremen. All rights reserved.
******************************... |
#include <bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
string ans = "";
for(int i=0; i<s.size(); i++){
string tmp = "";
for(int j=i; j<s.size(); j++){
string t = (string() + s[j]);
if(t == "A" || t == "C" || t == "G" || t == "T")... |
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int n,ctr=-1;
cout<<"Enter the number N\n";
cin>>n;
int l=sqrt(n);
int r;
r=l%10;
for(int i=0;i<r;i++)
ctr++;
cout<<"Integers less than N in the sample space is "<<ctr;
return 0;
} |
#include <bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
#define tests int t; cin >> t; while(t--)
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
using namespace std;
void solve() {
int n, m, k; cin >> n >> m >> k;
string s[n];
for(int i = 0; i < n; i++) {
cin >> s[i];
}... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const double PI = 3.14159265358979323846;
const ll MOD = 1000000007;
int main(){
char X;
cin >> X;
string S;
cin >> S;
for(int i = 0; i <... |
#define MAX_INT 10000001
#define MAX_NUM 500000
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main(){
int sort(int *points,int n);
int dichotomyleft(int *points,int e,int righ);
int dichotomyright(int *points,int e,int righ);
static int points[MAX_NUM];
static int borders_a[MAX_NUM];
... |
int data;
int en=12;
int in1=11;
int in2=10;
void setup() {
Serial.begin(9600);
pinMode(en,OUTPUT);
digitalWrite(en,HIGH);
pinMode(in1,OUTPUT);
pinMode(in2,OUTPUT);
digitalWrite(in1,LOW);
digitalWrite(in2,LOW);
}
void loop() {
while(Serial.available())
{
data=Serial.read();
... |
// Copyright (c) 2019 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 special ... |
#include "SM_Math.h"
#include <string.h>
namespace
{
float i2f(unsigned int i)
{
float ret;
memcpy(&ret, &i, sizeof(float));
return ret;
}
}
namespace sm
{
// from glm
float f16_to_f32(unsigned short value)
{
int s = (value >> 15) & 0x00000001;
int e = (value >> 10) & 0x0000001f;
int m = value & 0x0... |
#include "Cylinder.h"
Cylinder::Cylinder(Point3 c, Point3 t, Point3 s, float th) :center(c), tilt(t), shape(s), theta(th)
{
colour = color + BLACK;
}
Cylinder::Cylinder()
{
colour = color + BLACK;
theta = 0;
}
Cylinder::~Cylinder()
{
}
void Cylinder::Draw()
{
glPushMatrix();
//set the... |
isalnum() 如果参数是字母或者数字
isalpha() 如果参数是字母
iscntrl() 如果参数是控制字符
isdigit() 如果参数是数字(0~9)
isgraph() 如果参数是除空格之外的打印字符
islower() 如果参数是小写字母
isprint() 如果参数是打印字符(包括打印字符)
ispunct() 如果参数是标点符号
isspace() 如果参数是标准空白字符,like空格、进纸、换行符、回车、水平制表符、垂直制表符
isupper() 如果参数是大写字母
isxdigit() 如果参数是十六进制数字
tolower() 如果参数是大写字符,返回其小写,否则返回该参数
toupper() 如果参数是... |
#include "literal.h"
#include "visitor.h"
Literal::Literal() {}
Literal::~Literal() {}
CharacterLiteral::CharacterLiteral(char _val) : val(_val) {}
void CharacterLiteral::Accept(AbstractDispatcher& dispatcher) {
dispatcher.Dispatch(*this);
}
CharacterLiteral::~CharacterLiteral() {}
IntegerLiteral::IntegerLiteral... |
// -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
// should this whole module be #ifdef QUICK ?
/* Strings referenced in adjunct/desktop_util/.
*
* 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 aroun... |
#include "stdio.h"
#include "winsock2.h"
#pragma comment(lib,"ws2_32.lib")
#define SERVERIP "192.168.0.102"
#define SERVERPORT 6666
int main(){
int ret;
char sendBuf[512],recvBuf[512],file_name[512];
//存放windows socket初始化信息
WSADATA data;
SOCKET sockListen,sockTongXun;
printf("输入存储文件的文件名:\n");
scanf("%s",file_... |
#include "../SDK.h"
void ConVar::SetValue( const char* value )
{
typedef void( __thiscall* OriginalFn )( void*, const char* );
return U::GetVFunc<OriginalFn>( this, 14 )( this, value );
}
void ConVar::SetValue( float value )
{
typedef void( __thiscall* OriginalFn )( void*, float );
return U::GetVFunc<OriginalFn>(... |
#ifndef INC_SHADY_ENGINE_APPLICATION_H
#define INC_SHADY_ENGINE_APPLICATION_H
//C++ headers
#include<string>
//third party headers
#include<GL/glew.h>
#include<GLFW/glfw3.h>
namespace shady_engine
{
class application
{
protected:
GLFWwindow *mWindow;
float mWindowWidth;
float mWindowHeight;
publi... |
#pragma once
#include <iostream>
#include "VariableNode.hpp"
template<class Type>
struct VariableSingleValueNode : VariableNode<Type>
{
VariableSingleValueNode(Type & value, Type & delta)
: m_value(value)
, m_delta(delta)
{}
ArrayView<Type const> getOutputValues() const override
{
... |
#include "../SDL_main.cc"
#include <SDL2/SDL_image.h>
#include "cp_lib/basic.cc"
#include "cp_lib/array.cc"
#include "cp_lib/vector.cc"
#include "cp_lib/matrix.cc"
#include "cp_lib/memory.cc"
#include <stdlib.h>
#include <unistd.h>
#include "../draw.cc"
#include "wireframe_test.cc"
using namespace cp;
sbuff<Tuple<v... |
#include "classes.h"
Global::Global() {
xres = 1920;
yres = 1080;
mousecode = 0;
//memset(keys, 0, 65536);
}
Base::Base() {
VecZero(dir);
VecZero(vec);
VecZero(projection);
angle[0] = 90; // xy plane (360) x is right left, y is forward backwards
angle[1] = 90; // z angle (180) 0 = up, 180 = down
pos[0] = 0... |
/**
\file WalkInit.hpp
\author UnBeatables
\date LARC2018
\name WalkInit
*/
#pragma once
/*
* WalkInit inherited from BehaviorBase.
*/
#include <BehaviorBase.hpp>
/**
\brief This class is responsable for robot's walk when game starts.
*/
class WalkInit : public BehaviorBase
{
private:
st... |
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <string.h>
#include <math.h>
#include <locale.h>
#include <ctype.h>
int num[20];
int comp,a,b,mult;
int main()
{
printf("insira 20 numeros:\n");
for(a=0; a<20; a++)
{
scanf("%d", &num[a]);
}
... |
#include <CapacitiveSensor.h>
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // 10 megohm resistor between pins 4 & 2, pin 2 is sensor pin, add wire, foil
const int numReadings = 10;
const int OUTPUT_PIN = 6;
int readings[numReadings]; // the readings from the analog input
int readIndex = 0; // th... |
#include "constants.hpp"
const QString ConstantStrings::averageRatio = "averageRatio";
const QString ConstantStrings::brainCount = "brainCount";
const QString ConstantStrings::neuronPerBrain = "neuronPerBrain";
const QString ConstantStrings::loopPerCompute = "loopPerCompute";
const QString ConstantStrings::mutationFre... |
#pragma once
#include"Padre.h"
#include"PoderPersonajeA.h"
using namespace std;
using namespace System::Drawing;
class PersonajeA:public Padre
{
public:
int Energia;
int puntoH;
int puntoV;
int AnchoI;
int AltoI;
bool transparente;
public:
PersonajeA(int x, int y, Bitmap^bmp);
PersonajeA();... |
#include<iostream>
#include<algorithm>
#include<cmath>
#include<utility>
using namespace std;
struct Interval{
int st;
int et;
};
bool compare(Interval i1,Interval i2){
return i1.st < i2.st;
}
int main(){
int arr[] = {1,3,2,5,7,6};
sort(arr,arr+6);
for(int i=0;i<6;i++){
cout<<arr[i] << " ";
}
//to so... |
// PingerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Pinger.h"
#include "PingerDlg.h"
#include "sockeng.h"
#include "cbtext.h"
#include "HelpDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define DELAY 100
int gRunning=0;
int gResolving=0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.