text stringlengths 8 6.88M |
|---|
#include "loginwidget.h"
#include "ui_loginwidget.h"
#include "ui/Callbacks/Login.h"
#include "ui/UserData/UserData.h"
LoginWidget::LoginWidget(QWidget *parent) :
QStackedWidget(parent),
ui(new Ui::LoginWidget) {
ui->setupUi(this);
this->resize(810, 550);
this->setMinimumSize(810, 550);
this->... |
// **************************************
// File: glenv.h
// Copyright: Copyright(C) 2013-2017 Wuhan KOTEI Informatics Co., Ltd. All rights reserved.
// Website: http://www.nuiengine.com
// Description: This code is part of NUI Engine (NUI Graphics Lib)
// Comments:
// Rev: 2
// Created: ... |
#include <iostream>
#include <sstream>
#include <vector>
#include <list>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <string>
#include <set>
#include <stack>
#include <cstdio>
#include <cstring>
#include <climits>
using namespace std;
struct Node {
int id... |
#ifndef __PAGEUSERLIST_H
#define __PAGEUSERLIST_H
#include "CtrlWindowBase.h"
//#include "MUser2.h"
#include "VUserCtrlPanel.h"
namespace wh{
//---------------------------------------------------------------------------
class ModelPageUserList : public IModelWindow
{
public:
ModelPageUserList(const std::shared_ptr<... |
#include <iostream>
using namespace std;
int main()
{
typedef unsigned int udb;
udb i = 5 , j = 2;
cout << " Nilai i = " << i;
cout << "Nilai j = " << j;
return 0;
}
|
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "Character/CSCharacter.h"
#include "CSAdvancedAI.generated.h"
/**
*
*/
UCLASS()
class UE4COOP_API ACSAdvancedAI : public ACSCharacter
{
GENERATED_BODY()
public:
/** Initialize Defa... |
/* -*- 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.
*/
#ifndef DESKTOPOPSYSTEMINFO_H
#define DESKTOPOPSYSTEMINFO_H
#incl... |
#include <iostream>
#include <string>
bool check(int day,int month) {
if(1 > month || 12 < month || 1 > day) {
return false;
}
if((1 == month || 3 == month || 5 == month || 7 == month || 8 == month || 10 == month || 12 == month) && 31 < day) {
return false;
} else if(2 == month && 28 < ... |
/*******************************************************************
* Neural Network Training Example
* ------------------------------------------------------------------
* Bobby Anguelov - takinginitiative.wordpress.com (2008)
* MSN & email: banguelov@cs.up.ac.za
*************************************************... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-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"
#include "modules/database/src/opdatabase_b... |
#ifndef CONNECTOR
#define CONNECTOR
#include "message.hpp"
#include <iostream>
#include <sstream>
#include <vector>
#include <cstring>
#ifdef WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "Mswsock.lib")
#pragma comment(lib, "AdvApi32.lib")
#include <baset... |
#include<bits/stdc++.h>
using namespace std;
main()
{
int n,k,m1,m2,sum=0;
while(scanf("%d %d",&n,&k)==2)
{
sum=n;
m1=n/k;
m2=n%k;
n=m1+m2;
if(n>=k)
{
sum+=m1;
while(k<=n)
{
m1=n/k;
m2=n%k;
... |
// Created on: 2002-04-15
// Created by: Alexander Kartomin (akm)
// Copyright (c) 2002-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 ver... |
#pragma once
#include "Render/DrawBasic/BufferLayout.h"
namespace Rocket
{
Interface IndexBuffer
{
public:
virtual ~IndexBuffer() = default;
virtual void Bind() const = 0;
virtual void Unbind() const = 0;
virtual uint32_t GetCount() const = 0;
};
} |
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int n;
vector<int> v;
int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cin >> n;
while(n--){
int tp;
cin >> tp;
v.push_back(tp);
}
sort(v.begin(), v.end());
int ans = 0;
... |
//============================================================================
// Name : functions.cpp
// Author : Ben Newey
// Version :
// Copyright : Your copyright notice
// Description : All basic functions for port reading / mysql / json sending to UI
//==========================================... |
/****************************************************************************
** Meta object code from reading C++ file 'relationediteur.h'
**
** Created by: The Qt Meta Object Compiler version 67 (Qt 5.8.0)
**
** WARNING! All changes made in this file will be lost!
*****************************************************... |
/* -*- 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... |
//
// Created by user24 on 2019/11/16.
//
#ifndef LAB_DS_LAB3_BITREE_CC
#define LAB_DS_LAB3_BITREE_CC
#include <fstream>
#include "BiTree.hh"
#include "BiNode.hh"
namespace lab3 {
template<typename T>
auto BiTree<T>::length() -> size_t {
size_t length = 0;
preOrder([&length](Node &node) {
return length++, t... |
#include "SceneRenderer.h"
#include <glm/gtx/transform.hpp>
#include "../OpenGL/RenderTarget.h"
#include "../OpenGL/VertexArray.h"
#include "../OpenGL/Shader.h"
#include "../OpenGL/MeshGenerator.h"
#include "../OpenGL/TextureCubeMap.h"
#include "../OpenGL/OpenGLState.h"
#include "../OpenGL/Camera.h"
#include "../Open... |
#include <iostream>
#include <cstring>
#include "preprocess.h"
#include "lexical.h"
#include "preprocess.h"
#include "grammar.h"
#include "parser.h"
#include "rep/prog.h"
#include "interpreter.h"
using namespace std;
string workDir;
string getFolder (const string& str) {
size_t found;
found=str.find_last_of("/\\... |
#ifdef SUCK_TREECORE_GEOMETRY
#include "treeface/graphics/guts/GeomSucker.h"
#include "cairo-svg.h"
#include <treecore/Process.h>
#include <treecore/File.h>
#include <treecore/StringRef.h>
#include "treeface/graphics/guts/HalfOutline.h"
#include "treeface/graphics/guts/HalfEdgeNetwork.h"
#include "treef... |
#pragma once
#include <SFML/Graphics.hpp>
class Window{
public:
static sf::Image image;
static sf::RenderWindow window;
}; |
#include "simexamples/SimFramework.h"
#include "include/SimException.h"
#include "SimExamples/triangle/ExmTriangle.h"
#include "SimExamples/voronoi/ExmVoronoi.h"
int WINAPI
WinMain( __in HINSTANCE hInstance, __in_opt HINSTANCE hPrevInstance, __in LPSTR lpCmdLine, __in int nShowCmd )
{
try {
//SIM_EXCEPTION("ERROR"... |
#include<cstdio>
using namespace std;
int n,k;
bool zhi[10010]={1,1};
int main()
{
scanf("%d%d",&n,&k);
for(int i=2;i<=n;i++)
for(int j=2;j<=n/i;j++)
zhi[i*j]=1;
int flag=0;
for(int i=2;i<=n-k;i++)
{
int j=i+k;
if(!zhi[i] && !zhi[j])
{
printf("%d %d\n",i,j);
f... |
class PartFueltank : CA_Magazine
{
scope = 2;
count = 1;
type = 256;
model = "\dayz_equip\models\fueltank.p3d";
picture = "\dayz_equip\textures\equip_fueltank_ca.paa";
displayName = $STR_EQUIP_NAME_8;
descriptionShort = $STR_EQUIP_DESC_8;
class ItemActions
{
class Crafting
{
text = $STR_EPOCH_PLAYE... |
// Created on: 1997-03-03
// Created by: Yves FRICAUD
// Copyright (c) 1997-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... |
//
// Created by Brady Bodily on 4/22/17.
//
#ifndef ITAK_KEYCOUNT_HPP
#define ITAK_KEYCOUNT_HPP
class KeyCount {
private:
int Key;
int Count;
public:
KeyCount(int key){Key = key; Count = 1;}
int GetKey(){return Key;}
int GetCount(){return Count;}
void SetKey(int key){Key = key;}
void Inc... |
#include "spi.h"
#include <stdio.h>
//#include "cterm/ctermcore.h"
//---- cfiler_native.cpp から流用+α
#ifdef DEBUG
struct FuncTrace
{
FuncTrace( const char * _funcname, unsigned int _lineno )
{
funcname = _funcname;
lineno = _lineno;
printf( "FuncTrace : Enter : %s(%)\n", funcname, lineno )... |
/******<CODE NEVER DIE>******/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define FastIO ios_base::sync_with_stdio(0)
#define IN cin.tie(0)
#define OUT cout.tie(0)
#define CIG cin.ignore()
#define pb push_back
#define pa pair<int,int>
#define f first
#define s second
#define FOR(i,n,m) for(ll i=... |
#include <bits/stdc++.h>
typedef long double LD;
typedef long long LL;
typedef unsigned long long ULL;
typedef unsigned int uint;
using namespace std;
void dfs(int x, vector< vector<int> >& g, vector<int>& v) {
set<int> w;
for (int i = 0; i < (int)g[x].size(); ++i) {
dfs(g[x][i], g, v);
w.insert(v[... |
/****************************************************************************
**
** Copyright (C) 2005-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the example classes of the Qt Toolkit.
**
** Licensees holding a valid Qt License Agreement may use this file in
** accordance with the rights, respo... |
#include <iostream>
#include <vector>
#include <initializer_list>
#include <utility>
#include <stdexcept>
#include <list>
template<class KeyType, class ValueType, class Hash = std::hash<KeyType>>
class HashMap {
private:
std::vector<std::vector<typename std::list<std::pair<const KeyType,
ValueType>>::... |
/* -*- 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.
*
* THIS FILE IS AUTOMATICALLY GENERATED - DO NOT EDIT!
*
*/
#in... |
#include "GameObject.h"
#include "Sound.h"
#include "sdlwrap.h"
#include <SDL_render.h>
#include <string>
using std::vector;
Zombie::Zombie(int x, int y)
: _x(x), _y(y)
{
_hp = Zombie::defaultHp();
}
float Zombie::x() const { return _x; }
float Zombie::y() const { return _y; }
void Zombie::x(float x) { _x = x; ... |
#ifndef ITEM_H_
#define ITEM_H_
#include <string>
#include "Triggers.h"
#include "Status.h"
using namespace std;
class Item{
public:
Item();
string getName();
void setName(string);
Status getStatus();
void setStatus(Status);
string getWriting();
void setWriting(string);
string getOnFlag();
void setOnFl... |
/**
* Copyright (c) 2015, Timothy Stack
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of condi... |
/*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* 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 applic... |
// Copyright (c) 2017 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<iostream>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
class Solution {
public:
vector<int> intersection(vector<int>& nums1, vector<int>& nums2) {
//基本思想:双指针,与algo里面的set_intersection算法一致
vector<int> res;
set<int> s1,s2;
for(auto num:nums1)
... |
template<class IntegerType>
struct TRatio {
IntegerType up, down;
explicit TRatio(IntegerType u) : up(u), down(1) {}
TRatio(IntegerType u, IntegerType d) {
assert(d != 0);
const IntegerType g = gcd(u, d);
up = u / g;
down = d / g;
if (down < 0) {
up *= -1;
down *= -1;
}
}
In... |
#include "GameGlobal.h"
HINSTANCE GameGlobal::mHInstance = NULL;
HWND GameGlobal::mHwnd = NULL;
LPD3DXSPRITE GameGlobal::mSpriteHandler = NULL;
int GameGlobal::mWidth = 400; //900 test //400
int GameGlobal::mHeight = 225; //600 test //250
int GameGlobal::liveCount = 0;
LPDIRECT3DDEVICE9 GameGlobal::mDevice = nullptr... |
#ifndef UNITATTACK_H
#define UNITATTACK_H
#include "../Specifications.h"
#include "../units/Unit.h"
class Unit;
class UnitAttack {
public:
UnitAttack();
virtual ~UnitAttack();
virtual void attack(Unit& enemy, Unit& attacker);
virtual void counterAttack(Unit& enemy, Unit& ... |
/****************
* These implementations are copied from pgmultilineedit.h. Some changes are
* made to fix some bugs and also to change some behaviour.
* "Change:" and "CHANGE:" tags help you find these changes.
*/
#include <pgapplication.h>
#include "WidgetMultiLineEdit.hh"
#include "WidgetScrollBar.hh"
using ... |
// Created on: 2015-12-15
// Created by: Varvara POSKONINA
// Copyright (c) 2005-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 2.... |
#pragma once
#include "afxcmn.h"
#include "afxwin.h"
// CSetServerIpPort 对话框
class CSetServerIpPort : public CDialogEx
{
DECLARE_DYNAMIC(CSetServerIpPort)
public:
CSetServerIpPort(CWnd* pParent = NULL); // 标准构造函数
virtual ~CSetServerIpPort();
// 对话框数据
enum { IDD = IDD_SETSERVERIP };
protected:
virtual void ... |
// PWM outputs connected to LED driver circuits
const int giallo1 = 3;//Red LED drive
const int giallo2 = 5;//Green LED drive
const int bianco = 6;//Blue LED drive
const int power = 4; //Always on for soundsensor
const int sensore_suono = 2; //Sensore sonoro attivo basso
// initial value for the variable resistors
lo... |
#ifndef IMAGEVIEWER_H
#define IMAGEVIEWER_H
#include <QMainWindow>
#include "qaction.h"
#include "qlabel.h"
#include "qmenu.h"
#include "qscrollarea.h"
#include "qscrollbar.h"
#include "qmenubar.h"
#include "qmessagebox.h"
#include "mouselabel.h"
class ImageViewer : public QMainWindow
{
Q_OBJE... |
#pragma once
namespace skybox
{
enum
{
BOX_TOP,
BOX_LEFT,
BOX_RIGHT,
BOX_FRONT,
BOX_BACK,
BOX_BOTTOM
};
void init();
void acquire();
void setTexture(char* name);
void reset();
void render();
void unacquire();
void release();
};
|
#ifndef LATTICE_HEADER
#define LATTICE_HEADER
class Lattice
{
private:
int nd;
int* lattice;
int nc;
int volume; // spatial volume
int lattice_size; // spatial volume * nc
// Pre-allocated space to make is_even more efficient.
int* internal_coord;
public:
Lattice(int... |
#include "thread_group.hpp"
#include <csetjmp>
#include <vector>
class jmp_thread_group
: public thread_group
{
public:
template<typename Function>
void launch(int num_threads, Function f)
{
// save the start state
state start_state;
if(!setjmp(start_state))
{
std::clo... |
#include <bits/stdc++.h>
using namespace std;
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
#define MAXN 100
#define INF 0x3f3f3f3f
#define DEVIATION 0.00000005
typedef long long LL;
bool table[MAXN+10][5];
int L[MAXN+10],R[MAXN+10];
int main(int argc, char const *argv[])
{
int kase;
scanf("%d",&... |
/* -*- 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.
*
* @author Petter Nilsen
*/
#ifndef OP_TOOLBAR_MENU_BUTTON_H
#def... |
#include "ThreadPool.h"
using std::thread;
using std::vector;
using std::mutex;
using std::lock_guard;
ThreadPool::ThreadPool(vector<thread>::size_type n) {
// TODO Create vector in initialisation
for (vector<thread>::size_type i(0); i < n; ++i)
threads.push_back(thread(&ThreadPool::thread_loop, this));
}
vo... |
#include "Accessory.h"
Accessory::Accessory()
{
}
Accessory::~Accessory()
{
}
void Accessory::Show()
{
cout << "이름 : " << name << endl;
cout << "가격 : " << price << endl;
cout << "마력 : " << stat << endl;
cout << "설명 : " << comment << endl;
cout << "갯수 : ";
if (count == 0)
cout << "매진";
else
cout << coun... |
#ifndef CONFIG_H
#define CONFIG_H
#include <string>
class Config
{
public:
struct Profile
{
int width;
int height;
bool fullscreen;
bool vsync;
bool supersampling;
bool showFPS;
bool fpsProfiling;
};
static Profile profile;
const std::string FILE_PATH = "config.cfg";
void readConfig();
void cre... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2002-2003 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Peter Karlsson
*/
#ifndef WINDOWSLANGUAGEMANAGER_H
#define WIN... |
/* XMRig
* Copyright (c) 2018-2020 SChernykh <https://github.com/SChernykh>
* Copyright (c) 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
* ... |
// #include <boost/multiprecision/cpp_int.hpp>
// using boost::multiprecision::cpp_int;
#include <bits/stdc++.h>
using namespace std;
// ¯\_(ツ)_/¯
#define f first
#define s second
#define p push
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define rep(i, begin, end) for (__typeof(end) i = (begin) -... |
#include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *deleteDuplicates(ListNode *head) {
if(!head) return nullptr;
ListNode *fhead = new ListNode(head->val+1);
... |
/*
19.07.20
LG codepro - 데이터 리오더링
*/
#include <iostream>
using namespace std;
unsigned int Make_Data(unsigned int rcv);
// 작성할 함수
unsigned int Make_Data(unsigned int rcv)
{
int sol = 0;
sol = (rcv&15) <<28 ;
sol += ((rcv>>15) & 15) << 24;
sol += ((rcv>>26) & 63) << 18;
sol += ((rcv>>9) & 3)<<16;
sol ... |
#include <iostream>
#include <cstring>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n, m;
int res=0;
cin>>n>>m;
if (n!=m){
cout<<2;
}
else{
res=m;
for (int i=2;i*i<=m;i++){
if(n%i==0){
res=i;
break;
}
}
cout<<res;
}
} |
#include "stdafx.h"
#include "QuizPlayer.h"
#include "Quiz.h"
#include "MockQuizView.h"
//#include <vld.h> // Visual Leak Detector. Download and install from http://vld.codeplex.com
using namespace qp;
using namespace std;
struct QuizPlayerTestSuiteFixture
{
QuizPlayerTestSuiteFixture()
:quiz(make_sha... |
#ifndef __Student__
#define __Student__
#include <iostream>
#include <string>
class Student
{
public:
Student();
Student(
const std::string& first_name,
const std::string& last_name,
const std::string& subject_name,
const int age);
~Student() = default; /* c++ 11 */
... |
//===========================================================================
//! @file scene_toon.h
//! @brief デモシーン トゥーン
//===========================================================================
#pragma once
//===========================================================================
//! @class SceneToon
//====... |
#include "gtest/gtest.h"
#include "../../../../options/Option.hpp"
#include "../../../../options/OptionPut.hpp"
#include "../../../../binomial_method/case/Case.hpp"
#include "../../../../binomial_method/case/Wilmott1Case.hpp"
#include "../../../../binomial_method/method/regular/american/AmericanBinomialMethod.hpp"
dou... |
#pragma once
namespace Game
{
class Module
{
public:
virtual void update() = 0;
virtual void draw() = 0;
virtual void start() = 0;
virtual void stop() = 0;
virtual void configure() = 0;
virtual void cleanup() = 0;
};
}
|
#pragma once
#include <string>
#include "Sender.h"
using namespace std;
class Mail
{
public:
Mail(string title, string contents, string t);
friend Sender& Sender::operator<<(Mail& mail);
private:
string _title;
string _contents;
string _time;
};
|
#ifndef FIELDDESCRIPTORCONTAINER_H
#define FIELDDESCRIPTORCONTAINER_H
#include <QtGui/QWidget>
#include <QString>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
#include <google/protobuf/generated_message_util.h>
template<class Object>
class FieldDescriptorContainer
{
pro... |
#pragma once
#include "../Hardware/Registers.hpp"
#include <avr/interrupt.h>
namespace Drivers
{
enum ExternalInterruptPin { i0 = 0, i1 = 2 };
enum ExternalInterruptType { low, change, toLow, toHigh };
template< ExternalInterruptPin Tp, ExternalInterruptType Tt>
class ExternalInterrupt
{
public... |
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
int N, M;
int nCnt = 1;
int nMap[100][100];
int nChecked[100][100];
int dy[4] = { 0, 0, -1, 1 };
int dx[4] = { -1, 1, 0, 0 };
void bfs(int y,int x)
{
queue<pair<int, int>> q;
q.push(make_pair(y, x));
n... |
namespace iberbar
{
template < typename T >
class TGrowArray
{
public:
TGrowArray( void )
: m_count( 0 )
, m_data( NULL )
{
}
TGrowArray( const TGrowArray& dest )
: m_count( 0 )
, m_data( NULL )
{
if ( dest.m_data )
{
m_data = new T[ dest.m_count ];
memcpy_s( m_data, sizeof( T... |
#include <algorithm>
#include <cstdlib>
#include <fstream>
#include <functional>
#include <iostream>
#include <memory>
#include <numeric>
#include <sstream>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <variant>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
#include <getopt.h... |
// Copyright (c) 2018-2023 Conceal Network & Conceal Devs
//
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "Common/CommandLine.h"
namespace {
const command_line::arg_descriptor<std::string> arg_wallet_file = { ... |
// MFC3(2)View.h: CMFC32View 类的接口
//
#pragma once
class CMFC32View : public CView
{
protected: // 仅从序列化创建
CMFC32View() noexcept;
DECLARE_DYNCREATE(CMFC32View)
// 特性
public:
CMFC32Doc* GetDocument() const;
// 操作
public:
// 重写
public:
virtual void OnDraw(CDC* pDC); // 重写以绘制该视图
virtual BOOL PreCreateWindow(C... |
#ifndef OUTPUT_H
#define OUTPUT_H
#include "global.h"
class Output {
public:
void save_at(Data *d);
void save_arrivals(vector<Receiver> receivers,const Data &d);
void save_spherical_cuts(const Source &);
void save_err_vs_dist(const Source &);
void save_err_surface(const Source &);
};
#endif |
#pragma once
#include <cmath>
class PriorityQueue
{
public:
PriorityQueue();
~PriorityQueue();
int Top() { if (rozmiar != 0) return kopiec[0].vertrex; }
void push(int, int *);
void pop();
int extract();
void write();
int size() { return rozmiar; }
bool empty() { if (rozmiar == 0) return true; return false; }
... |
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
main()
{
ll n, x;
while(cin>>n>>x)
{
ll i, j, c=0, k=n;
for(i=1; i<=n; i++)
if(x/i<=n && x%i==0)c++;
cout<<c<<endl;
}
return 0;
}
|
#include "Graph.h"
#include "Edge.h"
#include "Vertex.h"
#include <string>
#include <iostream>
using namespace std;
/**
* @return The number of vertices in the Graph
*/
template <class V, class E>
unsigned int Graph<V,E>::size() const {
// TODO: Part 2
return vertexMap.size();
}
/**
* @return Returns the degree ... |
#include "Stonewt.h"
#include <iostream>
//enum { Lbs_per_stn = 14 };//pounds per stone
using namespace std;
int main()
{
Stonewt a(30);
cout << a;
Stonewt b(2, 11);
cout << b;
Stonewt c = a + b;
cout << c;
c.setMode(Stonewt::STONE);
cout << c;
c.setMode(Stonewt::FRACTIONAL_POUNDS);
cout << c;
c.setMode(Sto... |
#ifndef LED_h
#define LED_h
#include "Arduino.h"
class LED {
public:
LED(int pin);
void on();
void on(int pwm);
void off();
private:
int ledpin;
};
#endif
|
#ifndef MITAMA_ANYHOW_ANYHOW_HPP
#define MITAMA_ANYHOW_ANYHOW_HPP
#include <mitama/anyhow/error.hpp>
#include <mitama/result/detail/fwd.hpp>
#include <memory>
namespace mitama::anyhow {
template <class T>
using result = result<void_to_monostate_t<T>, std::shared_ptr<::mitama::anyhow::error>>;
}
#endif
|
#include <assert.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <reactor/net/Acceptor.h>
#include <reactor/base/SimpleLogger.h>
namespace reactor {
namespace net {
static void default_conn_callback(int fd, const InetAddress &addr, Timestamp time) {
LOG(Info) << "[" << addr.to_string() << "] ... |
#include "gpu_utilities.h"
#include "definitions.h"
#include "jit4ptx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <cuda.h>
// Define the pointers to the kernels
CUfunction haddKernel = nullptr;
CUfunction hmodifyKernel = nullptr;
CUfunction haddKernel_part = nullptr;
CUfunction hmodifyKernel... |
template <typename T>
inline Vector<T,2>::Vector() :
x(0),
y(0)
{
}
template <typename T>
inline Vector<T,2>::Vector(T x, T y) :
x(x),
y(y)
{
}
template <typename T>
inline Vector<T,2>::Vector(std::initializer_list<T> l)
{
assert(l.size() == 2 && "Vector2 must have 2 values\n");
data[0] = l.begin()[0];... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-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"
#include "modules/encodings/utility/opstri... |
#ifndef FILEMGR_H
#define FILEMGR_H
///////////////////////////////////////////////////////////////////////
// SizeFileMgr.h - Find sizes of files matching specified patterns //
// Ver 1.1 //
// Jim Fawcett, CSE687 - Object Oriented Design, Fall 2018 ... |
#include <allegro5/allegro.h>
#include <allegro5/allegro_font.h>
#include <allegro5/allegro_ttf.h>
#include <allegro5/allegro_primitives.h>
#include <allegro5/allegro_image.h>
#include <allegro5/allegro_audio.h>
#include <allegro5/allegro_acodec.h>
#include <iostream>
#include <vector>
#include <string>
#include <time.... |
#include<iostream>
using namespace std;
class A
{
int i;
public:
// A(){}
// A(int x) : i(x){}
int operator () (int x)
{
i=x;
return i;
}
};
int main()
{
A a;
cout<<a(3)<<endl;
cout<<a(5)<<endl;
}
|
#include <iostream>
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void solve(){
int n;
cin>>n;
vector<int>a(n);
vector<int>b(101);
for(int i=0;i<n;i++) cin>>a[i],b[a[i]]++;
for(int i=0;i<=100;i++){
if(b[i]>0){
cout<<i<<" ";
b[i]--;
}... |
bool ispalindrome(string str,int i,int j){
while(i<j){
if(str[i]!=str[j]) return false;
i++;
j--;
}
return true;
}
int solve(string str,int i,int j,vector<vector<int>>&dp){
if(i>=j) return 0;
if(ispalindrome(str,i,j)) return 0;
... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) Opera Software ASA 2009-2011
*
* WebGL GLSL compiler -- pretty printer.
*
*/
#include "core/pch.h"
#ifdef CANVAS3D_SUPPORT
#include "modules/webgl/src/wgl_pretty_printer.h"
/* virtual */ WGL_Decl *
WGL_PrettyPrinter... |
#include<stdio.h>
main()
{
char s1[20]="abcdef";
puts(s1);
}
|
#include "EnemyAttack.h"
float EnemyAttack::BULLET_ATTACK_GAP_X = 0.002f;
float EnemyAttack::BULLET_ATTACK_GAP_Y = 0.3f;
float EnemyAttack::KNIFE_ATTACK_GAP_X_BIGGER = 0.013f - 0.002f;
float EnemyAttack::KNIFE_ATTACK_GAP_X_SMALLER = 0.013f;
float EnemyAttack::KNIFE_ATTACK_GAP_Y = 0.25f;
// Constructor
Enem... |
// Created on: 1998-07-30
// Created by: Christian CAILLET
// Copyright (c) 1998-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 ... |
#include <SDL2/SDL.h>
#include <glad/glad.h>
#include <spdlog/spdlog.h>
#include <debug_break/debug_break.h>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <string>
#include <unordered_map>
#include "common/app.h"
#include "common/gl-exception.h"
#include "common/square-data.h"
std::unordered... |
#include "loginpage.hpp"
LoginPage::LoginPage(QWidget *parent): QVBoxLayout(parent)
{
creation = new QPushButton("Create an account !", parent);
connection = new QPushButton("Login !", parent);
QObject::connect(creation, SIGNAL(clicked()), this, SLOT(switchToCreate()));
QObject::connect(connection, SI... |
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef pair<int,int> pii;
typedef long double ld;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
const int maxn=200005;
const int INF=0x3f3f3f3f;
const double pi=acos(-1.0);
const double eps=1e-9;
tem... |
#pragma once
#include <functional>
#include <list>
#include <mutex>
using namespace std;
namespace nora {
template <typename Ret, typename... Args>
class functions {
public:
void operator()(Args... args);
typename list<function<Ret(Args...)>>::iterator add(con... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-1999 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_LSOUTPUT
#define DOM_LSOUTPUT
#ifdef DOM3_SAVE
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.