text
stringlengths
8
6.88M
#include "scene.hpp" #include "config/utils.hpp" #include "log.hpp" #include "config/options_ptts.hpp" #include "proto/ss_common_resource.pb.h" #include "utils/client_process_mgr.hpp" #include "config/recharge_ptts.hpp" namespace nora { namespace common_resource { using scene_mgr = client_proc...
#include <bits/stdc++.h> using namespace std; #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 100 int soundex(char k){ string str[6] = {"BFPV","CGJKQSXZ","DT","L","MN","R"}; for(int i = 0 ; i < 6 ; i++) for(int j = 0 ; j < str[i].size() ; j++ ) if( k == str[i][j] ) return i+1; r...
#pragma once #include <vector> #include "stringview.h" namespace json { ///JSON is often full of enums. To easy convert enum to string and vice versa, you can use this class /** * To use this class, you need to define table where each row has enum value and string value. This * table must be used to construct Na...
//////////////////////////////////////////////////////////////////////////////// // 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) ///////...
#include "Connection.h" #include <stdlib.h> #include <stdio.h> #include <string.h> #if defined(_MSC_VER) #include <Windows.h> #include <process.h> #define LockMutex EnterCriticalSection #define UnlockMutex LeaveCriticalSection #else #include <unistd.h> #include <pthread.h> #define LockMutex pthread_mutex_lock #define U...
#include "engone.h" #include "ui_engone.h" #include "voice.h" #include"dialog.h" #include"sentence.h" #include"vocab.h" #include"speech.h" engone::engone(QWidget *parent) : QDialog(parent), ui(new Ui::engone) { ui->setupUi(this); QPixmap pix("C:\\Users\\nayan\\Desktop\\image1.png"); u...
/* Portions Copyright (c) 2005 Nokia Corporation */ #include "Python.h" #include <ctype.h> #include <e32std.h> /* snprintf() wrappers. If the platform has vsnprintf, we use it, else we emulate it in a half-hearted way. Even if the platform has it, we wrap it because platforms differ in what vsnprintf does in c...
// // Created by andyw1997 on 12/3/18. // #ifndef CPP_TFPREPROCESS_H #define CPP_TFPREPROCESS_H #include <string> #include <vector> #include <functional> #include <mutex> #include <sstream> #include "cirrus/src/Configuration.h" #include "cirrus/src/SparseDataset.h" class TFPreprocess { public: cirrus::SparseDatas...
#include<iostream> #include<queue> #include<stack> #define FOR(i,n) for(i=0;i<n;i++) using namespace std; int N; queue<int>q[100]; stack<int>s; int allempty() { int count=0,i; FOR(i,N){if(q[i].empty()==1)count++;} if(count==N && s.empty()==1) return 1; else return 0; } int main() { int set,n...
/* XMRig * Copyright (c) 2018-2019 tevador <tevador@gmail.com> * Copyright (c) 2018-2021 SChernykh <https://github.com/SChernykh> * Copyright (c) 2016-2021 XMRig <https://github.com/xmrig>, <support@xmrig.com> * * This program is free software: you can redistribute it and/or modify * it under the ...
#include <ros.h> #include <std_msgs/String.h> #include <geometry_msgs/Twist.h> #include <stdlib.h> int OdomCount = 0; int OdomWait = 3; int LMotor = 1; int RMotor = 0; bool left_forward; bool right_forward; int MotorNum[2] = {LMotor, RMotor}; double Vels[2] = {0,0}; int CVEL[2]= {0,0}; int Mspeeds[2] = {0,0}; d...
#ifndef NOTEBOOK_H #define NOTEBOOK_H #include "widgetList.h" #include "note.h" #include <QFile> #include <QXmlStreamWriter> #include <QXmlStreamReader> #include "memory" #include "settings.h" class Notebook { friend class NoteListWindow; public: Notebook(const std::weak_ptr<Settings>); ~Notebook(); vo...
////////////////////////////// // Filename: main.cpp ////////////////////////////// #include "GameManager.h" int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow) { GameManager* gameManager; bool result; //Create the GameManager object gameManager = new GameManager; if (...
#ifndef Compound_h #define Compound_h //Depricated #include <vector> #include <tr1/array> #include <tr1/memory> #include "Manifold.h" #include <Eigen/Core> using Eigen::Vector3d; using Eigen::Matrix3d; class Compound : public Manifold { public: class Point; class PointOfReference; class Geodesic; typedef st...
#include <bits/stdc++.h> using namespace std; #define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0) #define MAXN 100 #define INF 0x3f3f3f3f #define DEVIATION 0.00000005 int main(int argc, char const *argv[]) { int kase; scanf("%d",&kase); int num; for(int K = 1 ; K <= kase ; K++ ){ printf("Case #%d: ...
#include <stdio.h> #include <stdlib.h> struct queue { char pw; int x; struct queue *next; }; typedef struct queue Q; Q *p,*head; void enqueue(Q **list,char w) { Q *temp,*p; int c=1; temp=(Q*)malloc(sizeof(Q)); temp->x=w; temp->next=NULL; p=head; if(p==NULL) { head...
/* MBED RTOS Blinky * Flash some simple LEDs using the RTOS * Thread version */ #include <mbed.h> DigitalOut red(LED1,1); /* initialise to 1 = off */ void flash_red(void) { while(true) { red = !red; wait(0.3); } } int main(void) { Thread blink; blink.start(flash_red); blink.join(); }
#pragma once #ifndef __ZIP_HELPER #define __ZIP_HELPER #include <map> #include <string> //1.暂时不支持子目录 //注意: 因为使用了zlib库,使用时加上预编译宏 ZLIB_WINAPI class ZipHelper { public: ZipHelper() {} ~ZipHelper() {} //path: utf8 path ZipHelper& AddFile(const char* input_path, const char* inzip_path = ""); ZipHelper&...
#pragma once #include <vector> #include <string> #include <memory> #include <PortableDeviceApi.h> namespace WPD { class WPDDevice; class WPDObjectIterator { static const int batch = 10; using EnumPortableDeviceObjectIDs = std::unique_ptr<IEnumPortableDeviceObjectIDs, void (*)( ...
/* ** EPITECH PROJECT, 2019 ** OOP_indie_studio_2018 ** File description: ** Event */ #ifndef EVENT_HPP_ #define EVENT_HPP_ #include <irrlicht/irrlicht.h> #include <string> using namespace irr; class EventReceiver : public IEventReceiver { public: EventReceiver(void); ~EventReceiver(void); virtual bool ...
// Created on: 1995-12-07 // Created by: Jacques GOUSSARD // 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 G...
#include "EuropeanOption.h" #include "BasicMaths.h" #include "MarketData.h" #include "Pricer.h" #include <cmath> #include <iostream> Results EuropeanOption::analyticPrice(const MarketData& m) const { Results out; out.m_standardDeviation = 0; double df = m.discountFactorTo(m_maturity); double fwd = m.equityPrice()...
// Created on: 1993-06-22 // Created by: Laurent BOURESCHE // 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 ...
// codebit written by Tiantian Liu @ University of Pennsylvania, 2012 #ifndef MYGLWIDGET #define MYGLWIDGET #include "DisplayClass.h" #include <iostream> #include <istream> #include <sstream> #include <string> #include <fstream> #include <QTimer> #include <QKeyEvent> class MyGLWidget : public QGLWidget { Q_OBJECT ...
#ifndef MENUSTATE_H #define MENUSTATE_H #include "Game.h" #include "GameDimens.h" using std::string; class MenuState: public State { public: MenuState(GameDataRef); virtual ~MenuState(); MenuState(const MenuState& other); MenuState& operator=(const MenuState& other); void in...
#include <fstream> #include "mp23_16_opt.h" int main() { ofstream in_pix("input_pixels_regression_result_mp23_16_opt.txt"); ofstream fout("regression_result_mp23_16_opt.txt"); HWStream<hw_uint<512> > in_update_0_read; HWStream<hw_uint<256> > mp23_16_update_0_write; // Loading input data // cmap : { in...
// ########################################################## // By Eugene Ch'ng | www.complexity.io | 2018 // Email: genechng@gmail.com // ---------------------------------------------------------- // A C++ SDL Application // Loading and displaying a bitmap // // How to compile: // g++ -I/usr/include <filename>.cpp -o...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright 2002-2012 Opera Software ASA. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** ** Peter Krefting */ #ifndef PC_APP_H #define PC_APP_H #include "mo...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. * * @author Karianne Ekern (karie) */ #ifndef QUIX_DESKTOP_ENVIRON...
#pragma once #ifndef SLOTH_RAW_CAMERA_H_ #define SLOTH_RAW_CAMERA_H_ #include <sloth.h> #include <window.h> #include <config/header.hpp> namespace sloth { class RawCamera { protected: // vectors of camera glm::vec3 m_Position; float m_Pitch; float m_Yaw; public: RawCamera() :m_Position(CAMERA_INIT...
#pragma once #include "../Config.hpp" #include "../SecureWiper.hpp" #include "../Array.hpp" #include "../Intrinsic.hpp" #include <memory.h> namespace accel::Crypto { template<size_t __N> class XXTEA_ALG { static_assert(__N >= 2); public: static constexpr size_t BlockSizeValue = __N * sizeo...
// // hash.h // HashTable // // Created by Georgiy danielyan on 5/10/15. // Copyright (c) 2015 Goga. All rights reserved. // // Hash Table Tutorial by PaulProgramming. // Followed along and replicated the code. // Hash Table and methods work properly. #include <string> #include <stdio.h> #include <cstdlib> #inc...
#include <iostream> #include <vector> #include <cmath> using namespace std; int main() { int n,cuts; while(true) { cin>>n; if(n==0) break; cuts=0; while(n>1) { cuts++; n/=2; } cout<<cuts<<endl; } return 0; }
#include <iostream> #include "exam.h" /*** * ------------------------------------------------------------------------------------------------------------------- * 题目 * ------------------------------------------------------------------------------------------------------------------- * 无重复字符串的排列组合。编写一种方法,计算某字符串的所有排...
#ifndef S_GRAV_OBJ #define S_GRAV_OBJ #include "GravityObject.h" class SelectGravityObject : public GravityObject { public: SelectGravityObject(); SelectGravityObject(int weight, Vector* position = new Vector(), Vector* speed = new Vector(), Vector* acceleration = new Vector()); SelectGrav...
#include <algorithm> #include <functional> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; string s; struct Solution { int solve() { int curr = 0, res = 0, start = 0; for (char c : s) { curr += c == '+' ?...
#pragma once #include "State.h" class GameEndState : public State { private: // /*sf::RectangleShape Box;*/ sf::Clock quitTimer; sf::RectangleShape BlackScreen; int screen_a; //Texture/Sprites sf::Texture screen_texture; sf::Sprite screen_sprite...
/** * Peripheral Definition File * * NVIC - Nested Vector Interrupt Controller * * MCUs containing this peripheral: * - Cortex-M0 * - Cortex-M0plus * - Cortex-M3 * - Cortex-M4 * - Cortex-M7 */ #pragma once #include <cstdint> #include <cstddef> namespace io { struct Nvic { /** Software trigger interrupt reg...
#include<stdio.h> void shellSortBubble(int a[], int n) { int temp, i, j, flag, gap = n; while (gap > 1) { gap = gap / 2; do { flag = 0; for (i = 0; i < n - gap; i ++) { j = i + gap; if (a[i] > a[j]) { temp = a[i]; a[i] = a[j]; a[j] = temp; flag = 1; } } } while (flag !=...
#include<iostream.h> #include<conio.h> #include<string.h> int max(int a,int b) { return (a>b)?a:b; } int lcs(char *x,char *y,int m,int n) { int i,j,l[10][10]; for(i=0;i<=m;i++) { for(j=0;j<=n;j++) { if(i==0||j==0) { l[i][j]=0; } else if(x[i-1]==y[j-1]) { l[i][j]=l[i-1][j-1]+1; } ...
// // codegen.cpp // mini-sql // // Created by Дмитрий Маслюков on 25.02.2020. // Copyright © 2020 Дмитрий Маслюков. All rights reserved. // #include "codegen.hpp" void CodeGen::write_node (Parser::astnode * node, frame * fr){ switch (node->type) { case Parser::NUMVAL:{ long val = (*(long*...
#include "CHSRandom.hpp" CHSRandom::CHSRandom () { this->seed_x = HSRANDOM_BASIC_SEED_X; this->seed_y = HSRANDOM_BASIC_SEED_Y; this->seed_z = HSRANDOM_BASIC_SEED_Z; this->seed_w = HSRANDOM_BASIC_SEED_W; } void CHSRandom::SetSeed ( unsigned int seed ) { if ( seed == 0 ) { this->seed_x = HSRANDOM_BASIC_SEED_X;...
#include "kg/util/log.hh" #include "kg_features.hh" #include <include/cef_app.h> #include <include/cef_client.h> class cef_client : public CefClient, public CefLifeSpanHandler, public CefLoadHandler, public CefDisplayHandler { public: cef_client() : CefClient {}, CefLifeSpanHandler {}, CefDisplayHandler {}, _brow...
#ifndef ParamsModel_H #define ParamsModel_H #include <QAbstractTableModel> #include <QStyleOptionViewItem> #include "../framework/ProcessingStep.hpp" #include <../framework/ModuleManager.hpp> #include <../framework/MetaData.hpp> namespace uipf { class ParamsModel : public QAbstractTableModel { Q_OBJECT public:...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2000-2003 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 "desktop_starter.h" #include...
// 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....
/* 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 ...
// // Created by OLD MAN on 2019/9/3. // #include <iostream> using namespace std; int main(){ // why 20组测试,通过8组 // int m,n; // cin>>m>>n; // if(m%17 != 0) // m += 17 - m%17; // if(n%17 != 0) // n -= 17 - n%17; // //cout<<m<<" "<<n<<endl; // int num = (n-m)/17 + 1; // //cout<<nu...
/* * AdminConsoleRepositoryImpl.cc * * Created on: Nov 11, 2017 * Author: cis505 */ #include "AdminConsoleRepositoryImpl.h" using namespace std; Status AdminConsoleRepositoryImpl::GetRowForUser(ServerContext* context, const GetUserRowRequest* request, BigTableRow* response) { // TODO: fill out method ret...
#include <iostream> using namespace std; //IDEA: use something like lamuto partition. One traversal solution typedef struct Node { int key; Node *next; Node(int x) { key = x; next = NULL; } } Node; Node *insert(Node *head, int key) //O(1) { Node *temp = new Node(key); temp-...
// Created on: 2001-04-24 // Created by: Christian CAILLET // Copyright (c) 2001-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 CPUSHBUTTON_H #define CPUSHBUTTON_H #include <QPushButton> #include <QLinearGradient> class CPushButton : public QPushButton { Q_OBJECT public: enum State{ Normal, Enter, Pressed, Disable }; CPushButton(const QChar& fchar, const QString& text, QWidget *parent); ~CPushButton(); void setState(St...
#pragma once #include "RigidBody.h" class Sphere : public RigidBody { public: Sphere(glm::vec2 position, glm::vec2 velocity, float fAngRot, float mass, float elasticity, float fFricCoStatic, float fFricCoDynamic, float fDrag, float fAngDrag, float radius, glm::vec4 colour); ~Sphere(); virtual void makeGizmo...
#ifndef ALPHATREE_H #define ALPHATREE_H #include "pixel.h" #include "alphalevel.h" #include "filereader.h" #include <vector> #include "dissimilarity.h" #include "recognizer.h" class AlphaTree { public: //Constructors AlphaTree(); //Functions void initialize(FileReader fileReader); int calculateDissimilari...
#include "stdafx.h" #include "SphericalHarmonicLight.h" //#include SphericalHarmonicLight::SphericalHarmonicLight() { } void SphericalHarmonicLight::SHProjectEnvMap(ComPtr<ID3D11DeviceContext> d3dContext) { /*Renderer::ThrowIfFailed( SHProjectCubeMap(d3dContext.Get(), 3, envMap.Get(), resultR.data(), resultG.d...
#include "Log.h" void Log(const char *fmt, ...) { va_list list; static char buffer[1024]; static DWORD w; FILE *f; va_start(list, fmt); // To console DWORD len = wvsprintfA(buffer, fmt, list); WriteConsole(GetStdHandle(STD_OUTPUT_HANDLE), buffer, len, (DWORD *)&w, NULL); if (fopen_s(&f, "din...
#ifndef LISTA_HPP #define LISTA_HPP struct ELEMENT{ int wartosc; ELEMENT *nast; //wskaznik do nastepnego elementu listy }; class Lista { private: //zeby z zewnatrz nie tykac sie tych wartosci pisze sie private (hermetyzacja danych) ELEMENT *head; ELEMENT *tail; public: //interfe...
#pragma once #include "CShaderResource.h" #include "Effect\CEffectEngine.h" #include "../graphics/RenderTarget.h" #include "../graphics/font/CFONT.h" class CShaderResource; class CEffectEngine; enum EnRenderMode { enRenderMode_Invalid, //不正なレンダリングモード。 enRenderMode_CreateShadowMap, //シャドウマップ生成。 enRenderMode_Norm...
/******************************************************************************* main.cpp - Shape-it Copyright 2012-2021 by Silicos-it, a division of Imacosi BVBA, Hans De Winter, and the Shape-it contributors This file is part of Shape-it. Permission is hereby granted, free of charge, to any person obtaining a copy...
#include <iostream> #include <cstring> #include <queue> #include <vector> #include <algorithm> struct p{ int a, b, c; }; int main() { std::cin.sync_with_stdio(false); std::cin.tie(NULL); std::vector<int> list(3); bool FLAG = false; std::queue<p> q; bool visited[501][501]; std::mem...
int Solution::removeDuplicates(vector<int> &A) { // Do not write main() function. // Do not read input, instead use the arguments to the function. // Do not print the output, instead return values as specified // Still have a doubt. Checkout www.interviewbit.com/pages/sample_codes/ for more details for (int i = 0...
/* -*- 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. ** */ #ifndef OPLOCALE_H #define OPLOCALE_H /** @short Provider of...
#pragma once #include<vector> #include<set> #include<cmath> #include<cstdlib> struct Base { //baza int x; int y; Base(int xx, int yy) :x(xx), y(yy) {} Base(){ x = 0; y = 0; } bool operator==(const Base& rhs)const { return (this->x == rhs.x) && (this->y == rhs.y); } bool operator<(const Base& rhs)const { return...
void nextComb(int curr, vector<string> mp, string iAns, vector<string> &ans, string A) { if (curr >= A.size()) { ans.push_back(iAns); return; } for (int i = 0; i < mp[A[curr] - '0'].size(); i++) { iAns.push_back(mp[A[curr] - '0'][i]); nextComb(curr + 1, mp, iAns, ans, A); iAns.pop_back(); }...
#ifndef MOVIE_H #define MOVIE_H #include <string> #include <iostream> #include <set> #include <algorithm> #include "product.h" #include "util.h" class Movie : public Product { public: Movie(const std::string category, const std::string name, double price, int qty, std::string genre, std::string rating); ~Movie...
#ifndef XYZ_H #define XYZ_H #include <iostream> #include <cmath> #include <random> #include <string> #include <sstream> std::random_device generator; std::uniform_real_distribution<float> unitInterval(0.0f,1.0f); std::uniform_real_distribution<float> symmetricInterval(-1.0f,1.0f); constexpr double PI =3.141592653589...
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Navalny.hpp :+: :+: :+: ...
#pragma once #include "Seaquence.h" class State; class SeaquenceController; class GameSeaquence; class GameSeaquenceController:public Seaquence { public: typedef SeaquenceController GrandController; enum NextSeaquence{ NEXT_ENDING, NEXT_GAMEOVER, NEXT_TITLE, NEXT_NONE, }; GameSeaquenceController(); ~G...
#include "Shader.h" #include <glm/gtc/type_ptr.hpp> #include <fstream> #include <sstream> #include <iostream> #include "OpenGLDebug.h" ShaderBase::~ShaderBase() { if (_id) { glDeleteProgram(_id); glCheckError(); } } void ShaderBase::Start() { glUseProgram(_id); glCheckError(); } void ShaderBase::End() { glUse...
/* * Roller.h * * Created on: Apr 6, 2015 * Author: eddy */ #ifndef ROLLER_H_ #define ROLLER_H_ #include <thread> #include <mutex> class Roller{ public: void start_cycle(int size); void stop_cycle(void); int get_number(void); private: void cycle(void); int sides; int number; bool...
/* 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...
#include <Windows.h> #define button1 1 int CALLBACK wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR szCmdLine, int nCmdShow) { MSG msg{}; HWND hwnd{}; WNDCLASSEX wc{ sizeof(WNDCLASSEX) }; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hbrBackground = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); wc.hCursor =...
/* -*-mode:c++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ #include "scheduler.hh" #include <iomanip> #include <sstream> #include <iostream> #include <cmath> #include <numeric> #include <chrono> #include "thunk/ggutils.hh" #include "thunk/thunk_reader.hh" #include "net/s3.hh" #include "tui/status_...
#ifndef __VIVADO_SYNTH__ #include <fstream> using namespace std; // Debug utility ofstream* global_debug_handle; #endif //__VIVADO_SYNTH__ #include "gp_4_opt_compute_units.h" #include "hw_classes.h" struct in_in_update_0_write0_merged_banks_6_cache { // RAM Box: {[0, 80], [0, 78]} // Capacity: 44 // # of rea...
#include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <map> typedef long long LL; typedef unsigned long long ULL; #define PI 3.141592653589...
class PZombie_VB: Citizen1 { side = 1; glassesEnabled = 0; moves = "CfgMovesZombie"; gestures = "CfgGesturesMale"; weapons[] = {}; weaponSlots = ""; backpack = ""; magazines[] = {}; respawnWeapons[] = {}; respawnMagazines[] = {}; faceType = "PZombieFace1"; identityTypes[] = {"PZombie1"}; extCameraPositio...
/* * SDEV340 Week 2 Problem 1 * Convert an integer x: 0 <= x <= 9999 into its English string representation * Benjamin Lovy */ #include <iostream> #include <string> using std::string; // Class for pretty-printing a number 0-9999 class Numbers { unsigned int number; static string hundred; static string le...
////////////////////////////////////////////////////////////////////////// // ExpandCollapseControl.cpp - Provides expand and collapse functionality// // to hide and unhide data on web browser // // // // Language: Visual C++ 2015 ...
// // Created by Dawid Szymański on 2019-05-18. // #include <iostream> int exercise04() { int mnoznik = 2, nadgodziny = 0, liczbagodzin, stawka, brutto, podatek, netto; int prog = 28 , prog20 = 19, prog2030 = 21, prog30 = 28; int var20, var2030, var30; std::cout << "Podaj liczbe godzin\nLiczba godzin:...
#include "BulletObject.h" #include "BulletTransform.h" namespace Game { BulletObject::BulletObject(Transform transform) : mTransform(transform) { } BulletObject::~BulletObject() { } PhysicsTransform& BulletObject::transform(){ return mTransform; } BulletTransform& BulletObject::nativeTransform() { return mTran...
class Solution { public: double myPow(double x, int n) { if (n<0) return 1.0/power(x,n); return power(x,n); } private: // 采用分治法 double power(double x, int n) { if (0==n) return 1.0; double val = power(x, n/2); return (n%2==0)? val*val: val*val*x; } }...
#pragma once #include "widgets/widget.hpp" namespace OptimExplorer { class TrainWidget : public Widget { public: TrainWidget() : Widget("Train") {} void render() override; private: float m_lr = 1e-3; float m_wd = 5e-4; int m_epochs = 10; }; } // namespace OptimExplorer
/* -*- Mode: c++; tab-width: 4; c-basic-offset: 4 -*- * * Copyright (C) 2007-2010 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef COMMON_SOCKET_ADDRESS_H #define COMMON_SOCKET_ADDRESS_H __FILE__ #include "mod...
// Created on: 1995-07-18 // Created by: Modelistation // 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 GNU ...
#include "singl_motion.h" #include "ui_singl_motion.h" Singl_Motion::Singl_Motion(QWidget *parent) : QDialog(parent), ui(new Ui::Singl_Motion) { ui->setupUi(this); ui->Motion_Number->addItem("M1"); ui->Motion_Number->addItem("M2"); ui->Motion_Number->addItem("M3"); } Singl_Motion::~Singl_Motio...
#include "Region.h" #include "..\Util.h" using namespace BroodWar; namespace BroodWar { namespace Api { Region^ ConvertRegion(BWAPI::Region region) { if(region == NULL) return nullptr; return gcnew Region(region); } Region::Region(BWAPI::Region region) { instance = region; } int Regi...
/* -*- 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. ** ** Peter Krefting */ /** @file ua.cpp * * Contains functions fo...
#include "classes/particle.h" void Particle::integrate(float duration) { asert(duration > 0.0); //Update using Verlet integration Vector3 lastAcc = acceleration; Vector3 newAcc = force*inverseMass Vector3 avgAcc = (lastAcc + newAcc)*.5; position.addScaledVector(velocity, duration); positio...
#pragma once #include<cocos2d.h> #include<ctime> USING_NS_CC; class WorldTime : public Sprite { public: CREATE_FUNC(WorldTime); virtual bool init(); static WorldTime* getInstance(); clock_t getTime(); DWORD DelayBegin, DelayEnd, DelayTime; private: static WorldTime* _instance; };
/* * Copyright (c) 2011 Pierre-Etienne Bougué <pe.bougue(a)gmail.com> * Copyright (c) 2011 Florian Colin <florian.colin28(a)gmail.com> * Copyright (c) 2011 Kamal Fadlaoui <kamal.fadlaoui(a)gmail.com> * Copyright (c) 2011 Quentin Lequy <quentin.lequy(a)gmail.com> * Copyright (c) 2011 Guillaume Pinot <guillaume.pino...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2007-2009 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. It may not be distributed * under any circumstances. */ #ifndef MEMORY_REPORTING_H #define MEMORY_REPORTING_H #ifdef EN...
#ifndef HWMEDIADECODER_H #define HWMEDIADECODER_H #include <android/native_window_jni.h> struct StreamDecodedataParameter { char *minetype; int width; int height; ANativeWindow *window; int channels; int samplerate; }; class CHwMediaDecoder { public: CHwMediaDecoder() { m_codecid = -1;} virtual ~CHwMediaDe...
#ifdef DEBUG #define _GLIBCXX_DEBUG #endif #include <iostream> #include <algorithm> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <memory.h> #include <math.h> #include <string> #include <string.h> #include <queue> #include <vector> #include <set> #include <deque> #include <map> #include <functional>...
#include <iostream> #include <vector> #include <algorithm> #include <string> int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0); bool asc = true, des = true; for (int i = 1; i <= 8; ++i) { int a; std::cin >> a; asc = asc && a == i; ...
/******************************************************************************** ** Form generated from reading UI file 'mainwindow.ui' ** ** Created by: Qt User Interface Compiler version 5.14.1 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ***************************************...
#include<cstdio> using namespace std; int n,L,G; int main() { scanf("%d%d%d",&n,&L,&G); for(int i=1;i<=n;i++) { int w,h; scanf("%d%d",&w,&h); while(w>G || h>G) w/=2,h/=2; if(w<L || h<L) printf("Too Young\n"); if(w>=L && h>=L && w!=h) printf("Too Simple\n"); if(w>=L && h>...
// // Created by 송지원 on 2019-10-31. #include "iostream" #include <string.h> using namespace std; int main () { char input[101]; int ch; int i, len; cin.getline(input, 101); len = strlen(input); for (i=0; i<len; i++) { ch = input[i]; if ((ch-'A') * (ch-'M') <= 0) ch += 1...
/* ID: stevenh6 TASK: agrinet LANG: C++ */ #include <fstream> #include <string> #include <map> #include <vector> #include <string> #include <algorithm> using namespace std; ofstream fout("agrinet.out"); ifstream fin("agrinet.in"); int main() { int sol = 0; int connect[100] = {1}; int web[100][100]; ...
#include <SDL/SDL.h> #include <Arduino.h> #include <avr/io.h> #include "component/sdcard.h" #include "component/adc.h" #include "component/heater.h" #include "component/serial.h" #include "component/display_SSD1309.h" #include "component/display_HD44780.h" #include "component/led_PCA9632.h" #include "component/ardui...
// // Created by manout on 18-1-18. // #include <vector> #include <algorithm> using std::upper_bound; using std::lower_bound; using std::vector; void insert_sort(vector<int>& data) { for (auto it = data.begin() + 1; it not_eq data.end(); ++it) { auto const insertion_point = std::upper_bound(data.begin(), it, *it...