blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
994abd8b8d42c8689e36d3a21f414c09395767c1 | 714be0cc243733fb8890e34ef6c44a005cac8bc7 | NJBeck/Second-Wind | /src/globals.cpp | C++ | cpp | 591 | permissive | #include "globals.h"
// TODO: change constructors to take the required handlers
// so order of initialization is clear
// e.g. quadHandler -> quadHandler(&imgHandler)
namespace globals {
SDL_Window* window = NULL;
OrthoCam camera{ 100.0, 100.0, 16.0, 9.0, 1280, 720 };
EventManager eventManager;
// renderer in... |
11282ec5cb90f1a330c7c32a93bc24312c8d295d | ab62e7bc6f958b06058a378c9c2ba2e2fec8e751 | yu-chan/shooting2D | /effect.cpp | C++ | cpp | 2,427 | no_license | #include "GV.h"
//爆発エフェクト
void explosion_calc() {
for(int i=0; i<EPS_MAX; i++) {
if(eps[i].flag==1) eps[i].cnt++;
if(eps[i].cnt%2==0) eps[i].index=eps[i].cnt%17;
if(eps[i].index==16) eps[i].flag=0;
}
}
//ボムを打ったときの爆発エフェクト
void b_explosion_calc() {
for(int i=0; i<EPS_MAX; i++) {
if(b_eps[i].flag==1) b_eps[i]... |
e33c89fa468d59d903c4a5dfa639ed1e4d82a713 | efb9b8109bffe5f80b0d9faa1d6daa21fe8fa40b | PromZona/DronengineOG | /DronengineOG/src/DronengineOG/Renderer.cpp | C++ | cpp | 2,011 | no_license | #include "Renderer.h"
namespace DronengineOG {
Renderer::Renderer(Initialization* OpenGL)
{
shader = 0;
this->OpenGLinit = OpenGL;
VAO = new VertexArray();
BAO = new VertexBuffer();
EAO = new ElementArray();
VAO->Bind();
Object* first = new Object();
std::vector<float> vertices = {
0.5f, 0.5f... |
b7917377835a86bf779c113d18eb8301d17d03d3 | 32fccf3e02d493548da2b96d328e46a686f19c21 | John-Ad/Maze-Pathfinder | /Snake.cpp | C++ | cpp | 2,670 | no_license | #include "Snake.h"
//___constructor/destructor______
Snake::Snake(int x[], int y[], int w, int h, int maxSz)
{
//snake initialization
height = h;
width = w;
maxSize = maxSz;
snakeX = new int[maxSize];
snakeY = new int[maxSize];
snake.push_back(RectangleShape());
snake[0].setFillColor(Color:... |
07dc7cc4335415493bcaf1ea9fca969f5327f1b3 | 3ce881eadadb32e51c8b72c814cd9a9003acdf83 | PengtaoJiang/caffe_latte | /include/caffe/blob.hpp | C++ | hpp | 9,423 | permissive | #ifndef CAFFE_BLOB_HPP_
#define CAFFE_BLOB_HPP_
#include <algorithm>
#include <string>
#include <vector>
#include "caffe/common.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/syncedmem.hpp"
const int kMaxBlobAxes = 32;
namespace caffe {
/**
* @brief A wrapper around SyncedMemory holders serving as the bas... |
ea9352702f92397eeb0dc952f99c1028fd90b3a6 | 5bb5c207d6bf3add47badd731c00e5777b20b9b8 | spring/svn-spring-archive | /branches/nmapsys2/Sim/Projectiles/WakeProjectile.cpp | C++ | cpp | 2,040 | no_license | #include "StdAfx.h"
#include "WakeProjectile.h"
#include "Game/Camera.h"
#include "Rendering/GL/VertexArray.h"
#include "Sim/Misc/Wind.h"
#include "mmgr.h"
#include "Rendering/Env/BaseWater.h"
#include "ProjectileHandler.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruct... |
e1204f2fe747e2e17a2648b1cb8576d34aa2eeef | 6b0a147481384a976bd6dbd67c8db75d339459ce | clangen/autom8-legacy | /libautom8/src/device/x10/mochad/mochad_controller.cpp | C++ | cpp | 8,160 | permissive | #include <autom8/device/x10/mochad/mochad_controller.hpp>
#include <autom8/util/debug.hpp>
#include <autom8/util/utility.hpp>
#define TAG "mochad"
#undef LOG_CONNECTION
#undef LOG_SEND
static std::string default_mochad_host_ = "127.0.0.1";
static std::string default_mochad_port_ = "1099";
using namespace autom8;
usi... |
b7c143b6d338c9b06295a3d171de7924df32e291 | 8dcad9d16749d8bfe36488e633817ca4507a7099 | Mu2e/Offline | /Print/artProductSizes/RootSizeOnDisk.hh | C++ | hh | 3,428 | permissive | #ifndef ROOTtools_artProductSizes_RootSizeOnDisk_hh
#define ROOTtools_artProductSizes_RootSizeOnDisk_hh
//
// Collect information about the disk space used by the top tier and second
// tier objects inside an art format root event-data file.
//
// This is known to work for root 5.34.*
//
//
// The available information... |
29958624687947bf716874df0e384f68baac257c | 52297164a8087cb448ab6f04282ab024b0417c7d | carrysocks/algorithm | /bfs.cpp | C++ | cpp | 1,374 | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
class Graph{
public:
int size;
vector<vector<int>> adj;
queue<int> q;
vector<int> order;
Graph(int n){
size=n;
adj.resize(n);
}
void addEdge(int u,int v){
adj[u... |
d093517483829f6e9c9bc160561b3f55abc07c8a | de2177fb11269860be03600280072f8841f697b1 | albertparedandan/COMP3211 | /part_demo/assignment.cpp | C++ | cpp | 4,198 | no_license | //
// Created by Dekai WU and YAN Yuchen on 20190424.
//
#include "assignment.hpp"
#include <make_transducer.hpp>
#include <shared_utils.hpp>
using namespace tg;
using namespace std;
const char* STUDENT_ID = "20373300";
namespace part_demo {
unsigned const NUM_EPOCHS = 4;
static const unsigned EMBEDDING_SI... |
7e72952f5b4546b67e80b80bdcdd4d4f3089c096 | 3d76ed38c4867bbf7c3f1ba225d281c98f40936a | AOzvat/concole_app_count_char | /desktop_app/hello_world.cpp | C++ | cpp | 3,333 | no_license | // HelloWindowsDesktop.cpp
// compile with: /D_UNICODE /DUNICODE /DWIN32 /D_WINDOWS /c
#include <windows.h>
#include <stdlib.h>
#include <string.h>
#include <tchar.h>
// Global variables
// The main window class name.
static TCHAR szWindowClass[] = _T("DesktopApp");
// The string that appears in the application's t... |
9963855d63fc9590c724ff82570bf730d001b80c | c8060c08efe3ad91c338ec8db6fba9e4ffdb323f | cowlicks/library-astrodynamics | /bindings/python/src/LibraryAstrodynamicsPy/Trajectory/Orbit/Model.cpp | C++ | cpp | 2,554 | permissive | ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @project Library/Astrodynamics
/// @file LibraryAstrodynamicsPy/Trajectory/Orbit/Model.cpp
/// @author Lucas Brémond <lucas@lofto... |
7cd5f693960b00be306fdccce5a39fd18708398f | bd8d8f42367ffd3dbbe33ce6ee5571ea3672e3a5 | FightForDobro/uCode.cpp | /Sprint03/t06/main.cpp | C++ | cpp | 281 | no_license | #include <iostream>
#include <vector>
#include "isPalindrome.h"
int main(int argc, char** argv)
{
std::vector<int> arr {1, 2, 3, 2, 1};
std::string radar = "radar";
auto res = isPalindrome(radar.begin(), radar.end());
std::cout << res << std::endl;
return 0;
} |
be4e22596f9f409a98717f6bb20f019eccbfaebe | b88a5ed743061423453e1b86955dcec6f66bd328 | jayong93/GSProgramming | /ScriptSample/main.cpp | C++ | cpp | 1,262 | permissive | #include <cstdio>
#include <cstring>
#include <cstdlib>
#include "include/lua.hpp"
void display_error(lua_State* L) {
printf("Error: %s\n", lua_tostring(L, -1));
lua_pop(L, 1);
}
int addnum_c(lua_State* L) {
int a = (int)lua_tonumber(L, -2);
int b = (int)lua_tonumber(L, -1);
lua_pop(L, 3);
int result = a + b;
... |
26302c2defe3b54a9d9c25fd5a132f107b82daad | 824417c9829c9d67fbc96e1a418bb4aee6a6e8d3 | maurodelazeri/cpp-swiss-army-knife | /redisdb/db/crc32c.cc | C++ | cc | 20,363 | no_license | #include "crc32c.h"
#include <stddef.h>
#include <stdint.h>
#include "coding.h"
namespace crc32c {
namespace {
const uint32_t kByteExtensionTable[256] =
{
0x00000000, 0xf26b8303, 0xe13b70f7, 0x1350f3f4, 0xc79a971f, 0x35f1141c,
0x26a1e7e8, 0xd4ca64eb, 0x8ad958cf, 0x78b2dbcc, 0x6be22838, 0x9989ab3b,
0x4... |
1d3f57a5038bbf4a6f72289bc97b3d8e03d5ab15 | f49cc7db5d99cfde1f41ca17435ff3f3d3bfb9c8 | Tubbz-alt/TrainingTracer_Samples | /Mbed_Sample/STEP7/main.cpp | C++ | cpp | 3,197 | permissive | /*
* Mbed_Sample/STEP7/main.cpp
*
* Copyright(C) 2020 RT Corporation <support@rt-net.jp>
* All rights reserved.
*
* License: Apache License, Version 2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
*/
#include "mbed.h"
DigitalOut DIR_R(D12);
DigitalOut DIR_L(... |
ff661800fd0795671fbe593f21c3c521c97c0f9f | 057796573ca3f4c0c82a4a6a71bb625e1aa069da | ghcjs/sodium | /c++/tests/memory/switch-memory.cpp | C++ | cpp | 1,161 | no_license | #include <sodium/sodium.h>
#include <unistd.h>
using namespace sodium;
using namespace std;
/*!
* Run:
* valgrind --tool=massif memory/switch-memory
* massif-visualizer massif.out.*
*
* What you should see:
*
* flat memory usage profile (no leak)
*/
int main(int argc, char* argv[])
{
#define N... |
41b9bf1a5dda0657131146a2225fd85e8c1745ba | 3a0296fa66d642c4bd6849abfaac53bcae49cd10 | lnkuiper/duckdb | /src/catalog/catalog_entry/duck_table_entry.cpp | C++ | cpp | 29,353 | permissive | #include "duckdb/catalog/catalog_entry/duck_table_entry.hpp"
#include "duckdb/planner/binder.hpp"
#include "duckdb/planner/constraints/bound_check_constraint.hpp"
#include "duckdb/planner/constraints/bound_foreign_key_constraint.hpp"
#include "duckdb/planner/constraints/bound_not_null_constraint.hpp"
#include "duckdb/p... |
e0960e92d4ea5fd7e1933703bad6ca7f163db2a2 | d9661d2c2ef8d46990e46b229c41321a0779c6eb | cwhuang1937/CP | /contest/practice/UVa OJ 11988 Broken Keyboard (a.k.a. Beiju Text)/main.cpp | C++ | cpp | 626 | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
while(getline(cin, s)) {
list<char> vec;
list<char>::iterator it = vec.begin();
for(int i = 0; i < s.length(); ++i) {
if(s[i] == '[') {
it = vec.begin();
}
else... |
cf23e29124215601addaa4bd287a7b177caa57bc | 4691de9b907df0d236de888c94c0d3eadcd0068e | Jackkoz/SIK_3 | /server.cpp | C++ | cpp | 5,994 | no_license | #include <boost/program_options.hpp>
namespace po = boost::program_options;
#include <iostream>
#include <iterator>
#include <cstdlib>
#include <regex>
#include <boost/array.hpp>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
using namespace std;
using name... |
c0979dd19cc9937fc5074057ddb7f1175f82b345 | 7eb2cf111af40534fa760ccd2746e3180d42ce80 | uel-dataexchange/Opencascade_uel | /src/GeomFill/GeomFill_SectionPlacement.cxx | C++ | cxx | 27,310 | no_license | // File: GeomFill_SectionPlacement.cxx
// Created: Mon Dec 15 17:09:47 1997
// Author: Philippe MANGIN
// <pmn@sgi29>
#include <GeomFill_SectionPlacement.ixx>
#include <GeomLib.hxx>
#include <Geom_Plane.hxx>
#include <GeomLProp_CLProps.hxx>
#include <GeomAbs_CurveType.hxx>
#include <GeomAdaptor_HSurfac... |
6583625ea271e61fba372b0ae06d9a51cdc1880e | 40836e606f9d8b8d9e43a4bc3f7664bd672ffa1d | pouyapt/RPsimulation | /RPsimulation/BaseUnits.cpp | C++ | cpp | 21,333 | no_license | #include "BaseUnits.h"
double TrustA::mu_x_B(double x) {
return (p->theta-p->eta)/(p->beta+1)*(x+1)+p->eta;
}
double TrustA::mu_x_N(double x) {
return p->theta;
}
double TrustA::mu_x_G(double x) {
return (p->kappa-p->theta)/(1-p->epsilon-p->alpha)*(x-p->alpha)+p->theta;
}
double TrustA::mu_x_1(double... |
56f8aa00d55c243a22554f0d4bf57b3edf08f812 | 942450e0ebd4005790ee61dde2464e3183e7fb26 | ReedySplash/VJ_FIB_2DGAME | /2DGame/Scott Pilgrim/02-Bubble/Level2.cpp | C++ | cpp | 35,482 | no_license | #include <iostream>
#include <cmath>
#include <glm/gtc/matrix_transform.hpp>
#include "Level2.h"
#include "Game.h"
#define SCREEN_X 32
#define SCREEN_Y 16
#define INIT_PLAYER_X_TILES 50
#define INIT_PLAYER_Y_TILES 150
Level2::Level2()
{
}
Level2::~Level2()
{
}
void Level2::init(bool music, int pers)
{
if (mu... |
d05a633c29de821963c9162fc45ccfd5b760bc6c | 202b415cbf554acb143e1642506237ad733bbc36 | lucifer1004/codeforces | /1200/b/b.cc | C++ | cc | 557 | permissive | #include <iostream>
#include <vector>
using namespace std;
typedef long long ll;
class Solution {
public:
void solve() {
int n, m, k;
cin >> n >> m >> k;
vector<int> h(n);
for (int i = 0; i < n; ++i) cin >> h[i];
for (int i = 0; i < n - 1; ++i) {
if (h[i] + m < h[i + 1] - k) {
cou... |
01f650cdae1b8c83909313da722ebca0d5703a74 | ba2deb73236adcecf16122a4e8abebbd6cc7b41f | ahmedyarub/restinio | /dev/restinio/utils/base64.hpp | C++ | hpp | 3,641 | permissive | /*
restinio
*/
/*!
Base64 implementation.
*/
#pragma once
#include <restinio/exception.hpp>
#include <restinio/utils/impl/bitops.hpp>
#include <restinio/impl/include_fmtlib.hpp>
#include <string>
#include <bitset>
#include <array>
#include <exception>
#include <iostream> // std::cout, debug
namespace restinio
... |
2e024fb9bd56c83c4e96bfd6b2887c40ee0abc43 | 8a4b76ebdbbd4e551099c471af63583452f3fc41 | shuest/leetcode | /492.cpp | C++ | cpp | 479 | no_license | #include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<stack>
#include<queue>
using namespace std;
class Solution {
public:
vector<int> constructRectangle(int area) {
vector<int> result(2,0);
int l =... |
bb5759de2dd894bc18e22de832f229f97f30e844 | aa13a54814056d174b89d79ff2060c203b00f157 | noticeable/clockwork | /soda_codes/ps10_ps11/our_code/ps10_ps11_opt_host.cpp | C++ | cpp | 7,081 | no_license | #include "xcl2.hpp"
#include <algorithm>
#include <fstream>
#include <vector>
#include <cstdlib>
int main(int argc, char **argv) {
srand(234);
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " <XCLBIN File>" << std::endl;
return EXIT_FAILURE;
}
std::string binaryFile = argv[1];
int num_epochs... |
5433ea3ce3628b2c804282a49f63e033fa18e921 | 33e6f805a8606d7bcad044190b21be1a7bdc45a9 | XBQ314/School-assignment | /成绩查询/sheet_2.cpp | C++ | cpp | 2,584 | no_license | #include <iostream>
#include <string>
#include "head.h"
std::string::size_type position;
void sheet_2()
{
if (quanti == 1&& banji == 0&& geren == 0)
{
std::cout<<"Up or Down?Up 0,Down 1."<<std::endl;
std::cin>>down;
if(ID == 1&&NAME == 0&&POINT == 0)//选择全体查询,按学号排序
{
whole_paixu_id();
}
... |
82420c9a2d30583b1d62e4ad48e163702043eec8 | 8bc41a7e5a38e41a89a01ad91a33a2fda8747736 | JoshuaEbenezer/Computer-Vision | /PrewittEdge.cpp | C++ | cpp | 765 | no_license | /*#include "stdafx.h"
#include <opencv2\opencv.hpp>
#include<math.h>
using namespace cv;
using namespace std;
int main()
{
int gx, gy, g;
Mat im1 = imread("BlobRace.png", 0);
Mat im2(im1.rows, im1.cols, CV_8UC1, 22);
int ax[3][3] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
namedWindow("test2", WINDOW_AU... |
de6ed41572ce1d3680ce56758b60423cad34a312 | 28deeb1297b1867f6e361ec2cb1517d9b6c8b56c | yashgarg2107/Competitive-Coding | /two_closest_points.cpp | C++ | cpp | 2,982 | no_license | // Implementation of algorithm for finding two closest pair of points.
// Implementation when dist computation are done with squares of euclidean dist.
struct pt {
ll x, y, id;
};
struct cmp_x {
bool operator()(const pt & a, const pt & b) const {
return a.x < b.x || (a.x == b.x && a.y < b.y);
}
};... |
785987ce861531799e6e77a1d1e5387fb986db06 | a6f070005f365d2eb9268318aa4e8fd99f7c3771 | molllyn1/zeus-sdk | /boxes/groups/sample/simple-assets-peg/contracts/eos/sanftpegx/sanftpegx.cpp | C++ | cpp | 15,479 | no_license | #define LIQUIDX
#include "../json/json.hpp"
#include "../dappservices/link.hpp"
#define CONTRACT_NAME() sanftpegx
#undef MESSAGE_RECEIVED_HOOK
#define MESSAGE_RECEIVED_HOOK(message) transfer_received(message);
#undef MESSAGE_RECEIPT_HOOK
#define MESSAGE_RECEIPT_HOOK(receipt) transfer_receipt(receipt);
// name of ass... |
54fa6c3da1b99342ac974b8de104c64b95c272c7 | c9eff79e1e37c20741cf95822dfaace8e7bcbb67 | Freethetan/INFO3111-S21 | /Day2Day/Day_05 (lighting 2)/LightManager/cLightHelper.cpp | C++ | cpp | 4,896 | permissive | #include "cLightHelper.h"
//static
const float cLightHelper::DEFAULT_ATTEN_CONST = 0.1f;
//static
const float cLightHelper::DEFAULT_ATTEN_LINEAR = 0.1f;
//static
const float cLightHelper::DEFAULT_ATTEN_QUADRATIC = 0.1f;
//static
const float cLightHelper::DEFAULT_AMBIENT_TO_DIFFUSE_RATIO = 0.8f;
//static
const... |
53c9e69fd0c046a8b1916f1c0809d6bb09cf8706 | aac872d318215497b2d09720bf4d387500cd0fe9 | dbazin00/Cuda_Convolution | /CudaConvolution/helpers.cpp | C++ | cpp | 1,116 | no_license | #include "helpers.h"
#include <iostream>
#include <cmath>
void getError(cudaError_t err) {
if (err != cudaSuccess) {
std::cout << "Error " << cudaGetErrorString(err) << std::endl;
}
}
float* gaussianDistance(float sigma, const int fsize) {
const int size = 2 * fsize + 1;
float* kernel = new fl... |
bd81075a59aa5d075fef64a87132325003a0f449 | b1a4705ee83935541870b0e7b50142bf8f56692e | smalls12/blokus | /interface/IRegisterRequest.hpp | C++ | hpp | 276 | permissive | #pragma once
#include <string>
class IRegisterRequest
{
public:
virtual void SetUsername(std::string username) = 0;
virtual std::string GetUsername() = 0;
virtual void SetUuid(std::string uuid) = 0;
virtual std::string GetUuid() = 0;
}; |
6dbc8ebe680780664b1835da3c205aca602c63c2 | e8077d3edded43a63f7a372d7285ccde33a1aa07 | bpawlow/Soduku-Game | /src/ui.cxx | C++ | cxx | 18,024 | no_license | #include "ui.hxx"
#include "model.hxx"
#include <iostream>
#include <cstdlib>
#include<ctype.h>
#include <ge211_event.hxx>
// What needs to be done : The draw function needs to be fixed : look at the
// brick out one. The
// geometry.hxx file in brick out is really helpful on getting the spacing
// between each box.
... |
6bd444b11ce7751e60e57053c9be7a73c7d7ebc5 | f3814a09fab3b2b0153bc6738940e318b748f559 | KVdan/birthday_paradoxy | /main.cpp | C++ | cpp | 439 | permissive | #include <iostream>
#include <cmath>
int main()
{
int p=0;
float res = 1;
float num=365;
float n=365;
// it`s important to set res,num,n to float data type
while(res>0.5)
{
res *=(n/num);
n--;
p++;
}
std::cout<<"When # of people equals "<<p<<", th... |
0de5d0739bc49a2fafca6ba223258e740abc8f7b | d2c5f1fddf6dd7eb2c89c67ab259879be94b7a86 | xiaoqgao/windows_embedded_7_2014M12 | /windows_embedded_7_2014M12/WINCE700/private/servers/asp/collects/dict.cpp | C++ | cpp | 20,659 | no_license | //
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft shared
// source or premium shared source license agreement under which you licensed
// this source code. If you did not accept the terms of the license agreement,
// you are... |
4a57b2fa3d9f0fe431f2d158f41bb796b2a3da9f | b944e7001d2378adea0645a8732fb550bbe4022f | Jonatankk/codigos | /URIOJ/uri1471.cpp | C++ | cpp | 594 | no_license | #include<stdio.h>
#include<vector>
#define MAX 11234
using namespace std;
int main(){
vector<bool> vivos;
int N, R, placa, i, cont;
while(scanf("%d %d", &N, &R) != EOF){
vivos.assign(N+1, false);
cont = 0;
for(i = 0; i < R; i++){
scanf("%d", &placa);
vivos[pl... |
68a6a8dfc8396bead7b05b4e0ef20d8c26221e6f | fed5327ffcddabe5e2874931d28b0cdcb4c516f6 | bremoran/microbit-dal | /source/drivers/MicroBitRadio.cpp | C++ | cpp | 17,415 | permissive | /*
The MIT License (MIT)
Copyright (c) 2016 British Broadcasting Corporation.
This software is provided by Lancaster University by arrangement with the BBC.
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... |
8f83649488b6f4027cc4554ce1a4b166f09f6a8c | 4f4ad96a917d56ad2b13371dfe8b37c125dbf45e | GambleCoin-Project/GambleCoin | /src/masternodeconfig.cpp | C++ | cpp | 4,084 | permissive | // Copyright (c) 2014-2015 The Dash developers
// Copyright (c) 2015-2017 The PIVX developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
// clang-format off
#include "net.h"
#include "masternodeconfig.h"
#include "util.... |
d3cd1df216701051f6dfa2809ccc31dd1420e16c | 42d9ebfe8d0057fc4fa80c1bdb18dc3bcf601ea7 | uday60/blogCodes2 | /libs/mxnet/generic_predictor.hpp | C++ | hpp | 5,256 | no_license | #ifndef GENERIC_PREDICT_FUNCTIONS_HPP
#define GENERIC_PREDICT_FUNCTIONS_HPP
#include "common.hpp"
#include "image_converter_functor/dlib_mat_to_separate_rgb.hpp"
#include <mxnet-cpp/MxNetCpp.h>
#include <vector>
namespace ocv{
namespace mxnet_aux{
/**
*A generic class for mxnet cnn predictor
*@param Return Retur... |
a6465b1c51fbcb2c682e46cbc820e1174507d8a4 | 728f2518a2445e7fed3d87a2593764a8f2784d36 | shelbaz/KingOfNewYork | /King of New York/King of New York/GameTokens.cpp | C++ | cpp | 2,959 | no_license | //
// Created by Shawn Elbaz on 2018-10-11.
//
#include "GameTokens.h"
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
std::string GameTokens::getName() {
return tokenTypeName[token];
}
GameTokens::GameTokens() {
TokenTypes token;
}
GameTokens::GameTokens(TokenTypes name): ... |
4e10e342e75ec18c1bd5b043695b4aaf3efea029 | 26c2631017ea1c919a7b60054cc7274b0a3a2bb2 | Famzy/chromium | /content/browser/browser_child_process_host_impl.cc | C++ | cc | 24,732 | permissive | // Copyright (c) 2012 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/browser_child_process_host_impl.h"
#include "base/base_switches.h"
#include "base/bind.h"
#include "base/command_line.h"
#i... |
5ce3f348656243def518ea63649f2c5451f5663a | 53fb2963d4b8dc0d177161653e6e43d23af16b10 | mengtest/private | /keye-1.1/keye/wsio/ws_svc_handler.cpp | C++ | cpp | 2,124 | no_license | // --------------------------------------------------------
/*Copyright KeyeLeo.All rights reserved.
*
*File : svc_handler.h
*Desc :
*Version : 1.0
*Program : KeyeLeo
*Date : 2012-09-31
*/
// --------------------------------------------------------
#include "stdafx.h"
#include "wsio_fwd.h"
#inclu... |
35af26610303d495d3279b2e3ec30169f415d4d7 | c8dacf815fe5a94f0410ebe5235bb3d66adbe4df | cowtony/ACM | /LintCode/c++/1305. Integer to English Words.cpp | C++ | cpp | 1,875 | no_license | class Solution {
public:
/**
* @param num: a non-negative integer
* @return: english words representation
*/
string numberToWords(int num) {
if (num == 0) {
return "Zero";
}
const unordered_map<int, string> kUnit = {
{0, ""},
{1, " Thous... |
e65a7a0f88d5486f9054a22a235f524912c13265 | f9144799d726d9d2894bd94b11f1a877df7cb0b4 | tmsimont/cache-simulator | /trace/Address.cc | C++ | cc | 686 | no_license | /* Author: Cory Linfield, Trevor Simonton, Rania Abdraba, and Anthony Pfaff
Course: CSCI 5593
Project: Semester Project Implementation
File: Address.cc
*/
#include <cassert>
#include <iomanip>
#include <iostream>
#include <string>
#include <iterator>
#include "Address.h"
using namespace std;
address... |
d1e6fb02668c9a0c14288a678166d0b0734e1a33 | 2c4dd60ec2251191ea5b9c452635e78f32fcef11 | UncleKhab/cpp-probleme | /probleme/sume_produse_numarari/hidden_number.cpp | C++ | cpp | 365 | no_license | #include <iostream>
#include <fstream>
std::ifstream fin("hidden_number.in");
std::ofstream fout("hidden_number.out");
int main()
{
int n, sum = 0, cnt = 0;
while (fin >> n)
{
sum += n;
cnt++;
}
int m = sum / cnt;
if (m * cnt == sum)
{
fout << m << "\n";
}
e... |
dbab74f61ddc8561f17188534da92375c20375ae | c6c96a0968a149ce8473a7b6d4f8c973e3e2aed2 | kirtan18/Codechef-Problem-Solution | /Space Arrays.cpp | C++ | cpp | 624 | no_license | void solve(){
lli n;cin>>n;
lli arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
sort(arr,arr+n);
lli temp =0;
int flag = 1;
for(lli i=0;i<n;i++){
if(arr[i] > (i+1)){
flag = 0;
}
temp += (i+1)-arr[i];
}
if(flag == 0){
cout<<"Second"<<... |
6a28c175bbdb63a54f6b65b4d8c68d53185c8443 | 430aa706fdc0f45e0d415d54f40cb32dab9a9027 | a-kashirin-official/spbspu-labs-2018 | /chernyshev.mikhail/common/shape.hpp | C++ | hpp | 438 | no_license | #ifndef SHAPE_HPP
#define SHAPE_HPP
#include "base-types.hpp"
namespace chernyshev
{
class Shape
{
public:
virtual ~Shape() = default;
virtual double getArea()const = 0;
virtual rectangle_t getFrameRect()const = 0;
virtual void Move(double delta_x,double delta_y) = 0;
virtual void Move(p... |
4663466c6cdb21457abbe6e45f20fc1faed12154 | ef0e7f33cd072a55fb9bb0158d0ff1e22239ad5e | nfschina/nfs-browser | /third_party/aria2/test/PriorityPieceSelectorTest.cc | C++ | cc | 1,185 | permissive | #include "PriorityPieceSelector.h"
#include <cppunit/extensions/HelperMacros.h>
#include "array_fun.h"
#include "BitfieldMan.h"
#include "MockPieceSelector.h"
namespace aria2 {
class PriorityPieceSelectorTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(PriorityPieceSelectorTest);
CPPUNIT_TEST(testSelect);... |
37e97781a8dc2e8b9076202f3cff9fb906b21c01 | 87caf36c53fbf603adbabb658f22beba5d1791d1 | OpenWaterAnalytics/epanet-rtx | /src/TimeSeriesFilterSecondary.cpp | C++ | cpp | 1,184 | permissive | //
// TimeSeriesFilterSecondary.cpp
// epanet-rtx
//
// Created by Sam Hatchett on 2/15/16.
//
//
#include "TimeSeriesFilterSecondary.h"
using namespace RTX;
void TimeSeriesFilterSecondary::setSecondary(TimeSeries::_sp secondary) {
if (this->canSetSecondary(secondary)) {
_secondary = secondary;
this->di... |
39a906be8088b8aa9a66ace22b1dab27a195794d | 75d9793fc08f3fad26787a13e95c0c674e72f576 | intelsdi-x/intelRSD | /PSME/agent/compute/include/discovery/builders/network_device_builder.hpp | C++ | hpp | 1,690 | permissive | /*!
* @brief Network device builder class interface.
*
* @header{License}
* @copyright Copyright (c) 2017-2018 Intel Corporation.
*
* 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:... |
3637834a2a2598cdf824b798c5d04b93c91a61dc | e62015ca665c6d4ea10f1d7b36bc1bbecf22bb7a | tewk/CGoGN | /Apps/Tuto/Traversals/traverse_attributes.cpp | C++ | cpp | 3,881 | no_license | /*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg ... |
39b182a12d14b594761b95f418d07cb379a10e1a | 9cb08d056bbd0c4caf74bda350b89e708cfed201 | nicowxd/Competitive-Programming | /CodCad/DataStructures/UnionFind/B.cpp | C++ | cpp | 1,063 | no_license | #include <bits/stdc++.h>
using namespace std;
const int MAXN = 100100;
int p[MAXN], r[MAXN], v[MAXN];
int findSet(int i)
{
return (p[i] == i) ? i : (p[i] = findSet(p[i]));
}
bool isSameSet(int a, int b)
{
return findSet(a) == findSet(b);
}
void unionSet(int a, int b)
{
if (!isSameSet(a,b))
{
int x = findSet... |
0564410e07fc784c9d75b71f47979ca215dcb49b | 444f00dcc84ce26e54f8e89c8a1460405230f72e | Twice5846/ut4-cheat | /UT4-Cheat/SDK/UT4_UTDMG_LightningProj_classes.hpp | C++ | hpp | 673 | no_license | #pragma once
// Unreal Tournament 4 (Pre Alpha) SDK
#ifdef _MSC_VER
#pragma pack(push, 0x8)
#endif
namespace Classes
{
//---------------------------------------------------------------------------
//Classes
//---------------------------------------------------------------------------
// BlueprintGeneratedClass UTD... |
65e275a4a98cbd9a70d73d8ac54d2d2b74dada12 | c6cf5695d6bd13043b575b0434e1e4d3a56ce205 | nijiahe/code | /code/windows/cocos2dx/AnalysisOfCorrosion/CommonAlgorithm.cpp | C++ | cpp | 227 | no_license | #include "CommonAlgorithm.h"
double strToDouble(const char *str) {
__String* s = String::create( str);
return s->doubleValue();
}
int strToInt(const char *str) {
__String* s = String::create(str);
return s->intValue();
}
|
3f4493a84042a3bcfd9d45185ea18402d1ee2196 | b95fdd3fe96b3df7cc09fd01c0a3015f4371c043 | sh-lim/SHINCHON | /Software/SONIC-Ubuntu/b3d/madai_repo/rhic/b3d/src/eqofst/eqofst_threephase.cc | C++ | cc | 7,618 | no_license | #ifndef __INCLUDE_EQOFST_ThreePhase_CC__
#define __INCLUDE_EQOFST_ThreePhase_CC__
#include "eqofst.h"
CEqofst_ThreePhase::CEqofst_ThreePhase(CSpecies *hspecies_set,string parsfilename_set){
parsfilename=parsfilename_set;
parameterMap eqofstpars;
double kappa,dfact;
parameter::ReadParsFromFile(eqofstpars,parsfile... |
e146fafa9268a09c8575236d6a840a34320e2677 | 5583dde29f0c1646116e248a23df8fe22e538bd1 | yamamo2shun1/me4of | /src/ofApp.cpp | C++ | cpp | 1,849 | no_license | #include "ofApp.h"
#include "ext.h"
#include "ext_obex.h"
//--------------------------------------------------------------
void ofApp::setup() {
post("setup...");
ofBackground(bgColorRed, bgColorGreen, bgColorBlue, bgColorAlpha);
ofEnableAlphaBlending();
}
//---------------------------------------------------... |
5a5eb8288bc8d4db8139929147c33b0a4a0eb33f | d8f0ff831b3742f91473b45d0d821aebe052494f | ssw1991/C-Projects | /Level 4/Section 4.2/Exercise 8/Exercise 8/stack.hpp | C++ | hpp | 1,548 | no_license | #ifndef STACK_HPP
#define STACK_HPP
/*
Header file for a first in last out container with specific functionality
*/
#include <vector>
template <typename T>
class Stack
{
private:
std::vector<T> stack;
public:
Stack() : stack(std::vector<T>()) // Default by creating a stack with 0 elements
{};
Stack(std::... |
c7cbb945b8847fd3c65b55df0d2e0942c863e39f | 6df557820575a819db65ed7a96f4d8ed64b0934a | aprieels/3D-watermarking-spectral-decomposition | /dependencies/PyMesh/src/IO/MshLoader.cpp | C++ | cpp | 14,292 | permissive | /* This file is part of PyMesh. Copyright (c) 2015 by Qingnan Zhou */
#include "MshLoader.h"
#include <iostream>
#include <sstream>
#include <vector>
#include <Core/Exception.h>
using namespace PyMesh;
MshLoader::MshLoader(const std::string& filename) {
std::ifstream fin(filename.c_str(), std::ios::in | std::io... |
86b89ebe6b5facd773b32158fb0e99bd9ea39925 | 956545b508442937c185283c5d2acef0e3ef3736 | 21Gun5/XD-jishi-zhenti | /17_b.cpp | C++ | cpp | 1,255 | no_license | #include <iostream>
using namespace std;
/*
find查找子字符串,区分大小写;
toupper和tolower进行大小写转化,单个字符转;
*/
int main()
{
string str; //要找字符串
int flag, n, i, j;
cin >> str >> flag >> n;
for(i=0; i<n; i++)
{
string strx; //从此字符串里找
cin >> strx;
// cout << str << endl <... |
59b686d9e1d609b658e2c7300436889062a18fc4 | 95e96f55920095882f367d33d08c917015079554 | vijpandaturtle/cppND | /cpp-concurrent-traffic-simulation/src/TrafficLight.cpp | C++ | cpp | 2,294 | no_license | #include <iostream>
#include <random>
#include "TrafficLight.h"
/* Implementation of class "MessageQueue" */
template <typename T>
T MessageQueue<T>::receive()
{
// FP.5a : The method receive should use std::unique_lock<std::mutex> and _condition.wait()
// to wait for and receive new messages and pull them f... |
df9f536bfbfa49584c25f6288129009acbadb025 | 2dacc340af865e4d2802d9faa9e17beafb2130a8 | tatsumack/atcoder | /abc189/ASlot.cpp | C++ | cpp | 668 | no_license | #include <bits/stdc++.h>
#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " ... |
77d35aa6ef2c59d9f23e1a1ad4c11e71676bf015 | e23a09bfa2e7af013d21f5b7740525ae69538a06 | zhan2016/vimrid | /imebra/src/base/src/baseObject.cpp | C++ | cpp | 12,961 | no_license | /*
0.0.46
Imebra: a C++ dicom library.
Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 by Paolo Brandoli
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
as published by the Free Software Foundation.
This progr... |
d04e31d02d6e7b16926cea6dbc3d0dbf4a7fea67 | 593f94bb10833fa4042f28c32c24d28589232b51 | DragonJoker/Castor3D | /include/Core/CastorUtils/Align/AlignModule.hpp | C++ | hpp | 1,181 | permissive | /*
See LICENSE file in root folder
*/
#ifndef ___CU_AlignModule_HPP___
#define ___CU_AlignModule_HPP___
#pragma once
#include "CastorUtils/CastorUtils.hpp"
#if defined( CU_CompilerMSVC )
# define CU_Alignas( a ) alignas( a )
#else
# define CU_Alignas( a )
#endif
namespace castor
{
/**@name Align */
//@{
/**
\~en... |
10745dd6cc02f6e37e033a5a73d1b6fcf8d2ea89 | b63d80779cc15e8ed6ba60337329765d67df6e0f | rockduan/androidN-android-7.1.1_r28 | /WORKING_DIRECTORY/system/connectivity/shill/mock_metrics.cc | C++ | cc | 790 | permissive | //
// Copyright (C) 2012 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... |
bc7a44ba2a8777e54a3a8ee647100c6615413611 | cabe24400b5994a3016f09c23281d581fc8407e9 | junxzm1990/ASAN-- | /testcases/juliet_test_suite/testcases/CWE190_Integer_Overflow/s01/CWE190_Integer_Overflow__char_max_square_33.cpp | C++ | cpp | 3,187 | no_license | /* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE190_Integer_Overflow__char_max_square_33.cpp
Label Definition File: CWE190_Integer_Overflow.label.xml
Template File: sources-sinks-33.tmpl.cpp
*/
/*
* @description
* CWE: 190 Integer Overflow
* BadSource: max Set data to the max value for char
* GoodSource: ... |
f989fdab00bb0dd2f6811666d43e318d1d3a2e0b | c10b716d9dd91ce14c8bd8379d4ba2c952c3e9c1 | yeohan/AdaptiveCards | /source/shared/cpp/ObjectModel/ImageSet.cpp | C++ | cpp | 3,186 | permissive | #include "pch.h"
#include "ImageSet.h"
#include "ParseUtil.h"
#include "Image.h"
using namespace AdaptiveCards;
ImageSet::ImageSet() :
BaseCardElement(CardElementType::ImageSet),
m_imageSize(ImageSize::None)
{
PopulateKnownPropertiesSet();
}
ImageSet::ImageSet(
Spacing spacing,
bool separation,
... |
5cadcc133536063f7b0e242b27de8ec63fa90160 | 29f75d1d099a59dba33b28f390e3085bb4a1de82 | Lukelectro/AccesSystem | /lib-arduino/ACNode/src/SIG1.cpp | C++ | cpp | 4,534 | permissive | #include <ACNode-private.h>
#include "SIG1.h"
// Note - none of below HMAC utility functions is re-entrant/t-safe; they all rely
// on some private static buffers one is not to meddle with in the 'meantime'.
//
static const char q2c[] = "0123456789abcdef"; // Do not 'uppercase' -- the HMACs are calculated over it - an... |
00796f1387be657941fdd3b1e8242b249cabc135 | 981999d52b25e2308e13ef1ed586c2f42e1d2b25 | PulakMajumdar81/Daily-DSA-prep | /gfg_kthLargestInAStream.cpp | C++ | cpp | 803 | no_license | #include<bits/stdc++.h>
// #include</home/wintersoldier/Desktop/test/pycpp.cpp>
using namespace std;
int main()
{
// utils ob;
int t;
cin>>t;
while(t--)
{
int k,n;
cin>>k>>n;
priority_queue<int,vector<int>, greater<int>> minHeap;
for(int i=0;i<n;i... |
2bd1f8b853f79c887b922a882794d1a009d9f9f0 | 1382919d09e3feb97045ce99b64ae2aef76711a7 | suncharm/HotPatcher | /HotPatcher/Source/HotPatcherRuntime/Private/HotPatcher.cpp | C++ | cpp | 2,308 | permissive | // Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "HotPatcherRuntime.h"
#include "FlibPatchParserHelper.h"
#include "ETargetPlatform.h"
#include "Interfaces/ITargetPlatform.h"
#include "Misc/EnumRange.h"
#if WITH_EDITOR
#include "Interfaces/ITargetPlatformManagerModule.h"
#endif
#defi... |
2885afbfeb506a5e6946f1d026ca72dc227045e9 | 88aff4a670894d0945cbb5027e418ce2b82ead9a | patrickschneider23/hhvm | /hphp/runtime/base/apc-stats.cpp | C++ | cpp | 17,827 | permissive | /*
+----------------------------------------------------------------------+
| HipHop for PHP |
+----------------------------------------------------------------------+
| Copyright (c) 2010-2013 Facebook, Inc. (http://www.facebook.com) |
+---------... |
fc4921f51e32da974aebaf81bca7c6b0d0976b09 | d6feb31d96327511aa3cf86798ae99bdeb0c7963 | fuzzpault/UIndy-CSCI230-2017-I | /W3-Representations/floatDisaster.cpp | C++ | cpp | 977 | no_license | /* Author: Paul Talaga
Date: Sept 18, 2017
Desc: Some demonstrations of issues with using floats
and doubles in C/C++.
*/
#include <iostream>
#include <cmath>
using namespace std;
int main(){
float a = 3000000000000000.0;
float b = 0.000000002;
cout << "a: " << a << endl;
cout << "b: " <<... |
4abb073029178f7b84b01fb3d8938df3bf85f3c2 | 0e850bfea1ec5f60c2e1b33746092e3d301b0f16 | gonzopancho/NBA | /elements/loadbalancers/GPUOnly.hh | C++ | hh | 1,250 | permissive | #ifndef __NBA_ELEMENT_GPUONLY_HH__
#define __NBA_ELEMENT_GPUONLY_HH__
#include <nba/element/element.hh>
#include <nba/element/annotation.hh>
#include <vector>
#include <string>
#include <rte_errno.h>
namespace nba {
class GPUOnly : public SchedulableElement, PerBatchElement {
public:
GPUOnly() : SchedulableEleme... |
49c1fa755be153f100d31ab112dece15e9a53d26 | 499aec9a13e28ce90b1fd5a33fbe5624c1bf93a6 | likewatchk/python-pcl | /VTK-7.1.1/Geovis/Core/vtkGeoAlignedImageRepresentation.cxx | C++ | cxx | 7,991 | permissive | /*=========================================================================
Program: Visualization Toolkit
Module: vtkGeoAlignedImageRepresentation.cxx
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
... |
a0fa79a7a278a5de6327c14342f6e82113d17ddd | bea0c69a2a09792db6f28d86025c8d6542a2f705 | Sobte/cqcppsdk | /src/core/exception.hpp | C++ | hpp | 927 | permissive | #pragma once
#include <exception>
#include <string>
namespace cq {
// cq 命名空间下所有异常类型的基类
struct Exception : std::exception {
Exception(const char *what_arg) : Exception(std::string(what_arg)) {
}
Exception(const std::string &what_arg) : _what_arg(what_arg) {
}
// 异常描述
... |
2df4d8a7660b8ff855d28e78552e13ccf18c2920 | 3f92d6992199d69c7abb0aa8bc0494ae740cfe0f | ZhengPeiRu21/mod-individual-progression | /src/wotlkScripts/IppWotlkModdedScripts.cpp | C++ | cpp | 5,975 | permissive | #include "IndividualProgression.h"
#include "Battlefield.h"
#include "BattlefieldMgr.h"
#include "ScriptedGossip.h"
#include "GameTime.h"
enum eWGqueuenpctext
{
WG_NPCQUEUE_TEXT_H_NOWAR = 14775,
WG_NPCQUEUE_TEXT_H_QUEUE = 14790,
WG_NPCQUEUE_TEXT_H_WAR = 14777,
WG_NPCQ... |
aa19b73ebd1d680f213218f740de480b7536f42b | db0648bbf63974d23a2d803706e544477521e71f | ristea123/PDA2 | /matrix_openCL/Project1/main.cpp | C++ | cpp | 4,077 | no_license | #define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.hpp>
#include <utility>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <array>
using namespace cl;
template <std::size_t M, std::size_t N>
using Matrix = std::array<std::array<int, N>, M>;
std::vector<Platform> platforms;
cl_context_... |
383f83e5ee8211e375f1aff965dfc9027c44eda1 | 183b3c0d65eddd8e046aeb0a1772118d06ab53eb | Mninek/Snake-Clone | /game.cpp | C++ | cpp | 4,221 | no_license | #include "game.h"
void random(int &x, int &y)
{
srand(time(0));
x = 1 + rand() % (38 - 1);
y = 1 + rand() % (38 - 1);
}
void random2(int &x, int &y)
{
srand(time(0) + time(0));
x = 1 + rand() % (38 - 1);
y = 1 + rand() % (38 - 1);
}
Game::Game()
{
FPS = 15;
}
void Game::gameKeyCallback(G... |
829f44ba7660d59943efecae89525a4562161944 | 1a936af409b3d0dff05538e1707cc6e076212c5d | nestorjgc/Vigenere-Cipher-Program | /Code.cpp | C++ | cpp | 1,347 | no_license | #include <string>
#include <iostream>
using namespace std;
class Vigenere
{
public:
static string keyGen(string str, string key)
{
int strLen = str.size();
int index = 0;
while(key.size() != str.size()){
if( index == strLen ){
index = 0;
}
... |
2061c9facdd295c69f845f344da9d5b1bbb7d1aa | 24c745f73f70532e0950dc3a113b0349687b7ecb | guizya/SpareProjects | /KMeans_cpu_vs_gpu_cuda/KMeans/CpuMethods.cpp | C++ | cpp | 1,541 | no_license | #include "CpuMethods.h"
#include <iostream>
float CPU::calcLength(int pnt, int cluster)
{
float len = 0;
for (int dim = 0; dim < D; dim++) {
float t = (points[pnt * D + dim] - kmeans[cluster * D + dim]);
len += t * t;
}
return len;
}
void CPU::kmeansCPU() {
float minimal = 1E8;
int minIdx = -1;
vector<int>... |
d3d2bcd6f390aaa950158dc7acafc332aef8c4ec | 25f8ff683c5c8e835a571d3014899932f5cb5bab | 15831944/Template-Yang | /模本程序/模本程序.cpp | C++ | cpp | 8,100 | no_license | // 模本程序.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "模本程序.h"
#include <string>
#include <CommCtrl.h>
#pragma comment(lib,"Comctl32.lib")
#define MAX_LOADSTRING 100
// Global Variables:
HINSTANCE hInst; // current instance
TCHAR szTitle[MAX_LOADSTRING]; // The title ... |
ae11cb7169bd725f42779a88a6bd18eb988985aa | 0943a2f9ce6b4cc8be7d7e616c376f4eb7dc8e60 | sdlu1992/LittleBall_Cocos2dx | /libs/extensions/GUI/CCControlExtension/CCControlColourPicker.cpp | C++ | cpp | 7,152 | no_license | /*
* Copyright (c) 2012 cocos2d-x.org
* http://www.cocos2d-x.org
*
* Copyright 2012 Stewart Hamilton-Arrandale.
* http://creativewax.co.uk
*
* Modified by Yannick Loriot.
* http://yannickloriot.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associ... |
72301d526c1a42c4a191422bd8f91bd4a74ef9b2 | a62a0fcdba24d80ac47f993a77fc8a027038fd03 | phylib/pips-scenario | /extensions/apps/probeData-producer.cpp | C++ | cpp | 4,537 | permissive | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
* Copyright (c) 2011-2015 Regents of the University of California.
*
* This file is part of ndnSIM. See AUTHORS for complete list of ndnSIM authors and
* contributors.
*
* ndnSIM is free software: you can redistribute it and/or modify it under... |
017ecd52d0fbb2a999393ef1c43e3fb434b11dde | e45e2d51e55c6c1e57fbb481730fcf915aefcbe3 | droidsde/CoolStars | /Classes/GuideView.cpp | C++ | cpp | 4,828 | no_license | #include "GuideView.h"
#include "UiLayout.h"
#include "CommonUtil.h"
#include "CommonMacros.h"
#include "DataManager.h"
#include "GuideMgr.h"
USING_NS_CC;
using namespace std;
float GuideView::kRefWidth = 480;
float GuideView::kRefHeight = 800;
GuideView::GuideView(int guideId)
: m_guideId(guideId)
, m_layout(NULL)
,... |
d03742372f91738214b75c13de951fbf62353170 | 380269ae6b339edbc1dc76277f793e9c3bdc543a | sgzwiz/xbox_leak_may_2020 | /xbox_leak_may_2020/xbox trunk/xbox/private/windows/directx/dplay/sp/wsock/adapterentry.cpp | C++ | cpp | 7,559 | no_license | /*==========================================================================
*
* Copyright (C) 2000-2000 Microsoft Corporation. All Rights Reserved.
*
* File: AdapterEntry.cpp
* Content: Structure used in the list of active sockets
*
*
* History:
* Date By Reason
* ==== == ======
... |
92949157115d4abf6673835b5fce8c7a52c5cdbe | 834e3fcfbe346823b9d8b87e0e5f8a15a39702e1 | Yeluorag/ACM-ICPC-Code-Library | /CQU Training/Chongqing University Weekly Training (10.18)/C - Solve it!.cpp | C++ | cpp | 1,403 | no_license | #include <algorithm>
#include <iostream>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;
typedef long long LL;
#define mem(a, n) memset(a, n, sizeof(a))
#define rep(i, n) fo... |
1bfe579cb58c317447543b06c7065b87459d3812 | b375e54cae609c10f9c9a48821841155969fd5f9 | chayandeokar/c- | /primaenumber.cpp | C++ | cpp | 293 | no_license | #include<iostream>
using namespace std;
int main()
{
int n,i;
cout<<"enter no to check prime no: ";
cin>>n;
for( i=2; i<n; i++)
{
cout<<i<<endl;
if ((n%i)==0)
{
cout<<"not prime"<<endl;
break;
}
}
if(i==n)
{
cout<<"is a prime no "<<endl;
}
return 0;
}
|
aa3c25d0f5dbadce788a777d81c9b8f5b82f8c85 | ac926e52cb7f34e0b9e40a5889ca7d8c41a62fc6 | lvfangmin/mojo | /sky/engine/bindings-dart/core/dart/custom/DartEventCustom.cpp | C++ | cpp | 3,501 | permissive | // Copyright 2011, Google 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 list of conditions a... |
54da1c46bb9c7015be8af1458508a17e767700a2 | 248baf818d559e877a41339c154227e9e15bc93c | aaronkirkham/jc4-console-thingy | /deps/fw1/CFW1FontWrapper.cpp | C++ | cpp | 4,492 | permissive | // CFW1FontWrapper.cpp
#include "FW1Precompiled.h"
#include "CFW1FontWrapper.h"
#define SAFE_RELEASE(pObject) { if(pObject) { (pObject)->Release(); (pObject) = NULL; } }
namespace FW1FontWrapper {
// Construct
CFW1FontWrapper::CFW1FontWrapper() :
m_pDevice(NULL),
m_featureLevel(D3D_FEATURE_LEVEL_9_1),
m_pDWri... |
611f6f83d2200c6d5c40b243baec1297d37570e1 | f98b19a131732d42f3502539eebb0db26c16282a | zxw610/rlss | /include/rlss/internal/JSONBuilder.hpp | C++ | hpp | 11,705 | permissive | #ifndef RLSS_JSON_BUILDER_HPP
#define RLSS_JSON_BUILDER_HPP
#include "../../../third_party/json.hpp"
#include <rlss/internal/Util.hpp>
#include <fstream>
#include <splx/curve/PiecewiseCurve.hpp>
namespace rlss {
namespace internal {
namespace jsonbuilder {
long long int file_count = 0;
... |
f8fb94af0116a144577b44c9a467d74aae7028c0 | 2cbde3a7c949e390a6dc0335fda05e9694de0c6f | grav/beatthebox | /UnitTests/MFCCTest.cpp | C++ | cpp | 1,121 | no_license | //
// MFCCTest.cpp
// BeatTheBox
//
// Created by Mikkel Gravgaard on 12/05/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#include "gtest/gtest.h"
#include "MFCC.h"
TEST(MFCCTest, TestTable){
MFCC<double>::init(256, 13, 44100, 20, 20000);
EXPECT_TRUE(abs(0.9811-MFCC<double>::amplitude(9... |
d0df29f6bb6356a1c11d5fdb80f98cbae8581c55 | ad136a499e0b072b64687fee11a04c5a48fff9fb | YMChenLiye/cpp_primer | /chapter10/10.3.4/ex_10_22.cc | C++ | cc | 458 | no_license | #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;
using std::placeholders::_1;
bool foo(const string &s,int sz)
{
return s.size()>sz;
}
int main()
{
vector<string> vec;
string wo... |
b1b0a6e6a580e862b1e54083f7eca657b333e91d | 363ac076e143a4d28dfa36f4476c6cd046e38f92 | richardjcy1/CP | /GeeksForGeeks/Math/ModInverse.cpp | C++ | cpp | 766 | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
int gcdExtended(int a, int b, int* x, int* y)
{
if (a == 0)
{
*x = 0, *y = 1;
return b;
}
int x1, y1;
int gcd = gcdExtended(b % a, a, &x1, &y1);
*x = y1 - (b... |
f3f27128801b6c80a776ab5dcca4786b29150945 | d8f818c02dd5e2db41e8b5f301396e6fe94cf7b5 | B4rabbas/alive_reversing | /Source/AliveLibAE/ScreenShake.cpp | C++ | cpp | 4,382 | no_license | #include "stdafx.h"
#include "ScreenShake.hpp"
#include "Function.hpp"
#include "Events.hpp"
#include "stdlib.hpp"
#include "PsxDisplay.hpp"
#include "ScreenManager.hpp"
#include "PsxRender.hpp"
#include "Game.hpp"
EXPORT ScreenShake* ScreenShake::ctor_4ACF70(__int16 enableShakeEvent, __int16 softerShakes)
{
BaseG... |
bebcd0ff78a6d2c4a659b64c5a8b2d921c812549 | 52b33582722813d0b6fff0bc766a3f490be1f853 | hetter/ParaCraftMobile | /frameworks/runtime-src/Classes/platform/mac/ParaEngineApp.cpp | C++ | cpp | 13,092 | no_license | //-----------------------------------------------------------------------------
// Class: CParaEngine
// Authors: LiXizhi
// Emails: LiXizhi@yeah.net
// Company: ParaEngine
// Date: 2014.8
// Desc: Just for mobile version (android, iOS, cocos2dx) used by AppDelegate
//---------------------------------------------------... |
27fc961e8816334d08aeb567aadedfda0f108834 | b34b7dc6d7bf80a0f01e2d2a555d2579a81adbab | pantadeusz/mhe | /dawniejsze/older/2019_2020/04-tsp-full-experiment/src/solver_sa.hpp | C++ | hpp | 1,203 | permissive | #ifndef __SOLVER__SIMULATED_ANNEALING_HPP____
#define __SOLVER__SIMULATED_ANNEALING_HPP____
#include <cmath>
#include <iostream>
#include <map>
#include <list>
// minimalizujemy funkcje f
auto simulated_annealing = [](auto gen_random_sol, // losowy punkt startu
auto get_random_neighbour,... |
a7366db8d9a5c58424bb39b84256e1601d90f6d7 | 2c0df45e6a919f56656090d78a3a512b4bf4945f | xujj25/leetcode-HW | /week14/src/constructBinaryTreeFromInorderAndPostorderTraversal.cpp | C++ | cpp | 1,976 | no_license | #include <iostream>
#include <vector>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
TreeNode* getTreeNode(vector<int>& inOrder, vector<int>& postOrder,
int... |
89ea2265ebaaba9172b5a0950a09c8882bc483fc | 41c42668d349085ed256ab515e5ce2f81e8f8dc8 | robou3p/robot | /Button.cpp | C++ | cpp | 565 | no_license | #include "Button.h"
/**
* @brief Construct a new Button:: Button object
*
*/
Button::Button()
{
}
/**
* @brief Checks whether the button is pressed.
*
* @return uint8_t Button state, true if pressed.
*/
uint8_t Button::pressed()
{
if (hasBeenPressed)
{
hasBeenPressed = 0;
return 1;
}
return !... |
eb87031b5d8b55a036273d6808fcb706b6171b0f | f4e55aa42305d46c9446e3b928e7fc663ebeb55c | DOCGroup/XSC | /contrib/CCF/CCF/CCF/IDL3/SemanticAction/Impl/Include.cpp | C++ | cpp | 8,386 | no_license | // file : CCF/IDL3/SemanticAction/Impl/Include.cpp
// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
#include "CCF/IDL3/SemanticAction/Impl/Include.hpp"
#include "CCF/CompilerElements/TokenStream.hpp"
#include "CCF/CompilerElements/Preprocessor.hpp"
#include "CCF/IDL3/LexicalAnalyzer.hpp"
#include "CCF/... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.