text stringlengths 8 6.88M |
|---|
/* -*- 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
*/
#ifndef VISUAL_DEVICE_HANDLER_H
#... |
/*
* Copyright (C) 2008 Alex Shulgin
*
* This file is part of png++ the C++ wrapper for libpng. PNG++ is free
* software; the exact copying conditions are as follows:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are me... |
#include <Windows.h>
#include <string>
#include <D3D11.h>
#include <d3dcompiler.h>
using namespace std;
//wnd thing
HINSTANCE g_hInstance(NULL);
HWND g_hWnd(NULL);
UINT g_winWidth(640);
UINT g_winHeight(480);
//d3d thing
ID3D11Device* g_dx11device(NULL);
ID3D11DeviceContext* g_dx11context(NULL);
IDXGI... |
// Created on: 2014-11-14
// 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.... |
#ifndef epic_cursor_h__
#define epic_cursor_h__
#include "image.h"
#include <array>
class Cursor {
public:
enum class Mode : int {
Normal,
PanningGallery,
PanningImage,
Selecting,
Selected,
Exit
};
template <typename T = int> T ordinal(Mode m) { return static_cast<T>(m); }
Cursor();
... |
// SimpleGraphic Engine
// (c) David Gowor, 2014
//
// Module: Core Image
//
#include "common.h"
#include "core_image.h"
#include "_lib/jpeglib.h"
#include "_lib/tiffio.h"
#include "_lib/png.h"
#ifndef __bool_true_false_are_defined
#define __bool_true_false_are_defined
#endif
#include "_lib/gif_lib.h... |
// simulation.cpp
#include <chrono>
#include <iostream>
#include "BlobCrystallinOligomer/simulation.h"
namespace simulation {
using movetype::MetMCMovetype;
using movetype::VMMCMovetype;
using std::chrono::steady_clock;
using std::cout;
using std::setw;
NVTMCSimulation::NVTMCSimulation(Conf... |
#pragma once
#include "events/event.hpp"
#include <LabRender/Camera.h>
#include <memory>
#ifdef _MSC_VER
// suppress warnings until USD is cleaned up
# pragma warning(push)
# pragma warning(disable : 4244 4305)
#endif
#include <pxr/usd/usd/stage.h>
#ifdef _MSC_VER
// suppress warnings until USD is cleaned up
#... |
/* -*- 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.
**
** Alexander Remen (alexr)
*/
#include "core/pch.h"
#ifdef M2_SU... |
#include <iostream>
using namespace std;
int main() {
const int num = 4;
int* ptr =(int*)(&num);
*ptr = 20;
cout <<&num<<" " <<num << endl;
cout << ptr << " " <<*ptr << endl;
return 0;
} |
// Created on: 1998-10-29
// Created by: Jean Yves LEBEY
// 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 GN... |
#pragma once
#include <SFML/System/Vector2.hpp>
#include <SFML/System/Vector3.hpp>
namespace pure
{
template <typename T>
float dot(sf::Vector2<T> lv, sf::Vector2<T> rv)
{
return lv.x * rv.x + lv.y * rv.y;
}
template <typename T>
float dot(sf::Vector3<T> lv, sf::Vector3<T> rv)
{
return lv.x * rv.x + lv.y... |
#include <settings/settings.h>
#include <GetFromFile.h>
Settings getSettings(const std::string &fileName) {
GetFromFile dataFile(fileName);
Settings settings;
settings.dt = dataFile.getWord<double>("timeStep");
settings.time = dataFile.getWord<double>("time");
settings.TLeft = dataFile.getWord<d... |
/*
* 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) 2019, tlblanc <tlblanc1490 at gmail dot com>
#ifndef OS_FILESTREAM_H_
#define OS_FILESTREAM_H_
#include <fcntl.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "io/sink.hpp"
#include "io/source.hpp"
#include <memory>
class FileException {
public:
F... |
#pragma once
#include "gameNode.h"
#include "vehicle.h"
#include "NPC.h"
class mainGame : public gameNode
{
private:
entity * _player;
npc* _character;
vector<vehicle*> _vCars;
float _zoom;
public:
mainGame();
~mainGame();
HRESULT init(void);
void release(void);
void update(void);
void render();
}; |
//
// Created by micky on 15. 5. 22.
//
#ifndef JUDGESERVER_JUDGE_H
#define JUDGESERVER_JUDGE_H
#include <iostream>
#include <string>
#include <vector>
#include "Thread.h"
#include "SemaphoreObejct.h"
#include "question.h"
#include "InetSocket.h"
using namespace Thread;
class Judge : public Thread::Thread{
private... |
#include<iostream>
using namespace std;
int main()
{
int i,sum=0;
for(i = 1; i <= 10; i++)
{
sum = sum + i;
}
cout<<"The sum of number from 1 to 10 is "<<sum;
return 0;
}
|
#pragma once
#include <bm.h>
namespace siu {
/**
* UID слоя на холсте.
*/
typedef std::string uidLayer_t;
/**
* Топология для обмена битовыми картами между объектами.
*/
typedef bm::bvector<> topology_t;
/**
* Декларация слоя.
*/
typedef std::pair< uidLayer_t, topology_t > layer_t;
// Методы ниже... |
#line 1 "D:/Clicks_git/B/Boost-INV_Click/SW/example/c/ARM/STM/Click_Boost_INV_STM.c"
#line 1 "d:/clicks_git/b/boost-inv_click/sw/example/c/arm/stm/click_boost_inv_types.h"
#line 1 "c:/users/public/documents/mikroelektronika/mikroc pro for arm/include/stdint.h"
typedef signed char int8_t;
typedef signed int int16_t... |
//
// C++ Implementation: mess
//
// Description:
//
//
// Author: Jally <jallyx@163.com>, (C) 2009
//
// Copyright: See COPYING file that comes with this distribution
//
//
#include "mess.h"
#include "utils.h"
PalInfo::PalInfo():ipv4(0), segdes(NULL), version(NULL), user(NULL), host(NULL),
name(NULL), group(NULL), p... |
#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>
#include <numeric>
typedef long long LL;
typedef unsigned lon... |
/*
* MIT License
*
* Copyright (c) 2017 by J. Daly at Michigan State University
*
* 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 ... |
#pragma once
#include <memory>
#include <QListWidgetItem>
#include <QDialog>
#include "PhoneticDictionaryViewModel.h"
namespace Ui {
class PhoneticDictDialog;
}
namespace PticaGovorun
{
class PhoneticDictionaryDialog : public QDialog
{
Q_OBJECT
public:
explicit PhoneticDictionaryDialog(QWidget *parent = 0);
... |
#include "Point.h"
Point::Point()
{
m_x = 0;
m_y = 0;
}
Point::Point(int x, int y)
{
m_x = x;
m_y = y;
}
int Point::GetX() const
{
return m_x;
}
int Point::GetY() const
{
return m_y;
}
void Point::PrintCordinates()
{
std::cout << "Cordinates are: (" << m_x << "," << m_y << ")" << std::en... |
//O(nlogn) Time and O(n) Space complexity solution
class Solution
{
public:
//Function to find maximum of each subarray of size k.
vector <int> max_of_subarrays(int *arr, int n, int k)
{
vector<int> ans;
priority_queue<pair<int,int>> pq;
for(int i =0;i<k;i++){
... |
#include <iostream>
#include <vector>
#include <queue>
#include <cstring>
#include <map>
#include <set>
using namespace std;
#define int long long
#define P pair<int,int>
#define pb push_back
#define endl '\n'
const int N = 3e5 + 5;
vector <int> Graph[N];
int vis[N];
vector <int> pol;
int n, k, d;
map <P, int> road;... |
#include<bits/stdc++.h>
using namespace std;
int main()
{
// only gravity will pull me down
// Print first n Fibonacci Numbers
int t, n;
cin >> t;
while (t--) {
cin >> n;
long dp[n+1];
dp[1] = 1;
dp[2] = 1;
for(int i=3; i<=n; i++)
dp[i] = dp[... |
//
// bwocc.hpp
//
//
// Created by Elliott Sloate on 10/22/20.
//
#ifndef bwocc_hpp
#define bwocc_hpp
#include <stdio.h>
#endif /* bwocc_hpp */
|
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
#pragma once
#include "../../Toolbox/Toolbox.h"
#include "Texture.h"
#include "../Image/Image.h"
namespace ae
{
class FramebufferAttachement;
/// \ingroup graphics
/// <summary>
/// 2D samplable data that can be link to a shader to be rendered.
/// </summary>
class AERO_CORE_EXPORT Texture2D : public Texture
... |
/*
========================================================================
DEVise Data Visualization Software
(c) Copyright 1992-1996
By the DEVise Development Group
Madison, Wisconsin
All Rights Reserved.
========================================================================
Under no circumstances ... |
#include <iostream>
bool stugum(char** &arr, int &x, int &y, int size) {
if((x == size) || (x == 0) || (y == 0) || (y == size)) {
return true;
} else if(*arr[x + 1] == '_' || *arr[x + 1] == '*') {
if(*arr[x + 1] == '_') {
*arr[x + 1] = '*';
} else {
*arr[x + 1] = '_';
}
return stugum(arr, ++x, y, siz... |
#include <cstdlib>
#include <time.h>
#include <iostream>
#include<fstream>
using namespace std;
#include "Restaurant.h"
#include "..\Events\ArrivalEvent.h"
Restaurant::Restaurant()
{
pGUI = NULL;
}
void Restaurant::RunSimulation()
{
pGUI = new GUI;
PROG_MODE mode = pGUI->getGUIMode();
switch (mode) //Add a fun... |
#include<iostream>
#include "game.h"
#include "map.h"
using namespace std;
int main()
{
make_map(? , ? , 10, 20);
make_map(? , ? , 10, 20);
make_map(? , ? , 10, 20);
// 게임 창 생성
int checking = 1;
char key;
while (checking)
{
cout << "K: 게임 시작 L : 게임 종료";
cin >> key;
switch (key)
... |
//
// talkservice.cpp
// AutoCaller
//
// Created by Micheal Chen on 2017/7/17.
//
//
#include "talkservice.hpp"
#include "imservice.hpp"
TalkService* TalkService::getInstance()
{
static TalkService inst;
return &inst;
}
IYouMeVoiceEngine* TalkService::getTalkEngine()
{
IYouMeVoiceEngine *engine = IYo... |
#include <iostream>
using namespace std;
int main()
{
int i=1, n;
cout<<"Enter any number to print the table:";
cin>>n;
cout<<"Table of "<<n<<endl;
do{
cout<<n<<" * "<<i<<" = "<<n*i<<endl;
i++;
}while(i<=10);
return 0;
}
|
/*
* Lanq(Lan Quick)
* Solodov A. N. (hotSAN)
* 2016
* LqWrk - Worker class.
* Recive and handle command from LqWrkBoss.
*/
#include "LqWrk.hpp"
#include "LqAlloc.hpp"
#include "LqWrkBoss.hpp"
#include "LqLog.h"
#include "LqOs.h"
#include "LqConn.h"
#include "LqTime.hpp"
#include "LqFile.h"
#include "LqAtm.hpp"
#incl... |
#include "stdafx.h"
#include "MultipliersMgr.h"
#include "Multipliers.h"
#include "Station.h"
#include "Qso.h"
#include "Contest.h"
MultipliersMgr::MultipliersMgr()
:
m_multipliersType(eMultUnknown),
m_station(nullptr),
m_instate(false),
m_multipliersBase(nullptr)
{
}
MultipliersMgr::~MultipliersMgr()
{
}
// ... |
// Copyright (c) 2011-2017 The Cryptonote developers
// Copyright (c) 2017-2018 The Circle Foundation & Conceal Devs
// 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 "GetHistoryProc.h"
#include "Logger.h"
#include "HallManager.h"
#include "Room.h"
#include "ErrorMsg.h"
//#include "UdpManager.h"
#include "ProcessManager.h"
#include "GameCmd.h"
#include "IProcess.h"
REGISTER_PROCESS(CLIENT_MSG_GETHISTORY, GetHistoryProc)
GetHistoryProc::GetHistoryProc()
{
this->name = "G... |
#include "core.h"
template<typename Type>
int* Minimal(Type* array, int size, int& minimal_quantity)
{
int* array_of_index = new int[size];
int minimal = 0;
minimal_quantity = -1;
for (int i = 0; i < size; i++)
if (array[i] < array[minimal])
minimal = i;
for (int i = 0; i < s... |
#include "QtExceL.h"
#include <ole2.h>
QtExcel::QtExcel()
{
m_pExcel = NULL;
m_pWorkbooks = NULL;
m_pWorkbook = NULL;
m_pWorksheet = NULL;
m_strXlsFile = "";
m_nRowCount = 0;
m_nColumnCount = 0;
m_nStartRow = 0;
m_nStartColumn = 0;
m_bIsOpen = false;
m_bIsVali... |
/* sha1.cpp
Copyright (c) 2005 Michael D. Leonhard
http://tamale.net/
This file is licensed under the terms described in the
accompanying LICENSE file.
*/
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <liblas/detail/sha1.hpp>
namespace liblas { namespace ... |
#include<iostream>
#include<cstdlib>
using namespace std;
class Queue
{
struct node {
int data;
node* link;
}*front,*rear;
public:
Queue();
void addNode(int);
void deleteNode();
void display();
};
Queue::Queue()
{
front = NULL;
re... |
/*
replay
Software Library
Copyright (c) 2010-2019 Marius Elvert
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, mod... |
/* -*- 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.
*/
#include "core/pch.h"
#if defined UPDATERS_ENABLE_MANAGER
#incl... |
#pragma once
#include "Analysis.hpp"
#include "Bispectrum.hpp"
#include "LISW.hpp"
#include "Helper.hpp"
#include <armadillo>
#include <string>
#include "stdafx.h"
#include "interpolation.h"
#include <fstream>
using namespace alglib;
using namespace arma;
using namespace std;
class Bispectrum_Fisher {
public:
... |
#include <iostream>
using namespace std;
int main()
{
long long t, x, y;
cin >> t;
for (int i = 0; i < t; i++)
{
cin >> x >> y;
cout << x << " " << x * 2 << endl;
}
} |
#pragma once
#include "led.h"
#include <stdexcept>
#include <iostream>
#include <Windows.h>
SetUrl_t * SetUrl;
SetLed_t * SetLed;
Clear_t * Clear;
Show_t * Show;
Wait_t * Wait;
SetChar_t * SetChar;
ShowMotioningText1_t * ShowMotioningText1;
ShowFirework_t * ShowFirework;
inline void loadLibrary(const... |
// -----------------------------------------------------------------------------
// G4_QPIX | TrackingSD.cpp
//
// TODO: Class description
// * Author: Justo Martin-Albo
// * Creation date: 13 Feb 2019
// -----------------------------------------------------------------------------
#include "TrackingSD.h"
#inclu... |
#include <stdio.h>
void main()
{
int a,q=1,w,N;
do
{
printf("enter number of kuan\n");
scanf("%d",&N);
while(w<=N)
{
printf("%d ",q);
q=q*w;
}
printf("\ntry again?");
scanf("%d",&a);
}while (a==1);
} |
#define _CRT_SECURE_NO_WARNINGS
#include <SFML/Graphics.hpp>
#include <zmq.hpp>
#include <string>
#include <iostream>
#include <windows.h>
#include "gameTime.h"
#include "GameObject.h"
#include "positionComponents.h"
#include "colorComponents.h"
#include "sizeComponents.h"
#include "movementComponents.h"
... |
//
// Created by micky on 15. 5. 24.
//
#include "Timer.h"
|
//
// FriendCAPI.cpp
// SwitchServer
//
// Created by Joel Liang on 2018/9/1.
//
#include <stdio.h>
#include <elastos/core/Object.h>
#include "ElastosCore.h"
#include "elatypes.h"
#include "FriendCAPI.h"
ECode friendGetUid(IFriend *iFriend, const char** pUid)
{
String uid;
ECode ec = iFriend->GetUid(&uid... |
// Copyright (C) 2014 Agustin Berge
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include <pika/future.hpp>
#include <pika/init.hpp>
#include <pika/testing.hpp>
#includ... |
// Author: WangZhan -> wangzhan.1985@gmail.com
#pragma once
#include "MessagePump.h"
#include "BasicTypes.h"
#include "ScopedHandle.h"
// Typical use #1:
// // Use only when there are no user's buffers involved on the actual IO,
// // so that all the cleanup can be done by the message pump.
// class MyF... |
/* * * * * * * * * * * * * * * *\
* Title: A programming demo *
* Author: Alex Shank *
* Date: 2007 *
\* * * * * * * * * * * * * * * */
#include "Variables.h"
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
gamevars::gamevars(void)
{
}
gamevars::~gamevar... |
class Solution {
public:
vector<vector<int>> getFactors(int n) {
vector<vector<int>> factors;
helper(factors, {}, n, 2);
return factors;
}
/* bool divisible(int n){
if(n != 2 && n%2 == 0) return true;
for(int i = 3; i*i <= n; i+=2){
if(n%i == 0) return true... |
#pragma once
#include <string>
#include <vector>
#include "Cargo.h"
/**
* ステージを表すクラス
*/
class Stage {
public:
// コンストラクタ
/**
* init_data 文字列で表した初期ステージ構成
*/
Stage(const std::string& init_data);
Stage(const Stage&) = delete;
Stage(Stage&&) = delete;
// デストラクタ
~Stage() = default;
// ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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"
#ifndef NS4... |
/* -*- 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.
*/
/**
* @file OpTrustAndSecurityButton.cpp
* @author rfz@opera.co... |
#include <iostream>
#include <cstring>
#include <set>
const int DAY = 1440;
int parse_time(const std::string &t)
{
return stoi(t.substr(0, 2)) * 60 + stoi(t.substr(3, 5));
}
int main()
{
std::cin.sync_with_stdio(false);
std::cin.tie(NULL);
std::string s, e, q, s_Time, s_Name;
std::set<std::string>... |
#include <iostream>
using namespace std ;
int array[10][10] ;
int count [10] ;
void add_graph(int a , int b, int array[10][10], int count[10]) {
array[a][b] = 1 ;
array[b][a] = 1 ;
count[a] = 1 ;
count[b] = 1 ;
}
void show_graph(int array[10][10]){
for (int i = 1; i < 10; i++) {
int... |
#ifndef epic_image_h__
#define epic_image_h__
#include <SDL.h>
#include <string>
class Image {
public:
// These two functions are such a bad idea (for at least two reasons)
static SDL_Renderer *sdl_renderer(SDL_Renderer *ren = nullptr) {
static SDL_Renderer *renderer = ren;
return renderer;
}
static... |
#include <fstream>
int main() {
std::fstream i("input.txt"), o("output.txt", 2);
int n, j, s = 0;
i >> n;
for (j = 1; j <= n; j++) {
if (n % j == 0)
s += j;
}
o << s;
} |
// Copyright (c) 2020 ETH Zurich
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#pragma once
#include <pika/config.hpp>
#include <pika/assert.hpp>
#include <pika/corouti... |
#pragma once
#include<memory>
#include <gvc.h>
class Situation;
/**
* A Transition describes the transition and the output between two situations
*/
class Transition {
public:
/**
* Constructs a new Transition with the given predecessor, successor, transition count and transition probability.
* Used when retrievin... |
#include "2-1.h"
#include <stdlib.h>
enum Gender { MALE=1, FEMALE=2};
typedef struct
{
char Name[20];
Gender Sex;
int Age;
char Phone_Number[20];
} Profile;
int main() {
int sex;
Profile H_Class[10];
// Profile *H_Class2;
Profile* H_Class3;
H_Class3 = new Profile [10];
cin >> H_Class[0].Name;
cin >> H_Class... |
#include<bits/stdc++.h>
#define rep(i,n) for (int i =0; i <(n); i++)
using namespace std;
using ll = long long;
const double PI = 3.14159265358979323846;
const ll MOD = 1000000007;
int main(){
string S;
cin >> S;
int N = (int)S.size();
for(int i = 0; i < N/2; i++){
if(S.at(i) !=... |
#ifndef REGISTRO_H
#define REGISTRO_H
#include <stdlib.h>
#include <fstream>
#include <sstream>
#include "Hora.h"
#include "Fecha.h"
class Registro
{
private:
Fecha f,
fUTC;
Hora h,
hUTC;
float magnitud,
latitud,
longitud,
... |
/* 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... |
/*
* Copyright 2021 The Android Open Source Project
*
* 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
#include <iostream>
#include <string>
using std::cout;
// end of recursion: print the rest
void myPrintfImpl(char const *rest)
{
while (*rest)
{
if (*rest == '%')
{
++rest;
}
cout << *rest++;
}
}
template<typename T, typename... Ts>
void myPrintfImpl(char c... |
#include "adaptive_heat_equation.hpp"
#include <iomanip>
#include "../tools/linalg.hpp"
namespace applications {
AdaptiveHeatEquation::AdaptiveHeatEquation(
std::shared_ptr<TypeXVector> vec_Xd,
std::unique_ptr<TypeYLinForm> &&g_lin_form,
std::unique_ptr<TypeXLinForm> &&u0_lin_form,
const AdaptiveHeat... |
#include <ezLCDLib.h>
ezLCD3 lcd;
int xPos = 25; // horizontal position
int yPos = 50; // vertical position
int width = 250;
int height = 35;
int option = 1; // 1=draw horizontal, 2=horizontal disabled, 3=vertical,
// 4=vertical disabled, 5=redraw horizontal,
// 6=redraw horizonta... |
//
// TCVec4f.cpp
// threecpp
//
// Created by CastingJ on 16/9/21.
//
//
#include "TCVec4f.h"
|
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2005 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
#ifndef _SVG_MOTIONPATH_H_
#define _SVG_MOTIONPATH_H_
#ifdef SVG_SUPPO... |
/*
Name: ������ʵ��
Copyright:
Author: Hill bamboo
Date: 2019/8/17 12:42:44
Description:
*/
#include <bits/stdc++.h>
using namespace std;
class BigInteger {
public:
vector<int> data;
BigInteger(int size) {
data = vector<int>(size, 0);
}
BigInteger(string nums) {
for (int i = nums.size() - 1; i >= 0; --i) ... |
#include "core.h"
void out(char** text)
{
for (int i = 0; i < 10; i++)
cout << text[i];
} |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "SamplingProfiler.h"
#include "CaptureData.h"
#include "OrbitClientData/FunctionUtils.h"
using orbit_client_protos::CallstackEvent;
using orbi... |
//
// Created by 周华 on 2021/5/1.
//
#ifndef RAYTRACING_VECTOR_H
#define RAYTRACING_VECTOR_H
#include <cassert>
class Vector3 {
public:
// 默认构造,初始化所有的值为0
Vector3() {
x = 0;
y = 0;
z = 0;
}
// 带参数的构造,以参数里的x、y、z初始化内部的值
Vector3(float x, float y, float z) {
this->x = x... |
#ifndef VECTOR_H
#define VECTOR_H
/*Обобщенное программирование - это создание кода. работающего
с разными типами. заданными в виде аргументов, причем эти типы
должны соответствовать специфическим синтаксическим и семантическим требованиям.*/
/*Обобщенное программирование поддерживается шаблонами, основываясь на раз... |
#pragma once
#include <thero/optional.hpp>
#include <vector>
template <typename T>
void emplaceOptional(th::Optional<T> data, std::vector<T>& storage)
{
if(data)
storage.emplace_back(std::move(*data));
}
template <typename T, typename Func>
T* findIf(std::vector<T>& storage, Func func)
{
auto result =... |
#ifndef RECOGNIZER_H
#define RECOGNIZER_H
#include "pixel.h"
#include "alphalevel.h"
#include "filereader.h"
#include <vector>
#include "dissimilarity.h"
class Recognizer{
public:
//Constructors
Recognizer();
Recognizer(FileReader fileReader);
//Functions
bool isTriangle(int sizeOfTriangle, std::vector<std::vec... |
#include "Bubble.h"
#include <QMessageBox>
#include <QTime>
#include <QMouseEvent>
Bubble::Bubble(QWidget *parent) : QWidget(parent)
{
Q_CHECK_PTR(parent);
qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
diameter = 30 + qrand() % 60;
setGeometry(qrand() % (parent->size().width() - diameter), qrand() % (p... |
#include<bits/stdc++.h>
using namespace std;
#define INF 100000000000
long long ans=INF;
long long n,a,b,c;
void dfs(long long num,long long cost){
if(num%4==0){
ans=min(ans,cost);
// cout<<ans<<endl;
}
if(num>3*n)
return;
dfs(num+1,cost+a);
dfs(num+2,cost+b);
... |
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
int test;
cin >> test;
for(int i = 0; i < test; i++){
}
return 0;
} |
//
// Created by new on 2016/11/8.
//
#ifndef HTTPSVR_HELPER_H
#define HTTPSVR_HELPER_H
#include <string>
#include <vector>
#include "json/json.h"
using namespace std;
class Helper {
public:
/**
* 过滤用户输入字符中的不合法字符
* 目前主要直接把一些特殊字符替换成空格,并去掉前后空格
* @param string $str 用户输入的字符
* @retu... |
#ifndef SYSTEM_H
#define SYSTEM_H
/*
* System.h
*
* Emulates the connections between each of the processors and memory
*
*/
class system {
// processors
// memory
};
#endif
|
// Datastructures.hh
#ifndef DATASTRUCTURES_HH
#define DATASTRUCTURES_HH
#include <string>
#include <vector>
struct TownData
{
std::string name;
int x;
int y;
};
class Datastructures
{
public:
Datastructures();
~Datastructures();
// Estimate of performance: constant.
// Short rational... |
#include "stdafx.h"
#include "head.h"
ICBCBank::ICBCBank()
{
int result;
char * errmsg = NULL;
char **dbResult; //是 char ** 类型,两个*号
int nRow, nColumn;
int i, j;
int index;
result = sqlite3_open("ICBCData.db", &db); //TODO:这里的逻辑有问题
if (result != SQLITE_CANTOPEN) //若打开失败,则创建
{
//若原来已经存在有这张表格,则不会创建表格,即不会影响正确... |
//https://projecteuler.net/problem=754
#include<iostream>
using namespace std;
bool RelativelyPrime (int a, int b) { // Assumes a, b > 0
for ( ; ; ) {
if (!(a %= b)) return b == 1 ;
if (!(b %= a)) return a == 1 ;
}
}
int gauss_fact(int n)
{
int ret = 1;
for(int i =1;i<n;i++)
{
if... |
#include "msg_0x82_updatesign_tw.h"
namespace MC
{
namespace Protocol
{
namespace Msg
{
UpdateSign::UpdateSign()
{
_pf_packetId = static_cast<int8_t>(0x82);
_pf_initialized = false;
}
UpdateSign::UpdateSign(int32_t _x, int16_t _y, int32_t _z, const String16& _text1, const String16& _text2, const String16& _text3, ... |
/*************************************************************************
> File Name: tmp/snowflake.cpp
> Author: billowqiu
> Mail: billowqiu@billowqiu.com
> Created Time: 2016-10-25 14:21:52
> Last Changed: 2016-10-25 14:21:52
*************************************************************************/
#include ... |
#include <algorithm>
#include "Client.h"
#include "Log.h"
#include "protocol.h"
#include "../JsonPacket.h"
#include "Helper.h"
using namespace evwork;
extern struct g_args_s g_args;
static const char *log_level_map[] = {"ERROR", "INFO", "DEBUG"};
static const char *action_map[] = {"过", "吃", "碰", "偎", "跑", "提", "胡"... |
/*
* 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/QuicAsyncTransportServer.h>
#include <quic/server/QuicServerTransport.h>
namespace quic {
Qui... |
class Solution {
public:
vector<int> GetLeastNumbers_Solution(vector<int> input, int k) {
priority_queue<int> Q;//½¨Á¢´ó¸ù¶Ñ
vector<int> ret;
if(k < 1 || input.size() < k){
return ret;
}
for(int i=0; i<input.size(); ++i){
if(Q.size() < k){
... |
#include <iostream>
#include <cstring>
using namespace std;
void readline()
{
char line[10];
cin.getline(line,9);
}
int getExpression();
int getTerm();
int getFactor();
bool isNum(char c)
{
if(c>='0' && c<='9')
return 1;
return 0;
}
int main()
{
int N;
cin >> N;
while(N--)
{
... |
/*
TouchKeys: multi-touch musical keyboard control software
Copyright (c) 2013 Andrew McPherson
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 you... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.