text stringlengths 8 6.88M |
|---|
#include "acceptorlist_p.hpp"
#include "server_p.hpp"
#include "monitor_connection_p.hpp"
#include <boost/bind.hpp>
#include <iostream>
#include <sys/stat.h>
namespace ioremap { namespace thevoid {
enum { MAX_CONNECTIONS_COUNT = 128 };
template <typename Endpoint>
static void complete_socket_creation(Endpoint endpoi... |
#include "HSRIFF.hpp"
bool HSMakeRiffChunkFourCC ( char * lpChunkBaseName , std::string * lpChunkFourCC ){
if ( lpChunkBaseName == nullptr ) return false;
if ( lpChunkFourCC == nullptr ) return false;
char name [ 5 ];
name [ 4 ] = 0;
size_t paramLen = strlen ( lpChunkBaseName );
memcpy ( name , lpChunkBa... |
// This file is part of Eigen, a lightweight C++ template library
// for linear algebra. Eigen itself is part of the KDE project.
//
// Copyright (C) 2009 Hauke Heibel <hauke.heibel@gmail.com>
//
// Eigen is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// L... |
#include "../headers/Inventory.h"
//#include "../headers/player.h"
//#include "../headers/skill.h"
#include "../headers/item.h"
#include "../headers/Safe_Input.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <assert.h>
using namespace std;
Inventory::Inventory()
{
inv_size ... |
#include "InputHandler.h"
InputHandler::InputHandler(GameEngine* e)
{
engine = e;
}
InputHandler::~InputHandler()
{
}
void InputHandler::checkKeyboard() {
if (engine != NULL) {
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up) || sf::Keyboard::isKeyPressed(sf::Keyboard::W)) {
engine->player... |
#include "ofxCommandProcessorThreadMac.h"
bool ofxCommandProcessorThreadMac::start() {
thread_ptr = boost::shared_ptr<boost::thread>(new boost::thread(
boost::bind(&ofxCommandProcessorThreadMac::run, this)
));
return true;
}
void ofxCommandProcessorThreadMac::join() {
thread_ptr->join();
}
void ofxCommandProce... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 2012 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
#include "core/pch.h"
#include "modules/opdata/OpDataFragmentIterator... |
/* 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... |
#include "../gl_framework.h"
using namespace glmock;
extern "C" {
DLL_EXPORT void CALL_CONV glCullFace(GLenum mode) {
}
}
|
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#define p printf
void random(int arr[10][10], int row, int col)
{
srand(time(NULL));
int i,j;
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
arr[i][j]=(rand()%20)+1;
if(arr[i][j]<10)
p("0%d ",arr[i][j]);
else
... |
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin >> s;
for(int i=0;i<s.size();i++){
if(s[i]>='A'&&s[i]<='Z'){
s[i]+=32;
}
}
string str="";
str+=".";
for(int i=0;i<s.size();i++){
if(s[i]!= 'u' && s[i] != 'e' && s[i] != 'o' && s[i] != 'a' && s[i] != 'i' && s[i] != 'y')... |
//这个是第一道leetcode题吧 那天和吴同学长 种奇龙学长一起值班的时候开始做的 瞬间想出归并排序还是可以的
//其他的话 那天能想到类型转换导致一直不对多亏了寒假看的C++ primer
// 52 ms 63.63%
class Solution {
public:
double findMedianSortedArrays(vector<int>& nums1, vector<int>& nums2) {
int nums1Size = nums1.size();
int nums2Size = nums2.size();
int * num... |
/************************************************************************
* @project : sloth
* @class : FontType
* @version : v1.0.0
* @description : 存储着字体纹理和数据文件
* @author : Oscar Shen
* @creat : 2017年2月27日21:30:07
* @revise :
******************************************************************... |
/* -*- 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
**
*/
#include "core/pch.h"
#ifdef _NATIVE_S... |
/* -*- 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.
*
* @author Tomasz Gólczyński
*/
#ifndef QUICK_COMPOSE_EDIT_H
#def... |
#include "Statement.h"
Statement::Statement()
{
Var=new Variable;
Var->name="";
Var->value=0;
Var->repeat=1;
ID=0;
Text = "";
Comment="";
StatType="None";
Selected = false;
}
void Statement::SetSelected(bool s)
{ Selected = s; }
bool Statement::IsSelected() const
{ return Selected; }
string Statement:... |
//entry.hpp
//Entry point for the program.
//Created by Lewis Hosie
//16-11-11
void killprogram();
|
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include "TFile.h"
#include "TTree.h"
#include "TH1.h"
#include "TH2.h"
#include "TGraph.h"
#include "TGraphAsymmErrors.h"
#include "TVectorT.h"
#include "Nuclear_Info.h"
#include "fiducials.h"
#include "helpers.h"
#include "A... |
#include "scrollinterfacemagicmissile.h"
#include "scroll.h"
ScrollInterfaceMagicMissile::ScrollInterfaceMagicMissile()
{}
|
#pragma once
#include <iostream>
#include <string>
#include <sstream>
#include <ostream>
/**
* Class stores pupil details
*/
class Student {
private:
// Instance variables
std::string name;
int age;
int attendance;
float gpa;
std::string comment;
public:
Student(std::string name, int age... |
#include <iostream>
#include <vector>
#include <queue>
#include <fstream>
using namespace std;
const long long N = INT_MAX;
int main() {
ifstream fin("salesman.in");
ofstream fout("salesman.out");
int n, m;
fin >> n >> m;
vector<vector<int>> d(1 << n, vector<int>(n, -1));
vector<vector<int>> ... |
#include<iostream>
#include<list>
#include<vector>
#include<map>
#include<utility>
#include<cmath>
#include <algorithm>
#include <cstdlib> /* 亂數相關函數 */
#include <ctime> /* 時間相關函數 */
#include"AStar.h"
using namespace std;
int point::dist(const point &T)
{
return 10 * sqrt(pow((T.x - x), 2) + pow((T.y - y), 2));... |
#include "bricks/audio/ffmpegaudiodecoder.h"
#if BRICKS_CONFIG_AUDIO_FFMPEG
#include "bricks/core/exception.h"
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
}
using namespace Bricks;
using namespace Bricks::IO;
using namespace Bricks::Audio;
namespace Bricks { namespace Audio {
F... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
*
* Copyright (C) 1995-2006 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Adam Minchinton and Karianne Ekern
... |
/******************************************************/
// THIS IS A GENERATED FILE - DO NOT EDIT //
/******************************************************/
#include "Particle.h"
#line 1 "/Users/jcarouth/projects/personal/particle-counter/src/particle-counter.ino"
/*
* Project particle-counter
* Descri... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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.
*
* George Refseth, rfz@opera.com
*/
#include "core/pch.h"
#i... |
/*
* This program mux a video bitstream(H.264) and a audio bitstream(AAC) together
* into a MP4 format file.
*/
#include <stdio.h>
#define __STDC_CONSTANT_MACROS
extern "C"
{
#include "libavformat/avformat.h"
};
int main(int argc, char* argv[])
{
/*
Step 1: Init FFmepg
*/
av_register_all();
/*
Step 2: ... |
// $Id$
//
// Copyright (C) 2002-2012 Greg Landrum and Rational Discovery LLC
//
// @@ All Rights Reserved @@
// This file is part of the RDKit.
// The contents are covered by the terms of the BSD license
// which is included in the file license.txt, found at the root
// of the RDKit source tree.
//
#include <G... |
/* XMRig
* Copyright (c) 2018-2019 tevador <tevador@gmail.com>
* 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 ... |
/*
* Complete the function below.
*/
int function(int x) {
int sq = x*x;
return sq;
} |
#include "iocoingui.h"
#include "clientmodel.h"
#include "walletmodel.h"
#include "optionsmodel.h"
#include "guiutil.h"
#include "guiconstants.h"
#include "init.h"
#include "ui_interface.h"
#include "qtipcserver.h"
#include <QApplication>
#include <QMessageBox>
#include <QTextCodec>
#include <QLocale>
#include <QThre... |
#ifndef CREDITS_SCREEN
#define CREDITS_SCREEN
#include "game.h"
#include "raylib.h"
using namespace g_var;
void updateCredits();
void drawCredits();
#endif // !CREDITS_SCREEN
|
#ifndef ACCES_INIT_H
#define ACCES_INIT_H
#include <QMainWindow>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QDebug>
#include <QtSql>
#include <QSqlTableModel>
#include <QMessageBox>
class acces_init : public QMainWindow
{
Q_OBJECT
public:
explicit acces_init(QWidget *parent = nullptr);
void ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; 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(_NATIVE_S... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2010 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*/
/**
* @file gadgets_module.h
* Global declarations for the gad... |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "GameFramework/GameMode.h"
#include "DuranteGameMode.generated.h"
UCLASS(minimalapi)
class ADuranteGameMode : public AGameMode
{
GENERATED_BODY()
public:
ADuranteGameMode(const FObjectInitializer& ObjectInitializer);
};
|
#include "DataProcessor.h"
#include "SQLiteManager.h"
#include "PredicateConstructor.h"
#include "TransitionGenerator.h"
#include "Situation.h"
#include "Transition.h"
#include "PredicateVehicle.h"
#include "VehicleData.h"
#include <iostream>
#include <map>
#include <thread>
using std::make_unique;
using std::make_sha... |
//
// Created by Stephen Clyde on 1/19/17.
//
#ifndef FORMATTEDTABLE_FORMATTEDCELL_H
#define FORMATTEDTABLE_FORMATTEDCELL_H
#include <ostream>
#include <string>
#include "ColumnDefinition.hpp"
class FormattedCell {
private:
enum allocatedDataType { Unknown, String, Integer, Float};
allocatedDataType m_data... |
#include "mouseeventholder.cpp"
frmMain::frmMain(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::frmMain)
{
ui->setupUi(this);
PalletScene = new QGraphicsScene(0, 0, ui->graphicsView->geometry().width(), ui->graphicsView->geometry().height(), this);
dx = ui->graphicsView->geometry().x();
dy ... |
#pragma once
#include "bricks/collections/array.h"
namespace Bricks { namespace Collections {
template<typename T>
class AutoArray : public Array<T*>
{
protected:
static void Retain(T* value) { AutoPointer<>::Retain(value); }
static void Release(T* value) { AutoPointer<>::Release(value); }
void RetainAll() ... |
#include <iostream>
#include <algorithm>
#include <numeric>
using namespace std;
using ll = long long;
int main() {
int n, m;
cin >> n >> m;
ll a[n], c[n];
for (int i = 0; i < n; ++i) cin >> a[i];
for (int i = 0; i < n; ++i) cin >> c[i];
int order[n];
iota(order, order + n, 0);
sort(... |
#include "widget.h"
#include <QVBoxLayout> //垂直布局
#include <QHBoxLayout> //水平布局
#include <QGridLayout> //网状布局
Widget::Widget(QWidget *parent)
: QWidget(parent)
{
//this->setMinimumSize(640, 480); //设置this窗口的最小大小
b1 = new QPushButton("OK", this);//按键依附于this窗口
b2 = new QPushButton("Cancel", this);
... |
//********************************************
// Student Name :
// Student ID :
// Student Email Address:
//********************************************
//
// Instructor: Sai-Keung WONG
// Email: cswingo@cs.nctu.edu.tw
// wingo.wong@gmail.com
//
// National Chiao Tung University, Taiwan
// Computer Science
// Da... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#include "core/pch.h"
#ifdef WEBFEEDS_BACKEND_SUPPORT
#inclu... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 2006 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_MARKER_H
#define SVG_MARKER_H
#if defined(SVG_SUPPORT) && ... |
#include "api/FRCNN_OLD/Faster_Inference.hpp"
using namespace caffe::FRCNN_OLD;
int main(int argc , char **argv){
google::InitGoogleLogging(argv[0]);
LOG(ERROR) << "In Main function !";
CHECK( argc == 5 ) << "[Inputfile] [Outputfile] [Detection_Config] [GPU_ID] " << " not " << argc;
std::stringstream ... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2002 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser. It may not be distributed
* under any circumstances.
*/
#ifndef OP_BAR_H
#define OP_BAR_H
#include "modules/widgets/OpWi... |
//
// Main.cpp
//
// Created by Yajun Shi
//
// The main class for running the game
#include "stdafx.h"
#include "BangManager.h"
int main(int argc, char* argv[])
{
theWorld.Initialize(1024, 768, "Bang!");
theWorld.SetGameManager(new BangManager());
theWorld.StartGame();
theWorld.Destroy();
return 0;
}... |
#include <Adafruit_NeoPixel.h>
#include "MovingAnimation.h"
MovingAnimation::MovingAnimation(void) { }
void MovingAnimation::reset(variables_t *vars) {
Serial.println("changing to moving");
int i;
for(i = 0; i < vars->color_len; i++) {
vars->color_store[i] = Adafruit_NeoPixel::Color(0, 0, rand()%64+64);
... |
//***************************************************************************
// CSS 1 Spring 2017 Lab # 5
// Dror Manor
// This program will translate 0-9 and aA-zZ to ICAO phonetic codes
//***************************************************************************
#inc... |
#include <math.h>
#include <iomanip>
#include <sstream>
#include "LVRdataConverter.hh"
#include <xdaq/ApplicationDescriptor.h>
#include "ecal/tools/exception/Exception.hh"
LVRdataConverter::LVRdataConverter(xdaq::ApplicationContext* appContext, DipFactory* _dip, const std::string& dip_path) {
NumberOfConverted_ = 0... |
/*====================================================================
Copyright(c) 2018 Adam Rankin
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 limitati... |
#include <bits/stdc++.h>
using namespace std;
#define TESTC ""
#define PROBLEM "494"
#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
int main(int argc, char const *argv[])
{
#ifdef DBG
freopen("uva" PROBLEM TESTC ".in", "r", stdin);
freopen("uva" PROBLEM ".out", "w", stdout);
#endif
char symbol;
... |
//
// Particle.cpp
// w05_h01_strings
//
// Created by Kris Li on 10/5/16.
//
//
#include "Particle.hpp"
Particle::Particle() {
pos.x = ofRandom(ofGetWindowWidth());
pos.y = ofRandom(ofGetHeight());
vel.set(0,0);
acc.set(0,0);
damp = 0.90; // damping force--resistance
radius = 5;
... |
//将意外异常转化成意料中的异常
void unexpected()
{
cout<<"Unexpected exception.\n";
throw runtime_error("");
}
//标准异常层次体系
void readIntegerFile(const string& filename,vector<int>& dest)
throw(invalid_argment,runtime_error)
{
ifstream istr;
int temp;
istr.open(filename.cstr());
if(istr.fail())
{... |
//
// Generated file. Do not edit.
//
#include "generated_plugin_registrant.h"
#include <flutter_bluetooth/flutter_bluetooth_plugin.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
FlutterBluetoothPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FlutterBluetoothPlugin"));
}
|
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <algorithm>
#define INT_MAX 0x7fffffff
#define INT_MIN 0x80000000
using namespace std;
string simplifyPath(string path){
path = '/' + path + '/';
ve... |
/* 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... |
#include<stdio.h>
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
void key_callback(GLFWwindow *win, int key, int scancode, int action, int mode)
{
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
glfwSetWindowShouldClose(win, GL_TRUE);
else
printf("key:%d\n", key);
}
int m... |
#include "Engine.hpp"
Engine::Engine() {
m_window = NULL;
m_devMode = false;
m_width = 640;
m_height = 480;
srand(time(NULL));
}
Engine::~Engine() {
SDL_Quit();
}
bool Engine::Initialize(const char* title, int width, int height, bool fullScreen) {
#ifdef NDEBUG
m_devMode = false;
#els... |
#include "Etudiant.hpp"
#include <cstdio>
namespace enseirb{
static Chaine g("Etudiant");
Etudiant::Etudiant():
Personne(""), _filiere(""), _enseignement(""){
printf("%s (%d): %s\n", __FILE__,__LINE__,__func__);}
Etudiant::Etudiant(const Etudiant &s):
Personne(s.nom()), _filiere(s.filiere()), _e... |
// Copyright (c) 2021 ETH Zurich
// Copyright (c) 2020 John Biddiscombe
// Copyright (c) 2016 Thomas Heller
// Copyright (c) 2016 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.boo... |
#include "stdafx.h"
#include "ist/ist_sys.h"
#include "system.h"
#ifdef WIN32
#pragma comment(lib,"SDL.lib")
#pragma comment(lib,"SDLmain.lib")
#pragma comment(lib,"SDL_mixer.lib")
#pragma comment(lib,"opengl32.lib")
#pragma comment(lib,"glu32.lib")
#pragma comment(lib,"glew32.lib")
#pragma comment(lib,"... |
#ifndef _DefienLackProc_H_
#define _DefienLackProc_H_
#include "BaseProcess.h"
class DefineLackProc :public BaseProcess
{
public:
DefineLackProc();
virtual ~DefineLackProc();
virtual int doRequest(CDLSocketHandler* clientHandler, InputPacket* inputPacket, Context* pt);
virtual int doResponse(CDLSocketHandler* cli... |
#include<iostream>
#include<cstdio>
#include<map>
#include<set>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<cmath>
using namespace std;
int f[110],g[110][110];
int main() {
string a,b;
while (cin >> a >> b) {
... |
/*
* Copyright 2012 Google Inc.
*
* 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 applicable law or agreed to... |
//
// Vertices.h
// PLYLoader
//
// Created by JIANG, SHAN on 12-10-19.
// Copyright (c) 2012 JIANG, SHAN. All rights reserved.
//
#ifndef PLYLoader_Vertices_h
#define PLYLoader_Vertices_h
#include "Points.h"
#include "inc\Vec2.h"
class Vertices: public Points{
public:
Vertices();
~Vertices();
v... |
// Файл util.h с реализацией вспомогательных утилит
#include "util.h"
// Запись строки символов в указанный файл
void str2file(std::string &str, std::string fileName) {
std::ofstream out; // поток для записи
out.open(fileName); // окрываем файл для записи
if (out.is_open()) {
out << str;
... |
/*
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
*/
#pragma once
#include "Core/Path.hpp"
#include "Core/ResourceManager.hpp"
#include "Math/Rectangle.hpp"
#include "Serialization/Seri... |
#include <iostream>
#include <vector>
#include <utility>
void test0();
int main() {
test0();
return 0;
}
struct tracker {
tracker() { std::cout << "calling tracker()\n"; }
~tracker() { std::cout << "calling ~tracker()\n"; }
tracker(tracker const&) { std::cout << "calling tracker(tracker const&)\... |
////////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2007-2015 Hartmut Kaiser
// Copyright (c) 2008-2009 Chirag Dekate, Anshul Tandon
// Copyright (c) 2012-2013 Thomas Heller
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version... |
/**
* Copyright (c) 2007-2012, 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 ... |
#include <bits/stdc++.h>
using namespace std;
int n;
char a[100], b[100];
int main() {
// scanf("%d%s%s", &n, a + 1, b + 1);
// int cmp = 0;
//// for (int i = 1; i <= n; i++) {
//// if (a[i] == '>') cmp++;
//// else cmp--;
//// if (b[i] == '<') cmp++;
//// else cmp--;
//// }
// for (int i = 1; i <= n; i++)
// if (... |
#pragma once
#include "bricks/config.h"
#include "bricks/core/sfinae.h"
#if BRICKS_CONFIG_LOGGING_ZOMBIES
#include "bricks/core/object.h"
#endif
#define tempnew Bricks::Internal::TemporaryPointer() *
namespace Bricks {
#if BRICKS_CONFIG_RTTI
template<typename T, typename U> static inline typename SFINAE::EnableIf<... |
#include <iostream>
#include "capthread.h"
#include "capfork.h"
using namespace std;
void strcpy(const string src, char *dst, size_t size) {
if (size + 1 < src.size()) {
return;
}
memcpy(dst, src.c_str(), src.size());
dst[src.size()] = '\0';
}
int main() {
string input;
int type;
... |
/**
* @file Single_Thread.hpp
*
* @author Matthew
* @version 1.0.0
* @date Apr 17, 2015
*/
#ifndef VALKNUT_CORE_THREAD_POLICIES_SINGLE_THREAD_HPP_
#define VALKNUT_CORE_THREAD_POLICIES_SINGLE_THREAD_HPP_
namespace valknut{
namespace thread_policies{
///////////////////////////////////////... |
#pragma once
#include "ThreadSafeQueue.h"
#include "AudioChunk.h"
class SpotifyProvider
{
public:
void StartThread();
SpotifyProvider(const char* username, const char* password, const char* listname, ThreadSafeQueue<AudioChunk>* queue);
~SpotifyProvider();
private:
void Login();
static void ProcessThread();
const... |
#pragma once
#include "cocos2d.h"
#include "extensions/cocos-ext.h"
#include "ui/CocosGUI.h"
#include "SceneManager.h"
USING_NS_CC;
class LobbyLayer : public cocos2d::Layer
{
private:
Sprite* m_RoomBG;
ui::ListView* m_RoomViewbox;
ui::Button *m_RoomCreate;
ui::Button *m_Shop;
ui::Button *m_Btn_Refresh;
public:... |
#include<iostream>
using namespace std;
int main() {
char ac = 'a';
int ai = ac;
cout << ai << " " << endl;
cout << static_cast<int>(ac) << '\n';
return 0;
} |
#include "myview.h"
#include <QLabel>
#include <QDebug>
MyView::MyView(QWidget *parent) : QAbstractItemView(parent)
{
}
QRect MyView::visualRect(const QModelIndex &index) const
{
Q_UNUSED(index);
return QRect(0, 0, 300, 200);
}
void MyView::scrollTo(const QModelIndex &index, ScrollHint hint)
{
Q_UNUSED(... |
#include "pch.h"
#include "Room.h"
Room::Room()
{
initParent();
}
Room::~Room()
{
m_player = nullptr;
m_dContext = nullptr;
m_device = nullptr;
m_gameTimerPointer = nullptr;
m_models = nullptr;
m_wvpCBuffers = nullptr;
int i = 0;
for (auto p : m_gameObjects)
{
i++;
if (p != nullptr)
{
delete p;
... |
/*
* In a more traditional environments, one would split into .H and .CPP files. However in Arduino, the ".ino" file
* comes with certain built-in includes (such as "Arduino.h" and more) which are not automatically added to other CPP
* files. So, to make things more seamless, I will be putting implementation directl... |
// Copyright 2011 Yandex
#ifndef LTR_LEARNERS_COMPOSITION_LEARNER_LINEAR_COMPOSITION_LEARNER_H_
#define LTR_LEARNERS_COMPOSITION_LEARNER_LINEAR_COMPOSITION_LEARNER_H_
#include "ltr/utility/shared_ptr.h"
#include "ltr/learners/composition_learner/composition_learner.h"
#include "ltr/scorers/composition_scorers/linear... |
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*-
*
* Copyright (C) 1995-2008 Opera Software AS. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* @author Arjan van Leeuwen (arjanl)
*/
group "webfeeds.webfeed_reader_manager";
requ... |
// You need the definitions in the dynamiclinklibrary.h file to call the DLLs functions from your app
// dynamiclinklibraries.cpp : Defines the entry point for the console application.
// Compile by using: cl /EHsc /link dynamiclinklibrary.lib MathClient.cpp
#include "stdafx.h"
#include <iostream>
#include "dynamicl... |
#include <stdio.h>
#include <stdlib.h>
#include "Table.h"
#include "AllocSvrConnect.h"
#include "Logger.h"
#include "Configure.h"
#include "IProcess.h"
#include "TaskRedis.h"
#include "CoinConf.h"
#include "Util.h"
#include "OperationRedis.h"
Table::Table():status(-1)
{
}
Table::~Table()
{
}
void Table::init()
{
t... |
#ifndef _manager_h_
#define _manager_h_
#include "window.h"
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <glm/glm.hpp>
class Manager : public Window {
public:
Manager();
GLFWwindow* window;
static bool showQuads;
private:
static bool drawQuads();
static bool drawCube();
protected:
vi... |
// Created on: 1997-05-14
// Created by: Christian CAILLET
// 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 ... |
//
// main.cpp
// NeheGL
//
// Created by Andong Li on 8/28/13.
// Copyright (c) 2013 Andong Li. All rights reserved.
// entry function of this project
//
#include "headers.h"
//just change here to change renderer
#define RENDERER NEHE39
int main(int argc, char * argv[]){
glutInit(&argc, argv);
glutIn... |
#include "User.h"
#include "protocol.h"
User::User(LinkID linkID)
{
mUserType = SceneServer;
mLinkID = linkID;
mUserID = linkID;
}
User::~User()
{
}
|
//
// IntLib.h
// Landru
//
// Created by Nick Porcino on 10/29/14.
//
//
#pragma once
#include "LandruActorVM/LandruLibForward.h"
namespace Landru {
namespace Std {
//-----------
// Int Libary \__________________________________________
class IntLib {
public:
... |
//
// Torpedo.cpp
// GAME2
//
// Created by ruby on 2017. 11. 11..
// Copyright © 2017년 ruby. All rights reserved.
//
#include "Torpedo.hpp"
void Torpedo::move() {
moveUp();
}
|
#include <stdio.h>
#include <iostream>
#include <string.h>
#define TAMANHO 300
using namespace std;
FILE *f, *s;
int criararquivo (char uf[2]);
int fechararquivo ();
int main(int argc, char**argv)
{ cout << "Tamanho dos registros..:" << TAMANHO<<"\n\n";
char registro [TAMANHO];
int qt;
int qtest=0;
char ... |
// bellman ford algorithm to find single source shortest path in a graph
// the graph is assumed to be directed and is stored in the form of a vector of edges
// complexity: O(|V|*|E|)
ll dist[MAXN];
void check_neg_cycle(vector<pair<ll,pair<int,int>>> edges){
for(auto edge: edges){
if(dist[edge.second.second] > d... |
#pragma once
#include<Windows.h>
class Hand
{
public:
Hand();
Hand(int newWinRate, LPCSTR newName);
~Hand();
private:
int winRate;
LPCSTR name;
void checkOrCall(LPCSTR nameOfTheWindow);
void fold(LPCSTR nameOfTheWindow);
void bet(LPCSTR nameOfTheWindow);
};
|
// Subsequence with the biggest sum%m value O(2^(n/2)*n)
int n, m, a[40];
void comb(int l, int r, vi &v){
int sz = r-l+1;
for(int i=0;i<(1<<sz);i++){
int sum = 0;
for(int j=0;j<sz;j++)
if(i & (1<<j))
sum = (sum + a[l+j])%m;
v.pb(sum);
}
sort(v.begin... |
/*
waveread.h文件,用于读取wav文件
包含wavread类,构建对象时需要输入文件路径:
wavread wav("/Users/Administrator/Downloads/data1081.wav");
wavread类介绍:
成员函数:
1、echo_info();输出wav文件相关信息
数据成员:
1.info(保存wav文件信息);
2.data(保存音频信息)
对data的特殊说明:
1.data中的数据可能为16bits、8bits,etc.本次实验中的音频使用的均是16bits,所以说嘛以16bits为例,用short存储.
2.最高位为符号位,有没有使用1补码没有确定.
3.... |
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#include "cmJsonObjects.h" // IWYU pragma: keep
#include <algorithm>
#include <cassert>
#include <cstddef>
#include <functional>
#include <limits>
#include <map>
#include ... |
#include <fstream>
#include <iostream>
#include "../../OCScriptLib/src/OCScript.hpp"
class SampleCommand1 : public OCScript::ICommand
{
public: static SampleCommand1& GetInstance() { static SampleCommand1 instance; return instance; }
private: SampleCommand1() { }
public:
wstring GetCommandName()
{
return L"Samp... |
// 19.06.01
// 백준 #7562 : 나이트의 이동
// BFS 방식
#include <iostream>
#include <queue>
#include <utility>
using namespace std;
int tc;
int res[10000];
int dir_x[8]={2,1,-1,-2,-2,-1,1,2};
int dir_y[8]={1,2,2,1,-1,-2,-2,-1};
int length;
int cur[2];
int goal[2];
int solve(int x,int y)
{
int visited[310][310]={0,};
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.