text stringlengths 8 6.88M |
|---|
#include "gl_utils.h"
//#if __GUEST
//#include "egl.h"
//#else
//#include "dprint.h"
//#include <GLES/gl.h>
//#include <GLES/glext.h>
//#define //EGL_ABORT ABORT
//#endif
size_t gl_sizeof(GLenum type)
{
size_t retval = 0;
switch(type)
{
case GL_BYTE:
case GL_UNSIGNED_BYTE:
retval = 1;
break;
case GL_SH... |
/* -*- Mode: c++; tab-width: 4; 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"
#include "platforms/posix/posix_ua_component_manager.h"
OP_ST... |
#ifndef HGRAPH_H
#define HGRAPH_H
#include <set>
#include <vector>
#include "Vertex.h"
#include "Edge.h"
#include "Attribute.h"
#include "Mark.h"
#include "VertexPos.h"
namespace graph
{
class HGraph
{
public:
typedef const Vertex* (HGraph::*filterAdjacentVertices)(const Vertex*, const Edge*);
/*construc... |
#include <iostream>
#include <limits>
#include <sstream>
#include <stdlib.h>
#include "claseeee.h"
using namespace std;
istream& operator>>(istream& in, Farmacie& f)
{
string s;
double p;
string nr;
int ang;
cout << "Citeste denumire: ";
getline(in, f.denumire);
do
{
try
... |
/**************************************************************************/
/* */
/* Copyright (c) 2013-2022 Orbbec 3D Technology, Inc */
/* */
/* PROPRIETA... |
int MinRepresstation(string S)
{
int i = 0, j = 1, k = 0;
int len = S.length();
S += S;
while(i < len && j < len)
{
k = 0;
while(k < len && S[i + k] == S[j + k])
k++;
if(k >= len)
break;
if(S[i + k] > S[j + k])
i = max(i + k + 1, j + 1);
else
j = max(i + 1, j + k +... |
#include<bits/stdc++.h>
#include<unistd.h>
#include<cmath>
using namespace std;
void findNextFit(vector<int> jobs, vector<int> block) {
system("clear");
cout<<"\n\nNEXT FIT\n";
int intfrag = 0;
int prev = -1;
vector<int> visited(block.size(), 0);
for(int i = 0; i < jobs.size(); i++) {
vector... |
//Author: Aishwarya Ketkar
//Date: 02/15/2015
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <vector>
using namespace std;
//Calculates the normal distribution CDF
double NormalCdfCalc (double x)
{
double a1 = 0.2548;
double a2 = -0.2844;
double a3 = 1.4214;
double a4 = -1.4531;
... |
#include <crtdbg.h>
#include "../VFS/IFile.h"
int main()
{
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
IFile* pFile = OpenDiskFile("test.txt", IFile::O_Truncate);
char buffer[] = "123456";
pFile->Write(buffer, offset_type(sizeof(buffer)));
pFile->ReserveSpace(offset_type(10));
... |
// Nama : Naufal Dean Anugrah
// NIM : 13518123
// Tanggal : 13 Februari 2020
// Topik : Inheritance, Polymorphism, Abstract Base Class
#include "C.hpp"
C::C() : B(), A() {}
void C::sing() {
B::sing();
A::sing();
}
|
/*
* Timer.cpp
*
* Created on: Jun 11, 2017
* Author: root
*/
#include "Timer.h"
namespace CommBaseOut
{
Timer::Timer():m_obj(0),m_type(OnceTimer),m_ID(0),m_interval(0),m_start(0),m_bePoint(0),m_tickPoint(0),m_elapseRound(0),m_delflag(false),m_ticks(0),m_round(0),m_tm(0)
{
}
Timer::~Timer()
{
if(m_obj)
... |
/*
===========================================================================
Copyright (C) 2017 waYne (CAM)
===========================================================================
*/
#pragma once
#ifndef ELYSIUM_CORE_DATA_COMMANDTYPE
#define ELYSIUM_CORE_DATA_COMMANDTYPE
namespace Elysium
{
nam... |
#ifndef FORMATTED_TOUCHSTONE_H
#define FORMATTED_TOUCHSTONE_H
// RsaToolbox
#include "Definitions.h"
#include "FormattedComplex.h"
#include "FormattedNetworkData.h"
// Qt
#include <QFile>
#include <QTextStream>
#include <QString>
#include <QStringList>
// C++ std lib
#include <complex>
#include <vector>
// ToDo: ... |
#include <stdio.h>
#include <stdlib.h>
main ()
{ /* ESTA FUNCIONANDO!!!!*/
int quadrante, x, y;
printf ("Informe o valor de X : \n");
scanf ("%d",&x);
printf ("Informe o valor de Y : \n");
scanf ("%d",&y);
if (x>0)
{
/* Pode estar no primeiro ou no quarto quadrante */
if (y>0)
{
/* ... |
#include "FileHandler.h"
#include "Logger.h"
#include <ctime>
FileHandler::FileHandler()
{
m_pLogger = Logger::getLogger();
}
FileHandler::~FileHandler()
{
}
bool FileHandler::createMatrixFromDoc( const char * InputFileName,
map<int, map<int, int>*>* pMatrix,
int& NodeCount)
{
bool Success... |
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
void increment(vector<short> &a, int k) {
int i = 0;
while (i < k && a[i] == 1) {
a[i++] = 0;
}
if (i < k) {
a[i] = 1;
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n... |
/*
* Lanq(Lan Quick)
* Solodov A. N. (hotSAN)
* 2016
* LqHttpAtz... - Make user uthorization.
*/
#include "LqOs.h"
#include "LqHttp.hpp"
#include "LqHttp.h"
#include "LqTime.h"
#include "LqAtm.hpp"
#include "LqHttpAtz.h"
#include "LqHttpMdl.h"
#include "LqStr.hpp"
#include "LqCrypt.h"
#define __METHOD_DECLS__
#inclu... |
#ifndef _CIRCLE_H
#define _CIRCLE_H
#include "sjfwd.h"
#include "shape.h"
#include "point.h"
class circle : public shape {
public:
double radius;
circle(double cx = 0, double cy = 0, double r = 1, double fl = false) {
this->center = point(cx, cy);
this->radius = r;
this->fill = fl;
}
bool ove... |
#ifndef UTILITEST_H_
#define UTILITEST_H_
#include <Eigen/Core>
#include <Eigen/Cholesky>
#include <Eigen/LU>
#include <cmath>
namespace vct {
template <typename T>
using State = Eigen::Matrix<T, Eigen::Dynamic, 1>;
template<typename T>
using Control = State<T>;
template<typename T>
using M... |
#ifndef FEMAS_SYSTEM_PRINT_FUNCTION_H_
#define FEMAS_SYSTEM_PRINT_FUNCTION_H_
#include <iostream>
inline std::ostream& operator << (std::ostream& os, const CUstpFtdcReqUserLoginField& ftdc_struct) {
os << "ftdc_struct(CUstpFtdcReqUserLoginField) ---> TradingDay:" << ftdc_struct.TradingDay
<< " UserID:" << ftdc_s... |
#include "SwapChain.h"
#include "GdiException.h"
import "GDIPlusManager.h";
GDIPlusManager gdipm;
VSwapChain::VFrame::VFrame(int width, int height, HWND hwnd, bool ICCColorAdjustment)
: frameArea(0, 0, width, height)
{
if (ICCColorAdjustment)
{
GDI_CALL_EXCEPT(Gdiplus::DllExports::GdipCreateFromHWNDICM(hwnd, &p... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e10
#define rep(i,n) for(int i=0; i<n; i++)
#define r... |
#pragma once
#include "ofMain.h"
#include "ofxFTGLFont.h"
#include "ofxFaceTracker.h"
class testApp : public ofBaseApp{
public:
void setup();
void update();
void draw();
void keyPressed (int key);
void keyReleased(int key);
void mouseMoved(int x, int y );
void mouseDragged(int x, int y, int button);... |
#ifndef TIPOVIEWER_H
#define TIPOVIEWER_H
#include "tipoqueue.h"
class TipoViewer
{
public:
TipoViewer();
virtual ~TipoViewer();
int menu();
void listar(TipoQueue*);
int buscar();
void mostrar(Tipo*);
void cargar(Tipo*, string);
void mensaje(... |
#include <math.h>
#include <gl\glut.h>
#include <gl\gl.h>
#include <gl\glu.h>
#include <string.h>
#include <stdlib.h>
float angle = 0.0, deltaAngle = 0.0;
float x = 0.0f, y = 1.75f, z = 5.0f; // tao do dung
float lx = 0.0f, ly = 0.0f, lz = -1.0f; // huong nhin
int deltaMove = 0;
int font = (int)GLUT_BITMA... |
/**
* @file test_fkbdb.cpp
*
* @author Fan Kai(fk), Peking University
* @date 09/25/2008 09:15:43 AM CST
*
*/
#include <fkbdb.h>
#include <iostream>
using namespace std;
int main() {
fk::BDB db("fkbdb.db");
cout <<db.exists(1) <<endl;
db.put(1, 2);
db.put(2, 4.5);
db.put<double, char>(3.3, ... |
#include <iostream>
#include <cstring>
#include <vector>
#include <stack>
#include <set>
int n, m, ID[41], ID_cnt, group[41], indegree[41];
bool finished[41];
std::set<int> link[41];
std::vector<std::vector<int>> SCC;
std::stack<int> stk;
int dfs(int idx)
{
ID[idx] = ++ID_cnt;
stk.push(idx);
int parent =... |
#ifndef OBJECT2ALIASED_HPP
#define OBJECT2ALIASED_HPP
#include "CustomMacros.hpp"
// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
class Object2Aliased : public QObject
{
QO2_ALIAS
public:
Object2Aliased();
signals:
void aSignal();
public slots:
void aSlot();
};
#endif
|
// Copyright (c) 2007-2017 Hartmut Kaiser
// Copyright (c) 2011 Bryce Lelbach
//
// 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 <KNoTThing.h>
#include <SoftwareSerial.h>
#define OPENING_SENSOR_PIN 2
#define OPENING_SENSOR_NAME "Opening Sensor"
#define OPENING_SENSOR_ID 69
#define BLUETOOTH_SENSOR_PIN 3
#define BLUETOOTH_POWER_PIN 4
#define BLUETOOTH_AT_PIN 5
#define BLUETOOTH_TX_PIN A0
#define BLUETOOTH_RX_PIN ... |
// Created on: 2017-02-16
// Created by: Sergey NIKONOV
// Copyright (c) 2008-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 a... |
/********************************************************************************
** Form generated from reading UI file 'dimensionement.ui'
**
** Created: Tue 16. Apr 16:14:38 2013
** by: Qt User Interface Compiler version 4.8.2
**
** WARNING! All changes made in this file will be lost when recompiling UI file!
*... |
// Copyright (c) 2015 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 ... |
// Created on: 1992-02-04
// Created by: Christian CAILLET
// 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 ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2000-2012 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** @author Yngve Pettersen
** @author Alexei Khlebnikov
**
*/
#... |
#include "MainWindow.h"
#include "ui_MainWindow.h"
#include <QPainter>
#include <QStatusBar>
#include <QLabel>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
setWindowIcon(QIcon("://app.ico"));
label = new QLabel(this);
ui->statusBar... |
/*
* ofAppAndroidWindow.h
*
* Created on: 24/05/2010
* Author: arturo
*/
#pragma once
#include "ofAppBaseWindow.h"
#include "ofEvents.h"
#include "ofConstants.h"
#include "ofTypes.h"
class ofAppAndroidWindow: public ofAppBaseGLESWindow {
public:
ofAppAndroidWindow();
virtual ~ofAppAndroidWindow();
sta... |
#pragma once
#include <stdio.h>
#include <ctime>
#include <conio.h>
#include <windows.h>
#include "time.h"
#include <string>
#include "webClock.h"
#include <iomanip>
#include <iostream>
#include "clockMenus.h"
#include "cursorSet.h"
using namespace std;
class webClock
{
public:
int h, m, s, mh;
string tod = "";
... |
#ifndef WALI_TEST_DOMAINS_KEYED_SEM_ELEM_SET_FIXTURES_HPP
#define WALI_TEST_DOMAINS_KEYED_SEM_ELEM_SET_FIXTURES_HPP
#include <string>
#include <vector>
#include "wali/domains/KeyedSemElemSet.hpp"
#include "wali/ShortestPathSemiring.hpp"
namespace {
using wali::ref_ptr;
using std::string;
using wali::sem_e... |
#include "bilinear_form.hpp"
#include <cmath>
#include <cstdlib>
#include <set>
#include <unordered_map>
#include "bases.hpp"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "integration.hpp"
#include "linear_operator.hpp"
int bsd_rnd() {
static unsigned int seed = 0;
int a = 1103515245;
int c = 123... |
#include <iostream>
#include <string>
using namespace std;
#include "PlayingCard.h"
PlayingCard::PlayingCard() {
}
PlayingCard::PlayingCard(int value, string suit) {
this->value = value;
this->suit = suit;
}
ostream& operator<<(ostream &os, const PlayingCard &card) {
string names[] = {"2", "3", "4", "5", "6", "7... |
#ifndef INC_GPENGINE_GPMATH_TRANSFORM_HPP
#define INC_GPENGINE_GPMATH_TRANSFORM_HPP
#include"Mat4.hpp"
#include"Vec4.hpp"
namespace GPEngine
{
namespace GPMath
{
Mat4 translate(const Mat4& other,const Vec4 &direction);
Mat4 scale(const Mat4& other,const Vec4 &units);
Mat4 rotate(const Mat4& other,float angleI... |
#include "GetChatInfo.h"
boost::property_tree::ptree GetChatInfo::execute(std::shared_ptr<Controller> controller) {
return controller->getChatInfo(commandParams);
}
GetChatInfo::GetChatInfo(boost::property_tree::ptree ¶ms) : BaseCommand("GetSelectChatRoom") {
commandParams = params;
}
|
#include <ros/ros.h>
#include <ros/package.h>
#include <memory>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <exception>
#include <io_lib/io_utils.h>
#include <dmp_lib/DMP/DMP_pos.h>
#include <dmp_lib/GatingFunction/LinGatingFunction.h>
#include <dmp_lib/GatingFunction/ExpGatingF... |
// Created on: 1995-10-12
// Created by: Bruno DUMORTIER
// 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 GN... |
#include "myvertexwidget.h"
MyVertexWidget::MyVertexWidget(QWidget *parent) : QListWidget(parent)
{
setSortingEnabled(true);
}
void MyVertexWidget::addVertexItem(QListWidgetItem *item)
{
this->addItem(item);
}
void MyVertexWidget::sharedVertexToEdge()
{
if (selectedItems().size() == 1) {
Vertex *... |
constexpr int maxn = 262144;
constexpr int mod = 998244353;
constexpr int imgunit = 86583718; /* sqrt(-1) = sqrt(998233452) */
using i64 = long long;
using poly_t = int[maxn];
using poly = int *const;
void polytri(const poly &h, const int n, poly &sin_t, poly &cos_t) {
/* sin(f) = (exp(i * f) - exp(- i * f)) / 2i *... |
// Copyright (c) 2007-2021 Hartmut Kaiser
//
// 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/modules/errors.hpp>
#incl... |
// Created on: 1994-06-03
// Created by: Christian CAILLET
// Copyright (c) 1994-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 ... |
// SpewFilter.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
//============================================================================
// Name : SpewFilter.cpp
// Author : Tom Haley
// Version : v1.0
// Copyright :
// Description : Filter WinCE Debug Spews fo... |
/*
* @author: aaditkamat
* @date: 26/12/2018
*/
#include <iostream>
using namespace std;
void eighth_pattern(int num) {
string result = "";
int bound = 2 * num, ctr = 1;
for (int i = 1; i <= bound; i++) {
for (int j = 1; j <= bound; j++) {
if (j <= ctr || j > bound - ctr) {
... |
#pragma once
#include <vector>
class ProbalityHandle
{
public:
//We don't need default constructor in this case, so delete it
ProbalityHandle() = delete;
//Template for array reference at constructor
template<class _Type, unsigned int _Size>
explicit ProbalityHandle(const _Type(&_ArrayRef)[_Size]) noexcept;
//Vir... |
#include<stdint.h>
uint8_t val1_8bit = (uint8_t)random(32);
uint8_t val2_8bit = (uint8_t)random(32);
uint16_t val1_16bit = (uint16_t)random(65536);
uint16_t val2_16bit =(uint16_t) random(65536);
uint32_t val1_32bit = (uint32_t)random(4294996);
uint32_t val2_32bit = (uint32_t)random(4294966);
float t = 3.5431;
float... |
//
// University of California, San Diego
// Data Structures and Algorithms: Algorithmic Toolbox
//
// Created by Dulio Denis on 2/17/16.
// Copyright (c) 2016 ddApps. Licensed under the MIT License.
// ------------------------------------------------
// Problem: Given two digits a and b, find a+b.
// Compile:... |
#include <iostream>
#include <winsock2.h>
#include <WS2tcpip.h>
#include <string>
#include <sstream>
#pragma comment(lib, "ws2_32.lib")
#pragma comment(lib,"wsock32.lib")
#pragma warning(disable:4996)
using namespace std;
int num_of_ex = 4;
string get_source(string _requete)
{
WSADATA WSAData; // здес... |
#include <iostream>
#include <algorithm>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
using namespace std;
template <class BI>
bool next_partial_permutation(BI first, BI middle, BI last) {
reverse(middle, last);
return next_permutation(first, last);
}
int main(void) {
int a[5];
REP(i, 0, 5)... |
#include <stack>
#include <queue>
#include <tuple>
#include <algorithm>
using grid = vector<vector<char>>;
bool dfs(grid &g, uint64_t i, uint64_t j)
{
if (g[i][j] == '0')
return false;
std::queue<std::tuple<uint64_t, uint64_t>> q{};
q.push({i, j});
while (q.size() > 0)
{
auto [i,... |
#include "stdafx.h"
#include "AutoHandle.h"
#include <exception>
#include <Windows.h>
AutoHandle::AutoHandle(HANDLE h)
: m_handle(h)
{
}
AutoHandle::~AutoHandle()
{
try {
BOOL res = FALSE;
res = CloseHandle(m_handle);
if (0 == res) {
// This function fails. handling error.
DWORD err = 0;
err = Get... |
/*
Copyright (c) 2015-2022 Xavier Leclercq
Released under the MIT License
See https://github.com/ishiko-cpp/test-framework/blob/main/LICENSE.txt
*/
#ifndef _ISHIKO_TESTS_TESTS_CORE_TESTTEARDOWNACTIONSTESTS_DIRECTORIESTEARDOWNACTIONTESTS_H_
#define _ISHIKO_TESTS_TESTS_CORE_TESTTEARDOWNACTIONSTESTS_DIRECTORI... |
#ifndef PERSON
#define PERSON
#include <string>
using std::string;
// функция возвращает переданное количество лет в правильной форме
string age_in_correct_form(const uint8_t age)
{
if ((age == 1) || ((age > 20) && ((age % 10) == 1)))
return std::to_string(age) + " год";
if ((age < 5) || ((age > 20) && ((age % 10... |
#include<cstdio>
#include<algorithm>
#include<memory.h>
using namespace std;
char a[1111];
int main(){
//freopen("input.txt","r",stdin);// freopen("output.txt","w",stdout);
scanf("%s",&a);
int n = strlen(a);
reverse(a,a+n);
a[n++] = '0';
for(int i=0;i<n;++i) if(a[i]!='9'){
++a[i... |
#include<cstdio>
#include<cstring>
#include<algorithm>
#define lowbit(i) i&-i
using namespace std;
const int M = 1030;
int a[M][M];
int n;
void upd(int x,int y,int d)
{
for(int i=x;i<=n;i+=lowbit(i))
for(int j=y;j<=n;j+=lowbit(j))
a[i][j] += d;
}
int sum(int x,int y)
{
int re... |
#pragma once
#include <math.h>
#include <cmath>
#define _USE_MATH_DEFINES
#include "vec2.h"
#include "vec3.h"
#include "vec4.h"
#include "mat4.h"
#define PI 3.14159265358f
namespace sge{ namespace math {
inline float toRadians(float degrees) {
return degrees * (M_PI / 180.0f);
}
inline float toDegrees(float ra... |
/**
* @file Game.cpp
* @author Jan Zarsky (xzarsk03@stud.fit.vutbr.cz)
* Andrei Paplauski (xpapla00@stud.fit.vutbr.cz)
* @brief Implementation of main class Game representing the whole game
*/
#include <iostream>
#include <stdlib.h>
#include <vector>
#include <iomanip>
#include <string>
#include <f... |
#include<stdio.h>
#include<math.h>
int main()
{
int tc = 0 ;
scanf("%d",&tc);
int loop, n ;
double R,intermediateP;
double pi_times_2 = 2*acos(-1);
for(loop = 0; loop < tc ; loop++)
{
scanf("%lf %d",&R,&n);
intermediateP = sqrt(2*(1-cos(pi_times_2/n)));
printf("Case... |
#include "string_operations.hpp"
#include <algorithm>
#include <set>
#include <string>
#include <vector>
// trim from start (in place)
void ltrim(std::string& s) {
s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) {
return !std::isspace(ch);
}));
}
// trim from end (in place)
void rtrim(std::strin... |
//
// 15. 3Sum.cpp
// leetcode
//
// Created by xujian chen on 6/1/20.
// Copyright © 2020 xujian chen. All rights reserved.
//
/*
15. 3Sum
Medium
6543
785
Add to List
Share
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the arr... |
#pragma once
#include <string>
#include <vector>
#include <tuple>
#include "Environment.h"
#include "ZLibDecompressor.h"
class DebUnpacker
{
public:
DebUnpacker(Environment& env);
bool run(const std::string& inputFilePath, const std::string& outputFolderPath);
private:
Environment& env;
ZLibDecompressor zlib... |
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <fstream>
#include <map>
#include <boost/lexical_cast.hpp>
using namespace std;
using namespace boost;
enum class State {
off_hook,
connecting,
connected,
on_hold,
on_hook
};
inline ostream& operator<<(ostream &os,... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** 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.
**
** Espen Sand
*/
#ifndef _UNIX_OPWINDOW... |
#include "RPCClient.hpp"
#include "TxManager.hpp"
RPCClient::RPCClient(Configuration *_conf, RdmaSocket *_socket, MemoryManager *_mem, uint64_t _mm)
:conf(_conf), socket(_socket), mem(_mem), mm(_mm) {
isServer = true;
taskID = 1;
}
RPCClient::RPCClient() {
isServer = false;
taskID = 1;
mm = (uint64_t)malloc(siz... |
#include "fftoperation.h"
FFTOperation::FFTOperation()
{
}
void FFTOperation::run()
{
fftwf_complex *in, *out;
fftwf_plan p;
int N= 8;
int i;
int j;
in = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * N);
out = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * N);
for( i=0; i < N;... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow){
ui->setupUi(this);
initializeOcr();
createMenuBar();
this->ui->takePhotoButton->setHidden(true);
connect(newFileAction, &QAction::triggered, this, &M... |
/*
* Context.cpp
*
* Created on: Jun 11, 2017
* Author: root
*/
#include "Context.h"
#include "AcceptManager.h"
#include "Service_Handler.h"
#include "EpollMain.h"
#include "DispatchMessage.h"
#include "ConnManager.h"
#include "Session.h"
#include "../util.h"
#include "GroupSession.h"
#include "MessageManage... |
//
// Created by Lee on 2019-04-23.
//
#ifndef UBP_CLIENT_CPP_VER_VIEWERVIEW_H
#define UBP_CLIENT_CPP_VER_VIEWERVIEW_H
#include "PhotoViewer.h"
#include <QWidget>
#include <QPushButton>
#include "Photo.h"
#include "PhotoManager.h"
class ViewerView : public QWidget {
Q_OBJECT
public:
explicit ViewerView(QW... |
/* -*- 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"
#include "modules/dom/src/domenvironmentimp... |
#include <conio.h>
#include <stdio.h>
void sort(int *A){
int b;
printf("\nBefore Sorting\n\n");
for(int j=0; j<5; j++)
printf("A[%d] = %d\n",j,A[j]);
printf("\n\n");
for(int i=1; i<=5; i++)
for(j=0; j<5-1; j++){
if(A[j+1]<A[j]){
b=A[j];
A[j]=A[j+1];
A[j+1]=b;
} // End o... |
/**
*** Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by
*** The Board of Trustees of the University of Illinois.
*** All rights reserved.
**/
/*
* Copyright (c) 1993 Martin Birgmeier
* All rights reserved.
*
* You may redistribute unmodified or modified versions of this source
* code provided that the abov... |
/*
* 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... |
#include <QDebug>
// RsaTolbox
#include "General.h"
#include "GenericInstrument.h"
#include "VisaBus.h"
#include "TcpBus.h"
#include "NoBus.h"
using namespace RsaToolbox;
/*!
* \defgroup InstrumentGroup Instrument
* Rohde \& Schwarz instrument driver
* classes
*/
/*!
* \defgroup GenericInstrumentGroup Generi... |
#pragma once
#include "bricks/core/object.h"
#include "bricks/core/exception.h"
#include "bricks/core/copypointer.h"
#include "bricks/io/filesystem.h"
struct zip;
struct zip_file;
namespace Bricks { namespace IO { class Stream; } }
namespace Bricks { namespace Compression {
#if BRICKS_CONFIG_COMPRESSION_LIBZIP
cl... |
#pragma once
#include "IUnaryOperationNodesFactory.hpp"
#include "Nodes/UnaryOperations/TanhUnaryOperation.hpp"
template<class Type>
struct TanhNodeFactory : IUnaryOperationNodesFactory<Type>
{
TanhNodeFactory(Type beta)
: m_beta(beta)
{
}
std::unique_ptr<UnaryOperationNode<Type> > create(NotN... |
// -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
//
// Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
//
// This file is part of the Opera web browser. It may not be distributed
// under any circumstances.
//
// Yngve Pettersen
//
//
#ifndef _MIME_CS_H
#define _MIME_CS_H
... |
#include "rvplane.h"
RVPlane::RVPlane(int lenX, int lenZ)
:RVBody()
{
this->lenX = lenX;
this->lenZ = lenZ;
m_VSFileName = ":/shaders/VS_simpler.vsh";
m_FSFileName = ":/shaders/FS_plan.fsh";
}
void RVPlane::initializeBuffer()
{
QVector3D A(0, 0, 0);
QVector3D B(lenX, 0, 0);
QVector3D ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2000-2012 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
** Kajetan Switalski
**
*/
#include "... |
#define WHITE 0
#define BLACK 1
#include <iostream>
#include <algorithm>
using namespace std;
int nMap[101][101];
int nCheck[101][101];
int M, N, K;
int nResult = 0;
int nCntOfSector[101];
int dx[4] = { -1, 1, 0, 0 };
int dy[4] = { 0, 0, -1, 1 };
void DFS(int x, int y, int Depth)
{
nCheck[x][y] = 1;
nCntOf... |
#include <bits/stdc++.h>
using namespace std;
main (){
int t;
cin >> t;
while (t>0){
long n;
cin >> n;
long long a[n];
for (long long i=0;i<n;i++){
a[i]=-1;
}
long long b;
for (long long i=0;i<n;i++){
cin >>b;
if (b < n && b>=0 ) a[b]=b;
}
for (long long i=0;i<n;i++){
cout << a[i]<< " ";
}
cout << e... |
/*
Copyright (c) 2014 Mircea Daniel Ispas
This file is part of "Push Game Engine" released under zlib license
For conditions of distribution and use, see copyright notice in Push.hpp
*/
#include "Core/Resource.hpp"
#include <cassert>
namespace Push
{
Resource::Resource(const Path& resource, size_t type)
... |
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;
typedef long long ll;
#define INF 10e17 // 4倍しても(4回足しても)long longを溢れない
#define rep(i,n) f... |
#pragma once
template <class T>
class Node
{
public:
T region;
Node<T> *child1;
Node<T> *child2;
Node<T> *child3;
Node<T> *child4;
public:
Node(T region_);
~Node();
};
template <class T>
Node<T>::Node(T region_) : region(region_)
{
child1 = nullptr;
child2 = nullptr;
child3 = ... |
#include <iostream>
#include <pybind11/embed.h>
#include <pybind11/stl.h>
namespace py = pybind11;
using namespace py::literals;
int main() {
// start the interpreter and keep it alive
py::scoped_interpreter guard{};
// use the Python API
py::print("Hello, World!");
// executing code from string... |
/*
* PerfectForwardingFail.cpp
*
* Created on: May 25, 2016
* Author: bakhvalo
*/
#include "gtest/gtest.h"
#include <type_traits>
#include <vector>
#include <chrono>
#include <set>
namespace
{
void f(int)
{
}
void f(const std::vector<int>&)
{
}
template<typename... Ts>
void fwd(Ts&&... params)
... |
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
int a[7] = {2,4,1,3,7,9,5};
int temp = 0;
for(int i = 0; i < 7; i++)
{
for(int j = 0; j < 7-i-1; j++)
{
if(a[j] > a[j+1])
{
temp = a[j];
a[j] = a[j+1];
... |
#include "MyView.h"
MY_IMPLEMENT_DYNAMIC(CMyView, CMyWnd)
CMyView::CMyView()
{
}
CMyView::~CMyView()
{
}
|
#include "trail.h"
#include <limits>
using namespace std;
void Trail::Run()
{
printf("begin trail, threshold %lf, number of file %d\n",e,n);
int *trail_set = (int *)malloc(sizeof(int) * n);
memset(trail_set,0,n);
for(int i = 0; i < n; i++)
trail_set[i] = 0;
float prev_min = dist_matrix[0][1];
... |
#pragma once
#include "graph.hpp"
#include "response.hpp"
#include "layout.hpp"
extern "C" void inject(char const * const);
extern "C" void load(char const * const url);
extern "C" void scale(const double depth, const double breadth);
extern "C" void setPhysics(void);
extern "C" void iterate(const unsigned int count)... |
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main()
{
std::ios::sync_with_stdio(false);
string N;
int carry;
while(!cin.eof())
{
N="0";
cin>>N;
if(N=="0")
continue;
if(N=="1")
cout<<"1"<<endl;
else
{
for(int i=N.length()-1;i>=0;i--)
{
if(N[i]=='0')
... |
#pragma once
#include <string.h>
#include <iostream>
using namespace std;
#include <stdio.h> |
/*********************************************************************
** Author: Christopher Matian
** Date: July 5th, 2017
** Description: A small program that converts celsius to fahrenheit
*********************************************************************/
#include <iostream>
using namespace std;
int main()... |
#include "DFA.h"
DFA::DFA()
{
}
DFA::~DFA()
{
}
bool DFA :: addTokenItem(int key, tokenItem i) {
if (tokenDict.find(key) == tokenDict.end())
{
tokenDict.insert({ key, i });
return true; //如果存在边的话返回true
}
else {
return false;
}
}
bool DFA::addTokenItem(int key, int token_id, s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.