text
stringlengths
8
6.88M
#include "decifrar.hpp" #include <iostream> #include <cassert> int main(int argc, char* argv[]) { decifrar* decif = new decifrar(); assert(decif->decipher("FC HQWZP LPU JOMUFU HK TBFXIT TXJGPHFZH", "181246").compare("EU GOSTO DOS FILMES DE STEVEN SPIELBERG") == 0); std::cout << "Everything good on decifrar class" <...
#include <stdlib.h> #include <stdio.h> #include <math.h> #include "noises.h" using namespace std; #define B 0x100 #define BM 0xff #define N 0x1000 #define NP 12 /* 2^N */ #define NM 0xfff static int p[B + B + 2]; static float g3[B + B + 2][3]; static float g2[B + B + 2][2]; static float g1[B + B + 2]; static int...
/*====================================================================* - Copyright (C) 2001 Leptonica. All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - 1. Redistributions of source c...
/*! * \file * \author David Saxon * \brief Inline definitions for UTF-8 implementations of the * byte_to_symbol_index function. * * \copyright Copyright (c) 2018, The Arcane Initiative * All rights reserved. * * \license BSD 3-Clause License * * Redistribution and use in source a...
#include <string> #ifndef IO_H #define IO_H char getch(); char getche(); void reset(); void clean_stdin(); std::string color(const std::string text, const std::string color); std::string underline(const std::string text, const std::string color); #endif
#ifndef GENERIC_MEX_IO #define GENERIC_MEX_IO #include <matrix.h> #include <mex.h> #undef printf #include <cstdarg> #include <vector> #include <unordered_map> #include <functional> #include <cstdio> #include <string.h> #include "MexMem.hpp" #include "LambdaToFunction.hpp" #include "MexTypeTraits.hpp" #ifdef _MSC_VE...
// This file has been generated by Py++. #ifndef StateImageryMap_hpp__pyplusplus_wrapper #define StateImageryMap_hpp__pyplusplus_wrapper void register_StateImageryMap_class(); #endif//StateImageryMap_hpp__pyplusplus_wrapper
// max occuring character in a string #include <iostream> #include <string> #include <bits/stdc++.h> using namespace std; int main() { string s = "kndkfkjdjlfdlkslfk"; int freq[26] = {0}; for(int i=0;i<s.size();i++){ freq[s[i]-'a']++; } char ans; int maxF = 0; for(int i=0; i<...
/****************************************************************************************** * Chili DirectX Framework Version 16.07.20 * * Game.cpp * * Copyright 2016 PlanetChili.net <http://www.planetchili.net> * * * * This file is part of The Chili...
#include "../inc.h" class Solution { public: //O(N * logN) int longestConsecutive1(vector<int> &num) { if(num.size() < 2) return num.size(); sort(num.begin(), num.end()); int r = 1, c = 1; for(size_t i = 1;i < num.size();++i){ if(num[i - 1] == ...
#pragma once #include "easytf/base.h" #include "easytf/entity.h" #include "easytf/param.h" namespace easytf { class Operator { public: //init param virtual void init(const Param& param) = 0; //forward virtual void forward(const std::map<std::string, std::shared_ptr<Entity>>& bottom, std::map<std::string, st...
#include<iostream> using namespace std; int gcd(int a,int b) { int i,j; for(i=1; i<=a || i<=b; ++i) { if(a%i==0 && b%i==0) j=i; } return (a*b)/j; } int main() { int j; float fraction,i=2,x,y,a,b,c; cin>>x>>y; c=x/y; while(c>0) { j=gcd(y,i); ...
/* File Name: BinarySearchTree.h Author: Geun-Hyung Kim Description: 연결 리스트를 활용한 이진탐색트리 생성 */ #ifndef _BINARY_SEARCH_TREE_ #define _BINARY_SEARCH_TREE_ #include <iostream> #include <queue> using namespace std; template <typename T> class Node{ T data; // 데이터 저장을 위한 변수 Node<T> *left; // 트리 노드의 ...
#include "rayon.h" #include <QDebug> Rayon::Rayon() { id_3=0; type_2=""; etat=0; materiels=""; } Rayon::Rayon(int id_3,QString type_2,int etat,QString materiels) { this->id_3=id_3; this->type_2=type_2; this->etat=etat; this->materiels=materiels; } QString Rayon::get_type_2(){return type_2;} int Rayon::get_eta...
/************************************************************* * > File Name : P2278.cpp * > Author : Tony * > Created Time : 2019/08/26 15:59:39 * > Algorithm : [DataStructure]priority_queue **************************************************************/ #include <bits/stdc++.h> us...
#ifndef WAVPCMFILE_H #define WAVPCMFILE_H #include <QFile> #include <QAudioFormat> class WavPcmFile : public QFile { public: WavPcmFile(const QString & name, const QAudioFormat & format, QObject *parent = 0); bool open(); void close(); private: void writeHeader(); bool hasSupportedFormat(); QAudioFormat...
/* Copyright (c) 2008 NVIDIA CORPORATION Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, dis...
#pragma once void sort_file(const std::string & in_path, const std::string & output_path, const std::string & tmp_path = "tmp.dat", size_t num_threads = 2); void sort_file(const char* in_path, const char* output_path, const char* tmp_path = "tmp.dat", size_t num_threads = 2);
#include <iostream> #include <string> #include <vector> #include <algorithm> #include <cmath> using namespace std; int main() { string first_name; first_name = "Gulnaz"; cout <<first_name; cout<<"\n"; first_name = "Nici"; cout <<first_name; cout<<"\n"; int age; age = 45; cout...
#include <iostream> using namespace std; int main() { cout << "first num: " double n1, n2; cin >> n1; cout << "second num: " cin >> n2; cout << "sum:" << n1 + n2 << endl; return 0; }
/* ID: sarthak16 PROG: namenum LANG: C++ */ #include <iostream> #include <fstream> #include <string> using namespace std; char a[10][3] = { {'0', '0', '0'}, {'1', '1', '1'}, {'A', 'B', 'C'}, {'D', 'E', 'F'}, {'G', 'H', 'I'}, {'J', 'K', 'L'}, {'M', 'N', 'O'}, {'P', 'R', 'S'}, {'T', 'U', 'V'}, {'W', 'X', 'Y'}, }; int ...
/************************************************************************* > File Name: time.cpp > Author: Jason > Mail: jie-email@jie-trancender.org > Created Time: 2017年03月29日 星期三 13时34分42秒 ************************************************************************/ #include "time.h" #include <muduo/net/EventLoop....
#include "Camera.hpp" using namespace Render; using namespace Math; Camera::Camera(float sceneAspectRatio) : m_fov(120.0f), m_aspectRatio(sceneAspectRatio), m_zNear(0.01f), m_zFar(6000.f), m_cameraInitPos({1000.0, 600.0, -800.0}), m_targetInitPos({0.0, 0.0, 0.0}) { reset(); } void Camera::reset() { m_cameraP...
#ifndef __F_BULLET__ #define __F_BULLET__ #include "Bullet.h" #include "../../FrameWork/Animation.h" #define F_BULLET_SPEED 200.0f #define ROUND_RADIUS 600.0f #define ROUND_FREQUENCE 3.5f class FBullet : public Bullet { public: FBullet(GVector2 startPosition, float degree); ~FBullet(); void init() overrid...
//************************************************************************** //** //** See jlquake.txt for copyright info. //** //** 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 ...
#ifndef BinaryNode_hpp #define BinaryNode_hpp #include <iostream> namespace compressor { class bitset; class BinaryNode { public: explicit BinaryNode() = default; explicit BinaryNode(BinaryNode& node) = default; explicit BinaryNode(BinaryNode&& node) = default; virtual ~BinaryNode() = default; ...
/*************************************************************************** dialogocolores.h - description ------------------- begin : jue abr 1 2004 copyright : (C) 2004 by Oscar G. Duarte email : ogduarte@in...
#include <ros/ros.h> #include <OGRE/OgreMatrix3.h> #include <OGRE/OgreSceneManager.h> #include <OGRE/OgreSceneNode.h> #include <OGRE/OgreVector3.h> #include "WeightedPoseWithCovarianceArray/WeightedPoseWithCovarianceArrayVisual.h" namespace tuw_geometry_rviz { WeightedPoseWithCovarianceArrayVisual::WeightedPoseWithC...
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) #define ok() puts(ok?"Yes":"No"); using namespace std; typedef long long ll; typedef vector<int> vi; typedef pair<int, int> ii; typedef vector<vi> vvi; typedef vector<ii> vii; typedef vector<bool> vb; typedef vector<vb> vvb; typedef set<int> si; ty...
#include <Control/vddispatcher.h> VDDispatcher::VDDispatcher(QObject *parent) : QObject(parent) { /* ide jon majd a settings osztaly peldanya, amely alapjan a vdcontrol es a gui funkcioit osszekapcsoljuk. (billentyuparancs es egyeb marhasagok pld. Scriptelesnel ez az osztaly jo lehet event-kezelesre is....
#ifndef CODEGENERATOR_H #define CODEGENERATOR_H #include "../syntaxtree/aggregates.h" /** * Abstract interface to which every code generator for tiny should adhere */ class CodeGenerator { public: /** * Generate code for all given identifiers (variables, arrays and functions) * The passed variabl...
#include <iostream> #include "world.h" int main() { World& world = World::instance(); Country* scotland = world.getCountry("Scotland"); Country* catalonia = world.getCountry("Catalonia"); Country* england = world.getCountry("England"); Country* spain = world.getCountry("Spain"); Union* eu = wo...
// // DataFile.h // Homework6 // // Created by HeeCheol Kim on 2018. 10. 12.. // Copyright © 2018년 HeeCheol Kim. All rights reserved. // #pragma once #include <string.h> using namespace std; class DataFile { public: DataFile() { this->filename = ""; } ~DataFile() {} inline void setFile(stri...
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <sstream> using namespace std; /* 位运算方法,二进制表示下,某一位a与b不同才能得到1(0+1或者1+0),某一位a与b相同能得到0(0+0或者1+1进位) 我们再保留进位 (a&b)<<1,如果进位为0时加法完成 */ class Solution { public: int Add(int a, int b) { int t...
/** * * @file TCP.hpp * @brief TCP communication class * @auther Naoki Takahashi * **/ #pragma once #include <memory> #include <string> #include <boost/asio.hpp> namespace IO { namespace Communicator { class TCP { public : TCP(const short &port); TCP(const TCP &) = delete; ~TCP(); ...
#ifndef METROMAP_MAP_MAP_H #define METROMAP_MAP_MAP_H #include <QHash> #include <QList> #include <QSharedPointer> class QString; namespace metro { class Station; class Map { public: typedef QHash<quint32, QSharedPointer<Station> >::const_iterator StationIterator; QList<quint32> stationsId() const; QList<qui...
#include "EditorInputHandler.h" EditorInputHandler::EditorInputHandler( HINSTANCE handleInstance, HWND handle, Camera* camera, int w, int h) { this->m_Width = w; this->m_Height = h; HRESULT hr = DirectInput8Create( handleInstance, DIRECTINPUT_VERSION, IID_IDirectInput8, (void**)&m_directInput, NULL)...
#include <iostream> using namespace std; int money[100]; int answer[10001]; int main(){ /*모든 answer 배열의 원소값을 매우 큰 값으로 초기화*/ for(int i = 0; i < 10001; i++){ answer[i] = 10001; } int n, m, x; cin >> n >> m; /*단위 화폐의 최소한의 지불 화폐 수는 1*/ for(int a = 0; a < n; a++){ cin >> x; ...
include "MORClass.h"
#include "LinkedList.h" // default constructor (creates empty list) LinkedList::LinkedList() { head = NULL; tail = NULL; length = 0; } // constructor creates list when given head node (can be head of another list) LinkedList::LinkedList(Node* h) { head = h; length = 0; Node* curr = head; Node* pre...
#pragma once #include <string> #include <vector> #include <opencv2/opencv.hpp> #include "regressor.h" using namespace std; using namespace cv; class FaceX { public: // Construct the object and load model from file. // // filename: The file name of the model file. // // Throw runtime_error if the model file cann...
/*********************************************************************** created: 18/8/2011 author: Martin Preisler purpose: Implements the Element class *************************************************************************/ /*******************************************************************...
#ifndef LTUI_INPUT_H #define LTUI_INPUT_H #include <iostream> #include <optional> #include <sstream> #include <string> namespace ltui::input { template <class parsed_t> std::optional<parsed_t> read(const std::string &prompt) { parsed_t tmp; do { std::cin.clear(); std::cout << prompt; std::cin >> tmp; ...
// // Created by yulichao on 2020/11/9. // #include "head.h" #include <string> #include <iostream> #include <unistd.h> #include <list> using namespace std; class master { private: list<notifier *> pNotifierlist; public: master() = default; void doWork() { cout << "master work : " << endl; for (int i = 0; i ...
#pragma once // Forward Declarations class SimpleVertexShader; class SimplePixelShader; struct ID3D11ShaderResourceView; struct ID3D11SamplerState; class Material { public: // Parameterised Constructor for Material Material(SimpleVertexShader* t_vertex_shader, SimplePixelShader* t_pixel_shader, ID3D11ShaderResourc...
#ifndef WBACTIONUISHOWYESNODIALOG_H #define WBACTIONUISHOWYESNODIALOG_H #include "wbaction.h" #include "simplestring.h" class WBActionUIShowYesNoDialog : public WBAction { public: WBActionUIShowYesNoDialog(); virtual ~WBActionUIShowYesNoDialog(); DEFINE_WBACTION_FACTORY( UIShowYesNoDialog ); virtual void Initia...
#include "videofactory.h" VideoFactory::VideoFactory() { } QString VideoFactory::getNewId() { QString ajout="video@"; return ajout+NoteFactory::getNewId(); } Note* VideoFactory::buildNote(const QString& id, const QString& titre, const QString &path, const QString &desc){ Video* v=new Video(id, titre,path...
#pragma once #include <iostream> #include <fstream> #include <string> #include <iterator> #include <set> #include <regex> //REFERENCE: http://www.cplusplus.com/forum/general/182654/ namespace html_generator { //USAGE: USE replace_all TO REPLACE ALL HYPERLINK AND SRC in a html text by appending prefix to the o...
/* @brief processes.h * Intermediate tasks */ #ifndef PROCESSES_H #define PROCESSES_H #include <bits/stdc++.h> using namespace std; void mapeoAlphabet( string *alphabet ); void negativeNumbMod( int *modifyModule, int sizeAlphabet ); int verifyAffineKey( int sizeAlphabet, int a ); void generateKeyVigenere( string...
#include "Tiles.h" Tiles::Tiles(int w, int h) { //ctor tileWidth = w; tileHeight = h; } Tiles::~Tiles() { //dtor } void Tiles::Initialize() { } int Tiles::GetTileWidth() { return tileWidth; } int Tiles::GetTileHeight() { return tileHeight; }
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <cstring> #include <queue> #include <sstream> using namespace std; struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) { } }; cl...
#ifndef __CTILE_H_ #define __CTILE_H_ #include "CommonHeader.h" //타일 상태 (갈 수 있는 곳인지, 없는 곳인지) enum class ETileType : USHORT const { Non = 0, Block = 1 }; //주위 타일 방향 판단 쉽게 하려고 선언 enum class EDirection : unsigned char const { NW = 0, N = 1, NE = 2, E = 3, SE = 4, S = 5, SW = 6, W = 7 }; /*...
/*Ще не остаточна версія Ітема*/ #include "graphnode.h" #include <QPainter> #include <QDebug> GraphNode::GraphNode(int id) : GrawItem(id) { } QRectF GraphNode::boundingRect() const { if (_ModeView==0) return QRectF(-4, -4, 8, 8); } void GraphNode::paint(QPainter *painter, const QStyleOptionGraphicsItem ...
#include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #include <sys/types.h> #include <time.h> #include <bits/stdc++.h> #include <dirent.h> #include <netinet/tcp.h> #include "base/server.h" using std::co...
#pragma once #include "Config.h" #include <string> #include <iostream> #include <map> #include <list> #include <vector> #include <sstream> #include <fstream> #include <memory> #include <SOIL.h> #define GLEW_STATIC #include <GL/glew.h> #include <GLFW/glfw3.h> #include <glm/glm.hpp> #include <glm/gtc/type_ptr.hpp> ...
// // Created by dn on 12/31/17. // #include <iostream> #include "game_logic.h" Deck deck; void Match() { std::string match_result {"Tourament Complete\nYou finished this tourament with "}; // Deck deck; deck.shuffleDeck(); int mount_money = 5000; while (mount_money > 0) { mount_money += rou...
#include<bits/stdc++.h> using namespace std; int n; vector<string>v; void solve(string s,int pos,string ans) { if(pos==n) { v.push_back(ans);return; } solve(s,pos+1,ans+'+'+s[pos]); solve(s,pos+1,ans+s[pos]); } int main() { string s; cin>>s; n=s.size(); string x=""; x+=...
#pragma once #include <SFML/Graphics.hpp> #include <random> #include <ctime> #include <iostream> #include "Snake.h" #include "Level.h" #define LOOP(n)for(size_t i = 0;i<n;i++) #define LOOPX(n)for(size_t x = 0;x<n;x++) #define LOOPY(n)for(size_t y = 0;y<n;y++) #define MAP_OFFSET_X 0 #define MAP_OFFSET_Y 0 #define MAP_SI...
#include <iostream> using namespace std; struct Rectangle { int length; //4 bytes int breadth; // 4 bytes }; //Rectangle object will take 4+4= 8 bytes of memory int main() { struct Rectangle rec = {20,15}; // rec.length = 20; // rec.breadth = 15; cout<< rec.length<<endl; cout<< rec.breadth; return 0; }
/** * Binary serialization basic sinks */ #ifndef FISHY_SERIALIZER_BASESINKS_H #define FISHY_SERIALIZER_BASESINKS_H #include <cstring> namespace core { namespace base { /** * Sink that is usable to just size a given serialization. */ class FakeSink : public iBinarySerializerSink { public: FakeSink() : m_size...
#include<cstdio> #include<iostream> #include<stack> using namespace std; int main() { int n; char s1[20],s2[20]; while(~scanf("%d %s %s",&n,s1,s2)) { stack <char> s; int flag[100]={0}; int j=0,k=0; for(int i=0; i < n; i++) { s.push(s1[i]); ...
/* * File: Console.h * Author: gmena * * Created on 06 de septiembre de 2014, 09:00 AM */ #include <string> #include <iostream> #include "Util.h" using namespace std; #ifndef CONSOLE_H #define CONSOLE_H class Console { public: static void success(string log); static void error(string log); stati...
// -*- C++ -*- // // Copyright (C) 1998, 1999, 2000, 2002 Los Alamos National Laboratory, // Copyright (C) 1998, 1999, 2000, 2002 CodeSourcery, LLC // // This file is part of FreePOOMA. // // FreePOOMA is free software; you can redistribute it and/or modify it // under the terms of the Expat license. // // This progr...
//my solution //70+ ms //I cannot understand the requirements as a foreigner even with Google!! class Solution { public: bool isAnagram(string s, string t) { if(s.size()!=t.size()) return false; unordered_map<char,int> mymap; for(int i=0;i<s.size();i++){ mymap[s[i]] = 0; ...
#include <iostream> #include "LangLexer.hpp" #include "LangParser.hpp" #include "LangWalker.hpp" int main() { ANTLR_USING_NAMESPACE(std) ANTLR_USING_NAMESPACE(antlr) try { LangLexer lexer(cin); LangParser parser(lexer); parser.block(); // antlr.CommonAST a = (antlr.CommonAST)parser.getAST(); RefAST a = par...
#include<bits/stdc++.h> #define M 1000000007 using namespace std; long solve(int n,int k,int x) { long onecount = 1; long nononecount = 0; for(int i=1;i<n;i++) { long temp = onecount; onecount = ((nononecount)*(k-1))%M; nononecount = (temp + ((nononecount)*(k-2))%M)%M; } if(x == 1) { return oneco...
#include "simulation.h" #include "point.h" #include "vehicule.h" #include "vehiculecontroller.h" #include <QQmlApplicationEngine> #include <QQmlContext> #include <QGeoCoordinate> simulation::simulation() { } void simulation::remplir_vehicules(Point itineraires[100][24]) { Vehicule voiture; Point ...
/* * Copyright (C) 2007-2015 Frank Mertens. * * Use of this source is governed by a BSD-style license that can be * found in the LICENSE file. * */ #ifdef __linux #include <sys/types.h> #include <sys/socket.h> // socket, sendmsg, recvmsg #include <linux/netlink.h> #include <linux/rtnetlink.h> #include <sys/ioctl...
#include "device.h" #ifndef FONT_H #define FONT_H class Font { const uint8_t * font; uint8_t width; uint8_t height; uint8_t shift; public: Font (const uint8_t *f); void setWidth (uint8_t); void setHeight (uint8_t); void setShift (uint8_t); uint8_t & getWidth (); uint8_t & getHeight (); uint8_t & getShift...
// // BankAccount_Graphic_Panel.cpp // BankAccount // // Created by ace on 2016. 6. 18.. // Copyright © 2016년 origin. All rights reserved. // #include "BankAccount_Graphic_Panel.hpp"
/* Rishabh Arora IIIT-Hyderabad */ #include <bits/stdc++.h> using namespace std; typedef pair<int,int> II; typedef vector<int> VI; typedef vector<II> VII; typedef long long int LL; typedef unsigned long long int ULL; #define rep(i, a, b) for(i = a; i < b; i++) #define rev(i, a, b) for(i = a; i > b; i--) #define I...
#include <iostream> #define length 100 using namespace std; //prototipo funcao maior double* maior (double *vetor, int tamanho); int main () { double numero [length], n; double *pnumero; double *enderecomaior; cout<<"Digite a quantidade de numeros desejados:"<<endl; cin>>n; if (n<=length...
// // Created by 梁栋 on 2019-03-18. // #include <iostream> #include <vector> #include <algorithm> using namespace std; class Solution { public: void combinationSum2Base(const vector<int>& candidates, int start, int target, vector<int > record, vector<vector<int> >& res){ if(target == 0){ res.push...
// // Created by Changmin Kim on 2017. 5. 7.. // #ifndef OBJECT_TRACKER_OBJECTTRACKER_H #define OBJECT_TRACKER_OBJECTTRACKER_H #include <iostream> #include "opencv2/video/tracking.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" using namespace cv; using namespace std; #define TPL...
/* * Copyright (C) 2014-2016 Open Source Robotics Foundation * * 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...
#include <iostream> using namespace std; class Counter { private: unsigned int m_counter; public: Counter() : m_counter(0) {} unsigned int get() { return m_counter; } void operator++() { m_counter++; } void operator--() { m_counter--; } }; template<class T> class SharedPointer { private: T...
#include "Object.hpp" class Tile : public Object { private: std::string type; //grass top //grass fill //grass slope //grass steep slope //? block //flippy thing //moving platform };
#include <fstream> #include <gtest/gtest.h> #include <cereal/archives/portable_binary.hpp> #include "hs_test_utility/test_toolkit/test_serialization.hpp" #include "hs_sfm/sfm_utility/match_type.hpp" namespace { TEST(TestMatchType, SerializationTest) { typedef hs::sfm::ImagePair ImagePair; type...
#include<bits/stdc++.h> using namespace std; int main(){ int n,m,q; cin>>n>>m; vector<string>s(n); vector<string>t(m); for(int i=0; i<n;i++) cin>>s[i]; for(int i=0; i<m;i++) cin>>t[i]; cin>>q; long y; while(q--){ cin>>y; int x = y%n; int z = y%m; if(x==0){ cout<<s[n-1]; }else{ cout<<s[x-1]...
#include "BCD.h" BCD::BCDStore BCD::BCDStore::OpenStore( LPCWSTR lpStoreName /*= L""*/, BOOL *pStatus /*= NULL*/ ) { WMIServices services(L"root\\WMI"); if (!services.Valid()) { if (pStatus) *pStatus = FALSE; return BCDStore(); } WMIObject storeClass = services.GetObject(L"BCDStore"); if (!storeClass.Vali...
#include <bits/stdc++.h> using namespace std ; #define ll long long const int MAX_N = 2e5 + 10 ; int n ; ll sum , b[MAX_N] , c[MAX_N] ; bool check(int x) { for (int i = 0 ; i < x ; ++i) b[i] = 0 ; for (int i = x ; i <= n ; ++i) b[0] += c[i] ; for (int i = 0 ; i < x ; ++i) b[i] += c[i] ; ll ned = 1 ; for (int ...
#include <bits/stdc++.h> #define ll long long using namespace std; int main() { int n,m,a=1; while(true) { scanf("%d %d",&n,&m); if(!n && !m)break; int ara[n+2],x; for(int i=0;i<n;i++)scanf("%d",&ara[i]); for(int i=0;i<m;i++)scanf("%d",&x); printf("Case %d: ",...
//-------------------------------------------------------------- // Student Name: < Ivan Hernandez , Linhson Bui> // Date: <12/13/2018> // // Space Ship Spotted - CS134 Final Project // In this game you are exploring an unknown land // as an alien in a flying saucer // You want to find and abduct a...
#include <iostream> #include <fstream> int main(int argc, char **argv) { if (argc != 2) { return 1; } std::ifstream f(argv[1], std::ios::binary); f.seekg(0, std::ios::end); std::cout << f.tellg(); return 0; }
//@@author A0112218W #include "Command_Edit.h" EditCommand::EditCommand(CommandTokens::SecondaryCommandType type2, size_t index) : Command(CommandTokens::PrimaryCommandType::Edit) { _type2 = type2; _index = index; } bool EditCommand::canUndo() { return true; } EditNameCommand::EditNameCommand(size_t index, std::...
// // Created by nickolay on 09.06.2020. // #include <opencv2/imgcodecs.hpp> //#include <opencv2/imgcodecs/imgcodecs_c.h> #include <iostream> #include <opencv2/imgproc.hpp> #include "DroneImage.h" #include "opencv2/highgui.hpp" DroneImage::DroneImage() { data = cv::imread("../../testim.jpg", cv::IMREAD_COLOR);//...
#include<SerialFlash.h> #define FLASH_PIN (0) void setup() { //open serial and wait for it to complete Serial.begin(9600); while(!Serial) { delay(100); } //try and access the chip bool serialOpen = SerialFlash.begin(FLASH_PIN); if(serialOpen) { //erase the chip Serial.println("Erasing th...
#include "MontonCartas.h" using namespace std; MontonCartas::MontonCartas() { p = 0; deleted = 0; } MontonCartas::MontonCartas(int todas) { char pal [] = {'O','C','B','E'}; deleted = 0; Carta *aux; bool primeraCarta = true; for(int i=0; i<4; i++) { char a = pal[3-i]; ...
// Zach_Hunter_HW4.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <iostream> #include <fstream> #include <cmath> #include <iomanip> #include <string> using namespace std; int main() { double deposit = 0.0; double intrate = 0.0; double balance = 0.0; int months = 0; in...
/*************************************************************************** Copyright (c) 2020 Philip Fortier 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 2 of the License, or...
/** * * @file main.cpp * @brief Test main function * @author Naoki Takahashi * **/ #include <exception> #include <iostream> #include <string> #include <bitset> #include <chrono> #include <thread> #include <boost/asio.hpp> #include "Constant.hpp" #include "Converter/Endian.hpp" #include "CommandLineArg...
#pragma once #include <experimental/coroutine> #include <variant> #include <optional> #include <system_error> namespace ncoro { namespace stde = std::experimental; namespace details { template<typename T, typename E, typename ExceptionHandler> class result { public: ...
/////////////////////////////////////////////////////////////////// //Copyright 2019-2020 Perekupenko Stanislav. All Rights Reserved.// //@Author Perekupenko Stanislav (stanislavperekupenko@gmail.com) // /////////////////////////////////////////////////////////////////// #pragma once #include "CoreMinimal.h" #include ...
/* * SKETCH: * DWIO.ino * * (c) 2016, Michael Gries * Creation: 2016-06-28 (based on SimpleTestDweetIO.ino) * Modified: 2016-06-28 (function DweetIOmessaging added) * Modified: 2016-07-04 (ESP.getFreeHeap() added to Dweet) * * PREREQUISITES: * uses predefined local WiFi network * * LINKS: * s...
#include "dweetESP8266.h" #include <ArduinoJson.h> /** * Constructor. */ dweet::dweet(){ // _thing_name = thing_name; maxValues = 5; currentValue = 0; val = (Value *)malloc(maxValues*sizeof(Value)); } /** * This function is to get value from the dweet.io API * @arg key the key where y...
/** * \file NumberCrush.cxx * \author Brice Maussang, Gaëtan Perrot, Peio Rigaux, Jérémy Topalian * \date 16 Decembre 2014 * \brief Jeu NumberCrush * \version 1.0 */ #include <iostream> #include <vector> #include <string> #include <cctype> #include <iomanip> #include <sstream> #i...
/*************************************************************************** Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. 2010-2020 DADI ORISTAR TECHNOLOGY DEVELOPMENT(BEIJING)CO.,LTD FileName: HTTPRequest.h Description: A object to receive, parse and respond to client u...
#ifndef CPP_LINQ_TEST_UTILS_H #define CPP_LINQ_TEST_UTILS_H #include "CppLinq.h" template<typename R, typename T, unsigned N, typename F> void IsEqualArray(R dst, T(&ans)[N], F func) { for (size_t i = 0; i < N; ++i) { EXPECT_EQ(func(ans[i]), func(dst.NextObject())); } EXPECT_THROW(dst.NextObject(), CppLinq::En...
#include <omp.h> #include <assert.h> #include <string.h> #include "matrix.h" #include "memory.h" void fun3d::Matrix::ilu_YousefSaad() { memset(iw, 0, nrows * sizeof(unsigned int)); for(unsigned int i = 0; i < nrows; i++) { const unsigned int j0 = A->i[i]; const unsigned int j1 = A->i[i+1]; for(unsi...
// // This program 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 Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it wil...