text string | size int64 | token_count int64 |
|---|---|---|
#include "commanddeletetext.h"
#include "cursor.h"
namespace Typeset{
CommandDeleteText::CommandDeleteText(Cursor& cursor, Text* t, QTextCursor cL, QTextCursor cR)
: cursor(cursor),
t(t) {
pL = cL.position();
pR = cR.position();
c = cL;
c.setPosition(cR.position(), QTextCursor::KeepAnchor);... | 760 | 278 |
/*
Copyright (c) 2014 - 2015 Martin Buck
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, pu... | 21,491 | 8,707 |
/*
* Copyright (c) 2012, Michael Lehn
*
* 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,... | 4,970 | 1,901 |
__qpu__ void ccnot(qreg q) {
decompose {
UnitaryMatrix ccnot_mat = UnitaryMatrix::Identity(8, 8);
ccnot_mat(6, 6) = 0.0;
ccnot_mat(7, 7) = 0.0;
ccnot_mat(6, 7) = 1.0;
ccnot_mat(7, 6) = 1.0;
}
(q, QFAST);
}
int main() {
auto q = qalloc(3);
ccnot::print_kernel(q);
return 0;
} | 309 | 164 |
#include"../../../timer.h"
#include<fmt/format.h>
int main()
{
constexpr std::size_t N(200000000);
std::size_t value{};
{
fast_io::timer t("fmt::format_int");
for(std::size_t i{};i!=N;++i)
value+=fmt::format_int(i).str().size();
}
println("value:",value);
} | 267 | 126 |
/*==========================================================================
*
* Copyright (C) 1998-2002 Microsoft Corporation. All Rights Reserved.
*
* File: Locals.cpp
* Content: Global variables for the DNWsock service provider
*
*
* History:
* Date By Reason
* ==== == ======
... | 7,362 | 2,986 |
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
#include "v8api_test_harness.h"
////////////////////////////////////////////////////////////////////////////////
//// Tests
void
test_ArrayConversion()
{
HandleScope handle_scope;
Persistent<Context> conte... | 1,146 | 372 |
/*
* connection.cpp
*
* Created on: Apr 30, 2013
* Author: boettgerj
*/
#include "connection.h"
#include "qmath.h"
Connection::Connection( QVector3D fn, QVector3D diff, float v ) :
fn( fn ),
diff( diff ),
v( v )
{
QVector3D diffn = diff.normalized();
r=qAbs(diffn.x());
g=... | 398 | 169 |
#include <tests/CTestCar.h>
CTestCar::CTestCar(irr::IrrlichtDevice *pDevice, IRunner *pRunner) : IState(pDevice, pRunner) {
m_sName=L"Car Test";
m_sDescr=L"Test with user controlled car";
}
void CTestCar::activate() {
m_pSmgr->loadScene(DATADIR "/scenes/Testbed_car.xml");
m_pCam=m_pSmgr->addCamer... | 4,033 | 1,785 |
#pragma once
#include "surena/game.h"
#include "games/game_catalogue.hpp"
namespace Games {
class Chess : public BaseGameVariant {
public:
Chess();
~Chess();
game* new_game() override;
void draw_options() override;
void draw_state_editor(game*... | 405 | 118 |
#include "GoldenEgg.h"
#include "SpellForceField.h"
#include "Monster.h"
ASpellForceField::ASpellForceField(const class FObjectInitializer& PCIP) : Super(PCIP)
{
ProxSphere = PCIP.CreateDefaultSubobject<USphereComponent>(this, TEXT("ProxSphere"));
ProxSphere->AttachTo( Particles );
Force = 1000;
}
void ASpellForce... | 1,259 | 485 |
#ifndef __UTILITY_WIFI_H
#define __UTILITY_WIFI_H
#include <lwip/inet.h>
class WiFi {
private:
WiFi();
static bool initialized;
static ip4_addr_t ip;
static ip4_addr_t gateway;
static ip4_addr_t subnetmask;
static bool connected;
public:
static bool Connect(const char* ssid, const char* password);
st... | 424 | 167 |
/*
* ConstructorArray.cpp
*
* Created on: 2020/02/12
* Author: iizuka
*/
#include "lang/sc_expression/ConstructorArray.h"
#include "engine/sc_analyze/AnalyzeContext.h"
#include "engine/sc_analyze/AnalyzedType.h"
#include "engine/sc_analyze/AnalyzedThisClassStackPopper.h"
#include "engine/sc_analyze/Validat... | 4,436 | 1,664 |
/*!
* \copy
* Copyright (c) 2009-2013, Cisco Systems
* 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 abo... | 17,124 | 8,100 |
/*
Copyright (C) 2006 Mark Joshi
Copyright (C) 2007, 2008 Eric Ehlers
Copyright (C) 2011 Narinder Claire
This file is part of XLW, a free-software/open-source C++ wrapper of the
Excel C API - https://xlw.github.io/
XLW is free software: you can redistribute it and/or modify it under the
terms of the XLW licen... | 5,962 | 1,578 |
// Autogenerated from CppHeaderCreator on 7/27/2020 3:10:42 PM
// Created by Sc2ad
// =========================================================================
#pragma once
#pragma pack(push, 8)
// Begin includes
#include "utils/typedefs.h"
// Including type: System.Object
#include "System/Object.hpp"
#include "utils/i... | 5,042 | 1,577 |
#include <random>
#include <Eigen/Dense>
#include "HODLR_Tree.hpp"
#include <pybind11/pybind11.h>
#include <pybind11/eigen.h>
#include <squaredeMat.hpp> //squared exponential kernel
#include <squaredeP1Mat.hpp>
using std::normal_distribution;
namespace py = pybind11;
Eigen::MatrixXd predict(Eigen::MatrixXd X, Eigen::... | 2,742 | 1,058 |
/*
This file is part of Bohrium and copyright (c) 2012 the Bohrium
team <http://www.bh107.org>.
Bohrium 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 3
of the License, or (at your option) ... | 4,101 | 1,299 |
/* Shared Use License: This file is owned by Derivative Inc. (Derivative) and
* can only be used, and/or modified for use, in conjunction with
* Derivative's TouchDesigner software, and only if you are a licensee who has
* accepted Derivative's TouchDesigner license or assignment agreement (which
* also govern the ... | 2,094 | 1,165 |
//
// ProcessorBinaryShutdownException.cpp
// elf-loader
//
// Created by Nathan Mentley on 4/29/20.
// Copyright © 2020 Nathan Mentley. All rights reserved.
//
#include <ElfLoader/Core/Exceptions/ProcessorBinaryShutdownException.h>
Core::Exceptions::ProcessorBinaryShutdownException::ProcessorBinaryShutdownExcept... | 426 | 136 |
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the test suite of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
** Licensees holding valid commercia... | 8,950 | 3,216 |
#include <slamtools/configurator.h>
using namespace Eigen;
std::shared_ptr<Configurator> Configurator::default_config() {
static std::shared_ptr<Configurator> s_default_config = std::make_shared<Configurator>();
return s_default_config;
}
Configurator::~Configurator() = default;
// 相机内参数
Matrix3d Configurat... | 2,613 | 1,184 |
/*Index:
@vars
@add
@run
@init
*/
#include "memory.h"
#define DESHI_CMD_START(name, desc) \
deshi__last_cmd_desc = str8_lit(desc); \
auto deshi__cmd__##name = [](str8* args, u32 arg_count) -> void
#define DESHI_CMD_END_NO_ARGS(name) \
; \
cmd_add(deshi__cmd__##name, str8_lit(#name), deshi__last_cmd_desc, 0, 0)
#def... | 16,202 | 6,903 |
/// Source : https://leetcode.com/problems/add-two-numbers/description/
/// Author : Fei
/// Time : Jun-4-2019
#include "../SingleLinkedList.h"
#include "../SingleLinkedList.cpp"
#include <cassert>
using namespace std;
class Solution
{
public:
class Solution {
public:
ListNode* addTwoNumbers(ListNode* l1, List... | 1,628 | 570 |
/**
* @class StdProjectionMatrix
*
* @brief Definition of a Kalman Filter projection matrix. This is used to projected out the measured
* coordinates (and errors) from the state vector (covariance matrix) during the track fits
*
* @author Tracy Usher
*
* $Header: /nfs/slac/g/glast/ground/cvs/TkrRecon/src... | 850 | 355 |
//
// ZEPTO-8 — Fantasy console emulator
//
// Copyright © 2016—2017 Sam Hocevar <sam@hocevar.net>
//
// This program is free software. It comes without any warranty, to
// the extent permitted by applicable law. You can redistribute it
// and/or modify it under the terms of the Do What the Fuck You Want
// to Pu... | 6,923 | 3,164 |
#include <iostream>
#include "../include/mm_file/mm_file.hpp"
int main() {
std::string filename("./tmp.bin");
static const size_t n = 13;
{
// write n uint32_t integers
mm::file_sink<uint32_t> fout(filename, n);
std::cout << "mapped " << fout.bytes() << " bytes "
... | 1,557 | 525 |
#include"epoller.h"
Epoller::Epoller(int maxEvent) :_epollerFd(epoll_create(512)),_events(maxEvent){
assert(_epollerFd >= 0 && _events.size() > 0);
}
Epoller::~Epoller() { close(_epollerFd); }
bool Epoller::addFd(int fd,uint32_t events) {
if(fd < 0) return false;
epoll_event ev = {0};
ev.data.fd = fd;... | 1,130 | 513 |
/***************************************************************************
* JNI
***************************************************************************/
#include "glm/glm.hpp"
#include "glm/gtc/type_ptr.hpp"
#include "objects/components/bone.h"
#include "util/gvr_jni.h"
namespace gvr {
extern "C" {
JNI... | 3,716 | 1,357 |
#include "ToolsModel.h"
#include <QDesktopServices>
#include <QUrl>
ToolsModel::ToolsModel(QObject *parent) : QObject(parent)
{
}
void ToolsModel::openUrl(const QString &url)
{
QDesktopServices::openUrl(QUrl(url));
}
| 225 | 84 |
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <cstring>
using namespace std;
int main()
{
vector<const char * > roster1 { "abc", "def", "ghi"};
list<const char * > roster2 { "abc", "def", "ghi"};
//list<const char * > roster2(roster1.cbegin(), roster1.cend());
boo... | 1,155 | 444 |
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <math.h>
#include <vector>
#include <unordered_map>
#include <string>
#include "fastmath.h"
#include "Vec3.h"
#include "Mat3.h"
//#include "VecN.h"
#include "testUtils.h"
#include "integration.h"
#include "AOIntegrals.h"
//#incl... | 14,883 | 6,375 |
/*
* Copyright (C) 2019 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by app... | 13,759 | 4,298 |
#include <algorithm>
#include <cstddef>
template <std::size_t N>
struct fixed_string {
constexpr fixed_string(const char (&foo)[N + 1]) {
std::copy_n(foo, N + 1, data);
}
auto operator<=>(const fixed_string&) const = default;
char data[N + 1] = {};
};
template <std::size_t N>
fixed_string(const char (&str)[... | 1,341 | 507 |
/*
* ext.cc
*
* Copyright (C) 2013 Diamond Light Source
*
* Author: James Parkhurst
*
* This code is distributed under the BSD license, a copy of which is
* included in the root directory of this package.
*/
#include <boost/python.hpp>
#include <boost/python/def.hpp>
#include <dials/algorithms/background/g... | 1,815 | 641 |
/* This file is distributed under MIT license as part of the project flocksims.
* See LICENSE file for details.
* (c) Simon Grosse-Holz, 2019
*/
# include "State.h"
# include "mathutils.h"
# include <chrono>
# include <cmath>
# include <fstream>
# include <iomanip>
# include <iostream>
# include <random>
# include... | 5,733 | 2,608 |
// Copyright Carl Philipp Reh 2006 - 2019.
// 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)
#ifndef SGE_D3D9_STATE_CORE_DEPTH_STENCIL_DEPTH_VISITOR_HPP_INCLUDED
#define SGE_D3D9_STATE_CORE_DE... | 955 | 394 |
#pragma once
#include <Arduino.h>
#include <Wire.h>
#include <math.h>
#include "SparkFunLSM9DS1.h"
#define LSM9DS1_M 0x1E // Would be 0x1C if SDO_M is LOW
#define LSM9DS1_AG 0x6B // Would be 0x6A if SDO_AG is LOW
// Earth's magnetic field varies by location. Add or subtract
// a declination to get a more accurate... | 1,064 | 443 |
#include "WEMeshInstance.h"
namespace WE {
bool MeshInstance::init(Mesh& mesh, RenderLoadContext& renderLoadContext) {
return mesh.initInstance(*this, renderLoadContext);
}
bool MeshInstance::isInited() {
return mMesh.isValid();
}
/*
bool MeshInstance::hasSkeletonInstance() {
return mSkelIn... | 2,856 | 1,128 |
/**
* @file common/Mutex.hpp
* @brief Defines the Mutex class
*/
#pragma once
#ifdef __SWITCH__
#include <sys/lock.h>
#else
#ifdef __PC__
#include <mutex>
#endif
#endif
namespace id {
/**
* @brief A mutex
*/
class Mutex {
public:
/**
* @brief Creates the m... | 885 | 293 |
// Copyright (c) 2017 Aler Denisov
// 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, di... | 4,840 | 1,782 |
/***********************************************************************
*Copyright 2010-20XX by 7ymekk
*
* 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.apach... | 6,514 | 2,112 |
#include "message.hpp"
namespace network
{
namespace message
{
size_t Message::s_maxsizeUsername = 24;
size_t Message::s_maxsizeMessage = 512;
Message::Message(
const std::string& username,
MessageType msgType,
Team playerTeam,
const std::string& message) noexcept :
m_message(mes... | 1,705 | 677 |
////////////////////////////////////////
////////////////////////////////////////
//
// Copyright (C) 2014 Korovasoft, Inc.
//
// File:
// \file ConcurrentObjects.cpp
//
// Description:
// \brief ConcurrentObjects Library implementation.
//
// Author:
// \author J. Caleb Wherry
//
///////////////////... | 1,191 | 363 |
#include "cfgpull.cfg.h"
#include "cfgpull.h"
#include "../dwhttp.h"
#include "esp_system.h"
#include <esp_log.h>
#ifndef SIM
#include <esp_ota_ops.h>
#include <sdkconfig.h>
#endif
#include <memory>
#include <bearssl_hmac.h>
#include <bearssl_hash.h>
#include "../sd.h"
#include "../common/util.h"
#include "../seri... | 7,261 | 3,235 |
//
// Created by Prajwal Prakash on 24/06/20.
//
#include "LevelManager.h"
#include <filesystem>
#include <fstream>
LevelManager::LevelManager(const char* assets_directory) : m_AssetsDirectory(assets_directory)
{
LoadLevels();
}
void LevelManager::LoadLevels()
{
for (const auto& entry : std::filesystem::dir... | 993 | 317 |
/* Creator: Aina Gomez.
*/
#include <iostream>
#include <map>
using namespace std;
int main() {
map<string,int> m;
string op, paraula;
map<string,int>::const_iterator it = m.begin();
while (cin >> op) {
if (op == "minimum?") {
if (m.empty()) cout << "indefinite ... | 1,260 | 388 |
/*
* This file is part of the DUDS project. It is subject to the BSD-style
* license terms in the LICENSE file found in the top-level directory of this
* distribution and at https://github.com/jjackowski/duds/blob/master/LICENSE.
* No part of DUDS, including this file, may be copied, modified, propagated,
* or dis... | 23,624 | 8,925 |
/*
* textdata.cxx
*
* Text data stream parser
*
* Portable Tools Library
*
* Copyright (C) 2019 by Vox Lucida Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the L... | 8,986 | 3,186 |
#include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;
bool isIncreasing(vector<int>& nums)
{
for (int i = 0; i < nums.size() - 1; i++) {
if (nums[i] > nums[i + 1])
return false;
}
return true;
}
bool checkPossibility(vector<int>& nums)
{
int modified = 0, i;
int temp;
vector<int>::iterat... | 1,120 | 581 |
/**
* swr - a software rasterizer
*
* frame buffer buffer implementation.
*
* \author Felix Lubbe
* \copyright Copyright (c) 2021
* \license Distributed under the MIT software license (see accompanying LICENSE.txt).
*/
/* user headers. */
#include "swr_internal.h"
namespace swr
{
namespace impl
{
/*
* he... | 38,117 | 13,364 |
/*
Copyright 2011 Aevum Software aevum @ aevumlab.com
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 requi... | 3,185 | 1,191 |
#include <thrust/adjacent_difference.h>
#include <thrust/device_vector.h>
#include <thrust/random.h>
#include <thrust/reduce.h>
#include <thrust/sort.h>
#include <thrust/unique.h>
namespace example
{
namespace detail
{
template<typename DerivedPolicy, typename Array>
void initialize(thrust::execution_policy<DerivedPo... | 3,304 | 1,053 |
class Solution {
public:
double findMaxAverage(vector<int>& nums, int k) {
int n = nums.size();
int minNum = INT_MAX, maxNum = INT_MIN;
for (int num : nums) {
minNum = min(minNum, num);
maxNum = max(maxNum, num);
}
double low = minNum, high = maxNum;
... | 1,207 | 388 |
#include <pihud/Event.hpp>
namespace PiH
{
Event::Event()
{
type = EventType::NotSet;
}
Event::Event(const InputEvent &inputEvent, int playerID)
{
type = EventType::Input;
input = inputEvent;
this->playerID = playerID;
}
Event::Event(const FocusEvent &focusEvent, i... | 1,549 | 459 |
#include <cstdint>
#include <cstdlib>
#include <atomic>
#include <chrono>
#include <iostream>
#include <string>
#include <thread>
#include <utility>
#include <vector>
#include <caf/atom.hpp>
#include <caf/config_option_adder.hpp>
#include <caf/downstream.hpp>
#include <caf/event_based_actor.hpp>
#include <caf/scoped_a... | 5,731 | 2,140 |
// Copyright (c) 2016
// Author: Chrono Law
#include <std.hpp>
using namespace std;
#include <boost/utility/addressof.hpp>
using namespace boost;
///////////////////////////////////////
void case1()
{
int i;
string s;
assert(&i == boost::addressof(i));
assert(&s == boost::addressof(s));
int a[1... | 1,114 | 399 |
/*====================================================================*
*
* opathspec.hpp - interface for the opathspec class.
*
*. Motley Tools by Charles Maier
*: Published 1982-2005 by Charles Maier for personal use
*; Licensed under the Internet Software Consortium License
*
*--------------------------... | 2,434 | 608 |
#include "compilable.hpp"
namespace bacs {
namespace system {
namespace builders {
class interpretable : public compilable {
protected:
name_type name(const bacs::process::Source &source) override;
};
class interpretable_executable : public compilable_executable {
public:
interpretable_executable(const Contain... | 1,026 | 271 |
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2018 Sebastian Schlenkrich
This file is part of QuantLib, a free-software/open-source library
for financial quantitative analysts and developers - http://quantlib.org/
QuantLib is free software: you can redistribute it a... | 28,856 | 10,322 |
#include <iostream>
using namespace std;
int main()
{
cout <<"\nHello World"<< endl;
return 0;
}
//======================================================
#include <iostream>
using namespace std;
class helloworld{
helloworld(){
printf("Hello World!!");
}
};
int main(){
helloworld obj= n... | 339 | 105 |
// Copy from luogu1169
#include <iostream>
#include <algorithm>
#include <string.h>
#include <sstream>
#include <stdlib.h>
#include <stdio.h>
#include <queue>
#include <cmath>
#include <math.h>
#include <vector>
#include <iostream>
#include <cstdio>
#include <ctime>
#include <set>
#include <map>
#include <fstream>
#... | 1,758 | 865 |
#ifndef __OBOTCHA_HTTP_PROXY_AUTHENTICATE_HPP__
#define __OBOTCHA_HTTP_PROXY_AUTHENTICATE_HPP__
#include "Object.hpp"
#include "StrongPointer.hpp"
#include "String.hpp"
#include "ArrayList.hpp"
namespace obotcha {
DECLARE_CLASS(HttpProxyAuthenticate) {
public:
_HttpProxyAuthenticate();
_HttpProxyAuthentica... | 431 | 166 |
#ifndef MENUMECA_HPP
#define MENUMECA_HPP
#include<iostream>
#include<list>
#include"./Mecanico.hpp"
#include"./Vendedor.hpp"
#include"./Item.hpp"
#include"./MaodeObra.hpp"
#include"./Servico.hpp"
#include"./Ordem.hpp"
using namespace std;
void menuMeca(Mecanico* mecani);
void viewOrdems(Mecanico* mecani, Vendedor ... | 446 | 195 |
#include "BoolPropertyDelegate.h"
#include <QComboBox>
#include "DAVAEngine.h"
#include "PropertiesTreeItemDelegate.h"
#include "Utils/QtDavaConvertion.h"
BoolPropertyDelegate::BoolPropertyDelegate(PropertiesTreeItemDelegate* delegate)
: BasePropertyDelegate(delegate)
{
}
BoolPropertyDelegate::~BoolPropertyDelega... | 2,154 | 650 |
#include "CompositeLight.h"
#include <Collector.h>
namespace Tristeon
{
CompositeLight::CompositeLight()
{
Collector<CompositeLight>::add(this);
}
CompositeLight::~CompositeLight()
{
Collector<CompositeLight>::remove(this);
}
} | 239 | 98 |
//Inamullah Taj - 1446
// OBJECTIVE: Implement a Class of Static Graph
#include "HashTableHeader.h"
#include <conio.h>
#include <iostream>
using namespace std;
void main()
{
char ext;
int choice, size, value;
cout<<"\t \t \t>>-> HASH TABLES <-<<\n\n";
cout<<"\n\t\tEnter Size of Table = "; cin>>size... | 1,420 | 630 |
/**
* @file tqli2.cpp
*
* @brief Implementation for the tqli2 function using blitz arrays
*
* @author Roger Melko
* @author Ivan Gonzalez
* @date $Date$
*
* $Revision$
*/
#include <cmath>
#include <iomanip>
#include "blitz/array.h"
#include "tqli2.h"
#define SIGN(a,b) ((b)<0 ? -fabs(a) : fabs(a))
/**
* @b... | 2,507 | 1,180 |
#pragma once
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <vector>
template <typename T>
inline std::complex<T> cmul(const std::complex<T>& a, const std::complex<T>& b) {
return std::complex<T>(a.real() * b.real() - a.imag() * b.imag(),
a.real() * b.i... | 1,266 | 579 |
/*
MIT License
Copyright (c) 2019 MaticVrtacnik
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, ... | 3,586 | 1,450 |
/*
Copyright 2008 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,... | 21,764 | 7,307 |
/*******************************************************************/
/* */
/* ADOBE CONFIDENTIAL */
/* _ _ _ _ _ _ _ _ _ _ _ _ _ */
/* ... | 54,578 | 29,163 |
/*
* Copyright (c) Contributors to the Open 3D Engine Project.
* For complete copyright and license terms please see the LICENSE at the root of this distribution.
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include <AzCore/Math/IntersectPoint.h>
#include <AzCore/UnitTest/TestTypes.h>
#include <AZTestSha... | 6,799 | 2,612 |
/*
The MIT License
Copyright (c) 2019 Hanfeng GU <hanfenggu@gmail.com>
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, m... | 6,152 | 2,265 |
namespace eagleeye
{
/* Image Signal */
template<class T>
ImageSignal<T>::ImageSignal(Matrix<T> data,char* name,char* info)
:BaseImageSignal(TypeTrait<T>::type,TypeTrait<T>::size,info),
img(data)
{
this->m_meta.name = name;
this->m_meta.info = info;
this->m_meta.fps = 0.0;
this->m_meta.nb_frames = 0;
this-... | 6,827 | 2,948 |
/*##############################################################################
HPCC SYSTEMS software Copyright (C) 2016 HPCC Systems®.
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 Licens... | 1,519 | 479 |
/* 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, sublicense, and/or... | 5,854 | 1,997 |
#ifndef ESB_READ_WRITE_LOCK_H
#include <ESBReadWriteLock.h>
#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
namespace ESB {
ReadWriteLock::ReadWriteLock() : _magic(0) {
#ifdef HAVE_PTHREAD_RWLOCK_INIT
if (0 == pthread_rwlock_init(&_lock, 0)) {
_magic = ESB_MAGIC;
}
#elif defined HAVE_PTHREAD_MUTEX_INI... | 7,217 | 2,925 |
#pragma once
#include "common/tlvprotocol.h"
class AutoParamBase
{
public:
virtual ~AutoParamBase() = default;
virtual int Size() const = 0;
virtual void Reset() = 0;
virtual bool Serialize(TLVSerializer &serializer) = 0;
virtual bool Unserialize(TLVUnserializer &unserializer) = 0;
};
template<typename StructPa... | 1,295 | 489 |
#include "Collider.h"
/*Well Fudge. I've learned my lesson. Don't trust online 'optimizations' without checking.
* Square Root apparently isn't as 'costly' as some articles made it out to be. I'm not going back to change
* all my work using LSquare and radSquare instead of gl::length, but that's annoying. Real annoyi... | 7,484 | 2,837 |
#include "KRFReadLib.h"
#include "kseek.h"
inline kifstream::kifstream()
: m_File(NULL)
, m_State(std::ios_base::goodbit)
{
}
inline kifstream::kifstream(const char* filename, std::ios_base::openmode mode)
: m_File(kopen(filename, NULL))
, m_State(std::ios_base::goodbit)
{
}
inline kifstream::~kifstream()
{
close()... | 2,336 | 996 |
#include "core/workspace.h"
#include "utils/filler.h"
#include "utils/op_kernel.h"
#include "utils/math_functions.h"
#include "operators/norm/group_norm_op.h"
namespace dragon {
template <class Context> template <typename Tx, typename Tp>
void GroupNormOp<Context>::RunWithType() {
TENSOR_FILL_WITH_TYPE(Input(1), ... | 5,902 | 2,193 |
//
// Created by sebastian on 03.06.19.
//
#include "ConfigManager.h"
namespace firmware::json::config {
ConfigManager::ConfigManager(const std::string &deviceName) {
ConfigFinder config{deviceName};
if (auto &content = config.getFileContents()) {
if(!content->empty()) {
... | 919 | 253 |
/**
* Mojang API
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* OpenAPI spec version: 2020-06-05
*
* NOTE: This class is auto generated by OpenAPI-Generator 3.3.4.
* https://openapi-generator.tech
* Do not edit the class manually.
*/
#include... | 3,598 | 1,212 |
#include "VDSAIDefaultBehaviors.h"
VDAsaiDBArrive::VDAsaiDBArrive() {}
void VDAsaiDBArrive::_bind_methods() {}
| 113 | 50 |
/*-----------------------------------------------------------------------------
Copyright(c) 2010 - 2018 ViSUS L.L.C.,
Scientific Computing and Imaging Institute of the University of Utah
ViSUS L.L.C., 50 W.Broadway, Ste. 300, 84101 - 2044 Salt Lake City, UT
University of Utah, 72 S Central Campus Dr, Room 3750, 84112... | 8,470 | 2,881 |
#pragma once
#include "handle/sdl.hpp"
#include "mutex.hpp"
#include "abstbuffer.hpp"
#include "lubee/src/rect.hpp"
#include "handle/sdl.hpp"
#include <SDL_surface.h>
#include <memory>
namespace rev {
struct RGB;
struct RGBA;
class Surface {
private:
SDL_Surface* _sfc;
mutable Mutex _mutex;
AB_Byte _buff... | 2,947 | 1,452 |
// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
//-----------------------------------------------------------------------------
// Copyright 2000-2022 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
// See the top-level COPYRIGHT file for details.
// SPDX-License-Identifier: Apache-2... | 10,224 | 3,247 |
#include "HyoDioForm.h"
#include "ui_HyoDioForm.h"
#include <QHBoxLayout>
#include <QPushButton>
HyoDioForm::HyoDioForm(int points, QWidget *parent) :
QWidget(parent),
ui(new Ui::HyoDioForm)
{
ui->setupUi(this);
this->setObjectName("Digital I/O");
makePoints(points);
this->adjustSize();
}
H... | 2,209 | 830 |
/*
* iaf_cond_alpha_mc.cpp
*
* This file is part of NEST.
*
* Copyright (C) 2004 The NEST Initiative
*
* NEST 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
... | 19,953 | 8,012 |
//
// DummyThreads.hh
//
// Copyright (C) : 2000 - 2002
// LifeLine Networks BV (www.lifeline.nl). All rights reserved.
// Bastiaan Bakker. All rights reserved.
//
// 2004,2005,2006,2007,2008,2009,2010,2011,2012
// Synchrotron SOLEIL
// L'Orme des Merisiers
// Sa... | 2,154 | 830 |
#include "hzpch.h"
#include "AudioManager.h"
#include "Platform/LabSound/LabSoundAudioManager.h"
#include "Platform/NoAPI/NoAPIAudio.h"
namespace Hazel {
Scope<AudioManagerImpl> AudioManager::s_Instance;
void Hazel::AudioManager::Init()
{
HZ_CORE_ASSERT(!s_Instance, "Audio Manager already exists!");
#if defin... | 693 | 269 |
/*
See LICENSE file in root folder
*/
#ifndef ___C3D_ShaderProgram_H___
#define ___C3D_ShaderProgram_H___
#include "ShaderModule.hpp"
#include "Castor3D/Cache/CacheModule.hpp"
#include "Castor3D/Miscellaneous/DebugName.hpp"
#include "Castor3D/Render/RenderDevice.hpp"
#include <CastorUtils/Data/TextWriter.hpp>
#inclu... | 5,698 | 2,310 |
#include <string>
#include <iostream>
#include <exception>
#include <cstdlib>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <cstring>
extern "C" {
#include "../../src/scale.h"
}
int print_input(uint8_t *value, size_t value_len) {
std::stringstream s;
for (unsigned int i=0; i<value_len; i++) {
... | 2,140 | 816 |
//Illustration of extrinsic camera parameters
// Andreas Unterweger, 2017-2022
//This code is licensed under the 3-Clause BSD License. See LICENSE file for details.
#include <iostream>
#include <opencv2/viz.hpp>
#include "common.hpp"
#include "math.hpp"
#include "conf_viz.hpp"
static constexpr auto parameter_accura... | 5,613 | 1,804 |
/*
* ______ __ __ __
* / __/ /_ ____ __ / //_/__ _______ ___ / /
* / _// / // /\ \ / / ,< / -_) __/ _ \/ -_) /
* /_/ /_/\_,_//_\_\ /_/|_|\__/_/ /_//_/\__/_/
*
* copyright (c) 2021 Gavin Kellam (aka corigan01)
*
* Permission is hereby granted, free of ... | 2,910 | 1,057 |
//
// Created by suncx on 2020/9/23.
//
#include "HttpServer.h"
#include "EventLoop.h"
#include "InetAddress.h"
#include "ConsoleStream.h"
using std::string;
using std::to_string;
using reactor::net::HttpRequest;
using reactor::net::HttpResponse;
using reactor::net::http::Headers;
using reactor::net::EventLoop;
using... | 1,091 | 382 |
/**
* Morpheus_DynamicMatrix_Impl.hpp
*
* EPCC, The University of Edinburgh
*
* (c) 2021 - 2022 The University of Edinburgh
*
* Contributing Authors:
* Christodoulos Stylianou (c.stylianou@ed.ac.uk)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in comp... | 6,771 | 2,194 |
/*
* Copyright (C) 2017 by Author: Aroudj, Samir, born in Suhl, Thueringen, Germany
* All rights reserved.
*
* This software may be modified and distributed under the terms
* of the BSD 3-Clause license. See the License.txt file for details.
*/
#include <cstdio>
#include "Platform/ApplicationTimer.h"
#include "Cl... | 6,137 | 2,309 |
// Top-voted solution (https://discuss.leetcode.com/topic/12384/simple-solution).
class Solution {
public:
string intToRoman(int num) {
string M[] = {"", "M", "MM", "MMM"};
string C[] = {"", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"};
string X[] = {"", "X", "XX", "XXX", "XL", "L... | 2,020 | 796 |