text stringlengths 8 6.88M |
|---|
/**
* \copyright
* (c) 2012 - 2015 E.S.R. Labs GmbH (http://www.esrlabs.com)
* All rights reserved.
*/
#include "gps/AcPusher.h"
#include "android/caim/base/ICaimTransceiver.h"
#include "util/endian.h"
namespace gps
{
void GpsAcPusher::pushGPSCoordinates(sint32 latMs, sint32 longMs)
{
uint8 newPosition[sizeof(f... |
#include "stdafx.h"
#include "NIC.h"
NIC::~NIC()
{
if (pAdapterInfo)
free(pAdapterInfo);
}
int NIC::initNIC()
{
/* Declare and initialize variables */
pAdapter = NULL;
DWORD dwRetVal = 0;
ULONG ulOutBufLen = sizeof(IP_ADAPTER_INFO);
pAdapterInfo = (IP_ADAPTER_INFO *)malloc(sizeof(IP_ADAPTER_INFO));
if (pAda... |
#include "FourierPrinterSystem.h"
#include "EverydayTools/Array/ArrayViewVector.h"
#include "EverydayTools/Exception/CheckedCast.h"
#include "Keng/Core/IApplication.h"
#include "Keng/Core/SystemEvent.h"
#include "Keng/GPU/DeviceBufferMapper.h"
#include "Keng/GPU/ScopedAnnotation.h"
#include "Keng/GPU/RenderTarget/IWin... |
// Created on: 1992-06-04
// Created by: Jacques GOUSSARD
// Copyright (c) 1992-1999 Matra Datavision
// Copyright (c) 1999-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the G... |
#include "NPCManagerBTDecisionMakingAdministrator.h"
using namespace BehaviourTree;
NPCManagerBTDecisionMakingAdministrator::NPCManagerBTDecisionMakingAdministrator() :
m_behaviorTreeRoot{ BehaviourTree::BlocFabric::initiateRootAsCompositeBloc<BehaviourTree::BlocTernarySelector>("DecisionMakingNpcManagerRoot")... |
/*====================================================================
Copyright(c) 2018 Adam Rankin
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 limitati... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2000-2011 Opera Software ASA. All rights reserved.
*
* This file is part of the Opera web browser.
* It may not be distributed under any circumstances.
*
* Yngve Pettersen
*/
#include "core/pch.h"
#if defined(_NATIV... |
#include <iostream>
using namespace std;
int main() {
int N = 1,count=0, loc1 = 90000000,loc2 = 90000000,loc3 = 0, time = 0,now=0,range= 8000000;
while (N != 0){
cin >> N;
if (N != 0){
loc3 = N;
if (loc2 > loc3 && loc2 > loc1){
if (now > 0 && (time-now)<range){
... |
1 #include <iostream>
2 #include <sys/socket.h>
3 #include <netinet/in.h>
4 #include <arpa/inet.h>
5 #include <stdlib.h>
6 #include <string.h>
7 #include <poll.h>
8 #include <unistd.h>
9 using namespace std;
10 typedef struct pollfd pollfd;
11
12 void Init(pollfd* fd_list, int size)
13 {
14 f... |
#include "common.h"
#include <sys/shm.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <string.h>
#include <iostream>
int main(){
//定义共享内存结构体
struct ShmEntry *entry;
//1、申请共享内容,参数为key,size和shmfig[IPC_CREAT|(IPC_CREAT|IPC_EXCL)],返回一个共享内存的id
int shmid = shmget((key_t)1111,sizeof(struct Shm... |
#include <bits/stdc++.h>
using namespace std;
void permutation(string s,int lo,int hi)
{
if(lo==hi){cout<<s<<endl;return;}
for(int i=lo;i<=hi;i++)
{
swap(s[lo],s[i]);
permutation(s,lo+1,hi);
swap(s[lo],s[i]);
}
}
int main()
{
string s;
cin>>s;
permutation(s,0,s.len... |
#include "stdafx.h"
#include "JoinPage.h"
JoinPage::JoinPage(QWidget* parent)
: QWidget(parent)
{
ui.setupUi(this);
m_sqlOprtor = new SQLiteOperator(this);
connect(ui.ckb_spwd, &QCheckBox::stateChanged, this, &JoinPage::onCkbChecked);
connect(ui.edit_rpwd, &QLineEdit::returnPressed, this, &JoinPage::... |
#pragma once
#ifdef _WIN32
#include "mysql.h"
#else
#include "/usr/include/mysql/mysql.h"
#endif
#include <stdint.h>
#include <string>
#include <map>
class MySQLConnection
{
public:
MySQLConnection();
~MySQLConnection();
// connects to a MySQL-server
bool Connect(const std::string &sHostname, const uint16_t &wPo... |
#include"conio.h"
#include"stdio.h"
void main(void)
{
int sum=0, n;
clrscr();
scanf("%d",&n);
sum=n*(n+1)/2;
printf("\n%d",sum);
getch();
} |
#include <stdio.h>
#include <stdlib.h>
struct Tree {
int len; // Нийт багтаамж
int size; // Одоогийн хэмжээ
int *dat; // Өгөгдөл хадгалах хүснэгтийг заах хаяг
};
int error = 0;
const char error_msg[][50] = {
"",
"Mod duuren!",
};
void init(struct Tree *p, int n)
{
p->len = n;
p->size = 0;
p->dat = (int *) m... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*-
**
** Copyright (C) 1995-2005 Opera Software ASA. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
**
*/
#ifndef SVG_FILTER_H
#define SVG_FILTER_H
#if defined(SVG_SU... |
#include "_pch.h"
#include "VObjCatalogDataViewModel.h"
#include "MObjItem.h"
#include "MTypeNode.h"
using namespace wh;
using namespace view;
VObjCatalogDataViewModel::VObjCatalogDataViewModel()
:wxDataViewModel()
{
}
//---------------------------------------------------------------------------
VObjCatalogDataVie... |
#ifndef __WPP__QT__KEYBOARD_H__
#define __WPP__QT__KEYBOARD_H__
#include <QObject>
#include <QRect>
#include <QGuiApplication>
namespace wpp
{
namespace qt
{
class Keyboard: public QObject
{
Q_OBJECT
Q_PROPERTY(QRect keyboardRectangle READ getKeyboardRectangle NOTIFY keyboardRectangleChanged)
private:
QGuiApplic... |
class Solution {
public:
int minDistance(string word1, string word2) {
int dc = 1;//删除代价
int rc = 1;//修改代价
int ic = 1;//插入代价
int m = word1.size();
int n = word2.size();
vector<vector<int> > dp(m+1,vector<int> (n+1,0));
for(int i=1; i<=m; ++i){
dp[i... |
#pragma once
#include "CppCommons.hh"
#include "DBHelper.hh"
#include "SQLiteHelper.hh"
#include "Utils.hh"
#include <memory>
#include <unordered_map>
namespace HotaSim {
template<class T>
class DBLoader {
public:
DBLoader(const DBManager& _dbmgr, const std::shared_ptr<SQLiteWrapper::SQLiteHelper> _helper)
:... |
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
int main(int argc, char** argv)
{
string str1= argv[1];
string str2= argv[2];
string compstr;
int temp=0, i=0;
if(str1.length()>str2.length())
{
cout<<0;
}
else if(str1.length()==str2.length())
{
... |
#ifndef __QT_APP_BASE__READ_ADDRESS_BOOK_PERMISSION_DENIED_EXCEPTION_H__
#define __QT_APP_BASE__READ_ADDRESS_BOOK_PERMISSION_DENIED_EXCEPTION_H__
#include "PermissionDeniedException.h"
namespace wpp
{
namespace qt
{
class ReadAddressBookPermissionDeniedException : public PermissionDeniedException
{
public:
void rai... |
#ifndef pid_h
#define pid_h
#include "plastics.h"
#include "ppac.h"
#include "ic.h"
#include "parameters.h"
#include "ribf123_rawvar.h"
enum class focal_planes_t {achromatic_dispersive, dispersive_achromatic, achromatic_dispersive_achromatic};
class PID{
public:
double beta;
double aoq;
double delta;... |
#include "House.h"
void House::Initialize()
{
//LoadFromFile("data/models/3DS/House/house.obj", true);
objectType = ObjectType::House;
//Model3D::Initialize();
//Model3D::computeVertexData();
model->Initialize();
model->computeVertexData();
model->SetBoundingBox(model->CalculateBoundingBox(model->AllVertexDa... |
/*
ID: stevenh6
TASK: butter
LANG: C++
*/
#include <bits/stdc++.h>
#include <fstream>
#include <iostream>
#include <string>
#include <climits>
#include <algorithm>
#include <map>
using namespace std;
ofstream fout("butter.out");
ifstream fin("butter.in");
int N, P, C;
int cows[501];
int pastures[801][801];
int nei... |
/* Triangle intersect algorithm taken from http://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm*/
#include "Object.h"
void Object::setMaterial(Material * mat){
m = mat;
}
Triangle::Triangle(Point v1,Point v2, Point v3, Point no){
p1 = v1;
p2 = v2;
p3 = v3;
n =... |
#include "core/pch.h"
#include "modules/img/decoderfactorywebp.h"
#include "modules/img/src/imagedecoderwebp.h"
#include "modules/webp/webp.h"
#ifdef WEBP_SUPPORT
ImageDecoder* DecoderFactoryWebP::CreateImageDecoder(ImageDecoderListener* listener)
{
ImageDecoderWebP* webp_decoder = OP_NEW(ImageDecoderWebP, ());
... |
#include "Map.h"
Map::Map(const std::string& fileName)
: width(0), height(0), startX(0), startY(0), offsetX(0), offsetY(0) {
std::ifstream fs(fileName);
fs >> width >> height;
map = new int*[height];
for (int i = 0; i < height; i++) {
map[i] = new int[width];
for (int j = 0; j < width; j++) {
ma... |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
string s;
#define abs(a) ((a) < 0 ? -(a) : (a))
int HP = 0;
void calcHp(int It, int Rpos, int Mzan, int Hpoint){
if (It == s.size()) {
//printf("point:%d, Rpos:%d\n", Hpoint,Rpos);
if (HP <= Hpoint){
HP = Hpoin... |
#include <iostream>
#include <boost/format.hpp>
#include "DEdvs/config.h"
#include "DEdvs/dedvs.h"
#include "DEdvs/dedvs_impl.h"
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
#include "DEdvs/opencv_iop.h"
namespace po = boost::program_options;
namespac... |
#ifndef MATERIAL_H
#define MATERIAL_H
#include <array>
#include <glm/glm.hpp>
#include <Texture.h>
#include <Buffers/MaterialBuffer.h>
class CMaterial final
{
public:
void setDiffuseTexture(CTexture *texture);
void setNormalTexture(CTexture *texture);
void setDiffuseColor(const glm::vec3 &color) const;
... |
#include "maingame.h"
#include <windows.h>
void TestDraw()
{
system("cls");
cout << "----------------------" << endl;
cout << "| |" << endl;
cout << "| This mode is |" << endl;
cout << "| not yet |" << endl;
cout << "| implemented! |" << endl;
cout << "| ... |
#include "rdtsc_benchmark.h"
#include "ut.hpp"
#include <random>
#include <algorithm>
#include <math.h>
#include <functional>
#include <vector>
#include "particle.h"
#include "linalg.h"
#include "trigonometry.h"
#include "fastrand.h"
#include "compute_jacobians.h"
#include "get_observations.h"
#include <immintrin.h>... |
//
// Created by user24 on 2019/12/17.
//
#ifndef LAB_DS_LAB4_COMPAT_HH_
#define LAB_DS_LAB4_COMPAT_HH_
#include "Graph.cc"
namespace compat {
using namespace lab4;
using status = int;
const status OK = 1;
template<typename T>
inline status InitGraph(Graph<T> *&graph) {
graph = new Graph<T>();
return OK;
}
tem... |
// KC Text Adventure Framework - (c) Rachel J. Morris, 2012 - 2013. zlib license. Moosader.com
#ifndef _NOTEBOOK
#define _NOTEBOOK
#include <string>
#include <vector>
#include "../LuaWrappers/NotebookWrapper.h"
class Notebook
{
public:
void Init(lua_State* state);
void DisplayNotebookLocations();
vo... |
/*
* 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.
*/
#ifndef MVFST_USE_LIBEV
#include <quic/common/QuicEventBase.h>
namespace quic {
void QuicEventBase::setBackingEventBase(QuicBa... |
// Question => Check for Anagram
#include<iostream>
#include<algorithm>
using namespace std;
bool areAnagram(string str1, string str2){
int n1 = str1.length();
int n2 = str2.length();
if(n1 != n2){
return false;
}
sort(str1.begin(), str1.end());
sort(str2.begin(), str2.end());
f... |
#include "stdafx.h"
#include "manipulateVoxel.h"
#include "neighbor.h"
#include "detailSwapManager.h"
manipulateVoxel::manipulateVoxel()
{
}
manipulateVoxel::~manipulateVoxel()
{
for (int i = 0; i < meshBox.size(); i++)
{
delete meshBox[i];
}
}
void manipulateVoxel::loadFromFile(){
std::vector<arrayInt> mes... |
#ifndef PROJECTPART1_DATAREADERSERVER_H
#define PROJECTPART1_DATAREADERSERVER_H
#include <string>
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <netdb.h>
#include <unistd.h>
#include <netinet/in.h>
#include <string.h>
#include <sys/socket.h>
#include <unordered_map>
#include <vector>
#include "Sy... |
#include "basis.hpp"
namespace space {
bool HierarchicalBasisFn::Refine() {
if (is_full()) return false;
for (auto &elem : vertex_->patch) {
elem->Refine();
assert(elem->children().size() == 2);
elem->children()[0]->newest_vertex()->RefineHierarchicalBasisFn();
}
assert(is_full());
return true;
... |
#pragma once
#ifndef VANZATORANIMALE_H
#define VANZATORANIMALE_H
#include "Vanzator.h"
class VanzatorAnimale : public Vanzator
{
friend class VanzatorClienti;
public:
void cautare(animal* an);
void inserare(animal* an);
virtual ~VanzatorAnimale();
static VanzatorAnim... |
#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... |
/*
* (c) copyright 1988 by the Vrije Universiteit, Amsterdam, The Netherlands.
* See the copyright notice in the ACK home directory, in the file "Copyright".
*
* Author: Ceriel J.H. Jacobs
*/
/* Id: atan2.c,v 1.3 1994/06/24 11:43:15 ceriel Exp */
#include "core/pch.h"
#ifdef ACK_MATH_LIBRARY
#include "modules/s... |
// Copyright (c) 1991-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
... |
/*
* Copyright (c) 2020 sayandipde
* Eindhoven University of Technology
* Eindhoven, The Netherlands
*
* Name : image_signal_processing.cpp
*
* Authors : Sayandip De (sayandip.de@tue.nl)
* Sajid Mohamed (s.mohamed@tue.nl)
*
* Date : March 26, 2020
*
* Function ... |
// Copyright (c) 2020 The Orbit Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "TextRenderer.h"
#include <freetype-gl/shader.h>
#include <freetype-gl/vertex-buffer.h>
#include "App.h"
#include "GlCanvas.h"
#include "GlUti... |
#pragma once
#include "token.h"
#include<vector>
#include<fstream>
#include<queue>
#include<iomanip>
struct treeNode {
treeNode(token& t) :t(t)
{}
treeNode(const treeNode& tn)
{ this->t = tn.t; this->width = tn.width; this->child_ptrs = tn.child_ptrs; }
treeNode()
{
t = token(-1, "none", "_"); child_ptrs = v... |
#include "KeyboardHandler.h"
KeyboardHandler::KeyboardHandler()
{
}
KeyboardHandler::~KeyboardHandler()
{
}
void KeyboardHandler::handle(SDL_Event ev)
{
keyStates[ev.key.keysym.sym] = ev.key.state;
}
bool KeyboardHandler::is_pressed(int keyCode)
{
std::map<int, bool>::iterator a = keyStates... |
#include "elfbase.h"
using namespace elf;
ElfBase::ElfBase() : t(nullptr), b(nullptr)
{
}
ElfBase::~ElfBase()
{
}
bool ElfBase::read_header_from_file(std::string file_name)
{
return false;
}
bool ElfBase::print_header_info()
{
if (!t || !b)
return false;
char magic_marker[sizeof(uint32_t)+1];
memset(magic... |
#include "game/PingStatus.hpp"
PingStatus::PingStatus(){
gPingTextTexture = new LTexture();
reset();
}
PingStatus::~PingStatus(){
}
void PingStatus::reset(){
ping = 0;
}
void PingStatus::render(){
pingText.str( "" );
pingText <<"Ping: "<< ping;
gPingTextTexture->loadFromRenderedText( pingText.str().c... |
#include <iostream>
#include <fstream>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
struct toado{
int h,c;
};
toado huong[8] { -1,0
,-1,1
,0,1
,1,1
,1,0
,1,-1
,0,-1... |
/*
Copyright 2021 University of Manchester
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 applicable law or agreed to in writing, s... |
#include "USBCTRL.hpp"
#include <cstdio>
#include <cstring>
#include "lpc17xx_usb.h"
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL ((void *) 0)
#endif
// TSetupPacket USBCTRL::Setup;
// usbdesc_base ** USBCTRL::descriptors;
// usbdesc_device *USBCTRL::dev = (usbd... |
//
// Shotgun.cpp for shotgun in /home/deneub_s/cpp_indie_studio
//
// Made by Stanislas Deneubourg
// Login <deneub_s@epitech.net>
//
// Started on Thu Jun 1 08:05:48 2017 Stanislas Deneubourg
// Last update Sun Jun 18 19:54:42 2017 Stanislas Deneubourg
//
// TODO: ENLEVER LES PRINTS
#include <ctime>
#include <... |
/****************************************************************************
* *
* Author : lukasz.iwaszkiewicz@gmail.com *
* ~~~~~~~~ *
* Lice... |
//: C14:PrivateInheritance.cpp
// Kod zrodlowy pochodzacy z ksiazki
// "Thinking in C++. Edycja polska"
// (c) Bruce Eckel 2000
// Informacje o prawie autorskim znajduja sie w pliku Copyright.txt
class Pet {
public:
char eat() const { return 'a'; }
int speak() const { return 2; }
float sleep() const { re... |
#pragma once
#include "CoreMinimal.h"
#include "Widget/BaseSlot/ItemSlot/ItemSlot.h"
#include "Struct/ItemSlotInfo/ItemSlotInfo.h"
#include "Enum/PartsType.h"
#include "PlayerEquipSlot.generated.h"
UCLASS()
class ARPG_API UPlayerEquipSlot : public UItemSlot
{
GENERATED_BODY()
private :
UPROPERTY(meta = (BindWidge... |
// Sharna Hossain
// CSC111
// Lab 4 | circle.cpp
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
float radius, circumference, area;
float pi = 3.14159265359;
cout << "Please enter the radius: ";
cin >> radius;
circumference = 2 * pi * radius;
area = (radius * radius... |
#ifndef CMAP_H
#define CMAP_H
#include <iostream>
#include <string>
#include <algorithm>
#include <sstream>
#include <fstream>
#include "tinyxml.h"
#include "tinystr.h"
#include "gl_const.h"
class cMap
{
public:
int **Grid;
int height, width;
int *start_i, *start_j;
int *goal_i, *goa... |
#include"stdio.h"
#include"conio.h"
void main(void)
{
clrscr();
printf("Hello Ashok");
getch();
} |
#pragma once
// internal
#include "common.hpp"
// stlib
#include <vector>
#include <random>
#define SDL_MAIN_HANDLED
#include <SDL.h>
#include <SDL_mixer.h>
#include "render_system.hpp"
#include "physics_system.hpp"
// Container for all our entities and game logic. Individual rendering / update is
... |
#include "BinarySearchTree.h"
template<typename T>
BinarySearchTree<T>::BinarySearchTree(){
Root = new TreeNode<T>();
}
template<>
BinarySearchTree<string>::BinarySearchTree() {
Root = new TreeNode<string>();
}
template<typename T>
BinarySearchTree<T>::BinarySearchTree(T d) {
Root = new TreeNode<T>(d);
}
templat... |
class WoodenFence_ghost_DZ: DZE_Ghost_Previews
{
scope = 2;
model = "z\addons\dayz_buildings\models\fence_wood_ghost.p3d";
displayName = $STR_BLD_name_WoodenFence_ghost;
};
class WoodenFence_1_foundation_DZ: ModularItems
{
scope = 2;
model = "z\addons\dayz_buildings\models\fence1_ground.p3d";
displayName = $STR_... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style:"stroustrup" -*-
**
** Copyright (C) 2011 Opera Software AS. All rights reserved.
**
** This file is part of the Opera web browser. It may not be distributed
** under any circumstances.
*/
/** @brief Implementation of Opera's debug ... |
#include "components/ai/sequenceai.hpp"
namespace ai {
AI::timer_t SequenceAI::start(AI* ai) {
return update(ai);
}
AI::timer_t SequenceAI::update(AI* ai) {
if (i == subs.size())
return ai->pop_script();
else
return ai->push_script(subs[i++]);
}
} |
// https://codeforces.com/problemset/problem/445/B
#include <iostream>
#include <vector>
using namespace std;
bool visited[51];
vector<int> edges[51];
long long ans;
void dfs(int src)
{
visited[src] = true;
for (auto dst : edges[src])
{
if (!visited[dst]) {
dfs(dst);
ans *= ... |
#include "rdtsc_benchmark.h"
#include "ut.hpp"
#include <iostream>
#include <random>
#include <algorithm>
#include <math.h>
#include <functional>
#include <vector>
#include <immintrin.h>
#include "compute_weight_and_feature_update.h"
#include "linalg.h"
using namespace boost::ut; // provides `expect`, `""_test`, et... |
#include <utility>
#include <Rendering/Font.h>
#include <GameManager.h>
#include <Parsers/Gm1File.h>
using namespace Sourcehold;
using namespace Rendering;
using namespace Game;
static std::shared_ptr<Gm1File> _fonts[3];
static std::pair<uint8_t, uint8_t> _table_width_height[3] = {
{ 15, 18 }, /* Slanted */
... |
/*
Exp no 4
Program to implement chat using message queue
S1330-R-jayadeep
23-07-2016
*/
#include<iostream>
#include<sys/msg.h>
#include<sys/ipc.h>
#include<unistd.h>
struct msgBuff{
long mtype;
char mBuff[20];
};
using namespace std;
int main(){
int msgId = msgget(1999,IPC_CREAT|0666);
if(... |
#ifndef CCOMPRAMODEL_H
#define CCOMPRAMODEL_H
#include <QAbstractListModel>
#include <QtSql>
#include "ccompraitem.h"
class CCompraModel : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int tamanho READ getTamanho NOTIFY tamanhoChanged)
public:
explicit CCompraModel(QObject *parent = 0);
... |
#pragma once
#include "ofMain.h"
class NoiseTexture
{
public:
NoiseTexture();
~NoiseTexture();
void render();
void draw( int x, int y );
void setSpeed( float _s );
void setZoom( float _z );
ofFbo getBuffer();
float w1, w2, w3, w4;
private:
ofShader noise;
ofFbo noiseFbo;
floa... |
#ifndef __MODELEXECACT_H
#define __MODELEXECACT_H
#include "ModelActBrowser.h"
#include "ModelBrowser.h"
#include "ModelPropPg.h"
namespace wh {
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
//--------------... |
/*Unit tests for GenericArray.*/
#include "cc/shared/generic_array.h"
#include "cc/shared/common.h"
#include "gtest/gtest.h"
namespace cc_shared {
namespace {
int int_comparer(const void* param1, const void* param2) {
const int* p1 = (const int*) param1;
const int* p2 = (const int*) param2;
return ((*p1) - (*... |
#ifndef DRAW_COLLECTION_HPP
#define DRAW_COLLECTION_HPP
#include <GL/glew.h>
#ifdef __linux__
#include <GLFW/glfw3.h>
#elif __MINGW32__
#include <GLFW/glfw3.h>
#elif __WIN32
#include <GL/glfw3.h>
#endif
#include <glm/glm.hpp>
#include <glm/ext.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <boost/filesystem.hp... |
/*
* Created by Peng Qixiang on 2018/4/23.
*/
/*
* 一只青蛙一次可以跳上1级台阶,也可以跳上2级。
* 求该青蛙跳上一个n级的台阶总共有多少种跳法。
*
*/
# include <iostream>
# include <vector>
using namespace std;
int jumpFloor(int number) {
if(number < 0){
return -1;
}
if(number <= 2){
return number;
}
int n1 = 1;
... |
/*
* Copyright (c) 2015-2020 Morwenn
* SPDX-License-Identifier: MIT
*/
#ifndef CPPSORT_SORT_H_
#define CPPSORT_SORT_H_
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <type_traits>
#include <utility>
#include <cpp-sort/sor... |
/* -*- Mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
**
** Copyright (C) 2010 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 "modules/libcrypto/include/Crypto... |
// Created on: 1993-09-07
// Created by: Bruno DUMORTIER
// 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 GN... |
#ifndef BIRD_H
#define BIRD_H
#include <cmath>
#include <cstdio>
class Bird{
public:
Bird() { next = NULL; tot_neighbor = 0; }
double rr(Bird *node);
double rr(Bird *node, double a, double b);
void interact(Bird *bird);
void interact(Bird *bird, double a, double b);
void move(double omega_ext);
void move(double... |
#include "random.h"
#include <string>
#include <iostream>
#include "lorentz.h"
namespace Srandom{
int getEnvSeed(){
char *val = std::getenv("lseed");
int seed = (val == NULL) ? -1 : std::stoi(std::string(val));
std::cout << "Lido seed = " << seed << std::endl;
return seed;
}
std::mt19937 gen( (getEnvSe... |
#ifndef WORK_MORE_H_
#define WORK_MORE_H_
#include <stdlib.h>
#include <iostream>
#include "gui/main_gui.h"
int loadConfig();
#endif /* WORK_MORE_H_ */
|
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,k;
scanf("%d%d",&n,&k);
int t=240-k;
int i;
for(i=1;i<=n;i++){
if(i*5>t){
break;
}else{
t-=i*5;
}
}
printf("%d",i-1);
return 0;
}
|
#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 <numeric>
typed... |
// gcd(a, m) = 1 para existir solucao
// ax + my = 1, ou a*x = 1 (mod m)
ll inv(ll a, ll m) { // com gcd
ll x, y;
gcd(a, m, x, y);
return (((x % m) +m) %m);
}
ll inv(ll a, ll phim) { // com phi(m), se m for primo entao phi(m) = p-1
ll e = phim-1;
return fexp(a, e);
}
|
// Created on: 2000-07-03
// Created by: Andrey BETENEV
// Copyright (c) 2000-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 a... |
// Copyright (c) 2013 Nick Porcino, All rights reserved.
// License is MIT: http://opensource.org/licenses/MIT
#ifndef LAB_REALVAROBJ_H
#define LAB_REALVAROBJ_H
#include "LandruVM/VarObj.h"
namespace Landru
{
class RealVarObj : public Landru::VarObj
{
public:
RealVarObj(const char* name);
virtual ~RealVarObj... |
/* -*- 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
*/
#include "core/pch.h"
#if defined(_NATIVE... |
#include<iostream>
#include"Cvector.hpp"
using namespace std;
Cvector::Cvector(){x=0;y=0;z=0;}//constructeur par defaut
Cvector::Cvector(const double &a,const double & b,const double & c):
x(a),y(b),z(c){//onstructeur par reference
}
Cvector::Cvector(const Cvector & Cvec){//constructeur par copie
x=Cvec.x;
y=... |
#define Steyr_ACOG modelOptics = "\Ca\weapons_E\SCAR\ACOG_TA31_optic_4x.p3d";\
class OpticsModes\
{\
class ACOG\
{\
opticsID = 1;\
useModelOptics = true;\
opticsFlare = true;\
opticsDisablePeripherialVision = true;\
opticsZoomMin = 0.0623;\
opticsZoomMax = 0.0623;\
opticsZoomInit = 0.0623;\
distanceZo... |
#pragma once
#include "../Monster.h"
class RedHead :public Monster
{
public:
RedHead();
private:
AnimationClip m_anim[8];
}; |
#include <iostream>
#include <math.h>
#include <algorithm>
#include <deque>
#include"ProgressPie.h"
using namespace std;
int main(int argc, char **argv)
{
pie();
return 0;
}
|
#ifndef _LGB_SPLT
#define _LGB_SPLT
#include "LGB.h"
namespace LGBm {
template <typename T>
class LGBsplit : public LGB<T> {
public:
double perturbation;
LGBsplit() : LGB<T>{}, perturbation{0.001} {};
int run() {
size_t N = this->signal.size();
size_t M = this->nDimension * this-... |
#include <catch2/catch.hpp>
#include <replay/index_map.hpp>
namespace
{
struct sample_payload
{
std::uint8_t key=0;
double value=0.0;
};
bool operator==(sample_payload const& lhs, sample_payload const& rhs)
{
return std::tie(lhs.key, lhs.value) == std::tie(rhs.key, rhs.value);
}
struct destructor_counter... |
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.9.0 Jan 25 2021)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#pragma once
#include <wx/... |
#include<iostream>
using namespace std;
int main(){
int a[10];
int i = 0;
while(i<10)
a[i++] = i;
int * p;
p = &a[9];
while(i >0){
cout << *p << " ";
p--;
i--;
}
return 0;
} |
/*
* The MIT License (MIT)
*
* Copyright (c) 2014 Matt Olan, Prajjwal Bhandari.
*
* 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 ... |
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <string>
#include <cstring>
#include <queue>
#include <vector>
#include <set>
#include <deque>
#include <map>
#include <functional>
#inc... |
// 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.... |
#include "sets.h"
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <set>
#include <algorithm>
/*
1 Add an element to the set.
2 Delete an element from the set. (If the number is not present in the set, then do nothing).
3 If the number is present in the set, then print "Yes"... |
#include "stdafx.h"
#include "Contest.h"
#include "Station.h"
#include "ContestConfig.h"
#include "StringUtils.h"
#include "QsoTokenType.h"
#include "FreqToken.h"
#include "ModeToken.h"
#include "NameToken.h"
#include "DateToken.h"
#include "TimeToken.h"
#include "CallsignToken.h"
#include "RstToken.h"
#include "Seri... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.