text stringlengths 3.08k 12.5k |
|---|
#include <iostream>
#include <SDL.h>
//Screen dimension constants
const int SCREEN_WIDTH = 640;
const int SCREEN_HEIGHT = 480;
const int FPS = 24;
struct State {
int vx;
int vy;
};
struct Dimension {
SDL_Point min;
SDL_Point max;
};
bool operator<=(const SDL_Point & o, const Dimension & d) {
return (o.x ... |
#include "manual_flight.h"
ManualFlight::ManualFlight(ros::NodeHandle& n, bool test_flag):
nh_(n)
{
//ROS subscribers and publishers initialization
sub_px4_state_ = nh_.subscribe<mavros_msgs::State>("mavros/state", 10, &ManualFlight::stateCallback, this);
sub_keyboard_ = nh_.subscribe<keyboard::Key>("/keyboard/keyd... |
/** @file
*
* @defgroup example_module Example code for Chops Net IP library.
*
* @ingroup example_module
*
* @brief Example of TCP send/receive text string over local loop network
* connection. Text is returned in uppercase.
*
* @author <NAME>
*
* Copyright (c) 2019 <NAME>
* 2019-10-14
*
* D... |
/**
* Algoritmos em Grafos (MO412)
*
* @author: <NAME> <<EMAIL>>
* @author: <NAME> <<EMAIL>>
* @author: <NAME> <<EMAIL>>
*/
#include "fibonacciheap.h"
FibonacciHeap::FibonacciHeap() {
root = nullptr;
}
FibonacciHeap::FibonacciHeap(int n, int s) {
root = nullptr;
build(n, s);
}
FibonacciHeap::~Fibo... |
/***************************************************************************
file : simuconfig.cpp
created : Wed Nov 3 21:48:26 CET 2004
copyright : (C) 2004 by <NAME>�
email : <EMAIL>
version : $Id: simuconfig.cpp,v 1.4.2.1 2008/11/09 17:50:21 berni... |
#include <glad/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void frameBuffer_size_callback(GLFWwindow* window, int width, int height);
void processinput(GLFWwindow* window);
const char* vertexShaderSource = "#version 330 core \n"
"layout(location = 0) in vec3 aPos;\n"
"void main()\n"
"{\n"
" gl_Position = ve... |
/**
* @file terminal_handler.cpp
* @author <NAME>
* @version 0.1
* @date 2019-05-27
* @brief This file contains implementation of terminal command sending manager
*
* @attention
*
* <h2><center>© Copyright (c) 2019 University of West Bohemia in Pilsen
* All rights reserved.</center></h... |
// Copyright 2020 The Fuchsia 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 <lib/dma-buffer/buffer.h>
#include <lib/zx/vmar.h>
#include <fake-dma-buffer/fake-dma-buffer.h>
class ContiguousBufferImpl : public dma_buffer::... |
#include "stdafx.h"
#include "proc_window.h"
#include "application.h"
#include "utility.h"
using sima::ui::proc_window;
proc_window::proc_window(sima::ui::application& owner) : window(L"sima", L"sima processor", 200, 200, 400, 500, owner), code_editor(nullptr)
{
auto hinst = HINSTANCE(GetWindowLongPtrW(... |
#include "netclient.h"
#include <iostream>
#include <QDir>
#include <mainwindow.h>
#include <QMessageBox>
netclient::netclient()
{
socket = new QTcpSocket();
}
netclient::~netclient()
{
if(socket->isOpen())
socket->close();
}
void netclient::startClient() {
try
{
connect(this, &netc... |
#include "../river.h"
#include <string>
#include <algorithm>
#include <iostream>
#include <cstring>
using namespace std;
char** make_river_scene(string left, string boat)
{
char** scene = create_scene();
// static scene objects
add_to_scene(scene, 0, 0, "bank.txt");
add_to_scene(scene, 0, 53, "bank.txt");
... |
/*
Copyright (c) 2016 Scoud
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, distribute, sublicens... |
/*
* Copyright 2021 EPAM Systems, Inc
*
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership. 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 Li... |
#include "sdi12_sensor.h"
#include "app_config.h"
#include "sdi12_log.h"
/******************************************************************************
* Default constructor (private)
*****************************************************************************/
/***************************************************... |
//
// Test.cpp
// pv021-project
//
// Created by <NAME> on 17/12/15.
// Copyright © 2015 <NAME>. All rights reserved.
//
#include "Test.hpp"
#include <iostream>
#include <fstream>
#include <ctime>
int CLASSES = 10;
int EXAMPLES = 60000;
int EXAMPLES_TESTS = 10000;
int HEADER_LABELS = 8;
int HEADER_IMAGES = 16;
in... |
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#include <set>
#include <functional>
#include <algorithm>
#include <queue>
template <typename T>
struct reversion_wrapper { T& iterable; };
template <typename T>
auto begin (reversion_wrapper<T> w) { return std::rbegin(w.iterable); }
template <type... |
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
/******************... |
#include "common.h"
#include "Log.h"
///////////////////////////////////////////////////////////////////////////////
// CONSTANTS
///////////////////////////////////////////////////////////////////////////////
const int RETURN_ERROR = -1;
const int RETURN_SUCCESS = 0;
const float PI = 3.14159265f;
bool LIVELY;
//... |
#include"graph.h"
#include "tnode.h"
#include <unordered_map>
Graph::Graph(string fname) {
m_graph = new std::unordered_map<string, TNode*>;
m_logger = new EasyLogger(fname);
m_root = nullptr;
}
Graph::Graph(EasyLogger* m) {
m_graph = new std::unordered_map<string, TNode*>;
m_logger = m;
m_... |
/*===================== begin_copyright_notice ==================================
Copyright (c) 2021, Intel 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, i... |
#include "FlexibleAStar.h"
#include "altheap.h"
#include "DebugUtility.h"
#include "ExpansionPolicy.h"
#include "fpUtil.h"
#include "graph.h"
#include "Heuristic.h"
#include "mapAbstraction.h"
#include "path.h"
#include "ProblemInstance.h"
#include "reservationProvider.h"
#include "timer.h"
#include "unitSimulation.h"... |
#include <android/asset_manager.h>
#include <android/asset_manager_jni.h>
#include "OcrLite.h"
#include "OcrUtils.h"
OcrLite::OcrLite() {}
void OcrLite::init(JNIEnv *env, jobject assetManager, int numOfThread) {
AAssetManager *mgr = AAssetManager_fromJava(env, assetManager);
if (mgr == NULL) {
LOGE(" ... |
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <string.h>
#include <unistd.h>
#include <gnutls/gnutls.h>
#define SRP_PASSWD "<PASSWORD>"
#define SRP_PASSWD_... |
#include "HIPixelMedianVtxProducer.h"
#include "FWCore/Framework/interface/MakerMacros.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/Verte... |
#include "graph.h"
void Graph::add_edge(ll u, ll v) {
++m;
if(u == v) {
auto &eu = edges[u];
eu.push_back({u, ll(eu.size() + 1)});
eu.push_back({u, ll(eu.size() - 1)});
} else {
ll i1 = edges[u].size(), i2 = edges[v].size();
edges[u].push_back({v, i2});
edges[v].push_back({u, i1});
}
}
ostream &Graph:... |
/***
This code makes an Arduino Mega 2560 board act as a ROS Node.
For a simple diff drive robot it can publish the speed and positon
of left and right motor wheels, and subscribe to a control topic
to accept control commands (PID) from a computer / Raspberry Pi running ROS.
Author: <NAME>
References:
1. https://... |
#include<stdio.h>
#include"lift.h"
#include <stdlib.h>
#include <windows.h>
#include <conio.h>
void InputMaxTime();
void init(Elevator * E, int i);
void CheckGiveUp(Elevator E[]);
int MaxClientNum = 7; //最大乘客人数
int MaxRunTime; //最大运行时间
int NextClientInterTime; //下一个乘客进入系统的时间
int TotalClient=1; //当前总... |
// CopyLocationShl.cpp : Implementation of CCopyLocationShl
#include "stdafx.h"
#include <atlconv.h> // for ATL string conversion macros
#include "CopyLocation.h"
#include "CopyLocationShl.h"
/////////////////////////////////////////////////////////////////////////////
// CCopyLocationShl
CCopyLocationShl... |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0/
*
* or in the "license" f... |
#include <iostream>
#include <array>
#include <utility>
#include <tuple>
#include <algorithm>
constexpr std::size_t nodes_count = 10 * 10 * 100;
struct node {
enum struct gate : int { AND=1, OR, NONE };
bool value, changeable;
gate g;
};
std::ostream& operator << (std::ostream& oss, const node& v) {
... |
// Copyright <NAME>. All Rights Reserved.
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// Example heightfield grid animated with sine and cosine waves
#include "HeightFieldAnimatedActor.h"
#include "Providers/RuntimeMeshProviderStatic.h"
AHeightFieldAnimatedA... |
#include <ctime>
#include <string>
#include <CLI/CLI.hpp>
#include <ghc/fs_std.hpp> // filesystem
#include <igl/Timer.h>
#include <igl/edges.h>
#include <igl/readOBJ.h>
#include <nlohmann/json.hpp>
// clang-format off
#include <spdlog/spdlog.h>
#include <spdlog/fmt/chrono.h>
// clang-format on
#include <tbb/parallel_f... |
// Copyright 2013-2015 Stanford University
//
// 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 ... |
/*
-------------------------------------------------------------------------------
This file is part of OgreKit.
http://gamekit.googlecode.com/
Copyright (c) 2006-2010 <NAME>.
Contributor(s): none yet.
-------------------------------------------------------------------------------
This software is p... |
//=---------------------------------------------------------------------=
//
// $Id$ $Name$
//
// The contents of this file are subject to the AAF SDK Public Source
// License Agreement Version 2.0 (the "License"); You may not use this
// file except in compliance with the License. The License is available
// in AAFSD... |
#include "emoji_loader.h"
#include <giomm/file.h>
#include <glibmm/fileutils.h>
#include <glibmm/miscutils.h>
#include <json/json.h>
#include <libsoup/soup-uri.h>
#include <fstream>
#include <iostream>
emoji_loader::emoji_loader(const std::string& directory)
: session_(soup_session_new()),
directory_(directo... |
#include "stdhdr.h"
#include "dogfight.h"
#include "initData.h"
#include "simbase.h"
#include "campwp.h"
#include "camp2sim.h"
#include "loadout.h"
#include "entity.h"
#include "simveh.h"
#include "sms.h"
#include "SimDrive.h"
#include "mission.h"
#include "classtbl.h"
#include "otwdrive.h"
#include "MsgInc/SendDogfigh... |
#include "DigestCache.hpp"
#include "BinaryWriter.hpp"
#include "Stats.hpp"
#include <algorithm>
#include <time.h>
#include <stdio.h>
static uint64_t s_cutoff_time;
void DigestCacheInit(DigestCache *self, size_t heap_size, const char *filename)
{
ReadWriteLockInit(&self->m_Lock);
self->m_Initialized = true;... |
#include <iostream>
#include "noise.hpp"
#include <SDL2/SDL.h>
#include <future>
// OpenGL related headers
#include <GL/glew.h>
#include <SDL_opengl.h>
struct OpenGLState {
GLuint program;
};
OpenGLState init_opengl() {
glewExperimental = (GLboolean) true;
glewInit();
return {};
}
void draw_opengl(const Open... |
/*
* Copyright (c) 2020 Project CHIP Authors
* All rights reserved.
*
* 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
*
... |
/**
* @file : test_cartesian_product.hpp
* @author : <NAME>
* @date: Wed July 11 2013
*/
#include "OccupancyGrid/cartesian_product.hpp"
#include <boost/bind.hpp>
#include <cstdio>
#include <vector>
#include <iostream>
#include <gtest/gtest.h>
#include <boost/property_map/property_map.hpp>
#include <boost/unorder... |
#include "gmqcc.h"
/*
* Based on the flexible and economical utf8 decoder:
* http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
*
* This is slightly more economical, the fastest way to decode utf8 is
* with a lookup table as in:
*
* first 1-byte lookup
* if that fails, 2-byte lookup
* if that fails, 3-byte lookup
... |
#include <stdio.h>
#include "main.h"
#include "actor.h"
#include "sound.h"
Actor::Actor()
{
//printf("Actor::Actor()\n");
attackType=AT_FORCE;
fullHealth=100;
attackRegenerateTime=2000;
for(int i=0;i<6;i++) {
resistance[i]=0; // percent of how resistent they are to various attacks
}
blockType=AT_NONE;
b... |
/**
* step 1 : dataset assign
*/
#include "ini.h"
#include "dirtrav.h"
#include "filenode.h"
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <time.h>
#include <vector>
#include <string>
using namespace std;
int read_basedir(void * basedir, const char* section, const char... |
#include "headers/DCM.h"
DCMPlanner::DCMPlanner(double deltaZ, double stepTime, double doubleSupportTime, double dt, int stepCount, double alpha){
this->deltaZ_ = deltaZ;
this->tStep_ = stepTime;
this->tDS_ = doubleSupportTime;
if(alpha > 0.0 && alpha < 1.0)
this->alpha_ = alpha;
else
... |
// Program for testing the stand-alone OpenEphyra QA service
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <cstdlib>
#include <getopt.h>
#include <thrift/protocol/TBinaryProtocol.h>
#include <thrift/transport/TSocket.h>
#include <thrift/transp... |
#include "boxqp.h"
/*
Minimize 0.5*x'*Q*x + x'*c s.t. lower<=x<=upper
See Appendix in [Tassa 2014]
What's cool about this QP solver vs. generic ones:
If initial guess has same active set/clamped dimensions as optimum, it will be reached in one iteration!
inputs:
Q - positive definite ma... |
// PhysioParse.cpp : Program to parse Siemens Physiolog files files.
// The data is written into a tab seperated text file with a the name provided
// on the command line
//
// Note: This is larely taken from the idea discussion boards. Thus, I belive
// the fist version is from <NAME>.
#include <iostream>
#... |
#include "strmap.h"
#include <vector>
#include <string>
#include <cstdint>
#ifndef HAVE_OLD_CPP
# include <unordered_map>
#else
# include <tr1/unordered_map>
namespace std { using std::tr1::unordered_map; }
#endif
using namespace std;
#undef HAVE_64_BITS
#if INTPTR_MAX == INT32_MAX
# define HAVE_64_BITS 0
#elif IN... |
// This example shows how to organize a typical game frame into jobs
#include <jobSystem/jobSystem.h>
#include <atomic>
#include <cassert>
#include <chrono>
#include <cstdarg>
#include <iostream>
#include <mutex>
#include <thread>
using namespace Typhoon;
namespace {
std::mutex coutMutex;
void print(const char* m... |
#include "lib.h"
void *alloc_pages(unsigned int page_count) {
assert(page_count > 0);
void *ptr = malloc(4096 * page_count);
// printf("+ %8llx - %4d\n", (unsigned long long) ptr, page_count);
return ptr;
}
void release_pages(void *ptr, unsigned int page_count) {
assert(ptr != NULL & page_count > 0);
// ... |
#include <bits/stdc++.h>
#define VI vector<int>
#define VII vector<pair<int,int>>
#define QI queue<int>
#define ms(a,v) memset( a, v, sizeof( a ) )
#define FOR(i,a,b) for(int i = a; i <= b; ++i)
#define ROF(i,a,b) for(int i = a; i >= b; i--)
#define foreach(v, c) for( typeof( (c).begin() ) v = (c).begin(); v != (c).e... |
// Copyright 2017 Google Inc.
//
// 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... |
// (c) <NAME>. All Rights Reserved.
// Purpose: To illustrate protected inheritance versus public inheritance
#include <iostream>
using namespace std;
typedef int Item;
class LinkListElement
{
private:
void *data;
LinkListElement *next;
public:
LinkListElement() { data = 0; next = 0; }
LinkListElement... |
/*
* Copyright (C) 2011-2019 Intel Corporation. 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 li... |
/****************************************************************************//*
* Copyright (C) 2021 <NAME>
*
* 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, includ... |
// I2CCommunicator.cpp
// Created by <NAME> on 10/10/13.
// Copyright (c) 2013 <NAME>. All rights reserved.
// Communicates over I2C
#include "comms/I2CCommunicator.h"
extern "C"{
#include "device/twi.h"
}
/*********** All nasty I2C stuff is mediated in this file. ***********
********* Data from I2C is put in th... |
// calcAndWrite_Jaccards.cpp
// <NAME>
// Last Modified: 2014-12-06
/*
Copyright 2008-2014 <NAME>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option... |
#include <iostream>
#include <sstream>
#include <stdexcept>
#include "xmlrpcType.hpp"
#include "xmlrpcMethod.hpp"
using namespace std;
xmlrpcMethod::xmlrpcMethod(string const& functionName,
string const& methodName,
string ... |
#include "o3.hpp"
#include "sco/expr_ops.hpp"
#include "sco/modeling_utils.hpp"
#include "osgviewer/osgviewer.hpp"
#include "trajopt/collision_checker.hpp"
#include "trajopt/collision_terms.hpp"
#include "trajopt/common.hpp"
#include "trajopt/plot_callback.hpp"
#include "trajopt/problem_description.hpp"
#include "trajo... |
// [WriteFile Name=AnimateImagesWithImageOverlay, Category=Scenes]
// [Legal]
// Copyright 2020 Esri.
// 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/LICEN... |
// twentyone.cpp
// <NAME>
#include <iostream>
#include <vector>
using namespace std;
namespace Part1
{
static int deterministic_dice = 0;
static int deterministic_rolls = 0;
int roll()
{
int r = deterministic_dice+1;
deterministic_rolls++;
deterministic_dice = r%100;
re... |
#include <torch/torch.h>
#include <torch/script.h>
#include <torch/autograd.h>
#include <torch/utils.h>
#include <iostream>
#include <unistd.h>
#include <iomanip>
#include <map>
using namespace torch::autograd;
torch::Tensor f( torch::Tensor a ) {
auto b = a * 2;
torch::Tensor c;
while( b.norm().item<d... |
/**********************************************************************
Copyright 2020 Advanced Micro Devices, Inc
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/L... |
#include <opencv2/opencv.hpp>
#include <opencv2/core/mat.hpp>
#include <future>
using namespace std;
std::mutex optimiseSelectionCostMtx; // mutex for critical section
vector<tuple<int, int, long long, long long>> optimiseSelectionCostKernel(vector<int> dataIndices, std::shared_ptr<FeatureMatrix> _data, vector<int> ... |
#include<bits/stdc++.h>
using namespace std;
#define DEBUG_PRINT 0
#define out if(DEBUG_PRINT)cout
#define endl '\n'
#define mp make_pair
#define pii pair<int,int>
/* Timing stuff */
double currentTime=0;
double deadline=CLOCKS_PER_SEC*60;
inline int getTime() { return currentTime=clock(); }
// Start here
int n,m;
v... |
/*
* Copyright (c) 2019 <NAME>
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <cmath>
#include <iostream>
#include <vector>
#include <chrono>
#include <Eigen/Core>
#if defined(_WIN32) // windows
# define NOMINMAX // to r... |
#include <ortp/ortp.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <string.h>
#define STREAMS_COUNT 1000
BOOL m_bExit = FALSE;
static char *help="usage: mrtprecv file_prefix local_port number_of_streams \n"
"Receives multiples rtp streams on local_port+2*k, k={0..num... |
/*
* Copyright (C) 2018 The Android Open Source Project
*
* 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 app... |
// exiga.cpp, v1.0 2011/05/20
// coded by asmodean
// contact:
// web: http://asmodean.reverse.net
// email: asmodean [at] hush.com
// irc: asmodean on efnet (irc.efnet.net)
// Modified by Fuyin
// 2014/09/07
// Modified again by Neroldy
// 2016/06/25
// 2017/09/25
// Fucked agin again by Lipsum
// 2021/0... |
#include <bits/stdc++.h>
#define VI vector<int>
#define VII vector< pair<int,int> >
#define QI queue<int>
#define ms(a,v) memset( a, v, sizeof( a ) )
#define FOR(i,a,b) for(int i = a; i <= b; ++i)
#define ROF(i,a,b) for(int i = a; i >= b; i--)
#define foreach(v, c) for( typeof( (c).begin() ) v = (c).begin(); v != (c)... |
#include "include/Tsca.h"
#include <framework/rfw_network_interfaces.h>
//#define ELEVATE_PRIVILEGES
namespace tsyncca {
namespace components {
Tsca::Tsca(_component_conf &config, riaps::Actor &actor) :
TscaBase(config, actor), m_hasJoined(false), m_logcounter(0) {
_logger->set_level(s... |
#include "Text.h"
#include "filesystem.h"
Text::Text() {
// Shader
textShader = Shader(FileSystem::getPath("src/Shader/font.vs").c_str(), FileSystem::getPath("src/Shader/font.fs").c_str());
glm::mat4 projection = glm::ortho(0.0f, static_cast<GLfloat>(SCR_WIDTH), 0.0f, static_cast<GLfloat>(SCR_HEIGHT));
textShader... |
#include <ft2build.h>
#include FT_FREETYPE_H
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "pool.hpp"
void textRender::setup_font(std::map<std::string,GLuint>& shaders)
{
textShaderId = shaders["text"];
//glEnable(GL_CULL_FACE);
glEnable(GL_BLEND)... |
/*
* Copyright (c) 2005, <NAME> and IFS Institute for Software at HSR Rapperswil, Switzerland
* All rights reserved.
*
* This library/application is free software; you can redistribute and/or modify it under the terms of
* the license that is included with this library/application in the file license.txt.
*/
#in... |
#include "pilercr.h"
#include <algorithm>
#define TRACE 0
extern void Align_Recursion(char *A, int Alen, char *B, int Blen,
Trapezoid *b, int current, int comp, int MinLen, double MaxDiff, int Traplen);
extern int TSORT(const void *l, const void *r);
extern int StSORT(const void *l, const void *r);
extern ... |
/**
* Copyright 2021 Alibaba Group Holding Limited.
*
* 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 applicab... |
#include "State/Host.hpp"
Host::Host(sf::RenderWindow& window,
std::unique_ptr<State>& main_state,
unsigned short port)
: State(window, main_state),
mServer(port)
{
//Initialize the script box.
TextEditor::LanguageDefinition lua_lang = TextEditor::LanguageDefinition::Lua();
lua_lang.mAutoIndentation ... |
/**************************************************************************
*
* Copyright (c) 2002 - 2011 by Computer Architecture Department,
* Universitat Politecnica de Catalunya.
* All rights reserved.
*
* The contents of this file may not be disclosed to third parties,
* copied or duplicated in any form, in... |
#include "SyntaxHighlighter.h"
#include <iostream>
#include <map>
#include "Constants.h"
const char SyntaxHighlighter::m_separators[] = {
' ',
'(',
')',
'{',
'}',
';',
',',
':',
'[',
']',
'|',
'<',
'>',
'=',
'&',
'!'
};
const std::string SyntaxHighlighter::m_operators[] = {
"for",
"while",
"if"... |
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "/debug.h"
#else
#define db(...)
#endif
#define all(v) v.begin(), v.end()
#define pb push_back
using ll = long long;
const int NAX = 2e5 + 5, MOD = 998244353;
const int kmod = MOD;
int mul(int a, int b, int mod = kmod)
{
return (long long)a * b... |
#include "uihistoryview.h"
#include "apputil.h"
#include "fileutil.h"
#include "strutil.h"
#include "timeutil.h"
#include "uicolorconfig.h"
#include "uimodel.h"
UiHistoryView::UiHistoryView(const UiViewParams& p_Params)
: UiViewBase(p_Params)
{
if (m_Enabled)
{
int hpad = (m_X == 0) ? 0 : 1;
int vpad = ... |
#include <cstring>
#include <TextureManager.h>
#include "Prism.hpp"
Prism::Prism(unsigned dimension, GLuint sideTexture) : BaseShape(true), dimension(dimension), sideTexture(sideTexture)
{ init(); }
Prism::Prism(unsigned dimension) : BaseShape(false), dimension(dimension)
{ init(); }
Prism::Prism(unsigned dimension,... |
/**
*
* Author: <NAME>(coderemite)
* Email: <EMAIL>
*
*/
#include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
#define sz(a) (int)((a).size())
const int MAX = 22;
const int MOD = 1E9;
int sub(int x, int y) {
x-=y; if (x < 0) x+=MOD;
return x;
}
int add(int x, int y) {
... |
#include "FusionEKF.h"
#include <iostream>
#include "Eigen/Dense"
#include "tools.h"
#include <math.h>
using Eigen::MatrixXd;
using Eigen::VectorXd;
using std::cout;
using std::endl;
using std::vector;
/**
* Constructor.
*/
FusionEKF::FusionEKF() {
is_initialized_ = false;
previous_timestamp_ = 0;
// initi... |
#include "stdafx.h"
#include "EntityInfoRenderer.h"
#include <dingus/gfx/Vertices.h>
#include <dingus/gfx/geometry/DynamicVBManager.h>
typedef SVertexXyzDiffuseTex1 TVertex;
CEntityInfoRenderer::CEntityInfoRenderer( CD3DIndexBuffer& ib )
: mIB( &ib )
{
CVertexFormat vformat(
CVertexFormat::V_POSITION ... |
#include "LVGLImageButton.h"
#include <QIcon>
#include "LVGLCore.h"
#include "LVGLObject.h"
#include "properties/LVGLPropertyImage.h"
class LVGLPropertyImgBtnSrc : public LVGLPropertyImage {
public:
LVGLPropertyImgBtnSrc(lv_btn_state_t state, LVGLProperty *parent = nullptr)
: LVGLPropertyImage(parent),
... |
/* The MIT License (MIT)
*
* Copyright (c) 2014-2018 <NAME> and <NAME>
*
* 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
* ... |
#include <bits/stdc++.h>
#include <unistd.h>
#include "../util/helpers.cpp"
using namespace std;
// http://adventofcode.com/2019/day/19
class intcode_runner
{
public:
map<size_t, long long> program;
size_t ip;
long long relative_base;
bool keep_running;
vector<int> input;
size_t input_index;
intcode_runner(c... |
#include <assert.h>
#include "Rescore.hh"
Rescore::Rescore()
: m_tree_gram(NULL),
m_src_lattice(NULL),
m_sentence_start_label("<s>"),
m_sentence_end_label("</s>"),
m_null_label("!NULL")
{
}
Lattice::Node& // private
Rescore::find_or_create_node(int node_id, Context &context)
{
// Check if the cont... |
#include "../Include/tableData.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "Enclave_u.h"
#include "sgx_urts.h"
#include "sgx_utils/sgx_utils.h"
sgx_enclave_id_t global_id = 0;
int N_IDS[5] = {0,1,2,3,4};
char NAMES[5][10] = {"Townie","Simonette" , "Dinnie", "Merell", "Madelon"};
int name_idx... |
/* XBW.cpp
* Copyright (C) 2014, <NAME> & <NAME> & <NAME>
* all rights reserved.
*
* XBW implementation
*
* This library 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 2.1 of ... |
#include "LeetCodeLib.h"
/*
* @lc app=leetcode id=307 lang=cpp
*
* [307] Range Sum Query - Mutable
*
* https://leetcode.com/problems/range-sum-query-mutable/description/
*
* algorithms
* Medium (29.27%)
* Testcase Example: '["NumArray","sumRange","update","sumRange"]\n[[[1,3,5]],[0,2],[1,2],[0,2]]'
*
* Giv... |
# pragma execution_character_set("utf-8")
#include <opencv2/core.hpp>
#include <QPainter>
#include <QStylePainter>
#include <QStyleOptionFocusRect>
#include <QDateTime>
#include <QMutexLocker>
#include "FpsCounter.h"
#include "Viewer2D.h"
Viewer2D::Viewer2D(QWidget *parent)
{
QSizePolicy sp;
sp.setWidthForHeight(... |
/* CPPExample.cpp
*
* Copyright 2015 <NAME> <<EMAIL>>
*
* 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 appl... |
// Copyright (C) 2018 ETH Zurich
// Copyright (C) 2018 UT-Battelle, LLC
// All rights reserved.
//
// See LICENSE for terms of usage.
// See CITATION.md for citation guidelines, if DCA++ is used for scientific publications.
//
// Author: <NAME> (<EMAIL>)
// <NAME> (<EMAIL>)
// <NAME> (<EMAIL>)
//
// Int... |
/* Copyright 2021 Canaan Inc.
*
* 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 ... |
#define _GNU_SOURCE
#include "cfg.h"
#include "multicron.h"
#include "commands.h"
#include <string>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#ifdef BSD
#else
#include <linux/unistd.h>
#include <sys/syscall.h>
#endif
/* Copy from linux/ioprio.h*/
enum {
IOPRIO_CLASS_NONE,
IOPRIO_CLASS_RT,
IOPRIO_C... |
/*****************************************************************
ActorX.cpp Actor eXporter for Unreal.
Copyright (c) 2000,2001,2002,2003,2004 Epic Games, Inc. All Rights Reserved.
Created by <NAME>
Exports smooth-skinned meshes and arbitrary hierarchies of regular textured meshes,
and their animation in ... |
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#include <climits>
#include <bitset>
#include <iostream>
using namespace std;
// float quantizations
long long int F = 1000000;
// secret quantizations
long long int Q = LLONG_MAX;
// quantize a float from -0.5 to 0.5 to 0 to Q
long long int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.