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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
7943f3af19f06dc39a8845f3c92d042bfd1afba8 | C++ | SundeepK/Splitter | /src/TextureMapper.cpp | UTF-8 | 4,464 | 2.796875 | 3 | [] | no_license | #include <TextureMapper.h>
TextureMapper::TextureMapper(float scale) : m_scale(scale) {
}
TextureMapper::~TextureMapper() {
}
float TextureMapper::fl(float num) {
return floor( num * 1000.00 + 0.5 ) / 1000.00;
}
b2Vec2 TextureMapper::fl(b2Vec2 num) {
return b2Vec2(fl( num.x), fl( num.y));
}
float TextureMa... | true |
f25a73e081f9bb31e5a1c7e9e57288cf92d1c098 | C++ | atharvkaranjkar/Advance-Data-Structures | /8_BloomFilter.cpp | UTF-8 | 5,240 | 3.484375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class BloomFilter
{
public:
bool arr[100];
int filter_size;
int filter;
BloomFilter(int n)
{
filter_size = n;
for (int i = 0; i < filter_size; i++)
{
arr[i] = false;
}
filter = 0;
}
int hash1(strin... | true |
222d57220aa299dab4e47d29f1e3b77ca9e86c94 | C++ | VladGuryev/dictionary | /main.cpp | UTF-8 | 1,297 | 2.71875 | 3 | [] | no_license | #include <string>
#include <experimental/string_view>
#include <iostream>
#include "translator.h"
#include "test_runner.h"
#include "profile.h"
using namespace std::experimental;
using namespace std;
void TestSimple ()
{
Translator translator;
translator.Add (string ("okno"), string ("window"));
translator.Add... | true |
4d80d0c690719114990797edff2cf6d872bfc2ce | C++ | ilim0t/numerical-analysis | /test/calculation_test.cpp | UTF-8 | 2,982 | 3 | 3 | [] | no_license | #include <gtest/gtest.h>
#include <complex>
#include <iostream>
#include <data.hpp>
#include <calculation.hpp>
TEST(Data_Mat_Calculation, Dot) {
EXPECT_EQ(dot(Mat<double, 2, 2>{{1, 2},
{3, 4}},
Mat<double, 2, 2>{{5, 6},
{7, 8... | true |
a9dc3c3e5b38bf518e31a5a7028d87aaffd7890e | C++ | 3for/verifiable-shuffle | /src/G_q.h | UTF-8 | 1,586 | 3.296875 | 3 | [
"Apache-2.0"
] | permissive | /*
* G_q.h
*
* Created on: 30.09.2010
* Author: stephaniebayer
*
* Class describing the group G_q subset of Z_p with prime order q.
*
*/
#ifndef G_q_H_
#define G_q_H_
#include "Cyclic_group.h"
#include "Mod_p.h"
#include <NTL/ZZ.h>
NTL_CLIENT
class G_q: public Cyclic_group {
private:
Mod_p gener... | true |
b39bccb23b12aded338878aa5849fcb64efaac12 | C++ | NeacsuRadu/Visibility-algorithms | /src/demo/simple_polygon_visibility.cpp | UTF-8 | 10,222 | 2.796875 | 3 | [] | no_license | #include "simple_polygon_visibility.h"
#include "polygon_helpers.h"
simple_polygon_visibility * singleton<simple_polygon_visibility>::instance = nullptr;
extern std::string run_type;
void simple_polygon_visibility::preprocess_polygons(const std::vector<std::vector<point>>& polygons)
{
m_polygon = polygons[0];
... | true |
8284e74cdb98ba695cb68c8d7155fc12f9401e5f | C++ | mateusztasz/HarmonySearchAlgorithm | /Program/include/harmony.hh | UTF-8 | 1,584 | 3.03125 | 3 | [] | no_license | #ifndef HARMONY_HH
#define HARMONY_HH
#include <iostream>
#include <string>
#include <iomanip>
#include <ctime>
#include <random>
#include <chrono>
#include "boundary.hh"
using namespace std;
/*!
* \file
* \brief The file contains a definition of Harmony Class.
*
*/
/*!
* \brief Models every generated harm... | true |
e1d438822e056dfd6039946110297e8112f8bc0d | C++ | zwcloud/EmbededListView | /MainListModel.cpp | UTF-8 | 1,418 | 2.875 | 3 | [] | no_license | #include "MainListModel.h"
#include "MyObject.h"
#include "SubListModel.h"
void MainListModel::fill(std::vector<MyObject*>& objectList)
{
beginResetModel();
//clear old sub-models
for (SubListModel* model : m_children)
{
delete model;
model = nullptr;
}
m_children.clear();
/... | true |
ec3f00468125dcc0639d20f4a9d776b58d346da2 | C++ | Arnaudlaurent/EXIIITIA-1 | /CODE/LIB/ExtiaCounter/ExtiaCounter.h | UTF-8 | 1,070 | 2.65625 | 3 | [] | no_license | #ifndef EXTIA_COUNTER_H_
#define EXTIA_COUNTER_H_
#include "Arduino.h"
extern "C" void TIMER1_OVF_vect(void) __attribute__((signal));
#define MAX_COUNTER 3
// 65536 - 16000 => TIMER1 max value (16bits) - 16Mhz master clock, no prescaler
#define TIMER_INITVAL 49536
class ExtiaCounter {
public:
ExtiaCounter();
bo... | true |
203212bf0df835bcbd1179f5226ba507642dbc9d | C++ | moyang602/bit_mbzirc | /src/bit_task/src/map_address_manage.cpp | UTF-8 | 2,244 | 2.53125 | 3 | [] | no_license | #include "ros/ros.h"
#include "bit_task/FindMapAddress.h"
#include "bit_task/isAddressExist.h"
#include "bit_task/WriteAddress.h"
// 获取指定地点位置
bool FindMapAddress(bit_task::FindMapAddress::Request &req,
bit_task::FindMapAddress::Response &res)
{
std::string Name = req.AddressToFind;
// To do ... | true |
9a34ad2c43c76e5dc3c8d3434b8bdf0e5205f820 | C++ | seongwon-kang/Elsword-Source-2014 | /KncWX2Server/Common/ServerLogManager.cpp | UHC | 3,537 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "ServerLogManager.h"
//////////////////////////////////////////////////////////////////////////
const wchar_t* serverlog::GetLogLevelStr( serverlog::LOG_LEVEL eLogLevel )
{
switch( eLogLevel )
{
case serverlog::CLOG: return L"clog";
case serverlog::CLOG2: return L"clog2";
case serverlog::CWARN: return ... | true |
e7e2630083288204cecb4badf597645c7261ddeb | C++ | melody40/monorepo | /C++ codes/splitString/main.cpp | UTF-8 | 610 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
int main() {
char s;
std::ifstream inputfile("input.txt");
std::ofstream outputfile;
outputfile.open("output.txt", std::ofstream::out);
// size_t pos = 0;
// std::string token;
// while ((pos = s.find(delimiter)) != std::string::npos) {
// token... | true |
8c0957eb53f3ce318c6bfcccb1b96a3481bcbefd | C++ | sajeda123/Data-Structure | /Linked List/Delete_node.cpp | UTF-8 | 1,815 | 3.40625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
struct linked_list
{
int num;
struct linked_list *next;
};
typedef struct linked_list node;
node *head=NULL,*last=NULL,*previous=NULL;
void delete_node(int key)
{
int flag=0,p=0;
node *my_node=head;
while(my_node!=NULL)
{
p++;
... | true |
a8603d53bc10afc1e9039cb840cf1cfd67acf906 | C++ | KsGin/LeetCode | /LeetCode/ConstructTheRectangle.h | UTF-8 | 633 | 3.203125 | 3 | [] | no_license | /*
* File : ConstructTheRectangle
* Author : KsGin
* Date : 03/11/2017
*/
#ifndef LEETCODE_CONSTRUCTTHERECTANGLE_H
#define LEETCODE_CONSTRUCTTHERECTANGLE_H
#include <vector>
class Solution {
public:
std::vector<int> constructRectangle(int area) {
int length = area , width = 1;
for (int i... | true |
85c28d591b29e072ec4a2bc3d2c4e78f90700c54 | C++ | Makocb/Commivoyajer-problem-v2 | /Matrix.cpp | UTF-8 | 2,784 | 3.15625 | 3 | [] | no_license | #include "Matrix.h"
#include <ctime>
#include <iostream>
#include "Globals.h"
Matrix::Matrix():Matrix(Globals::defaultGenerationMin, Globals::defaultGenerationMax, Globals::defaultSize)
{
}
Matrix::Matrix(int min, int max, int dim)
{
std::srand(time(NULL));
std::vector<int> matrixRow;
for (int i = 0; i < dim; i... | true |
2ac7f2736acaeca787fccdc208f0bcb56ebea05c | C++ | dandycheung/dandy-twl | /TWL/include/util/pathutil.cpp | UTF-8 | 5,019 | 2.65625 | 3 | [] | no_license | #include <windows.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
#include "numutil.h"
#define IsDigit(c) ((c) >= TEXT('0') && c <= TEXT('9'))
//
// Takes a location string ("shell32.dll,3") and parses
// it into a file-component and an icon index.
// Returns the icon index
//
int WINAPI P... | true |
4d5427dba2c32e107ac097e225ec9cc8df23ce45 | C++ | melodeeli98/codeblox-capstone | /master-firmware/codeblox_driver.ino | UTF-8 | 4,647 | 2.640625 | 3 | [] | no_license | #include "LowPower.h"
#include "codeblox_driver.h"
#include "side.h"
#include <avr/io.h>
void resetClock();
void initDriver(void (*newMessageCallback)(const Message&, enum Side_Name)){
// turn off reflective sensors asap
DDRB |= 1 << PINB7;
PORTB |= 1 << PINB7;
resetClock();
//select external reference
... | true |
53dc95f64f4467aa2e912bfcc5834372845a2d88 | C++ | chen415296831/usejenkins | /main.cpp | UTF-8 | 372 | 2.546875 | 3 | [] | no_license | /***********************************************
Filename: main.cpp
Author:
Description:
Create Data: 2019-05-16 19:03:50
Modfiy History: 2019-05-16 19:03:50
***********************************************/
#include <iostream>
#include <string>
using namespace std;
int main()
{
string h... | true |
6ce82576b726c11fa7f33f35a33e715e6b77b7fb | C++ | PeteyPii/Euler | /src/problems/Problem020.cpp | UTF-8 | 354 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "SourcePrefix.h"
#include "BigInteger.h"
#include "Common.h"
int32 problem20(int32 n) {
if (n == 0) {
return 1;
}
if (n < 0) {
throw string("We shouldn't take the factorial of a negative number");
}
BigInteger x(1);
for (int32 i = 1; i <= n; i++) {
x *= i;
}
return x.sumOfDigit... | true |
ff57609878d698d0909d353692f8796fc7a40634 | C++ | NAThompson/paraview_mwes | /src/EulerSpiral.cxx | UTF-8 | 1,608 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
#include <vtkm/cont/DataSet.h>
#include <vtkm/cont/DataSetFieldAdd.h>
#include <vtkm/cont/DataSetBuilderExplicit.h>
#include <vtkm/io/writer/VTKDataSetWriter.h>
#include <boost/math/quadrature/tanh_sinh.hpp>
#include <boost/math/constants/constants.hpp>
void wri... | true |
0b5bb4db01b0e00bcb85f84dc959ecf5f8471c1b | C++ | JustEndRay/Lab3.3E-OOP- | /Bus.h | UTF-8 | 611 | 2.953125 | 3 | [] | no_license | #pragma once
#include "Car.h"
#include <string>
#include <iostream>
#include <sstream>
class Bus :public Car
{
private:
int Number_of_passenger_seats;
public:
Bus();
Bus(int);
Bus(Bus&);
void SetNumber_of_passenger_seats(int Power);
int GetNumber_of_passenger_seats() const;
void Re_assignment_Number_of_passen... | true |
a403e6f2bbe89c8b970d647033709ede28bf592f | C++ | LeulShiferaw/resume | /IA/SA-odd/main.cpp | UTF-8 | 4,887 | 3.0625 | 3 | [] | no_license | /*
* =====================================================================================
*
* Filename: main.cpp
*
* Description: Odd version of SA
*
* Version: 1.0
* Created: 26.12.2016 05:36:08
* Revision: none
* Compiler: gcc
*
* Author: Leul Shiferaw (l... | true |
806d8ad9ac1cba1658020dcd12d31f67c948b310 | C++ | tjlaboss/OpenMOC | /src/Timer.h | UTF-8 | 2,210 | 2.703125 | 3 | [
"MIT"
] | permissive | /**
* @file Timer.h
* @brief The Timer class.
* @date January 2, 2012
* @author William Boyd, MIT, Course 22 (wboyd@mit.edu)
*/
#ifndef TIMER_H_
#define TIMER_H_
#ifdef __cplusplus
#ifdef SWIG
#include "Python.h"
#endif
#include "log.h"
#include "constants.h"
#include <time.h>
#include <omp.h>
#include <iostrea... | true |
8eb8ad0d62ef6d26c1aa22f879ac2a2c72bee600 | C++ | Igronemyk/OI | /LuoGu/p3379-2.cpp | UTF-8 | 3,416 | 2.921875 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
template<typename T>
T read() {
T result = 0;int f = 1;char c = getchar();
while(c > '9' || c < '0') {if(c == '-') f *= -1;c = getchar();}
while(c <='9' && c >= '0') {result = result * 10 + c - '0';c... | true |
695bf334b2666e772e69f7fcf78158c2865d0ce5 | C++ | AkiKuraTomoKu/SRC16_Real-Rover | /programms/check/NMEA/NMEA.ino | UTF-8 | 162 | 2.640625 | 3 | [] | no_license | void setup(void){
Serial.begin(115200);
Serial2.begin(9600);
}
void loop(void){
if(Serial2.available()){
Serial.print((char)Serial2.read());
}
}
| true |
9887e7bb3bcdaf04e663ce0e464a9164d082b8f3 | C++ | abasak24/SAGA-Bench | /src/dynamic/types.h | UTF-8 | 3,060 | 2.96875 | 3 | [
"BSD-2-Clause"
] | permissive | #ifndef TYPES_H_
#define TYPES_H_
#include <cstdint>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <vector>
/* Basic building blocks for node and its variations, typedefs. */
typedef int64_t NodeID;
typedef int64_t Weight;
typedef int PID;
typedef std::map<NodeID, NodeID> MapTable;
s... | true |
8096218637f32f35e9d723d8766176b9bcc74e39 | C++ | KeyKy/issue | /caffe_thread_learn.hpp | UTF-8 | 1,092 | 2.8125 | 3 | [] | no_license |
#ifndef caffe_thread_learn_hpp
#define caffe_thread_learn_hpp
#include <stdio.h>
#include <boost/thread.hpp>
#include <boost/shared_ptr.hpp>
namespace boost { class thread; }
class InternalThread {
public:
InternalThread() : thread_() {}
virtual ~InternalThread();
/**
* Caffe's thread local s... | true |
c0b32d40141176476800cad5588f6347dfef3be4 | C++ | chromium/chromium | /base/containers/intrusive_heap.h | UTF-8 | 42,335 | 3.21875 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef BASE_CONTAINERS_INTRUSIVE_HEAP_H_
#define BASE_CONTAINERS_INTRUSIVE_HEAP_H_
// Implements a standard max-heap, but with arbitrary element removal. To
// facilitate thi... | true |
2f991e63de038b95e0f2c0d669d618ea337a068a | C++ | sureshyhap/Schaums-Outlines-Programming-with-C-plus-plus | /Chapter 6/Problems/19/19.cpp | UTF-8 | 537 | 3.515625 | 4 | [] | no_license | #include <iostream>
void selection_sort(int a[], int size);
int main(int argc, char* argv[]) {
int a[] = {83, 823, 365, 8274, 05, 4, 84074, 679};
selection_sort(a, 8);
for (int i = 0; i < 8; ++i) {
std::cout << a[i] << " ";
}
return 0;
}
void selection_sort(int a[], int size) {
for (int j = 0; j < s... | true |
46aef8eb43234b072fe99e931bda36274b8c99e0 | C++ | DrNefarious/kryptos | /dictionary_builder.cpp | UTF-8 | 325 | 2.875 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
using namespace std;
int main(){
ifstream dictionary("words.txt");
ofstream output("words_4.txt");
string line;
while(getline(dictionary,line)){
if(line.length() == 4){
output << line << endl;
}
}
dictionary.close();
output.close();
return ... | true |
bfd1a355bb4d8e847636f0b2d19e506f510f1193 | C++ | DGolgovsky/Courses | /CPP.OTUS/Design_Patterns/1.Creational_patterns/08.object_pool.cpp | UTF-8 | 1,375 | 3.5 | 4 | [
"Unlicense"
] | permissive | // Объектный пул (Object pool)
#include <exception>
#include <iostream>
#include <string>
#include <vector>
#include <array>
class PgConnection
{};
class PgConnectionPool
{
private:
struct PgConnectionBlock
{
PgConnection* connection;
bool busy;
};
std::vector<PgConnectionBlock> m_p... | true |
9b5dc4b97d72847c49db0e77812e1f97c13a05f5 | C++ | AppliedAlpha/BOJ | /Submitted/2xxx/2745.cpp | UTF-8 | 406 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int b, tmp, d = 1, sum = 0;
string str;
cin >> str >> b;
for (int i=str.length()-1; i>=0; i--) {
if (str[i] >= '0' && str[i] <= '9') tmp = str[i]-'0';
else... | true |
67f4fe2d052f8ebced4288f4f635dae898fd90d1 | C++ | diegotf30/CS-Homeworks | /OOP/Robot/include/Camara.h | UTF-8 | 691 | 3.28125 | 3 | [] | no_license | #ifndef CAMARA_H
#define CAMARA_H
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
class Camara
{
public:
///Constructor
Camara(string sQuality, string sType)
{
this->sQuality = sQuality;
this->sType = sType;
}
///Destructor
virtual ~Camara() { }
/... | true |
279df165e6b9d263210b42af81b39b570eac3585 | C++ | benitoab/2PA_TA_benitoab | /Antekeland/include/board.h | UTF-8 | 1,424 | 2.765625 | 3 | [] | no_license | /**
* @file main.cc
* @brief Main file of the game.
* @details This is the core file. It gathers all classes of the game to make it possible.
* @author Javier Benito Abolafio <benitoab@esat-alumni.com>
* @version alfa 1.0
* @date Ded-2020
* @copyright ESAT
*/
#ifndef __BOARD_H__
#define __BOARD_H__... | true |
f50076dca3d41d6f6b5d89d8132824641602a35b | C++ | juliosueiras/Winter2015Class | /PROG20799/c_program/cint/cint-5.16.19-source/cint-5.16.19/reflex/inc/Reflex/Builder/DictSelection.h | UTF-8 | 9,793 | 2.796875 | 3 | [
"MIT"
] | permissive | // @(#)root/reflex:$Name: $:$Id: DictSelection.h,v 1.6 2006/07/05 07:09:08 roiser Exp $
// Author: Stefan Roiser 2004
#ifndef ROOT_Reflex_DictSelection
#define ROOT_Reflex_DictSelection
#include "Reflex/Kernel.h"
/**
* @file DictSelection.h
* @author scott snyder
* @author Stefan Roiser (minor changes, mainly d... | true |
813c97dca1ba03c9fcc404c3451c8c4893e0da8e | C++ | LuisAlbertoVasquezVargas/CP | /otherRepos/luis/HackerRank/ProjectEuler/euler065.cpp | UTF-8 | 1,085 | 2.703125 | 3 | [] | no_license |
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
public static BigInteger ONE = BigInteger.ONE;
public static BigInteger ZERO = BigInteger.ZERO;
public static BigInteger TWO = BigInteger.valueOf(2);
public static int N = 30000;
public static void main(String[... | true |
5897c074631fff4bd558b921709970f1ba56cd4e | C++ | meatrick/cosc326 | /etude03/etude03.cpp | UTF-8 | 6,048 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <string>
#include <istream>
#include <sstream>
#include <cstring>
#include <vector>
#include <algorithm> // for reversing vectors
#include <cmath>
using namespace std;
string increment_bitsting(string bitstring);
struct Scenario {
vector<int> numbers;
int target_valu... | true |
5272629dfb035d03209afacd79ac786c79b8ba33 | C++ | AbdullahJasim/SimpleGames | /GenericPlayer.h | UTF-8 | 391 | 2.765625 | 3 | [] | no_license | #pragma once
#ifndef GENERIC_PLAYER
#define GENERIC_PLAYER
#include "Hand.h"
class GenericPlayer : public Hand {
friend ostream& operator<<(ostream& os, const GenericPlayer& aGenericPlayer);
public:
GenericPlayer(const string& name = "");
virtual ~GenericPlayer();
virtual bool IsHitting() const = 0;
bool IsBus... | true |
a16e1cd78fc2a2b235def23143c6dcf6f8d8e02a | C++ | kstenerud/patch-a-bobble | /src/Bitbuff.cpp | UTF-8 | 3,725 | 2.59375 | 3 | [] | no_license | #include <windows.h>
#include "bitbuff.h"
int get_bit(char* data, long bit_offset)
{
return ((data[(int)(bit_offset - (bit_offset%8)) / 8]
& (1 << (int)(7-(bit_offset%8)))) != 0);
}
void set_bit(char* data, long bit_offset, int value)
{
if(value)
data[(int)(bit_offset - (bit_offset... | true |
d74e3dc037f3a4bdf1c3927d6c4b608b80c108b2 | C++ | EBailey67/DiceParser | /src/diceparser.h | UTF-8 | 3,350 | 3.1875 | 3 | [] | no_license | #pragma once
#include <map>
#include <regex>
#include <string>
#include <sstream>
#include "conditional.h"
#include "error.h"
#include "expression.h"
#include "operand.h"
#include "token.h"
#include "value.h"
namespace DungeonZ
{
class DiceParser
{
public:
/// Error code results and strings
Error ErrorCode;
... | true |
ca67b88fa09378e3a1f11f4c4581f58a88d7d3be | C++ | sek3951/10-team | /common.h | UTF-8 | 1,601 | 2.65625 | 3 | [] | no_license | #pragma once
#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;
//constant
#define DINO_BOTTOM_Y 12
#define TREE_BOTTOM_Y 20
#define TREE_BOTTOM_X 45
#define Bird_BOTTOM_Y 10
#define BIRD_BOTTOM_X 45
#define GRAVITY 3
#define CROWD_TIME 10
#define LEADER_BOARD_MAX 5
//function
void SetCons... | true |
a02380304404dfc5ba56370e0d0a89624db4e7be | C++ | Hank-learner/Data-Structures-with-Algorithms | /samples/forestBT.cpp | UTF-8 | 2,187 | 3.71875 | 4 | [] | no_license | #include <iostream>
#include <sstream>
using namespace std;
#define basespace 10
struct Node {
char key;
int is_rchild;
struct Node *left, *right;
};
struct Node* newnode(char key) {
struct Node* temp = new Node;
temp->key = key;
temp->left = NULL;
temp->right = NULL;
return temp;
}
... | true |
0a26636fa1cb433a52263b399a0823f374406a83 | C++ | donovan680/Paint-for-kids | /Actions/AddTriAction.cpp | UTF-8 | 2,492 | 2.625 | 3 | [] | no_license | #include "AddTriAction.h"
#include "..\Figures\CTriangle.h"
#include "..\ApplicationManager.h"
#include "..\GUI\input.h"
#include "..\GUI\Output.h"
AddTriAction::AddTriAction(ApplicationManager * pApp):Action(pApp)
{}
void AddTriAction::ReadActionParameters()
{
//Get a Pointer to the Input / Output ... | true |
6db5837fdb74231d68b72a9344ac8dfa8559d06e | C++ | kyshel/lab | /cpp/sword_03.cpp | UTF-8 | 587 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace std;
bool Find(int* matrix, int rows, int cols, int number){
bool found = false;
if (matrix != NULL && rows > 0 && cols > 0){
int row = 0;
int col = cols - 1;
while(row < rows && col >= 0){
if(matrix[row * cols + col] == number){
found = true;
break;
... | true |
e84b74ada555ddeebc8d06bf24f8f79974b9b92e | C++ | masoudjalalir/Snake_Game | /SNAKE.cpp | UTF-8 | 9,557 | 2.734375 | 3 | [] | no_license | using namespace std;
#include <conio.h>
#include <stdio.h>
#include <time.h>
#include <iostream>
#include <windows.h>
//#define MAX 50
int InitialLength =15,q,e;
char Screen[25][80]; // What to show on the screen
char bait;
bool akbar=true;
bool masoudd=false;
int Direction[25][80]; // Movement direction of each part ... | true |
25dc6b40e10aa2791e0ab3351182f6e55a4c9618 | C++ | orcchg/StudyProjects | /ORDINARY_PROGS/PEREBOR/number_of_splitts/main.cpp | UTF-8 | 630 | 3.078125 | 3 | [] | no_license | #include <conio.h>
#include <stdio.h>
typedef long ULONG;
ULONG Pk_split(ULONG,ULONG);
int main()
{
int N;
ULONG P;
printf("Number of splitts; Enter N: ");
scanf("%d",&N);
printf("\n");
ULONG* ArrP = new ULONG[N];
P = Pk_split(N,N);
printf("P = %ld\n\n",P);
for(int y = 0; y < N;... | true |
beb36fd68b8eefccf5374c0ef8d0df3c9b0a4dbb | C++ | hvanhorik-GDP/Master | /Projects/GDP2019_Test/GLFW_Callbacks.cpp | UTF-8 | 5,668 | 2.5625 | 3 | [] | no_license |
#include "GLFW_Callbacks.h"
#include "gl/GLCommon.h"
#include <glm/glm.hpp>
#include <glm/vec3.hpp>
#include <glm/vec4.hpp>
#include "../Common/globalStuff.h" // for find object
#include "../Common/pFindObjectByFriendlyName.h"
#include <stdio.h> // for fprintf()
static bool isShiftKeyDownByAlone(int mods);
stat... | true |
8c15ebb41c1dd0a7753bedadbb88d4c86b305520 | C++ | ailuoxz/BadPrincess-Game | /Src/BaseSubsystems/Math.h | ISO-8859-1 | 5,688 | 3.0625 | 3 | [] | no_license | /**
@file Math.h
Este fichero contiene la definicin de ciertos tipos de datos
utilizados por la aplicacin y relacionados con la base
matemtica; en particular, define distintos tipos de matriz,
vector, etc.
<p>
En la prctica, los tipos son simplemente tipos sinnimos
a los de Ogre, para evitar prdidas de tiempo en conve... | true |
ca60fb7ae22ebd9922948e3e776b097748b9e776 | C++ | dabare/arduino | /robotSensor/robotSensor.ino | UTF-8 | 2,069 | 2.65625 | 3 | [] | no_license | //----------------------Motors-----------------
#define MLF 9
#define MLB 10
#define MRF 5
#define MRB 6
//----------------------Sensors-----------------
#define SJL 11
#define SJR 2
#define SPR 3
#define SPL 4
#define SJF 12
#define SJY 13
#define maxMotor 255
#define blackPath 1
void setup() {
pinMode(8, INPUT);... | true |
c859641293deefddfabf6b80d545eff516df0314 | C++ | ArpitSingla/Competitve-Programming-CP | /Codeforces Contest/Round #644 (Div. 3)/Similar Pairs.cpp | UTF-8 | 1,084 | 2.578125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define int long long int
int32_t main() {
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin) ;
freopen("output.txt", "w", stdout) ;
#endif
ios_base::sync_with_stdio(false);
cin.tie(NULL) ; cout.tie(NULL) ;
int t ;
cin >> t ;
whil... | true |
9b5c0b6e5f3bcef1274de396654f4e638c1d861e | C++ | aliasvishnu/leetcode | /Solutions/621*-TaskScheduler.cpp | UTF-8 | 1,557 | 3.40625 | 3 | [] | no_license | // Time - O(n)
// Space - O(k)
/*
First we store all the counts in a heap (name of the process doesn't matter). For n+1 steps, we pick the most occuring process and subtact 1
from it and put it in an array. Then we add the new values to the heap. We do this until there are more than or equal to n processes in teh
heap... | true |
5d8602a63f7cf0a8c983b6b6432e55cde150fb15 | C++ | Christopher-Yan/Luogu | /lg 2663.cpp | UTF-8 | 432 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
using namespace std;
int n, m, sum;
int c[30];
int dp[10010];
int main()
{
cin >> n;
m = n / 2;
for (int i = 1; i <= n; ++i)
{
cin >> c[i];
sum += c[i];
}
sum /= 2;
for (int i = 1; i <= n; ++i)
{
for (int j = m; j >= c[i]; --j)
{
cout << c[i] <<endl;
... | true |
79344e8a459ab21de9b410a5a31308ebd22160ed | C++ | OrangeBaoWang/AutoTuneTMP | /paper/fmm_m2m_interactions/kernels/struct_of_array_data.hpp | UTF-8 | 6,941 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | #pragma once
// #include "interaction_constants.hpp"
namespace octotiger {
namespace fmm {
// component type has to be indexable, and has to have a size() operator
template <typename AoS_type, typename component_type, size_t num_components,
size_t entries, size_t padding>
class struct_of_array_data {
priva... | true |
b4470c5ec51efe5550cde7ff6e91541b2db773ea | C++ | Nonaminggumerah/MAGANG_IRIS-repo | /Penugasan_3.cpp | UTF-8 | 790 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
class Animal
{
protected:
int umur;char nama[10];
public:
void set_data (int a, char b[10])
{
umur = a;
strcpy(b,nama);
}
};
class Zebra:public Animal
{public:
void message_zebra()
{cout<< "Zebra namanya "<<nama<<" berumu... | true |
b309bedb3bc251c52dd1154c2e5a725a8a33a7af | C++ | makese/PAT-Basic | /1012.cpp | UTF-8 | 1,017 | 2.78125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int in[1000];
int n = 0;
int a[5] = {0};
bool has[5] = {false};
bool a2 = false;
int a4 = 0;
cin >> n;
for(int i = 0; i < n; i ++) {
cin >> in[i];
}
for(int i = 0; i < n; i ++){
switch(in[i] % 5){
case 0:
if(in[i] % 2 == 0) {
a[0] += in[i];
... | true |
45b75eb23427c76e7d273c9dc9c3827c5cb1f521 | C++ | yuta6686/DX_016 | /DX21_Sample16/score.cpp | SHIFT_JIS | 3,687 | 3.015625 | 3 | [] | no_license | //=============================================================================
//
// XRA [score.cpp]
// Author :
//
//=============================================================================
#include "score.h"
#include "texture.h"
#include "sprite.h"
//**********************************************************... | true |
2b2a24944177a2b76b5bf46eff421d1d25cc5490 | C++ | planaria/kumori | /include/kumori/socket_streambuf.hpp | UTF-8 | 2,113 | 2.828125 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | #pragma once
#include "socket.hpp"
namespace kumori
{
class socket_streambuf
: public std::streambuf
, boost::noncopyable
{
public:
socket_streambuf(
socket& socket,
const boost::posix_time::time_duration& timeout,
char* input_buffer,
std::size_t input_buffer_size,
char* output_buffer,
std... | true |
42d1b26d30f03ec492d0719a8c5539672c157d70 | C++ | Stephanomejia17/CCOMP-2-2 | /13_Punteros/ejemplo3.cpp | UTF-8 | 273 | 3.125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
int arr[] = {10,2,4,6,7,9,7};
int tam = sizeof(arr) / sizeof(arr[0]);
int *ptr = arr; //es quievalente a poner => int *ptr = &arr[0]
while(tam--){
cout << *ptr++ << " ";
}
cout << endl;
} | true |
160595ad325379d48058a8365b1b8ced764b810d | C++ | sharvi1203/DSA | /Graph/Detect cycle in an undirected graph.cpp | UTF-8 | 611 | 3.109375 | 3 | [] | no_license | bool isCyclicUtil(vector<int> g[], int V,int sv,int parent,vector<bool>& visited){
visited[sv]=true;
for(auto i=g[sv].begin();i<g[sv].end();i++){
if(!visited[*i]){
if(isCyclicUtil(g,V,*i,sv,visited)){
return true;
}
}else if(*i!=parent){
return... | true |
b4d80f814cfdc7957f2314fbaea9973028149a0d | C++ | wilfried-oss/graph | /graph/Graph.cpp | UTF-8 | 11,837 | 3.3125 | 3 | [] | no_license | #include "Graph.h"
using namespace std;
Graph::Graph(bool type):nodes(),edges(),oriented(type){}
void Graph::addNode(string node)
{
if(nodes.find(node)==nodes.end())
nodes.insert(node);
}
void Graph::removeNode(string node)
{
for(const auto &n:nodes)
removeEdge(n,node);
e... | true |
03ab6f35b8cf499a685a479d52cba01e46124f4f | C++ | Divyalok123/LeetCode_Practice | /Practice/PartitionArrayintoDisjointIntervals.cpp | UTF-8 | 830 | 3.328125 | 3 | [] | no_license | /* https://leetcode.com/problems/partition-array-into-disjoint-intervals/ */
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
class Solution {
public:
int partitionDisjoint(vector<int>& A) {
if(A.size() == 2) return 1;
int n = A.size();
vector<int> on... | true |
90b4b519177f5e6ceb809205bfba5e23964afc57 | C++ | benitoab/2PA_TA_benitoab | /Antekeland/src/main.cc | UTF-8 | 371 | 2.5625 | 3 | [] | no_license | /**
* @file main.cc
* @brief Main file of the game.
* @details This is the core file. It gathers all classes of the game to make it possible.
* @author Ricardo Beltrán Muriel <beltranmu@esat-alumni.com>
* @version alfa 1.0
* @date Ded-2020
* @copyright ESAT
*/
#include"game.h"
int main(int argc, cha... | true |
4b32ec2952e5d73e02af404a1906e7c1fcf0ded2 | C++ | angello10/TIL | /BAEKJOON/1920.cpp | UTF-8 | 398 | 2.71875 | 3 | [] | no_license | #include <cstdio>
#include <algorithm>
using namespace std;
int main() {
int N;
scanf("%d", &N);
int arr[N];
for (int i = 0;i < N;i++) {
scanf("%d", &arr[i]);
}
sort(arr, arr + N);
int M;
scanf("%d", &M);
for (int i = 0;i < M;i++) {
int x;
scanf("%d", &x);... | true |
77693a392a7627c25401b6dc08d93537486ca072 | C++ | nvurdien/Game-Master | /121-p6-Vurdien-Navie/Nim.h | UTF-8 | 1,089 | 2.984375 | 3 | [] | no_license | //Nim Game header: contains all the methods used in the Nim Class.
//Navie Vurdien
//email: nvurdien@hotmail.com
#include <vector>
#ifndef NIM_H //if not defined in cpp, else ignore till matching #endif
#define NIM_H //define it for cpp
class Nim
{
//globals used in Nim game
int g_arraysize;//the array siz... | true |
97dc4d7acda830b3be17004217514f74a0e31d1b | C++ | HeiwaRyuu/Calculadoras | /Multiplicador de Matrizes/Multiplicador de Matrizesz.cpp | UTF-8 | 2,155 | 2.734375 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <conio.h>
double a11,a12,a13,a21,a22,a23,a31,a32,a33,b11,b12,b13,b21,b22,b23,b31,b32,b33,c11,c12,c13,c21,c22,c23,c31,c32,c33,cont;
int main(){
do{
system("cls");
printf("\nEntre os valores dos coeficientes da matriz A na ordem a11,a12,a13...:\n");
printf("\nEntre com ... | true |
10d6bf5e7a2f08eafc1d793b722322754b7333a3 | C++ | Sunghwan-Cho-Digipen/cs280_COB_LAB | /Lab6/Game/ClashOfBlocks.cpp | UTF-8 | 2,638 | 2.921875 | 3 | [] | no_license | /*--------------------------------------------------------------
Copyright (C) 2020 DigiPen Institute of Technology.
Reproduction or disclosure of this file or its contents without the prior
written consent of DigiPen Institute of Technology is prohibited.
File Name: ClashOfBlocks.cpp
Purpose: Source file for ClashOfBl... | true |
6335e213b63d7dbb7cf895ac4d28ddfbb72225d1 | C++ | nabil-k/Mondlitch | /Enemy.h | UTF-8 | 5,931 | 3.078125 | 3 | [] | no_license | #pragma once
#include <math.h>
#include <vector>
#include <SFML/Graphics.hpp>
#include "TextureManager.h"
#include "Platform.h"
class Enemy {
int width, height;
float pos_x, pos_y;
float vel_x, vel_y;
bool top_collision, bottom_collision, left_collision, right_collision;
float gravity = 32;
bool fall = true;
Te... | true |
b9d2327c03c128b20fb4871d2752c7d29c5da471 | C++ | dangerous66/C- | /fraction/fraction.h | UTF-8 | 905 | 3.296875 | 3 | [] | no_license | #pragma once
int min(int a,int b)
{
if (a < b)
{
return a;
}
else
{
return b;
}
}
int max(int a, int b)
{
if (a > b)
{
return a;
}
else
{
return b;
}
}
class Fraction
{
private:
int m_numerator;
int m_denominator;
int common_denomintor(Fraction b)
{
for (int... | true |
df15c7bbf3b1936715d79f897484167610295934 | C++ | lava/lexy | /include/lexy/dsl/recover.hpp | UTF-8 | 6,064 | 2.5625 | 3 | [
"BSL-1.0"
] | permissive | // Copyright (C) 2020-2021 Jonathan Müller <jonathanmueller.dev@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
#ifndef LEXY_DSL_RECOVER_HPP_INCLUDED
#define LEXY_DSL_RECOVER_HPP_INCLUDED
#include <lexy/dsl/alternative.hpp>
#include... | true |
6aa5bb33aeb6d15dc451f43de3ca6342eea990a4 | C++ | TommyPlayer-c/Cplusplus_SimpleSTL | /test_vector.cpp | UTF-8 | 418 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include "./list.h"
#include "./vector.h"
#include "./memory.h"
using namespace std;
using namespace SimpleSTL;
int main()
{
vector<int> v(2, 9);
cout << v[0] << " " << v[1] << " " << v[2] << endl;
cout << v.size() << endl;
cout << v.capacity() << endl;
v.push_back(1034);... | true |
fa4387095e6c8890a111bd0f0c5613e11183da13 | C++ | sophiepeneva/Expressions | /Sum.cpp | UTF-8 | 595 | 3.515625 | 4 | [] | no_license | # Expressions
#include "Sum.h"
Sum::Sum(Expression* firstExp, Expression* secondExp)
{
firstExpression = firstExp;
secondExpression = secondExp;
}
Sum& Sum::operator=(const Sum& s)
{
if(this!=&s)
{
Destroy();
CopyFrom(s);
}
return *this;
}
void Sum::CopyFrom(const Sum& s)
{
firstExpression = s.firstExp... | true |
43fde34c70cda85cb03c447c70bc3cc693f7f538 | C++ | godilopa/AI | /Project1/practicas steering/src/Path.cpp | ISO-8859-10 | 2,618 | 3.03125 | 3 | [] | no_license | #include <stdafx.h>
#include "../include/Path.h"
#include <moaicore/MOAIEntity2D.h>
Path::Path(){
}
Path::~Path(){
}
void Path::DrawPath() {
USVec2D pointA = mPoints[0];
for (int i = 1; i < mPoints.size(); i++) {
USVec2D pointB = mPoints[i];
MOAIGfxDevice& gfxDevice = MOAIGfxDevice::Get();
gfxDevice.SetPenC... | true |
16efaaf0ef8a3878c63500d77906961a00f2ff74 | C++ | KernelPanic-OpenSource/Win2K3_NT_drivers | /wdm/audio/filters/kmixer/rfcvec.inl | UTF-8 | 4,104 | 2.625 | 3 | [] | no_license | /*++
Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved.
Module Name:
rfcrcvec.inl
Abstract:
This includes the inline functions
for the real float circular vector
Author:
Jay Stokes (jstokes) 22-Apr-1998
--*/
#if !defined(RFCVEC_INLINE)
#define RFCVEC_INLINE
#pragma once
... | true |
97941297647742243ee422777ce18ad4635c4474 | C++ | yue-w/HelloWorld | /UnitTest/TestDataParse.cpp | UTF-8 | 3,362 | 2.796875 | 3 | [] | no_license | #include <gtest\gtest.h>
#include "../Core/DataParser.h"
#include "../Core/DataWrapper.h"
#include "../Core/OptimizationData.h"
#include "../Core/CommonFunc.h"
namespace Core
{
TEST(Test_DataParser, TestGrad)
{
//Prepare data wrapper.
DataWrapper data;
data.Add("varName1", "x1");
data.Add("lowBnd1", "0");
... | true |
cc52b6b2f2084186126619f6eb5dc002a625efd9 | C++ | ChiaYi-LIN/Computer-Programming | /PSA13/PSA13_b04704016/b04704016_p1.cpp | UTF-8 | 1,827 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class Point{
public:
Point(int a=0, int b=0){x=a; y=b;}
int x, y;
};
class Figure{
public:
Figure(){ next = 0; }
virtual float area(){ return 0; }
void link(Figure *pFigure){ next = pFigure; }
Figure *getLink(){ return next; }
protected:
Figure... | true |
060a643d3f5bdc2cf4b72282b04c152dc571d4b5 | C++ | Masahiro-Obuchi/Atcoder | /ABC/ABC149/ABC149C.cpp | UTF-8 | 1,055 | 3.296875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool is_prime(const unsigned n)
{
switch (n)
{
case 0: // fall-through
case 1:
return false;
case 2: // fall-through
case 3:
return true;
} // n > 3 が保証された
if (n % 2 == 0)
return false;
if (n % 3 == 0)
return false;
/... | true |
5e8ecbe1181a0b83488a72d516971878d438f316 | C++ | astateful/dyplat | /lib/bson/src/JSON.cpp | UTF-8 | 10,405 | 2.84375 | 3 | [
"BSD-3-Clause"
] | permissive | #include "astateful/bson/JSON.hpp"
#include "astateful/bson/Element/String.hpp"
#include "astateful/bson/Element/Int.hpp"
#include "astateful/bson/Element/Null.hpp"
#include "astateful/bson/Element/Bool.hpp"
#include "astateful/bson/Element/Double.hpp"
#include "astateful/bson/Serialize.hpp"
#include <locale>
#include... | true |
f06645f5e0b4e23d666f45c05b89071b769889d0 | C++ | mariokonrad/marnav | /test/marnav/ais/Test_ais_message_20.cpp | UTF-8 | 2,011 | 2.609375 | 3 | [
"BSD-3-Clause",
"BSD-4-Clause"
] | permissive | #include <marnav/ais/message_20.hpp>
#include <marnav/ais/ais.hpp>
#include <gtest/gtest.h>
namespace
{
using namespace marnav;
class test_ais_message_20 : public ::testing::Test
{
};
TEST_F(test_ais_message_20, parse)
{
std::vector<std::pair<std::string, uint32_t>> v;
v.emplace_back("D030p8@2tN?b<`O6DmQO6D0", 2);... | true |
bad90dba3252033b0ecbaff48b328bcea8dcf0f6 | C++ | roy4801/solved_problems | /uva/686.cpp | UTF-8 | 772 | 3.09375 | 3 | [] | no_license | /*
* Uva 686 - Goldbach's Conjecture (II)
* author: roy4801
* AC(c++) 0.000
*/
#include <iostream>
using namespace std;
#define TABLE_SIZE 33000
bool prime[TABLE_SIZE];
void buildPrimeTable()
{
prime[0] = prime[1] = false;
for(int i = 2; i < TABLE_SIZE; i++)
prime[i] = true;
for(int i = 2; i < TABLE_SIZE;... | true |
a57e4c64b4301f679647a63aee2c8ce1d3132935 | C++ | emojicode/emojicode | /Compiler/Parsing/AbstractParser.hpp | UTF-8 | 3,818 | 2.546875 | 3 | [
"Artistic-2.0",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | //
// AbstractParser.hpp
// Emojicode
//
// Created by Theo Weidmann on 27/04/16.
// Copyright © 2016 Theo Weidmann. All rights reserved.
//
#ifndef AbstractParser_hpp
#define AbstractParser_hpp
#include "Emojis.h"
#include "Lex/TokenStream.hpp"
#include "Types/Generic.hpp"
#include "Types/TypeContext.hpp"
#inclu... | true |
8f5b8b7f03d84aa3d9769e48c6187a307fe6a9b0 | C++ | Manjunath-Jakaraddi/Competitive-Coding | /codeforces/Good Bye 2017 Solutions/eleven2.cpp | UTF-8 | 604 | 2.609375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
bool f[5005][5005];
bool g[5005][5005];
int main()
{
string s;
cin>>s;
int ans=0;
for(int i=0;i<s.length();i++)
{
int cur=0;
for(int j=i;j<s.length();j++)
{
if(s[j]==')') cur--;
else cur++;
if(cur>=0) f[i][j]=true;
else break;
}
}
for(int i=0;i<s... | true |
6937a0c2b855b8b5c7a0d9fd2b558b3eec87c8b4 | C++ | BartheG/SqlBasicCpp | /Users/UsersInfos.hpp | UTF-8 | 764 | 2.96875 | 3 | [] | no_license | #ifndef USERSINFOS_HPP_
#define USERSINFOS_HPP_
#include <string>
class UsersInfos {
public:
UsersInfos(
const std::string &username,
const std::string &passwordOne,
const std::string &passwordTwo = "",
const std::string &mail = ""
);
~UsersInfos();
std::string getUsername() const ... | true |
789a4820d93a96e34ea6ac92b21b47159f9ce1c7 | C++ | Zhangzhiyi/CPlusPlus | /HelloWorld/TestCopyAssign/Classes/TestCopyAssign.cpp | GB18030 | 3,194 | 3.265625 | 3 | [] | no_license | // TestCopyAssign.cpp : ̨Ӧóڵ㡣
//
#include "stdafx.h"
#include <iostream>
#include "StringBad.h"
#include "StringGood.h"
#include "DerivedStringGood.h"
using namespace std;
void callme1(StringBad & rsb);
void callme2(StringBad sb);
void callme1(StringGood & rsb);
void callme2(StringGood sb);
StringGood getStringGood(... | true |
a17fc5b234b9bc58978b6872b6159b3a75121a16 | C++ | abdulsalamY/hw5 | /handler.cpp | UTF-8 | 4,172 | 2.765625 | 3 | [] | no_license | //
// Created by abdul on 1/15/2020.
//
#include "handler.hpp"
#include "RegisterManager.hpp"
#include "bp.hpp"
#include <iostream>
#include <assert.h>
string handle_operation(string r1, string r2, string op_char, TypeID reg1_type, TypeID reg2_type){
string type = "i32";
if(reg1_type == BYTETYPE && reg2_type ... | true |
74831fe3ab758dbb8f341bad92497a804f0ceeb2 | C++ | sabassamadashvilli423/51 | /lector/lector/lector.cpp | UTF-8 | 518 | 3 | 3 | [] | no_license | #include <iostream>
#include"Lectori.h"
#include<vector>
using namespace std;
void mySort(vector < Lectori> a) {
for (int j = 0; j < a.size(); j++) {
for (int i = 0; i < a.size() - 1; i++) {
if (a[i].count > a[i + 1].count)
swap(a[i] , a[i + 1]);
}
}
}
int... | true |
d15967136231c2b3283002e7af24e659aa40bf8d | C++ | aayushjn2/LeetCode | /Consecutive Numbers Sum.cpp | UTF-8 | 291 | 2.734375 | 3 | [] | no_license | class Solution {
public:
int consecutiveNumbersSum(int N) {
int res = 0;
int k = 1;
while(k<(ceil(sqrt(2*N)))){
int t = k*(k-1)/2;
if((N-t)%k==0){
res++;
}
k++;
}
return res;
}
}; | true |
a0824b2a193f7e6b04d982376a12b3d72191ccfe | C++ | A-TNguyen/Text_RPG_Game | /Main/Cave.h | UTF-8 | 5,393 | 3.09375 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Cave
{
public:
void Cave_Story();
private:
int x = 0; // Switch counter
int choice; // Choosing an answer from the switch case
bool alive = true; //Statment to keep true to be alive
};
//Scope resolution for the class ... | true |
5a30c50c6b36a9d1881a068364a80e88a98cbf23 | C++ | Kaustav97/CPP_Reference | /CC-JuneLong/PlusEqn.cpp | UTF-8 | 1,471 | 3.09375 | 3 | [] | no_license | #include <vector>
#include <set>
#include <unordered_map>
#include <algorithm>
#include <iostream>
using namespace std;
#define tr1(cont) for(auto it=cont.begin();it!=cont.end();it++)
#define tr2(cont,it) for(;it!=cont.end();it++)
#define rep(n) for(int i=0;i<n;i++)
// std::unordered_map<string,int> hist;
string ans;... | true |
2cb623cab727a05a25b87bd3d0eea93b87195a43 | C++ | marchenko2k16/GameOfLife | /GameOfLife/World.cpp | UTF-8 | 1,969 | 2.953125 | 3 | [] | no_license | #include "World.h"
unsigned int World::height;
unsigned int World::width;
extern int windowHeight;
extern int windowWidth;
void World::checkForChanges(unsigned int row, unsigned int col)
{
bool flag = false;
int count = 0;
int i;
if (row == 0)
{
i = 0;
}
else
{
i = row - 1;
}
int _j;
if (col == 0)
... | true |
409c86288a24d938018764f3cd5b02a8b0b15108 | C++ | Refeel/WordsCollocations | /methods.cpp | UTF-8 | 3,343 | 2.71875 | 3 | [] | no_license | #include "methods.h"
#include "QStringList"
Methods::Methods(WordsStatisticNGrams *wordsStats)
{
ranking(wordsStats);
}
Methods::~Methods()
{
}
void Methods::ranking(WordsStatisticNGrams *ws)
{
QString collocation = "";
int biGram = 2;
QHash<QString, int>::const_iterator iter = ws->wordsStatistic[b... | true |
b608872313dde81ee2217c8cf779bf8762603331 | C++ | Banghyungjin/DataStructure | /Balanced_String/balanced_string.cpp | UTF-8 | 816 | 3.03125 | 3 | [] | no_license | //made by HyungJin
//10-10-2019
//----------------------------------------------------------------------------------------------------------------------
#include <iostream>
using namespace std;
int main() {
int inputNum;
cout << "Please input a number that is bigger than 0 you want or type -1 to quit" << endl... | true |
04752df637e80e226b1ea943ee9dea85ab1c6eb3 | C++ | LonglongSang/Life_of_XDU | /OiWiki_Learning/线段树/1235规划兼职工作动态规划.cpp | UTF-8 | 1,176 | 2.703125 | 3 | [] | no_license | //https://leetcode-cn.com/problems/maximum-profit-in-job-scheduling/
#include <stdio.h>
#include <string>
#include <iostream>
#include <stdlib.h>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <vector>
#include <string.h>
#include <algorithm>
using namespace std;
#define N 10... | true |
5de053f07ac335fda420f8b17dd3e290502760b7 | C++ | SS2015TUMGED/GED | /projects/Game/src/T3d.cpp | UTF-8 | 4,408 | 2.828125 | 3 | [] | no_license | #include "T3d.h"
#include <sstream>
#include "DirectXTex.h"
using namespace std;
struct T3dHeader {
int16_t magicNumber; // Must be 0x003D
int16_t version; // Must be 1
int32_t verticesSize; // vertex buffer data size
int32_t indicesSize; // index buffer data size
}; // Sizes are always in... | true |
418232e917fd9aade8bcafe07f9d7cec90a0a110 | C++ | risooonho/GameBase | /Source/GameBase/Private/Extensions/PlayerControllerExtensions.cpp | UTF-8 | 3,420 | 2.53125 | 3 | [] | no_license | #include "PlayerControllerExtensions.h"
#include "Kismet/GameplayStatics.h"
#include "GameFramework/PlayerController.h"
#include "GameFrameworkExtensions.h"
#include "ActorExtensions.h"
FVector2D FPlayerControllerExtensions::GetMousePosition(UObject* WorldContextObject)
{
check(WorldContextObject);
check(WorldConte... | true |
16f81ed611c0a89f0435e4cd5ccf4205be9ccfeb | C++ | MarkOates/LabyrinthOfLore | /include/LabyrinthOfLore/Hud/TitleText.hpp | UTF-8 | 564 | 2.53125 | 3 | [] | no_license | #pragma once
#include <string>
namespace LabyrinthOfLore
{
namespace Hud
{
class TitleText
{
private:
std::string above_text;
std::string headline_text;
float time_changed_at;
protected:
public:
TitleText();
~TitleText();
... | true |
b18fc22c82a2dd7dacb5a7d99e4fed35fa0e871c | C++ | hikaen2/tenuki | /position.cpp | UTF-8 | 8,225 | 3.015625 | 3 | [
"MIT"
] | permissive | #include "tenuki.h"
using std::map;
using std::string;
using std::vector;
namespace tenuki {
/**
* SFENを局面にする
*/
const position parse_position(const string& sfen) {
const map<string, square_t> TO_SQUARE {
{"1", square::EMPTY },
{"P", square::B_PAWN ... | true |
d25534857fa602b7c99e123342e65c943715d32b | C++ | Rainboylvx/pcs | /loj/132/1.cpp | UTF-8 | 3,264 | 2.84375 | 3 | [] | no_license | /*-----------------
* author: Rainboy
* email: rainboylvx@qq.com
* time: 2020年 05月 20日 星期三 08:37:52 CST
* problem: loj-132
*----------------*/
#include <bits/stdc++.h>
#define For(i,start,end) for(i = start ;i <= end; ++i)
#define Rof(i,start,end) for(i = start ;i >= end; --i)
typedef long long ll;
using namespace std;... | true |
d195c2679394bff6924f31bc29af7d1dadbdb3df | C++ | Anubhav12345678/competitive-programming | /RemoveDuplicatesInASINGLYLINKEDLIST.cpp | UTF-8 | 1,337 | 3.40625 | 3 | [] | no_license | {
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *next;
Node(int x) {
data = x;
next = NULL;
}
};
void print(Node *root)
{
Node *temp = root;
while(temp!=NULL)
{
cout<<temp->data<<" ";
temp=temp->next;
}
}
Node* removeDuplicates(Node *root);
int main() {
// your code ... | true |
34f30f13f603c6f6ef047aca9410bc41e2464f84 | C++ | P1nk1e/zadacha2 | /anti-aliasing/anti-aliasing/main.cpp | UTF-8 | 1,519 | 2.859375 | 3 | [] | no_license | //
// main.cpp
// anti-aliasing
//
// Created by Владимир Киселев on 21.12.2020.
// Copyright © 2020 Владимир Киселев. All rights reserved.
//
#include <iostream>
#include "tgaimage.h"
#include "linesMod.hpp"
#include "linesMod.hpp"
const TGAColor white = TGAColor(255, 255, 255, 255);
const TGAColor red = TGA... | true |
2cac34582238ecdf49886a295952ff0166271b16 | C++ | mkoldaev/bible50cpp | /lang/fa/gen/Bible22.h | UTF-8 | 27,678 | 2.8125 | 3 | [] | no_license | #include <map>
#include <string>
class Bible22
{
struct fa1 { int val; const char *msg; };
struct fa2 { int val; const char *msg; };
struct fa3 { int val; const char *msg; };
struct fa4 { int val; const char *msg; };
struct fa5 { int val; const char *msg; };
struct fa6 { int val; const char *msg; };
struct fa7 {... | true |