text
stringlengths
5
1.04M
#include "z80/cpu.hpp" void Z80::CPU::xor_a() { uint8_t v = REGISTER(REG_AF).getUpper(); v ^= v; REGISTER(REG_AF).setUpper(v); this->setFlags( ZERO_FLAG ); this->clearFlags( CARRY_FLAG | SUBTRACT_FLAG | HALFCARRY_FLAG ); this->incrementPC(1); this->clock.incrementMachineCycles(1); }
/* * SPDX-License-Identifier: MIT * * Copyright (c) 2021 Bart Bilos * For conditions of distribution and use, see LICENSE file */
// // Copyright (c) 2013-2021 The SRS Authors // // SPDX-License-Identifier: MIT or MulanPSL-2.0 // #ifndef SRT_TO_RTMP_H #define SRT_TO_RTMP_H #include <srs_core.hpp> #include <memory> #include <string> #include <thread> #include <queue> #include <map> #include <mutex> #include <condition_variable> #include <srs_ke...
#include <iostream> #include "hwork221219.h" using namespace std; namespace hwork221219 { void task16051() { int number = 0; int minDigit = INT_MAX; int amount = 0; while (number != 0) { int digit = number % 10; if (digit % 2 == 0 && digit < minDigit) { minDigit = digit; } if (digit % 2...
//===-test_xor2d_dnnl.cc-----------------------------------------------------------===// // // Copyright (C) 2019-2020 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 ...
/* Copyright (c) 2009-2016, Jack Poulson All rights reserved. This file is part of Elemental and is under the BSD 2-Clause License, which can be found in the LICENSE file in the root directory, or at http://opensource.org/licenses/BSD-2-Clause */ #ifndef EL_TWOSIDEDTRMM_UNBLOCKED_HPP #define EL_TWOSID...
// Copyright 2018 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 "peridot/lib/module_manifest/module_facet_reader_impl.h" #include "lib/cmx_facet_parser/cmx_facet_parser.h" #include "lib/fsl/io/fd.h" #include "...
// Copyright (c) 2019 PaddlePaddle 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 // // Unless required...
/* Copyright 2005-2015 Intel Corporation. All Rights Reserved. This file is part of Threading Building Blocks. Threading Building Blocks is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundat...
#include <iostream> #include <ostream> #include <sstream> #include <thread> #include <memory> #include <cstddef> #include "SomeClass.h" using namespace std; struct SomeStruct { int Value; }; namespace Value { thread_local SomeStruct ThreadLocalSomeStruct = {}; static SomeClass g_staticSomeClass = SomeClass(20, ...
#include "stdafx.h" #include "vkTextureUtils.h" namespace vkTextureUtils { struct TextureFormatPairs { D3DFORMAT m_dx9FMT; DXGI_FORMAT m_vkFMT; }; TextureFormatPairs TextureFormatList[] = { { D3DFMT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, //D3DFMT_R8G8B8 Not available { D3DFMT_A8R8G8B8, DXGI_FORMAT_R8G8B8A8_...
#include "CCRiftInstance.h" #include "CCRiftCommons.h" #include "CCRiftScene.h" #include "CCRiftGLFWPreviewDevice.h" using namespace CCRift; CCRiftInstance::CCRiftInstance(const tmInstance* inInstance, const SDKDevicePtr& inDevice, const SDKSettings& inSettings, const SDKSuites& inSuites, GLFWPreviewDevice* previ...
#include<iostream> using namespace std; int main(){ float c[1001] = {0}; int m, n, t; float num; scanf("%d",&m); while(m--){ scanf("%d%f",&t,&num); c[t] += num; } scanf("%d",&n); while(n--){ scanf("%d%f",&t,&num); c[t] += num; } int...
// Copyright 2016 The Chromium 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 "content/browser/media/media_devices_permission_checker.h" #include <utility> #include <vector> #include "base/bind.h" #include "base/command_l...
// This file is part of OpenCV project. // It is subject to the license terms in the LICENSE file found in the top-level directory // of this distribution and at http://opencv.org/license.html. #ifndef __OPENCV_TEST_PRECOMP_HPP__ #define __OPENCV_TEST_PRECOMP_HPP__ #include "opencv2/ts.hpp" #include "opencv2/im...
#ifdef _DEBUG #include "imgui/imgui.h" #include "imgui/imgui_impl_dx11.h" #include "imgui/imgui_impl_win32.h" #include "imgui/imgui_stdlib.h" #include "imgui//IconsFontAwesome5_c.h" #include "My_imgui.h" #include "imgui/ImGuizmo.h" #include "imgui/imgui_internal.h" ImVec2 operator+(const ImVec2& lhs, const ImVec2...
// Copyright 2021 Lawrence Livermore National Security, LLC and other ExaCA Project Developers. // See the top-level LICENSE file for details. // // SPDX-License-Identifier: MIT #ifndef EXACA_PRINT_HPP #define EXACA_PRINT_HPP #include "CAtypes.hpp" #include <Kokkos_Core.hpp> #include <string> void PrintGrainIDsFor...
//===- MCJITObjectCacheTest.cpp - Unit tests for MCJIT object caching -----===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
// This file is part of snark, a generic and flexible library for robotics research // Copyright (c) 2011 The University of Sydney // 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. R...
// (C) Copyright Gennadiy Rozental 2001-2005. // 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) // See http://www.boost.org/libs/test for the library home page. // // File : $RCSfile: test_exec_monit...
#include<bits/stdc++.h> #define rec(i,x) for(int i=0;i<x;i++) #define MAXN 200005 #define INF 0x3f3f3f3f #define LL long long #define ll long long #define P pair<double,int> using namespace std; template<typename TI> struct BitOp{ //返回:反转pos开始,往右长度为len的区域 inline TI flip(TI op,size_t pos,size_t len=1){return op^((...
// ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_DinoCharacterStatusComponent_BP_Direbear_parameters.hpp" namespace sdk { //--------------------------------------------------------------------------- //Functions //-----------------------------------------...
/* * TLogServer.actor.cpp * * This source file is part of the FoundationDB open source project * * Copyright 2013-2018 Apple Inc. and the FoundationDB project 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...
// Copyright (C) 2019. Huawei Technologies Co., Ltd. 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 the rights to ...
//============================================================================== // Copyright 2003 - 2011 LASMEA UMR 6602 CNRS/Univ. Clermont II // Copyright 2009 - 2011 LRI UMR 8623 CNRS/Univ Paris Sud XI // // Distributed under the Boost Software License, Version 1.0. // Se...
/** @file utf8itor.cc * @brief iterate over a utf8 string. */ /* Copyright (C) 2006,2007,2010,2013,2015 Olly Betts * * 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...
////////////////////////////////////////////////////////////////////////// // // Copyright (c) 2015, Image Engine Design 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: // // * R...
#include "common/http/http1/codec_impl.h" #include <cstdint> #include <memory> #include <string> #include "envoy/buffer/buffer.h" #include "envoy/http/codec.h" #include "envoy/http/header_map.h" #include "envoy/network/connection.h" #include "common/common/enum_to_int.h" #include "common/common/utility.h" #include "...
/* dasum.f -- translated by f2c (version 20010320). You must link the resulting object file with the libraries: -lf2c -lm (in that order) */ #include <math.h> double mndasum(unsigned int n, const double* dx, int incx) { /* System generated locals */ int i__1, i__2; double ret_val, d__1, d__2, d__3, ...
#include <iostream> #include "book.h" #include "library.h" using namespace std; int main(){ const Book booky1("me", "A life worth lived", 1993); const Book booky2("you", "A life Part II", 1997); const Book booky3("us", "It's fucked up", 2020); Library lib(3); lib.addBook(booky1); lib.add...
// License: Apache 2.0. See LICENSE file in root directory. // Copyright(c) 2020-2021 Intel Corporation. All Rights Reserved. #include "RealSenseID/FaceAuthenticator.h" #include <iostream> #include <stdio.h> class MyEnrollClbk : public RealSenseID::EnrollmentCallback { public: void OnResult(const RealSenseID::Enr...
// // Created by artem on 26.03.2022. // #include "ConvolutionOperation.h" #include <iostream> ConvolutionOperation::ConvolutionOperation() = default; std::vector<std::vector<Pixel> > ConvolutionOperation::ApplyConvolution(const std::vector<std::vector<Pixel>> &input) const { int image_height = stati...
/****************************************************************************** * * Project: OGR * Purpose: Implements OGRAVCE00DataSource class. * Author: Frank Warmerdam, warmerdam@pobox.com * James Flemer <jflemer@alum.rpi.edu> * ******************************************************************...
#include "ShaderStorageBuffer.h" #include "GlobalDeviceObjects.h" bool ShaderStorageBuffer::Init(const std::shared_ptr<Device>& pDevice, const std::shared_ptr<ShaderStorageBuffer>& pSelf, uint32_t numBytes) { VkBufferCreateInfo info = {}; info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; info.usage = VK_BUFFER_USA...
// Boost.Geometry (aka GGL, Generic Geometry Library) // Unit Test // Copyright (c) 2014, Oracle and/or its affiliates. // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Licensed under the Boost Software License version 1.0. // http://www.boost.org/users/license.html #ifndef B...
/****************************************************************************** ** Filename: fpoint.c ** Purpose: Abstract data type for a 2D point (floating point coords) ** Author: Dan Johnson ** History: Thu Apr 12 10:44:15 1990, DSJ, Created. ** ** (c) Copyright Hewlett-Packard Company, 1988. ...
// Copyright 2013 The Chromium 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 "chrome/browser/ui/app_list/search/common/webservice_cache.h" #include <stddef.h> #include <stdint.h> #include "base/memory/ptr_util.h" #includ...
// (C) Copyright John Maddock 2007. // 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) #include <boost/math/bindings/rr.hpp> #include "ntl_rr_digamma.hpp" #include <boost/...
/** * Copyright 2020 Huawei Technologies 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 * * Unless required by applicable law...
#include <algorithm> #include <fstream> #include <regex> #include <unordered_map> #include "envoy/admin/v2alpha/memory.pb.h" #include "envoy/admin/v2alpha/server_info.pb.h" #include "envoy/json/json_object.h" #include "envoy/runtime/runtime.h" #include "envoy/stats/stats.h" #include "common/http/message_impl.h" #incl...
#include "json.h" #include "standard-release/semver/semver.h" #include <filesystem> #include <fstream> #include <iostream> #include <regex> #include <sstream> #include <system_error> using namespace StandardRelease; static const std::string JSON_FIELD = "\"version\": \"([^\"]+)\""; struct StandardRelease::JsonFilePr...
// Copyright (c) 2005-2014 Code Synthesis Tools CC // // This program was generated by CodeSynthesis XSD, an XML Schema to // C++ data binding compiler. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License version 2 as // published by the Fre...
#include "Ht.h" #include "PersTest00.h" void CPersTest00::PersTest00() { if (PR2_htValid) { switch (PR2_htInst) { case TEST00_ENTRY: { HtContinue(TEST00_WR); break; } case TEST00_WR: { GW2_test00_0_src_v0_data.write_addr(8, 14); GW2_test00_0_src_v0_data = ((uint32_t)0x0005bedda4786260LL); P2_te...
// 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 may...
/* * Copyright 1999-2000,2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unle...
#ifdef USE_OPENCV #include <opencv2/core/core.hpp> #endif // USE_OPENCV #include "caffe/common.hpp" #include "caffe/layer.hpp" #include "caffe/util/benchmark.hpp" #include "caffe/util/io.hpp" #include "caffe/layers/cpm_data_layer.hpp" namespace caffe { template <typename Dtype> CPMDataLayer<Dtype>::CPMDataLayer(con...
#include "stdafx.h" #include "actor.h" #include "Actor_Flags.h" #include "inventory.h" #include "xrserver_objects_alife_monsters.h" #include "xrServer.h" #include "CameraLook.h" #include "CameraFirstEye.h" #include "ActorEffector.h" #include "PHWorld.h" #include "level.h" #include "xr_level_controller.h" #include "g...
#include <bits/stdc++.h> using namespace std; void addEdge(vector<int> adj[], int u, int v) { adj[u].push_back(v); adj[v].push_back(u); } void displayGraph(vector<int> adj[], int v) { for (int i = 0; i < v; i++) { for (auto &&j : adj[i]) cout << j << " "; c...
// Copyright 2013 The Chromium 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 "chrome/browser/ash/policy/external_data/cloud_external_data_manager_base_test_util.h" #include <utility> #include "base/callback.h" #include "...
// Copyright 2021 The Chromium 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 "components/history_clusters/core/noisy_cluster_finalizer.h" #include "components/history_clusters/core/on_device_clustering_features.h" #includ...
// // Created by danie on 23/12/2020. // #include <iostream> #include <cstring> #include "compito.h" using namespace std; ToDoList::ToDoList() { p0 = 0; } void ToDoList::aggiungi(const char *description, unsigned int priority) { if (description == NULL || priority < 1 || strlen(description) > MAX_DIM_DESC)...
#include "gtest/gtest.h" #include "z5/s3/handle.hxx" namespace z5 { // fixture for the handle test class HandleTest : public ::testing::Test { protected: HandleTest(){} ~HandleTest(){ } void SetUp() { } void TearDown() { } }; TEST_F(Han...
// Copyright (C) 2018-2021 Intel Corporation // SPDX-License-Identifier: Apache-2.0 // #include <future> #include "behavior/ov_infer_request/cancellation.hpp" #include "openvino/runtime/exception.hpp" namespace ov { namespace test { namespace behavior { std::string OVInferRequestCancellationTests::getTestCaseName(c...
#include <stdio.h> int main(int argc, const char *argv[]) { printf("hello world\n"); return 0; }
// Copyright 2015 MongoDB 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 wri...
// NewFileDlg.cpp #include "stdafx.h" #include "resource.h" #include "NewFileDlg.h" /* static */ bool CNewFileDlg::m_bBraille2 = true; /* static */ int CNewFileDlg::m_nExt = 0; LRESULT CNewFileDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { CenterWindow(); // Set some default info. ...
/* * Copyright 2010-2017 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" fil...
#include "LearnOpenGL_GLFW/Sen_06_TrianglesGLFW.h" #include "LearnOpenGL_GLFW/Sen_07_TextureGLFW.h" #include "LearnOpenGL_GLFW/Sen_09_ModelViewProjection.h" #include "LearnOpenGL_GLFW/Sen_10_Camera.h" //#include "LearnOpenGL_GLFW/Sen_21_AssimpMeshModel.h" #include "LearnOpenGL_GLFW/Sen_22_DepthTest.h" #include "LearnOp...
/** * DeepDetect * Copyright (c) 2014-2015 Emmanuel Benazera * Author: Emmanuel Benazera <beniz@droidnik.fr> * * This file is part of deepdetect. * * deepdetect 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 Softw...
/* * 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 option) any later version. * * This program is distributed in the hope that it will be use...
#include "ros/ros.h" #include "geometry_msgs/Twist.h" #include "std_msgs/String.h" #include <sstream> #include <iostream> #include <string.h> using namespace std; // Topic messages callback void chatterCallback(const std_msgs::String::ConstPtr& msg) { ROS_INFO("[Listener] I heard: [%s]\n", msg->data.c_str())...
// Copyright (c) 2013-2015 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. // Unit tests for alert system #include "alert.h" #include "chain.h" #include "chainparams.h" #include "clientversion.h" #in...
/* The Internet Filter Version 3 Kernel Version 3 Source Code Written By Jeff Koftinoff <jeffk@internetfilter.com> Copyright (c) 1995-2005 By Turner and Sons Productions, Inc. http://www.internetfilter.com/ ALL RIGHTS RESERVED. */ #ifndef IF3_WORLD_HPP #define IF3_WORLD_HPP #ifndef IF3_WORLD_PRECOMPILED_HPP #inc...
// // // /// @brief Calculates the trace of the current rank two array if it /// is square and was previously initialized either by construction /// or the array::create() member function. Otherwise returns zero. // /// @return A numerical data with the same type of the array. // data_type trace() { data_type trace(0....
#include <iostream> extern "C" { #include "bar.h" #include "zingo.h" } int main() { if( bar() == 42*42 ) std::cout << "ok" << std::endl; else std::cout << "failed" << std::endl; if( zingo() == 41*42 ) std::cout << "ok" << std::endl; else std::cout << "failed" << std::endl; }
#include <CoreLib/UString.h> #include <cassert> using namespace JxCoreLib; void TestString() { string s("a word 一个字"); assert(StringUtil::Length(s) == 10); u8char c = StringUtil::CharAt(s, 9); assert(c == u8char{ "字" }); StringIndexMapping mapping(s, 2); // use cache u8char c2 = StringUtil:...
//C- -*- C++ -*- //C- ------------------------------------------------------------------- //C- DjVuLibre-3.5 //C- Copyright (c) 2002 Leon Bottou and Yann Le Cun. //C- Copyright (c) 2001 AT&T //C- //C- This software is subject to, and may be distributed under, the //C- GNU General Public License, either Version 2 of ...
/* * Copyright (c) 2019-2022, Adam Chyła <adam@chyla.org>. * All rights reserved. * * Distributed under the terms of the BSD 3-Clause License. */ #pragma once #include <string_view> namespace omtt::expectation::validation { struct PartialOutputCause { const std::string_view fExpectedPartialOutput; }; }
// Copyright 2003 The Trustees of Indiana University. // Use, modification and distribution is 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) // Shared container iterator adaptor // Author: Ronald Garcia // See htt...
#include "left.h" #include "ui_left.h" #include "main.h" Left::Left(QWidget *parent) : QWidget(parent), ui(new Ui::Left) { ui->setupUi(this); } void Left::updateText(QString pos, QString text, QString inverted) { QString labelIdent = "label_"; labelIdent.append(pos); QLabel* lab...
#include "GameObject.hpp" #include <iostream> namespace mbgl { class TestObject : public GameObject { public: TestObject(std::string name) : GameObject(name) { d_LogIsButtonPressed.Bind(this, &TestObject::LogIsButtonPressed); } void OnCreate() override { ...
/*! * Copyright (C) tkornuta, IBM Corporation 2015-2019 * * 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...
// Clang Build Analyzer https://github.com/aras-p/ClangBuildAnalyzer // SPDX-License-Identifier: Unlicense #include "Utils.h" #ifdef _MSC_VER #define WIN32_LEAN_AND_MEAN struct IUnknown; // workaround for old Win SDK header failures when using /permissive- #include <windows.h> #else #include <unistd.h> #endif static s...
/* +----------------------------------------------------------------------+ | HipHop for PHP | +----------------------------------------------------------------------+ | Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) | | Copyrigh...
// Copyright (c) 2014-2018, The Monero 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: // // 1. Redistributions of source code must retain the above copyright notice, this list of /...
/**************************************************** * Template for coding contests * * Author : Sanjeev Sharma * * Email : thedevelopersanjeev@gmail.com * *****************************************************/ #pragma GCC optimize ("O3") #pragma GCC opt...
#include "taskparts/scheduler.hpp" #include "taskparts/stats.hpp" #include "taskparts/chaselev.hpp" #include "taskparts/machine.hpp" #include "taskparts/logging.hpp" #include "../example/fib_par.hpp" #include "../example/fib_nativefj.hpp" #include "../example/fib_oracleguided.hpp" #include <map> #include <stdio.h> #in...
/********************************************************************** * File: quspline.cpp (Formerly qspline.c) * Description: Code for the QSPLINE class. * Author: Ray Smith * * (C) Copyright 1991, Hewlett-Packard Ltd. ** Licensed under the Apache License, Version 2.0 (the "License"); ** y...
/*** * ==++== * * Copyright (c) Microsoft 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 re...
/* * Created by * Shivani Bhardwaj <shivanib134@gmail.com> */ #include<iostream> using namespace std; long long Merge(long long * a, long long l, long long mid, long long n){ long long p=l,q=mid,i=0,c=0; long long tmp[n-l+1]; while(p<mid && q<=n){ if(a[p]<=a[q]) ...
/////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// /// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documen...
// Problem Statement // We are given a binary tree (with root node root), a target node, and an integer value K. // // Return a list of the values of all nodes that have a distance K from the // target node. The answer can be returned in any order. #include <bits/stdc++.h> using namespace std; /** * Definition for...
/* * This is part of the FL library, a C++ Bayesian filtering library * (https://github.com/filtering-library) * * Copyright (c) 2014 Jan Issac (jan.issac@gmail.com) * Copyright (c) 2014 Manuel Wuthrich (manuel.wuthrich@gmail.com) * * Max-Planck Institute for Intelligent Systems, AMD Lab * University of Souther...
/** \file * Quantum kernel abstraction implementation. */ #include "kernel.h" #include <sstream> #include <algorithm> #include <iterator> #define K_PI 3.141592653589793238462643383279502884197169399375105820974944592307816406L #include "utils/json.h" #include "utils/str.h" #include "utils/vec.h" #include "options...
#include <assert.h> #include <stdlib.h> #include <stdio.h> #include <libelf.h> #include <fcntl.h> #include <unistd.h> #include <iostream.h> #include "cachemire-2.h" #include "cm_memory.h" int load_file(char* file, unsigned long * start_address) { int fp; char name[80]; int main_found = 0; int slave_found = 0;...
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193_char_memcpy_68a.cpp Label Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE193.label.xml Template File: sources-sink-68a.tmpl.cpp */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allo...
#include "filesystem.hpp" #include <fstream> #include <sstream> NOXIS_NS_BEGIN; bool isFileExist(const std::string &path) { std::ifstream testFile(path); auto isOk = testFile.good(); testFile.close(); return isOk; } std::string joinPath(std::initializer_list<std::string> paths) { std::ostringstr...
#pragma once #include <stdint.h> namespace bfos::terminal { using SizeUnit = uint16_t; using Attribute = uint8_t; const int WIDTH = 80; const int HEIGHT = 25; class RawOutput { public: void printChar(char character); void printString(const char *string); void...
#include <swizzle/ast/nodes/Enum.hpp> #include <swizzle/ast/VisitorInterface.hpp> namespace swizzle { namespace ast { namespace nodes { Enum::Enum(const lexer::TokenInfo& enumInfo, const lexer::TokenInfo& name, const std::string& containingNamespace) : enumInfo_(enumInfo) , nameInfo_(name) ...
class X { int i; public: X(int ii = 0) ; void modify(); }; X::X(int ii) { i = ii; } void X::modify() { i++; } int main() { X x; x.modify(); }
/**************************************************************************************** * @author: kzvd4729 created: Jan/21/2018 14:00 * solution_verdict: Accepted language: GNU C++14 * run...
#include "base/colorutil.h" uint32_t whiteAlpha(float alpha) { if (alpha < 0.0f) alpha = 0.0f; if (alpha > 1.0f) alpha = 1.0f; uint32_t color = (int)(alpha*255) << 24; color |= 0xFFFFFF; return color; } uint32_t blackAlpha(float alpha) { if (alpha < 0.0f) alpha = 0.0f; if (alpha > 1.0f) alpha = 1.0f; return (...
// Author: Mingcheng Chen (linyufly@gmail.com) #include "watershed_extractor.h" #include "util.h" #include <vtkStructuredPointsReader.h> #include <vtkStructuredPointsWriter.h> #include <vtkStructuredPoints.h> #include <vtkSmartPointer.h> #include <vtkPointData.h> #include <vtkDataArray.h> #include <vtkIndent.h> #inc...
// Copyright (c) 2017 The University of Sydney #include "../device.h" #include "../orientus/traits.h" #include <comma/application/command_line_options.h> #include <comma/application/verbose.h> #include <comma/csv/options.h> #include <comma/csv/stream.h> #include <comma/io/select.h> using namespace snark::navigation::...
#include "minerva.h" #include <GLFW/glfw3.h> #include "vulkan.h" #include "window/window.h" void MvUpdate() { glfwPollEvents(); Vulkan::Get().drawFrame(); } bool MvShouldWindowClose(Window w) { return glfwWindowShouldClose(w.window); }
// Copyright 2018 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 "fidl/json_generator.h" #include "fidl/names.h" #include "fidl/types.h" namespace fidl { void JSONGenerator::Generate(const flat::Decl* decl) {...
#include <iostream> using namespace std; using ll = int64_t; // Check Nim Game (I and II) readme files to understand the concept int main() { ll T; cin >> T; for (ll cas = 1; cas <= T; cas++) { ll n; cin >> n; ll ans = 0; for (ll i = 0; i < n; i++) { ll x; cin >> x; if (i % 2 =...
// // Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE.md file in the project root for full license information. // // SequenceParser.cpp : Parses the UCI format using a custom state machine (for speed) // #include "stdafx.h" #include <stdexcept> #include <stdint.h> #include...
// Copyright 2021 Tamas Eisenberger <e.tamas@iwstudio.hu> // // 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 a...
#include <iostream> #include <cstdlib> #include <cmath> #include <complex> using std::complex; #ifdef _OPENMP #include <omp.h> #else int omp_get_num_threads() {return 1;} #endif bool almost_equal(complex<double> x, complex<double> gold, float tol) { return std::abs(gold) * (1-tol) <= std::abs(x) && std::abs(x) <= std...