text
stringlengths
8
6.88M
// my_div.cpp : 定义 DLL 应用程序的导出函数。 // #include "stdafx.h" extern "C" { _declspec(dllexport) double my_div(int a, int b); } double my_div(int a, int b) { return a / b; }
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; c-file-style: "stroustrup" -*- */ /** * ES_Value_Internal and operations on ES_Value. * * @section value_set ECMAScript values * * @section values Represented values * * A value in the engine is a tagged union '...
#pragma once #include "Light.h" class AmbientLight : public Light { public: RGB lightColor; double radianceScalingFactor; AmbientLight(); void setRadianceScalingFactor(double i); void setLightColor(double r, double g, double b); double getRadianceScalingFactor(); RGB getLightColor(); RGB getLightRadiance();...
#ifndef NICKSTORAGEMODEL_H #define NICKSTORAGEMODEL_H #include <QAbstractTableModel> #include <QVariant> #include <QModelIndex> #include <QHash> #include <QList> #include <QString> #include "nickmodel.h" class NickStorageModel : public QAbstractTableModel { Q_OBJECT public: explicit NickStorageModel(QObject *...
#include <QTRSensors.h> #include <Serial.h> #define NUM_SENSORS 6 // number of sensors used #define NUM_SAMPLES_PER_SENSOR 4 // average 4 analog samples per sensor reading #define EMITTER_PIN 13 // emitter is controlled by digital pin 2 // sensors 0 through 5 are connected to analog inpu...
#include "utility/Profiler.h" #include <iostream> std::shared_ptr<Profiler> Profiler::getInstance() { if (!s_instance) { s_instance = std::shared_ptr<Profiler>(new Profiler()); } return s_instance; } void Profiler::recordTrace(const std::string& name, long long duration) { if (m_traces.find(name) == m_traces....
// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2008-2009 Gael Guennebaud <gael.guennebaud@inria.fr> // // Eigen is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free...
#include "include/Widget/rigidpropertywidget.h" #include "ui_rigidpropertywidget.h" //----------------------------------------------------------------------------------------------------------- RigidPropertyWidget::RigidPropertyWidget(QWidget *parent, RigidProperty _property, float posX, float posY, float posZ, float...
/* ------------------------------------------------------------------ * Copyright (C) 1998-2009 PacketVideo * * 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.o...
#include<iostream> #include<vector> #include<algorithm> #include<stack> using namespace std; #define inf 9999 struct TreeNode { int val; TreeNode* left; TreeNode* right; TreeNode() : val(0), left(nullptr), right(nullptr) {} TreeNode(int x) : val(x), left(nullptr), right(nullptr) {} TreeNode(int x, TreeNode* left,...
#include<bits/stdc++.h> using namespace std; typedef long long ll; main() { ll test, s, p=1, x, y; cin>>test; while(test--) { cin>>s; x = ceil(sqrt(s)); y = x*x-x + 1; if(x%2==0) { if(s<y) cout<<"Case "<<p++<<": "<<x-y+s<<" "<<x<<endl;...
#ifndef SETTLER_RESOURCE_H #define SETTLER_RESOURCE_H #include <string> using std::string; enum product {none, wood, brick, ore, cattle, wheat}; string resource_name(const product&); #if 0 class resource { public: enum product {none, wood, brick, ore, cattle, wheat}; private: product _prod; r...
#include<iostream> #include<stdio.h> using namespace std; int main() { int i,j; char str[100]; cout<<"Enter string\n"; gets(str); int count; for(i=0;str[i]!='\0';i++) if(str[i]==' ') cout<<"CamelCase does not exist\n"; if(str[0]>='a'&&str[0]<='z') { count=1; } else if(str[0]>='A'&&str[0]<='Z') ...
#include <gtest/gtest.h> #include <cstdint> #include <fmt/ieee-float.hpp> using namespace fmt; TEST(IeeeFloat, Uint64Conversions) { uint64_t ordered = 0x0123456789ABCDEF; EXPECT_EQ(3512700564088504e-318, IeeeDouble(ordered).value()); uint64_t min_double64 = 0x0000000000000001; EXPECT_EQ(5e-324, IeeeDouble(mi...
#include "State_Ship.h" #include "State.h" #include "Ship.h" #include "SensoryMemory.h" #include "Wall.h" //#include "SteeringBehaviors.h" #include "TargetSystem.h" #include "SensoryMemory.h" #include "Detector.h" #include "WeaponSystem.h" #include "Weapon.h" #include "ObjectType.h" #include "GamePlay.h" #...
// Copyright (c) 2017-2021 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with spe...
/* ***** BEGIN LICENSE BLOCK ***** * FW4SPL - Copyright (C) IRCAD, 2009-2011. * Distributed under the terms of the GNU Lesser General Public License (LGPL) as * published by the Free Software Foundation. * ****** END LICENSE BLOCK ****** */ #include <fwComEd/helper/Array.hpp> #include <fwDataTools/MeshGenerator.h...
#include <stdio.h> #include "randomforest.h" #include "common.h" #include <iostream> #include <sstream> #include <fstream> #include <string> #include <algorithm> #include <iterator> #include <vector> #include <unordered_set> std::vector<std::string> split(std::string sentence){ using namespace std; if(sentence...
#include "include/month.hpp" #include <cstdlib> #include "include/helpers.hpp" using std::string; Month::Month(string date) { this->date = date; int year = atoi(date.substr(5, 4).data()); int mon = atoi(date.substr(2, 2).data()); int numDays = 0; if (mon ==2 && year % 4 == 0 && year % 100 && year % 40...
#pragma once #include "bricks/core/object.h" #include "bricks/core/pointer.h" #include "bricks/core/string.h" #if BRICKS_CONFIG_RTTI #include <typeinfo> namespace Bricks { class TypeInfo : public Object { private: const std::type_info* type; public: TypeInfo() : type(NULL) { } TypeInfo(const TypeInfo& typ...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- * * 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. */ #include "core/pch.h" #ifdef SVG_SUPPORT #ifdef SVG_LOG_ERRORS ...
// StaticCanvas.cpp : implementation file // #include "stdafx.h" #include "Chat.h" #include "StaticCanvas.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CStaticCanvas ...
#pragma once #include <memory> #include "Keng/Base/Serialization/Serialization.h" #include "Keng/ResourceSystem/FwdDecl.h" namespace yasli { class Archive; } namespace keng::resource { class IResource; class IResourceSystem; class IDevice; class IResourceFabric : public core::IRefCountObject ...
#include <iostream> #include <string.h> #include <vector> using namespace std; class Person { public: Person(int age, char *str) { cout << "有参构造" << endl; m_age = age; name = (char *)malloc(strlen(str) + 1); strcpy(name, str); } //实现深拷贝 Person(const Person &p) {...
#include "mainwindow.h" #include "ui_mainwindow.h" //#include "guarantee.h" //#include "contact.h" //#include "environments.h" #include "logintype.h" #include "usertype.h" #include <QMessageBox> MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupU...
/** * Copyright (c) 2022, 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...
/********************************************************************* * Assignment: Lab 14 - Doubly Linked List implementation * * Author: Martin Plut * * Date: Fall 2017 * * File: Lab 14 header++ file ...
#include <jni.h> #include <android/log.h> #include <string.h> #include "jni/jni_utils.h" extern "C" { /** * Convert a jstring to a UTF-8 char pointer. Ownership of the pointer goes * to the caller. **/ char * convert_jstring_path(JNIEnv * env, jstring input) { char buf[PATH_MAX]; jboolean copy = false; ...
// // main.cpp // BYU Loops // // Created by Jesse Millar on 9/24/13. // Copyright (c) 2013 Jesse Millar. All rights reserved. // #include <iostream> using namespace std; int loopCount; int main() { cin >> loopCount; for (int i = 0; i < loopCount; i++) { cout << "BYU\n"; } r...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) 2008-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 MEDIASOURCE_H #define MEDIAS...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*- * * Copyright (C) 2009-2012 Opera Software ASA. All rights reserved. * * This file is part of the Opera web browser. * It may not be distributed under any circumstances. */ #ifndef MEDIA_CONTROLS_H #define MED...
/* * File: main.cpp * Author: Tom * * Created on 13 January 2012, 3:45 PM */ #include <cstdlib> #include <iostream> using namespace std; /* * */ int main() { int one = 1; int two = 1; int three = 2; long sum = 0; while(three < 4000000) { if(three%2 == 0) { ...
//Using Floyd Warshall. Time-0.000s #include <bits/stdc++.h> using namespace std; #define ll long long #define vll vector<ll> int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ll p,r,t=0; string a,b; while(cin>>p>>r) { if(p==0 && r==0) break; t++; //if...
#include <iostream> using namespace std; int main() { //Leeres Feld (enthaelt Garbage) //int feld[5]; /*Element einzeln fuellen feld[0] = 4; feld[1] = 7; */ // Feld mit Startwerten int feld[] = {2, 4, 6, 8}; cout << sizeof(feld) << "=" << sizeof(int*) << endl; cout << size...
////////////////////////////////////////////////////////////////////////////// // // 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. // ////...
/* -*- coding: utf-8 -*- !@time: 2020/1/7 6:51 !@author: superMC @email: 18758266469@163.com !@fileName: 0032_arrange_the_array_to_the_smallest_number.cpp */ #include <environment.h> class Solution { private: static bool cmp(int x, int y) { return to_string(x) + to_string(y) < to_string(y) + to_stri...
#if defined(_PSP_VER) #include "Colour.h" #include "stdlib.h" const unsigned int Colour::White = 0xffffffff; const unsigned int Colour::Black = 0xff000000; const unsigned int Colour::Red = 0xff0f0fff; const unsigned int Colour::Green = 0xff0fff00; const unsigned int Colour::Yellow = 0xff0ffff0; const unsigned int Co...
#include <stdio.h> #include <string.h> #include "pico/stdlib.h" //#include "hardware/adc.h" //#include "hardware/clocks.h" //#include "hardware/flash.h" #include "hardware/gpio.h" //#include "hardware/irq.h" //#include "hardware/pwm.h" //#include "hardware/spi.h" // #include "tusb.h" // if you want to use tud_cdc_conne...
class Solution { private: int dir[4][2]{{-1,0}, {1,0}, {0, 1}, {0, -1}}; vector< vector<char> > grid; vector< vector<bool> > visited; int n, m; void dfs(int i, int j){ visited[i][j] = true; for(int y=0;y<4;y++){ int ni = i + dir[y][0]; int nj = j + dir[y][1]; if(ni >= 0 && ni < n && nj >= 0 && nj < ...
// File: query.h // Written by Joshua Green #ifndef QUERY_H #define QUERY_H #include "column.h" #include "key.h" #include "predicate.h" #include <vector> struct column; struct key_entry; // --------------------------------------------------------------- CLASS QUERY ------------------------------------...
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; */ vector<int> v; void solve(TreeNode* A){ if(!A) return; solve(A->left); v.push_back(A->val); solve(A->right); } in...
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; vector<int> v(n), cp(n); for(int i=0; i<n; i++){ cin >> v[i]; cp[i] = v[i]; } sort(cp.begin(), cp.end()); int c1 = cp[n/2-1], c2 = cp[n/2]; for(int i=0; i<n; i++){ if(v[i] <=...
#ifndef PLUGINS_INTERFACES_SRC_SHAREDLOGGERINTERFACE_H #define PLUGINS_INTERFACES_SRC_SHAREDLOGGERINTERFACE_H #define SHARED_LOGGER_INTERFACE_IDENTIFIER "edl.SharedLoggerInterface" #include <QtPlugin> #include "easylogging++.h" namespace plugins { namespace interfaces { /*! * \brief The SharedLoggerInterface stru...
#include <sgfx/canvas.hpp> #include <algorithm> void sgfx::draw(canvas_view target, const canvas& img, point top_left) { if (top_left.x + img.width() <= 0 || top_left.x >= target.width()) return; if (top_left.y + img.height() <= 0 || top_left.y >= target.height()) return; auto x_offset = ...
#include "CollisionDetector.h" #include <cstdlib> #include "CharacterObject.h" #include "Game.h" CollisionDetector::CollisionDetector() { } CollisionDetector::~CollisionDetector() { } const bool CollisionDetector::IsCollided(const Rect& rcA, const Rect& rcB) { Game& game = Game::Instance(); return (abs(rcA.cent...
#include "Bispectrum_MPI.hpp" #include "wignerSymbols.h" #include "Integrator.hpp" #include <complex> #include <cmath> #include "Log.hpp" #include <fstream> #include "ODEs.hpp" #include "ODE_Solver.hpp" #include <ctime> #include <chrono> using namespace chrono; Bispectrum::Bispectrum(AnalysisInterface* analysis, MPI_...
// thread_id.cpp // Boost Logging library // // Author: John Torjo, www.torjo.com // // Copyright (C) 2007 John Torjo (see www.torjo.com for email) // // 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 // h...
// // triangle.h // cg-projects // // Created by HUJI Computer Graphics course staff, 2012-2013. // Purpose : A class that represents a triangle on the 3d space. // Implements a method checking if a given point is inside // the triangle. // #ifndef _TRIANGLE_HH #define _TRIANGLE_HH ////////...
#include <iostream> #include <random> #include <stdexcept> #include "control.h" // § InputHandler void InputHandler::read_line() { std::string line; std::getline(std::cin, line); input.str(line); input.clear(); len = input.str().length(); } Square InputHandler::get_row_col(const std::string& prom...
#ifndef INPUTHANDLER_H #define INPUTHANDLER_H #include <QObject> #include <QHash> #include <QString> class InputHandler : public QObject { Q_OBJECT public: explicit InputHandler(QObject *parent = 0); void addMapping(int key, int signal); void addMapping(int key, const QString &signal); void r...
#include "src/wasm/cpp/arcs.h" #include "src/wasm/cpp/tests/entities.h" class HandleSyncUpdateTest : public arcs::Particle { public: HandleSyncUpdateTest() { registerHandle("input1", input1_); registerHandle("input2", input2_); registerHandle("output", output_); } void onHandleSync(const std::string...
/* * EventSet.cpp * * Created on: Jun 11, 2017 * Author: root */ #include "EventSet.h" #include "BoundSlot.h" #include "EventArgs.h" #include "SubscriberSlot.h" #include "../Memory/MemAllocator.h" namespace CommBaseOut { EventSet::EventSet() : m_muted(false) { } EventSet::~EventSet(void) { RemoveAll...
#ifndef APP_H #define APP_H #include <string> #include "core/pbutil.h" class SDL_Window; struct _SDL_GameController; namespace pb { class GLCtx; class App { private: App(const App& rhs); App& operator=(const App& rhs); public: App(const char* appName); virtual ~App(); bool StatusOk(); ...
// Copyright (c) 2019, tlblanc <tlblanc1490 at gmail dot com> #include <ctype.h> #include <errno.h> #include <limits.h> #include "string_utils.hpp" #define null_check(a, b) do { \ if (a == nullptr && b == nullptr) { \ return true; \ } else if (a...
/* -*- 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 */ #include "core/pch.h" #include "modules/prefs/...
#pragma once #include "component.h" class TimeComponent : public Component { public: enum Action { kPlayOnce, kDestroyOwner, kRepeat, kPlayBack, kReverse }; public: TimeComponent() {} void Initialize() override; void Destroy() override; bool Load(const rapidjson::Value& value) override; Component* C...
#include<cstdio> int partition(int arr[],int start,int end){ int p = arr[start]; while(start<end){ while(start<end&&arr[end--]>=p); arr[start]=arr[end]; while(start<end&&arr[start++]<=p); arr[end]=arr[start]; } arr[start]=p; printf("%d",start); return start; }...
/* A thief is robbing a store and can carry a maximal weight of W into his knapsack. There are N items and ith item weighs wi and is of value vi. Considering the constraints of maximum weight that knapsack can carry, you have to find and return the maximum value that thief can generate by stealing items. Note Space com...
// GcSequenceModifyDockable.cpp : 구현 파일입니다. // #include "stdafx.h" #include "CocosTool.h" #include "GcSequenceModifyDockable.h" #include "GcSequenceTimeDlg.h" #include "GcSequenceCollisionDlg.h" #include "GcExtraDataDlg.h" const gtchar* GcSequenceModifyDockable::msSequenceCollisionDlgName = _T("Collision"); const gtc...
#include <iostream> #include <vector> #include <map> #include <cmath> #include <queue> #include <algorithm> #include <iomanip> #include <set> using namespace std; /*ϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕϕ*/ #define int long long int #define ld long double #define F first #define S second #define P p...
#include <iostream> #include <cstring> using namespace std; int main(){ char a[20], b[20]; gets (a); gets (b); int d = strcmp (a,b); if (d==0) cout << "they are SAME"; else if (d<1) cout << a << " comes first" << endl; else cout << b << " comes first" << endl; int e = a[0] - b[0]; if (e==0) c...
#include "qrdialog.h" #include "ui_qrdialog.h" QRDialog::QRDialog(QWidget *parent) : QDialog(parent), ui(new Ui::QRDialog) { ui->setupUi(this); } QRDialog::~QRDialog() { delete ui; }
/* struct TreeLinkNode { int val; struct TreeLinkNode *left; struct TreeLinkNode *right; struct TreeLinkNode *next; TreeLinkNode(int x) :val(x), left(NULL), right(NULL), next(NULL) { } }; */ class Solution1 { public: TreeLinkNode* GetNext(TreeLinkNode* pNode) { if(!pNode){ ...
#pragma once #ifndef END_GAME_SCREEN_H #define END_GAME_SCREEN_H #include "Screen.h" #include "Texture.h" class EndGameScreen: public Screen { private: Texture* title; Texture* congratz; bool showCongratz; TTF_Font* font; SDL_Color red; int time; public: void setShowCongratz(bool); void start(SDL_Renderer*...
/* -*- mode: c++; tab-width: 4; c-basic-offset: 4 -*- */ group "layout.cliprectobject"; include "modules/doc/frm_doc.h"; include "modules/logdoc/logdoc.h"; include "modules/logdoc/htm_elm.h"; include "modules/layout/traverse/traverse.h"; require init; html { //! <html><body style="margin: 0; height: 10000px"> //!...
// use two unordered_maps class Solution { public: vector<int> findSubstring(string s, vector<string>& words) { vector<int> indices; unordered_map<string, int> count; for (string word : words) { count[word]++; } int ns = s.size(), nws = words.size(), nw = words[0...
#include "SqlNativeConnection.hpp" #ifndef ELYSIUM_CORE_DATA_SQLNATIVECLIENT_SQLHELPER #include "SqlHelper.hpp" #endif #ifndef ELYSIUM_CORE_EXCEPTION #include "../Elysium.Core/Exception.hpp" #endif Elysium::Core::Data::SqlNativeClient::SqlNativeConnection::SqlNativeConnection() : DbConnection() { SqlH...
#ifndef BUTTON_H #define BUTTON_H #include "Postmaster/Subscriber.h" #include <string> #include <SFML/Graphics/Drawable.hpp> #include <SFML/Graphics/RectangleShape.hpp> #include <SFML/Graphics/Text.hpp> // TODO: Make font size adjust to button size namespace Platy { namespace Game { enum class EMessageType; ...
#include <iostream> #include <fstream> #include <iomanip> using namespace std; int main() { cout << "Press Ctrl-C to stop" << endl; ofstream fileOutput ("random"); for (int i = 0; i <= 1000; i++) { if (i % 10 == 0) fileOutput << endl; fileOutput << left << setw(4) << 5 + rand() % 1...
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*- ** ** 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...
#include "SkyboxGenerator.h" #include "../OpenGL/TextureCubeMap.h" #include "../OpenGL/ComputeShader.h" #include "../OpenGL/TimeQuery.h" #include "../ImGui/imgui.h" #include <iostream> SkyboxGenerator::SkyboxGenerator(glm::ivec2 cubemapFaceDims) { _cubemapFaceDimensions = cubemapFaceDims; _groupDims = glm::ivec3(c...
/* * Copyright 2016 Freeman Zhang <zhanggyb@gmail.com> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applic...
#include <iostream> using namespace std; long long recursion(int n) { // OG motherfuckers B-) if (n == 1) return 1; int x = n * (n+1) / 2; long long p = 1; for (int i = 0; i < n; i++) { p *= x; x -= 1; } return p + recursion(n-1); } int main() { // only gravity will pu...
// Created by: Kirill GAVRILOV // Copyright (c) 2013-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 // by the Fre...
// // load_float_image.cpp // PlaneMap // // Created by Yimeng Zhang on 5/25/14. // Copyright (c) 2014 Yimeng Zhang. All rights reserved. // #include "load_float_image.h" #include <cstdio> #include <cstdlib> #include <cstring> #include <GLFW/glfw3.h> #include <stdint.h> GLuint load_float_image(const char * image...
// // Created by 1 on 17.10.2015. // #include <tuple> #ifndef BIND_BIND_H #define BIND_BIND_H #endif //BIND_BIND_H template <size_t N> struct arg; template <> struct arg<0> { template <typename First, typename ... Tail> typename std::decay<First const>::type operator() (First const& first, Tail const& ... t...
#ifndef ERRORS_MSG_H_ #define ERRORS_MSG_H_ #include <nan.h> #include <string> #include "webp/encode.h" #include "webp/decode.h" #define CallbackError(callback, errmsg) \ v8::Local<v8::Value> argv[] = {Nan::Error(errmsg)}; \ callback->Call(1, argv); \ return; ...
#include ".\input.h" #include "graphics.h" #include "camera.h" Input::Input(void) { priority = TP_ENGINE; ZeroMemory((void *)&keystate,sizeof(keystate)); ZeroMemory((void *)&laststate,sizeof(laststate)); mouseMovement = Vector(0,0,0); mouseAbsolute = Vector(0,10,0); mousePosition = Vector(0,0,0); in...
// // main.cpp // serialowabaza // // Created by Julia on 06.11.2018. // Copyright © 2018 Julia. All rights reserved. // Used IDE: XCode 9.4; Used OS: Mac OS 10.13.6 // This project probably will not work correctly with Windows, becouse of 100th line in uzytkownik.cpp. #include <iostream> #include <fstream> #in...
/* -*- 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 ** */ #ifndef _DIGEST_AUTH_ELEMENT_H_ #define ...
// -*- 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. // // Arjan van Leeuwen (arjanl) #ifndef ENGINE_STORE3_H #define E...
#pragma once #include <vector> #include "Point.h" class Quickhull { public: Quickhull(std::vector<Point> p, bool render); std::vector<Point> findExtremes(std::vector<Point> p); std::vector<std::vector<Point> >getAllHulls(); std::vector<Point> GetHull(); private: std::vector<std::vector<Point> > allHulls; void Fi...
/* * Copyright (c) 2011-2012 Dan Wilcox <danomatika@gmail.com> * * BSD Simplified License. * For information on usage and redistribution, and for a DISCLAIMER OF ALL * WARRANTIES, see the file, "LICENSE.txt," in this distribution. * * See https://github.com/danomatika/ofxAppUtils for documentation * */ #pragma...
#include <systemc.h> #include <fstream> #include <iostream> SC_MODULE(tester) { sc_in<bool> clk; sc_out<bool> reset_n; sc_out< sc_uint<2> > addr_in_1, addr_in_2, addr_out; sc_out< sc_uint<3> > opcode; ifstream in_file; void testing(); SC_CTOR(tester) { SC_THREAD(testing); sensitive << clk.pos(); i...
#include <iostream> #include <vector> #include <set> #include <algorithm> #include <stack> using namespace std; /** Solution 2 O(N) time complexity **/ class Solution { public: int largestRectangleArea(vector<int>& heights) { stack<int> indices; int res = 0; int n = heights.size(); ...
/* 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 ...
#ifndef ZLIB_UTIL_H #define ZLIB_UTIL_H #include "zlib/zlib.h" class zlib_writer{ private: int CHUNKSIZE; int UNITSIZE; z_stream strm; unsigned char *out; // output buffer public: zlib_writer(int level = Z_DEFAULT_COMPRESSION); ~zlib_writer(); // please set flush to Z_FINISH in the final write size_t...
// Helena Ruiz Ramirez // A01282531 // 22/marzo/2018 // Tarea 7: Herencia // Descripcion: Header de la clase Empleado. Hereda de Persona y esta compuesto con Tiempo. #ifndef Empleado_h #define Empleado_h #include "Persona.h" #include "Tiempo.h" using namespace std; class Empleado:public Persona{ public: Emplea...
//=========================================================================== //! @file scene_manager.h //! @brief シーン管理システム //=========================================================================== #pragma once //=========================================================================== //! @class SceneManager /...
#include<SPI.h> #define CS 10 void setup() { pinMode(CS, OUTPUT); digitalWrite(CS, HIGH); Serial.begin(115200); SPI.begin(); SPI.beginTransaction(SPISettings(100000, MSBFIRST, SPI_MODE0)); } void loop() { digitalWrite(CS, LOW); int val = SPI.transfer(42); digitalWrite(CS, HIGH); Serial.println(val)...
#include<bits/stdc++.h> #define int long long using namespace std; const int N = 1e6; int readInt () { bool minus = false; int result = 0; char ch; ch = getchar(); while (true) { if (ch == '-') break; if (ch >= '0' && ch <= '9') break; ch = getchar(); } if (ch ...
//Write a program that reads P,T and R.Find simple interest and amount. #include<iostream> using namespace std; int main() { int p,t,r,si,a; cout<<"Enter principle,rate and time:"<<endl; cin>>p>>r>>t; si=(p*t*r)/100; a=p+si; cout<<"Simple Interest:"<<si<<"\nAmount:"<<a<<endl; return 0; }
#pragma once #include <string> #include <vector> namespace tiit { void clean(std::string& str) { str.erase(str.begin()); str.erase(prev(str.end())); const auto end = str.end(); auto it = str.begin(); while (it != end) { it = std::find(it, end, ' '); if (it == end) { break; } str.eras...
// Created on: 1993-11-09 // 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 ...
#pragma once #include "Vec3.h" #include "MoveDevice.h" namespace Move { class MoveRawCalibration { public: MoveRawCalibration(MoveDevice::TMoveCalib calib); ~MoveRawCalibration(void); public: short int AccHeader; Vec3 AccVectors[6]; short int GyroBiasHeaders[2]; Vec3 GyroBiasVectors[...
#include "Colliders.h" #include "Globals.h" #include "ModuleInput.h" #include "Application.h" #include "ModulePlayer.h" #include "ModuleParticles.h" #include "Pinball.h" #include "ModuleAudio.h" Colliders::Colliders(Application* app, bool start_enabled) : Module(app, start_enabled) { } Colliders::~Colliders() { ...
#include "mac.h" #include "memory.h" #include <math.h> #include "global.h" //模拟器内部函数,无需用类硬件写法 extern void Multi24(int Multi24_0, int Multi24_1); extern void Mac_Sim(int addr_0, int addr_1, int Const_Reg, unsigned int Config_Reg, int addr_out, int len); extern void Multi24_16x24(int Multi24_0, int Multi24_1); ...
#include<stdio.h> int rstrlen(char *p); int main() { printf("%d",rstrlen("Hello There")); } int rstrlen(char *p) { if(*p) { p++; return 1+rstrlen(p); } else { return 0; } }
// -*- C++ -*- #ifndef POLEH #define POLEH ////////////////////////////////////////////////////////////////////// // // File: pole.hh // // Animation Lab, Computer Science Department // Carnegie Mellon University // // Created: Sat Mar 16 17:22:12 1996 by Zoran Popovic // // GerbilPole is a class for mousepol...
// 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 ...