blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 117 | path stringlengths 3 268 | src_encoding stringclasses 34
values | length_bytes int64 6 4.23M | score float64 2.52 5.19 | int_score int64 3 5 | detected_licenses listlengths 0 85 | license_type stringclasses 2
values | text stringlengths 13 4.23M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
80ed93df2edd890c17ee1defeb0a9220d82fc335 | C++ | alexyuehuang/OOP_Projects | /Lab_2/Lab02/Board.h | UTF-8 | 508 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include "game_pieces.h"
#include <vector>
//use standard namespace
using namespace std;
struct piece {
string name;
string display;
colors color = invalid;
};
//functions
int dimensions(ifstream& a, unsigned int& b, unsigned int& c);
int read(ifstream& a, ve... | true |
2a1439bd42740d951150ae76d86af6b74b025214 | C++ | qiyang0221/leetcode | /Construct Binary Tree from Preorder and Inorder Traversal.cpp | GB18030 | 1,855 | 3.71875 | 4 | [] | no_license | //
//description:
//
//
//solution
//ʾʼֹ
//ĵһмֵ
#include<iostream>
#include<cstdio>
#include<cstdlib>
#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 *buildTree(... | true |
0db84225dfb164132f7e62ea0bfc8a0de192eb9f | C++ | LencoDigitexer/VSCode_borland_setup | /pr/pr28_EIN.cpp | IBM866 | 4,631 | 3.328125 | 3 | [
"MIT"
] | permissive | #include <iostream.h>
#include <iomanip.h>
#include <conio.h>
#include <math.h>
#include"..\\h\\wind.h"
#include"..\\h\\page_1.h"
class conus{
private:
float h, R, r, V, S;
public:
// ࠬࠬ 㬮砭
// i -> 'i'nput
conus(float hi = 7, float Ri = 10, float ri = 4);
int get_R(... | true |
1521858bdd991dead1315236001c1de4fcd6fc16 | C++ | Xenakios/XenakiosModules | /dep/rubberband/src/audiocurves/PercussiveAudioCurve.cpp | UTF-8 | 3,240 | 2.546875 | 3 | [] | no_license | /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
/*
Rubber Band Library
An audio time-stretching and pitch-shifting library.
Copyright 2007-2020 Particular Programs Ltd.
This program is free software; you can redistribute it and/or
modify it under the terms of... | true |
8cc73de5f5114f5bba980a4bf6b4206e727f702a | C++ | mpzadmin/yuc | /Afzalabadi/base.cpp | UTF-8 | 432 | 3 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
void delay(int delaynumber = 100000000);
int main()
{
string charector ;
cout << "Enter your charector :";
getline(cin, charector);
for( int index = 0; index < charector.length(); index++ )
{
cout << charector[index];
del... | true |
fc6eecf2b641ad4b15df5b07d1c6653e7d5fa92a | C++ | abozb01/ee205-final | /include/common.h | UTF-8 | 766 | 2.703125 | 3 | [] | no_license |
#pragma once
#include <SFML/Graphics.hpp>
#include <iostream>
#include <string>
#define WIDTH 1280
#define HEIGHT 720
#define PRINT(x) std::cout << x << std::endl
#define ROUND2(x) ((int)(x * 100)) / 100.f
#define STR(x) std::to_string(x)
using vec2i = sf::Vector2i;
using std::string;
class vec2;... | true |
877530acf92835a743a9f8c8b9bac246fb6876f8 | C++ | xubury/FoggyEngine | /Engine/TileMap/Map.hpp | UTF-8 | 6,251 | 2.828125 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef MAP_HPP
#define MAP_HPP
#include "TileMap/Layer.hpp"
#include "TileMap/Tile.hpp"
#include "TileMap/VMap.hpp"
#include "iostream"
namespace foggy {
template <typename GEOMETRY>
class Map : public VMap {
public:
Map(const Map&) = delete;
Map& operator=(const Map&) = delete;
Map(float size);
... | true |
b6308c455f9b18c4eb614b377f61e186ffb4f652 | C++ | lululombard/SenseoOnlineArduino | /Boiler.cpp | UTF-8 | 708 | 3 | 3 | [] | no_license | #include "Boiler.h"
int max_temp = 410;
Boiler::Boiler(int pin_boiler, int pin_sensor) {
this->pin_boiler = pin_boiler;
this->pin_sensor = pin_sensor;
pinMode(pin_boiler, OUTPUT);
}
void Boiler::off() {
digitalWrite(pin_boiler, LOW);
}
void Boiler::on() {
digitalWrite(pin_boiler, HIGH);
}
boolean Boiler::st... | true |
4c8149c6ca99600118de1c2272b0b12e553a80df | C++ | yhzhm/Practice | /Course/ProgrammingContestChallengeSE/PCC 2.2.1 贪心 硬币问题.cpp | UTF-8 | 734 | 3.0625 | 3 | [] | no_license | /*
* 有1元、5元、10元、50元、100元的硬币各C1,C5,C10,C50,C100,C500枚。
* 现在要用这些硬币来支付A元,最少需要多少枚硬币?假定本题至少存在一种支付方案。
* 样例输入:c1=3 c5=2 c10=1 c50=3 c100=0 c500=2,a=620;
* 样例输出:6 (500 1枚 50 2枚 10 1枚 5 2枚 合计6枚)
*/
//
// Created by Hz Yang on 2017/5/9.
//硬币问题
#include <iostream>
using namespace std;
int main() {
const int v[6]={1,5,1... | true |
3b008e694e8a197fc0c5351c399309afa0064518 | C++ | drken1215/algorithm | /DataStructure/union_find_size.cpp | UTF-8 | 2,602 | 3.09375 | 3 | [
"CC0-1.0"
] | permissive | //
// Union-Find (union by size)
//
// verified:
// Yosupo Library Checker - Unionfind
// https://judge.yosupo.jp/problem/unionfind
//
// AOJ Course DSL_1_A Set - Disjoint Set: Union Find Tree
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_1_A&lang=jp
//
/*
併合時の工夫: union by rank
... | true |
0975172de5fb6e441d3698e61690bd9f1e36db7d | C++ | JoeDunnStable/how_much_data | /include/gauss_kronrod_impl.h | UTF-8 | 7,412 | 2.84375 | 3 | [
"LicenseRef-scancode-public-domain",
"MIT"
] | permissive | /// \file gauss_kronrod_impl.h
/// Implementation of routines to calculate nodes and weights
/// Included in file gauss_kronrod.h when LIBRARY is defined
/// \author Joseph Dunn
/// \copyright 2016, 2017, 2018 Joseph Dunn
/// \copyright Distributed under the terms of the GNU General Public License version 3
#include <... | true |
d7a72a16ca9db267de52ccd1f915b371892c23ac | C++ | newpolaris/tiny_imageformat | /tests/test_formatcracker.cpp | UTF-8 | 8,201 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "al2o3_platform/platform.h"
#include "al2o3_catch2/catch2.hpp"
#include "tiny_imageformat/tinyimageformat_base.h"
#include "tiny_imageformat/tinyimageformat_query.h"
#include <float.h>
TEST_CASE("Format Cracker IsDepthOnly (C)", "[Image]") {
for (uint32_t i = 0; i < TinyImageFormat_Count; ++i) {
TinyImag... | true |
eca92cd7787ffc1f1e9f3d74bc98574cb4fc1b1b | C++ | AndreasFMueller/AstroPhotography | /control/ice/server/StatisticsI.h | UTF-8 | 2,722 | 2.515625 | 3 | [] | no_license | /*
* StatisticsI.h
*
* (c) 2020 Prof Dr Andreas Müller, Hochschule Rapperswil
*/
#ifndef _StatisticsI_h
#define _StatisticsI_h
#include <types.h>
#include <map>
#include <string>
#include <list>
#include <memory>
namespace snowstar {
class CallStatistics;
typedef std::shared_ptr<CallStatistics> CallStatisticsPtr... | true |
de9a314b070488ae3109475c91d6a088f9735d27 | C++ | Han-nahh/Kattis-Solutions | /gearchanging.cpp | UTF-8 | 977 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int N, M;
double P;
int main() {
ios_base::sync_with_stdio(0);
cin >> N >> M >> P;
P /= 100;
vector<double> cranks, backs;
for (int i = 0; i < N; ++i) {
double x; cin >> x;
cranks.push_back(x);
}
for (int i = 0; i < M; ++i) {
... | true |
29d1c012ab01292ad21ba2d9cefae836831c8e6a | C++ | kanusahai/EPI | /practice/Enclosed.cpp | UTF-8 | 2,783 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<stack>
#include<cstring>
#include<cstdlib>
using namespace std;
struct Coordinates {
int x;
int y;
};
void DFS(char **matrix, Coordinates cn) {
stack<Coordinates> dfsStack;
int numCols = strlen(matrix[0]);
int numRows = numCols;
matrix[cn.x][cn.y]='G';
dfsStack.push(cn);
... | true |
d3cf08a13c443ec43e9f8c9fae60f8fa786ff9af | C++ | PHATHUY88/zendoo-mc-cryptolib | /mc_test/mcTestCall.cpp | UTF-8 | 3,818 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "zendoo_mc.h"
#include "hex_utils.h"
#include <iostream>
#include <cassert>
#include <string>
/*
* Usage:
* 1) ./mcTest "generate" "params_dir"
* 2) ./mcTest "create" <"-v"> "proof_path" "params_dir" "end_epoch_mc_b_hash" "prev_end_epoch_mc_b_hash" "quality"
* "constant" "pk_dest_0"... | true |
4074ba55c7b3bfffc5ae614b2a403fae349690b4 | C++ | ZephyrZhng/code_win | /data structure/题/2.12 字典序比较.cpp | UTF-8 | 608 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <string>
#include <numeric>
#include <iterator>
#include <algorithm>
using namespace std;
int lexicographical_compare(const string& a, const string& b)
{
int SHORT = a.size() <= b.size()? a.size(): b.size();
for(int i = ... | true |
f69fb17b27747d160b58b3bd0ace8d820df48644 | C++ | yacubovvs/CubOS_01b | /SDK/build/arduino/nano_SSD1206_128x64/cubos/app_settings.ino | UTF-8 | 13,732 | 2.578125 | 3 | [] | no_license | unsigned char delay_before_turnoff = 6;
/*
case 0: return "5 sec";
case 1: return "10 sec";
case 2: return "30 sec";
case 3: return "1 min";
case 4: return "2 min";
case 5: return "5 min";
case 6: return "10 min";
case 7: return "30 min";
case 8: return "45 min";
case 9: return "1 hour";
*/
#define appNameClass ... | true |
5badfc62d9964ed6a4b1fcb244cf22e50ae0b91f | C++ | lz-purple/Source | /app/src/main/java/com/syd/source/aosp/system/tpm/attestation/server/key_store.h | UTF-8 | 3,228 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | //
// Copyright (C) 2015 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... | true |
4a7caa2aba4b37d800a939b8f3aca4bfed1ede05 | C++ | Masters-Akt/CS_codes | /leetcode_sol/669-Trim_A_Binary_Search_Tree.cpp | UTF-8 | 942 | 3.453125 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | true |
54c250f6b9548ef00eeb3ffc07812510d1953759 | C++ | ryuukk/arc_cpp | /arc/src/math/Quat.cpp | UTF-8 | 449 | 2.796875 | 3 | [] | no_license | #include "Quat.h"
arc::Quat arc::Quat::fromAxis(arc::Vec3 axis, float rad) {
float d = Vec3::len(axis);
if (d == 0.f) return Quat::identity();
d = 1.0f / d;
float l_ang = rad < 0 ? Mathf::PI2() - (std::fmod(-rad, Mathf::PI2())) : std::fmod(rad, Mathf::PI2());
float l_sin = std::sin(l_ang / 2);
... | true |
e0e7c253238d0975b90e7f4dcbb67c1a27d23d94 | C++ | verngutz/cp-library | /Convolutions (Arithmetic) - Modular Convolution Square-Root Trick.cpp | UTF-8 | 1,523 | 2.890625 | 3 | [] | no_license | #include <bits/stdc++.h>
#include "Convolutions (Arithmetic) - Discrete Fourier Transform.cpp"
using namespace std;
template <typename T> vector<T>& operator+=(vector<T>& a, const vector<T>& b) {
transform(a.begin(), a.end(), b.begin(), a.begin(), plus<T>());
return a;
}
template <typename T> vector<T>& operato... | true |
1b068460eb0e0dd8684a4ed13e134db9826bf128 | C++ | LeandroRodriguez/fpietomrearoleanoagus | /ManejoArchivos/Bloque.cpp | UTF-8 | 5,943 | 3.4375 | 3 | [] | no_license | #include "Bloque.h"
/*constructor*/
Bloque::Bloque(const cantBytes& tamanio) {
this->tamanio = tamanio;
this->usados = 0;
this->registros = new list<RegistroVariable*>();
/*el nroBloque se lo setean desde afuera*/
}
Bloque::Bloque(){}
/*destructor*/
Bloque::~Bloque() {
}
/*devuelve true si el registro se p... | true |
52cf949c591505d19499d3566f6f6b069a007bfc | C++ | pradeep-k/graphlake | /typekv.cpp | UTF-8 | 7,166 | 2.546875 | 3 | [] | no_license | #include "graph.h"
#include "typekv.h"
sid_t typekv_t::type_update(const string& src, const string& dst)
{
sid_t src_id = 0;
sid_t super_id = 0;
vid_t vid = 0;
tid_t type_id;
//allocate class specific ids.
map<string, vid_t>::iterator str2vid_iter = str2vid.find(src... | true |
9a421ecd913a939d39f530f6922d65a646e8c6c6 | C++ | Anecoz/homco2 | /apps/common/Timestamp.cpp | UTF-8 | 1,092 | 3.078125 | 3 | [] | no_license | #include "Timestamp.h"
#include <chrono>
#include <limits>
static std::int64_t g_invalidSec = std::numeric_limits<std::int64_t>::lowest();
namespace homco2 {
namespace common {
Timestamp::Timestamp()
: _sec(g_invalidSec)
{}
Timestamp::Timestamp(std::int64_t epochSeconds)
: _sec(epochSeconds)
{}
Timestamp Time... | true |
1a98e4c753a0ade6433d86cd99b4cea5b997d8d6 | C++ | prevwong/oasis-eosio-v2 | /contracts/Marketplace/Marketplace.cpp | UTF-8 | 2,933 | 3.046875 | 3 | [] | no_license | #include "Marketplace.hpp"
#include <eosiolib/asset.hpp>
namespace Oasis {
void Marketplace::buy(name buyer, const uint64_t product_id) {
productIndex products(_code, _code.value);
auto iterator = products.find(product_id);
eosio_assert(iterator != products.end(), "The product was not found");
auto... | true |
4c711b0d299678cff0a0b39fffd8c0f5e33aa532 | C++ | rhomu/mix_mpcd | /src/random.hpp | UTF-8 | 696 | 3.21875 | 3 | [] | no_license | #ifndef RANDOM_HPP_
#define RANDOM_HPP_
// self explanatory
void init_random();
// return random real, uniform distribution
float random_real();
// return random real, normally distributed
float random_normal();
// return random uint
uint32_t random_uint32();
inline float random_real(float min, float max)
{
return ... | true |
994436e9271381238ec287bfbdb1a88d1ff93ced | C++ | s1042992/UVAPractice | /UVA13180.cpp | UTF-8 | 849 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int main(){
int pearls[1100];
while(cin>>pearls[0] && pearls[0]!=0){
int cnt = 1;
while(cin>>pearls[cnt] && pearls[cnt]!=0){
cnt++;
}
sort(pearls,pearls+cnt);
bool flag=true;
if(cnt%2==0){
... | true |
84deffbef7338b020def8079053d8d3e4eb557ee | C++ | AntonyHerald/Cpp | /8.cppAdvanced/vectorSTL02.cpp | UTF-8 | 782 | 3.796875 | 4 | [] | no_license | // Vectors are STL in C++, They care sequencial containers that store elements.
// Vectors are dynamic data storage, They can be expanded based on the elements.
//
// Why - When user do not know the size of array/container during design time
// this comes handy to alter the size during run time.
//
#include <iostream>... | true |
0e726dae174119fc40dc8f88a7d12af845cce6c9 | C++ | vegardinho/curlingprosjekt | /scrapyard/akselerator__raw_values_.ino | UTF-8 | 3,498 | 2.765625 | 3 | [] | no_license | // MPU-6050 Short Example Sketch
// By Arduino User JohnChi
// August 17, 2014
// Public Domain
#include <Wire.h>
#include <stdlib.h>
int *med_denne;
int *med_forrige;
int *maalinger;
int ant_var = 6;
int maks_maalinger = 50;
int sekv_nr = 0;
const int MPU_addr=0x68; // I2C address of the MPU-6050
boolean akkurat_st... | true |
7b7253fc1464c6c8f02841b92587cd95cda3e1d7 | C++ | haxul/cesar-cipher | /encryptions/cesar/begin_encyption.h | UTF-8 | 835 | 2.890625 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include "Cesar.h"
#include "../../helpers/input_helper.h"
using namespace std;
#ifndef UNTITLED_BEGIN_ENCYPTION_H
#define UNTITLED_BEGIN_ENCYPTION_H
void begin_cesar_encryption() {
string text;
int shift;
co... | true |
c41424b8eb335ad18c6b0d27fbf59471ef3873c5 | C++ | theRAMSnake/AI | /src/playgrounds/LogicalPG.cpp | UTF-8 | 4,983 | 2.8125 | 3 | [] | no_license | #include "LogicalPG.hpp"
#include <gacommon/rng.hpp>
#include <stdexcept>
#include <sstream>
namespace pgs
{
class LogicalFitnessEvaluator : public gacommon::IFitnessEvaluator
{
public:
LogicalFitnessEvaluator()
: mInputs({gacommon::ValueIO(), gacommon::ValueIO(), gacommon::ChoiceIO{4}})
, mOutputs({... | true |
665c016cd822931f70bca67af650bd4db68d8710 | C++ | Sugrue/UOIT-Projects | /Object Oriented Programming/Assignmnet_3/Assignmnet_3/Before comments/Shape.h | UTF-8 | 208 | 2.546875 | 3 | [] | no_license |
#include <string>
#include <iostream>
#ifndef SHAPE_H
#define SHAPE_H
class Shape{
public:
//constructor
Shape();
virtual double area();
virtual double perimeter();
virtual double volume();
};
#endif | true |
db9f5f618ba6f00d607e2110e83996f75190c30d | C++ | llpm/llpm | /lib/llpm/connection.hpp | UTF-8 | 9,214 | 2.734375 | 3 | [
"Apache-2.0"
] | permissive | #ifndef __LLPM_CONNECTION_HPP__
#define __LLPM_CONNECTION_HPP__
#include <llpm/ports.hpp>
#include <llpm/block.hpp>
#include <llpm/exceptions.hpp>
#include <util/macros.hpp>
#include <boost/function.hpp>
#include <set>
#include <map>
#include <unordered_map>
namespace llpm {
// Fwd. defs. Silly rabbit, modern parsi... | true |
082641f39f9e12455b6583e24352d3dab96595b3 | C++ | harathi6672/ncrwork | /Windows internals/secondarythread/secondarythread.cpp | UTF-8 | 744 | 2.78125 | 3 | [] | no_license | #include <windows.h>
#include <stdio.h>
#include <tchar.h>
DWORD dwc;
DWORD WINAPI thread_func(LPVOID lparam) {
for (int i = 0; i < 10; i++) {
printf("i = %d\n", i);
Sleep(1000);
if (i == 5) {
ExitThread(dwc);
}
}
return 0;
}
int main() {
DWORD thid;
HANDLE hthread;
HANDLE handle_array;
... | true |
bce248b8414f2711fdc35081433d6185cfae9dad | C++ | cjacker/windows.xp.whistler | /source/UTILS/UOFS/OFS/EXTENT.CXX | UTF-8 | 3,948 | 2.875 | 3 | [] | no_license | //+----------------------------------------------------------------------------
//
// File: extent.cxx
//
// Contents: Implementation of classes EXTENTNODE and EXTENTLST.
//
// Classes: EXTENTNODE
// EXTENTLST
//
// Functions: Methods of the above classes.
//
// History: 05-Jan-94 RobDu Created.
//
//--------------... | true |
e2aa2cde8cf6c5c2d4e40b4c2f6f8ead6e763334 | C++ | khaledsliti/CompetitiveProgramming | /LightOJ/LOJ1266.cpp | UTF-8 | 1,401 | 2.515625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
const int N = 1005;
int bit[N][N];
void add(int i, int j, int val)
{
for(int x = i; x < N; x += x & -x)
for(int y = j; y < N; y += y & -y)
bit[x][y... | true |
cc3b820ab4c2e424c66edb286e55faf85173eb01 | C++ | peachbupt/Lab | /atl-demo/test-alt/test-alt.cpp | UTF-8 | 569 | 2.53125 | 3 | [] | no_license | // test-alt.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "atldemo_i.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
HRESULT hr;
IMyClass *pMyClass = NULL;
hr = CoInitialize(NULL);
hr = CoCreateInstance(CLSID_MyClass, NULL, 1,
IID_... | true |
1a5213cf903d3a8a74accbbd1325a8a897622c11 | C++ | HULANG-BTB/LazyOJ | /Judger/Compare.cpp | UTF-8 | 12,625 | 3.0625 | 3 | [] | no_license | #include "Compare.h"
#include <string>
#include <fstream>
#include <sstream>
/**
* Class Compare
* Author: Lang Hu
* QQ: 774023581
* Email: admin@oibit.cn
* Date: 2019-10-10
* CompareCode: -2 --- 打开文件失败
* 0 --- 答案错误
* 1 --- 格式错误
* 2 --- 对比通过
**/
n... | true |
680ab204ae6033852c8f7e9d8d4070ac75139ffd | C++ | Joewessel27/MobileBrawler | /src/GameLibrary/Actor/SpriteActor.cpp | UTF-8 | 17,934 | 2.8125 | 3 | [] | no_license |
#include "SpriteActor.h"
#include "../Graphics/PixelIterator.h"
namespace GameLibrary
{
SpriteActorAnimationEvent::SpriteActorAnimationEvent(const SpriteActorAnimationEvent& event)
: target(event.target),
name(event.name),
animation(event.animation)
{
//
}
SpriteActorAnimationEvent& SpriteActorAnimation... | true |
de22387221074454b3ce8824c628ba2d6a4dcc84 | C++ | anshulkataria4/codechef | /LongContest/Jan19/DifferentNeighbours.cpp | UTF-8 | 2,397 | 3.296875 | 3 | [] | no_license | //Different Neighbours Problem Code: DIFNEIGH
#include<iostream>
#include<vector>
using namespace std;
vector<vector<int>> difngb(vector<vector<int>> v,int *k, int curRow, int curCol, int m, int n){
int rowDir[] = {+2, 0, -2, 0, -1, -1, +1, +1};
int colDir[] = {0, -2, 0, +2, -1, +1, +1, -1};
if(v[curRow][... | true |
b610033995209ab4d273e690a7e995f1a6f35139 | C++ | stackofsugar/orbit-game | /src/Cursor.cpp | UTF-8 | 301 | 2.609375 | 3 | [] | no_license | #include "../include/pch.h"
using namespace std;
Cursor::Cursor() {
m_posX = m_posY = 0;
}
void Cursor::processAndUpdateMovement(int mouseX, int mouseY) {
m_posX = mouseX - (m_width / 2);
m_posY = mouseY - (m_height / 2);
}
void Cursor::render() {
Texture::render(m_posX, m_posY);
} | true |
fb470a8e699d2d6b89ca291b18b35b31a3fb2f77 | C++ | deepak1214/CompetitiveCode | /Codeforces_problems/Dreamoon and WIFI/solution.cpp | UTF-8 | 2,697 | 3.515625 | 4 | [
"MIT"
] | permissive | // The idea is we need to calculate:
// How many '+' sign exists in both 1st string and 2nd string.
// How many '-' sign exists in both 1st string and 2nd string.
// How many '?' sign exists in 2nd string, if there is no '?' sign exist in the second string we need to check if number of '+' signs in
// 1st string equals... | true |
bb614f24ad7abab79ce6e2704d3864f20e6db6e2 | C++ | SyncShinee/ACM-ICPC | /ACMContest/topcoder/SRM633Round1/B.cpp | UTF-8 | 554 | 3.140625 | 3 | [] | no_license | #include <cstdio>
#include <string>
#include <vector>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
class ABBA {
public:
string canObtain(string initial, string target) {
int len;
while (target.size() > 0 && target != initial) {
len = target.size();
if (target[len - 1] == '... | true |
c38a58deb4b78aeab5e02a43dc1511d5187cd18c | C++ | anilchoudhary/DSA | /GFG__2/sorting/merge_sort.cpp | UTF-8 | 978 | 3.328125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void merge(int arr[], int s, int m, int e)
{
int n1 = m - s + 1;
int n2 = e - m;
int arr1[n1 ], arr2[n2 ];
for (int i = 0; i < n1; i++)
{
arr1[i] = arr[i + s];
}
for (int i = 0; i < n2; i++)
{
arr2[i] = arr[m + 1 + i];
}
int i = 0, j = 0; int k = s;
while (... | true |
cc2f46e4a6c7fdbd85826cb979d3cd7499245b5e | C++ | TobMit/Informatika3 | /Lekcia 3/Triedecka_Zo_Súboru/Data.cpp | UTF-8 | 408 | 2.765625 | 3 | [] | no_license | #include "Data.h"
Data::Data(DataTyp aHodnota, Data* aNasledovnik)
{
hodnota = aHodnota;
nasledovnik = aNasledovnik;
}
int Porovnaj(const void* data1, const void* data2)
{
DataTyp* dptrdata1 = (DataTyp*)data1;
DataTyp* dptrdata2 = (DataTyp*)data2;
return *dptrdata1 - *dptrdata2;
}
int PorovnajK... | true |
7337d6b9801733d8afdaa645cc7ca973da2eeb52 | C++ | Nitapol/ASCII_deletion_distance | /distance1.cpp | UTF-8 | 1,545 | 2.90625 | 3 | [] | no_license | // Copyright (c) 2019 Alexander Lopatin. All rights reserved.
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
using namespace std;
int fee(const char& c) { return c; }
string& skip_char(string &dst, const string &src, int skip) {
dst.clear();
for (int i = 0; i < src.size(); i++)
... | true |
1af6e91ddd4d01556829f1c297a9f410f9a0e176 | C++ | MaciejWadowski/cpp | /JIMP_AI/lab_2/polybius/Polybius.cpp | UTF-8 | 1,973 | 3.09375 | 3 | [] | no_license | //
// Created by maciej on 11.03.18.
//
#include "Polybius.h"
using namespace std;
string PolybiusCrypt(string _message){
string output = "";
string message;
for(int i = 0; i < _message.size(); i++)
message += tolower(_message[i]);
char tab[5][5];
int count = 0;
for(int i = 0; i < 5; i... | true |
de75945e00de3857e0e8ab9f6d1349ee250758a4 | C++ | GuLinux/NexstarRemotePlus | /buttons.h | UTF-8 | 626 | 2.796875 | 3 | [] | no_license | #include "singleton.h"
#include <Arduino.h>
#pragma once
class Buttons : public Singleton<Buttons> {
public:
typedef void (*Callback)(void);
Buttons();
void setup(int pin);
void click();
void tick();
enum Clicks { NoButton, SingleClick, DoubleClick, TripleClick, LongClick};
void set_callback(Callback ca... | true |
f705db63fd4cc1eec56a6e100b37c44d831c92fb | C++ | OMER-B/AdvancedProgramming1 | /ex4/src/server/server.cpp | UTF-8 | 3,813 | 3 | 3 | [] | no_license | #include "server.h"
#include <sys/socket.h>
#include <netinet/in.h>
#include <unistd.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <arpa/inet.h>
#define BUFFER 10
using namespace std;
#define MAX_CONNECTED_CLIENTS 2
Server::Server(int port) : serverSocket_(0) {
port_ = port;
cout << "Serv... | true |
cb824ad5dd8e35dbe027110dc55c12feec15ab5a | C++ | shayankarmaly/UCLA-CS32 | /homework2/eval.cpp | UTF-8 | 6,488 | 3.078125 | 3 | [] | no_license | /*#include <iostream>
#include <stack>
#include <cctype>
#include <string>
using namespace std;
bool fin(const bool values[], string& postfix);
int evaluate(string infix, const bool values[], string& postfix, bool& result)
{
postfix = "";
stack<char> stackOp;
int pTracker = 0;
int... | true |
6debd0e00f2e70b0cd773fbeb0fe847476c82c17 | C++ | mverwe/diall | /interface/rhoMCWeights.h | UTF-8 | 2,628 | 2.71875 | 3 | [
"CC0-1.0"
] | permissive | #ifndef rhoMCWeights_h
#define rhoMCWeights_h
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include "TFile.h"
#include "TH1D.h"
#include "TH2D.h"
#include "TString.h"
#include <fstream>
using namespace std;
class rhoMCWeights
{
private:
TString fNameWeightFileCent0 = "/afs/cern.ch... | true |
b7d86de172350cdf93149511f59ab5ab9012abe4 | C++ | rfcosta85/CursoCPlusPlus | /exemplosEstacio/estrutura_de_dados/exemplos_aula03/exemplo001.cpp | UTF-8 | 358 | 2.625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
struct coordenadas
{
int x, y;
};
coordenadas a = {-5,2}, b = {6,5};
cout << "\nCoordenadas de a("<< a.x <<","<< a.y <<")";
cout << "\nCoordenadas de b("<< b.x <<","<< b.y <<")";
cout << "\n\n";
... | true |
e3172f7b4fce53864f46614a8f3d56624c3787fa | C++ | LeonardoFassini/Competitive-Programming | /CodeForces/271A-TIMMY.cpp | UTF-8 | 641 | 3.046875 | 3 | [] | no_license | #include <cstdio>
char a, b, c, d;
void aumenta1(char &a, char &b, char &c, char &d){
if(d == '9'){
d = '0';
if(c == '9'){
c = '0';
if(b == '9'){
b = '0';
if(a == '9'){
a = '0';
printf("1");
}
else a++;
}
else b++;
}
else c++;
}
else d++;
}
int main(void){
ch... | true |
61a5a4bcb3be5542f4ff611b1aedb1c852f3a2af | C++ | xuermin/leetcode | /countAndsay/countAndsay.cpp | GB18030 | 517 | 3.390625 | 3 | [] | no_license | // countAndsay.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include<iostream>
#include<string>
using namespace std;
string countAndSay(int n) {
string output,str;
if (n == 1) {
return "1";
}
str = countAndSay(n - 1);
int count = 1;
for (int i = 0; i < str.size(); i++)
{
if (str[i] == str[i + 1])
count++;
else... | true |
461d5da96164ee9d3ded3a8b245a6dd25a3e64c7 | C++ | ArgishtiAyvazyan/DistanceCalculator | /src/IO/CLIParser.cc | UTF-8 | 5,669 | 2.90625 | 3 | [
"MIT"
] | permissive | /**
* @file CLIParser.cc
* @author Argishti Ayvazyan (ayvazyan.argishti@gmail.com)
* @brief Implementation for cli::Parser.
* @date 03-11-2020
* @copyright Copyright (c) 2020
*/
#include "CLIParser.h"
#include <sstream>
#include <iostream>
#include <string_view>
using namespace std:... | true |
3c580811080a2c581f927e4d236f69415992fcc6 | C++ | mojoe12/UVa | /doyourownhomework.cpp | UTF-8 | 691 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <map>
using namespace std;
int main(int argc, char *argv[]) {
int k;
cin >> k;
for (int c = 1; c <= k; c++) {
int n;
cin >> n;
map<string, int> subjects;
for (int i = 0; i < n; i++) {
string subject;
int duration;
cin >> subject >> duration;
subjects.insert( make_pai... | true |
64f2539d15fa1e618549743cc0bba33aea80d3b5 | C++ | irtefa/algo | /codeforces/businessTrip.cc | UTF-8 | 422 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int i, n, m, t = 0;
vector<int> v;
cin >> n;
for (i = 0; i < 12; i++) {
cin >> m;
v.push_back(m);
}
sort(v.rbegin(), v.rend());
for (i = 0; i < v.size(); i++) {
if (t >= n... | true |
c6564bb9c0746920725697e0bfe538a2116eee0f | C++ | monaco89/C-Programs | /prime numbers/prime numbers/main.cpp | UTF-8 | 504 | 2.859375 | 3 | [] | no_license | //
// main.cpp
// prime numbers
//
// Created by Nick Monaco on 3/13/13.
// Copyright (c) 2013 Nick Monaco. All rights reserved.
//
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
for (int i=2; i<100; i++)
for (int j=2; j*j<=i; j++)
{
if (i % j == 0)
... | true |
43770fb41b16be7c82b81fdc15d68edc1a8f1fe0 | C++ | Kareliavs/Jumping-bits | /TRABAJO CON CLASE/main.cpp | ISO-8859-1 | 5,443 | 2.59375 | 3 | [] | no_license | #include <allegro.h>
#include "inicia.h"
#include <iostream>
#define MAXFILAS 21
#define MAXCOLUMNAS 82
using namespace std;
//usaremos las variables MAX para hacer una matriz
//que contendran los bloques en x 30 en y 19 y 100pre se deja 1 mas
//de espacios en el vector
BITMAP *buffer;
BITMAP *fondo;
BITMAP *muro;
BIT... | true |
2dd5b45898d8c0909d5859318366ea0351aef196 | C++ | chm994483868/AlgorithmExample | /Algorithm_C/OfferReview/01_38/24_ReverseList/ReverseList_1.hpp | UTF-8 | 706 | 2.71875 | 3 | [] | no_license | //
// ReverseList_1.hpp
// OfferReview
//
// Created by CHM on 2020/11/4.
// Copyright © 2020 CHM. All rights reserved.
//
#ifndef ReverseList_1_hpp
#define ReverseList_1_hpp
#include <stdio.h>
#include <stdlib.h>
#include "List.hpp"
using namespace List;
namespace ReverseList_1 {
// 24:反转链表
// 题目:定义一个函数,输入一个链... | true |
8a462e07b6d4d7917eb484451cf20859c9130943 | C++ | xtay315/RedBook8th | /RedBook8th/Examples/Ex07_lights.cpp | UTF-8 | 2,413 | 2.546875 | 3 | [] | no_license | /*
* Ex07_lights.cpp
*
* Created on: Feb 25, 2014
* Author: Andrew Zhabura
*/
#include "Ex07_lights.h"
#include "GL/LoadShaders.h"
#include "Auxiliary/vmath.h"
#include "Auxiliary/vermilion.h"
Ex07_lights::Ex07_lights()
: OGLWindow("Ex07_lights", "Ex 07-lights (M)")
{
}
Ex07_lights::~Ex07_lights(... | true |
3be8fc9864871dbaeb16c2b2a2034a5f110e8311 | C++ | Denis1697/Somegame | /Mage.h | UTF-8 | 368 | 3.1875 | 3 | [] | no_license | #pragma once
#include "Character.h"
class Mage : public Character
{
private:
public:
Mage(char * name, int HP, int attackDamage) : Character(name, HP, attackDamage)
{
_intelligence = 7;
_strength = 2;
_agility = 3;
_attackDamage =
attackDamage +
((float)_intelligence * 0.9) +
((float)_agil... | true |
0486905d04bd7a933cf06f0f7e412e6b80e234c0 | C++ | stanleyhon/COMP-four-one-two-eight | /w4/triangle/t.cpp | UTF-8 | 2,067 | 3.671875 | 4 | [] | no_license | #include <iostream>
using namespace std;
int array[100][100];
int dp[100][100];
int totalRows;
void dpGo (int row, int col);
int main(int argc, char **argv)
{
for (int i = 0; i != 100; ++i) {
for (int j = 0; j != 100; ++j) {
array[i][j] = -1;
dp[i][j] = -1;
}
}
c... | true |
d941d26a959d10fdf6084655100feeff723acda6 | C++ | gkampitakis/mortal-kombat-arcade | /MortalKombat/SpriteHolder.h | UTF-8 | 410 | 2.828125 | 3 | [] | no_license | #include <Sprite.h>
typedef list<Sprite*> SpriteList;
class SpriteHolder {
private:
static SpriteHolder* holder;
protected:
typedef map<unsigned, SpriteList> SpritesByType;
SpritesByType sprites;
public:
SpriteHolder(void) {};
~SpriteHolder() { CleanUp(); };
static SpriteHolder* Get(void);
void Add(Sprite* s)... | true |
611d572ac3e9b5eea4051739e673775295396646 | C++ | NorilskUshakova/MaxLab | /Source.cpp | UTF-8 | 755 | 2.625 | 3 | [] | no_license | #include <iostream>
using namespace std;
class DataTime
{
int sec(int god1, int mes1, int den1, int chas1 = 0, int min1 = 0, int sec1 = 0)
{
int god_l1 = god1 - 1970;
int god_l2 = (god_l1 / 4) + 0.5;
int den = god_l1 * 365 + god_l2;
switch (mes1)
{
case 1: den += 31; break;
case 2: den += 69; break;
... | true |
28f93eeaa142cc0815d2ef1e22a9e31aef69bc76 | C++ | asdlei99/khaki | /example/echo.cpp | UTF-8 | 1,772 | 2.75 | 3 | [] | no_license | #include "../khaki.h"
#include <map>
class EchoServer {
public:
EchoServer(khaki::EventLoop* loop, std::string host, int port, int threadNum) :
server_(loop, host, port, threadNum) {
server_.setReadCallback(std::bind(&EchoServer::OnMessage,
this, std::placeholders::_1));
server_.setConnectionC... | true |
cc7d8b151af1d0c6feaeb62ab9ed489bf5f1c122 | C++ | cyrilmaitre/white_hole | /src/space_2/LootItemModel.h | UTF-8 | 799 | 2.5625 | 3 | [] | no_license | #pragma once
#include "Item.h"
// Define
#define LOOTITEMMODEL_CONFIG_ID "id"
#define LOOTITEMMODEL_CONFIG_ITEM "item"
#define LOOTITEMMODEL_CONFIG_QUANITYMIN "quantity_min"
#define LOOTITEMMODEL_CONFIG_QUANITYMAX "quantity_max"
class LootItemModel
{
public:
// Constructor - Destructor
LootItemModel(KeyValue... | true |
0d3f74515ebae192bcfd36c00bb18352ad999737 | C++ | charleschang213/VE281 | /Projects/p4/orderbook.h | UTF-8 | 1,131 | 2.546875 | 3 | [] | no_license | #ifndef ORDERBOOK_H
#define ORDERBOOK_H
#include <vector>
#include <unordered_map>
#include <string>
#include "equity.h"
#include "client.h"
class orderbook{
std::unordered_map<std::string,int> ename,cname;
std::priority_queue<std::string,std::vector<std::string>,std::greater<std::string> > ordered_ena... | true |
5a7f2f773fbb2432f885d4107e53865f48ee79dd | C++ | konrad99fgf/ds | /Pilkarz.cpp | WINDOWS-1250 | 1,229 | 2.703125 | 3 | [] | no_license | #include "Pilkarz.h"
#include <fstream>
#include <iostream>
Pilkarz::Pilkarz()
{
//ctor
}
Pilkarz::~Pilkarz()
{
//dtor
}
void Pilkarz::wczytaj_pilkarza(std::fstream & plik)
{
plik>>imie;
plik>>nazwisko>>wiek;
plik>>narodowosc;
std::string poz;
plik>>poz;
wczytajpozycje(poz);
plik>>umiejet... | true |
076387346039d5c12cd294f5e2a79486ef936b2f | C++ | core2062/CORE2017 | /src/Robot.cpp | UTF-8 | 3,432 | 2.734375 | 3 | [] | no_license | #include "Robot.h"
using namespace CORE;
//shared_ptr<CORE2017> Robot = nullptr;
CORE2017 * Robot = nullptr;
CORE2017::CORE2017() :
driveSubsystem(),
hopperSubsystem(),
climberSubsystem(),
gearSubsystem(),
driveTeleController(),
driveGyroController(),
intakeController(),
driverJoystick(0),
operator... | true |
bca23c7818152ba2e48306e21ca6723bc37e5e8e | C++ | diffblue/cbmc | /src/analyses/loop_analysis.h | UTF-8 | 5,755 | 3.015625 | 3 | [
"BSD-2-Clause",
"LicenseRef-scancode-unknown-license-reference",
"BSD-4-Clause"
] | permissive | /*******************************************************************\
Module: Loop analysis
Author: Diffblue Ltd
\*******************************************************************/
/// \file
/// Data structure representing a loop in a GOTO program and an interface shared
/// by all analyses that find program loop... | true |
93802bd87e0c382f6c78a50637ff6973e000ba7c | C++ | mampfes/colorado | /include/Ratio.hpp | UTF-8 | 455 | 2.71875 | 3 | [] | no_license | #pragma once
#include <cstdint>
namespace colorado
{
template <typename T>
struct Ratio
{
constexpr Ratio(T numArg, T denomArg) :
num{numArg},
denom{denomArg}
{
}
constexpr Ratio() :
num{0},
denom{1}
{
}
... | true |
fc6b11c1a6b9b96f068fb65e2537e62d50ca4e44 | C++ | zhangji0629/algorithm | /codeforces/contest_1154/A.cpp | UTF-8 | 469 | 2.796875 | 3 | [] | no_license | #include<bits/stdc++.h>
using LL = long long;
LL num[10];
int main()
{
while(std::cin >> num[0] >> num[1] >> num[2] >> num[3]) {
LL sum = 0;
for(int i = 0; i < 4; i++) {
sum += num[i];
}
sum /= 3;
for(int i = 0; i < 4; i++) {
if(sum == num[i]) {
... | true |
93098805db27e3949ffa6926d4f3ff05e2ebcffa | C++ | dgant/SAIDA | /src/SAIDA/ReserveBuilding.cpp | UHC | 20,045 | 2.765625 | 3 | [] | no_license | #include "ReserveBuilding.h"
using namespace MyBot;
// TODO attach ǹ reserve .
// onCreate attach ǹ reserve .
// ǹ landing (onComplete?) attach ǹ reserve .
// ǹ lifting attach .
Building::Building(int order, TilePosition pos, TilePosition tileSize, ReserveTypes reserveType) {
this->order = o... | true |
6a2733b8700b7f0aa2c8814111b82028e679e6bb | C++ | HO-COOH/NeuroNet | /NeuroNet/Net.cpp | UTF-8 | 15,272 | 2.640625 | 3 | [] | no_license | #include "Net.h"
#include <cmath>
#include <algorithm> //for shuffle the inputs and desired_outputs pair
#include <random>
#include <chrono>
#include <memory>
#include <fstream>
#include <opencv2/opencv.hpp>
#include "Neuron.h"
double tanh_prime(double x)
{
return 1.0 - (tanh(x) * tanh(x));
}
double sigmoid_prime(do... | true |
aff60f097e07011dbd51de39e99d6e7291a64800 | C++ | timHau/extensor_coding | /compare/cpp/matrix.cpp | UTF-8 | 704 | 3.15625 | 3 | [] | no_license | #include "matrix.h"
Matrix::Matrix(int nRows, int nCols, vector<Extensor> values)
{
this->nRows = nRows;
this->nCols = nCols;
data = vector<tuple<int, int, Extensor>>();
for (int i = 0; i < values.size(); ++i) {
auto val = values[i];
if (!val.is_zero()) {
int row_index = i / nCols;
int col_index = i % n... | true |
38be721e38fd49a25db25a3fdbe86539a8682ad8 | C++ | kotabrog/CPP-module | /module-04/ex03/MateriaSource.hpp | UTF-8 | 602 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef MATERIASOURCE_H
#define MATERIASOURCE_H
#include <iostream>
#include <string>
#include "IMateriaSource.hpp"
#define NUM_MATERIA_SOURCE 4
class MateriaSource : public IMateriaSource
{
AMateria* materia[NUM_MATERIA_SOURCE];
bool checkIndex(int index) const;
public:
MateriaSource();
MateriaSour... | true |
4effe523bd57532ed1236e5288e1a3eca443e101 | C++ | caiweihan/Sta | /Sta.cpp | UTF-8 | 1,732 | 2.890625 | 3 | [] | no_license | constexpr unsigned max(unsigned a, unsigned b)
{ return a > b ? a : b; }
template<typename T, typename Alloc = std::allocator<T>, int init_size = max(512 / sizeof(T), 8u)>
class Sta
{
public:
typedef T value_type;
typedef T& reference;
typedef T* pointer;
typedef const T& const_reference;
typedef size_t si... | true |
2fc605a242260773eddfc938805174c7cff52b77 | C++ | FlorianWolters/cpp-component-core-uncopyable | /include/fw/core/uncopyable_mixin.h | UTF-8 | 1,689 | 3.0625 | 3 | [
"BSL-1.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /**
* Declares the `fw::core::UncopyableMixin` class.
*
* @file fw/core/uncopyable_mixin.h
* @author Florian Wolters <wolters.fl@gmail.com>
*
* @section License
*
* Copyright Florian Wolters 2014 (http://blog.florianwolters.de).
*
* Distributed under the Boost Software License, Version 1.0. (See accompanying
... | true |
23d113f8d670a907652d7731a23320a6e8a4350b | C++ | Polladin/AOC | /2022/src/day_09/rope_bridge.cpp | UTF-8 | 2,195 | 2.9375 | 3 | [] | no_license | #include "rope_bridge.h"
#include <vector>
#include <set>
#include "common/file_reader.h"
#include "common/common.h"
struct Point
{
int row;
int col;
};
using t_movement = std::pair< char, int >;
using t_input = std::vector< t_movement >;
using t_point = std::pair< int, int >;
t_input prepare_input( cons... | true |
de3d0b65b5eb066a3a4380a7d548c632a648922b | C++ | SuloUmal/C_Plus_Plus_Beginner | /Project/Good.cpp | UTF-8 | 7,631 | 2.921875 | 3 | [
"MIT"
] | permissive | #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <cstring>
#include <memory>
#include <fstream>
#include <iomanip>
#include "Good.h"
#include "Error.h"
using namespace std;
namespace aid
{
Good::Good(char name) {
setEmpty(name);
}
Good::Good(const char* sku, const char* name, cons... | true |
a04251fd76cb8e8cae4e5b827d03ac6c9e405430 | C++ | league/subpixelize | /subpixelize.cpp | UTF-8 | 1,637 | 3.21875 | 3 | [] | no_license | #include <Magick++.h>
#include <iostream>
#include <cassert>
using std::cout;
using std::string;
using namespace Magick;
/* Each pixel in input image is rendered as
* GRBx
* BRGx
* xxxx
* in the output image. So pixels are 4x3,
* including inter-pixel space.
*/
int main(int argc, char** argv)
{
In... | true |
0cb5befe3f6e92fce33424184af5a319d92eb792 | C++ | zmq175/DiscManager | /DiskManager/DiskManager/DiscList.cpp | GB18030 | 1,194 | 3.078125 | 3 | [] | no_license | #include "DiscList.h"
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
void DiscList::add(Disc &d)
{
Disc* pivot=new Disc(d);
if(ptr)
{
pivot->next=ptr;
}
if(!ptr)
{
pivot->next=NULL;
}
ptr=pivot;
}
void DiscList::display()
{
for (Disc* pivot = ptr; pivot; pivot=pivot->next)
{... | true |
a96a0252a91bf1378b9651c04b88c55da77a831a | C++ | lamesrich/LouidorRichemond_CSC5_46091_Sum2015 | /blackjack project folder 2 works/project V1/test/main.cpp | UTF-8 | 1,907 | 2.90625 | 3 | [] | no_license | //system library
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
//function prototypes
//execution begins here
int main ()
{
//declaring variables
int x=0, y=0, ct=0, ct2=0, SIZE;
srand(time(0));
//prompting user to enter number of players
cout <... | true |
8fe8581e09da8c25322900d5648cae45ef990ff4 | C++ | Mahmoudalziem/ITI_9_month_labs_OS_track | /Data-Structure-Labs/doubleLinkedList/main.cpp | UTF-8 | 3,926 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Employee
{
string name;
int id;
public:
Employee* pNext;
Employee* pPrevious;
Employee()
{name="no name"; id = 0;}
Employee(string n , int i)
{name = n; id = i; pNext = pPrevious = NULL;}
///getter & setter
void s... | true |
2c93885e155785726371ecc4afac15a8adadd0b7 | C++ | MarcoLotto/ScaenaFramework | /ExampleProject/src/ExamplePipelineBuilder.cpp | WINDOWS-1250 | 9,344 | 2.765625 | 3 | [
"MIT"
] | permissive | #include "ExamplePipelineBuilder.h"
#include "RenderPipelineWithGeometryAndBackWrite.h"
#include "BloomStage.h"
#include "DeferredGeometryStage.h"
#include "PhongLightingStage.h"
#include "BlurStage.h"
#include "UserInterfaceStage.h"
RenderPipeline* ExamplePipelineBuilder::getRenderPipelineConfigForward(UIController* ... | true |
e8aef4a0adac3550d5d7ef3b9637bf1e6092ea8a | C++ | nukazuka/RootFileViewer | /include/misc.hh | UTF-8 | 627 | 2.78125 | 3 | [] | no_license | #ifndef MISC_HH
#define MISC_HH
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
template < typename T >
void ShowVC( vector < T >& vT )
{
for( unsigned int i=0; i<vT.size(); i++ )
cout << setw(3) << i << "\t" << vT[i] << endl;
}
template < typename T >
//void ShowVC2D( vector < ... | true |
8e2aec5cd23304a7fbf2eb0df39be54e077f8f5c | C++ | nikkaramessinis/QtCurvesCPP | /renderarea.cpp | UTF-8 | 5,500 | 2.6875 | 3 | [] | no_license | #include "renderarea.h"
#include <QPaintEvent>
#include <iostream>
#include <QPainter>
RenderArea::RenderArea(QWidget *parent) : QWidget(parent),mBackgroundColor(0,0,255),mPen(Qt::white),mShape(Astroid){
mPen.setWidth(2);
on_shape_change();
}
QSize RenderArea::minimumSizeHint() const {return QSize(400,400);}
QSiz... | true |
579c76f91e33fca24dd447d974240de3046dd409 | C++ | aramhamidi/ATM | /src/Screen.cpp | UTF-8 | 945 | 2.953125 | 3 | [] | no_license | /**
* @Author: Aram Hamidi <aramhamidi>
* @Date: 2018-08-21T11:04:58-07:00
* @Email: aram.hamidi@getcruise.com
* @Project: Laser_Driver_A53
* @Filename: Screem.cpp
* @Last modified by: aramhamidi
* @Last modified time: 2018-08-21T12:15:51-07:00
*/
// Screen.cpp
// Member-function definitions for class Scre... | true |
d560232e1d13a2b512b710fefe71012086b943dd | C++ | kimny22/Algorithm | /heapsort.cpp | UTF-8 | 841 | 3.484375 | 3 | [] | no_license | #include <stdio.h>
void heapify(int A[], int k, int n) {
int left = 2 * k + 1;
int right = 2 * k + 2;
int smaller = 0;
if (right <= n) {
if (A[left] < A[right]) smaller = left;
else smaller = right;
}
else if (left <= n) smaller = left;
else return;
if (A[smaller] < A[k]) {
int t = A[k];
A[k] = A[small... | true |
e99b7a77a5ecc9cb416712932e5d009c07eba4e3 | C++ | mcmlevi/Portfolio_Levi_de_koning | /RayTracer/MathLib/vec3f.h | UTF-8 | 4,313 | 2.828125 | 3 | [] | no_license | #pragma once
#include "cmath"
#include <cassert>
#include <xmmintrin.h>
#include <immintrin.h>
_MM_ALIGN16 class Vec3f
{
public:
#pragma warning(push)
#pragma warning(disable : 4201 )
union
{
__m128 SIMD;
float m_coordinates[4];
struct
{
float m_x;
float m_y;
float m_z;
float m_w;
};
};
... | true |
6bd7d097ead919adbd7406e1a43d60702aa2cfb9 | C++ | siy93/Problem_Solving | /10834.cpp | UTF-8 | 497 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
int M, s;
int a, b, lcm;
int rotateNum, rotateType;
scanf("%d", &M);
scanf("%d %d %d",&a,&b,&s);
b /= a, a /= a;
rotateNum = b, rotateType = (0 ^ s);
for(int i=0; i<M-1; i++){
scanf("%d %d ... | true |
b3ff6ce4d6275746e192d9855df23402a6cca4fb | C++ | Jochen0x90h/RoomControl_old | /Emulator/DeviceState.hpp | UTF-8 | 612 | 2.875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Device.hpp"
#include "util.hpp"
class DeviceState {
public:
void init(const Device &device) {
this->state = this->lastState = 0;//device.state;
this->interpolator = 0;//device.state << 16;
this->condition = 0xff;
}
/**
* Check if a state is active
*/
bool isActive(const Device ... | true |
661e4fb231cd02c873202d10bda8bf4b5fbbe0a7 | C++ | GitHubforXiaoming/FragmentsAssemblyAssitant | /Registration.cpp | GB18030 | 13,880 | 2.625 | 3 | [] | no_license | #include "stdafx.h"
#include "Registration.h"
Registration::Registration()
{
}
Registration::Registration(int fragmentsSize, int fracturesSize)
{
this->fragmentsSize = fragmentsSize;
this->fracturesSize = fracturesSize;
fractures = new int*[fragmentsSize];
for (int i = 0; i < fragmentsSize; i++)
fractures[i] ... | true |
6d41d1a8832b4327e6d26f0b6a6388f36f79b55a | C++ | romie88/leetcode | /73.Set.Matrix.Zeroes.h | UTF-8 | 2,333 | 4 | 4 | [] | no_license | /**
* Algorithms 73 Set Matrix Zeroes Medium
*
* Given a m x n matrix, if an element is 0, set its entire row and column to 0.
* Do it in place.
*
* click to show follow up.
*
* Follow up:
* Did you use extra space?
* A straight forward solution using O(mn) space is pr... | true |
858f89c9d257baa0df57ce1cddbbf98e04645b0d | C++ | Twiebs/Raptor | /src/assets/assets.hpp | UTF-8 | 5,386 | 2.859375 | 3 | [] | no_license | #pragma once
#include <fstream>
#include <string>
#include <vector>
#include <unordered_map>
#include <stdint.h>
template<typename TAsset>
struct AssetHandle {
uint32_t arrayIndex;
uint64_t uuid;
};
template<typename TAsset>
inline const TAsset& GetAsset(AssetHandle<TAsset> handle) {
static_assert(false, "GetAsse... | true |
728709631b0da1b1eab0f653babe5d3a6f958969 | C++ | MichaelHGitHub/LCA51to100 | /056_Merge_Intervals/revisit.cpp | UTF-8 | 716 | 2.953125 | 3 | [] | no_license | #include <algorithm>
#include "header.h"
vector<vector<int>> merge_r(vector<vector<int>>& intervals)
{
std::sort(intervals.begin(), intervals.end(), [](vector<int> a, vector<int> b)
{
return (a[0] < b[0]);
}
);
int start = intervals[0][0];
int end = intervals[0][1];
ve... | true |
57a0f1f7f7cb1d90e2a8beede985f7b523ab0854 | C++ | jrlo1592/Moro | /physics/rigid_body.hpp | UTF-8 | 1,216 | 3.203125 | 3 | [] | no_license | #pragma once
#include "../math/vector2.hpp"
class RigidBody
{
private:
Vector2 m_position;
Vector2 m_velocity;
Vector2 m_center;
double m_mass;
public:
RigidBody(Vector2 & position, Vector2 & velocity, double mass)
{
m_position = position;
m_velocity = velocity;
if (mass ... | true |
0a5cd4157af85e46a8a80ae6ca01a95472f947b5 | C++ | pbisen/practiceCodes | /queuearray.cpp | UTF-8 | 1,655 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct queue
{
int size, cap, front;
int *array;
queue(int c)
{
cap = c;
size = 0;
front = 0;
array = new int[cap];
}
void enque(int input)
{
if (size < cap)
{
array[(front + size)%cap... | true |