text stringlengths 3.08k 12.5k |
|---|
#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
#include "llvm/IR/IntrinsicInst.h"
#include "Setbound.h"
#define SETBOUND_ASM \
"li x17, 98\n" \
"mv x10, $0\n" \
"mv x11, $1\n" \
"mv x12, $2\n" \
"ecall"
#define SETBOUND_CONS \
"r,r,r,~{x17},~{x10},~{x11},~{x12}"
using n... |
/***********************************************************************
Copyright (c) 2008, 2009, 2010, <NAME>, www.memo.tv
*** The Mega Super Awesome Visuals Company ***
* All rights reserved.
based on <NAME>lin's ofxSimpleGui API
http://toddvanderlin.com/
*
* Redistribution and use in source and binary for... |
/**
* Copyright (c) 2011, 2012
* <NAME> <<EMAIL>>
* and the IceCube Collaboration <http://www.icecube.wisc.edu>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appea... |
#include <stack/StackHandler.h>
#include <core/Options.h>
#include <core/System.h>
#include <core/Logger.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <execinfo.h>
#include <cxxabi.h>
#include <string>
#define THREAD_ID_LENGTH 20... |
// Functions for the <see cref="DibGuarPage"/> class to manage disability
// guarantee calculation output.
// $Id: DibGuarPage.cpp 1.9.1.2 2012/08/28 07:58:33EDT 277133 Development $
#include "DibGuarPage.h"
#include "DibGuar.h"
#include "PiaException.h"
#include "Resource.h"
#include "PiaCalAny.h"
using... |
// -*- C++ -*-
//
// Package: Analyzers
// Class: testCalibration
//
/**\class testCalibration testCalibration.cc HGCPFLab/Analyzers/plugins/testCalibration.cc
Description: [one line class summary]
Implementation:
[Notes on implementation]
*/
//
// Original Author: <NAME>
// Created: Mon, ... |
// binominals.cc - Binominals program by Sergey 2015
// AlgoArt - The Art of Algorithms (github.com/algoart/algoart)
/*
Calculating binominal coefficients, factorials, inverted factorials, fast
exponents, modulo operations etc.
Modulos(mod) - modulo selection
mod(a) - Modulo operation
add(a,b) - Modulo addit... |
#include "mqtt.h"
#include "libco/co_routine.h"
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <sys/time.h>
#include <stack>
#include <sys/socket.h>
#include <netinet/in.h>
#include <sys/un.h>
#include <fcntl.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <sys/wait.h>... |
/******************************************************************************
* Copyright (C) 2007 <NAME> <<EMAIL>>
*
* All rights reserved.
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of t... |
// Stoer-Wagner's algorithm implemented with a d-ary heap: O(ve log v)
#include <cstdio>
#include <vector>
#include <utility>
#include <queue>
#include <chrono>
using namespace std;
using namespace chrono;
#define D 16
#define MAXN 5000000
typedef long long ll;
struct daryheap
{
ll heap[MAXN];
int node[MAXN];
int at... |
//
// Particles.cpp
// BumperCarSimulation
//
// Created by <NAME> on 3/18/18.
// Copyright © 2018 <NAME> & <NAME>. All rights reserved.
//
#include "Particles.hpp"
#include "Window.hpp"
Particles::Particles()
{
// Initialize all the particles
for(int i = 0; i < TOTAL_PARTICLES; i++) {
particleLif... |
//
// #include "LICENSE"
//
//
#include "pch.h"
#include "Program Launcher.h"
CLauncherItem::CLauncherItem(CCategory* ptrParent, const UINT parentIndex, const wstring& wsName, const wstring& wsPath, const wstring& wsPathIcon, const int iIconIndex, const wstring& wsPath64, const bool bAdmin, const bool bAbsolute)
:
... |
// File and Version Information:
// $Header: /nfs/slac/g/glast/ground/cvs/LdfConverter/src/LdfCalDigiCnv.cxx,v 1.8 2012/04/26 04:01:37 heather Exp $
//
// Description:
// LdfCalDigiCnv is the concrete converter for the event header on the TDS /Event
//
// Author(s):
#define LdfCalDigiCnv_CXX
#include "Gaud... |
#include <h2opus/core/hara_weak_util.h>
#include <h2opus/core/hcompress.h>
#include <h2opus/core/hlru.h>
#include <h2opus/core/horthog.h>
#include <h2opus/util/debug_routines.h>
#include <h2opus/util/vector_operations.h>
#include <h2opus/util/gpu_err_check.h>
#include <h2opus/util/timer.h>
///////////////////////////... |
/*
* Copyright (c) 2020-2021, NVIDIA CORPORATION. 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
*
* Unless ... |
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <cstdlib>
bool autoScale_;
double min_,max_;
double firstTick_,lastTick_;
double absMin_,absMax_;
double tickSpacing_;
int scalingExponent_;
int nIntervals_;
using namespace std;
string formatNumber(double x,int e,dou... |
#include <cstdio>
#include <cmath>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <map>
#include <cfloat>
// Boost
#include <boost/filesystem.hpp>
#include <boost/program_options.hpp>
// Eigen
#include <Eigen/Dense>
/** \brief Just encapsulating vertices and faces. */
class Mesh... |
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
namespace pcf {
// initialize once by calling init()
#define MAXN 10000010 // initial sieve limit
#define MAX_PRIMES 1000010 // max size of the prime array for sieve
#define PHI_N 100000
#define PHI_K 100
int len = 0; // total n... |
#include<iostream>
#include<queue>
using namespace std;
//finding deepest left leaf node in a binary tree using simple level order taversal
struct BinaryTreeNode{
int data;
BinaryTreeNode *left;
BinaryTreeNode *right;
};
//Using level order taversal technique
struct BinaryTreeNode *DeepestLeftLeafLevelOrder(str... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "huffmanTree.h"
#include <QFileDialog>
#include <QMessageBox>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainW... |
/**
* wsserver
* ConnectionStorage.cpp
*
* @author <NAME> <<EMAIL>>
* @link https://github.com/edwardstock
*/
#include "ConnectionStorage.h"
#include <fmt/format.h>
wss::ConnectionStorage::~ConnectionStorage() {
for (auto &kv: m_idMap) {
for (const auto &c: kv.second) {
try {
... |
#include <opencv2/opencv.hpp>
#include <opencv2/cvconfig.h>
#include <opencv2/core/cv_cpu_helper.h>
#include <opencv2/core/hal/hal.hpp>
#include <opencv2/core/hal/intrin.hpp>
#include <iostream>
//#include "profile.h"
using namespace std;
using namespace cv;
float sse_ret(__m128 s)
{
union { __m128 m; float f[4]... |
#include "stats.h"
#include "table.h"
#include "../libbruce/src/serializing.h"
#include <algorithm>
using namespace libbruce;
int sum(const intlist_t &xs)
{
int ret = 0;
for (intlist_t::const_iterator it = xs.begin(); it != xs.end(); ++it)
{
ret += *it;
}
return ret;
}
StatsCollector::S... |
/*****************************************************************************
FILE: postclas.cpp
AUTHOR: <NAME>
revised by wan on 2017/2/24
****************************************************************/
#include "POSTCLAS.h"
// Records of post classifications.
int PostClass[MAXTYPES][8], PCInitCount = 0 ;
int ... |
#ifdef HAVE_CONFIG_H
#include <../../config.h>
#endif
/*
* Copyright (c) 1987, 1988, 1989, 1990, 1991 Stanford University
* Copyright (c) 1991 Silicon Graphics, Inc.
*
* Permission to use, copy, modify, distribute, and sell this software and
* its documentation for any purpose is hereby granted without fee, provi... |
#include "SolverApp.h"
#include "Vector.h"
#include "SparseVector.h"
#include "LinearInterpolator.h"
#include "CubicInterpolator.h"
#include "SIRTSolver.h"
#include "ARTSolver.h"
#include "SARTSolver.h"
#include "MGSolver.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <ctime>
#include <cmath>
... |
/**
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); ... |
#include <vector>
#include <chrono>
#include <random>
#include <iostream>
#include <cstdint>
#include <immintrin.h>
#include <stdio.h>
// This is the linear naive implementation used as baseline for the optimization benchmark
float dist_baseline(const std::vector<float>& p1, const std::vector<float>& p2) {
float ... |
#include <iostream>
#include <ros/ros.h>
#include <sensor_msgs/Joy.h>
#include <std_msgs/Bool.h>
#include <std_msgs/UInt16.h>
ros::Publisher armServoPub;
ros::Publisher grasp1ServoPub;
ros::Publisher grasp2ServoPub;
ros::Publisher launchServoPub;
ros::Publisher ramp1ServoPub;
ros::Publisher ramp2ServoPub;
ros::Publi... |
// TImestream DAta Storage (TIDAS).
//
// Copyright (c) 2015-2019 by the parties listed in the AUTHORS file. All rights
// reserved. Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <tidas_test.hpp>
#include <tidas_backend_hdf5.hpp>
#include <cstdlib>
#... |
#define OLC_PGE_APPLICATION
#include "olcPixelGameEngine.h"
enum Buttons {
Simulation, Add, Remove, Undefined
};
class LangtonsAnt : public olc::PixelGameEngine
{
int xOrigin = ScreenWidth() / 2;
int yOrigin = ScreenHeight() / 2;
int computationalSteps = 100;
std::pair<int, int> pos{ 0,0 };
st... |
// Copyright (c) 2022
// Author : <NAME>
// Create Time : 2022 March
// Change Log :
// - Init the camera
// - Init the access to the SD card
// - Take a photo and save it on the SD card
//
// The MIT License (MIT)
//
// Permission is hereby granted, free of charge, to any person obtain... |
/* \author <NAME> */
// Create simple 3d highway enviroment using PCL
// for exploring self-driving car sensors
#include "sensors/lidar.h"
#include "render/render.h"
#include "processPointClouds.h"
// using templates for processPointClouds so also include .cpp to help linker
#include "processPointClouds.cpp"
std::vec... |
//Language: GNU C++11
/*************************************************************************
> File Name: d.cpp
> Author: skt
> Mail: <EMAIL>
> Created Time: 2015年08月14日 星期五 18时25分38秒
************************************************************************/
#include <cstring>
#include <v... |
// Basic Mathematic Functions...
#include "csmfwddecl.hxx"
enum csmcompare_t csmmath_compare_doubles(double value1, double value2, double epsilon);
enum csmmath_dropped_coord_t csmmath_dropped_coord(double x, double y, double z);
void csmmath_select_not_dropped_coords(
double x, dou... |
#include "runtime/func.h"
#include "messaging/IMessageManager.h"
#include "messaging/Util.h"
#include "storage/DBClient.h"
#include "DiggiAssert.h"
#include <inttypes.h>
#include "runtime/DiggiAPI.h"
#include <chrono>
#include <ctime>
#include <numeric>
/... |
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <sched.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <string>
#include "knem_io.h"
#include "common.h"
#define LEN (1024... |
#include <bits/stdc++.h>
#ifdef LOCAL
#include "code/formatting.hpp"
#else
#define debug(...) (void)0
#endif
using namespace std;
static_assert(sizeof(int) == 4 && sizeof(long) == 8);
template <uint32_t mod>
struct modnum {
// change these if you need another size of integers
using u32 = uint32_t;
using u... |
/* Hourglass library example
The hourglass library uses timer2 to produce timer interrupts at a given
cycle time. This cycle time can be chosen at the initialization step of
the library:
Hourglass.Init (); : Use standard (SLOW) mode, 10 ms ticks
Hourglass.Init (SLOW); : Use SLOW mode, ... |
#include "apsis/engine/system.h"
#include "apsis/sync/clock.h"
#include <fstream>
#include <stdlib.h>
#ifdef JS_MODE
#include <emscripten.h>
#endif
Apsis::Engine::System::System(const char* path,
const Apsis::Settings::Video& videoSettings,
const Apsis::Se... |
#include <iostream>
#include <vector>
#include <string>
using namespace std;
/*
* Homework 1 - Comp365
Write a program that implements Large Integer operations. Your should:
" Implement a LargeInteger class
" Implement member functions that can input and output Large Integers
" Implement member function that adds two ... |
#include <ctime>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <math.h>
#include "term_disp.h"
#include "atom.h"
extern int frame_width;
extern int frame_height;
/* print atom names, locations, and bond partners */
void print_state(game_state *state)
{
int i, j;
atomDat atom;
printf("List... |
// Voro++, a 3D cell-based Voronoi library
//
// dikjstra_aux.c
//
// Routine implementation for modified dikjstra analysis
//
// Author : <NAME>
// Email :
// Date : November 20th 2015
#include "dijkstra_aux.hh"
/***** WEIGHT LIST MANAGEMENT FUNCTIONS *****/
WListElement *NewWListElement( int IdPoint,
... |
#include<fstream>
#include <vector>
using namespace std;
typedef int TreeKey;
typedef int TreeValue;
#include <sstream>
template<class TKey, class TValue>
struct Node {
TreeKey key;
TreeValue value;
Node* l;
Node* r;
Node(TreeKey key, TreeValue value) :key(key), value(value)
{
l = 0;
r =... |
/*
* This file is part of the NUbots Codebase.
*
* The NUbots Codebase 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) any later version.
*
* The ... |
/*******************************************************************************
* This file is part of the "Enduro2D"
* For conditions of distribution and use, see copyright notice in LICENSE.md
* Copyright (C) 2018-2020, by <NAME> (<EMAIL>)
*************************************************************************... |
#include "stdafx.h"
#include "Connection.h"
#include "ResponseListener.h"
#include "SessionStatusListener.h"
#include "LoginParams.h"
#include "SampleParams.h"
#include "CommonSources.h"
void printHelp(std::string &);
bool checkObligatoryParams(LoginParams *, SampleParams *);
void printSampleParams(std::string &, Logi... |
/*
* Winch.cpp
* Winches Light Painting App
*
* Created by <NAME> on 16/03/18.
*
*/
#include "Winch.h"
#include "AppManager.h"
Winch::Winch(const ofPoint& position, float width, float height, int _id): BasicVisual(position, width, height), m_id(_id), m_distance(0.0), m_speed(0.0)
{
this->setup();
}
Wi... |
#include <iostream>
#include <fstream>
#include <functional>
#include <filesystem>
#include "disktools.h"
namespace fs = std::filesystem;
#include "status.h"
#include "jopts.h"
#define CHECK_REPORT_ABORT_ERROR(result)\
if (!result)\
{\
std::cerr << "*** error: \"" << result.error_code() << "\"" << ... |
#define EIGEN_USE_THREADS
#include <memory>
#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"
#include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/register_types.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "ten... |
#include "file_image.h"
namespace Gdiplus {
using std::max;
using std::min;
}
#include <Gdiplus.h>
class ComInit {
public:
ComInit() {
CoInitializeEx(0, COINIT_MULTITHREADED);
}
~ComInit() {
CoUninitialize();
}
private:
ComInit(const C... |
#include "sol.hpp"
#include "../common.hpp"
#include "../console.hpp"
#include <algorithm>
#include <bitset>
#include <memory>
#include <string.h>
#include <stdio.h>
struct Field {
bool isDeparture;
std::pair<int, int> range1;
std::pair<int, int> range2;
};
static inline bool validForField(const Field& field, int... |
/*
* Copyright (c) 2021, The UAPKI Project Authors.
*
* 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 code must retain the above copyright
* notice, this list of conditions ... |
/** @file main.cpp
*
* @brief main file for getRandomName
*
* This is the main file for getRandomName, a small tool to create random names
* utilizing RNG of the pwxLib.
*
* (c) 2007 - 2019 PrydeWorX
* @author <NAME>, PrydeWorX - Bardowick, Germany
* <EMAIL>
* https://github.com/Yama... |
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// Binary Search Tree (BST) as Abstract Data Type (ADT)
// Pointer-based implementation of BST
#define DEBUG 1 // change it to 0 if you do not want debug statement to print
// Binary Tree Node
template<class T>
struct... |
//******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LI... |
#include "morse.h"
struct MorseSign {
// Length of this sign. If Length is 0, Bits is the duration of a pause.
uint8_t Length;
uint8_t Bits;
};
const struct MorseSign GetMorseSign(char c) {
switch (c) {
case 3: // ETX - End of Text
return (struct MorseSign){8, 0b01010101};
case 4: // EOT - End... |
#include "command_exec.h"
extern pid_t shell_pgid;
extern struct termios shell_tmodes;
extern int shell_terminal;
extern int shell_is_interactive;
extern Job* first_job;
void exec_command(Job *job)
{
auto c = job->commands.front(); // if c is not external command, then command_list only has one element.
c.check_ty... |
// Copyright (c) 2013-2018 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, including without limitation the rights
// to use, copy, modify, merge,... |
// Copyright (C) 2016 <NAME>. All rights reserved.
// Permission is granted to use at your own risk and distribute this software
// in source and binary forms provided all source code distributions retain
// this paragraph and the above copyright notice. THIS SOFTWARE IS PROVIDED "AS
// IS" WITH NO EXPRESS OR IMPLIED W... |
// (C) 2017-2021 by <NAME>, released under Apache License v2.0
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <time.h>
#include <curl/curl.h>
#include <sys/time.h>
#include "error.h"
#include "utils.h"
#include "log.h"
static const char *logfile = NULL;
stat... |
/*
<NAME>
Cisco Systems, Inc.
*/
/*
Copyright (c) 2015-2015 Cisco Systems, 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... |
/**************************************************************************\
|
| Copyright (C) 2009 <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 L... |
#include "include/roller.h"
// Constructors
Roller::Roller()
{
std::random_device rd;
_generator = std::mt19937_64(rd());
_roller = std::uniform_int_distribution<>(1, base_die.die);
}
Roller::Roller(int r, int n, int d, int m)
{
base_die.repeat = r;
base_die.number = n;
base_die.die = d;
base... |
// Copyright 2012 Google Inc. 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
//
// Unless required by ap... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* License); you ma... |
// SPDX-License-Identifier: Apache-2.0
#include "playwgpu_internal.h"
#include <GLFW/glfw3.h>
#include <utils/GLFWUtils.h> /* from dawn */
#include <dawn_native/DawnNative.h>
// struct guimsg_t {
// p_gui_msghdr_t hdr;
// union {
// p_gui_surfinfo_t surfinfo;
// };
// };
static err_t grow_rbuf(p_ringbu... |
/*
* mp_search.cpp for BWT Tunneling
* Copyright (c) 2020 <NAME> All Rights Reserved.
*
* 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... |
#include <TextRenderer.h>
TextRenderer::TextRenderer(std::string fontFile, Camera2D* cam, float quality){
this->cam = cam;
this->quality = quality;
init(fontFile);
}
void TextRenderer::init(std::string font_name){
FT_Library ft;
// All functions return a value different than 0 whenever an error ... |
/*
* Copyright (c) 2020 Blickfeld GmbH.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE.md file in the root directory of this source tree.
*/
#include "bf_protobuf_plugin.h"
using namespace std;
using namespace google::protobuf;
const string file_templa... |
/*
* Copyright 2019 Xilinx, 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... |
// Copyright 2020 <NAME>
#include <mpi.h>
#include <iostream>
#include <random>
#include <ctime>
#include <limits>
#include <vector>
#include "../../modules/task_3/alekhin_d_dijkstras_algorithm/dijkstras_algorithm.h"
void getRandomGraph(std::vector<int>* graph, int size) {
std::mt19937 gen;
gen.seed(static_cast<un... |
// Boost.Geometry (aka GGL, Generic Geometry Library)
// Unit Test
// Copyright (c) 2007-2012 <NAME>, Amsterdam, the Netherlands.
// Copyright (c) 2008-2012 <NAME>, Paris, France.
// Copyright (c) 2009-2012 <NAME>, London, UK.
// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
// (geolib/GGL),... |
/*
Copyright (C) 2010, 2011 by <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
to use, copy, modify, merge, publish, distribute,... |
#pragma once
#include <algorithm>
#include <cassert>
#include <vector>
#include <iostream>
#include <optional>
#include "constants.hpp"
template<typename T>
struct IDKeyPair
{
size_t id;
T key;
};
// A priority queue where the elements are IDs from 0 to id_count-1 where id_count is a number that
// is set in t... |
#include <bits/stdc++.h>
#include <time.h>
#define int long long int
#define pb push_back
#define mem(a, x) memset(a, x, sizeof a)
#define all(a) a.begin(), a.end()
#define scnarr(a, n) for (int i = 0; i < n; ++i) cin >> a[i]
#define vi vector<int>
#define si set<int>
#define pii pair <int, int>
#define sii set<pii>
#d... |
#include "cpp_header.h"
/*
* n n
* n-1 1 1 n-1
* n-2 2 2 n-2
* n-2 1 2 n-3
*
* n-3 3 3 n-3
* n-3 2
*
* 2 -2
* 1 -1 1 -1
*
* 3 -3
* 2 -1 1 -2
* 2 -2 1 -1
* 1 -1 2 -2
* 1 -1 1 -1 1 -1
*
* 4 -4
* 1 -1 3 -3
* 3 -1 1 -3
* 3 -3 1 -1
* 1 -1 2 -1 1 -2
* 2 -1 1 -1 1 -2
* 2 -1 1 -2 1 -1
* 1 -1 2 -2 ... |
#include "InstanceComponentFunctionSymbol.h"
#include "../objects/FunctionSymbol.h"
#include <iostream>
InstanceComponentFunctionSymbol :: InstanceComponentFunctionSymbol()
{
this -> xbaseposition = 0;
this -> ybaseposition = 0;
this -> type = 0;
this -> positionInComponent = 0;
}
InstanceComponentFu... |
#include "resources/amaterialgl.h"
#include "agl.h"
#include "commandbuffergl.h"
#include "resources/text.h"
#include "resources/atexturegl.h"
#include <file.h>
#include <log.h>
void AMaterialGL::loadUserData(const VariantMap &data) {
Material::loadUserData(data);
switch(m_MaterialType) {
case Post... |
// Written by <NAME>
#include "Vorb/stdafx.h"
#include "Vorb/MeshGenerators.h"
#include "Vorb/graphics/GpuMemory.h"
#include "glm/glm.hpp"
const static float GOLDEN_RATIO = 1.61803398875f;
const static int NUM_ICOSOHEDRON_VERTICES = 12;
const static f32v3 ICOSOHEDRON_VERTICES[12] = {
f32v3(-1.0f, GOLDEN_RATIO, 0... |
#include "ekf_sym.h"
using namespace EKFS;
using namespace Eigen;
EKFSym::EKFSym(std::string name, Map<MatrixXdr> Q, Map<VectorXd> x_initial, Map<MatrixXdr> P_initial, int dim_main,
int dim_main_err, int N, int dim_augment, int dim_augment_err, std::vector<int> maha_test_kinds,
std::vector<std::string> global... |
#include <CL/sycl.hpp>
#include <iostream>
#include <vector>
class MyInt32Const;
class MyFloatConst;
class MyConst;
using namespace sycl;
class KernelAAAi;
class KernelBBBf;
int global_val = 10;
// Fetch a value at runtime.
int get_value() { return global_val; }
float foo(const cl::sycl::ext::oneapi::experimenta... |
//===- PassManagerOptions.cpp - PassManager Command Line Options ----------===//
//
// Copyright 2019 The MLIR Authors.
//
// 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.... |
// g2o - General Graph Optimization
// Copyright (C) 2012 <NAME>
// 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 notic... |
//
// Created by ROHIT on 22-05-2017.
//
#include "findballsandmazes.h"
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <android/log.h>
findballsandmazes::findballsandmazes(int scree... |
/**
* $ g++ solution.cpp && ./a.out < input.txt
* Day 16!
* Part 1: giadhmkpcnbfjelo
* Part 2: njfgilbkcoemhpad
*/
#include <iostream>
#include <string>
using namespace std;
string do_the_dance(string programs, string input) {
string buffer;
for (int i = 0; i < input.length(); i++) {
buffer ... |
//===- NameMap.cpp - PDB Name Map -------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
// UNSUPPORTED: windows
// Disabled on windows due to bug VS 2019 missing math builtins
// REQUIRES: (accelerator || cpu || host) && windows
// RUN: %clangxx -fsycl -c %s -o %t.o
// RUN: %clangxx -fsycl %t.o %sycl_libs_dir/../bin/libsycl-cmath.o -o %t.out
// RUN: %HOST_RUN_PLACEHOLDER %t.out
// RUN: %CPU_RUN_PLACEHOLD... |
#include <cstdlib>
#include <algorithm>
// #include <Rcpp.h>
#include <RcppArmadillo.h>
// [[Rcpp::depends(RcppArmadillo)]]
class Coord{
public:
Coord(const int x, const int y);
Coord(const Coord & c);
bool operator==(const Coord & rhs) const;
int x;
int y;
};
Coord::Coord(const int x, const int y)
:x(... |
// Copyright (c) Improbable Worlds Ltd, All Rights Reserved
#include "SpatialCleanupConnectionTest.h"
#include "GameFramework/PlayerController.h"
#include "SpatialFunctionalTestFlowController.h"
/**
* This tests whether client connections get cleaned up when a pawn enters and leaves the interest of server that is n... |
/*
* Copyright (C) 2013 The Android Open Source Project
* 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, t... |
#include "process.hpp"
#include <functional>
#include <TlHelp32.h>
#include <memory>
#include "inject.hpp"
process::process(uint32_t process_id, uint32_t access)
: statuses({ "Exception", "Suspended", "Normal", "Terminated" })
{
this->process_id = process_id;
this->process_handle = OpenProcess(access, FALSE, proces... |
//#include <avr/pgmspace.h>
#include "settings_eeprom.h"
#include "state_spectator.h"
#include "receiver.h"
#include "channels.h"
#include "buttons.h"
#include "state.h"
#include "ui.h"
#include "pstr_helper.h"
using StateMachine::SpectatorStateHandler;
uint8_t selectedChannel = 0;
void SpectatorStateHandler::o... |
/*
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
/*
* Copyright (c) 2020 Trail of Bits, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This pr... |
#include "Thing.h"
#include "TimerThing.h"
#include "MenuManager.h"
#include "Helpers.h"
#include <utility>
#include "ScreenBuffer.h"
#include "MenuTask.h"
using namespace std;
void MenuManager::_up(const function<void()> &done) {
digitalWrite(encoder_1, LOW);
auto chain = timer.defer(EncoderTickLength / 2, [... |
// -*- C++ -*-
//
// Package: L1CondDBIOVWriter
// Class: L1CondDBIOVWriter
//
/**\class L1CondDBIOVWriter L1CondDBIOVWriter.cc CondTools/L1CondDBIOVWriter/src/L1CondDBIOVWriter.cc
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: <NAME>-<NAME>
/... |
// Copyright (c) 2019 Graphcore Ltd. All rights reserved.
#include <cassert>
#include <limits>
#include <poplar/HalfFloat.hpp>
#include <poplar/Vertex.hpp>
#include "../reduction/ReductionVertexDefs.hpp"
#include "poplar/AvailableVTypes.h"
#include "poplibs_support/ExternalCodelet.hpp"
#include "util.hpp"
static cons... |
#include "timeline-window.h"
TimelineWindow::TimelineWindow(wxWindow *parent) : wxScrolled<wxWindow>(parent, wxID_ANY)
{
m_parent = parent;
current_time_pos = 0;
SetScrollRate( 10, 10 ); //how many pixels to increment when scrolling
SetVirtualSize( TRACK_WIDTH, TRACK_HEIGHT ); //actual size of what will be... |
// Copyright 2015 The Chromium OS 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 <gtest/gtest.h>
#include <stdio.h>
extern "C" {
#include "cras_rstream.h"
#include "stream_list.h"
}
namespace {
static unsigned int add_ca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.