text string | size int64 | token_count int64 |
|---|---|---|
#ifndef AST_TERMINAL_HPP
#define AST_TERMINAL_HPP
#include "ast.hpp"
#include <string>
#include <iostream>
class Terminal : public Base
{
public:
std::string symbol;
Terminal(const std::string &_symbol) : symbol(_symbol) {}
virtual void print(int idt = 0) const
{
for (int i = 0; i < idt... | 2,751 | 962 |
#include "common.h"
z3::expr* binop(z3::context* context,
operator_t op,
type_t type,
z3::expr* lhs,
z3::expr* rhs) {
Z3_ast rm = Z3_mk_fpa_rne(*context);
z3::expr *res = nullptr;
switch (op) {
case RPLUS:
case OPLUS:
switch (type) {
... | 2,361 | 836 |
//------------------------------------------------------------------------------------------------------------------------------
#pragma once
#include <vector>
#include "Engine/Math/PhysicsTypes.hpp"
//---------------------------------------------------------------------------------------------------------------------... | 616 | 140 |
#include <tools/inputstate.h>
//*****************************************************************************************
// TKey static members
//*****************************************************************************************
const TKey TKey::shift(Qt::Key_Shift, true);
const TKey TKey::control(Qt::Ke... | 1,964 | 600 |
/*
The MIT License (MIT)
Copyright (c) [2016] [BTC.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, modify, me... | 34,635 | 19,690 |
/*
* Player - One Hell of a Robot Server
* Copyright (C) Andrew Howard 2003
*
*
* 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 y... | 1,556 | 593 |
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cctype>
#include <vector>
using namespace std;
typedef long long lint;
#define ni (next_num<int>())
#define nl (next_num<lint>())
template<class T>inline T next_num(){
T i=0;char c;
while(!isdigit(c=getchar())&&c!='-');
bool flag=c... | 1,691 | 882 |
// $Id: ASResource.cpp,v 1.2 2004/02/04 07:35:10 devsolar Exp $
// --------------------------------------------------------------------------
//
// Copyright (c) 1998,1999,2000,2001,2002 Tal Davidson. All rights reserved.
//
// compiler_defines.h
// by Tal Davidson (davidsont@bigfoot.com)
//
// This file is a part of "... | 6,646 | 2,029 |
// @HEADER
// ************************************************************************
//
// Intrepid Package
// Copyright (2007) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the ... | 13,202 | 4,280 |
#pragma once
/// @file si_derived.hpp
/// @brief Derived SI units
#include "si_base.hpp"
#include <utility>
namespace Si {
/// @brief Derived SI units
namespace Derived {
/// @tparam T Any number type such as float, double or long double used as a
/// container
template <typename T>
using Hertz = decltype(std::declv... | 6,940 | 2,191 |
/*
* Copyright (c) 2012, Willow Garage, 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:
*
* * Redistributions of source code must retain the above copyright
* notice, this l... | 4,500 | 1,666 |
// LeetCode.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
//int x = input[inputSize - 1];
//for (int i = inputSize - 1; i > 0; i--)
//{
// input[i] = input[i - 1];
//}
//input[0] = x;
//while (numsSize > 0)
//{
// numsSize -= 1;
//}... | 3,274 | 1,301 |
#include "sync_fault_state.h"
FaultState::FaultState(SyncStateManager* pSyncStateManager)
: SyncStateBase()
{
m_pSyncStateManager = pSyncStateManager;
}
FaultState::~FaultState()
{
}
void FaultState::Enter()
{
log_error("Here is ErrorState");
}
void FaultState::Exit()
{
// do nothing
}
void FaultS... | 410 | 166 |
// Copyright (c) 2020 by Nicolai Josuttis. All rights reserved.
// Licensed under the CCA-4.0 International License. See the LICENSE file in the project root for more information.
//
// Name: card.hpp
// Author: crdrisko
// Date: 08/08/2021-07:22:39
// Description: A class for the cards of a card game where each object... | 1,431 | 492 |
#ifndef CLOVER_UTIL_PARALLEL_BUFFER_HPP
#define CLOVER_UTIL_PARALLEL_BUFFER_HPP
#include "build.hpp"
#include "hardware/clstate.hpp"
namespace clover {
namespace visual {
/// @todo Shouldn't be in util >:(
class BaseVertexArrayObject;
class Framebuffer;
class Texture;
} // visual
namespace util {
class ParallelQue... | 2,024 | 683 |
#include<iostream>
using namespace std;
int main()
{
int id;
cout << "Enter number from 0 to 9999: ";
cin >> id;
int serial = 0;
serial += id + 76 + 1 + 907;
serial += serial;
serial *= 3;
serial -= 1;
cout << "Serial: "<< serial << endl;
system("pause");
retu... | 328 | 124 |
#include <jni.h>
#include <string>
extern "C"{
#include "libavcodec/jni.h"
}
#include "core/hw_mediacodec.h"
extern "C"
JNIEXPORT jstring JNICALL
Java_com_xhunmon_ffmpegmediacodecdemo_core_Player_getFFVersion(JNIEnv *env, jobject type) {
return env->NewStringUTF(av_version_info());
}
extern "C"
JNIEXPORT void JNI... | 920 | 363 |
/**
* @file pcl_icp.cpp
* @author Maximilian Harr <maximilian.harr@daimler.com>
* @date 22.04.2017
*
* @brief Point cloud library [http://www.pointclouds.org/]
* Comes with ROS [http://wiki.ros.org/pcl/]
* ICP (Iterative Closest Point) Tutorial [ http://pointclouds.org/documentation/tutorials/iter... | 2,691 | 1,104 |
#include "PCH.hpp"
#include <Emulator.hpp>
#ifdef __SWITCH__
#include <unistd.h>
#include <switch.h>
#include <dirent.h>
#include <iostream>
#endif
// 60 FPS or 16.67ms
const double TimePerFrame = 1.0 / 60.0;
// The number of CPU cycles per frame
const unsigned int CyclesPerFrame = 70224;
struct SDLWindowDeleter
{
... | 15,173 | 5,340 |
#include "lib/memory/mmu_factory.hpp"
// Initial values come from the Gambatte source code
// https://github.com/sinamas/gambatte/blob/master/libgambatte/src/initstate.cpp
namespace gb_lib {
MMU* MMUFactory::create(uint8_t* rom, uint32_t romSize, DMAMediator* dmaMediator, DMAMediator* hdmaMediator, MemorySpace* tim... | 5,855 | 3,151 |
#include <iostream>
#include "SWektor.hh"
#include "Macierz.hh"
#include "UkladRownan.hh"
#include "rozmiar.h"
#include "LZespolona.hh"
using namespace std;
int main()
{
char x;
cin >> x;
if (x == 'r') ///DLA DOUBLE
{
UkladRownanLiniowych<double, ROZMIAR> B;
SWektor<double, ROZ... | 1,210 | 536 |
#include <sstream>
#include <iostream>
#include "Utils.h"
void Utils::Bezier::QuadraticBezierCurve(const sf::Vector2f &p0, sf::Vector2f &p1, sf::Vector2f &p2, int segments,
std::vector<sf::Vector2f> &curvePoints, bool throughControlPoint) {
//If there are any segments requi... | 4,666 | 1,906 |
//
// Copyright 2011-2015 Jeff Bush
//
// 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 ... | 983 | 401 |
/*++
Copyright (c) 1997 Microsoft Corporation
Module Name :
InStrm.cpp
Abstract:
A lightweight implementation of input streams. This class provides
the interface, as well as a basic skeleton for input streams.
Author:
Neil Allain ( a-neilal ) August-19... | 4,061 | 1,960 |
/****************************************************************************
** CUBE http://www.scalasca.org/ **
*****************************************************************************
** Copyright (c) 1998-2016 **
** Fors... | 1,406 | 336 |
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <iostream>
#include <fstream>
#include <string>
#include <map>
#include <sstream>
#include <stdexcept>
#include <algorithm>
#include "eventFile/LSEReader.h"
#include "eventFile/LSEWriter.h"
#include "eventFile/LSE_Context.h"
#inclu... | 6,965 | 2,645 |
class Solution {
public:
//Intuitive method
//Check before overflow
//INT_MAX = 2147483647
//INT_MIN = -2147483648
//if current result == INT_MAX/10 and reminder > 7, overflow will happen
//if current result == INT_MIN/10 and reminder < -8, overflow will happen
//Runtime faster than 100.00%
//MU less than 76.31%
in... | 778 | 280 |
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2012 EMC Corp.
//
// @filename:
// CStatsEquivClassTest.cpp
//
// @doc:
// Test for constraint
//
// @owner:
//
//
// @test:
//
//
//------------------------------------------------------------------... | 26,949 | 11,495 |
#include <iostream>
#include <thread>
#include "Client.h"
namespace vasily
{
Client::Client(const quint16 serverPort, const std::string& serverIP, QObject* parent)
: QObject(parent),
_serverPort(serverPort),
_socket(std::make_unique<QTcpSocket>(this)),
_serverIP(serverIP)
{
qDebug() << "Se... | 2,625 | 859 |
/*
Author : Colmen Tse
Compsci : 120
5.6 consoleinput.cpp
*/
#include <string>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int age;
cout << "Enter your age: ";
cin >> age;
cin.ignore(1000, 10);
string name;
cout << "Enter your name: ";
getline(cin, name);
double temp;
cout << ... | 629 | 243 |
//
// Created by liuRuiLong on 2018/4/23.
//
#include "op_desc.h"
| 67 | 38 |
#include "Job.h"
using namespace std;
Job::Job(){
no = enterTime = timeToGo = 0;
cond = -1;
}
Job::~Job(){}
void Job::initialize(int No, double enter_time){
no = No;
enterTime = enter_time;
timeToGo = enter_time;
cond = -1;
}
| 236 | 101 |
#include <gtest/gtest.h>
#include <collection/FixedArrayStack.h>
#include <collection/FixedQueue.h>
#include <collection/LinkedListStack.h>
#include <collection/LinkedQueue.h>
#include <collection/ResizableStack.h>
#include <collection/ResizableQueue.h>
TEST(LINKEDLISTSTACK, PushPopCount)
{
LinkedListStack<int> stac... | 5,383 | 2,523 |
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include "catch.hpp"
TEST_CASE("Verify Test Configuration", "verification") {
REQUIRE(true == true);
}
TEST_CASE("Verify sum of squares function")
{
REQUIRE(sum_of_squares(3)==14);
REQUIRE(sum_of_squares(4)==30);
... | 729 | 322 |
// https://www.interviewbit.com/problems/modular-expression/
long long int calMod(int A, int B, int C){
if(B == 0){
return 1;
}
else if(B%2 == 0){
long long int y = calMod(A, B/2, C);
return (y*y)%C;
}
else{
return ((A%C)*calMod(A,B-1,C))%C;
}
}
int Solution::Mo... | 776 | 292 |
#include <iostream>
using namespace std;
main(){
string name[5] = {"apple", "google", "microsoft", "ibm", "tesla"};
string arr[5] = {"ab", "bc", "cd", "de", "ff"};
string arr2[] = {"apappappapapap", "hghghdgahdgahsdghag"};
int num = sizeof(name[4]);
int num2 = sizeof(arr[0]);
int num3 = sizeof(... | 570 | 219 |
#include <cstdio>
#include <cstdlib>
#include "bit_field.h"
typedef struct {
unsigned short width;
unsigned short height;
size_t type_size;
GLint internal_format;
GLenum format;
GLenum type;
} BF_HEADER;
void create_bit_field_file(const char *destination, unsigned short width,
... | 2,429 | 863 |
#pragma once
#include <map>
#include <memory>
#include <string>
#include <vector>
#include "IModule.hpp"
namespace aoce {
typedef IModule* (*loadModuleAction)();
typedef std::function<IModule*(void)> loadModuleHandle;
class ModuleInfo {
public:
void* handle = nullptr;
IModule* module = nullptr;
std::... | 1,446 | 441 |
#include "xysetcolorwidget.h"
#include "ui_xysetcolorwidget.h"
#include <QPainter>
#include <QMouseEvent>
XYSetColorWidget::XYSetColorWidget(QWidget *parent) :
QDialog(parent),
ui(new Ui::XYSetColorWidget), pressed(false)
{
ui->setupUi(this);
setWindowFlags(windowFlags() | Qt::FramelessWindowHint);
... | 1,430 | 486 |
#include "../pico_inc/conversion.h"
void Conversion_Uint_To_Char_Array(uint32_t inNumber, char * outDestinationPtrLocation, uint32_t outDestinationByteLength)
{
uintptr_t destPtr = reinterpret_cast<uintptr_t>(outDestinationPtrLocation);
_Conversion_Uint_To_Char_Array(inNumber, destPtr, outDestinationByteLengt... | 856 | 306 |
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
using namespace std;
int dp[355][355];
int a[355][355];
int main(){
int n,i,j;
while(~scanf("%d",&n)){
for(i=1;i<=... | 609 | 347 |
// Boost.GIL (Generic Image Library) - tests
//
// Copyright 2020 Olzhas Zhumabek <anonymous.from.applecity@gmail.com>
//
// 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)
//
#includ... | 3,269 | 1,131 |
#include <unistd.h>
#include <iomanip>
#include <torch/utils.h>
#include "../utils/Ch_18_util.h"
#include "../matplotlibcpp.h"
namespace plt = matplotlibcpp;
using torch::indexing::Slice;
using torch::indexing::None;
// Statistical bias
torch::Tensor stat_bias(float true_theta, torch::Tensor est_theta) {
return(... | 2,704 | 1,163 |
#include "gamelib/editor/ui/Overlay.hpp"
#include "gamelib/editor/tools/ToolUtils.hpp"
#include "gamelib/editor/EditorShared.hpp"
#include "gamelib/core/ecs/Entity.hpp"
#include "gamelib/core/geometry/flags.hpp"
#include "gamelib/core/input/InputSystem.hpp"
#include "gamelib/core/Game.hpp"
#include "gamelib/core/render... | 4,093 | 1,282 |
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <unordered_map>
#include <stdint.h>
#include <cmath>
using namespace std;
typedef int64_t Int;
typedef uint64_t UInt;
int main(int argc, char **argv) {
UInt p = 0;
UInt n = 0;
// Read the first line
string line = "";... | 1,079 | 387 |
#include <uv.h>
#include <string.h>
#include "monitor.h"
// There is no true standard for where time zone information is actually
// stored. glibc uses /etc/localtime, uClibc uses /etc/TZ, and some older
// systems store the name of the time zone file within /usr/share/zoneinfo
// in /etc/timezone. Different librarie... | 1,816 | 583 |
#include "RangedCombatTextKeys.hpp"
using namespace std;
// Ranged combat messages
RangedCombatTextKeys::RangedCombatTextKeys()
{
}
RangedCombatTextKeys::~RangedCombatTextKeys()
{
}
const string RangedCombatTextKeys::RANGED_COMBAT_UNAVAILABLE_ON_WORLD_MAP = "RANGED_COMBAT_UNAVAILABLE_ON_WORLD_MAP";
const string R... | 1,018 | 431 |
#ifndef UTILS_HPP
#define UTILS_HPP
//==============================================================================
// Originally written in 2016 by Peter Shirley <ptrshrl@gmail.com>
//
// To the extent possible under law, the author(s) have dedicated all copyright
// and related and neighboring rights to this softwa... | 1,603 | 508 |
#ifndef UTIL_MMAP_H
#define UTIL_MMAP_H
// Utilities for mmaped files.
#include <cstddef>
#include <limits>
#include <stdint.h>
#include <sys/types.h>
namespace util {
class scoped_fd;
long SizePage();
// (void*)-1 is MAP_FAILED; this is done to avoid including the mmap header here.
class scoped_mmap {
publ... | 5,202 | 1,875 |
/*
* This file is part of FFL project.
*
* The MIT License (MIT)
* Copyright (C) 2017-2018 zhufeifei All rights reserved.
*
* FFL_PipelineNodeParser.hpp
* Created by zhufeifei(34008081@qq.com) on 2018/02/11
* https://github.com/zhenfei2016/FFL-v2.git
*
* Pipelin系统中通过脚本创建node的parser
*
*/
#ifndef _FFL_PIPELINENOD... | 501 | 249 |
// Copyright 2014 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 "sync/api/attachments/attachment_store.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/location.h"
#include "base/sequenced_... | 1,740 | 533 |
//---------------------------------------------------------------------------
// Framemanager sequential implementation. The frame are sent one by one
// in the receiving order.
//
// Matthieu Dreher
// Argonne National Laboratory
// 9700 S. Cass Ave.
// Argonne, IL 60439
// mdreher@anl.gov
//
//-----------------------... | 1,233 | 342 |
#include"head.h"
bool func(const string &s);
int main(){
vector<string> words{"fox","jumps","over","quick","red","quick","blow","slow","the","turtle"};
auto iter = partition(words.begin(),words.end(),func);
for(const auto &e:words)
cout<<e<<" ";
cout<<endl;
return 0;
}
bool func(const string &s){
return s.size... | 328 | 127 |
/*
Copyright 2021-2022 Marc Ketel
SPDX-License-Identifier: Apache-2.0
*/
#include <math.h>
#include "NTC.h"
/*
Class which is able to calculate the temperature of a NTC given the voltage of a resistor divider.
Simple schematic:
resistorDividerVoltage---[resistorDividerResistance]---[NTC]---GND
*/
NTC::NTC(void... | 1,719 | 570 |
#include <fstream>
#include <xmlParser.h>
#include <MFGame.h>
#include <time.h>
static const unsigned int MIN_GRID_SIZE = 10;
static const std::string SHAPES_XML_FILE_PATH = "../../shapes.xml";
static char highlightChar = '*';
static char hotCornerChar = '&';
using std::vector;
template <typename T>
bool vectorConta... | 22,385 | 8,256 |
#pragma once
#include <bitset>
#include "../concepts.hpp"
namespace elona::serialization
{
template <size_t N, typename Archive>
void serialize(std::bitset<N>& value, Archive& ar)
{
if constexpr (concepts::is_iarchive_v<Archive>)
{
if constexpr (N <= 32)
{
uint32_t tmp;
... | 1,065 | 355 |
/*
* Copyright (C) 2017 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... | 6,835 | 2,299 |
// smtc_DefineLazyClass.cpp
//
#include "smtc_DefineLazyClass.h"
#include "smtc_ClassDefn.h"
#include "smtc_ClassScope.h"
#include "smtc_CreateLazyClass.h"
#include "smtc_CreateLazyClassEntity.h"
#include "smtc_CreateLazyClassScope.h"
#include "smtc_CreateMbrInit.h"
#include "smtc_CreateQualName.h"
#include "smtc_Crea... | 4,713 | 1,677 |
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
#define MX 60
int dist[105] [105];
int main()
{
int x, y;
int n=100;
int tc=1;
int mp[105] = {0};
while(scanf("%d %d", &x, &y)==2)
{
if(x==0) break;
for(int ... | 1,847 | 722 |
#include "SpotLight.hh"
float SpotLight::getAngle() const {
return angle_;
}
void SpotLight::setAngle(float angle) {
SpotLight::angle_ = angle;
}
const Vector3D<float> &SpotLight::getDirection() const {
return direction_;
}
void SpotLight::setDirection(const Vector3D<float> &direction) {
SpotLight::... | 530 | 177 |
//
//
#include "utils/encoding.h"
#include "mod_table/mod_table.h"
namespace util {
Encoding guess_encoding(const SCP_string& content, bool assume_utf8) {
if (content.size()>= 3 && !strncmp(content.c_str(), "\xEF\xBB\xBF", 3)) { // UTF-8
return Encoding::UTF8;
}
if (content.size()>= 4 && !strncmp(conte... | 8,869 | 4,116 |
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <vector>
using namespace std;
#define F first
#define S second
#define MP make_pair
typedef long long ll;
typedef long double ld;
typedef pair <ld, ld> Point;
const ld eps = 1e-7;
... | 4,446 | 2,477 |
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
#include "Artemis.Local.hpp"
#include "Artemis.Graphics.hpp"
#if defined(ATS_API_DIRECTX11)
#include "Platform/Artemis.Graphics.directx11.cpp"
#e... | 353 | 98 |
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
vector<vector<char>>v(n,vector<char>(m));
vector<vector<int>>poss(n,vector<int>(m,-1));
queue<pair<int,int>>q;
int xi,yi;
for(int i=0;i<n;i++)
{
for(int j=0;j<m;j++)
{
cin>>v[i][j];
... | 3,360 | 1,328 |
#include <stdio.h>
#include <thread>
#include <opencv2/opencv.hpp>
#include "kiwi-logger.hpp"
#include "kiwi-app-nanodet.hpp"
#include "kiwi-app-scrfd.hpp"
#include "kiwi-app-arcface.hpp"
#include "kiwi-infer-rknn.hpp"
using namespace cv;
using namespace std;
void test_pref(const char* model){
// 测试性能启用sync mode... | 3,595 | 1,543 |
#include "save_jpeg.h" | 22 | 10 |
/*
Edit by Christina
*/
#pragma once
#include <limits>
#include "mllib/Utility.hpp"
#include "mllib/Instances.hpp"
#include "lib/aggregator_factory.hpp"
#include "mllib/Classifier.hpp"
namespace husky{
namespace mllib{
/*
MODE
GLOBAL: global training
LOCAL: trainin... | 4,261 | 1,130 |
#ifndef _ML_REQUEST_HPP_
#define _ML_REQUEST_HPP_
#include <MemeCore/IRequest.hpp>
namespace ml
{
/* * * * * * * * * * * * * * * * * * * * */
class ML_CORE_API TestRequest
: public IRequest
{
public:
using LogFunc = void(*)(const ml::String &);
public:
TestRequest();
~TestRequest();
public:
void se... | 565 | 249 |
// Copyright 2019 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 "src/modular/lib/modular_config/modular_config.h"
#include <fcntl.h>
#include <lib/syslog/cpp/macros.h>
#include <rapidjson/document.h>
#include... | 6,505 | 2,174 |
/*
Copyright (c) 2002-2009 Tampere University.
This file is part of TTA-Based Codesign Environment (TCE).
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, ... | 8,771 | 2,713 |
#pragma once
#include <fc/static_variant.hpp>
#include <scorum/protocol/betting/wincase.hpp>
#include <scorum/protocol/betting/market_kind.hpp>
#include <scorum/protocol/config.hpp>
#include <boost/range/algorithm/transform.hpp>
namespace scorum {
namespace protocol {
template <market_kind kind, typename tag = void>... | 9,115 | 2,814 |
/* A program to find the capacity of MAC channel Multi user case (each alphabet is arbitrary size) by implementing Blahut Arimoto Algorithm
*
* Created on: 20-Oct-2018
* Author : Archit Kumar
*/
/*
Input[Optional]:
1. input probability distribution of input alphabet.
2. transition matrix for the chan... | 8,559 | 3,236 |
/*
* Martin Gustafsson @margu424 && Axel Gard @axega544
*
* The task was to crate a replication of the game of life.
*
* Soruces :
* labb PM - https://www.ida.liu.se/~TDDD86/info/misc/labb1.pdf
* C++ doc - http://www.cplusplus.com/doc/tutorial/files/
* StackOverFlow - https://stackoverflow.com/questions/2522594... | 3,378 | 1,188 |
#include "Aims.hpp"
// {{{ Aims::Aims()
Aims::Aims(AimsContext* context) :
_context(context) {
_configure = _context->config;
}
// }}}
// {{{ Aims::~Aims()
Aims::~Aims() {
}
// }}}
// {{{ void Aims::run()
void Aims::run() {
// 初始化 server
init();
_kafkaProducerIn->start();
}
// }}}
// {{{ void Aims::init()
... | 2,233 | 888 |
// Copyright (c) 2019, Entropy Game Global Limited.
// All rights reserved.
#include <stdint.h>
#include "rail/sdk/base/rail_array.h"
#include "thirdparty/gtest/gtest.h"
struct Item {
int32_t id;
int32_t value;
};
TEST(RailArray, size) {
rail::RailArray<struct Item> array;
EXPECT_EQ(0U, array.size())... | 1,259 | 542 |
#ifndef SZEN_SPRITEBATCH_HPP
#define SZEN_SPRITEBATCH_HPP
#include <SFML/Graphics.hpp>
#include <functional>
#include <map>
#include <vector>
#include <thor/Particles.hpp>
namespace sz
{
class TextureAsset;
class ShaderAsset;
struct BatchData
{
BatchData() : texture(NULL), shader(NULL), particles(NULL) {}
... | 1,552 | 613 |
#include "db.h"
APP_DB::APP_DB(QQmlApplicationEngine *parent) : QObject(parent)
{
_db = QSqlDatabase::addDatabase("QSQLITE");
this->setParent(parent);
// DEBUG STUFF
QString crypt_pw = QCryptographicHash::hash(QString("abcd").toLocal8Bit(),
QCryptographicHash::Sha256).toBase64(QByteArray::... | 8,171 | 2,492 |
#include "Parser.h"
#include "Tokenizer.h"
#include "malloc.h"
#include "config.h"
//#include <stdio.h>
//#include "string.h"
#define REDUCE 0x20000000
#define SHIFT 0x40000000
#define ACCEPT 0x60000000
#define ACTION_MASK 0x60000000
struct Rule {
ScriptTokenType result;
NodeType nodeType;
unsigned char numTerms:... | 37,941 | 19,561 |
/*
* Warhammer Age of Sigmar battle simulator.
*
* Copyright (C) 2019 by Rick Weyrauch - rpweyrauch@gmail.com
*
* This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT)
*/
#include <UnitFactory.h>
#include "ossiarch/Katakros.h"
#include "OssiarchBonereaperPrivate.h"
namespace Ossi... | 4,198 | 1,493 |
/*
* 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... | 9,703 | 3,106 |
#include "DataFrame.h"
#include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<sstream>
void DataFrame::read_csv(std::string path)
{
std::ifstream File;
File.open(path);
std::string line;
std::vector<double> temp;
std::getline(File, line);
std::stringstream lineStream(l... | 2,435 | 1,033 |
/*
* Copyright (c) 2021 Huawei Device 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 or a... | 4,099 | 1,562 |
// Description: C++18 edit object instance implementation for CFInt SubProject.
/*
* org.msscf.msscf.CFInt
*
* Copyright (c) 2020 Mark Stephen Sobkow
*
* MSS Code Factory CFInt 2.13 Internet Essentials
*
* Copyright 2020-2021 Mark Stephen Sobkow
*
* This file is part of MSS Code Factory.
*
* MSS Code ... | 19,891 | 7,288 |
#include "Scheduler.h"
#include <cstring>
#include <new>
#include "ARM/SchedulerDefines.h"
#include "IRQ.h"
#include "MemoryManager.h"
#include "Timer.h"
// How the scheduler currently works:
//
// CopyProcess creates a new memory page and puts the task struct at the bottom of the page, with the stack pointer
// poin... | 19,255 | 5,204 |
// (C) 2020 by folkert van heusden <mail@vanheusden.com>, released under Apache License v2.0
#include <chrono>
#include "ip_protocol.h"
#include "utils.h"
constexpr size_t pkts_max_size { 512 };
ip_protocol::ip_protocol(stats *const s, const std::string & stats_name)
{
pkts = new fifo<const packet *>(s, stats_name,... | 1,525 | 725 |
#include "Quantiser.h"
#include <math.h>
#include <stdio.h>
// Breng wijzigingen aan in onderstaande methode
// Quantisatie van de luminanitie- en chrominantiecoefficienten.
// De quantisatiestap qp moet bij het encoderen verschillend zijn van nul aangezien deling door nul niet is toegestaan.
int Quantiser::sign(pixel... | 999 | 466 |
#include "qmc2-crypto/StreamCencrypt.h"
#include <cassert>
#include <cstring>
#include <algorithm>
void StreamCencrypt::StreamEncrypt(uint64_t offset, uint8_t *buf, size_t len)
{
if (N > 300)
{
ProcessByRC4(offset, buf, len);
}
else
{
for (size_t i = 0; i < len; i++)
{
buf[i] ^= mapL(offs... | 4,546 | 1,990 |
#include "Debug.h"
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <string>
#include <Windows.h>
#include <iostream>
namespace Atum
{
namespace Utilities
{
void OutputTrace(char* text, ...)
{
char buffer[256];
va_list args;
va_start (args, text);
vsprintf_s (buffer, text, args);
... | 1,475 | 585 |
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <limits>
#include "AI.h"
#include "Moves.h"
#include "Board.h"
namespace chess {
AI::AI () {}
AI::AI (long* t_array, int t_maxZ, int t_maxY, int t_maxX, int t_turn, bool t_pawn2step)
: m_maxZ(t_maxZ), m_maxY(t_maxY), m_maxX(t_maxX),... | 5,973 | 2,335 |
#include "Light.h"
#include "Color.h"
#include "Vertex.h"
#include "Maths/Vec4.h"
#include <iostream>
#include <algorithm>
using namespace Maths::Vector;
//ADD LIGHTING HERE EVENTUALLY
Light::Light(const Maths::Vector::Vec3 p_position, const float p_ambient, const float p_diffuse, const float p_specular)
: m_positi... | 2,930 | 1,132 |
// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
// The test was reported to hang sometimes on Darwin:
// https://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20210517/917003.html
// UNSUPPORTED: darwin
#include "test.h"
#include <signal.h>
#include <string.h>
#include <sys/time.h>
int test;
int d... | 2,445 | 1,035 |
// Copyright 2017 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 <memory>
#include <utility>
#include "ash/login/ui/login_bubble.h"
#include "ash/login/ui/login_button.h"
#include "ash/login/ui/login_menu_view... | 15,828 | 5,334 |
#include <iostream>
using namespace std;
int main()
{
int a[30][30] ,nr, i, j, n, m ;
cout<<"Numar de linii "; cin>>n;
cout<<"Numar de coloane "; cin>>m;
for(i=1; i<=n; i++)
{ for(j=1; j<=m; j++)
{cout<<"a["<<i<<"]["<<j<<"] = "; cin>>a[i][j]; }
if(a[i... | 481 | 188 |
#include <zmq.hpp>
#include <stdio.h>
#include <unistd.h>
#include <string>
#include <assert.h>
#include <stdlib.h>
#include <ctime>
#include "hdaemon.pb.h"
#include <iostream>
class TestControl {
public:
TestControl() {
publishing = start_publishing = false;
test_duration = 5;
msg_batch = 100;
ms... | 8,700 | 3,074 |
/*
* This is part of the fl library, a C++ Bayesian filtering library
* (https://github.com/filtering-library)
*
* Copyright (c) 2015 Max Planck Society,
* Autonomous Motion Department,
* Institute for Intelligent Systems
*
* This Source Code Form is subject to the terms of the MIT License (MIT).
... | 8,891 | 2,870 |
#define BOOST_TEST_MODULE "C++ Unit Tests for metaLBM"
#include <boost/test/included/unit_test.hpp>
#include <boost/test/unit_test.hpp>
#include <boost/test/floating_point_comparison.hpp>
namespace tt = boost::test_tools;
#include <iostream>
#define NPROCS 1
#include "Lattice.h"
typedef double valueType;
typedef lbm:... | 780 | 315 |
#pragma once
#include <memory>
#include <string>
#include <vector>
#include "adstlog_cxx/p7_trace_wrapper.hpp"
// clang-format off
// Actor module registers all of these channels
#define ADSTLOG_ACTOR_CH p7ActorCh_
#define ADSTLOG_MSG_TX_CH p7MsgTxCh_
#define ADSTLOG_MSG_RX_CH p7MsgRxCh_
#define ADSTLOG_GRPC_RX_... | 13,307 | 5,442 |
#include "SearchRange.h"
#include "Cigar.h"
SearchRangeItem::SearchRangeItem(Type aType, int aStartColumn, int anEndColumn,
int aStartRow, int anEndRow)
: type(aType),
startRow(aStartRow),
endRow(anEndRow),
startColumn(aStartColumn),
endColumn(anEndColumn)
{ }
std::ostream& operator<<(std::ostr... | 6,025 | 2,207 |
/******************************************************************************
* Copyright (c) 2017 Johann Prankl
*
* 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, ... | 13,193 | 5,108 |
#include "../auxiliaries/program_options_handler.h"
#include "../auxiliaries/atoms_io.h"
#include "../auxiliaries/io_utilities.h"
#include "../common/chain_residue_atom_descriptor.h"
void reprint_hbp(const voronota::auxiliaries::ProgramOptionsHandler& poh)
{
voronota::auxiliaries::ProgramOptionsHandlerWrapper pohw(p... | 1,560 | 642 |