text
stringlengths
8
6.88M
#ifndef __DRIVER_GPIO_H #define __DRIVER_GPIO_H #include "gpiod.h" using namespace std; class gpio { private: struct gpiod_chip * chip; struct gpiod_line * line; public: gpio(int no, int dir); ~gpio(); int set_value(int val); int get_value(); }; #endif
#include "CHud.h" char (*CHud::m_BigMessage)[128] = (char (*)[128])0xBAACC0; Bool &CHud::bScriptForceDisplayWithCounters = *(Bool *)0xBAA3FA;
#include "glib.h" #include "iostream" #include "sstream" int main(int argc , char *argv[]) { GLIB obj("file://myconnections.xml"); int val=obj.HexStringToInt(argv[1]); obj.writeTest("test_REG",val); return 0; }
//Jumping on clouds #include <iostream> #include<vector> using namespace std; int main(){ int n; cin >> n; vector<int> clouds(n); for(int i = 0;i < n;i++){ cin >> clouds[i]; } vector<int>counts(n , 100); counts[0] = 0; for (int i = 0; i < n; ++i) { if (clouds[i] == 1...
#include "knight.h" Knight::Knight(int x, int y, bool pieceColor) : Piece(x, y, 'N', pieceColor){} bool Knight::Move(int i, int j, Location** board) { // down if ( i == mX + 2 ) { if ( ( ( j == mY - 1 ) || ( j == mY + 1 ) )&&( ( board[i][j].GetPiece() == NULL) || ( board[i][j].GetPiece()->GetColor() != board[...
/* * 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...
// // nehe10.h // NeheGL // // Created by Andong Li on 9/7/13. // Copyright (c) 2013 Andong Li. All rights reserved. // #ifndef __NeheGL__nehe10__ #define __NeheGL__nehe10__ #include <OpenGL/gl.h> #include <OpenGL/glu.h> #include <GLUT/glut.h> #include "utils.h" #include "SOIL.h" #include <iostream> #include <s...
#include "ESObject.h" ESObject::ESObject(string _name) { className = _name; }
/* * Program: Matching.h * Usage: Match all the images with key points */ #ifndef MATCHING_H #define MATCHING_H #include <iostream> #include <vector> #include <map> #include <set> #include <cmath> #include "CImg.h" #include "Warping.h" extern "C"{ #include <vl/generic.h> #include <vl/sift.h> #include <vl/kdtree.h>...
/** @file * Base class for an host-guest service. */ /* * Copyright (C) 2011-2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; * you can redistribute it and/or modify it under the terms of th...
#include <stdio.h> int main () { int n; double sed = 0.464102, result = 0; scanf("%d", &n); if (n % 2 == 0) { result = n; } else if (n == 1) { result = 2; } else if (n == 3) { result = 3.732051; } else { result = n + sed; } printf("%lf\n"...
//#include <iostream> // //using namespace std; // //int main() //{ // int n=9,m=19; // if(n<10&&m<20) // { // while(n>=1) // { // while(m>=1) // { // cout<<m<<" "; // m--; // } // cout<<"\n n: "<<n<<"\n"; // n--; // ...
int Solution::solve(vector<int> &A, int B) { int n = A.size(); int light, dark = 0; int ans = 0; while (dark < n) { light = dark + B - 1 < n ? dark + B - 1 : n - 1; while (light >= 0 && light >= dark - B + 1 && A[light] != 1) light--; if (light < 0 || light < dar...
#include "CModifyIdMessage.h" #include "Markup.h" #include "CMessageEventMediator.h" #include "NetClass.h" CModifyIdMessage::CModifyIdMessage(CMessageEventMediator* pMessageEventMediator, QObject *parent) : CMessage(pMessageEventMediator, parent) { } CModifyIdMessage::~CModifyIdMessage() { } bool CModifyIdMessage::...
#include "deleteworker.h" #include "JlCompress.h" #include<QFile> #include<QDir> #include <boost/filesystem.hpp> void DeleteWorker::init(QFileInfo& f1) { QString path = f1.filePath(); this->qfi1_= path + "/blk0001.dat"; this->qfi2_= path + "/txleveldb"; std::cout << "file " << (this->qfi1_).toStdString() << s...
#pragma once #include <iostream> #include <vector> #include <string> #include <cmath> class CourseData { public: struct Course { float grade; int points; std::string name; std::string gradeName; int id; }; private: float CalculateCredential(); std::vector<Course*> courses; std::string GradeToName(i...
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Bibliotheque.cpp * Author: emmadevaud * * Created on 22 mai 2020, 14:17 */ #include "Bibliotheque.h" using namesp...
#ifndef TEXT_MANAGER_HPP_ #define TEXT_MANAGER_HPP_ #include "TextRendererInterface.h" #include <unordered_map> #include <stdio.h> #include <stdarg.h> #include <string.h> #include <FTGL/ftgl.h> class FTGLTextRenderer : public TextRendererInterface { private: typedef std::unordered_map<int, FTGLPixmapFont *> Fo...
#include <iostream> #include <string> #include <vector> using namespace std; class Robot_part { protected: string name; int model_number; double cost; string description; string image_filename; public: Robot_part(string _name, int _model_number, double _cost, string _description) : name{_name}, model_num...
#include "libretro.h" #include <windows.h> static HMODULE h; static void (*pretro_set_environment)(retro_environment_t); void retro_set_environment(retro_environment_t p) { pretro_set_environment(p); } static void (*pretro_set_video_refresh)(retro_video_refresh_t); void retro_set_video_refresh(retro_video_refresh_t...
class CommonAmerica : CommonBlufor { uniform[] = { "rhs_uniform_FROG01_wd" }; vest[] = { "" }; backpack[] = { "" }; primary[] = { "" }; secondary[] = { "" }; launcher[] = { "" }; magazines[] = { "" }; items[] = { "ACE_EarPlugs",1 }; binoculars[] = { "" }; compass[] = { "ItemCompass" }; goggles[] = { "" }; ...
/* Petar 'PetarV' Velickovic Algorithm: Merge Sort */ #include <stdio.h> #include <math.h> #include <string.h> #include <iostream> #include <vector> #include <list> #include <string> #include <algorithm> #include <queue> #include <stack> #include <set> #include <map> #include <complex> #define MAX_N 1000001 using na...
#ifndef _ICOSAHEDRON_H_ #define _ICOSAHEDRON_H_ #include <vector> #define _USE_MATH_DEFINES #include <cmath> #include "g_Vector.h" #define ICOSAHEDRON_EPSILON 1e-5 class Icosahedron { protected: int d_q; // frequency of tesselation // offset for coordinates g_Vector d_offset; double d_radius; int d_ma...
#ifndef AWS_NODES_VARIABLEDECLARATION_H #define AWS_NODES_VARIABLEDECLARATION_H /* * aws/nodes/variabledeclaration.h * AwesomeScript Variable Declaration * Author: Dominykas Djacenka * Email: Chaosteil@gmail.com */ #include <list> #include "assignment.h" #include "statement.h" namespace AwS{ namespace Nodes{ ...
#include <stdlib.h> #include <string.h> #include <list> #include <set> #include <memory> #include <stdexcept> #include "socks6msg.h" #include "socks6msg.hh" #include "sanity.hh" using namespace std; using namespace S6M; #define S6M_CATCH(err) \ catch (EndOfBufferException &) \ { \ (err) = S6M_ERR_BUFFER; \ } \ ...
// 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 Lesser General Public License version 2.1 as published ...
#include "abstractshapeinfo.h" namespace sbg { template<int n> AbstractShapeInfo<n>::~AbstractShapeInfo() { } template struct AbstractShapeInfo<2>; template struct AbstractShapeInfo<3>; }
/* 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<bits/stdc++.h> using namespace std; #define MOD 1000000007 #define pr pair<int,int> #define pb push_back #define mp make_pair #define fi first #define se second typedef long long ll; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin>>t; while(t--) { int n,m; ci...
#ifndef UTILS_H_ #define UTILS_H_ #include "Room.h" #include <vector> #include "../rapidxml/rapidxml.hpp" #include "../rapidxml/rapidxml_utils.hpp" #include "../rapidxml/rapidxml_print.hpp" using namespace std; using namespace rapidxml; Room makeRoom(int, xml_node<> *); Item makeItem(xml_node<> *); Container makeContai...
#include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #include <cmath> #include <string> #include <algorithm> //#include "camadafisica.h" #define TAMANHO_VETOR 8 using namespace std; int CamadaDeAplicacaoTransmissoraBipolar(){ // Deve ser feita a conversão para binário //...
#include "Application.h" #include "MenuScene.h" int main() { try { // Create an application object. FW::Application app("Resources/Configuration.xml"); // Add the menu scene to the scene manager. app.getSceneManager().addScene<MenuScene>(); // Run the game. app.run(); } // If there wa...
//----------------------------------------------------------------------------- // Module D // // Description - Contains functions used to calculate the repulsive energy //----------------------------------------------------------------------------- #ifndef MODULEDNEW_HPP #define MODULEDNEW_HPP #include "../atom/atom....
#include <bits/stdc++.h> using namespace std; #define MOD 1000000007 #define rep(i, n) for(int i = 0; i < (int)(n); i++) #define rep1(i, n) for(int i = 1; i <= (int)(n); i++) #define showmap(is, js, x) {rep(i, is){rep(j, js){cout << x[i][j] << " ";}cout << endl;}} #define show(x) {for(auto i: x){cout << i << " ";} cout...
#ifndef _ZORK_ROOM_ #define _ZORK_ROOM_ #include "Object.hpp" #include "Container.hpp" #include "Item.hpp" #include "Creature.hpp" #include <functional> #include <list> using namespace std; class Room:public Object { public: Room(const string& n,const string& desc,const string& status, const string& type); void a...
#ifndef WAVEGUIDE_SYSTEM_H_ #define WAVEGUIDE_SYSTEM_H_ #include "linear_system.h" #include "waveguide.h" #include "wave.h" #include "complex" namespace KFU { class WaveguideSystem: public LinearSystem { public: WaveguideSystem(Waveguide guide, Wave w); void solve_all(); Wave* getSolutions(); private: ...
// #pragma once #ifndef _CONTRH_ #define _CONTRH_ /* 定义等值线绘制中使用到的基本数据类型 读取网格点信息 contr::access_contour */ #include "comn.h" #include "string-trans.h" namespace contr{ template <typename T> class pointxy //点 { public: T x; T y; pointxy() :x(0),y(0) {} pointxy(T a,T b) ...
#ifndef QTestParameterNames_H #define QTestParameterNames_H /** \class QTestParameterNames * * * Defines name and number of parameters that must be specified in the * xml configuration file for each quality test besides error and warning thresholds. * It's used by QTestConfigurationPerser * to check that a...
// Created on: 2013-02-05 // Created by: Julia GERASIMOVA // Copyright (c) 2001-2013 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...
/********************************************************************** axasm Copyright 2006, 2007, 2008, 2009 by Al Williams (alw@al-williams.com). This file is part of axasm. axasm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public Licenses as published by the Fre...
// Created on: 1993-05-04 // Created by: Modelistation // 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 GNU ...
#ifndef DFILEDIALOG_H #define DFILEDIALOG_H #include <QQuickItem> #include <xcb/xcb.h> #include <xcb/xproto.h> class QWindow; class QFileDialog; class DFileDialog : public QQuickItem { Q_OBJECT public: explicit DFileDialog(QQuickItem *parent = 0); ~DFileDialog(); Q_PROPERTY(QUrl fileUrl READ fileUrl)...
////////////////////////////////////////////////////////////////////////////// // // Copyright (c) Triad National Security, LLC. This file is part of the // Tusas code (LA-CC-17-001) and is subject to the revised BSD license terms // in the LICENSE file found in the top-level directory of this distribution. // ////...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 1995-2007 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. ** */ #ifndef VEGA_BACKENDS_MODULE_H #define VEGA_BACKENDS_MODULE_H ...
#ifndef SRC_DISPLAY_STRING_TRIE_NODE_H #define SRC_DISPLAY_STRING_TRIE_NODE_H /** * HIGH-LEVEL OVERVIEW: * Return the number of characters to print below the current node so as to * separate its value from those of its children. Eg., * hello * =========== -> This function determines the n...
#ifndef SOAP_SRC_EDLPROVIDERSERVERTHREAD_H #define SOAP_SRC_EDLPROVIDERSERVERTHREAD_H #include <QThread> namespace edlprovider { namespace soap { /*! * \brief The EdlProviderServerThread class is simply a helper to launch the Edl provider soap server in a separate thread. */ class EdlProviderServerThread : public ...
#ifndef TENSORPRODDENSE_H #define TENSORPRODDENSE_H #include <vector> #include <complex> #include <Eigen/SparseCore> //#include "sparseMat.h" using namespace Eigen; using namespace std; typedef std::complex<double> Complex; typedef Eigen::Triplet<Complex> T; typedef Eigen::SparseMatrix<Complex,RowMajor> SpMat; //ty...
#pragma once template <typename TCollection> class query_collection { private: TCollection m_Collection; public: query_collection(TCollection && collection) : m_Collection (std::forward<TCollection>(collection)) { } auto begin() { return m_Collection.begin(); } auto end() { return m_Collection.end();...
#ifndef __QUADRATIC__ #define __QUADRATIC__ #include <cassert> #include <iostream> #include "R_Tree.hpp" using namespace std; //this will be an R-Tree that does quadratic split template<typename RTreeType> class QuadR_Tree : public R_Tree<RTreeType> { private: typename R_Tree<RTreeType>::Node** splitNode(const ty...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2009 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" #ifdef DOM_JIL_API_SUPPORT #include "mod...
#include <gtkmm.h> #include "../../core/Process.h" #include "../../core/CommandDescriptor.h" class CommandPage : public Gtk::Box { public: CommandPage(Gtk::Window *parent); void loadCommandDescriptor(CommandDescriptor *descriptor); void reset(); void render(); void monitorC...
#pragma once #include "../MonsterAction.h" class Act_Ignite : public MonsterAction { public: Act_Ignite(); bool Action(Monster* me) override; private: bool Chase(Monster* me); bool Attack(Monster* me); enum state { enSChase, enSAttack, }; state m_state = enSChase; bool m_first = true; float m_cost = 20.f...
#include <algorithm> #include <functional> #include <iostream> #include <numeric> #include <string> #include <unordered_map> #include <unordered_set> #include <vector> using namespace std; int months[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; int n, m; struct Solution { string solve() { // sliding ...
#ifndef __QUEUE_CPP #define __QUEUE_CPP #include "queue.h" #include <iostream> using namespace std; template <class T> Queue<T>::Queue() { vipCount = 0; } template <class T> Queue<T>::Queue(const Queue<T>& otherQueue) { vipCount = otherQueue.vipCount; int len = otherQueue.list.length(); ListItem<T> *ptr = ot...
// ImageFilter2D.cpp // // This example demonstrates performing gaussian filtering on a 2D image using // OpenCL // // Requires FreeImage library for image I/O: // http://freeimage.sourceforge.net/ #include <iostream> #include <fstream> #include <sstream> #include <string.h> #ifdef __APPLE__ #include <...
// In order to fix up a vehicle more wheels and glass are required, so they have higher weights. Parts[] = { {Loot_MAGAZINE, 1, PartGeneric}, {Loot_MAGAZINE, 3, PartGlass}, {Loot_MAGAZINE, 1, PartFueltank}, {Loot_MAGAZINE, 3, PartWheel}, {Loot_MAGAZINE, 1, PartEngine} };
/** * Copyright (c) 2021, 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 condi...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 2007-2011 Opera Software AS. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. * * Edward Welbourne (based on unix/base/common/mt.cpp by Morten Ste...
#include <iostream> #include <stdlib.h> using namespace std; template <typename T> void sortTab(T* array,int numElem); int main() { int intTab[10] = {5,6,3,10,45,33,2,0,5,87}; float floatTab[10] = {1.2,5.1,20.6,5.1,1.1,0.3,0.7,12.3,3.2,20.1}; double doubleTab[10] = {1.20,0.20,12.36,25.36,2.15,3.14,25.3,14.25,1.21,5...
#include "inifile.h" int main(int argc, char**argv) { std::string file_name = "test.ini"; if (argc == 2) //different ini file passed as command arg file_name = argv[1]; IniFile ini(file_name); bool quit; std::string section,name; do { std::cout << "\n\nSECTION>"; std::getline(std::cin,section, '\n'); ...
/* * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <folly/Optional.h> #include <quic/dsr/frontend/WriteCodec.h> namespace quic { uint32_t writeDSRStreamFrame( DSRPack...
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <array> #include <fstream> #include <numeric> #include <boost/lexical_cast.hpp> using namespace std; using namespace boost; class Creature { enum Abilities { str, agl, intl, count }; std::array<int, count> abilities; public: ...
#include "dormitory.h" #include "login.h" #include "administrator.h" #include "ui_login.h" #include "mysql.h" #include "QMessageBox.h" QString login::id = ""; login::login(QWidget *parent) : QDialog(parent), ui(new Ui::login) { ui->setupUi(this); MySqlInit(); ui->password->setEchoMode(QLineEdit::P...
#include <iostream> #include <map> #include <vector> #include <set> #include <string> #include <cstdio> #include <algorithm> using namespace std; int main () { ios::sync_with_stdio(false); cin.tie(NULL); map<string, vector<string> > report; set<string> dishes; int i; while (cin >> i) { cin.ignore(); for ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * Copyright (C) 1995-2007 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) */ #ifndef STREAM_BUFFER_H ...
//=========================================================================== //! @file AssetManager.h //! @brief アセット全般管理用クラス //=========================================================================== #pragma once //=========================================================================== //! @class AssetManager...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; 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 */ #ifndef LIBSSL_PREMASTER_H #define LIBSSL_P...
#include <cstdio> #include <memory.h> #include <algorithm> using std::max; using std::min; int s[2222][2222], n, m; inline int getsum(int x1, int y1, int x2, int y2) { x1 = max(min(x1, n + m), 1); y1 = max(min(y1, m + n), 1); x2 = max(min(x2, n + m), 1); y2 = max(min(y2, m + n), 1); return s[x2][...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- ** ** Copyright (C) 2005 Opera Software AS. All rights reserved. ** ** This file is part of the Opera web browser. It may not be distributed ** under any circumstances. */ #ifndef SVGNUMBER_H #define SVGNUMBER_H #include "modules/libvega/vega...
#ifndef BINARYTREENODE_H #define BINARYTREENODE_H #include <string> #include <iostream> using namespace std; class BinaryTreeNode { public: BinaryTreeNode(); BinaryTreeNode(string); virtual ~BinaryTreeNode(); //The three Order functions just print the data v...
#ifndef _ENCRYPT_RC4_ #define _ENCRYPT_RC4_ #include <string.h> #define BOX_LEN 256 #define ENCRYPT_PWD "rockifone_powerful_ileader" class RC4Encrypt{ public: static int GetKey(const unsigned char* pass, int pass_len, unsigned char *out); static int RC4(const unsigned char* data, int data_len, const unsigned char...
class Solution { public: bool isValid(string s) { stack<char> pare; for (string::iterator it = s.begin(); it != s.end(); ++it) { switch (*it) { case '{': case '[': case '(': { pare.push(*it); break; } ...
#include <iostream> template<typename T> class Vector { private: T* elem; unsigned long sz; public: Vector(std::initializer_list<T>); ~Vector() { delete[] elem; } T& operator[](int i); const T* begin() const; const T* end() const; const T& operator[](int i) const; unsigned lon...
#include <iostream> #include <vector> #include <stdio.h> using namespace std; int main(int argc, char const *argv[]) { int A0=0, A1=0, A2=0, A3=0, A4=-1; float cnt = 0.0; int flag0=0, flag1=0, flag2=0, flag3=0, flag4=0; int num, input; int sign = 1; cin >> num; while( num-- ) { cin >> input; switch(input...
#include <ionir/construct/construct.h> #include <ionir/construct/value.h> #include <ionir/const/const.h> namespace ionir { Construct::Construct( ConstructKind kind, std::optional<ionshared::SourceLocation> sourceLocation, ionshared::OptPtr<Construct> parent ) : ionshared::BaseCo...
#include "ScriptManager.h" #include <regex> ScriptManager::ScriptManager() {} int ScriptManager::scriptChangeColor() { duk_context* ctx = duk_create_heap_default(); if (!ctx) { printf("Failed to create a Duktape heap.\n"); exit(1); } // Register objects and member functions inside our context d...
#include <iostream> #include <string> #include <algorithm> #include <iterator> #include <cstring> using namespace std; class Rochambo { public: int wins(string opponentGame) { string myGame = "RR"; string rochambo = "RPS"; string tmp; register size_t it; for (it = 1; it < opponentGame.s...
#include <iostream> #include <list> using namespace std; struct Animal { virtual void talk() = 0; }; struct Dog : Animal { void talk() { cout << "Bark!" << endl; } }; struct Cat : Animal { void talk() { cout << "Meow!" << endl; } }; class Shelter { private: list<Ani...
//超类方法不同的访问级别 class Gregarious { public: virtual void talk() {cout<<"Gregarious say hello ! "<<endl;} } ; class Shy : public Gregarious { protected: virtual void talk() {cout<<"Shy reluctantly say hello ! "<<endl;} }; Shy myShy; myShy.talk();//Bug,直接访问protected //正确的访问方...
#include "Chess.h" #include <qpainter.h> Chess::Chess(QWidget *parent) : QMainWindow(parent) { ui.setupUi(this); } void Chess::paintEvent(QPaintEvent*) { }
/* * File: main.cpp * Author: Daniel Canales * * Created on July 11, 2014, 4:25 PM */ #include <cstdlib> #include <iostream> using namespace std; /* * */ int main(int argc, char** argv) { //create for random # gen srand(static_cast<unsigned int>(time(0))); //decalre variables short me...
#include "Mat4x4f.h" namespace CGLA { Mat4x4f rotation_Mat4x4f(Axis axis, float angle) { Mat4x4f m(0.0f); switch(axis) { case XAXIS: m[0][0] = 1.0; m[1][1] = cos(angle); m[1][2] = sin(angle); m[2][1] = -sin(angle); m[2][2] = cos(angle); m[3][3] = 1.0; break; case YAXIS: ...
/* -*- 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 Patricia Aas (psmaas) */ #include "core/pch.h" // -*- Mode: c++; tab-width:...
#include "graphics.h" #include "md2.h" #include <iostream> #include <fstream> #include <utility> using std::cout; using std::cerr; using std::endl; extern int modelsRenderedThisFrame; Vector Model_MD2::_kAnorms[] = { #include "Anorms.h" }; int Model_MD2::_kMd2Ident = 'I' + ('D'<<8) + ('P'<<16) + ('2'<<24); int Mod...
/* BEGIN LICENCE */ /***************************************************************************** * SKCore : the SK core library * Copyright (C) 1995-2005 IDM <skcontact @at@ idm .dot. fr> * $Id: unicode.cpp.in,v 1.1.4.1 2005/02/21 15:02:20 krys Exp $ * * Authors: Mathieu Poumeyrol <poumeyrol @at@ idm .dot. fr> ...
#include <iostream> #include <map> #include <string> using namespace std; class EllysNewNickname { public: int getLength(string nickname) { int cnt = 0; char w; bool isConsecutive = false; for (int i=0; i<nickname.size(); ++i) { w = nickname.at(i); if (w == 'a' || w == 'i' || w== 'u' || w== 'e' || w==...
#pragma once #include <array> namespace breakout { enum class EEntityType : int { Awersome = 0, Background = 1, SolidBlock = 2, Block = 3, PlayerPaddle = 4, PlayerBall = 5, SpeedPowerUp = 6, StickyPowerUp = 7, PassThroughPowerUp = 8, PadSizeIncreasePowerUp = 9, ConfusePowerUp = 10, ChaosPowe...
// FileReadWrite.h #ifndef SIMPLE_FILE_READ_WRITE_H #define SIMPLE_FILE_READ_WRITE_H #include <string> namespace simple { std::string readFile( const std::string& name ); void writeFile( const std::string& out, const std::string& fileName ); } // simple #endif // SIMPLE_FILE_READ_WRITE_H
#pragma once #include "StdAfx.h" #include "Object.h" class CGrid : public CObject { public: CGrid(int col, int row, int colSize, int rowSize): CObject(NULL), m_col(col), m_row(row), m_colSize(colSize), m_rowSize(rowSize), m_bShow(false) {} bool Init(){return true;} void Update(float){} ...
#pragma once #include <map> #include <vector> #include <Poco/SharedPtr.h> #include <Poco/JSON/Array.h> #include <Poco/JSON/Object.h> #include "gwmessage/GWResponse.h" #include "model/DeviceID.h" #include "model/ModuleID.h" #include "model/RefreshTime.h" #include "util/Loggable.h" namespace BeeeOn { /** * @brief R...
//#ifdef DEBUG #if 0 #include <stdint.h> #include <string.h> const int chardat=0x0000; extern uint8_t * wram; extern uint16_t * vram; extern uint16_t * cgram; extern uint8_t * aram;//not that I'll need this... extern uint8_t * oam; extern uint32_t palette[32768]; uint32_t * pixels; void initstuff(uint32_t * mypixel...
// Created on: 1993-01-09 // Created by: CKY / Contract Toubro-Larsen ( Kiran ) // 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...
#include "SqList.h" void PrintMenu(void) { /* * Function Name: PrintMenu * Parameter: None * Return: None * Use: Print the main menu */ printf("\n+-----------------------------------------------------+\n"); printf("| *THE* LINEAR LIST DEMO |\n"); printf("| ...
#ifndef HTTPWORKER_H #define HTTPWORKER_H #include <QObject> #include <QNetworkAccessManager> #include <QNetworkReply> #include <QTextCodec> #include <QStringList> #include <QRegExp> #include <QSemaphore> #include <QMutex> #include <QMutexLocker> #include <QVector> #include <QPoint> #include <QDebug> class QHttpWork...
/////////////////////////////////////// // // Computer Graphics TSBK03 // Conrad Wahlén - conwa099 // /////////////////////////////////////// #include "Model.h" #include "GL_utilities.h" #include <iostream> Model::Model() { subDrawID = 0; subVoxelizeID = 0; diffuseID = 0; maskID = 0; diffColor = glm::vec3(1.0...
#include <bits/stdc++.h> #define ll long long #define ull unsigned long long #define FOR(i,n) for(ll i=0;i<n;i++) #define FOR1(i,n) for(ll i=1;i<n;i++) #define FORn1(i,n) for(ll i=1;i<=n;i++) #define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define mod 1000000007; using namespace std; int main() { ...
#ifndef _JOGADOR_H_ #define _JOGADOR_H_ #include "Personagem.h" class Jogador : public Personagem { private: const short int num; // Varável que informa qual é o número do jogador // jogador 1, jogador 2 etc... public: Jogador(); Jogado...
/** * @file test_macro.cpp * * * @author Fan Kai(fk), Peking University * @date 2008年07月01日 20时55分18秒 CST * */ #define _WRAP(X, Y) {X;Y;} #define _THROW(EX) {\ LOG_ERROR("throw " <<#EX); \ throw EX; \ } #define _CATCH(EX, FUNC) catch (EX &ex) {\ LOG_ERROR("catch " <<#EX); \ FUNC; \ } #def...
#include "INTEGER.hpp" #include "iostream" INTEGER::INTEGER() { } INTEGER::INTEGER(int x1) { this->x1 = x1; } INTEGER::suma(int x, int y) { return x + y; } INTEGER::resta(int x, int y) { return x - y; } INTEGER::division(int x, int y) { return x / y; } INTEGER::multiplicacion(int x, int y) { return x * y; } ...
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); QSqlDatabase db; createConnectionSqlite(db, "CdCollection"); createTable(db); removeAllCds(db); insertCd(db,"Alles wir gut! ", "Nina Ruge ", 2005); ...