text
stringlengths
8
6.88M
#pragma once #include "utils/ptts.hpp" #include "proto/config_area_ip.pb.h" #include "proto/config_week_calendar.pb.h" using namespace std; namespace pc = proto::config; namespace nora { namespace config { using area_ip_ptts = ptts<pc::area_ip>; area_ip_ptts& area_ip_ptts_ins...
#include <iostream> class A { public: void f(int x, char c) {} long g(double x) { return 0; } int operator() (int N) { return 0; } }; int factorial2(int N) { int result = 1; for (int i = N; i > 1; i--) result *= i; std::cout << "Result is: " << result << std::endl; return ...
/* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */ group "layout.numbers"; require init; include "modules/layout/numbers.h"; include "modules/style/css.h"; table ListTypes (short) { { CSS_VALUE_lower_alpha }, { CSS_VALUE_upper_alpha }, { CSS_VALUE_lower_roman }, { CSS_VALUE_upper_roman }, { CSS_VALUE_low...
//UVA10739-StringtoPalindrome /* 題意: 問題是,給一個字串,問最少要做多少 1.插入 2.刪除 3.替換 動作才行把這個字串變成回文 解法: 用dp[i][j] 表示 位置i到j最少需要用多少指令才行變成回文 所以是 dp[i][j] = dp[i+1][j-1] , str[i]==str[j] dp[i][j] = MIN (dp[i+1][j-1],dp[i+1][j],dp[i][j-1])+1 , str[i]!=str[j] */ #include<iostream> #include <string.h> using namespace std; const ...
/* * ==================================================================== * calendarmodule.cpp * * Python API to Series 60 agenda database. * * Implements currently (30.05.2005) following Python methods and types: * * open() * - open the default calendar database. * open(<filename>) * - open the specified c...
#include "GameCmd.h" #include "ProcessFactory.h" #include "IProcess.h" #include "LoginProcess.h" #include "LogoutProcess.h" #include "LoginComingProc.h" #include "UpdateTabStatusProc.h" #include "GameOverProc.h" #include "GetDetailProcess.h" #include "GetMemberProc.h" #include "BetCoinProcess.h" #include "ApplyBankerPr...
#ifndef __FORCE_H__ #define __FORCE_H__ #include <Eigen/Core> #include "MathDefs.h" class Force { public: virtual ~Force(); virtual void addEnergyToTotal( const VectorXs& x, const VectorXs& v, const VectorXs& m, scalar& E ) = 0; virtual void addGradEToTotal( const VectorXs& x, const Vector...
#ifndef CCARTAOMODEL_H #define CCARTAOMODEL_H #include <QtDeclarative> #include <QAbstractListModel> #include <QRegExp> #include <QStringList> #include <QtSql> #include "ccartaoitem.h" #include "ccompramodel.h" class CCartaoModel : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int tamanho RE...
#include "Helpers.h" #include "WebsocketServer.h" #include "RelayServer.h" #include "APIServer.h" #include "KeyManager.h" #include "PacketAccumulator.h" #include "RoomManager.h" #include <thread> #include <iostream> static_assert(sizeof(char) == 1, "Character size must be 1 byte."); int main() { std::string secr...
// // This file contains the C++ code from Program 6.3 of // "Data Structures and Algorithms // with Object-Oriented Design Patterns in C++" // by Bruno R. Preiss. // // Copyright (c) 1998 by Bruno R. Preiss, P.Eng. All rights reserved. // // http://www.pads.uwaterloo.ca/Bruno.Preiss/books/opus4/programs/...
/* * obj.hpp * * author: Thomas Blackwell * CS Username: tablackw * email: tablackwell@email.wm.edu * * Header file for the object class which contains a Sphere, a Color, and a Next pointer. * */ #include "Sphere.hpp" #include "rt.hpp" #ifndef OBJ_HPP #define OBJ_HPP typedef struct OBJECT{ Sphere sphere;...
#include<stdio.h> #include<iostream> using namespace std; main() { freopen("niilber.in","r",stdin); freopen("niilber.out","w",stdout); long a,b,c,d; scanf("%ld %ld %ld",&a,&b,&c); d=a+b+c; printf("%ld",d); }
#include <cstdint> enum class Opcode { RD, WR, ST, LW, MOV, ADD, SUB, MUL, DIV, AND, OR, MOVI, ADDI, MULI, DIVI, LDI, SLT, SLTI, HLT, NOP, JMP, BEQ, BNE, BEZ, BNZ, BGZ, BLZ, }; enum class OpcodeType { ARITHMETIC, CONDIMM, JUMP, IO, }; class Instruction { public: explicit Instruction(u...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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" #if defined(_NATIV...
/* -*- 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. ** ** Author: Jens Lindstrom (jl) / Petter...
/* -*- 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 DOM_COMMENT_H #define DOM_COMMENT_H #include "modules...
#include "VisaBus.h" #include "RsibBus.h" #include "GenericInstrument.h" using namespace RsaToolbox; #include <QtTest> #include <QSignalSpy> class test_GenericInstrument : public QObject { Q_OBJECT public: test_GenericInstrument(); private Q_SLOTS: void isRohdeSchwarz(); void idString(); void ...
// Copyright (c) 2020 ETH Zurich // Copyright (c) 2007-2017 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) #include <pika/config.hpp> #include <pika/...
// Created on: 1993-09-13 // Created by: Jacques GOUSSARD // Copyright (c) 1993-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 G...
#include <sys/socket.h> #include <sys/types.h> #include <sys/time.h> #include <netinet/in.h> #include <netdb.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <arpa/inet.h> #include <ctime> #include <iostream> #include <pthread.h> using ...
#include <set> #include <string> #include "kompute/Manager.hpp" namespace kp { #if DEBUG #ifndef KOMPUTE_DISABLE_VK_DEBUG_LAYERS static VKAPI_ATTR VkBool32 VKAPI_CALL debugMessageCallback(VkDebugReportFlagsEXT flags, VkDebugReportObjectTypeEXT objectType, uint64_t object, ...
#include <cstdio> #include <iostream> #include <string> using namespace std; void reverseWords(string &s){ string rs; for(int i=s.length();i>=0;){ while(i>=0 && s[i] == ' ') i--; if(i<0) break; if(!rs.empty()) rs.push_back(' '); string word; while(i>=0 && s[i]!=' ') word.push_back(s[i--]); ...
#include <sstream> #include <boost/accumulators/accumulators.hpp> #include <boost/accumulators/statistics.hpp> #include <algorithm> #include "ToSDetection.hh" #include "Log.hpp" using namespace boost::accumulators; ToSDetection::ToSDetection() : ADetection() { this->setPace(50); this->setName(std::string("ToSDe...
#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; const int maxn = 1e5 + 10; int a[maxn],b[maxn],f[maxn]; bool vis[maxn]; void dfs(...
#pragma once #include <vector> #include <iostream> using namespace std; struct Matrix { Matrix(); //Constructor Matrix(const Matrix&); ~Matrix(); //Destructor Matrix& operator=(const Matrix&); //Assignment bool operator==(const Matrix&); //Check for equivalence bool operator<(const Matrix&); //...
//---------------------------------------------------------------- // ClientEntity.cpp // // Copyright 2002-2004 Raven Software //---------------------------------------------------------------- #include "../../idlib/precompiled.h" #pragma hdrstop #include "../Game_local.h" ABSTRACT_DECLARATION( idClass, rvClientEnt...
void clearLEDs(){ for(int i = 0; i < LED_COUNT; i++){ leds.setPixelColor(i, 0); }; }; int check_zero(int input){ if(input >= 0){ return input; }else{ return 0; }; }; void move_rainbow(){ if(glob_R >= MAX){ glob_state = 1; }; if(glob_G >= MAX){ glob_state = 2; }; if(glob_B >= MA...
#ifndef GNMESH_H #define GNMESH_H #include "GnMeshData.h" class GNMESH_ENTRY GnMesh : public GnRenderObject { GnDeclareRTTI; GnDeclareStream; public: enum ePrimitiveType { PRIMITIVE_TRIANGLES, PRIMITIVE_TRISTRIPS, PRIMITIVE_LINES, PRIMITIVE_LINESTRIPS, PRIMITIVE_QUADS, PRIMITIVE_POINTS, }; protected:...
// Conversation.cpp : 实现文件 // #include "stdafx.h" #include "Conversation.h" // CConversation 对话框 IMPLEMENT_DYNAMIC(CConversation, CDialogEx) CConversation::CConversation(int id,CString title, CWnd* pParent /*=NULL*/) : CDialogEx(CConversation::IDD, pParent) , m_title(title) , m_history(_T("")) , m_content(_T("...
#pragma once #include <_/Deploy.hpp> #ifdef NANA_ENABLE_AUDIO #include <fstream> namespace Audio { namespace Wav { #if defined(NANA_WINDOWS) #pragma pack(1) struct MasterRIFFChunk { unsigned ckID; //"RIFF" unsigned cksize; unsigned waveID; //"WAVE" }; struct FormatChunk { unsigned ckID; //"fmt " unsigned ...
#include "BooksDB.h" #include <cstdlib> #include <ctime> #include <iomanip> string GenerateAlphaNumStr_N(size_t n) { static char characters[] = { 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', '1', '2', '3', '4',...
#include "ImageDimensions.hpp" #include "Util/Logger.hpp" #include <filesystem> #include <fstream> namespace fs = std::filesystem; namespace ImageDimensions { std::optional<SImageDimensions> getPNGDimensions(const std::string& file); std::optional<SImageDimensions> getJPGDimensions(const std::string& file); }...
#include<bits/stdc++.h> using namespace std; main() { char s1[2000]; while(cin>>s1) { if(s1[0]>='a') s1[0]=s1[0]-32; cout<<s1<<endl; } return 0; }
#include "gtest/gtest.h" #include "../../greekjet/greekjet/GreekJet.h" #define SIZE 100000 TEST(GreekJet_Performance, GreekJet_addition_Test) { for (int j = 0; j < 50; j++) { GreekJet jets[SIZE]; for (int i = 0; i < SIZE; i++) { jets[i] = GreekJet(i); } GreekJet result...
#include <bits/stdc++.h> using namespace std; const int maxn = 1010; const int maxq = 510; int n, m, q; int a[maxn][maxn]; char Red; int Ret; struct Q { int x, int y; } b[maxq]; void read() { Red = getcahr(); while (!isNum(Red)) Red = getchar(); Ret = 0; while (isNum(Red)) { Ret = Ret * 10 + Red - '0'; Red = ...
#ifndef GETSNPFILE_H #define GETSNPFILE_H // RsaToolbox #include <LastPath.h> // Qt #include <QWidget> namespace RsaToolbox { namespace Ui { class GetSnpFile; } class GetSnpFile : public QWidget { Q_OBJECT Q_PROPERTY(QString filePath READ filePath WRITE setFilePath NOTIFY filePathChanged USER true) publi...
class Solution { public: //Function to return list containing vertices in Topological order. vector<int> topoSort(int V, vector<int> adj[]) { vector<int> indegree(V,0); for(int i = 0;i<V;i++){ for(auto j:adj[i]) indegree[j]++; } queue<int> q; for(int i =0;i<V;i++){ if(!i...
/**************************************************************************** ** Meta object code from reading C++ file 'networkaccessviewer.h' ** ** Created: Tue Mar 8 09:41:15 2011 ** by: The Qt Meta Object Compiler version 62 (Qt 4.7.1) ** ** WARNING! All changes made in this file will be lost! ****************...
#include<iostream> using namespace std; int main () { int inicio, fim,aux; cin >> inicio >> fim; if (inicio >= fim){ cout << "O JOGO DUROU " << (24 - inicio) + fim << " HORA(S)" << endl; } else{ cout << "O JOGO DUROU " << fim - inicio << " HORA(S)" << endl; }...
#include <iostream> #include <iomanip> #include <string> #include <vector> #include <math.h> using namespace std; /* If you enter number like 2030 programm will display: 1 number equivalent >> 2 2 number equivalent >> 0 3 number equivalent >> 3 4 number equivalent >> 0 */ int task1() { int number; cout <<...
#include <iostream> #include<ostream> #include "Student.h" using namespace std; Student::Student() { } Student::~Student() { } ostream& operator<<(ostream& os, const Student &stud) { os<<stud.id; return os; } void Student::callKeyConst(const Student &stud) { int k = stud.id; } b...
// *************************** Number theory *************************** int phi(int n) { int res = n; for (int i = 2; i * i <= n; ++i) if (!(n % i)) { res /= n; res *= n - 1; for ( ; !(n % i); n /= i) ; } if (n > 1) { res /= n; res *= n - 1; } return res; } void sieve(char ...
#pragma once #ifndef CFastQueue_H #define CFastQueue_H #include "CSem.h" //high performance no-mutex pipe object. //Limitation: ONLY 1 THREAD FOR EACH SIDE OF THE PIPE. This works and has high performance, only if each function (push, pop) is called from a single thread. template<class ContainedObj,int kQue...
#ifndef CBT_NODES_BOOLEAN_HPP #define CBT_NODES_BOOLEAN_HPP /* Behavior nodes modeling boolean operations */ namespace cbt { struct behavior; auto negate(behavior&&) -> behavior; auto implies(behavior&&, behavior&&) -> behavior; auto equals(behavior&&, behavior&&) -> behavior; auto differs(behavior&&, behavior&&) -> be...
class Solution { public: int maxCoins(vector<int>& piles) { sort(piles.begin(), piles.end(), greater<int>()); int n = piles.size(); int ans = 0; int count = 0; int c = n/3; for(int i=1; i<piles.size(); i+=2) { count++; ans += piles[i]; ...
#ifndef __MAZE_HPP__ #define __MAZE_HPP__ #include <vector> #include <algorithm> #include <stdlib.h> #include <time.h> // union-find galore for modified kruskal, don't mind it, // yes yes it's disjointset stuff, ignore it I said! int Find(std::vector<int>& ds, int a) { if (ds[a] < 0) { return a; } else { int da...
#ifndef TETRISPIECE_H #define TETRISPIECE_H #include "tetriscoordinate.h" #include "tetrisconstants.h" #include <memory> #include <vector> class TetrisPiece { public: TetrisPiece( const TetrisCoordinate& centerCoordinate, int orientation, std::vector<TetrisCoordinate>&& coordin...
#include <iomanip> #include "budget_buddy.h" using namespace std; int main(int argc, char * argv[]){ //!// Try using ios::.good() to test existence of files! //!// Change code to not import the transaction data for all budgets, only import transaction data for user logged in! //TODO// Modularize driver ...
// // ConcurrentVector.h // Odin.MacOSX // // Created by Daniel on 07/06/15. // Copyright (c) 2015 DG. All rights reserved. // #ifndef Odin_MacOSX_ConcurrentVector_h #define Odin_MacOSX_ConcurrentVector_h #include <vector> #include <mutex> namespace odin { /// \brief Vector class that avoids simultaneous ac...
#include<bits/stdc++.h> using namespace std; template <typename T,typename V> class Pair{ private: T x; V y; public: void setX(T x){ this -> x = x; } T getX(){ return x; } void setY(V y){ this -> y = y; } V getY(){ return y; } }; int main(){ Pair <Pair <int,int>,int> p1;...
( English:'Greek'; Native:'Ελληνικά'; LangFile:'greek.lang'; DicFile:'greek.dic'; FlagID:'gr'; Letters:'Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω'; LetterCount:'12,1,2,2,8,1,7,1,8,4,3,3,6,1,9,4,5,7,8,4,1,1,1,3'; LetterValue:'1,8,4,4,1,10,1,10,1,2,3,3,1,10,1,2,2,1,1,2,8,8,10,3'; NumberOfJokers:2; ...
// // parser.h // mini-sql // // Created by Дмитрий Маслюков on 17.02.2020. // Copyright © 2020 Дмитрий Маслюков. All rights reserved. // #ifndef parser_h #define parser_h #include <vector> #include <iostream> #include "json.h" #warning names of rows cannot contain and, or, not static const char * lexems [] = { ...
#include "../include/testaMetodo.hpp" /* testaMetodo::testaMetodo (char* name_file, float a, float b){ ifstream myfile(name_file); vector<Point> answers; string linex, liney; int x,y; while(getline(myfile,linex) && getline(myfile,liney)){ x = stoi(linex,0,10); y = stoi(liney,0,10); Point coordinates(x,y)...
#include <Wire.h> #include <WiFiNINA.h> #include <WiFiUdp.h> #include <OSCMessage.h> #include <OSCBundle.h> #include <ButtonDebounce.h> /////////////// // OSC STUFF // /////////////// int status = WL_IDLE_STATUS; #include "arduino_secrets.h" ///////please enter your sensitive data in the Secret tab/arduino_secrets.h ...
// methods Inside class defination // outside class defination #include<iostream> using namespace std; class Myclass { public : void my_method() { // method inside the class cout<<"method from c++" << endl; } int square(int x) ; /// met...
#include <iostream> /// BIBLIOTECAS P/ SOCKETS #include <arpa/inet.h> #include <netinet/in.h> /// AF_INET #include <unistd.h> #define HOST "127.0.0.1" #define PORT_NUMBER 4326 #define MESSAGE_SIZE 40 /// Quantidade de caracteres que uma mensagem pode transmitir int main(){ char bufferServer[MESSAGE_SIZE]; /...
#include "nvse/NiRenderer.h" class NiD3DRenderStateGroup; class NiD3DShaderConstantMap; class NiD3DTextureStage; class NiDX9VertexBufferManager; class NiD3DShaderDeclaration : public NiObject { public: NiD3DShaderDeclaration(); virtual ~NiD3DShaderDeclaration(); NiDX9Renderer* Renderer; // 008 NiDX9VertexBu...
#include <iostream> #include <fstream> using namespace std; void PrintStatus( istream& is) { if (is.good()) cout << "good "; if (is.fail()) cout << "fail "; if (is.eof()) cout << "eof "; cout << endl; } int main() { ofstream out( "ausgabe.txt"); out ...
#include "ngn/hello.h" #include <iostream> #include <string> namespace ngn { void printHello(const std::string& name) { std::cout << "Hello, " << name << "!" << std::endl; } } // namespace ngn
// // Created by Yujing Shen on 29/05/2017. // #ifndef TENSORGRAPH_MATMULNODE_H #define TENSORGRAPH_MATMULNODE_H #include "../SessionNode.h" namespace sjtu{ class MatMulNode: public SessionNode { public: MatMulNode(Session *sess, const Shape& shape); virtual ~MatMulNode(); virtu...
// // Created by jeremyelkayam on 9/30/20. // #pragma once #include <list> #include "screen.hpp" #include "title_screen.hpp" #include "player.hpp" using std::string; using std::list; class EndScreen : public Screen { private: const game_options opts; bool screen_over; bool play_again; float time_so_far;...
#include <iostream> #include <cstring> #include <set> using namespace std; #define MAX 1000001 int main() { int t, n, a, b; cin >> t; while(t--) { cin >> n; int cnt = 0; int p[MAX]; memset(p, 0, sizeof(p)); for(int i=1; i<=n; ++i) { cin >> a >> b; p[a]++; if(p[b] >= 1) p[b]-...
#ifndef ATOM_SET_H #define ATOM_SET_H #include <set> #include "common.h" #define UNUSED_VARIABLE(x) ((void)(x)) using AtomSet = std::set<Variable>; #endif // ATOM_SET_H
// // OCXMLCustomMatchers.h // // Created by Wes Souza. // // ------------------------ // Copyright 2013 Zynga 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://ww...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
// // Created by Yujing Shen on 28/05/2017. // #ifndef TENSORGRAPH_EXCEPTION_H #define TENSORGRAPH_EXCEPTION_H #include "TensorGraph.h" namespace sjtu{ class Exception{ public: Exception(const string &str):message(str){} Exception(const Exception &r): message(r.message){} virtual ~Exc...
#include<stdio.h> #include<conio.h> struct stack { int top; int stackarr[100]; int size; }; void StackInit(stack*); void stackPush(stack*,int); int stackPop(stack*); int Eval(char*, stack*); void main(){ stack s; StackInit(&s); char expression[100] = "462+*"; int size = 5; /*printf("enter the size of the expr...
#include <WiFi.h> #include <WiFiAP.h> #include "AsyncUDP.h" //i'm accesspoint const char* ap_ssid = "esp32"; const char* ap_pass = "88888888"; char ap_stat = 0; //i'm station const char* sta_ssid = "********"; const char* sta_pass = "********"; char sta_stat = 0; //udp server AsyncUDP udp; int port = 1234; void...
*............................................................................* *..... GLOBAL TopReX parameters * *. . . . . . INTEGER parametrs . . . . . . . . . . . . . . . . . . . . . . * *..Ipar(1) ! internal TopReX code of the process * * -...
#pragma once #include <string> #include "People.h"; #include "Spells.h"; using namespace std; Spell* ChosenSpell1; Spell* ChosenSpell2; string chosenChar; string option; Spell* randSpell(int rand, Person person); void chosenCharacter(string chosenChar); void setSpell(Person &person); void getSpells(); void getCharac...
//--------------------------------------------------------------------------- #ifndef ApplyBankerProcH #define ApplyBankerProcH //--------------------------------------------------------------------------- #include "IProcess.h" class ApplyBankerProc:public IProcess { virtual int doRequest(CDLSocketHandler* client,...
#include "LED.h" LED led(10); void setup() { } void loop() { for(int i = 0;i<255;i++){ led.on(i); delay(5); } }
/* -*- 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. */ /** \file * This file declares the AUInstaller interface which is * the functions re...
#include "vm.h" #include "server.h" static const char* StateToString(sim::infra::VMState state) { switch (state) { case sim::infra::VMState::kStarting: return "STARTING"; case sim::infra::VMState::kRunning: return "RUNNING"; case sim::infra::VMState::kRestarting: ...
#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...
// // Created by xpl on 2021/6/23. // #include "XPlayer.h" #include <malloc.h> #include <cstring> #include "Log.h" XPlayer::XPlayer(JavaCallHelper *helper) : javaCallHelper(helper) { avformat_network_init(); } XPlayer::~XPlayer() { avformat_network_deinit(); delete javaCallHelper; javaCallHelper = 0...
#include<bits/stdc++.h> using namespace std; typedef long long ll; bool check(vector<long> &b,ll q,long h,long n) { ll p,th=0,i; for(i=n-1;i>=0;i--) { if(q>b[i]) break; if(b[i]%q==0) { p=b[i]/q; } else { p=b[i]/q+1; } th+=p; } if(...
// 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. #ifndef ORBIT_BASE_LOGGING_H_ #define ORBIT_BASE_LOGGING_H_ #include <cstdio> #include <filesystem> #include <fstream> #ifdef _WIN32 #include <Windows....
#ifndef wali_witness_WITNESS_MERGE_GUARD #define wali_witness_WITNESS_MERGE_GUARD 1 /*! * @author Nicholas Kidd */ #include "wali/Common.hpp" #include "wali/witness/Witness.hpp" #include "wali/witness/WitnessMergeFn.hpp" namespace wali { namespace witness { class WitnessMerge : public Witness { ...
// CameraWatcherDlg.cpp : implementation file // #include "pch.h" #include "framework.h" #include "CameraWatcher.h" #include "CameraWatcherDlg.h" #include "afxdialogex.h" #include <uuids.h> #ifdef _DEBUG #define new DEBUG_NEW #endif #define VCAM_NAME _T("Virtual Camera") #ifndef CLSID_DEFINED #define CLSID_DEFINED...
/**************************************************************************** * * * Author : lukasz.iwaszkiewicz@gmail.com * * ~~~~~~~~ * * Lice...
//////////////////////////////////////////////////////////////////////////////// //! @file //! Random (procedural) generation. //////////////////////////////////////////////////////////////////////////////// #pragma once #include "types.hpp" #include "math.hpp" #include "random.hpp" namespace yama { namespace generat...
#include<stdio.h> int main() { int a[11], i, j, t; for(int i = 0; i <= 10; i++) a[i] = 0; //初始化为0 for(i = 1; i <= 5; i++)//循环读入5个数 { scanf("%d", &t); a[t]++; } for(i = 0; i <= 10; i++) for(j = 1; j <= a[i]; j++) //有几个数字就输出几个数字 printf("%d ", i); getchar(); printf("\n"); return 0; }
// -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// // Простая структура для вычисления дробных сисел // V 1.0 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=// #include <iostream> using namespace std; struct FractionalNun { // Объявили структуру int integerNumerator; //...
/* 191020 LG codepro - [19년도_2차] 재고관리 (30점) - 미완성 */ #include <iostream> using namespace std; int N;//제품 수 int M;//제품 종류 수 int ID[100000 + 10];//제품 ID int id_cnt[100000 + 10 ]={0,}; void InputData(){ int i; cin >> N >> M; for(i = 1; i <= N; i++){ cin >> ID[i]; } } int main(){ int ans = 0; int fl...
#include <SPI.h> /* pins */ const uint8_t rst_pin = 6; const uint8_t dc_pin = 5; const uint8_t ss_pin = 10; uint8_t lcd_buf[6][84]; void set_pixel (uint8_t x, uint8_t y, int value) { if (value) lcd_buf[y / 8][x] |= 1 << (y % 8); else lcd_buf[y / 8][x] &= ~(1 << (y % 8)); } void buffer_to_lcd...
#include<bits/stdc++.h> using namespace std; main() { int len_colm, desk_row, place; while(cin>>len_colm>>desk_row>>place) { int i, j, l, number=0; for(i=1; i<=len_colm; i++) { for(j=1; j<=desk_row; j++) { number++; if(number==p...
//这里提供一种非搜索的做法 //不需要设置vis数组. //直接将存答案的数组作为参数,传输到子函数中 //思路:将答案数组分为两部分, //以nn为界,前半部分为有序区,后半部分为无序区 //对无序区按照字典序进行排序 //每次递归,都循环从无序区中取出元素,并加入有序区 //并将边界后移一位 //之后重新对无序区按照字典序进行排序, //然后将改变后的数组作为参数,传到下一层递归中 //当有序区的长度等于l时,便找到了一组解,输出即可 #include<iostream> #include<cstring> #include<algorithm> #include<cstdio> i...
#ifndef APPAPIINFO_HPP #define APPAPIINFO_HPP #include <QString> namespace tdlibQt { static const QString appid = QStringLiteral("10721"); static const QString apphash = QStringLiteral("aa0838770e243a5fd092ce402f2c288d"); } //namespace tdlibQt #endif // APPAPIINFO_HPP
/* -*- Mode: c++; indent-tabs-mode: nil; c-file-style: "gnu" -*- * * 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. */ #include "core/pch.h" #include "modules/xmlparser/xmlcommon.h" #include ...
#pragma once #include "surf.h" #include "hitrecord.h" #include <vector> #include <memory> class surfcluster : public surf { public: surfcluster() = default; surfcluster(std::vector<std::unique_ptr<surf>> subsurfs); /*~surfcluster() = default; surfcluster(const surfcluster& other); surfcluster(surfcluster&& other...
// Copyright (c) 2012 The Chromium 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 "chrome/test/base/interactive_test_utils.h" #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "build/buildflag...
#pragma once #include <glm/ext.hpp> using namespace glm; class Plane; class CollisionTests { public: static int TestPointTriangle(vec3 const& point, vec3 const& a, vec3 const& b, vec3 const& c); private: inline CollisionTests() {}; inline ~CollisionTests() {}; static float TriArea2D(vec2 const&...
#include "dds_uuid.h" #include "drill_objective_publisher.h" CDrillingObjectivePublisher::CDrillingObjectivePublisher() { } CDrillingObjectivePublisher::~CDrillingObjectivePublisher() { DDS_String_free(m_pDataInstance->id); } bool CDrillingObjectivePublisher::Initialize() { CDdsUuid uuid; uuid.GenerateU...
#include <cstdlib> #include <cmath> #include "trm/subs.h" #include "trm/constants.h" #include "trm/binary.h" /* * orbital_period computes the ornital period of a binary star. * \param m1 mass of star 1 (solar masses) * \param m2 mass of star 2 (solar masses) * \param a orbital separation (solar radii) * \return O...
/* ID: stevenh6 TASK: hamming LANG: C++ */ #include <iostream> #include <fstream> using namespace std; ofstream fout("hamming.out"); ifstream fin("hamming.in"); int nums[65], dist[(1 << 8 + 1)][(1 << 8 + 1)]; int N, B, D, maxval; void searchgroups(int cur, int start) { int a, b, canuse; char ch; if (cur...
// Created on: 1992-02-11 // 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 ...
#include <TcpServer.h> #include <sys/epoll.h> #include <stdlib.h> namespace Chatty { namespace net { void TcpServer::runForOnce() { int rc = socket_->Accept(); if (rc > 0) newConnCallback_(); } void TcpServer::Run() { epoll_fd_ = epoll_create1(0); if (epoll_fd_ != 0) { ::exit(1); } epoll_ctl(); } ...
/* Author: Mincheul Kang */ #include <boost/chrono.hpp> #include <boost/foreach.hpp> #include <ompl/base/SpaceInformation.h> #include <harmonious_sampling/StateSpaces.h> StateValidityChecker::StateValidityChecker(const ompl::base::SpaceInformationPtr &si, planning_s...
#include <iostream> int main() { //using escape sequences, print "2M" followed by a newline std::cout << "\062\t\115\n"; return(0); }