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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
76d679fcaa12ec971bb0d71d1cf628d0594a68e8 | C++ | wenxinz/C-PrimerPlus | /chapter11/stonewt_2.cpp | UTF-8 | 1,129 | 3.3125 | 3 | [] | no_license | //stonewt.cpp -- with all six relational operators reloaded
#include "stonewt_2.h"
#include <iostream>
using std::cout;
Stonewt::Stonewt(double lbs){
stone = int(lbs) / Lbs_per_stn;
pds_left = int(lbs) % Lbs_per_stn + lbs - int(lbs);
pounds = lbs;
}
Stonewt::Stonewt(int stn, double lbs){
stone = stn;... | true |
c13ed6b3e39ca7694a0c47281861d4eddf4bc36f | C++ | noahb764/CSC3180 | /closestPoint.h | UTF-8 | 339 | 2.5625 | 3 | [] | no_license | #ifndef CLOSESTPOINT_H
#define CLOSESTPOINT_H
class closestPoint
{
public:
// Default constructor
closestPoint();
//Constructor
closestPoint(double new_x, double new_y);
// Accessors
double getX();
double getY();
//Mutators
void setX();
void setY();
private:
double x_coord;
double y... | true |
f323d7e720865a831715d845c2e7535725bed9af | C++ | StefanDimeski/Chixel-Engine | /StateManager.cpp | UTF-8 | 1,074 | 3.359375 | 3 | [] | no_license | #include "StateManager.h"
#include <iostream>
StateManager::StateManager()
{
}
StateManager::~StateManager()
{
}
State* StateManager::toInstance(States state)
{
if (state == States::MainMenu)
return new MainMenuState();
}
void StateManager::pushFront(States state)
{
State *s = toInstance(state);
s->change... | true |
888bf56cc9b690019db0845a69c57e1fbd922678 | C++ | 956237586/CppExperiments | /CppExperiment3/CppExperiment3/Trapezoid.cpp | UTF-8 | 425 | 3.03125 | 3 | [] | no_license | //Trapezoid.cpp
#include "Trapezoid.h"
Trapezoid::Trapezoid(double top, double height, double bottom) {
this->top = top;
this->height = height;
this->bottom = bottom;
this->area = getArea();
}
double Trapezoid::getArea() {
return (top + bottom) * height / 2.0;
}
int TestTrapezoidMain() {
//int main() {
Shape* ... | true |
72eeba3cb8ee64e8a52eeb27bc3987fdd79f4203 | C++ | KArsen146/kgig2 | /kgig4/transfer.h | UTF-8 | 765 | 2.578125 | 3 | [] | no_license | //
// Created by Арсений Карпов on 30.05.2020.
//
#ifndef KGIG4_TRANSFER_H
#define KGIG4_TRANSFER_H
#include <string>
#include <vector>
#include <algorithm>
class transfer {
private:
double* _first{};
double* _second{};
double* _third{};
int _width;
int _height;
std::vector<std::string> base;
... | true |
1a25343b644bb279a05abc7e0093f354e68e6047 | C++ | k119-55524/Old-project | /RedKid3D/RedKid3D Engine/RedKid Engine/LogFile.h | MacCyrillic | 2,086 | 2.75 | 3 | [] | no_license | #pragma once
#include "header.h"
class CLogFile
{
public:
inline void ClearLogFile( void )
{
std::ofstream LogFile;
try
{
//
LogFile.open( LogFileName, std::ios::out | std::ios::trunc );
LogFile << "Log file.\n";
LogFile.close();
}
catch( ... )
{
LogFile.close();
}
};
inline void ... | true |
f3f08c88d48ee6f168bf77f83f28c71027fc25dd | C++ | SuperVang/example | /cpp/algorithm/ml/ml_lib/logistic_regression.cpp | UTF-8 | 3,811 | 3.21875 | 3 | [] | no_license | //
// Created by books on 19-11-17.
//
#include "logistic_regression.h"
LogisticRegression::LogisticRegression()
{
}
LogisticRegression::~LogisticRegression()
{
}
void LogisticRegression::gradientDescent(const SampleVec &pos, const SampleVec &neg)
{
assert(pos.size() + neg.size() > 1);
const int N = pos.e... | true |
40595112411d6bf0f307289aade76f0a342aa037 | C++ | d4vid-4thur69/JPMorgan-SSSM | /SSSMarket/StockMarket.h | UTF-8 | 1,210 | 2.71875 | 3 | [] | no_license | #ifndef D_StockMarket_H
#define D_StockMarket_H
#include <vector>
#include <string>
#include <ctime>
#include "Stocks.h"
using namespace std;
///////////////////////////////////////////////////////////////////////////////
//
// StockMarket is responsible for ...
//
/////////////////////////////////////////////////... | true |
d4becff354c79cedd2f578f171af54da46308876 | C++ | Redleaf23477/ojcodes | /codeforces/bye2022/C.cpp | UTF-8 | 1,486 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
using LL = long long int;
constexpr LL P = 100 * 100 + 1;
vector<LL> primes;
void make_prime() {
vector<int> sp(P, -1);
iota(sp.begin(), sp.end(), 0);
for (LL i = 2; i < P; i++) {
if (sp[i] == i) {
primes.emplace_back(i);
for (L... | true |
7ad67f538b108fd35c5fc2852910484244be0b61 | C++ | JaredChew/DGT_GP_Ass2 | /DGP2544/src/engine/gameWindow.cpp | UTF-8 | 4,367 | 3.03125 | 3 | [] | no_license | #include "gameWindow.h"
GameWindow::GameWindow(Logger& log) : log(log) {
// ** Initialise variables and objects here ** //
//Initialise controlling variables
gameloop = true;
frameDelay = 1000 / FPS;
avgFPS = 0;
countedFrames = 0;
if (init() == -1) {
gameloop = false;
}
}
GameWindow::~GameWindow() {
... | true |
e77207efa9106d02a125349a93f82c9bcbdc94d5 | C++ | lunakv/henceforth | /Core.cpp | UTF-8 | 6,057 | 2.75 | 3 | [] | no_license | #include <iostream>
#include "Core.hpp"
#include "Exceptions.hpp"
DefDict GetCoreDict() {
DefDict d;
d["+"] = std::make_shared<Add>();
d["-"] = std::make_shared<Sub>();
d["*"] = std::make_shared<Mul>();
d["/"] = std::make_shared<Div>();
d["MOD"] = std::make_shared<Mod>();
d["/MOD"] = std::m... | true |
114c9ea3509ab4ceaa929381f80a225eab17125d | C++ | cuhk-gw-suspension/sensactino | /arduino_script/L298N/MyParseNumber.cpp | UTF-8 | 541 | 2.75 | 3 | [
"MIT"
] | permissive | #include "MyParseNumber.h"
/* void myParseInt_(long *pos, char *number, char delimiter){ */
/* *pos = 0; */
/* bool isNegative = (*number=='-'); */
/* if (isNegative) number++; */
/* while (*number != delimiter){ */
/* if (isdigit(*number)) { */
/* *pos = (*pos * 10) + (*number - '0'); */
/* ... | true |
f551bb0968ed0b0275c44abcdc7fa21367c5a493 | C++ | Laghitus/sulautetutlabrat | /labra1_2.ino | UTF-8 | 544 | 3.0625 | 3 | [] | no_license |
float voltage = 0;
// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
pinMode(3, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on analog pin 0:
if(Serial.av... | true |
50b8be4489cac10f49378aee10f820f9bffd26b3 | C++ | A-KL/the-ray-tracer-challenge | /lib/Core/Shape3D.h | UTF-8 | 773 | 2.6875 | 3 | [] | no_license | #pragma once
#include <list>
#include "Point3D.h"
#include "Vector3D.h"
#include "MatrixOps.hpp"
#include "Material3D.h"
#include "Object3D.h"
class Intersection;
class Ray3D;
class Shape3D : public Object3D
{
public:
Shape3D(const Material3D& material);
Shape3D(const Matrix4d& transform, const Material3D& mater... | true |
57ae20f3bf01a292111e072ad6be1a40163caa75 | C++ | RuiMoreira1/CAL-Project-FasterServices | /main.cpp | UTF-8 | 1,406 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "graph/Graph.h"
#include "GraphMaker.h"
#include "GraphImporter.h"
#include "Solver.h"
int main() {
/*GraphViewer gv; // Instantiate GraphViewer
gv.setCenter(sf::Vector2f(300, 300)); // Set coordinates of window center
GraphViewer::Node &node0 = gv.add... | true |
84bb7d83b47ba1fc4b22d88c2c4d2efa72c7d314 | C++ | sparshgoyal2014/cppCodes | /testNull.cpp | UTF-8 | 208 | 2.796875 | 3 | [] | no_license | #include<iostream>
using namespace std;
void display(){
cout << "this is dis[pplay function" << endl;
return ;
}
int main(){
display();
void *p = NULL;
cout << p << endl;
return 0;
} | true |
e48f75563adb851a473a9d59ddfb3e3f2104b657 | C++ | novin997/cs5222-lab-prefetcher | /example_prefetchers/ghbac_setAsso.cc | UTF-8 | 6,843 | 2.515625 | 3 | [] | no_license | //
// Data Prefetching Championship Simulator 2
// Seth Pugsley, seth.h.pugsley@intel.com
//
/*
This file does NOT implement any prefetcher, and is just an outline
*/
#include <stdio.h>
#include <assert.h>
#include "../inc/prefetcher.h"
#include <unordered_map>
#include <deque>
#include <iostream>
#define GHB_S... | true |
0d90a3e4498b8b70b93c89a28a96e4bd631ce323 | C++ | dotnet/runtime | /src/mono/mono/eglib/test/enum.cpp | UTF-8 | 1,099 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "config.h"
#include "glib.h"
typedef enum {
Black = 0,
Red = 1,
Blue = 2,
Purple = Red | Blue, // 3
Green = 4,
Yellow = Red | Green, // 5
White = 7,
} Color;
G_ENUM_FUNCTIONS (Color)
static void
test_enum1 (void)
{
const Color green = Green;
const Color blue = Blue;
const Color red = Red;
const C... | true |
35f42c8aa4902dd82df2d7abd2cd1b51ad0d3215 | C++ | YuraVasiuk/Custom-Made-Data-Structures | /week12_Hash/hash.h | UTF-8 | 4,295 | 3.84375 | 4 | [] | no_license | #include <list>
#include <string>
#include <assert.h>
using namespace std;
/****************************************
* HASH
* The parent template hash class
****************************************/
template <typename T>
class Hash
{
public:
// the constructors
Hash() : numBuckets(0), numElements(0), buckets(NULL)... | true |
54fb92ad27ec884801740085cad6d229563d5dd6 | C++ | walkccc/LeetCode | /solutions/0264. Ugly Number II/0264.cpp | UTF-8 | 535 | 3.25 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int nthUglyNumber(int n) {
vector<int> uglyNums{1};
int i2 = 0;
int i3 = 0;
int i5 = 0;
while (uglyNums.size() < n) {
const int next2 = uglyNums[i2] * 2;
const int next3 = uglyNums[i3] * 3;
const int next5 = uglyNums[i5] * 5;
const int next = min(... | true |
7b130098ff4019956ef88cf4c6fd834dda274b93 | C++ | shaylajayde/BowlingAverages | /BowlingAverages.cpp | UTF-8 | 4,576 | 3.6875 | 4 | [] | no_license | // BowlingAverages.cpp : This file contains the 'main' function, along with an int function (GetBowlingData) and 2 void functions
// (GetAverageScore) and (PrettyPrintResults). Program execution begins and ends there.
//
// This program takes in data from a file titled "BowlingScoresModified.txt".
// Uses parallel arr... | true |
d8096ad79cad4db9211e64e0d42edcfe0b198e4b | C++ | hanzec/Dungeon | /src/Utils/DungeonUtils.cpp | UTF-8 | 3,958 | 2.96875 | 3 | [] | no_license | #include <queue>
#include "../../include/Utils/DungeonUtils.h"
#include "../../include/GameContant/Monster.h"
void DungeonUtils::OrderedList::push(std::list<Monster * > * monsters, Monster * monster){
for ( auto i = monsters->begin(); i != monsters->end(); i++){
if((*i)->nextMoveTime > monster->nextMoveTime... | true |
c2fcd3da178751a7a99638b8ff57a61ac506fa97 | C++ | mrippa/cpp-list | /listtest.cpp | UTF-8 | 1,053 | 3 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "list.h"
int main() {
list* mylist = new list();
//char a = 't';
mylist->prepend(10);
mylist->prepend(100);
cout << "Hello World1 " << mylist << endl;
mylist->print();
mylist->rprint(mylist->get_head());
cout << "Hello World\n" << ... | true |
2487704100bffb30b958c16217dde6ce89f724d0 | C++ | affilares/snoopwpf | /Snoop.GenericInjector/Executor.cpp | UTF-8 | 3,060 | 2.84375 | 3 | [
"MS-PL"
] | permissive | #include "pch.h"
#include <array>
#include <string>
#include <vector>
#include <comdef.h>
#include "NetCoreApp3_0Executor.h"
#include "NetFull4_0Executor.h"
bool icase_wchar_cmp(const wchar_t a, const wchar_t b)
{
return std::tolower(a) == std::tolower(b);
}
bool icase_cmp(std::wstring const& s1, std::wstring cons... | true |
31ec5b1f1a8a94ada4520f7119c390a46ff7ca0d | C++ | cpv-project/cpv-cql-driver | /src/LowLevel/RequestMessages/RegisterMessage.hpp | UTF-8 | 887 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "../ProtocolTypes/ProtocolStringList.hpp"
#include "./RequestMessageBase.hpp"
namespace cql {
/**
* Register this connection to receive some types of events
* The response to a REGISTER message will be a READY message.
*/
class RegisterMessage : public RequestMessageBase {
public:
usin... | true |
cd4d58d92f5bf2035fcc86224cd34e76b5048003 | C++ | BethIovine/BethSTL | /heap.h | UTF-8 | 3,336 | 3.125 | 3 | [] | no_license | //
// Created by Hemingbear on 2021/3/10.
//
#ifndef BETHSTL_HEAP_H
#define BETHSTL_HEAP_H
// heap operation mostly base on vector container.
template<class RandomAccessIterator>
inline void push_heap(RandomAccessIterator first, RandomAccessIterator last) {
push_heap_aux(first, last, size_type(first), value_type... | true |
7042f469b43ae6b22245e36cf39f3e75c2932349 | C++ | tomfunkhouser/gaps | /pkgs/R3Surfels/R3SurfelLabelAssignment.cpp | UTF-8 | 2,467 | 2.6875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | /* Source file for the R3 label assignment class */
////////////////////////////////////////////////////////////////////////
// INCLUDE FILES
////////////////////////////////////////////////////////////////////////
#include "R3Surfels.h"
////////////////////////////////////////////////////////////////////////
//... | true |
7b476c46bf3e39eb6576594c6cf63b178f164dc9 | C++ | Faizii992/Online-Solutions-2.2-Algorithm | /SCCShowallcomponentsandshowinputtedcomps.cpp | UTF-8 | 1,814 | 2.765625 | 3 | [] | no_license | #include<bits/stdc++.h>
#define true 1
#define false 0
#define white 0
#define grey 1
using namespace std;
int node,edge;
vector < int > adj[10];
vector < int > revadj[10];
stack < int > stck;
int color[100];
int x;
int mark=-1;
vector < int > scc[100];
int visited[100];
void DFS(int s)
{
... | true |
3677fb7763e841c942f9a7c2d771b99d8ed6e31f | C++ | XFone/exapi | /src/concurrent/fifo/FakeQueue.h | UTF-8 | 4,010 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | /*
* $Id: $
*
* Faked FIFO queue (contains only one item) for testing /debuging
*
* Copyright (c) 2014-2015 Zerone.IO (Shanghai). All rights reserved.
*
* $Log: $
*
*/
#pragma once
/** @file FakeQueue.h Faked FIFO/Queue */
#include "Base.h"
#include "Trace.h"
#include "IQueue.h"
#ifdef USE_TBB
#include <tb... | true |
c36ef5612ac6bcfd42ad89260c95364313c910b3 | C++ | rforcen/qt-metal | /metal/zcompiler/zCompiler.h | UTF-8 | 10,265 | 2.609375 | 3 | [] | no_license | #ifndef zCompilerH
#define zCompilerH
#include <complex>
#include "zSymbols.h"
using namespace std;
typedef u_char __byte;
class zCompiler {
public:
typedef complex<float> Complex;
string *fname;
int lfname;
constexpr static const float PHI = 1.6180339887;
static const int maxCons... | true |
f74d06223beb5878c9b53f5549725365dbdc083e | C++ | XiaoningCui/LeetCodePractice | /108. Convert Sorted Array to Binary Search Tree.cpp | UTF-8 | 3,572 | 4.125 | 4 | [] | no_license | /*
URL: https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree/
Author: CUI Xiaoning
Date: 2019-09-05
Difficulty: Easy
Tags: Tree, Depth-first Search
*/
/*
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.
For this problem, a height-balanced... | true |
c43d1f0741f4785d2abc2873fe0f5dbd1d13da90 | C++ | tch123/Algorithm | /Algorithms4Th/LibraryCPP/String.h | GB18030 | 10,132 | 3.046875 | 3 | [] | no_license | #ifndef V_STRING
#define V_STRING
#include <memory.h>
#include "Basic.h"
namespace Vonng
{
template<typename T>
class ObjectString : public Object
{
private:
static const T zero = 0;
mutable T* buffer;
mutable vint* reference;
mutable vint start;
mutable vint length;
mutable vint real... | true |
5acf31f612dd45d96b38a968e6c5e76f3bff820c | C++ | joecatarata/CodeDump | /UVA/895/895.cpp | UTF-8 | 539 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
void split(string str, vector<string> &out, string delim)
{
}
int main(){
ios_base::sync_with_stdio(false);
cout << "gumana" << endl;
vector<string> dict;
string input;
while(cin >> input){
if(input == "#")
break;
dict.pus... | true |
93e5ae882ca176cb82eae13f38aa5190b1fac1c4 | C++ | rikonek/zut | /semestr_2/zaawansowane_programowanie_obiektowe_c++/11.cpp | UTF-8 | 835 | 3 | 3 | [] | no_license | // zadanie na zaliczenie
// bartek.taczala@gmail.com
// Implement Matrix<N, M, T> (order is random here!)
// N - number of rows
// M - number of columns
// has templated copy ctor ( const Matrix<N1, M1, T1>& )
// N1 < N
// M1 < M
// T1 convertible to T
// has operators:
// ... | true |
f75ad6d21eae762175bd9f8ef91bf4c5df31fe7b | C++ | Jakooboo/lab1_Cwirko_Stasiak | /main.cpp | UTF-8 | 1,072 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include "proces.h"
int load_process(int liczba) {
process process_1("data."+std::to_string(liczba));
std::cout << "Dlugosc procesu " << liczba << " przed sortowaniem: " << process_1.calculate_length_of_process() << std::endl;
process_1.sort_process_first();
std::cout << "Dlugosc procesu "... | true |
606f70863d55a998efb76d73b22d05c419258e11 | C++ | piotrpopiolek/Code | /Szkoła Programowania/Rozdział 14 Listing 14.22 frnd2tmp/Rozdział 14 Listing 14.22 frnd2tmp/frnd2tmp.cpp | UTF-8 | 1,285 | 3.78125 | 4 | [] | no_license | #include<iostream>
using std::cout;
using std::endl;
template<typename T>
class HasFriend
{
T item;
static int ct;
public:
HasFriend(const T & i) :item(i)
{
ct++;
}
~HasFriend()
{
ct--;
}
friend void counts();
friend void reports(HasFriend<T> &); //parametr w postaci szablonu
};
//kazda specjalizacja ma w... | true |
a3bca1984b62627531f5f63802171573af3e1445 | C++ | ElefanteAlbino/FindMyThoughts | /FindMyThoughts.cpp | UTF-8 | 8,398 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <iterator>
#include <vector>
#include <cctype>
#include <algorithm>
#include <map>
using namespace std;
void lowerCase(string &str)
{
for(unsigned int i = 0; i < str.size(); i++){
if(isupper(str[i])){
str[i] = tolower(str[i]);
}
}
}
void filterWords(vector... | true |
af58249513e603429bf2df54ca8a7a4d9d5c5dfb | C++ | Vanadianfan/Algorithm | /Co-minimium Spanning Tree (次小生成樹).cpp | UTF-8 | 1,566 | 2.671875 | 3 | [] | no_license | #include<cstdio>
#include<vector>
#include<climits>
#include<cstring>
#include<iostream>
#include<algorithm>
const int N = 123, M = 350;
using namespace std;
int n, m;
bool used[M];
vector<int> MST[N];
int f[N], d[N][N];
template <class T>T MIN(const T &a, const T &b){
return a < b ? a : b;
}
struct YWZ{
int x, y, z;... | true |
b9f268b0b6623acc06cd71c8784f1ac493021598 | C++ | Thomas-WebDev/CSS503Project2 | /Shop.h | UTF-8 | 2,152 | 3.125 | 3 | [] | no_license | // ---------------------------------- Shop.h -----------------------------------
// By: Dr. Erika Parsons
// Modified by: Kevin Thomas Kehoe
// Course: CSS 503
// Assignment: Program 2
// Date of Last Modification: 05/06/2018
// -----------------------------------------------------------------------------
// Pur... | true |
d8da05ce526cd87a93e3f86e56b19e507d27feef | C++ | triplekill/C | /thread_class/thread.cpp | UTF-8 | 465 | 3 | 3 | [] | no_license | #include "thread.h"
Thread::Thread()
{
threadPara=NULL;
runFlag=0;
}
int Thread::run(void *Parameter)
{
HANDLE hThread;
if(runFlag) return -1;
this->threadPara=Parameter;
this->runFlag=1;
hThread=CreateThread(NULL,0,start_thread,(LPVOID)this,0,NULL);
CloseHandle(hThread);
return ... | true |
f8d026075dfd609b904c42abc608ca409549549a | C++ | SayanDutta001/Cpp-Codes | /Game Theory/TopCoder simpleNim.cpp | UTF-8 | 729 | 2.90625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
const int N=1e5+1;
class LongLongNim{
public:
int dp[N];
int numberOfWins(int maxN, vector<int>ar){
dp[0]=0;
int cnt=0;
for(int i=1;i<N;i++){
dp[i]=0;
for(auto xx: ar) if(xx<=i){
// from a winning p... | true |
84931361c4bbdba5be996a1370a3c6524ec38d64 | C++ | xinlianyu/EventCollection | /myqueue.cpp | UTF-8 | 1,821 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include "myqueue.h"
/****************************************************************/
myqueue::myqueue()
{
end=new q_element;
end->next=NULL;
end->pre=NULL;
end->value=-1;
start=end;
}
myqueue::~myqueue(){
q_element *q=start;
q_element *... | true |
6bcf536964942729181e4e85be6e349fa77c5c79 | C++ | FernandaRTenorio/DIMyR_FerRomeroT | /OPENGL TUT7/HELPERS.h | UTF-8 | 421 | 2.90625 | 3 | [] | no_license | #ifndef HELPERS_H
#define HELPERS_H
#include <fstream>
#include <string>
inline
void RemoveQuotes(std::string& input)
{
size_t pos;
while ( (pos = input.find('\"')) != std::string::npos )
{
input.erase(pos, 1);
}
}
inline
void ComputeQuaternionW(float* q)
{
float w2 = 1.0f - q[0] * q[0] - q[1] * q[1] - q[2]... | true |
718f7f34a01411dca5adf5470a122d797e0b4cb8 | C++ | cashinqmar/DSALGO | /practicequestions/assignmenthackrecursion/arithmetic.cpp | UTF-8 | 744 | 3.0625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool arithmetic(vector<int>& arr,int vsf,string exp,int idx){
if(idx==arr.size()){
if(vsf%101==0){
cout<<exp<<endl;
return true;
}
else return false;
}
bool res=false;
res=res|arithmetic(arr,vsf+arr[idx],exp+"+"+to_string(arr[idx]),idx+1);
if(res)re... | true |
c3617dbb6853fafbd9067decb23d86bb8a21fc9b | C++ | atrin-hojjat/CompetetiveProgramingCodes | /CF/EdRound_75/B.cpp | UTF-8 | 462 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int Q; cin >> Q;
while(Q--) {
int n; cin >> n;
int C = 0;bool X = false;
for(int i = 0; i < n; i++) {
int cnt[2] = {0, 0};
string str; cin >> str;
for(auto x : str)
cnt[x - '0']++;
if(cnt[0] % 2 && c... | true |
cb29be7c504cc43ea53593e047ac41f5f151f227 | C++ | nguyminh/CS-161 | /CS 161/fin.cpp | UTF-8 | 15,786 | 3.34375 | 3 | [] | no_license | /*Minh Nguyen
* 3/16/2014
* Final project
* Inputs include very basic conditional statements depending on which requirement you are in.
* output: Displays many different demonstrations of requirement list
*/
#include <iostream>
#include <limits.h>
#include <time.h>
#include <ctime>
#include <cstdlib>
#include <... | true |
a586d59ec11047ad23be913c6f185a456552c268 | C++ | CallmeAce/Coding_for_Fun | /workingspace/data_mining/symmetric_string.cpp | UTF-8 | 1,970 | 4.0625 | 4 | [] | no_license | /*
* Interesting Interview Problem
* Given a string, your task is to add alphabets at the end of it, and
* make it symmetric. of course, add a whole string is the most convinent
* way of doing that. But our goal is to make the symmetric string as short
* as possible
*
* It could be solved by dynamic programmin... | true |
141d16e5e8f2c24c00d9673010289b040e9b7c93 | C++ | PraxLannister/Codes | /assignments/MCA-2ndSem/ds/Assign-3/ques7.cpp | UTF-8 | 816 | 3.953125 | 4 | [] | no_license | /*WAP to reverse a Linked List.*/
#include<iostream>
#include<iomanip>
#include<cstdlib>
using namespace std;
typedef struct node
{
int data;
struct node *next;
}node;
node * head=NULL;
//a. Create a linked list.
node * createNode(int data)
{
node *newNode = new node;
if(!newNode)
{
cout<<"\nOVERFLOW!!!\n... | true |
111f074f0f5f0d70edac63a0d0ea294b8e1daf6d | C++ | albertorobles2000/Ejercicios-de-pilas-y-colas-con-la-stl | /src/ejercicio11.cpp | UTF-8 | 2,362 | 4.03125 | 4 | [] | no_license | /*
13. Implementa una cola con prioridad que contenga strings y de la que salgan primero las cadenas de caracteres
que tengan mas vocales y que en caso de igualdad salgan por orden alfabetico.
*/
#include <iostream>
#include <queue>
#include <string>
using namespace std;
int num_vocales(string s)
{
in... | true |
4988b946b39f5095777e4c4ddf01eaa8c4a555ba | C++ | Glock123/CsesSolutions | /MinimizingCoins.cpp | UTF-8 | 447 | 2.515625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int n, target;
cin >> n >> target;
int a[n];
for(int i=0; i<n; i++) cin >> a[i];
vector<int> dp(target + 1, 1e9);
dp[0] = 0;
for(int i=1; i<=target; i++)
for(int j=0; j<n; j++)
if(i - a[j] >= 0) dp... | true |
6272079a2328cf067deb4df6754e23897ba9d086 | C++ | ABackerNINI/CRMS_On_VxWorks | /utility/TimeUtil/Duration.h | UTF-8 | 2,383 | 3.078125 | 3 | [] | no_license | #pragma once
#ifndef _ABACKER_DURATION_H_
#define _ABACKER_DURATION_H_
#include "DateTime.h"
class Duration {
friend class DateTime;
public:
unsigned long long ddateTime; //second * 1000
#if (FEATURE_GET_CPU_CYCLE_COUNT)
long long dcpuCycleCount;
#endif
#if (FEATURE_GET... | true |
83b46ce01c5bdb888d161f66084d1324e7249d66 | C++ | thomaswohlfahrt/oiram_repus_jumpnrun | /source/Logic.h | UTF-8 | 4,085 | 3.234375 | 3 | [] | no_license | #ifndef LOGIC_H
#define LOGIC_H
#include "SDL/SDL.h"
#include <string>
#include "movingItem.h"
#include "player.h"
#include <iterator>
class map;
using namespace std;
/**
* @brief A class responsible for moving Item objects, detecting collisions and resolving them.
* Various methods for handling collisions betwe... | true |
615c319f51a5fbfeb6e44b86cea8dac70998f59f | C++ | Justocodes/C-Projects | /PROJECTS/THE PAINTING PROJECT.cpp | UTF-8 | 6,209 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <iomanip>
using namespace std;
int main() {
int bedroom1, bedroom2, basement;
int window1, window2, window3, window4;
int length;
int width;
int height;
int total_area_room1, total_area_room2, total_area_basement;
int total_area;
int count, counte... | true |
72d7e4de0437d6ecd39458065b859086fddbd719 | C++ | eriser/SynthTest | /Arduino/_03_Low_Pass_Filter_Tester/_03_Low_Pass_Filter_Tester.ino | UTF-8 | 1,642 | 2.765625 | 3 | [] | no_license | /** Outputs a constant analog value to the piezo element.
* This is to test the effectiveness of an attached low-pass
* filter (sim.okawa-denshi.jp/en/PWMtool.php, provideyourown.com/2011/analogwrite-convert-pwm-to-voltage/).
* Silence is good.
*/
const int speakerPin = 9;
/** From: playground.arduino.cc/Code/Pwm... | true |
10320f2d8856fa8c32291faefc729938c7c8edc2 | C++ | CmosZhang/Code_Practice | /LintCode/背包问题IV.cpp | GB18030 | 1,513 | 3.4375 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
//һЩƷһĿֵжֿĿ
//Ʒ [2,3,6,7] Ŀֵ 7, ô2ֿܣ[7] [2, 2, 3]Է2
//Ҳ12510Ӳʴ80Ԫķ
//Ӳҿظѡ
//״̬תƷ̣
//dp[i][j]ǰiӲҴճjԪķ
//dp[i][j]=dp[i-1][j]+dp[i-1][j-A[i]*1]+dp[i-1][j-A[i]*2]+...+
int backpack(vector<int>&item, int targ... | true |
4ecfc7ca65b4591417bd45c4027074012e112645 | C++ | ghbenjamin/quarantania2 | /src/systems/AnimationSystem.cpp | UTF-8 | 1,648 | 2.578125 | 3 | [] | no_license | #include <systems/AnimationSystem.h>
#include <game/Level.h>
#include <graphics/RenderInterface.h>
#include <components/RenderComponent.h>
#include <components/AnimationComponent.h>
#include <utils/Memory.h>
AnimationSystem::AnimationSystem(Level *parent)
: System(parent)
{
m_level->events().subscribe<Gam... | true |
f02a4af8c62a5ef4b3004642877ef356d7d2a6f2 | C++ | Gummybearr/PS | /leetcode/Remove Duplicates from Sorted Array.cpp | UTF-8 | 265 | 2.671875 | 3 | [] | no_license | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
set<int> s;
for(int i = 0;i<nums.size();i++){s.insert(nums[i]);}
vector<int> v;
for(auto i:s){v.push_back(i);}
nums = v;
return s.size();
}
}; | true |
2fb4e85c6a9ce873deb089a2a24145ca49cf3e88 | C++ | WhiZTiM/coliru | /Archive2/39/5ab7884091af2f/main.cpp | UTF-8 | 2,038 | 2.703125 | 3 | [] | no_license | #include <boost/icl/split_interval_set.hpp>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/phoenix.hpp>
#include <boost/range/adaptors.hpp>
#include <boost/range/algorithm.hpp>
#include <iostream>
#include <map>
namespace icl = boost::icl;
using boost::adaptors::map_values;
typedef icl::split_i... | true |
0853c174af26cb958c468f8980c4848ab6024862 | C++ | xiongfj/Backup | /0-----C#/弱引用.cpp | UTF-8 | 488 | 2.9375 | 3 | [] | no_license |
* 弱引用数据在垃圾回收的时候会被系统回收, 有一定的风险,
* 所以在使用前需要判断是否已经被回收
public void func()
{
WeakReference mathReference = new WeakReference(new xxClass() );
xxClass obj;
if (mathReference.IsAlive)
{
obj = mathReference.Target as xxClass;
...
}
else
;// 对象已经被回收,无法使用.
GC.Collect(); // 垃圾收回
if (mathReference.IsAlive) /... | true |
25c19de46c8a7cb163cb7b138fe8ba67503ddeaa | C++ | gitkobaya/rcga | /cmd_check.cpp | SHIFT_JIS | 11,365 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdarg>
#include<cstdlib>
#include<cstring>
#include "cmd_check.h"
CCmdCheck::CCmdCheck()
{
iGenerationNumber = 0;
iGenDataNum = 0;
iGenVectorDimNum = 0;
iCrossOverNum = 0;
iGaMethod = 0; // lf`̎@ݒ
iOutputFlag = 0;
pcFuncName = NULL;
lfAlpha = 0.0;
lfBeta = ... | true |
76189aea15a5a90ed5a355627e7d328f2ae5df57 | C++ | Rosta6/chess | /functions.cpp | UTF-8 | 5,381 | 2.96875 | 3 | [] | no_license | #include "header.h"
HANDLE color = GetStdHandle(STD_OUTPUT_HANDLE);
#define X 48
#define Y 24
void menu(){
cout << " 2 - Zadej tah. " << endl;
}
struct Round //data structure for storing rounds
{
string white_move;
string black_move;
};
class chessBoardClass
{
public:
... | true |
1171b954047724f24219a387b906359b72cda476 | C++ | daboytim/cse560 | /lab1/outputStream.h | UTF-8 | 1,201 | 3.109375 | 3 | [] | no_license | /*
* resultOutputStream.h
*
* Created on: Nov 25, 2009
* Author: Derek Boytim
*/
#ifndef _OutputStream
#define _OutputStream
#include <iostream>
#include <fstream>
class OutputStream {
private:
ofstream outputStream;
string outputFile;
bool isOpen;
public:
OutputStream(string);... | true |
71fd626ef104e7ce42983c7acfe5b103a938b9cc | C++ | codfish92/dataStructures | /CS262/Lab06/LinkedListIter/LinkedListIter.h | UTF-8 | 2,855 | 3.875 | 4 | [] | no_license | // FORWARD ITERATORS to step through the nodes of a linked list
// A node_iterator of can change the underlying linked list through the
// * operator, so it may not be used with a const node. The
// node_const_iterator cannot change the underlying linked list
// through the * operator, so it may be used with a const no... | true |
539e928db1919ee80c25728acadf8331b9c9b40b | C++ | ajb042487/cpp-distributed-text-system | /embedded/distributed-text/include/config/ReadOnlyConfiguration.h | UTF-8 | 2,033 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef CONFIG_READONLYCONFIGURATION_H
#define CONFIG_READONLYCONFIGURATION_H
#include <cstdint>
#include <string>
#include <vector>
#include "rapidjson/document.h" //#TODO: Forward-declare
namespace Config
{
using rapidjson::Document;
class ReadOnlyConfiguration
{
public:
ReadOnlyConfiguration()... | true |
01c6503c80b1dc6ae2e74ee571c83c4c56fc50ad | C++ | Codechef-SRM-NCR-Chapter/30-DaysOfCode-March-2021 | /answers/harshpreet0508/day18/q2.cpp | UTF-8 | 617 | 3.421875 | 3 | [
"MIT"
] | permissive | // Given an array, sort in decending order of set bits
#include<bits/stdc++.h>
using namespace std;
int sbc(int n)
{
int c=0;
while(n)
{
if(n & 1 == 1)
c++;
n = n>>1;
}
return c;
}
int func(int n1,int n2)
{
int c1 = sbc(n1);
int c2 = sbc(n2);
if(c1<=c2... | true |
efc3c6ece945229fdb7a14a1e471ba2d4393b694 | C++ | iloveooz/podbelsky2008 | /05/p05_05.cpp | UTF-8 | 445 | 3.375 | 3 | [] | no_license | //p05_05.cpp - увеличение указателя
#include <iostream>
using namespace std;
int main()
{
float zero = 0.0, pi = 3.141593, Euler = 2.718282;
float *ptr = &Euler;
cout << "\n ptr = " << ptr << " &ptr = " << &ptr << " *ptr = " << *ptr;
cout << "\n(ptr + 1) = " << (ptr + 1) << " *(ptr + 1) = " << *(ptr +... | true |
dffd932afa6c8b56f7600e868a183987f44dbd65 | C++ | sadisticaudio/SDKs | /AAX_SDK_2p3p2/ExamplePlugIns/Common/ProcessingClasses/CSimpleSynth.cpp | UTF-8 | 3,900 | 2.6875 | 3 | [] | no_license | /*================================================================================================*/
/*
* Copyright 2015 by Avid Technology, Inc.
* All rights reserved.
*
* CONFIDENTIAL: This document contains confidential information. Do not
* read or examine this document unless you are an Avid Technology empl... | true |
4ac38f0fe045eb60bfd5aa62a8977b164c0631c8 | C++ | aixi/blaze | /blaze/net/Acceptor.cc | UTF-8 | 2,139 | 2.515625 | 3 | [] | no_license | //
// Created by xi on 19-2-3.
//
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <blaze/log/Logging.h>
#include <blaze/net/EventLoop.h>
#include <blaze/net/InetAddress.h>
#include <blaze/net/SocketsOps.h>
#include <blaze/net/Acceptor.h>
namespace blaze
{
namespace net
{
Acceptor::Acceptor(Even... | true |
4948f33e0c9a3b96dfd27fb3c077aa3880cb7f2b | C++ | vishnuRND/Programs | /spiralform.cpp | UTF-8 | 890 | 3.0625 | 3 | [] | no_license | // spiralform.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdlib.h>
int a[10][10];
void spiral(int row,int column)
{
for(int i=0;i<row;i++)
{
for(int j=0;j<column;j++)
{
if(!(i==j||j==((column-1)-i)))
printf("%d",a[i][j]);
printf("\t");
}
printf("\n"... | true |
4a0f8136ade47a2e8701849a5452c3f7af9282a9 | C++ | CSE-560-GPU-Computing-2021/project_-team_4 | /rrt_cpu/main_single_rrt.cpp | UTF-8 | 2,173 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <chrono>
#include "Canvas.h"
#include "Utils.h"
#include "Tree.h"
#include "config.h"
#include "random"
int build_tree(Tree *tree1){
std::ofstream myfile;
myfile.open ("path_raw.txt", std::ios_base::app);
std::default_random_engine generator;
generator.se... | true |
a8df66d66676de931f95c119ddde71da46c8d2c3 | C++ | aselalee/ArduinoBluetoothRemoteCar | /SumoBot/MicroServo.h | UTF-8 | 545 | 2.671875 | 3 | [] | no_license |
#ifndef _MICROSERVO_H_
#define _MICROSERVO_H_
#include <Arduino.h>
#include <Servo.h>
class MicroServo
{
public:
MicroServo(uint8_t const pin,
uint16_t const rangeMin,
uint16_t const rangeMax,
uint16_t const moveOffest);
~MicroServo();
void Begin();
void R... | true |
ae05df072e2189fd1a71c6b6f9ef35f628400677 | C++ | tonyeko/Polinom | /BruteForce.hpp | UTF-8 | 463 | 2.625 | 3 | [] | no_license | // bruteforce.cpp
// Nama : Tony Eko Yuwono
// NIM : 13518030
#include "Polinom.hpp"
Polinom multiplicationBruteForce(Polinom P1, Polinom P2) {
Polinom result(P1.getDerajat()+P2.getDerajat(), true);
for (int i = 0; i <= P1.getDerajat(); i++) {
for (int j = 0; j <= P2.getDerajat(); j++) {
i... | true |
2cb4cf26ffaff37c9f3db79bff468f48d4b7c953 | C++ | yazevnul/teaching | /hse/2016/1/cpp/2016_10_19/main.cpp | UTF-8 | 3,483 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cassert>
#include <cstdint>
// http://en.cppreference.com/w/cpp/language/operator_precedence
// http://en.cppreference.com/w/cpp/language/integer_literal
static constexpr uint32_t SetBit(const uint32_t value, const uint8_t index) noexcept {
assert(index <= sizeof(u... | true |
2fc771fded2e3cb15262ce9686148c731ab623ba | C++ | bq-wang/mainStream | /cpp/cppprimer/src/exceptionhandlings/src/exceptionhandlings/stackExcp.cpp | UTF-8 | 3,870 | 3.453125 | 3 | [] | no_license | #include "stdafx.h"
#include "stackExcp.h"
#include <iostream>
#include <string>
using std::cout;
using std::endl;
//void iStack::pop(int &top_value)
//{
// if (empty())
// {
// throw popOnEmpty();
// }
// top_value = _stack[--_top];
// cout << "istack::pop(): " << top_value << endl;
//}
//
//
//vo... | true |
4d444303c104af6caf0c4eb50edd21efb583b70c | C++ | deepank1728/workspace | /cpp/new/mergesort.cpp | UTF-8 | 706 | 3.265625 | 3 | [] | no_license | #include<iostream>
using namespace std;
void merge_sort(int a[],int low,int mid,int up)
{
int c[up-low+1];
int i=low,j=mid+1,k=0;
while(i<=mid && j<=up)
{
if(a[i]<a[j])
c[k++]=a[i++];
else
c[k++]=a[j++];
}
while(i<=mid)
c[k++]=a[i++];
while(j<=up)
c[k++]=a[j++];
k=0;
for(int p=low;p<=up;p+... | true |
a2b6bcba093cd008c763063265a4431d6bb06e7b | C++ | cc-catch/cppcourse | /course01/project01/fran/food.cc | UTF-8 | 1,959 | 2.875 | 3 | [] | no_license | #include "food.h"
#include "cinder/Rand.h"
Food::Food(float radius):
mRadius(radius)
{}
void Food::Update(double elapsedSeconds)
{
mAnimateOffset = cinder::vec2(cos(elapsedSeconds) * mRadius, sin(elapsedSeconds) * mRadius);
}
void Food::Draw()
{
// A Tasty Flower for a very hungry caterpillar
cinder::gl::color(... | true |
f37145dbd5905232fd1a89259566692f3c2f64f5 | C++ | ligewei/hodgepodge | /bailian/2683.cpp | UTF-8 | 225 | 2.75 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int n;
cin >> n;
double a = 2;
double b = 1;
double sum = 0;
for(int i=1;i<=n;i++)
{
sum += a/b;
a = a+b;
b = a-b;
}
printf("%.4lf\n",sum);
return 0;
} | true |
7d417c0b4d174a8c20106c9113d4f7757f74bf7e | C++ | shouzo/Data-Structure-Learning_pages | /Data_Structures_6th_Edition/example/5第五章/5-5節Dijkstra++.cpp | BIG5 | 2,046 | 3.515625 | 4 | [] | no_license | /*=========================================================
5-5` qY@IlUI̵u|
Dijkstra() Dijkstratk
find_min() XDecided[]=0BDist̤p
Cost[V][V] ϧΪ[vFx}
Dist[V] q_IUI̵uZ
Prior[V] UI̵u|e@ӳI
Decided[V] ̵uwO_wMw
=========================================================
*/
#include ... | true |
5f08e3f976a02c056064f2983b6c3f96bb0ea3dd | C++ | SashaFlaska/ucd-csci2312-pa2 | /Point.cpp | UTF-8 | 7,627 | 3.46875 | 3 | [] | no_license | //
// Point.cpp
// PA2
//
// Created by Alexander Flaska on 2/24/16.
// Copyright © 2016 Alexander Flaska. All rights reserved.
//
#include "Point.h"
#include <cmath>
#include <algorithm> //min, max
#include <string>
#include <sstream>
#include <iostream>
#include "Point.h"
using namespace std;
using namespace ... | true |
21403041b6b9e7b2c6a04082ecd0b6b16a28db54 | C++ | bradleymckenzie/McKenzie-Bradley-CIS-17a-48969 | /Hmwk/Assignment 4/Gaddis_8thEd_Chapter13_Probl6_InventoryClass/main.cpp | UTF-8 | 1,839 | 3.859375 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Bradley McKenzie
* Created on October 20, 2017
* Purpose: Inventory Class:
*/
//System Libraries
#include <iostream>
#include <iomanip>
using namespace std;
//User Libraries
#include "Inventory.h"
//Global Constants
//Such as PI, Vc, -> Math/Science Values
... | true |
fc0f8a34a2be54e385a8a32266237bbd223bdab8 | C++ | YifatYank/advencedPrograming2018 | /ex1/src/ClassicLogic.h | UTF-8 | 2,241 | 3.265625 | 3 | [] | no_license | /**
* Name : Yifat Yankocivh
* ID : 204709224
* User Name : yankovy
*/
#ifndef CLASSICLOGIC_H_
#define CLASSICLOGIC_H_
#include "GameLogic.h"
#include "Player.h"
#include "GameDisplay.h"
#include "ConsuleDisplay.h"
#include <iostream>
using namespace std;
/*The class represents the classical logic of reversy game... | true |
5a5351918228d56b87d790b38fb6baff64aa5543 | C++ | DusanInfinity/ooprojektovanje-lab | /Lab. vezba 3 - SkiSanta/SkiSport/skisanta.cpp | UTF-8 | 1,526 | 2.9375 | 3 | [] | no_license | #include "skisanta.h"
#include <QDebug>
SkiSanta::SkiSanta(int w, int h, QObject *parent) : QObject(parent)
{
x = w/4;
y = h/4;
this->h = h;
this->w = w;
currentState = 1; // 0 - levo, 1 - pravo, 2 - desno
imageState = 0;
QImage imageL1, imageL2, imageS1, imageS2, imageR1, imageR2;
ima... | true |
3ea8c80ddaab006aa18b7b92e2fd7cc657789b04 | C++ | c437yuyang/Test_Cpps | /21_0_构造函数析构函数执行顺序/21_0_构造函数析构函数执行顺序.cpp | GB18030 | 762 | 3.3125 | 3 | [] | no_license | // 21_0_캯ִ˳.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <iostream>
using namespace std;
class B {
public:
B(void)
{
cout << "B\t";
}
~B(void)
{
cout << "~B\t";
}
};
struct C {
C(void)
{
cout << "C\t";
}
~C(void)
{
cout << "~C\t";
}
};
struct D : B {
D() { cout << "D\t"; }
~D() { cout << "~D... | true |
d4ed1dc82d32a9929fd84f6f1470e7cbeb0a6f90 | C++ | mikechen66/CPP-Programming | /CPP-Programming-Principles/chapter06-programming/ex10_permutations.cpp | UTF-8 | 2,004 | 3.53125 | 4 | [] | no_license | #include "../text_lib/std_lib_facilities.h"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
int get_fac(int num)
{
// Check for negative num
if (num < 0) error("Cannot find factorials of negative numbers.");
int fac = num;
if (fac == 0)
fac = 1;
else
... | true |
d2273d98496367de03079241fcb88b937f96baf0 | C++ | dakeryas/CosmogenicAnalyser | /src/TimeDivision.cpp | UTF-8 | 2,429 | 3.1875 | 3 | [] | no_license | #include "TimeDivision.hpp"
#include <cmath>
namespace CosmogenicAnalyser{
TimeDivision::TimeDivision(double timeBinWidth, TimeWindow onTimeWindow, TimeWindow offTimeWindow)
:timeBinWidth(timeBinWidth),onTimeWindow(std::move(onTimeWindow)),offTimeWindow(std::move(offTimeWindow)){
if(timeBinWidth < 0) ... | true |
191677f9e6b4da19c1106c4e887f4ec05ecb8f03 | C++ | SenaYora/NanotekSpice | /include/components/Input.hpp | UTF-8 | 864 | 2.78125 | 3 | [] | no_license | /*
** EPITECH PROJECT, 2020
** OOP_nanotekspice_2019
** File description:
** Input
*/
#ifndef INPUT_HPP_
#define INPUT_HPP_
#include "IComponent.hpp"
class Input : public nts::IComponent {
public:
Input(std::string);
~Input();
nts::Tristate compute(__attribute__((unused)) std::size_t pin... | true |
f262867ffecd24c9f58e1e7a45c49b0fccc70812 | C++ | wsnk/concur | /concurrency_queue/tests/concur-test/src/thread_master.cpp | UTF-8 | 1,947 | 2.53125 | 3 | [] | no_license | # include "thread_master.h"
# include <boost/test/test_tools.hpp>
//--------------------------------------------------------------------------------
# ifdef _WIN32
# include <Windows.h>
# include <WinBase.h>
# else
# include <sched.h>
# endif
//---------------------------------------------------------------------... | true |
c22577deed70f81c81fd7933a9ce1d9d1611c909 | C++ | Fihiz/42-final_CPP | /CPP_08/ex02/mutantstack.hpp | UTF-8 | 3,440 | 3.359375 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* mutantstack.hpp :+: :+: :+: ... | true |
6eeb132e4dc1bca2e5f077953cf3ec51bc80e3e6 | C++ | TopKekstar/RVR | /practica3.1/GameServer.h | UTF-8 | 1,654 | 2.671875 | 3 | [
"Unlicense"
] | permissive | #include <pthread.h>
#include <map>
#include "UDPServer.h"
#include "Game.h"
/**
* La clase GameServer representa el servidor dedicado del juego. La
* funcionalidad de red se implmenta mediante el interfaz de UDPServer (Prác-
* tica 2.3).
*
* Esta clase se encarga de realizar además la simulación del juego.
... | true |
479cc5278ccb2da6a1c8e8a2f0d95261bea050da | C++ | BFH1122/TCP_VIEW | /Service/MFCMyDialog/RandomEntry.cpp | GB18030 | 901 | 3.078125 | 3 | [] | no_license |
#include <iostream>
#include "random.h"
#include<cstdlib>
#include<ctime>
//ľʵ
int* randomNums::getNums() {
return nums;
}
//ĺ
void randomNums::randomN() {
//
nums = new int[n];
for (int i = 0; i < n; i++) {
nums[i] = rand() % 20 - 10;
}
}
randomNums::randomNums() {
}
//캯
randomNums::randomNums(int nn) {
... | true |
01137f06c6e6c8a1b6eb13eae22943c37e7243cf | C++ | bozhink/Code-Chunks | /Ada/livro-ds/gfilac.h | ISO-8859-1 | 1,248 | 3.5625 | 4 | [] | no_license | // (C) 1999, Arthur Vargas Lopes
// Arquivo fonte GFilaC.h
#ifndef FILAC
#define FILAC
#include <stdio.h>
#include <iostream.h>
#include <process.h>
#include <malloc.h>
template <class Tipo_Dado,int N> class FilaC
{
public:
Filac(); // Construtor
void Queue(Tipo_Dado D);
void DeQueue(Tipo_Dado *R);
int Taman... | true |
2599779e0f51e90a883aff8f0033df0b87cae679 | C++ | germix/germix-games | /code/game-aisland/src/EntityParameters.h | WINDOWS-1250 | 628 | 2.53125 | 3 | [] | no_license | ////////////////////////////////////////////////////////////////////////////////////////////////////
//
// EntityParameters
//
// Germn Martnez
//
////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef ___EntityParameters_h___
#define ___EntityParameters_h___
#inclu... | true |
b9190c756a20c17662777de14ea3010b58380382 | C++ | BillXu/TestLua | /TestLua/testClass2.h | UTF-8 | 1,292 | 2.625 | 3 | [] | no_license | #pragma once
#include "mytestClass.h"
#define PKG_NUM 2
struct stTestBase
{
stTestBase(){ x = y = 0 ;nType = 0 ; }
int nType ;
int x ;
int y ;
};
struct stChild
:public stTestBase
{
stChild(){ z = 0 ;nType = 1 ;}
int z ;
};
class COthreBase
{
public:
COthreBase(){};
void Print(){ printf("multi ji cheng\n"... | true |
4d4a0f57236e4963ddb80b95307acb98c19e7a74 | C++ | bmvskii/DataStructuresAndAlgorithms | /Sort, search algorithms/Вариант у-2/priority_queue_ordered_vector_impl.cpp | UTF-8 | 2,149 | 3.0625 | 3 | [] | no_license | #include "priority_queue.hpp"
#include "vector.hpp"
#include <cassert>
struct PriorityQueue
{
Vector m_orderedItems;
int fixedSize;
};
PriorityQueue * PriorityQueueCreate (int _fixedSize)
{
PriorityQueue * pPQ = new PriorityQueue;
VectorInit( pPQ->m_orderedItems );
pPQ->fixedSize = _fixedSize;
return pPQ;
}
... | true |
010d4f27cb32342e2dbf78c773e828dfea3e7742 | C++ | markygriff/Mr.Engine | /MrEngineLib/MrEngine/Camera2D.hpp | UTF-8 | 1,552 | 2.859375 | 3 | [] | no_license | #ifndef Camera2D_hpp
#define Camera2D_hpp
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <stdio.h>
namespace MrEngine
{
class Camera2D
{
public:
Camera2D();
~Camera2D();
void init(int screenWidth, int screenHeight);
void update();
/// Converts screen coo... | true |
18ace9e085940ec5cf18207792b00ed0049ae0b4 | C++ | kgandhi09/C-Cpp | /fopen/src/fopenForClass.cpp | UTF-8 | 768 | 2.671875 | 3 | [] | no_license | //============================================================================
// Name : fopen.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <io... | true |
35b1f6c0cbf29594ad6c73f8ef072e9be630f680 | C++ | YuWan1117/StudyServer | /r_l.cpp | UTF-8 | 751 | 2.796875 | 3 | [] | no_license | /*
* (C) 2007-2015 Alibaba Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* r_l.cpp --
*
* Version: 1.0 2015年07月28日 14时36分25秒
*
* Authors:
* Sweetheart502 (... | true |
b3cb39c05a15730817a8c83a3dfb8848f56af36b | C++ | GainAw/Calculator-Test | /Project1/Calculator.h | UTF-8 | 502 | 2.875 | 3 | [] | no_license | #pragma once
#include<string>
#include<iostream>
#include<conio.h>
using namespace std;
namespace Calculator
{
double add(double left, double right);
double sub(double left, double right);
double mult(double left, double right);
double div(double left, double right);
double car(double left, double r... | true |
fa74ae3b134cf3681feea9f5cbf21b21f91b90d7 | C++ | GustavoECM/CodigoC- | /Estudo_Funcao_C++_Livro/Estudo_Funcao_C++_Livro/FuncaoMatematica.cpp | ISO-8859-1 | 984 | 3.5 | 4 | [] | no_license | #include "stdafx.h"
#include "FuncaoMatematica.h"
#include<iostream>
using namespace std;
FuncaoMatematica::FuncaoMatematica()
{
}
void FuncaoMatematica::exemplosFuncao() {
int x = 9.2 , y = 8;
cout << ceil(x)<< endl; //arrendonda x para o menor inteiro no menor que x
cout << cos<int>(x) << endl; //co_se... | true |
3e0e2f02432166ffd21c3745ef70023d8e9e8181 | C++ | JonyOliva/GameSFML | /animation.cpp | UTF-8 | 4,152 | 2.828125 | 3 | [] | no_license | #include "animation.h"
#include <iostream>
Animation::Animation(sf::Texture* texture, int initRow, sf::Vector2u _imgCount, float _frameTime, bool ppMode){
currentImage = {0, initRow};
frameTime = _frameTime;
totalTime = 0;
imgCount = _imgCount;
pingpong = ppMode;
tRect.width = texture->getSize(... | true |