text stringlengths 8 6.88M |
|---|
#pragma once
#include "proto/data_base.pb.h"
#include "proto/data_event.pb.h"
#include "proto/data_player.pb.h"
#include "proto/data_rank.pb.h"
#include <string>
using namespace std;
namespace pd = proto::data;
namespace nora {
namespace scene {
class role;
pd::result role_c... |
#ifndef _DtBarcoPasajeros_
#define _DtBarcoPasajeros_
#include "DtBarco.h"
#include "TipoTamanio.h"
class DtBarcoPasajeros: public DtBarco{
private:
int cantPasajeros;
TipoTamanio tamanio;
public:
//Constructores
DtBarcoPasajeros(string nombre, string id, int cantPasajer... |
// Copyright (c) Improbable Worlds Ltd, All Rights Reserved
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "UserExperienceReporter.h"
#include "NFRConstants.h"
#include "BenchmarkGymGameModeBase.generated.h"
DECLARE_LOG_CATEGORY_EXTERN(LogBenchmarkGymGameModeBase, Log, All);
... |
/*
Author: Manish Kumar
Username: manicodebits
Created: 20:47:30 04-06-2021
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define PI 3.141592653589
#define MOD 1000000007
#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(0)
#define deb(x) cout<<"[ "<<#x<<" = "<<x<<"] "
voi... |
#include "EntityList.hpp"
using namespace Elysium::Core;
Elysium::Data::Model::EntityList::EntityList(DbCommandPool* CommandPool)
: Object(),
_CommandPool(CommandPool), _Handle(_CommandPool->_EntityHandleCounter++)
{
}
Elysium::Data::Model::EntityList::~EntityList()
{
}
int Elysium::Data::Model::Entit... |
#include <ros/ros.h>
#include <ros/node_handle.h>
#include <diagnostic_updater/diagnostic_updater.h>
#include <diagnostic_updater/publisher.h>
#include <sensor_msgs/Imu.h>
#include <sensor_msgs/FluidPressure.h>
#include <geometry_msgs/Vector3Stamped.h>
#include <geometry_msgs/QuaternionStamped.h>
#include <string>
#in... |
/*****************************************************************
* 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
*************... |
#include <cinttypes>
#include <cassert>
#include <cmath>
#include "processor.h"
#include "decode.h"
#include "config.h"
#include "tcm.h"
#include <iostream>
#include <stdio.h>
#include "parameters.h"
using namespace std;
tcm_t::tcm_t(uint64_t num_entries, uint64_t assoc, uint64_t num_instr_per_cycle, uint64_t cond_b... |
#include "LM35DZ.h"
#include <fstream>
using namespace std;
double readTemp()
{
double adc_val = 0;
double temp = 0;
double temp_cal = 0;
fstream tempFile (ADC_PATH, fstream::in);
tempFile >> adc_val;
tempFile.close();
// Calibrate sensorvalue:
temp = (adc_val*1.8)/4095;
temp = (temp-0.5)*100;
temp_cal =... |
#include "DefaultHeaderFiles.h"
GameObject::GameObject()
{
isToBeDestroyed = false;
}
void GameObject::DrawTrail()
{
for (int i = 0; i < row; i++)
{
for (int j = 0; j < col; j++)
{
if (xOld + j <= BOUNDARY_LEFT ||
xOld + j >= BOUNDARY_RIGHT ||
yO... |
template <typename type> struct SparseTable {
int n ;
vector < vector < type > > T ;
vector < int > logTable ;
SparseTable(int _n = 0) : n(_n) {
logTable.assign(n + 1, 0) ;
logTable[1] = 0 ;
for (int i = 2 ; i <= n ; ++i)
logTable[i] = logTable[i >> 1] + 1 ;
T... |
//
// Profiler.h
// Odin.MacOSX
//
// Created by Daniel on 27/05/15.
// Copyright (c) 2015 DG. All rights reserved.
//
// Profiler class for CPU and GPU
// For GPU with OpenGL, OpenGL must be initialized
//
// Usage:
// {
// PROFILE("name") or PROFILE_GPU("name")
// (code...)
// }
//
#ifndef __Odin_MacOS... |
/*
* This is an ugly hack that allow us to use any of the several different
* identicon-like avatar generation scripts without any modification AT ALL!
*
* Credits for the Javascript code:
* jQuery (John Resig)
* Sizzle.js (The Dojo Foundation)
* identicon5.js (Francis Shanahan)
*/
#include "Identico... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 100005
int n;
double p[maxn];
double l[maxn];
double ans[maxn];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)
cin>>p[i];
for(int i=1;i<=n;i++){
l[i]=(l[i-1... |
#include <iostream>
using std::size_t;
//************************************************************
template<typename T, size_t SIZE> class Stack{
public:
Stack() : top(0) {}
void push(const T &elem){
elements[top++] = elem;
}
T pop(){
return elements[--top];
}
bool empty() const{
return !top;
}
pr... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2012 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 LAYOUT_CARET_SUPPORT
#include "mod... |
class Solution {
public:
vector<vector<string>> partition(string s) {
vector<vector<string> > res;
if(s.empty()) return res;
vector<string> temp;
dfs(s,0,temp,res);
return res;
}
void dfs(string s,int cur,vector<string> &temp,vector<vector<string> > &res){
if(... |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;
class String{
friend ostream& operator<<(ostream &out, const String &s);
public:
String(const char *str = ""); // constructor
String& operator=(const String &s);
String operator+(const String &s);
String& operator++();
String operator++(... |
// Created on: 2009-12-30
// Created by: Alexander GRIGORIEV
// Copyright (c) 2009-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 ... |
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistribution... |
#include <iberbar/LuaCppApis/Xml.h>
#include <iberbar/LuaCppApis/Xml_Names.h>
#include <iberbar/Lua/LuaError.h>
#include <iberbar/Lua/LuaCppBuilder.h>
#include <iberbar/Lua/LuaCppInstantiateDef.h>
#include <iberbar/Utility/String.h>
#include <iberbar/Utility/Xml/RapidXml.h>
namespace iberbar
{
namespace Xml
{
... |
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}}
#define show(x) {for(auto i: x){cout << i << " ";} cout... |
#pragma once
#include <Windows.h>
#include <gdiplus.h>
#include <conio.h>
#include <vector>
#pragma comment (lib, "gdiplus.lib")
using namespace std;
using namespace Gdiplus;
struct tagImageInfo {
Gdiplus::Image* image;
Gdiplus::Rect rect;
};
class DrawImage2
{
private:
Gdiplus::Graphics* pGraphics;
ULONG_PTR ... |
#include<bits/stdc++.h>
using namespace std;
bool chk(int n){
if (n<1000 || n>9999) return false;
bool w[10] = {0};
for (int i=0;i<4;++i) {
if (w[n%10]==1) return false;
w[n%10]=1;
n/=10;
}
return true;
}
int main(){
int kai;
//数作成
srand((unsigned)time(NULL));
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2002 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*
* @author Tomasz Jamroszczak tjamroszczak@opera.com
*
*/
#ifn... |
#include <fstream>
#include <iostream>
#include <vector>
using namespace std;
int bubblesort(vector<int>& a, int size) {
int intermediate;
for (int i = 0; i < size - 1; i++) {
for (int j = 0; j < size - 1; j++) {
if (a[j] > a[j + 1]) {
swap(a[j], a[j + 1]);
}
}
}
return 0;
}
int main() {
vecto... |
// MDTMP remove...
//MDTMP #include <mat-utils/logger/log.hpp>
#define LOG_DEBUG
#define LOG_ERROR
#include <string>
#include <vector>
class ABoardGame {
public:
static std::string whoWins(const std::vector<std::string> &board);
private:
static std::string getSquare(const std::vector<std::string> &board, size_... |
//Given a non-negative number represented as an array of digits,add 1 to the number ( increment the number represented by the digits ).
//The digits are stored such that the most significant digit is at the head of the list.
//Example: If the vector has [1, 2, 3] the returned vector should be [1, 2, 4] as 123 + 1 = 1... |
#include <iostream>
#include <map>
#include <string>
using namespace std;
void canonize(string& a) {
for (size_t i = 0; i < a.size(); ++i) {
if (a[i] >= 'A' && a[i] <= 'Z') {
a[i] += 'a' - 'A';
}
}
}
map<string, int> f;
int main() {
int n;
cin >> n;
... |
/*
* 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/state/QuicStreamManager.h>
#include <quic/state/QuicStreamUtilities.h>
#include <quic/state/StateData.h>
namespac... |
//
// Created by 송지원 on 2020/05/21.
//
#include <cstdio>
using namespace std;
int main() {
long input;
scanf("%ld", &input);
printf("%ld", input << 1);
return 0;
} |
#pragma once
#include "DynamicObjectLogicCalculator.h"
class DynamicObjectMagicRayLogicCalculator:public DynamicObjectLogicCalculator
{
public:
virtual void init(LevelModel* levelModel, DynamicObjectModel* dynamicObjectModel);
virtual void computeLogic();
private:
bool checkIfMagicRayCollidesWithWalls();
bool che... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2009 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
*/
#include "core/pch.h"
#if defined(_NATIVE_... |
#ifndef USER_H
#define USER_H
#include <QString>
class DatabaseConfig;
class User
{
public:
User();
~User();
bool chekLogin(const QString &user, const QString &password);
QString getId();
private:
DatabaseConfig *dbCon;
QString userId;
};
#endif // USER_H
|
/** @file valknut/core/internal/platform.hpp
*
* This header detects the appropriate platform configuration based on the
* compiling operating system
*
* @note This is an internal header file, included by other library headers.
* Do not attempt to use it directly.
*/
#ifndef VALKNUT_CORE_INTERNAL_P... |
///////////////////////////////////////
///////////////////////////////////////
//
// This is left because there are
// some tests of the OpenFST stuff
// which haven't made their way to
// GTest yet. (They aren't considered
// part of the public interface of
// library at this point.)
//
//////////////////////////////... |
#include<bits/stdc++.h>
using namespace std;
class Solution {
public:
int peakIndexInMountainArray(vector<int>& arr) {
int l = 0;
int h = arr.size()-1;
while(l<h){
int m = l + (h-l)/2;
if(arr[m]<arr[m+1]){
l = m+1;
}
else{
... |
// Author : Gabriel Duarte
// Date : 01/30/2018
// Lab # : 02 exercise 2
// Description : We are making a Sierpinski gasket.
// Include the library
#include "EasyBMP.h"
#include <vector>
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
// Create an image
BMP triangle;
// Se... |
#include"LinkStackQueue.h"
bool Queue::IsEmptyQue()
{
if (_Linktail == _Linkhead)
{
return true;
}
return false;
}
Queue::Queue()
{
_Linkhead = NULL;
_Linktail = NULL;
}
void Queue::PushQue(ElemType val)
{
if (_Linkhead == NULL)
{
Node *s = new Node;
s->_data = val;
s->_next = NULL;
_Linkhead = s;... |
//
// Created by demon on 18-10-13.
//
/*
* https://leetcode.com/problems/remove-element/
*
*/
# include <vector>
#include <iostream>
using namespace std;
class Solution {
public:
int removeElement(vector<int> &nums, int val) {
int j = 0;
for (int i = 0; i < nums.size(); ++i) {
if ... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "QTimer"
#include "QDebug"
#include "QKeyEvent"
#define CLOCK_TIMEINTERVAL 1000 // 時間計時器間隔
#define OBJECT_TIMEINTERVAL 10 // 物體計時器間隔
#define GAME_TIME 30 // 遊戲時間
#define CAR_SPEED 2 // 車子移動速度(水平)
#define CAR_MOVE_SPEED 2 // 車子移動速度(垂直)
#define CAR_INIT_Y_POS ... |
//
// Poly.h
// GLFW3
//
// Created by William Meaton on 08/12/2015.
// Copyright © 2015 WillMeaton.uk. All rights reserved.
//
#ifndef Poly_h
#define Poly_h
#include <vector>
#include "Vector2D.h"
namespace Graphics{
class Polygon{
private:
std::vector<Math::Vector2D> v;
public:
Polygon();
~Polygon();... |
/*********************************************************\
* 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... |
#ifndef DETTAGLIOVINO_H
#define DETTAGLIOVINO_H
#include "vinolistitem.h"
#include <QDialog>
#include <QFormLayout>
#include <QLabel>
#include <QPushButton>
#include <QTextEdit>
#include <QWidget>
class DettaglioVino: public QDialog {
Q_OBJECT
private:
VinoListItem* itemVino;
QPushButton* buttonClose... |
#include <iostream>
#include <string>
struct Person
{
std::string Name;
};
int main(int argc, char** argv)
{
std::cout << "Hello before" << std::endl;
Person* me = nullptr;
me->Name = "Daniel";
std::cout << "Hello after" << std::endl;
retur... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */
#include "core/pch.h"
#ifdef ES_OPPSEUDOTHREAD
#include "modules/ecmascript/carakan/src/es_pch.h"
#include "modules/ecmascript/oppseudothread/oppseudothread.h"
#include "modules/memory/src/memory_executable.h... |
/* -*- 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.
*
* @author Marius Blomli, Michal Zajaczkowski
*/
#include "core/p... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <flann/flann.hpp>
using namespace std;
using namespace flann;
template <typename Index, typename Distance>
float compareWithGroundTruth(Index& index, const Matrix<typename Distance::ElementType>& inputData,
const Matrix<ty... |
/* -*- 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.
*/
/** \file
* This file declares the AUFileUtils interface which is
* a minimal set of... |
#include "light.h"
#include <utility>
double Light::calculateDiffThreshold(double distanceToFurther, int atThisLight, int atOtherLight,
vector<double> distances) {
double diff = diffToExpectedPercentOfLight(atThisLight, atOtherLight);
pair<double, double> mAndS = meanAndSt... |
#ifndef FEK_STREAMS_HPP
#define FEK_STREAMS_HPP
// windows
#ifdef _WIN32
#include <windows.h>
#endif
#ifndef _WIN32 // if syslog avaiable
#include <unistd.h>
#include <syslog.h>
#endif
// libc
#include <cassert>
#include <cstring>
// std
#include <streambuf>
#include <istream>
#include <iterator>
#include <limits>
... |
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
const int maxn = 222222, maxb = 555;
vector<int> query[maxb];
int n, q, b, m, cur, cnt[maxn], A[maxn], ans[maxn], Q[maxn][2];
bool cmp(int x, int y) { return Q[x][1] < Q[y][1]; }
void add(int num) {
cnt[num] ++ ;
wh... |
// Created on: 1995-10-26
// Created by: Yves FRICAUD
// 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 GNU L... |
// MFC_MiniServerADoc.h : interface of the CMFCMiniServerADoc class
//
#pragma once
class CMFCMiniServerASrvrItem;
class CMFCMiniServerADoc : public COleServerDoc
{
protected: // create from serialization only
CMFCMiniServerADoc() noexcept;
DECLARE_DYNCREATE(CMFCMiniServerADoc)
// Attributes
public:
CMFCMiniS... |
// CameraWatcherDlg.h : header file
//
#include <strmif.h>
#import "VCamRenderer.tlb" no_namespace, raw_interfaces_only exclude("UINT_PTR")
#pragma once
#pragma comment(lib, "Strmiids.lib")
/*************************************************
Enums / Typedefs
*************************************************/
ty... |
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <memory.h>
#include <math.h>
#include <string>
#include <sstream>
#include <string.h>
#include <queue>
#include <vector>
#include <set>
#include <map>
typedef long long LL;
typedef unsigned long long ULL;
#defin... |
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
// Пример выхода из цикла по условию
// V 1.0
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=//
#include <iostream>
int main() {
using namespace std;
int val = 0;
while (true) {
cout << "En... |
#include "SFML_Credits.h"
SFML_Credits::SFML_Credits(int windowWidth, int windowHeight)
{
const float scale = 0.8;
const float invScale = 1;
sf::Font myFont;
sf::View myView;
myView.setSize(windowWidth, windowHeight);
myView.setCenter(windowWidth / 2, windowHeight / 2);
myView.setViewport(sf::Float... |
//====================================================================================
// @Title: ITEMS
//------------------------------------------------------------------------------------
// @Location: /game/rpg/include/cItemsDef.h
// @Author: Kevin Chen
// @Rights: Copyright(c) 2011 Visionary Ga... |
#ifndef CHARACTER_H
#define CHARACTER_H
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
#include "weapons.h"
class Character
{
public:
Character(sf::Vector2f position, int life, int speed, Weapons* weapon, std::string path);
Character(const Character & c);
sf::Sprite& GetSprite();
Weapons* Get... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2007 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 SVG_SUPPORT
#include "modules/svg/s... |
#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;
int a[20],f[20][101... |
//
// SORT.cpp
// ADT
//
// Created by Jalor on 2020/9/7.
// Copyright © 2020 Jalor. All rights reserved.
//
#include "SORT.hpp"
|
#include "stdafx.h"
#include "NetAISelect.h"
#include "NetPVPMode.h"
#include "../GameCursor.h"
#include "../Title/MonAIPreset/MonAIPresetOpenSuper.h";
#include "../Fade/Fade.h"
#include "../SaveLoad/PythonFileLoad.h"
#include "../Title/PMMonster.h"
#include "../Title/MonAIPreset/MonAIPresetSaveOpen.h"
#include "../T... |
#include<iostream>
using namespace std;
typedef struct Node
{
int key;
Node *next;
Node(int x)
{
key = x;
}
} Node;
Node *enqeue(Node *tail, int key)
{
Node* tmp=new Node(key);
if(tail==NULL)
return tmp;
else
tail->next=tmp;
return tmp;
}
void printList(Node *head)
{
Node *c... |
/**
* created: 2013-4-6 23:29
* filename: FKAsynSocket
* author: FreeKnight
* Copyright (C):
* purpose:
*/
//------------------------------------------------------------------------
#pragma once
//------------------------------------------------------------------------
#define BASE_SERVERSOCK_MSG WM_USER... |
/**********************************************************************
Copyright (c) 2016 Advanced Micro Devices, 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... |
//
// Created by Raniery Costa Mendes on 11/7/19.
//
#include "Polygon.h"
#ifndef INHERTANCE_EXERCISE_TRIANGLE_H
#define INHERTANCE_EXERCISE_TRIANGLE_H
class Triangle :public Polygon {
public:
int area ();
};
#endif //INHERTANCE_EXERCISE_TRIANGLE_H
|
#include <iostream>
#include <vector>
#include <cstring>
#define nmax 500
#define lmax 5000005
using namespace std;
char expression[nmax], lft[nmax], rgh[nmax], *p;
struct ans
{
int vx, vy, v;
bool dx, dy, dv;
ans() :vx(0), vy(0), v(0), dx(false), dy(false), dv(false) {}
};
ans parseAdditionSubtraction();
a... |
// ArraySorting.cpp : Defines the entry point for the console application. // #include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <iostream>
#include <fstream>
using namespace std;
void shuffle(int *arr, size_t n) { if (n > 1) { size_t i; srand(time(NULL)); for (i = 0; i < n - 1;... |
#include "MySqlConnect.h"
#include "Logger.h"
#include "Configure.h"
#include "Room.h"
#include "Despatch.h"
#include <string>
#include "CDLReactor.h"
static MySqlConnect* instance = NULL;
MySqlConnect* MySqlConnect::getInstance()
{
if(instance==NULL)
{
instance = new MySqlConnect();
}
return instance;
}
MySq... |
/******************************************************************************
Welcome to GDB Online.
GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
Code, Compile, Run and Debu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2004-2008 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Yngve N. Pettersen
*/
#include "core/pch.h"
#ifdef SELFTEST
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef CRYPTO_STREAM_ENCRYPTION_RC4_H
#define CRYPTO_STREAM_ENCRYPTIO... |
#include "SmtSolver.h"
#include <queue>
#include <cassert>
#include <iostream>
#include "SatSolver.h"
std::pair<int, int> mkOrderedPair(int a, int b) {
if(a <= b) {
return std::make_pair(a, b);
} else {
return std::make_pair(b, a);
}
}
std::pair<SmtSatKernel, SatCnf> gene(const SmtCnf& sc)... |
#include "Character.hpp"
Character::Character(void) : name("defaultName"), action_points(40), current_weapon(NULL){
return;
}
Character::Character(std::string const & name) : name(name), action_points(40), current_weapon(NULL){
return;
}
Character::~Character(){
return;
}
void Character::recoverAP(){
... |
// MySocketest.cpp : Defines the entry point for the console application.
//
//#include "stdafx.h"
#include"winsock2.h"
#include <ws2tcpip.h>
#include <stdio.h>
#include <stdlib.h>
#define MCASTADDR "236.0.0.1"
#define MCASTPORT 12345
#define BUFSIZE 1024
int main(int argc, char* argv[])
{
WSADATA wsd;
str... |
#include<cstdio>
#include<cstring>
const int M = 303;
bool dia[M][M],vis[M];
int mat[M];
int n,m;
bool dfs(int k)
{
for(int i=1;i<85;++i){
if(dia[k][i] && !vis[i]){
vis[i] = 1;
if(mat[i]==-1 || dfs(mat[i])){
mat[i] = k;
return 1;
... |
#include "Headers.h"
class ControlSM {
public:
enum State {
WAIT,
READY,
LED_ONE,
ONE_TWO,
LED_TWO,
TWO_THREE,
LED_THREE,
THREE_FOUR,
LED_FOUR,
FOUR_FIVE,
LED_FIVE,
STATE_SIZE
} state;
enum BuffType {
MN... |
#include<iostream>
using namespace std;
int repeating(int arr[],int n){
int start=0,end=n-1;
while(start<end){
int mid=start+(end-start)/2;
if(arr[mid]==arr[mid-1] || arr[mid]==arr[mid+1]) //write conditions for corner cases
return arr[mid];
else if (mid>arr[mid]-... |
/*
* 2013+ Copyright (c) Ruslan Nigatullin <euroelessar@yandex.ru>
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your ... |
/*
All publisher definitions for the quadrotor simulation are given here
*/
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//HEADER FILES
#include "quadrotor_sim/quad_sim.h"
/////////////////////////... |
//
// Created by 钟奇龙 on 2019-05-02.
//
#include <iostream>
#include <stack>
#include <vector>
using namespace std;
class Node{
public:
int data;
Node *left;
Node *right;
Node(int x):data(x),left(NULL),right(NULL){}
};
vector<Node*> getTwoErrorNodes(Node *root){
vector<Node*> errors(2);
if(!root)... |
// mfc_button0Dlg.h : header file
//
#pragma once
#include "afxwin.h"
#include "PngButton.h"
// Cmfc_button0Dlg dialog
class Cmfc_button0Dlg : public CDialogEx
{
// Construction
public:
Cmfc_button0Dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
enum { IDD = IDD_MFC_BUTTON0_DIALOG };
protected... |
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding... |
#ifndef TANK_H
#define TANK_H
#include <QPoint>
typedef enum
{
dir_up,
dir_down,
dir_left,
dir_right
}direction;
class Tank
{
public:
QPoint p;
direction d;
Tank();
~Tank();
};
#endif // TANK_H
|
//----------------------------------------------------------------
// ClientModel.h
//
// A non-interactive client-side model
//
// Copyright 2002-2004 Raven Software
//----------------------------------------------------------------
#ifndef __GAME_CLIENT_MODEL_H__
#define __GAME_CLIENT_MODEL_H__
class rvClientModel ... |
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
int N, I;
int cont, cont2, armazem;
cont2 = 1;
cin >> N;
while ( N != 0 ){
for ( cont = 1; cont <= N; cont++ ){
cin >> I;
if ( cont == I ){
armazem = I;
... |
/**
* Copyright (c) 2017 Darius Rückert
* Licensed under the MIT License.
* See LICENSE file for more information.
*/
#include "objLoader.h"
#include <fstream>
#include <sstream>
#include <algorithm>
#include <iostream>
using std::cout;
using std::endl;
inline std::istream& operator>>(std::istream& is, glm::v... |
#include "gromacsoptionenter.h"
#include <QHBoxLayout>
GromacsOptionEnter::GromacsOptionEnter(QWidget *parent, QString value) :
GromacsOption(parent),
_lineEdit(new QLineEdit(value, this))
{
_lineEdit->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
_layout->addWidget(_lineEdit);
}
|
// Module 6.2.cpp : This file contains the 'main' function. Program execution begins and ends there.
// Valeria Benetti 2183227
#include <iostream>
using namespace std;
// Functions
void bubbleSort(int[], int, int&);
void selectionSor(int[], int, int&);
void displayResults(int, int);
int main()
{
// Declaring and i... |
bool Digital2=0;
int analog1 = 0;
int analog2 = 1;
int analog3 = 2;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
pinMode(2,INPUT);
}
void loop() {
// put your main code here, to... |
#include "Subject.h"
#ifndef __Subject_H
#error [E030] Не определен заголовочный файл Subject.h
#endif
void Subject::notify() {
for (int i = 0; i < views.size(); i++)
views[i]->update();
}
|
#include "vnapulsetype.h"
using namespace RsaToolbox;
#include <cassert>
QString toScpi(VnaPulseType type) {
switch (type) {
case VnaPulseType::Single:
return "SING";
case VnaPulseType::Train:
return "TRA";
case VnaPulseType::ConstantHigh:
return "CHIG";
case VnaPulseType::... |
/* -*- 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.
*/
#include "core/pch.h"
#ifdef HC_MESSAGE_LOGGING
#include "modules/ha... |
/*#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main()
{string a,b;
while (cin >> a >> b)
{int len,sum=0;
len = min(a.length(),b.length());
for (int i = 0;i < len; i++)
if (a[i] == b[i]) sum++;
cout << sum << endl;
}
return 0;
}*/
#include<stdio.h>
#incl... |
#include "head.h"
#include "data.h"
#include "net.h"
void train(){
for (int iter = 0; iter <= MAX_ITER; ++iter){
}
}
int main(){
double **X;
vector<Layer> layers;
if (!readTrain(X)) return 1;
if (!readNet(layers)) return 1;
buildNet(layers);
train();
release(X);
release(layers);
return 0;
}
|
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define inf 10000001
const int maxn = 1e5 + 10;
int head[maxn];
int dp[maxn];
int n, u, v, edgenum, arr;
struct Edge {
int from, to, dis, next;
} edge[maxn << 1];
void add(int u, int v, int d) {
Edge E = {u, v, d, he... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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 Manuela Hutter (manuelah)
*/
#ifndef FAKE_FEATURE_CONT... |
/*
Name: 寻找第一个错误版本
Copyright:
Author: Xiaodong Xiao
Date: 2019/9/12 16:14:40
Description: lc-cn 278
*/
#include <bits/stdc++.h>
using namespace std;
bool isBadVersion(int version) {
return true; // 只是为了通过编译
}
class Solution {
public:
int solve(int lo, int hi) {
while (lo < hi) {
int mid = lo + (hi - lo >>... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.