text stringlengths 3.08k 12.5k |
|---|
#include <torch/torch.h>
torch::nn::Conv2d conv_op(int64_t in_channels, int64_t out_channels, int64_t kernel_size,
int64_t stride, int padding) {
return torch::nn::Conv2d(torch::nn::Conv2dOptions(in_channels, out_channels, kernel_size)
.stride(stride)
.padding(padding)
... |
/**
* asp_therm - implementation of real gas equations of state
*
*
* Copyright (c) 2020-2021 <NAME>
*
* This library is distributed under the MIT License.
* See LICENSE file in the project root for full license information.
*/
#include "models_configurations.h"
#include "asp_utils/Logging.h"
#include "configu... |
#include "chessboard_widget.hpp"
#include <algorithm>
#include <iterator>
#include <mutex>
#include <signals_light/signal.hpp>
#include <cppurses/painter/color.hpp>
#include <cppurses/painter/glyph_string.hpp>
#include <cppurses/painter/painter.hpp>
#include <cppurses/system/mouse.hpp>
#include <cppurses/system/syst... |
// File: ALEDatabase.cpp
// Basic database for Assembly Language Emulator.
#include <iostream>
#include <fstream>
#include "ALEDatabase.h"
#include "ALEConstants.hpp"
ALEDatabase::ALEDatabase() {
ifstream program_file;
while (true) {
string file_name;
cout << "> Program file:... |
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDockWidget>
#include <QSizePolicy>
#include <QNetworkDatagram>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
config_dir = QCoreApplication::applicationDirPath()+"/configs/config... |
//
// AudioEncoder.cpp
// TestFFmpeg
//
// Created by anker on 2022/1/26.
//
#include "AudioEncoder.hpp"
#include <iostream>
#include <fstream>
extern "C" {
#include <libavutil/avutil.h>
}
// 错误处理
#define ERROR_BUF(ret) \
char errbuf[1024]; \
av_strerror(ret, errbuf, sizeof (errbuf));
bool AudioEncoder::p... |
/*******************************************************************************
Copyright (c) 2001-2008, Perforce Software, Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of... |
/*
* This code is property of KyJay LLC and is being
* provided to you through GitHub
* Author: <NAME>
* Date: 6/7/2013
*/
#include <iostream>
#include <cstdlib>
#include <ctime>
using std::cout;
using std::endl;
using std::cin;
bool prompt();
void feedDeck(int [52][2]);
int playDeck(int [52][2], int [52][2]);... |
#include <iostream>
#include <signal.h>
#include <stdio.h>
#include <sys/time.h>
#include "logging.h"
#include "TimerList.h"
#include "EventHandler.h"
#include "IOLoop.h"
using namespace std;
#define TIME_CLICK 500
static int pipe_err = 0;
static void epoll_pipe_handler(int)
{
pipe_err++;
}
void epoll_timer_c... |
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <fstream>
#include <cstdio>
using namespace std;
const int MAXV=1001;
const int INF=0x7fffffff;
//the number of nodes and edges
int V,edges;
//flow of each edge
int flow[MAXV][MAXV]={0};
int supply/*,demand*/;
//sou... |
#include "interface.h"
#include <iostream>
using std::string;
static string to_str (Move mv);
static string to_utf8 (Piece p, Color c);
static string to_ascii(BB b);
Interface::Interface()
{
init_moves(false);
init_move_str();
}
void Interface::interactive()
{
render_board();
... |
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
#include "EnginePrivate.h"
#include "Components/SphereComponent.h"
USphereComponent::USphereComponent(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
SphereRadius = 32.0f;
ShapeColor = FColor(255, 0, 0, 255);
bUseEditorCompos... |
/* Copyright (c) 2017 <NAME>, MIT License
*
* 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, publi... |
/*
* Scores = compute_matching_scores_segmentation(Boxes_det, Patterns_det, Boxes_gt, Patterns_gt)
*
* Inputs:
*
* Detections: N X 4 double matrix where D(i,:) = [x1 y1 x2 y2]
* Patterns: height x width x N unit8 matrix for occlusion patterns
*
* Outputs:
*
* Scores: N by M matching score matrix between... |
//
// CTRHMM.cpp
//
// Copyright (c) 2020 <NAME>
//
// This software is released under the MIT License.
// http://opensource.org/licenses/mit-license.php
//
//include{{{
#include <stdlib.h>
#include <boost/program_options.hpp>
#include "include/CTRHMMVariationalEstimator.hpp"
//}}}
using namespace std;
using namespac... |
#include <Windows.h>
#include <comdef.h>
#include <conio.h>
#include <iostream>
#include <string>
#include "IFirebirdDDFProvider.h"
#include "DDFProviderTypes.h"
#define DEBUG_WINDOW_PRINT(x) OutputDebugStringA(x); OutputDebugStringA("\n");
extern "C"
{
typedef HRESULT(__stdcall *DLLGETCLASSFUNPTR)(const CLSID& clsi... |
// Two-dimensional XY (planar spin) Model
// <NAME> and <NAME>, Phys. Rev. B 20, 3761 (1979)
// <NAME> and <NAME>, Phys. Rev. B 27, 598-601 (1983)
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
inline double std_rand()
{
return rand() / (RAND_MA... |
#include <algorithm>
#include <iostream>
#include "ManagerApi.h"
#include "Plist.h"
#include "PodFile.h"
#include "cli.h"
#include "common.h"
#include "exit_message.h"
#include "spdlog/spdlog.h"
void set_log_level();
std::vector<std::string> networks_list_by_podfile(const fyber::ManagerApi& manager_api, const fyber::... |
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include <chrono>
#include <glad/gl.h>
#include <glm/glm.hpp>
#include <imgui.h>
#include <imgui_impl_glfw.h>
#include <imgui_impl_opengl3.h>
#include <iostream>
#include <thread>
const char *vertexShaderSrc = R"(
#version 450
layout (location = 0) in vec2 aPos;
voi... |
#include "HoffMan.h"
HoffMan::HoffMan(void) {
this->chSize = pow(2, sizeof(char)* 8);
this->probArray = NULL;
}
HoffMan::~HoffMan(void) {
if (this->probArray) {
delete this->probArray;
}
}
string HoffMan::encode(string toEncode) {
if (this->probArray) {
delete this->probArray;
... |
#include "battery_monitoring/battery_monitoring.h"
void BatteryMonitoring::resetCounters()
{
counter_charging = 0;
sum_voltage_charging = 0;
sum_voltage_discharging = 0;
counter_discharging = 0;
}
//########## CONSTRUCTOR ##############################################################################... |
/*******************************************************************************
* Copyright (c) 2021, <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:
*
* 1. Redistributions of sourc... |
#include "Orbit.h"
#include <cmath>
#include "glm/gtc/matrix_transform.hpp"
Orbit::Orbit()
{
_centralMass = 5.97237e24;
}
Orbit::~Orbit()
{
}
void Orbit::orientOrbit(double longitudeOfAscendingNode, double inclination, double argumentOfPeriapsis)
{
const double PI = 3.141592653589793238462... |
//
// Created by Siddhant on 2019-09-27.
//
#include "iostream"
#include "vector"
#include "string"
using namespace std;
struct Node {
int data;
struct Node *next;
} *first = NULL;
struct Node *create(int A[], int n) {
struct Node *p = new Node;
struct Node *first = p;
for (int i = 0; i < n; ... |
//
// PathPlanner.cpp
// Packt_CreatingGamesWithAI
//
// Created by <NAME> on 09/10/2018.
// Copyright © 2018 <NAME>. All rights reserved.
//
#include "PathPlanner.hpp"
#include "PLG_GameWorldInfo.hpp"
#include "CollisionGrid.hpp"
#include "glm.hpp"
#include <limits>
PathInfo& PathInfo::getInstance()
{
stat... |
/* GNU Ocrad - Optical Character Recognition program
Copyright (C) 2003-2015 <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 2 of the License, or
(at your ... |
/*
* Copyright 2008, 2009 Google Inc.
* Copyright 2006, 2007 Nintendo Co., Ltd.
*
* 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
*
... |
#include "ZambeziIndexManager.h"
#include "./zambezi-tokenizer/ZambeziTokenizer.h"
#include <la-manager/AttrTokenizeWrapper.h>
#include <configuration-manager/ZambeziConfig.h>
#include <document-manager/DocumentManager.h>
#include <glog/logging.h>
#include <fstream>
using namespace sf1r;
ZambeziIndexManager::ZambeziI... |
#include "strstack.h"
#include <stdlib.h>
#include <malloc.h>
#include <string.h>
#if defined(_DEBUG) && defined(DEBUG_NEW)
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
SNode::SNode(){
init();
}
SNode::~SNode(){
init();
}
SNode::SNode(char* k, size_t len... |
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "lista.h"
#include "cmdline.h"
#include "BlockChainStatus.h"
#include "BlockChainFileManager.h"
#include "BlockChainManager.h"
#include "Transaction.h"
using namespace std;
static istream* iss = 0;
static ostream* o... |
#include "stdafx.h"
#include "Credits_UI.h"
Credits_UI::Credits_UI()
{ }
Credits_UI::~Credits_UI()
{
RemoveFromEvent();
}
void Credits_UI::Initialize( ID3D11Device* device, ID3D11DeviceContext* contex, ConstantBuffer<CB_VS_matrix_2D>* cb_vs_matrix_2d, std::shared_ptr<Fonts> fonts )
{
AddtoEvent();
UI::Initialize(... |
#include <stdio.h>
#include <io.h>
#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
// readrand.cpp
#ifndef byte
typedef unsigned char byte;
#endif
/* --------------------------------------------------------------------- */
inline bool LeadZeros(unsigned x, int i)
{
if(i<1... |
/*-----------------------------------------------------------------------------
* $RCSfile: DCOMDllGEtDSService.c,v $
*
* See Copyright for the status of this software.
*
* The OpenSOAP Project
* http://opensoap.jp/
*-----------------------------------------------------------------------------
*/
/* ... |
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <memory>
#include <iomanip>
#include <numeric>
#include <functional>
#include <new>
#include <algorithm>
#include <cmath>
#include <cstring>... |
/*
* Space Arcade Game
* Copyright (C) 2018 <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, ... |
/* Starshatter OpenSource Distribution
Copyright (c) 1997-2004, Destroyer Studios LLC.
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 t... |
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
/**
* @brief Implementation of a Wrapper class to abstract GLFW Nyx_Windows
*
* @file Nyx-Window.cpp
* @author <NAME>
* @date 2018-04-14
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++... |
#include <stddef.h>
#include <algorithm>
#include <set>
#include <queue>
#include <deque>
#include <iostream>
#include "node.hh"
int visited;
struct NodeComparator
{
bool operator()(const Node* l, const Node* r) const
{
if (l -> getFCost() == r -> getFCost())
return l -> getDepth() > r -> getDep... |
#include <chrono>
#include <unistd.h>
#include <cstring>
#include <fstream>
#include <pthread.h>
#include <poll.h>
#include "psdaq/hsd/Validator.hh"
#include "DataDriver.h"
#include "xtcdata/xtc/Dgram.hh"
static FILE* f = 0;
static unsigned _seconds=0;
static unsigned _nrxflags=0;
static bool _lverbose = false;
s... |
#pragma once
#include <FastLED.h>
#include <WiFiNINA.h>
#include "../ArduinoSort.hpp"
#include "../Color.hpp"
#include "../Logger.hpp"
#include "../consts.hpp"
#include "../util.hpp"
struct Bar {
Color color = Color();
int len = 0;
int offset = 0;
int start = 0;
int end = 0;
int endTime = 0;
Bar(Color... |
#include <conio.h>
#include <cstdio>
#include <iostream>
#include <string.h>
#include <cstdlib>
using namespace std;
static int t = 0;
class a
{
char bus_number[5], bus_driver[10], bus_arrival[5], bus_depart[5], b_from[10], b_to[10], bus_seat[8][4][10];
public:
void add_new_number_of_bus();
void reser... |
#include "src/gui_core/ScanBufferDraw.h"
#include <SDL.h>
#include <SDL_mutex.h>
#include <SDL_thread.h>
#include <iostream>
#include <app/app_start.h>
using namespace std;
// Two-thread rendering stuff:
SDL_mutex* gDataLock = nullptr; // Data access semaphore, for the read buffer
SDL_Window* window; /... |
#include "renderer/Font.hpp"
#include "renderer/RenderContext.hpp"
#include "renderer/ShaderManager.hpp"
#include "renderer/CameraDirector.hpp"
#include "renderer/Texture.hpp"
#include "renderer/TextureManager.hpp"
extern RenderContext g_renderContext;
extern CameraDirector g_cameraDirector;
static const int CHAR_WI... |
#include <stdlib.h>
#include <string.h>
#include <mkbktr.hpp>
#include <mkbktr/aes.hpp>
#include <mkbktr/util/log.hpp>
/* Allocate a new context. */
aes_ctx_t *new_aes_ctx(const uint8_t *key, unsigned int key_size,
aes_mode_t mode) {
aes_ctx_t *ctx;
if ((ctx = static_cast<aes_ctx_t *>(mall... |
//
// Created by <NAME> on 27.11.18.
//
#define STOP_COMPUTATION_EARLY
#include "Iterator.h"
#include <vector>
#include <iostream>
#include "City.h"
#include "Vertex.h"
#include <cmath>
using namespace std;
Iterator::Iterator(float eta_goal, int iter_max, float alpha, float beta, float k){
this->eta_goal = eta... |
#include "SSD1306.h"
#include <Arduino.h>
SSD1306::SSD1306() {
memset(buffer, OLED_BUFFER_SIZE, 0);
}
void SSD1306::setPixel(int16_t x, int16_t y) {
uint16_t idx = x + (y / 8) * OLED_WIDTH;
uint8_t bit = y % 8;
buffer[idx] |= (1 << bit);
}
void SSD1306::clearPixel(int16_t x, int16_t y) {
uint16_t idx = x ... |
// SPDX-License-Identifier: MIT
#include "llvm/Pass.h"
#include "llvm/IR/Function.h"
#include "llvm/Transforms/IPO/PassManagerBuilder.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/ADT/Twine.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/Instructions.h"
#include "llvm/Transforms/Utils/ValueMapper.h"
#inclu... |
/*
Copyright (c) 1999 - 2010, Vodafone Group Services Ltd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of condit... |
// SPDX-License-Identifier: GPL-3.0-only
// This file is part of Jadette.
// Copyright (C) 2020-2021 <NAME>
// Distributed under GNU General Public License v3.0
// See gpl-3.0.txt or <https://www.gnu.org/licenses/>
#include "pch.h"
#include "Shadow_map.h"
#include "Commands.h"
#include "util.h"
#include "View.h"
#inc... |
#include "stdafx.h"
#include "FileCatalog.h"
#include "stdlib.h"
#include "time.h"
int rand(int LowValue, int HighValue)
{
return rand() % (HighValue - LowValue + 1) + LowValue;
}
char *RandomWord(char Begin, char End, uint MinLength, uint MaxLength)
{
uint Length = rand(MinLength, MaxLength);
char *Result = new c... |
#include <Arduino.h>
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "menu.h"
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
... |
#include <iostream>
#include <thread>
#include <chrono>
#include "Controller.h"
#include "Utility/Utility.h"
#include "Utility/Logger.h"
#include "Network/NetworkError.h"
#include "Core/Message/Parse/ParseError.h"
#include "Core/Message/Parse/GameConfigMessage.h"
#include "Core/Message/Parse/CurrentStateMessage.h"
#i... |
/*
* Copyright (c) 2017 <NAME> <<EMAIL>>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCL... |
#include "stdafx.h"
#include "base64.h"
#include "Singleton.h"
#include "HttpClient.h"
Http::HttpClient::HttpClient( boost::asio::io_service& io_service,
const std::string& server,
const std::string& port,
const std::string& path,
const std::string& data ):
resolver_( io... |
#include "operation.h"
#include "constant.h"
#include "fps.h"
Operation::Operation(VideoCapture &capture) : capture(capture) {
setFrameSize(Point2d(capture.get(CAP_PROP_FRAME_WIDTH), capture.get(CAP_PROP_FRAME_HEIGHT)));
setCenterOfCapture(Point2d(getFrameSize().x / 2, getFrameSize().y / 2));
setFrameCoun... |
#include "funset.hpp"
#include <iostream>
#include "spdlog/spdlog.h"
#include "spdlog/fmt/ostr.h"
// Blog: http://blog.csdn.net/fengbingchun/article/details/78347105
namespace spd = spdlog;
int test_spdlog_console()
{
try {
// Console logger with color
auto console = spd::stdout_color_mt("console");
console->... |
//Copyright 2013 <NAME> <<EMAIL>>
//
//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, distr... |
#include <SVAutoCalib.hpp>
#include <opencv2/stitching/detail/motion_estimators.hpp>
#include <opencv2/stitching/detail/matchers.hpp>
#include <opencv2/stitching/detail/camera.hpp>
#include <iostream>
bool SVAutoCalib::calibrate(const std::vector<cv::Mat>& imgs, const bool savedata)
{
if (isInit){
std::cerr << "... |
#include "graph.hpp"
#include "clustering.hpp"
auto centroid(const Map& map, Locations locs) -> Building {
return find_nearest_building(map, barycenter(locs));
}
auto find_nearest_building(const Map& map, Location loc) -> Building {
return *std::min_element(map.buildings().begin(), map.buildings().end(),
... |
/*
***********************
––––– EXERCISE 8 ––––––
***********************
<NAME>, 886810
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Laboratorio di Simulazione Numerica
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
#include <iostream>
#include <fstream>
#include <ostream>
#include <cmath>
#include <iomanip>
#include "VC... |
// pick specified lines from such a number of csv files
// author: victor.li
// date: 2015/01/18
// version: 1.0.0
#include "stdafx.h"
#include <afx.h>
#include <locale.h>
#include <direct.h>
#include "target.h"
#define MAX_CSV_LINE 1000
#define SPECIFIED_POSITION 14
using namespace std;
void read_file(vector<CStrin... |
/*
* md5mesh.c -- md5mesh model loader + animation
* last modification: aug. 14, 2007
*
* Doom3's md5mesh viewer with animation. Mesh portion.
* Dependences: md5model.h, md5anim.c.
*
* Copyright (c) 2005-2007 <NAME>
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this so... |
#include "ros/ros.h"
#include <iostream>
#include <cstdio>
#include <opencv2/opencv.hpp>
#include <cv_bridge/cv_bridge.h>
#include "sensor_msgs/Image.h"
#include <vision_msgs/Detection2DArray.h>
#include <vision_msgs/Detection2D.h>
#include <image_transport/image_transport.h>
// For Yolov4-tiny
/*static const std... |
#include "Constants.hpp"
#include <array>
// actual midi times are computed from midi header ppq
const std::array<int, 20> noteDurations = {
3, // 128th note
6, // 64th
9, // dotted 64th
12, // 32nd
18, // dotted 32nd
24, // 16th
36, // dott... |
// Author(s): <NAME>
// Copyright: see the accompanying file COPYING or copy at
// https://svn.win.tue.nl/trac/MCRL2/browser/trunk/COPYING
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
/// \file lps2torx.... |
#include "Floor.h"
Floor::Floor(int numberRooms, int minWidth, int maxWidth, int minHeight, int maxHeight) {
this->width = (int)rand() % (maxWidth - minWidth) + minWidth;
this->height = (int)rand() % (maxHeight - minHeight) + minHeight;
this->generateRooms(numberRooms);
this->generateConnections();
this->boss = ... |
#include <string>
#include <array>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include "chessmove.hpp"
#include "BoardRules.h"
#include "json.hpp"
#include "PGNUtils.h"
using namespace nlohmann; //trying this
using namespace std;
using namespace thc;
int toIndex(const char* square) {
int col=tou... |
/*
SharpIR
Arduino library for retrieving distance (in cm) from the analog GP2Y0A21Y and GP2Y0A02YK
From an original version of Dr. <NAME> (<EMAIL>)
Version : 1.0 : <NAME>
+ Remove average and use median
+ Definition of number of sample in .h
+ Define IR pin as input
Version : 1.1 : Thi... |
// students_t_example2.cpp
// Copyright <NAME> 2006.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
// Example 2 of using Student's t
// A general guide to Student's t is at... |
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2010-2017, ITU/ISO/IEC
* All rights reserve... |
#include <fstream>
#include <iostream>
#include <array>
#include <vector>
#include <set>
#include <algorithm>
#include <map>
#include <unordered_map>
/* SCOTS header */
#include "scots.hh"
/* ode solver */
#include "RungeKutta4.hh"
/* time profiling */
#include "TicToc.hh"
/* memory profiling */
#include <ctime>
#inc... |
/*************************************************************************
* Copyright (C) [2019] by Cambricon, 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 a... |
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "ProguardPrintConfiguration.h"
#include "ProguardReporting.h"
#include <iostream>
#include <sstream>
std::string show_k... |
/*=========================================================================
*
* Copyright NumFOCUS
*
* 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.or... |
#include <sys/inotify.h>
#include <errno.h>
#include <unistd.h>
#include <iostream>
#include "shader.hpp"
#include "glsl_shader_includes.hpp"
#define EVENT_SIZE ( sizeof (struct inotify_event) )
#define EVENT_BUF_LEN ( 1024 * ( EVENT_SIZE + 16 ) )
void check_inotify_errors(int return_value) {
if (return_value... |
/*
* This file is a part of imagestego library.
*
* Copyright (c) 2020-2021 <NAME> <<EMAIL>>
*
* 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 li... |
/*******************************************************************************
* Copyright 2020 FUJITSU 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.apa... |
// -*- C++ -*-
//
// ----------------------------------------------------------------------
//
// <NAME>, U.S. Geological Survey
//
// This code was developed as part of the Computational Infrastructure
// for Geodynamics (http://geodynamics.org).
//
// Copyright (c) 2010-2017 University of California, Davis
//
// See ... |
#include <memory>
#include "google/protobuf/compiler/code_generator.h"
#include "google/protobuf/compiler/plugin.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/descriptor.pb.h"
#include "upbc/common.h"
namespace upbc {
namespace {
namespace protoc = ::google::protobuf::compiler;
namespace prot... |
#include "MutableString.h"
#include "../global.h"
#include "../unicode.h"
#include "ScriptObjects.h"
unsigned int MutableStringType;
unsigned int FileMappingType;
unsigned int MutableImageType;
void MyOpenFileMapping(ScriptValue &s, ScriptValue *args) {
wchar_t *name = UTF8toUTF16Alloc(args->stringVal->value);
if ... |
#include "stdafx.h"
#include "alife_space.h"
#include "hit.h"
#include "ode_include.h"
#include "bone.h"
#include "../xrNetServer/net_utils.h"
#include "xrMessages.h"
#include "Level.h"
#include "script_game_object.h"
SHit::SHit(float aPower,Fvector &adir,CObject *awho, u16 aelement, Fvector ap_in_bone_space, float a... |
/*
** Filename: test_binary.cpp
**
** Test conversion of Nary operators to binary operators
*/
#include "boolexprtest.hpp"
class BX_Binary_Test: public BoolExpr_Test {};
TEST_F(BX_Binary_Test, BinifyAtoms)
{
ops[0] = BX_ToBinary(&BX_Zero);
EXPECT_EQ(ops[0], &BX_Zero);
ops[1] = BX_ToBinary(xs[0]);
... |
#include "leetcode.hpp"
/* 1206. 设计跳表
不使用任何库函数,设计一个跳表。
跳表是在 O(log(n)) 时间内完成增加、删除、搜索操作的数据结构。跳表相比于树堆与红黑树,其功能与性能相当,并且跳表的代码长度相较下更短,其设计思想与链表相似。
例如,一个跳表包含 [30, 40, 50, 60, 70, 90],然后增加 80、45 到跳表中,以下图的方式操作:
https://assets.leetcode.com/uploads/2019/09/27/1506_skiplist.gif
<NAME> [CC BY-SA 3.0], via Wikimedia Commons
跳表中... |
// Copyright (c) 2015-2018 <NAME> (at gmail dot com)
// This file is distributed under the MIT License.
#include "ofp/sys/connection.h"
#include "ofp/echoreply.h"
#include "ofp/echorequest.h"
#include "ofp/message.h"
#include "ofp/sys/engine.h"
using namespace ofp;
using namespace ofp::sys;
const Milliseconds kKeep... |
// "Copyright [year] <Copyright Owner>"
// Created by mrbgn on 3/22/21.
//
#include <Server.hpp>
// This function produces an HTTP response for the given
// request. The type of the response object depends on the
// contents of the request, so the interface requires the
// caller to pass a generic lambda for receiving... |
/* The Image Registration Toolkit (IRTK)
*
* Copyright 2008-2015 Imperial College London
*
* 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... |
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "Test.h"
#include "TestClassDef.h"
#include "SkMath.h"
#include "SkPoint.h"
#include "SkScalar.h"
/*
Duplicates lots of code from gpu/src/GrPathUtils.cpp
It'd ... |
/*
Copyright (c) 2015 Arduino LLC. All right reserved.
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 the License, or (at your option) any later version.
T... |
/*
* sample_benchmark_future_poll.cpp
*
* Created on: 2020-05-08
* Author: owent
*
* Released under the MIT license
*/
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <inttypes.h>
#include <stdint.h>
#include <vector>
// include manager header file
#include <libcopp/f... |
#include <stdlib.h>
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofSetFrameRate( 44 );
//zero our DMX value array
memset( dmxData_, 0, DMX_DATA_LENGTH );
//open the device
dmxInterface_ = ofxGenericDmx::createDevice(DmxDevice::DMX_DEVICE_RAW);
bool o... |
//
// c4QueryTest.hh
// LiteCore
//
// Created by <NAME> on 8/3/18.
// Copyright © 2018 Couchbase. All rights reserved.
//
#pragma once
#include "c4Test.hh"
#include "c4Query.h"
#include "c4Index.h"
#include "c4.hh"
#include "c4Document+Fleece.h"
#include "StringUtil.hh"
#include <iostream>
using namespace std;
... |
#include "linear_shape_function.h"
using namespace M2DO_FEA ;
LinearShapeFunction :: LinearShapeFunction () {
spacedim = dim = -1 ;
}
LinearShapeFunction :: LinearShapeFunction (int spacedim, int dim) : spacedim (spacedim), dim (dim) {
// eta_values = MatrixXd::Constant(pow(2, spacedim), spacedim, -1) ;
eta_va... |
// Copyright 2017 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 "garnet/bin/ui/sketchy/stroke/stroke_fitter.h"
#include "src/lib/fxl/logging.h"
namespace {
constexpr float kEpsilon = 6e-6;
constexpr float kE... |
#pragma once
#include <blockchain/Types.hpp>
#include <fc/uint128.hpp>
namespace hsrcore {
namespace blockchain {
struct Price;
/**
* An asset is a 64-bit amount of shares, and an
* asset_id specifying the type of shares.
*/
struct Asset
{
... |
/* Copyright (c) 2003-2005 MySQL AB
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; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHO... |
// Copyright (c) 2019 The Zelantus Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include "assetsnapshotdb.h"
#include "validation.h"
#include "base58.h"
#include <boost/algorithm/string.hpp>
#include <boost/t... |
// File: qtmainwindow.cpp
// Copyright: Copyright(C) 2013-2017 Wuhan KOTEI Informatics Co., Ltd. All rights reserved.
// Website: http://www.nuiengine.com
// Description: This code is part of NPlan Project (Powered by NUI Engine)
// Comments:
// Rev: 1
// Created: 2018/8/27
// ... |
#include <llvm/IR/DebugInfo.h>
#include <llvm/IR/Function.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/IRBuilder.h>
#include <llvm/Pass.h>
#include <llvm/Support/Debug.h>
#include <list>
#define DEBUG_TYPE "cheetah::boundscheck"
using namespace llvm;
namespace {
struct BoundsCheck : public FunctionPass {
... |
/*
* Copyright 2009-2017 Alibaba Cloud 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... |
#include <fesvr/elf.h>
#include <fesvr/memif.h>
#include "sim_spike.h"
#include "msim_helper.h"
#include <vpi_user.h>
#include "svdpi.h"
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <string>
#include <memory>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <assert.h>
#in... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.