text stringlengths 8 6.88M |
|---|
#include "Lophoc.h"
template <class tml>
void Hoanvi(tml a, tml b)
{
tml temp = a;
a = b;
b = temp;
}
void Lophoc::Sort()
{
int size = DanhsachLop.size();
for (int i = 0; i < size - 1; i++)
{
for (int j = i + 1; j < size; j++)
{
if (DanhsachLop[i].DiemTrungBinh() < DanhsachLop[j].DiemTrungBinh())
{
... |
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include "common.h"
#include "intcode.h"
#include <boost/multiprecision/cpp_int.hpp>
#include "CImg.h"
using namespace std;
using namespace boost::multiprecision;
using namespace boost;
using namespace cimg_library;
/**
* Day 11 - Space Police
*/... |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n, m;
vector<int> nums;
vector<int> ans;
bool find(int target){
int low = 0;
int high = nums.size()-1;
while(low <= high){
int mid = (low + high) / 2;
if(nums[mid] == target){
return true;
... |
#pragma once
#include "ipc_medium.h"
#include "message.h"
#include <queue>
#include <unordered_map>
#include <mutex>
namespace Petunia {
class IPCMediumInprocess : public IPCMedium
{
public:
IPCMediumInprocess(std::string &channel, ConnectionRole connection_role = ConnectionRole::Auto);
~IPCMediumInproc... |
#pragma once
#include "Component\IComponent.h"
#include <string>
#include "Component\Transform.h"
#include "StrID.h"
namespace Hourglass
{
class Message;
class Entity
{
public:
Entity();
~Entity();
StrID GetName() const { return m_Name; }
StrID GetTag() const { return m_Tag; }
int GetInstanceID() ... |
// Page1.cpp : 实现文件
//
#include "stdafx.h"
#include "Schedule.h"
#include "Page1.h"
#include "afxdialogex.h"
#include <fstream>
#include <iomanip>
#include <algorithm>
// CPage1 对话框
IMPLEMENT_DYNAMIC(CPage1, CPropertyPage)
CPage1::CPage1()
: CPropertyPage(CPage1::IDD)
{
#ifndef _WIN32_WCE
EnableActiveAccessibil... |
//算法:dfs回溯
/*
本题目用到了杨辉三角.
手动模拟几组数据,可以推出:
当n=3时,sum=1*a+2*b+3*c
当n=4时,sum=1*a+3*b+3*c+1*d
当n=5时,sum=1*a+4*b+6*c+4*d+1*e
(a,b,c,d,e...等为所求序列中各位置的数)
可以看出, 算式中系数与杨辉三角中第n层各位置值一一对应
则:
先计算出第n层杨辉三角的值,
枚举各位置的值,
再使他们分别乘以此位置的系数
计算他们的总值.
当各位置都枚举完毕,且总值等于sum时,就找到了解
因为循环枚举各位置数时,是按字典序枚举的
则第一次找到的即... |
// 클래스 == 구조체? struct and class?
// 클래스 == 자료 저장 + 자료 처리 == 변수 + 함수
// 특정한 용도를 수행하기 위한 변수와 함수를 모아둔 틀
// 객체(오브젝트) : 틀을 이용하여 찍어낸 개체
#include <iostream>
using namespace std;
// private, public, protected
class TV {
// private is default in class
// These three values are private
bool power_on;
int channel;
int vo... |
#include<bits/stdc++.h>
using namespace std;
int main(){
double w,v,u;
int n;
double ans=0;
int flagx=1,flagy=1;
cin>>n>>w>>v>>u;
for(int i=0;i<n;i++){
double x,y;
cin>>x>>y;
if((x/v)>(y/u)){
flagx=0;
}
if((x/v)<(y/u)){
... |
//
// Created by seadream on 2018/10/30.
//
#ifndef SWORDTOOFFER_CMYSTRING_H
#define SWORDTOOFFER_CMYSTRING_H
#include <cstring>
class CMyString {
public:
CMyString(const char* pData = nullptr);
CMyString(const CMyString& str);
~CMyString(void);
CMyString&operator = (const CMyString& str) { // 相当于把s... |
#include <iostream>
#include <cstring>
#include <list>
// We can use either map or unordered_map => for hash-tables/ hash-maps;
// map uses BST to maintain the information and
// unordered_map uses separate chaining technique
#include <map>
using namespace std;
// template for Generic Graph!
// can store any kind of d... |
#include "AABoundingBox.h"
AABoundingBox::AABoundingBox()
{
}
AABoundingBox::AABoundingBox(glm::vec3 fMinCoord, glm::vec3 fMaxCoord) {
minCoord = fMinCoord;
maxCoord = fMaxCoord;
center = (fMaxCoord+fMinCoord);
center /= 2.0f;
size = glm::abs(fMaxCoord - fMinCoord);
halfSize = glm::vec3(size.x / 2.0f, size.y / ... |
#ifndef NODE_H
#define NODE_H
#include <iostream>
using namespace std;
template <class T> class Node
{
public:
Node(T elem): _elem(elem){}
void setLast(Node* last){
_last = last;
}
void setNext(Node* last){
_next = next;
}
T getElem(){
return _elem;
}
friend o... |
#include<stdio.h>
main()
{
char ch[20]="123456";
printf("%s\n",ch);
}
|
#include <array>
#include <fstream>
#include <vulkan/vulkan.h>
class Boy01_Scarf_GeoMesh
{
std::array<VkVertexInputAttributeDescription, 3> atts = {};
VkVertexInputBindingDescription desc;
VkBuffer buffer;
VkDeviceMemory vertexBufferMemory;
VkDeviceSize vertex_buffer_offset;
VkDeviceSize index_b... |
/**
* src/util/logger.cpp
*
* (C) Copyright 2014 Michael Sippel
*
* 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 3 of the License, or
* (at your option) any later v... |
#include <iostream>
#include <sstream>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <iomanip>
#include <set>
#include <climits>
#include <ctime>
#include <complex>
#include <cmath>
#include <string>
#in... |
#include "histo.hpp"
// template<uchar>
std::array<int, 256> histogram( cv::Mat& img )
{
CV_Assert( img.depth() == CV_8U );
CV_Assert( img.channels() == 1 );
std::array<int, 256> hist;
uchar* p;
int nRows = img.rows;
int nCols = img.cols;
if ( img.isContinuous() )
{
nCols *= ... |
#include "ModifierGroupWidget.h"
ModifierGroupWidget::ModifierGroupWidget(ModifierGroup *modifier_group, QWidget *parent) :
QWidget(parent)
{
this->modifier_group(modifier_group);
QVBoxLayout *layout = new QVBoxLayout();
// Add widget for ModifierGroup
QWidget *widget = new QWidget();
QHBoxLay... |
#include <GL/glew.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "glarray.h"
////////////////////////////////////////////////////////////////////////////////
static void glarray_init(GLArray* glarray, Vertex* vertices, uint32 n_vertices);
static void glarray_describe(uint32 attrib, uint32 att... |
#include<iostream>
using namespace std;
int main(int argc, char const *argv[])
{
char a=98-32;
cout<<a;
return 0;
}
|
#include "ofMain.h"
#include "City.h"
#include "Utility.h"
#include <iostream>
using std::cout;
using std::endl;
City::City(string _name, Earth &earth) : name(_name) {
geoinfo = new GeoInfo(name);
init(geoinfo->lat, geoinfo->lng, earth);
address = geoinfo->address;
//localtime = geoinfo->localtime;
offset = geoin... |
#include "desc.h"
#include "defines.h"
#include "gradientMex.h"
#include <stdio.h>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <vector>
#include <iostream>
void patchesToVec(cv::Mat img_o, std::vector<float> *res){
cv::Mat img = img_o;
... |
#ifndef NEURAL_EDGE_GROUP_GPU_H
#define NEURAL_EDGE_GROUP_GPU_H
#include <memory>
#include <vector>
#include <CL/cl.hpp>
#include "utility/Matrix.h"
class TiXmlElement;
class NeuralNodeGroupGpu;
class NeuralEdgeGroupGpu
{
public:
static std::shared_ptr<NeuralEdgeGroupGpu> loadFromXmlElement(const TiXmlElement* el... |
#include"OGLWidget.h"
#ifndef _OGL_SQUARE_H_
#define _OGL_SQUARE_H_
struct OGLSquareDescription {
OGLWidgetDescription widget;
struct {
float r;
float g;
float b;
float a;
} color;
};
//DUDO DE QUE ESTA CLASE EXISTA EN EL FUTURO
//TAL VEZ LOS WIDGET TENDRAN UN COLOR DE FON... |
#include <ct/optcon/optcon.h> // also includes ct_core
#include <my_ct_project/configDir.h>
// #include <ct/core/core.h>
#include "my_ct_project/CustomController.h"
#include "my_ct_project/plotResultsOscillator.h"
#include <ct/models/HyQ/HyQ.h>
#include <ct/models/HyA/HyA.h>
#include <ct/rbd/systems/FixBaseFDSystem.h... |
#pragma once
#include <string>
#include <iostream>
#include <fstream>
#include "../../FbxDemoBase/FbxDemo/ImporterStructure.h"
#include <vector>
class BiReader
{
private:
std::string fileName = "../../FbxDemoBase/biFile.bff";
std::ifstream inputFile;
Mesh mesh;
Vertex *vertexArr;
Material material;
public:
... |
#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 <assert.h>
#include <float.h>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <omp.h>
#include "soi.h"
/*
%..This is the step for filter and subsample.
%..In the actual cluster version, each processor runs this and produce
%..its portion of the distributed gamma_tilde.
%..In the matlab serial ... |
/************************************************************************/
/* File name : BkGnuPGInfo.h */
/************************************************************************/
/* Contents : BkGnuPG 制御情報アクセス */
/* ... |
#pragma once
#ifndef LIKNEDHEAP_HPP_INCLUDE
#define LIKNEDEAP_HPP_INCLUDE
namespace lbh {
typedef struct _Node {
int value;
struct _Node *leftChild;
struct _Node *rightChild;
}Node;
}
#endif |
#include <stdio.h>
#include "cs1300bmp.h"
#include <iostream>
#include <fstream>
#include "Filter.h"
using namespace std;
#include "rtdsc.h"
//
// Forward declare the functions
//
Filter * readFilter(string filename);
double applyFilter(Filter *filter, cs1300bmp *input, cs1300bmp *output);
int
main(int argc, char *... |
/* ***** BEGIN LICENSE BLOCK *****
* FW4SPL - Copyright (C) IRCAD, 2009-2011.
* Distributed under the terms of the GNU Lesser General Public License (LGPL) as
* published by the Free Software Foundation.
* ****** END LICENSE BLOCK ****** */
#include <boost/filesystem/path.hpp>
#include <boost/algorithm/string/trim... |
// Copyright 2016 <https://github.com/spelcaster>
#include "include/BaseConverter.hpp"
#include <cmath>
#include <iostream>
//! BaseConverter constructor
BaseConverter::BaseConverter() {
decimal_ = 0;
}
//! BaseConverter destructor
BaseConverter::~BaseConverter() {
std::vector<int>().swap(binnary_);
}
/*!
... |
#include <pangolin/pangolin.h>
#include <pangolin/video/video_input.h>
#include <pangolin/utils/file_utils.h>
#include <pangolin/utils/timer.h>
void VideoViewer(const std::string& input_uri, const std::string& output_uri)
{
pangolin::Var<bool> video_wait("video.wait", true);
pangolin::Var<bool> video_n... |
#include <iostream>
#include<math.h>
using namespace std;
//s(n)=x^1+x^2+x^3+..x^n
long dequi(int n,int x)
{
if(n==1)
{
return x;
}
return pow(x,n)+dequi(n-1,x);
}
long khudequi(int x,int n)
{
long tong=x;
for(int i=2;i<=n;i++)
{
tong+=pow(x,i);
}
return tong... |
#include <cstdint>
#include "common/thread/thread.h"
#include <gtest/gtest.h>
void foo(int32_t* a) {
++*a;
}
TEST(ThreadingTest, ThreadTest) {
int32_t a = 1;
Thread thread(std::bind(foo, &a));
thread.Join();
EXPECT_EQ(2, a);
}
TEST(ThreadingTest, ThreadStartTest) {
int32_t a = 1;
Thread thread;
threa... |
/*
* Person.cpp
* Comp 220 Bookstore Project
* Written by Joe Cleveland, Chase McGough, and Anthony Pizzo
* This file is the method definitions of the Person class
*/
#include "Person.h"
Person::Person(std::string first, std::string last, std::string phoneNumberIn, std::string emailIn, int commMethodIN) {
na... |
/*
* 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 <gtest/gtest.h>
#include <quic/common/test/TestUtils.h>
#include <quic/fizz/client/handshake/FizzClientExtensions.h>
#... |
#ifndef QUADRATURE_H_
#define QUADRATURE_H_
#include <iostream>
class Quadrature {
private:
int _n;
double* _mu;
double* _w;
public:
Quadrature(int n);
virtual ~Quadrature();
void initializeArray();
void setNumDirection(int num);
int getNumDirection() { return _n; }
double ... |
#include <iostream>
#include <string>
#include <unordered_map>
using namespace std;
#include <time.h>
#include "LongestPalindrome.h"
int main(int argc, char** argv) {
// string str = "kyyrjtdplseovzwjkykrjwhxquwxsfsorjiumvxjhjmgeueafubtonhlerrgsgohfosqssmizcuqryqomsipovhhodpfyudtusjhonlqabhxfahfcjqxyckycstcqwxvicwkj... |
#include "Tests/AutomationCommon.h"
#include "Math/UnrealMathUtility.h"
DEFINE_SPEC(AnglesSpec, "Angles", EAutomationTestFlags::EngineFilter | EAutomationTestFlags::ApplicationContextMask)
void AnglesSpec::Define()
{
Describe("FixedTurn", [this]() {
It("Should increment angle to the last, when the angle from first... |
//Enzo Vito
//14 July 2016
//DESCRIPTION: This sketch modulates the light of an LED as if it were "breathing". This is inspired by the LEDs found in Mac laptops in standby.
//EQUIPMENT:
//- Arduino Uno Rev 3
//- LED
//- Jumper wires
//- Solderless breadboard
//FUNCTIONS:
//- pinMode(pin,mode) configures a pin to behave... |
/*
** EPITECH PROJECT, 2021
** Untitled (Workspace)
** File description:
** Date
*/
#include "Date.hpp"
std::atomic<int>_hour;
std::atomic<int>_minute;
std::atomic<int>_seconds;
void updateTime(std::atomic<bool> &is_running)
{
const auto wait_duration = std::chrono::milliseconds(1000);
while (is_running) {
... |
#include "DummyPreprocessor.hpp"
#include <iostream>
DummyPreprocessor::DummyPreprocessor(int processorId, Conf &cfg) : Preprocessor(processorId, cfg) {}
cv::Mat DummyPreprocessor::Preprocess(cv::Mat &frame) {
std::cout << "Processor activated\n";
return frame;
}
|
#pragma once
#include "pico/time.h"
class Pulse {
public:
Pulse(uint delay = 1);
bool expired();
private:
uint m_delay;
absolute_time_t m_later;
};
|
#include "csettingspagegeneral.h"
#include "settings.h"
DISABLE_COMPILER_WARNINGS
#include "ui_csettingspagegeneral.h"
RESTORE_COMPILER_WARNINGS
CSettingsPageGeneral::CSettingsPageGeneral(QWidget *parent) :
CSettingsPage(parent),
ui(new Ui::CSettingsPageGeneral)
{
ui->setupUi(this);
}
CSettingsPageG... |
#pragma once
#include "SocketContext.h"
#include <winsock2.h>
#include <vector>
using namespace std;
//在完成端口上投递的I/O操作的类型
typedef enum _NET_TYPE
{
NET_ACCEPT, // Accept操作
NET_SEND, // 发送操作
NET_RECV, // 接收操作
NET_UNKNOWN // 初始... |
#include "Jepp.h"
Jepp::Jepp()
{
}
Jepp::~Jepp()
{
}
|
/*
* Copyright (c) 2015-2020 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_DETAIL_UPPER_BOUND_H_
#define CPPSORT_DETAIL_UPPER_BOUND_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <iterator>
#include <utilit... |
#include <GL/glew.h>
#include <glfwpp/glfwpp.h>
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include <iostream>
void cleanupImgui()
{
ImGui_ImplOpenGL3_Shutdown();
ImGui_ImplGlfw_Shutdown();
ImGui::DestroyContext();
}
template<typename Func>
void renderImgui(Func&& guiR... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2011 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser.
** It may not be distributed under any circumstances.
*/
#ifndef BTREEBASE_H
#define BTREEBASE_H
#include "modules/searc... |
/*
* Copyright (c) 2016-2021 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_ADAPTERS_SCHWARTZ_SMALL_ARRAY_H_
#define CPPSORT_ADAPTERS_SCHWARTZ_SMALL_ARRAY_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <arra... |
#ifndef SHADOW_MAP_H
#define SHADOW_MAP_H
#include "cpvs.h"
#include "Fbo.h"
#include "Texture.h"
#include "Image.h"
class ShadowMap {
public:
/**
* Creates a Shadow Map from a Texture 2D.
*
* @note The width must be equal to the height and both must be a power of two!
*/
ShadowMap(shared_ptr<Texture2D> tex... |
#include "stdafx.h"
#include "minpq.h"
#include <limits.h>
#include <malloc.h>
#include "utils.h"
static void restore_minpq_order(struct pq_node*, int, int);
static void decrease_pq_node_key(struct pq_node*, int, int);
static inline int parent(int i)
{
return (i - 1) / 2;
}
static inline int right(int i)
{
return ... |
//--------------------------------------------------------
// musket/include/musket/widget/facade.hpp
//
// Copyright (C) 2018 LNSEAB
//
// released under the MIT License.
// https://opensource.org/licenses/MIT
//--------------------------------------------------------
#ifndef MUSKET_WIDGET_FACADE_HPP_
#define MUSKET_... |
#pragma once
#include "eventHandler.h"
class platfEventHandler : public eventHandler
{
public:
platfEventHandler();
bool onEvent(Event* e);
};
|
#include "ffournisseur.h"
#include "QSqlQueryModel"
Ffournisseur::Ffournisseur()
{
}
Ffournisseur::Ffournisseur(QString Nom,QString Adresse,QString Num_Tel,QString courriel,int ID,QString Info,QString paiement,QString Tpaiement,int IDF,QString Nb_stock,QString N_Societe,QString N_Type,QString N_Produit):facture(Nom,A... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ma... |
/* -*- 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)
* @author Rune Myrland (runem)
*/
#ifndef KDE4_... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2008 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Yngve Pettersen
**
*/
#include "core/pch.h"
#if defined(_NA... |
#include "game.h"
#include <unistd.h>
#include <fstream>
using namespace std;
using namespace hw2;
void game::initializeGame(){
board newBoard;
default_board = newBoard;
cout << "Welcome to the game of life!" << endl << endl;
while (true){
// display options
cout << "Which ruleset would y... |
/*
* userData.h
*
* Author: Davlet
*/
#ifndef USERDATA_H_
#define USERDATA_H_
#include <string>
#include <cstring>
#include <fstream>
#include <mutex>
//preliminary declaration
bool isAlreadyExist(std::string _login);
bool passwordCheck(std::string _login, std::string _password);
class userData {
private:
... |
/****************************************
Cat Got Bored
*****************************************/
#include <bits/stdc++.h>
#define FOR(i, s, e) for(int i=s; i<e; i++) //excluding end point
#define loop(i, n) for(int i=0; i<n; i++) //n times
#define loop(n) for(int i=0;i<n;i++) // n times
#define getint(n) s... |
/*
* 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.
*/
#pragma once
#include <fizz/record/Extensions.h>
#include <quic/codec/QuicInteger.h>
#include <quic/common/BufUtil.h>
#include <... |
#pragma once
#include "plbase/PluginBase.h"
#pragma pack(push, 4)
class PLUGIN_API AnimBlendFrameData
{
public:
unsigned __int8 m_nFlags;
CVector m_vOffset;
class IFrame *m_pIFrame;
unsigned __int32 m_dwNodeId;
};
#pragma pack(pop)
VALIDATE_SIZE(AnimBlendFrameData, 0x18); |
#pragma once
#include "components/component.hpp"
namespace needs {
struct Needs : ecs::ComponentCRTP<ecs::Component::Needs, Needs> {
int food = 100;
int max_food = 200;
int sleep = 200;
int max_sleep = 200;
int happy = 200;
int max_happy = 200;
};
} |
/*****************************************************************
Name :BT_reconstruction
Author :srhuang
Email :lukyandy3162@gmail.com
History :
20190927 Initial Version
*****************************************************************/
#include <iostream>
#include <sstream>
#include <queue>
#include <stack... |
#include <iostream>
#include "caffe/util/io.hpp"
#include "caffe/SpeedUp/Special_Time.hpp"
using std::ostringstream;
namespace caffe {
std::map<PString, int> SpecialTime::ID;
std::vector<float> SpecialTime::Total_Time;
std::vector<int> SpecialTime::Total_Count;
std::vector<int> SpecialTime::Num_Multi;
SpecialTime:... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#ifndef CAppController_H
#define CAppController_H
#include "OpenGl_Ext/gl/glew.h"
#include "OpenGl_Ext/gl/wglew.h"
#include "gmcuThread.h"
#include "CSem.h"
#include "test_profiles.h"
#define TEXTURE_SIDE 1024
#ifndef TEST_PROFILE
#define USE_FASTQUEUE
//#define USE_THREADS
#define USE_PBO
#define U... |
/**
* @file map_parameters.hpp
* @author Chirag Jain <cjain7@gatech.edu>
*/
#ifndef SKETCH_CONFIG_HPP
#define SKETCH_CONFIG_HPP
#include <vector>
#include "common/ALeS.hpp"
namespace skch
{
struct ales_params {
uint32_t weight;
uint32_t seed_count;
float similarity;
uint32_t region_length;... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2010-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 _URL_COUNTER_SOCKET_WRAPPER_H_
#define _URL_COUNTER_SOCKE... |
#ifndef MY_LOCK_H_MYIDENTIFY_1985
#define MY_LOCK_H_MYIDENTIFY_1985
#include <pthread.h>
namespace core { namespace common
{
class locker
{
private:
// pthread_mutexattr_t m_attr;
pthread_mutex_t m_mutex;
public:
locker()
{
// pthread_mutexattr_init(&m_attr);
... |
// Created on: 1992-06-10
// Created by: Laurent BUCHARD
// Copyright (c) 1992-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 GN... |
#include<bits/stdc++.h>
using namespace std;
#define maxn 105
bool dp[maxn][maxn*maxn];
int n,m;
int a[maxn];
int sum;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
while(cin>>n>>m) {
memset(dp,false,sizeof(dp));
sum=0;
for(int i=1; i<=n+m; ... |
#include <queue>
#include "Graph.h"
#include <iostream>
using namespace std;
struct DNode {
int pri = INT_MAX;
bool visited = false;
const GraphNode *node = nullptr;
bool operator<(const DNode &other) const {
return pri < other.pri;
}
bool operator>(const DNode &other) const {
return pri > other.pri;
}
... |
#ifndef _SENSOR_H_
#define _SENSOR_H_
/* Declarations for all sensor classes */
#include <Wire.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
#include <DHT.h>
class Sensor {
public:
Sensor(const String& id); // Initialize with four letter ID used to send data
... |
#include "DetectMemoryLeak.h"
#include "Animation.h"
#include <iostream>
#include "PlayerInfo\PlayerInfo.h"
CAnimation::CAnimation()
: m_bFacingUp(false)
, m_bIsMoving(false)
, dodging(false)
, m_iAnimation_Index(0)
, m_ifStand_Start(0)
, m_ifStand_End(0)
, m_ibStand_Start(0)
, m_ibStand_End(0)
, m_ifWalk_Star... |
#include<stdio.h>
main()
{
printf("IOI");
}
|
#pragma once
#include "plbase/PluginBase.h"
#include "CPtrList.h"
#pragma pack(push, 4)
class PLUGIN_API CRepeatSector
{
public:
CPtrList m_VehiclesList;
CPtrList m_PedsList;
CPtrList m_ObjectsList;
};
#pragma pack(pop)
VALIDATE_SIZE(CRepeatSector, 0xC); |
#include "compute_weight.h" // import file to test
#include "compute_jacobians.h"
#include <vector> // used for test input
#include "ut.hpp" // import functionality and namespaces from single header file
using namespace boost::ut; // provides `expect`, `""_test`, etc
using namespace boost::ut::bdd; // provides `gi... |
#include <iostream>
#include <stack>
#include <vector>
#include<stdio.h>
using namespace std;
struct Node {
int p;
int putr;
struct Node* son;
};
typedef struct Node NODE;
void printchild(int i, vector<NODE*>v,int n){
// if(flag==0){
int count=0;
for(int t=0; t<n; t++){
if(v[t]->p==i)... |
#include <chrono>
#include <cstdio>
#include <iostream>
#include <memory>
#include <string>
#include <thread>
#include <tuple>
#include <type_traits>
#include <utility>
//
template <typename F, typename Tuple, std::size_t... S>
auto invoke_helper(F&& f, Tuple&& args, std::index_sequence<S...>)
{
return std::forward<F... |
#include <QCoreApplication>
#include <ros/ros.h>
#include <librosqt/QRosCallBackQueue.h>
#include "TestObject.h"
#include <std_msgs/String.h>
#include <QDebug>
#include <QThread>
void onNewMessage(std_msgs::StringConstPtr _msg)
{
qDebug() << "Message received in thread : " << QThread::currentThreadId() << " : " <... |
#include "../include/logger.hh"
#include <iostream>
#include <iomanip>
std::mutex logger::logmsg_mutex;
std::string logger::application_name;
std::ofstream logger::log_out;
void logger::init_logging(std::string application_name, std::string log_path) {
logger::application_name = application_name;
logger::log_... |
#include <iostream>
#include <string>
using std::cin;
using std::cout;
using std::endl;
// カードを格納
string s[3];
// A, B, Cのカードの配列の位置
// カードのイテレータの初期値
int ap = -1;
int bp = -1;
int cp = -1;
int game(int participant) {
if (participant == 0) {
ap++;
// 勝利条件
if (!s[participant][ap]) return participant;
... |
//Using dfs. Time-0.310s
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
vll graph,sum;
vector<bool> visit;
ll dfs(ll u)
{
visit[u] = true;
ll tot = 0;
if(graph[u] != -1 && !visit[graph[u]])
tot += 1 + dfs(graph[u]);
visit[u] = false;
return sum[... |
#pragma once
#include <string>
#include <string.h>
#include <stdio.h>
#include "Util.h"
//具体的服务节点
class Node
{
public:
Node(int id, const char* ip, unsigned short port, bool isheart)
{
this->id = id;
strcpy(this->ip,ip);
this->port = port;
this->isheart = isheart;
}
char ip[64];
char des[128]... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 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 OpOCSPRequestProducer.h
*
* OCSP request producer platf... |
import rita.*;
import processing.serial.*; //LECTURA ARDUINO
//timer
int time;
int wait = 2000;
int time2;
int wait2 = 100000;
//LECTURA ARDUINO
Serial port;
int end = 10;
int val0, val1, val2, val3, val4, val5; //numero del valor de EMF
String serial; //valor EMF en String (del Serial)
int txt=int(random(0, ... |
#pragma once
#include "Preamble.h"
class Interface{
public:
// Main minimising method
virtual mat minimise(double chisq) = 0;
// Methods to report if finished
virtual bool isFinished() = 0;
};
|
/* -*- 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.
*
* @author Arjan van Leeuwen (arjanl)
*/
#include "core/pch.h"
#... |
#include <stdio.h>
#include <string.h>
#define maxn 10000500
char ans[maxn];
char *strrev(char *str){
char *p1, *p2;
if (! str || ! *str){
return str;
}
for (p1 = str, p2 = str + strlen(str) - 1; p2 > p1; ++p1, --p2){
*p1 ^= *p2;
*p2 ^= *p1;
*p1 ^=... |
#include"conio.h"
#include"stdio.h"
void main(void){
int b1=2,a=1,b=0,l;
clrscr();
scanf("%d",&l);
while(l<a){
a*=b1;
b++;
if(a==l){
printf("\n\t%d",b);
break;
}
else {
printf("\n\t%d",b+1);
break;
}
}
// printf("\n\t%d",b-1);
getch();
} |
#include <bits/stdc++.h>
using namespace std;
int i,j,l1,l2,k,c;
int arr[1006][1006];
char str1[1005],str2[1005];
int main()
{
int m;
while(gets(str1)){
gets(str2);
l1=strlen(str1);
l2=strlen(str2);
for(i=0;i<=l1;i++)arr[0][i]=0;
for(i=0;i<=l2;i++)arr[i][0]=0;
c=0;
for(i=1;i<=l2;i... |
#include "Obj.hpp"
int main(int argv, char** args)
{
Obj obj;
return 0;
}
|
// SPDX-FileCopyrightText: 2021 Samuel Cabrero <samuel@orica.es>
//
// SPDX-License-Identifier: MIT
#include <Buzzer.h>
#include <Comm.h>
#include "armored.h"
#include "config.h"
#include "global.h"
TArmored::TArmored() {
}
const char *TArmored::name() const {
return STATE_ARMORED_STR;
}
void TArmored::enter() {... |
#include<iostream>
#include<string.h>
using namespace std;
//Ajilchin class todorhoiloh
class employee{
//private handaltiin tuvshintei gishuun ogogdol bolon function
private:
int id;
char *name;
char *tushaal;
float time;
float zah_salary();
public:
float salary();
bool increase_time(fl... |
/// \file NiCfActionInitialization.cc
/// \brief Implementation of the NiCfActionInitialization class; adapted from
/// Geant4 example B5 B5ActionInitialization.cc
#include "NiCfActionInitialization.hh"
#include "NiCfPrimaryGeneratorAction.hh"
#include "NiCfRunAction.hh"
#include "NiCfEventAction.hh"
#include "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.