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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
73f991969f73d6903431660e95ee351d1f51e8bc | C++ | nafejul75/URI_SOLUTIONS | /uri1096.cpp | UTF-8 | 313 | 2.875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
/**
* Escreva a sua solução aqui
* Code your solution here
* Escriba su solución aquí
*/
for(int i=1; i<=9; i+=2) {
for(int j=7; j>=5; j--) {
printf("I=%d J=%d\n",i,j);
}
}
return 0;
}
| true |
908a2790c4777a73e7a85367d21268c6d44fbd7e | C++ | Chriskkirilov/Diploma | /AutomatedGarden.ino | UTF-8 | 1,507 | 2.640625 | 3 | [] | no_license | #include <FastLED.h>
#include "garden_config.h"
const int LED_PIN = 7;
const int NUM_LEDS = 10;
CRGB leds[NUM_LEDS];
const int tempPin = A0;
int tempInput;
double temp;
const int lightPin = A1;
int lightInput;
const int humidityPin = A2;
int humidityValue;
const int motorPin = 9;
void setup() {... | true |
75817b8d349cd55c0ad24f60dfba23c604e6b783 | C++ | AnkitMohapatra/Tree | /Binary Search Tree Implementation.cpp | UTF-8 | 2,359 | 3.9375 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct node
{
int data;
node *left;
node *right;
};
node *NewNode(int data)
{
node *temp = new node();
temp->data = data;
temp->left = temp->right = NULL;
return temp;
}
node* insert(node *root, int data)
{
if (root == NULL)
{
return NewNode(data);
}
else
if ... | true |
a0029aa0f8f8ecf32d1e426f01b30fe7330c2ece | C++ | kpu/moses-emnlp | /moses/src/PCNTools.cpp | UTF-8 | 3,652 | 2.921875 | 3 | [] | no_license | #include "PCNTools.h"
#include <iostream>
#include <cstdlib>
namespace PCN
{
const std::string chars = "'\\";
const char& quote = chars[0];
const char& slash = chars[1];
// safe get
inline char get(const std::string& in, int c)
{
if (c < 0 || c >= (int)in.size()) return 0;
else return in[(size_t)c];
}
// consu... | true |
aeada348dce502d0a5d42fb1b03fb5b20095dace | C++ | viennamath/viennamath-dev | /viennamath/runtime/constant.hpp | UTF-8 | 5,692 | 2.890625 | 3 | [
"MIT"
] | permissive | #ifndef VIENNAMATH_RUNTIME_CONSTANT_HPP
#define VIENNAMATH_RUNTIME_CONSTANT_HPP
/* =======================================================================
Copyright (c) 2012, Institute for Microelectronics,
Institute for Analysis and Scientific Computing,
TU Wien.
... | true |
c6c1910d5c0ec8c6150386e999f8b3d4f415f3c0 | C++ | amd/libflame | /test/lapacke/EIG/ORTHO/lapacke_gtest_geqrt.cc | UTF-8 | 18,538 | 2.546875 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-other-permissive"
] | permissive | #include "gtest/gtest.h"
#include "../../lapacke_gtest_main.h"
#include "../../lapacke_gtest_helper.h"
#define geqrt_free() \
if (A!=NULL) free(A); \
if (Aref!=NULL) free(Aref);\
if (tau!=NULL) free(tau);\
if (tauref!=NULL) free(tauref); \
if( hModule != NULL) dlclose(hModule); \
if(dModule != NULL) dlclose(dModu... | true |
115be3afb61c1d4c24558d08c5c856bfa8bc46e7 | C++ | AKGP/InterviewBit | /IB/dp/maxProduct.cpp | UTF-8 | 841 | 2.75 | 3 | [] | no_license | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
using namespace std;
int maxProduct(vector<int> &A){
int dp[A.size()];
int m = A[0];
int curr_max = A[0];
int curr_min = A[0];
int prev_max = A[0];
int prev_... | true |
4cf9d7c257787ad6e2b8fc6421e4a389bc5dd590 | C++ | gauravghati/Advance-Datastructure | /implement_of_stack/Stack.h | UTF-8 | 335 | 2.703125 | 3 | [] | no_license | /*
* Stack.h
*
* Created on: Dec 16, 2019
* Author: f10
*/
#ifndef STACK_H_
#define STACK_H_
template <class T>
class Node{
public:
T data;
Node * next;
};
template <class T>
class Stack{
Node<T> *top;
public:
Stack();
void push(T);
T pop();
T Top();
bool empty();
virtual ~Stack();
};
#endif ... | true |
88d753f6fe23250573e8dc4a3de50d7dfad08c9d | C++ | tokbaev-a/auca-ds-2020 | /project-01/uva-10295/main.cpp | UTF-8 | 963 | 3.0625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
struct Skill
{
string mName;
int mMoney;
Skill(string name, int money) : mName(name), mMoney(money)
{
}
};
int main()
{
int m, n;
cin >> m >> n;
vector<Skill> skills;
for (int i = 0; i < m; i++)
{
string s;
int n... | true |
e53b0c79879a40c7a05682eccada14e63f59c1f2 | C++ | OsmanPL/EDD_1S2020_P1_201801229 | /[EDD]Practica1_201801229/[EDD]Practica1_201801229/ListaCiruclar.h | UTF-8 | 897 | 3.1875 | 3 | [] | no_license | #ifndef LISTACIRCULAR
#define LISTACIRCULAR
#include "Ruta.h"
#include <string.h>
#include <curses.h>
class ListaCircular {
private:
public:
Ruta* inicioLista;
Ruta* finalLista;
bool listaVacia() {
if (inicioLista == NULL || finalLista == NULL) {
return true;
}
else {
return false;
}
}
Ruta* retorn... | true |
fb4f747eab17e94d8c635526a820b634bf86b860 | C++ | dhruvpatel348/C-Programming | /file-7.cpp | UTF-8 | 399 | 2.609375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
FILE *f1,*f2,*f3;
f1=fopen("D:\\1.txt","r");
f2=fopen("D:\\2.txt","r");
f3=fopen("D:\\3.txt","w");
char ch,ch1;
while(ch!=EOF)
{
ch = getc(f1);
putc(ch,f3);
}
while(ch1!=EOF)
{
ch1 = getc(f2);
... | true |
bb79540180df3e38a4fb2e33a76a639ec7b484a3 | C++ | ozcoco/AppFramework | /main.cpp | UTF-8 | 868 | 3.28125 | 3 | [] | no_license | #include <iostream>
#include <map>
#include <queue>
#include <algorithm>
#include <thread>
#include <chrono>
int main()
{
std::map<char, int> first;
first['a'] = 10;
first['b'] = 30;
first['c'] = 50;
first['d'] = 70;
for (auto &e: first)
{
std::cout << e.first << "=" << e.second <... | true |
b7e4ac423d116bd40ac086cdafc7fa498141e110 | C++ | DionysiosB/CodeAbbey | /GreatestCommonDivisor.cpp | UTF-8 | 346 | 3.359375 | 3 | [] | no_license | #include <iostream>
long gcd (long a, long b){return (b == 0) ? a : gcd (b, a%b);}
int main(){
long t; std::cin >> t;
while(t--){
long x, y; std::cin >> x >> y;
long a = gcd(x, y);
long b = x * y / gcd(x, y);
std::cout << "(" << a << " " << b << ") ";
}
std::cout << st... | true |
5bab699f940f7eb4fcc333a60da89bbf5e0b9758 | C++ | GermanAizek/felf | /app/ELF.h | UTF-8 | 2,503 | 2.546875 | 3 | [] | no_license | #pragma once
#include <elf.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <iostream>
#include <fstream>
#include <unordered_map>
#include <vector>
#include <utility>
#include <string>
#include <cstdio>
#include <errno.h>
#include <string.h>
#d... | true |
b73a7af9f4fee00573bd4282a1b0671ae47348d8 | C++ | Hou-vst/read-data | /test/源.cpp | GB18030 | 2,686 | 2.875 | 3 | [] | no_license | #include<string>
#include<iostream>
#include<fstream>
#include<vector>
#include<map>
#include<set>
#include"usercf.h"
using namespace std;
void dealStrTemp(const string& temp,int& result1,int& result2)
{
int i_start = 0;
int size = static_cast<int>(temp.size());
int find_num = 0;
for (int i = 0; i < size && find_... | true |
4355441f64e7b6d56a932f741fb77cc7252db44b | C++ | SebastianJM/Competitive-Programming | /UVa Online Judge/UVA 1174 - IP-TV.cc | UTF-8 | 1,526 | 2.796875 | 3 | [] | no_license |
#include <iostream>
#include <math.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <string>
#include <map>
using namespace std;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef vector<int> vi;
vi pset;
int numSets;
int n;
void init(int n)
{
pset = vi(n); for (int i = 0; i... | true |
5337e2778600918a275799711577d19d5f6a42fc | C++ | TheCharmingSociopath/JetpackJoyride | /src/fireline.cpp | UTF-8 | 2,099 | 3.21875 | 3 | [
"MIT"
] | permissive | #include "fireline.h"
#include "main.h"
#define GLM_ENABLE_EXPERIMENTAL
Fireline::Fireline(float x, float y, color_t color, float rot) {
this->position = glm::vec3(x, y, 0);
this->rotation = rot;
this->direction = true;
// Our vertices. Three consecutive floats give a 3D vertex; Three consecutive vert... | true |
d9b84ab7cd6b8a50e65fa21912f6196232f9c8c8 | C++ | mcgoughc/220Project | /Person.cpp | UTF-8 | 1,499 | 3.328125 | 3 | [] | no_license | /*
* Person.cpp
* Comp 220 Bookstore Project
* Written by Joe Cleveland, Chase McGough, and Anthony Pizzo
* This file is the method definitions of the Person class
*/
#include "Person.h"
Person::Person(std::string first, std::string last, std::string phoneNumberIn, std::string emailIn, int commMethodIN) {
na... | true |
2693cd76b9b49ee711d2268eca4509a52862a6d6 | C++ | Live4dreamCH/AI_Searchs | /BFsearch.h | GB18030 | 2,509 | 2.765625 | 3 | [] | no_license | #pragma once
#include "GeneralSearch.h"
#include <list>
#include <iostream>
//#include "NineState_new.h"
//
template<class S, class Code>
class BFsearch : public GeneralSearch<S, std::list<S*>, Code>
{
public:
BFsearch(S start, S target) :GeneralSearch<S, std::list<S*>, Code>(start, target) {}
//openеĵһڵopenתƵclo... | true |
99415566cc02153800a1146dec7a42fe95a8da0c | C++ | evancheng1006/dsa2016_038 | /hw5/queryProcess.cpp | UTF-8 | 3,485 | 3.078125 | 3 | [] | no_license | #include <iostream>
#include <cctype>
#include <algorithm>
#include <string>
#include <vector>
#include "database.h"
void generateConfusionSetSingleWord(const std::string & str, std::vector<std::string> & result) {
result.clear();
result.push_back(str);
unsigned int len = str.length();
std::string tmp;
// Insert
... | true |
9757fbdc3e9bc4af57af3a57342c4be8dad1f922 | C++ | akashrautela/p3 | /Class Work (13-6-19)/loop_in_a-LL.cpp | UTF-8 | 763 | 3.609375 | 4 | [] | no_license | #include<iostream>
using namespace std;
class node
{
public:
int data;
node *next;
};
string isloop(node *h)
{
node *p1=h,*p2=h;
if(h == NULL) return "empty list";
while(p2!=NULL && p2->next!=NULL)
{
if(p1 == p2) return "LOOP EXITS";
p1 = p1->next;
p2 = p2->next->next;
... | true |
9a2230edd4c1df1cddcc17ad125606c4c0ac002a | C++ | MatanelAbayof/Robbery-in-the-Depths | /oop2_project/LifeView.cpp | UTF-8 | 1,764 | 3.015625 | 3 | [
"Apache-2.0"
] | permissive | #include "LifeView.h"
LifeView::LifeView(sf::RenderWindow& window, int numOfLife)
: HorizontalLayout(window)
{
init();
if (numOfLife > Character::getMaxLife()) {
throw(std::out_of_range("Cant have more life then " + Character::getMaxLife()));
}
setNumOfLife(numOfLife);
}
void LifeView::updateLifeParts(int numO... | true |
af874ef6bdfde901c08dc7842df998d49b313542 | C++ | luoshaochuan/hihocoder | /solutions/1041.cpp | UTF-8 | 1,902 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
using namespace std;
map<int,set<int>> dict;
map<int,pair<int,int>> fdict;
vector<int> visit;
void dict2tree(int currnode,int fathernode = 0,int height = 1){
if(fathernode != 0) fdict[currnode] = make_pair(fathernode,height);
... | true |
4aec46330b71ed74df6e469277ae0071fe3df6bd | C++ | wolf-git-creator/cpp | /visitor/visitor-test.cc | UTF-8 | 843 | 2.953125 | 3 | [] | no_license | #include <cassert>
#include <iostream>
#include "builder.hh"
#include "compute-visitor.hh"
void test(const std::string& input, int expected, bool div_zero = false)
{
auto builder = Builder(input);
auto t = builder.build();
auto e = visitor::ComputeVisitor();
try
{
t->accept(e);
}
... | true |
ee3d558a6749ca4de37f45950107216c8ab65ce4 | C++ | Connor-A/Chess_WIP | /piece.h | UTF-8 | 1,203 | 3.421875 | 3 | [] | no_license | /****************************************************************************************************************
This is the parent class for all the pieces of the chess board. It will be usre in a two
dimensional array to simulate the board, and the pieces will be saved by passing them into the board array
via po... | true |
189f9fe0797819f3b74f835ebae7add9be5e77b2 | C++ | ashayaan/codeforces | /countereg.cpp | UTF-8 | 756 | 2.578125 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
long long int gcd(long long int a,long long int b){
if(b){
return gcd(b,a%b);
}
else
return a;
}
int main(){
long long int l,r;
cin>>l>>r;
if(abs(l-r) < 2){
cout<<"-1"<<endl;
return 0;
}
long long int i=0... | true |
2ff053645e9c08405522b1b1f6cd58052df44f03 | C++ | searleser97/DistribuitedSystems | /ConstructoresYParametros/Ej1.cpp | UTF-8 | 1,189 | 3.421875 | 3 | [] | no_license | #include "Fecha.h"
#include <ctime>
#include <iostream>
using namespace std;
int random(int min, int max) { return min + rand() % (max - min + 1); }
int masVieja(Fecha &fecha1, Fecha &fecha2) {
if (fecha1.convierte() > fecha2.convierte()) return 1;
if (fecha1.convierte() < fecha2.convierte()) return -1;
return... | true |
4b650200a88118d4523bf0701e86cee6af2cd12b | C++ | njshah301/it-lab | /nj.cpp | UTF-8 | 223 | 3.046875 | 3 | [] | no_license | #include<iostream>
using namespace std;
class complex{
public:
int x,y;
complex(int x1,int y1){
x=x1;
y=y1;
}
int getX(){
return x;}
int gety(){
return y;}
};
int main(){
complex p(10,20);
cout<<p.x<<p.y;
return 0;
}
| true |
e680232d5cacc6a614643685b519a17e70592877 | C++ | ramonjunquera/GlobalEnvironment | /RPi/Geany/02 cpp/09 FilesIO/03 Array/Array.cpp | UTF-8 | 2,544 | 3.90625 | 4 | [] | no_license | /*
* Autor: Ramón Junquera
* Tema: Programación en C++
* Objetivo: Archivos binarios
* Material: Raspberry Pi
* Descripción:
* Para gestionar archivos binarios tenemos suficiente con las funciones
* proporcionadas por la librería iostream.
*
* En este ejercicio crearemos un array dinámico de números enteros c... | true |
54228361e79af96649d183fbcfb737de90e29408 | C++ | PauloFAragao/Jogo-de-Luta | /algoritimo para ataques de comando/Personagem.cpp | UTF-8 | 9,036 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "Personagem.h"
Personagem::Personagem(){}
Personagem::Personagem(int *ponteiro)
{
bts = ponteiro;
}
bool Personagem::controleGopes(int bt)
{
if(sequencia13()) return true;
else if(sequencia05()) return true;
else if(sequencia09()) return true;
else if(sequencia02()) return true;
else if(sequencia06()... | true |
0742583833c54b13e602b73aada2e77231f15f22 | C++ | totally-A/studentshelper | /IfElse.cpp | UTF-8 | 638 | 3.015625 | 3 | [] | no_license | //defines the entry point for the console application
#include<stdio.h>
#include<iostream>
using namespace std;
int main()
{
system("color F0");
int input;
printf("1. Play a game\n");
printf("2. Load a game\n");
printf("3. Go to a multiplayer\n");
printf("4. Exit\n");
printf("Choice:\n");
... | true |
5a6bd8ffd9f222645ddece9c69c01f57a783234d | C++ | sushil-lakra/learning_in_depth | /rod_cutting.h | UTF-8 | 1,760 | 3 | 3 | [] | no_license | #pragma once
/*
60 100 120 200
1 2 3 4
len = 5
5 41 32 311 221 2111 11111
*/
int rcp(int p[], int l[], int n, int rl)
{
if (n <= 0 || rl == 0) return 0;
if (l[n - 1] > rl)
return rcp(p, l, n - 1, rl);
return std::max(
p[n - 1] + rcp(p, l, n, rl - l[n - 1]),
rcp(p,... | true |
099b55b1b69e653b926e24986dd737caa4f43bf6 | C++ | dmikushin/Graduation-Work | /MPS_VOXAR/include/vnl/tests/test_na.cxx | UTF-8 | 4,545 | 2.78125 | 3 | [] | no_license | #include <vcl_iostream.h>
#include <vcl_iomanip.h>
#include <vcl_sstream.h>
#include <vcl_limits.h> // for infinity()
#include <vnl/vnl_math.h>
#include <vnl/vnl_na.h>
#include <testlib/testlib_test.h>
void test_na()
{
// Create NaN, NA
double qnan_d = vcl_numeric_limits<double>::quiet_NaN();
double na_d = vnl_n... | true |
3182fe73eb0075a7af783cd2b6499cd21a0c9250 | C++ | checkoutb/LeetCodeCCpp | /daily_challenge/2022/LT_2022-07-07_97._Interleaving_String.cpp | UTF-8 | 2,346 | 2.953125 | 3 | [] | no_license |
#include "../../header/myheader.h"
class LT
{
public:
// D D
//if (i == 0 && j == 0) dp[i][j] = 1;
//else if (i == 0) dp[i][j] = dp[i][j - 1] && s2[j - 1] == s3[i + j - 1];
//else if (j == 0) dp[i][j] = dp[i - 1][j] && s1[i - 1] == s3[i + j - 1];
//else dp[i][j] = ((dp[i][j - 1] && s2[j - 1] =... | true |
5523222f2eb865d8e45ed8a6f2b058cf2623f1d2 | C++ | hakerg/Useful-Code | /Useful Code/State.h | UTF-8 | 479 | 3.25 | 3 | [] | no_license | #pragma once
namespace uc
{
// class used by AI
// contains information about some situation
// _Turn - turn; can be applied to the State
template <class _Turn>
class State
{
public:
State() {}
virtual ~State() {}
// set new state based on player's turn
virtual void apply_turn(const _Turn& turn) = 0;
... | true |
3c7a02a376c3ce4ee37318514f382a812dab6a71 | C++ | linghuiliu/CosmiTestLCIO | /calice_userlib/include/SimpleValueVector.hh | UTF-8 | 2,366 | 2.8125 | 3 | [] | no_license | #ifndef __SimpleValueVector_hh__
#define __SimpleValueVector_hh__
#include "IMPL/LCGenericObjectImpl.h"
#include "UTIL/LCFixedObject.h"
#include "EVENT/LCObject.h"
#include <vector>
namespace CALICE {
class SimpleValueVector : public IMPL::LCGenericObjectImpl {
public:
/** Empty constructor
*/
Simp... | true |
b5648d3181ca3dd3d543bcdb2c0864989758f4c9 | C++ | ArtemVasilev/P-AA | /Khanova_Yulya/lab1/lr1.cpp | UTF-8 | 4,066 | 3.578125 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct Point{
int x;
int y;
int len; //сторона квадрата
};
class Square{
public:
Square(int k)
{
arr = new int[(k + 1)*(k + 1)]();
this->num = 0;
this->k = k;
}
~Square()
{
delete[] arr;
}
void Insert(int x, int y, int k... | true |
33ead1a4b4ae146d45c6dc7cb074a7d52a84b01a | C++ | zeropoint-t/GCSDD | /Data Structures & Algorithm I/Project7/main.cpp | UTF-8 | 7,674 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <memory>
#include <map>
#include <queue>
#include "BinaryNode.h"
#include "BinaryTree.h"
using namespace std;
template<class K, class V>
void visit(K& key, V& value){
cout << "Key: " << key << endl;
}
int main(){
///////////////////////////////////////
//... | true |
4513239880b2db278bc48577ba2d243f47289de9 | C++ | vincentma0001/vm_tools | /tst/vm_test/tst_cfgs/tst_cfgs.cpp | UTF-8 | 1,474 | 2.796875 | 3 | [] | no_license | //*
#include <limits.h>
#include <stdio.h>
#include <iostream>
#include <vm_cfgs.h>
//*/
int main(int argc, char *argv[])
{
//*
vTry
throw("throw string!");
vCatch(...)
vCout << "try catched...!"<< vEndl;
vEnd
vCout << "try sucesss!" << vEndl;
printf( "Test %d\n", vMax(1... | true |
96819828eb95bdf7ab5d15fb91b5f860c97b7b32 | C++ | anjanesh/vlbjcas | /PRACT/13.CPP | UTF-8 | 464 | 2.84375 | 3 | [] | no_license | // Command Line Arguments
#include<iostream.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>
void main(int argc,char *argv[])
{
float result;
if (strcmp(argv[1],"add")==0) result=atof(argv[2])+atof(argv[3]);
if (strcmp(argv[1],"sub")==0) result=atof(argv[2])-atof(argv[3]);
if (strcmp(argv[1],"m... | true |
61acac4d0ef7bbaf34a179b8d33b0ec11f185256 | C++ | xingfeT/c-practice | /day-001-100/day-071/problem-3/main.cpp | UTF-8 | 901 | 3.90625 | 4 | [] | no_license | /*
* NOTE(nick): problem not well defined in book ...
* should have input / output - this is problem wrong ...
*
* Write a function that recursively determines the value
* of the nth term of an arithmetic sequence defined by the
* terms
*
* a, a + d, a + 2d, a + 3d, ..... a + (n - 1)d
*
* a = 3
* n = 3
*... | true |
42f7ed37f8dcfb4827cec30bbd91fe8f42341185 | C++ | zahybnaya/mnk | /src/dotexporter.cpp | UTF-8 | 1,009 | 2.796875 | 3 | [] | no_license | #include "dotexporter.h"
#include <string.h>
#include <sstream>
static void print_node(Node* n, std::ostream& out) ;
static void print_path(std::string p, Node* n, std::ostream& out);
void todot(Node* n , std::ostream& out){
out << " digraph g {" <<std::endl;
print_path("", n, out);
print_node(n, out) ;
out << "... | true |
60b1d24943351cabfd2531a9b97272e8850a03f7 | C++ | gm561/algolab | /week4/tournament.cpp | UTF-8 | 3,623 | 2.734375 | 3 | [] | no_license | #include<iostream>
#include <map>
#include <boost/graph/adjacency_list.hpp>
#include<boost/graph/push_relabel_max_flow.hpp>
using namespace std;
using namespace boost;
typedef adjacency_list_traits<vecS, vecS, directedS> Traits;
typedef adjacency_list<vecS, vecS, directedS,
no_property,
property<ed... | true |
56142526bce477c394aa7d493aacbf7cb0618a8d | C++ | zabodan/factory | /logger/inc/LogLevel.h | UTF-8 | 610 | 3.1875 | 3 | [] | no_license | #pragma once
namespace core
{
struct LogLevel
{
enum Type
{
Trace = 0,
Debug,
Info,
Warning,
Error,
Assert
};
LogLevel(Type v) : m_value(v) {}
operator Type() const { return m_value; }
private:... | true |
6f40e27683d4a0d81e9978ad042db0378ce7e853 | C++ | shudal/WhutLab1 | /src/piczip/Huffman.cpp | UTF-8 | 1,916 | 2.9375 | 3 | [] | no_license | //
// Created by perci on 2020/5/12.
//
#include "Huffman.h"
#include <limits>
int Huffman::getMinWeightIndex (int to) {
int min_index = -1;
int min_weight = std::numeric_limits<int>::max();
for (auto i=0; i<=to; ++i) {
if (vs_[i].f == 0) {
if (vs_[i].w <= min_weight) {
... | true |
eb2724821fb8d26463024bcf7ef83b5ce5f2a579 | C++ | siddhshenoy/SAMPGamemodeAPI | /GamemodeApi/Utils/VectorFunctions.h | UTF-8 | 568 | 3.25 | 3 | [] | no_license | #pragma once
#include <vector>
namespace Utils
{
namespace Vector
{
template<class T>
static std::vector<T> CreateVector(std::vector<T> input, size_t start = 0, size_t end = -1);
template<class T>
std::vector<T> CreateVector(std::vector<T> input, size_t start, size_t end)
{
typename std::vector<T>::co... | true |
305c52042ea6f0cf29b62a3985635dbf08796490 | C++ | habib302/leetcode-1 | /987. Vertical Order Traversal of a Binary Tree.cpp | UTF-8 | 1,547 | 3.140625 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode() : val(0), left(nullptr), right(nullptr) {}
* TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
* TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), l... | true |
7921eaa3dfcd6285818742ba66e106801d2e95ff | C++ | hoangtuanhedspi/hermes | /include/hermes/Regex/RegexTraits.h | UTF-8 | 9,950 | 2.796875 | 3 | [
"MIT",
"NCSA"
] | permissive | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*/
//===----------------------------------------------------------------------===//
/// \file
/// Regex traits appropriate for Hermes r... | true |
d5b7fe3be4e0fdd8c04738e1cde6f4999d214155 | C++ | nolandoktor/Vortex_Watch_Code | /LedBuffer.h | UTF-8 | 1,175 | 3.171875 | 3 | [] | no_license | #ifndef LED_BUFFER_LIB
#define LED_BUFFER_LIB
#include <Arduino.h>
#include "GlobalDefines.h"
//#define N_LEDS 12
class LedBuffer
{
private:
int ledBuffer[N_LEDS][3];
public:
enum COLORS{RED, GREEN, BLUE};
LedBuffer();
void setColorVal(int idx, int color_idx, int val);
void setColorVa... | true |
95b0255d3f8af1492ddfca656c0b52f72a9f60e6 | C++ | Ma-qingsheng/summary | /C and C++/练习Dev/ddd1.cpp | GB18030 | 744 | 2.953125 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
#include <stdlib.h>
int main(){
typedef struct student{
char stu_number[20];
char stu_name[20];
float usual_mark;
float exam_mark;
float overall_mark;
}Student;
Student * stus,* p,* next,* head;
int N,i=0;
//ѧ
printf("ѧN=");
scanf("%d",&N);
... | true |
6a66cb72d7b7b3e24d74099dc6db27ad3200adee | C++ | Cimera42/2DGame | /2DGame/keyboardHandler.cpp | UTF-8 | 928 | 3 | 3 | [
"MIT"
] | permissive | #include "keyboardHandler.h"
std::unordered_map<int, int> keyList;
unsigned short modList;
void keyboardInput(GLFWwindow* inWindow, int keyCode, int scanCode, int action, int modifiers)
{
keyList[keyCode] = action;
modList = modifiers;
}
bool checkModifiers(unsigned short inMods, bool strict)
{
... | true |
0dd4f0c4aba0542f01a43976de2754ecde370c80 | C++ | Elisabethp7/Projet | /Case.cpp | UTF-8 | 866 | 3.09375 | 3 | [] | no_license | /*
* File: Case.cpp
* Author: Bienvenue
*
* Created on 30 novembre 2015, 23:19
*/
#include "Case.h"
#include <iostream>
using namespace std;
Case::Case(char c, int pion, int m, int max, int lien): symbole(c), nombrepions(pion), jouer(m), numerocase(nbrecases), nombrepionsmax(max), liencase(lien) {
nbre... | true |
167b967311d9f0505d0b89964ea93794bfda4074 | C++ | mission-interview/interview | /ctci/array/urlify.cpp | UTF-8 | 1,233 | 4.25 | 4 | [
"Apache-2.0"
] | permissive | /*
* Cracking the coding interview Edition 6
* Problem 1.3 URLify --> Replace all the spaces in a string with '%20'.
* Assumption : We have enough space to accomodate addition chars
* Preferebly in place
*/
#include <iostream>
#include <cstring>
/*
* Function : urlify
* Args : string long enough to accomo... | true |
d488b5b24b22c988988d39391d34d230415e14fd | C++ | masterserge/Cpp | /MT_Proxy_Server/libs/Buffer/Buffer.h | UTF-8 | 1,019 | 2.890625 | 3 | [] | no_license | #pragma once
#include <string>
class Buffer {
public:
virtual void append(const Buffer &buffer) = 0;
virtual void append(const Buffer *buffer) = 0;
virtual void append(const char *buf, size_t length) = 0;
virtual void append(const char *buf) = 0;
virtual const char* buf() const = 0;
virtual siz... | true |
6363c9d58b3b06f33453403998ddc611b25cf5f8 | C++ | JoakoI98/QTMathExp | /ModelView/modelviewlinker.cpp | UTF-8 | 1,276 | 2.796875 | 3 | [] | no_license | #include "modelviewlinker.h"
ModelViewLinker::ModelViewLinker(ModelViewPrimitives *primitives) : primitives(primitives)
{
}
bool ModelViewLinker::getReadyToDraw() const
{
return readyToDraw;
}
void ModelViewLinker::setReadyToDraw(bool value)
{
readyToDraw = value;
}
std::tuple<int, int, int, int> ModelView... | true |
cecff981bbafbede8010c7019a976196a6bd13db | C++ | wellisonraul/DesenvolvimentoUniversidade | /Semestre5/IA/BuscaEmLargura.cpp | ISO-8859-1 | 5,085 | 2.8125 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
typedef struct grafo Grafo;
struct grafo{
int eh_ponderado,nro_vertices,grau_max;
int** arestas;
float** pesos;
int* grau;
};
Grafo* cria_Grafo(int nro_vertices, int grau_max, int eh_ponderado){
Grafo *gr;
gr = (Grafo*) malloc(sizeof(struct grafo));
i... | true |
54e4606e8fe8082cbf50f1f312f4808d192b341e | C++ | Spicy-Noodles-Studio/Ultimate-Ghost-Punch | /UltimateGhostPunch/Src/CameraEffects.cpp | UTF-8 | 4,063 | 2.546875 | 3 | [
"CC-BY-4.0"
] | permissive | #include "CameraEffects.h"
#include <ComponentRegister.h>
#include <RenderSystem.h>
#include <WindowManager.h>
#include <GameObject.h>
#include <MathUtils.h>
#include <Camera.h>
#include <sstream>
REGISTER_FACTORY(CameraEffects);
CameraEffects::CameraEffects(GameObject* gameObject) : UserComponent(gameObject), min(... | true |
e8a7eee053e34d7cd6039be2bfddb1c2aab8c953 | C++ | CrazyThink/Arduino | /_2_1/_2_1.ino | UTF-8 | 521 | 2.671875 | 3 | [] | no_license | int t = 0;
int sw1 = 0;
int sw2 = 0;
void setup() {
pinMode(2, OUTPUT);
pinMode(12, INPUT);
pinMode(13, INPUT);
}
void loop() {
if(t != 0){
digitalWrite(2, HIGH);
delay(t);
digitalWrite(2, LOW);
delay(10 - t);
}
if(digitalRead(12) == LOW && sw1 == 0){
t++;
if(t == 11) t = 10;... | true |
c63507269345b3598244cfba4d2aab0d4fa28bc4 | C++ | powerLEO101/Work | /Code/LOJ/LOJ10081/code.cpp | UTF-8 | 1,670 | 2.6875 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<deque>
#define File(s) freopen(#s".in","r",stdin);freopen(#s".out","w",stdout)
#define gi get_int()
#define _ 2000000
#define for_edge(i,x) for(int i = Head[x];i!=-1;i = Edges[i].Next)
#define INF 0x3f3f3f3f
int get_int()
{
int x = 0,y ... | true |
34257d5faea4f66b6af0a82740889b2aba4ca07b | C++ | lasimondep/spbu-practice | /07.09.2017/problem1.cpp | UTF-8 | 783 | 2.609375 | 3 | [] | no_license | #include <cstdio>
#include <cstring>
const int MAXN(10), STEP[4][2] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}};
void f(int n, int a[MAXN][MAXN]) {
int p(3), x(0), y(n - 1), k(1), l(0), nx, ny;
a[x][y] = 2;
bool t;
while (k < n * n) {
nx = x + STEP[l][0], ny = y + STEP[l][1];
if (0 <= nx && nx < n && 0 <=... | true |
fa2b8cb3aecce5b6a6ec0fd45395eb3989547848 | C++ | sunsetwarrior/kakuro-game | /removed from project/puzzle.h | UTF-8 | 581 | 2.78125 | 3 | [] | no_license | #ifndef PUZZLE_H
#define PUZZLE_H
#include <QJsonArray>
#include <QJsonObject>
#include <QVector>
#include "puzzle.h"
class Puzzle
{
public:
Puzzle();
Puzzle(const QVector<double>& row);
void read(const QJsonObject& json);
void write(QJsonObject& json) const;
double getCell();
void setCell(do... | true |
c81736f9130dee8134c2f04c38bc78aea48e0b7c | C++ | PhuongNam-19127480/ktlt-19clc9-group03 | /Student management system/header.h | UTF-8 | 8,897 | 2.890625 | 3 | [] | no_license | #ifndef _SS_
#define _SS_
#include<iostream>
#include<fstream>
#include<string>
#include <stdio.h>
#include <iomanip>
#include <ctime>
#include <sstream>
using namespace std;
struct Semester
{
int n = 0;
char Semesters[11];
char academic[20];
};
struct StudentFromCSV {
string No;
string ID;... | true |
41887573169b62285fcd5a408e3d738ead8713bc | C++ | arthurquinn/solitaire | /solitaire_engine_linux/src/gameplay/foundation_pile.cpp | UTF-8 | 1,573 | 3.328125 | 3 | [] | no_license | #include "stdafx.h"
#include "gameplay/foundation_pile.h"
FoundationPile::FoundationPile() {}
const void FoundationPile::push(Card* card) {
pile.push_back(card);
}
const std::string FoundationPile::push(const pile_t cards) {
const std::string response = is_valid(cards);
if(response.find(ERROR_TAG) == std::s... | true |
150cef8c591735814bac81ba2b8b1f4c02b718e4 | C++ | salileo/RatnaKiran | /RatnaKiran/RatnakiranDatabase/Permissions.cpp | UTF-8 | 16,353 | 2.5625 | 3 | [] | no_license | #include "DatabaseGlobals.h"
#define ADMIN_USERNAME "admin"
#define ADMIN_PASSWORD "jaiganesh"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
#define ADDENTRY(x,y) \
case x:\
retval = y;\
break;
#define CHECKENTRY(x,y) \
{\
CString str = y;\
if(str == action)\
return ... | true |
272ee54be64510c3855838646c408f2d0625218d | C++ | Tasari/University_things | /Bioinformatics-intro/Zestaw 1/C++/Zadanie 5/main.cpp | UTF-8 | 428 | 3.28125 | 3 | [] | no_license | #include <iostream>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
int number, reversed = 0;
printf("Podaj liczbe aby pokazac ja w odwrotnej kolejnosci\n");
scanf("%d", &number);
while(number>0){
reversed = reversed*10 + num... | true |
d020e31bb86f0720c16fa302544b02dddd8ee2c5 | C++ | sramepa1/qtunneler | /Projectile.h | UTF-8 | 1,211 | 2.5625 | 3 | [] | no_license | /*
* -----------------------------------------------
* QTunneler - a classic DOS game remake in QT
* -----------------------------------------------
*
* semestral project for API programming course
* (Y36API) at the FEE CTU Prague
*
* Created by:
* Pavel Sramek (sramepa1... | true |
b4516a20c9babcd0d661048f2108f4b7f2221208 | C++ | YaelHacmon/reversi | /include/ViewGame.h | UTF-8 | 1,778 | 3.390625 | 3 | [] | no_license | /*
*/
#ifndef VIEWGAME_H_
#define VIEWGAME_H_
#include "Board.h"
#include <vector>
using namespace std;
/**
* Represents the view of the game, handles any interaction with the player.
* All functions are pure virtual, seeing as implementation depends on viewing tools (console, GUI, etc.)
*/
class ViewGame {
pub... | true |
b24c774ce67722c5ef02e107b087f97d95a2c77c | C++ | larajanecka/notes | /Old-Notes/2b/CS247/Tutorial/Resources6/examples/04-moving/main.cc | UTF-8 | 562 | 3 | 3 | [] | no_license | /*
* Ch. 3 of "Programming with gtkmm", pp. 11-14
*
* Displays a labelled button in a window. When the button is clicked, the text "Hello World" is printed
* to standard output.
*/
#include <gtkmm/main.h>
#include "hidebuttons.h"
int main( int argc, char * argv[] ) {
Gtk::Main kit( argc, argv ); // Initiali... | true |
0fe956888f6b02282172289e73adfad37b0b092b | C++ | ariesha-1702/DSA-450 | /Matrix/9-Find distinct elements.cpp | UTF-8 | 645 | 2.765625 | 3 | [] | no_license | // https://practice.geeksforgeeks.org/problems/find-distinct-elements2054/1
#include <bits/stdc++.h>
using namespace std;
class Solution{
public:
int distinct(vector<vector<int>> m, int n)
{
unordered_map<int,int> map;
int c=0;
for(int i=0;i<n;i++)
{
map[m[0][i]]=1;... | true |
15bfb2a262870c5d42663c4209ab97cd878afb25 | C++ | VitalSquared/OOP_CPP | /lab1/RNA.h | UTF-8 | 1,843 | 3.28125 | 3 | [] | no_license | #ifndef LAB1_RNA_H
#define LAB1_RNA_H
#include <unordered_map>
#define PAIRS_IN_SIZE_T (sizeof(size_t) * 4)
using namespace std;
enum Nucleotide { A, G, C, T };
class RNA {
private:
Nucleotide _nucl = A;
size_t _size = 0;
size_t _capacity = 0;
size_t *_nucleotides = nullptr;
void update_capacit... | true |
cfc70c3013e46ffda1864019aac89af5cd66d384 | C++ | duanmao/leetcode | /198. House Robber.cpp | UTF-8 | 473 | 2.796875 | 3 | [] | no_license | // Time: O(n), space: O(n)
class Solution {
public:
int rob(vector<int>& nums) {
int n = nums.size();
if (nums.empty()) return 0;
if (n == 1) return nums[0];
if (n == 2) return max(nums[0], nums[1]);
vector<int> f(n, 0);
f[0] = nums[0];
f[1] = max(nums[0], nu... | true |
acff4722199dd4822cd4624ca54e9d4200307ae1 | C++ | tonaaskarwur/YARP-Behavior-Trees | /yarp_modules/include/blackboard.h | UTF-8 | 3,801 | 3.375 | 3 | [
"MIT"
] | permissive | #ifndef BLACK_BOARD_H
#define BLACK_BOARD_H
#include <memory> // for shared_ptr
#include <string>
#include <vector>
#include <yarp/os/Property.h> // the blackboard is a yarp property
#include <cmath> //double_t, int_t etc
#include <iostream>
class BlackBoard
{
public:
BlackBoard();
//template< typename T >
... | true |
fe969e8960bfa5fa298a08224193b897889f8bc0 | C++ | HJPyo/C | /킹실한갓미.cpp | UTF-8 | 477 | 2.59375 | 3 | [] | no_license | #include <stdio.h>
int nx, ny, ar[12][12];
int main()
{
for(int i = 1; i <= 10; i++){
for(int j = 1; j <= 10; j++){
scanf("%d", &ar[i][j]);
}
}
nx = ny = 2;
while(ar[nx][ny] != 2){
ar[nx][ny] = 9;
if(ar[nx][ny+1] != 1 && nx <= 10){
ny++;
}
else if(ar[nx+1][ny] != 1 && ny <= 10){
nx++;
}... | true |
be8c8b72de766cab525da58d041aa546fc8bd92f | C++ | Miliox/gb_emulator | /src/debugger.cpp | UTF-8 | 5,531 | 2.640625 | 3 | [
"MIT",
"Apache-2.0"
] | permissive | /*
* debugger.cpp
* Copyright (C) 2017 Emiliano Firmino <emiliano.firmino@gmail.com>
*
* Distributed under terms of the MIT license.
*/
#include "debugger.hpp"
#include <iostream>
#include <iomanip>
#include <utility>
#include <vector>
Debugger::Debugger(GBCPU& cpu, GBGPU& gpu, GBJoypad& joypad) :
cpu(cpu),... | true |
a9649b329cca0502a486172accdcefe5a080133a | C++ | cyph3rk/Challenges | /1117.cpp | UTF-8 | 429 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
double notas[2] = { 0, 0 };
int contador = 0;
while (contador < 2) {
cin >> notas[contador];
if ( (notas[contador] >= 0) && (notas[contador] <= 10) ) {
contador++;
}
else {
cout << "nota invalida" << endl;
}
}
c... | true |
45a77abaf898f1d7486c173239a9bb1792d96930 | C++ | AC3Productions/Forte | /Forte/Source/SpriteSystem.cpp | UTF-8 | 1,341 | 2.78125 | 3 | [] | no_license | // file: SpriteSystem.cpp
// author: Alfaroh Corney III
// date: 3/23/2021
//
// info:
// Description of the purpose of the file goes here.
#pragma once
#include <SpriteSystem.h>
#include <GameObject.h>
#include <SpriteComponent.h>
SpriteSystem* SpriteSystem::m_instance = nullptr;
SpriteSystem* SpriteSystem::I... | true |
9297a54cb1801afa1903c71737b5e62dfd1e7537 | C++ | acgourley/simple-disk-utils | /Windows/DiskUtilsWinAPI/DiskUtilsWinAPI/HardDiskManager.cpp | UTF-8 | 1,786 | 2.578125 | 3 | [
"MIT"
] | permissive | // HardDiskManager.cpp: implementation of the CHardDiskManager class.
// LICENSE: http://www.codeproject.com/info/cpol10.aspx
//////////////////////////////////////////////////////////////////////
#include "HardDiskManager.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destr... | true |
99f33f364ec7c97b106f68d5b0afeb4d8b0c7043 | C++ | JJJoonngg/Algorithm | /백준/1783_병든나이트.cpp | UHC | 1,457 | 3.328125 | 3 | [] | no_license | /*
https://www.acmicpc.net/problem/1783
Ʈ N * M ũ ü ʾƷ ĭ ġ ִ. Ʈ ǰ ü Ʈ ٸ 4θ ִ.
2ĭ , 1ĭ
1ĭ , 2ĭ
1ĭ Ʒ, 2ĭ
2ĭ Ʒ, 1ĭ
Ʈ , ü Ʈ̱ ĭ 湮ϰ ; Ѵ.
Ʈ ̵ ִ. , ̵ Ƚ 4 ̻ 쿡 ̵ ̻ ̿ؾ Ѵ.
ü ũⰡ ־ , Ʈ 湮 ִ ĭ ִ ϴ α ۼϽÿ. ó ִ ĭ .
Է
ù° ٿ ü N M ־. N M 2,000,000,000 ۰ų ڿ̴.
100 50
1 1
17 5
2 4
20 4
Ʈ 湮 ִ ĭ ִ Ѵ.
48
1
4
... | true |
7112adb37b12139544b820f7f64bdc4d76313353 | C++ | hhhhicode/Algorithm_Study_ver.1 | /057. 재귀함수 이진수 출력/main_057.cpp | UTF-8 | 217 | 3.359375 | 3 | [] | no_license | #include <iostream>
void binaryRecursive(const int& N)
{
if (N == 0) return;
binaryRecursive(N / 2);
std::cout << N % 2;
}
int main()
{
using namespace std;
int N;
cin >> N;
binaryRecursive(N);
return 0;
} | true |
172f6cc739b71f2d98b4c88c6b03f5b26eda5bc6 | C++ | J4ck5ilver/DX12-Portfolio-Scene | /src/Engine/Assetmanager/AssetFile.hpp | UTF-8 | 4,793 | 2.609375 | 3 | [] | no_license | #ifndef ASSETFILE_HPP
#define ASSETFILE_HPP
#include<string>
#define FE_JPG "jpg"
#define FE_DDS "dds"
#define FE_PNG "png"
#define FE_OBJ "obj"
#define FE_MAT "mat"
#define FE_XML "xml"
template<typename T>
class AssetFile
{
public:
enum class FileType
{
EmptyType = 0,
MeshType = 1,
TextureType = 2,
Mate... | true |
99c525c773b9a06e1da5fddccedd929b8d853a79 | C++ | CM4all/beng-proxy | /src/escape/Static.hxx | UTF-8 | 545 | 2.71875 | 3 | [] | permissive | // SPDX-License-Identifier: BSD-2-Clause
// Copyright CM4all GmbH
// author: Max Kellermann <mk@cm4all.com>
/*
* Escaping with a static destination buffer.
*/
#pragma once
#include <string_view>
struct escape_class;
/**
* Unescape the given string into a global static buffer. Returns
* NULL when the string is... | true |
04f831afbcd9aed5336d89129eb72a550a60e0c5 | C++ | MissingJoe/Data-Structure | /Supplemental questions/2-b4.cpp | GB18030 | 2,517 | 3.34375 | 3 | [] | no_license | #include <iostream>
using namespace std;
typedef int Status;
typedef int ElemType;
typedef struct DuLNode {
ElemType data;
DuLNode* prior;
DuLNode* next;
}DulNode, * DuLinkList;
Status InitialDuLinkList(DuLinkList& l) {
//l = (DuLinkList)malloc(sizeof(DuLNode));
l = new DuLNode;
if (!l)
retur... | true |
fbb6d2988dae384c27e1a2f9b74d58c67f2cf4eb | C++ | cairijun/pork | /tests/test_broker_mq.cc | UTF-8 | 7,600 | 2.515625 | 3 | [] | no_license | #include <algorithm>
#include <atomic>
#include <memory>
#include <random>
#include <thread>
#include <vector>
#include <boost/chrono.hpp>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "broker/message_queue.h"
#include "proto_types.h"
using namespace testing;
namespace pork {
class BrokerMqTest: p... | true |
69af9d6d1c9971265de0bf52d37c483b462dd2a3 | C++ | Spectra456/LabsCPP2017 | /B6/main.cpp | UTF-8 | 681 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include "task-headers.hpp"
int main(int argc, char *argv[])
{
if (argc == 1)
{
std::cerr <<"Restart and type the arguments, please" <<std::endl;
return 1;
}
char * error;
int numsize = strtol(argv[1], &error, 10);
if (*error)
{
std::cerr <<"Restart and type correct argu... | true |
f6fd53baaaaef11203321934ccafe6eea954f9fa | C++ | abhishekp314/-PC--Blazing-Racer | /Blazing Racer PC v1/Blazing Racer PC v1/Graphics/Camera.cpp | UTF-8 | 1,026 | 2.71875 | 3 | [] | no_license | #include "stdafx.h"
#include "Camera.h"
namespace Graphics
{
Camera::Camera(void)
{
m_mProjMat = XMMatrixIdentity();
m_mViewMat = XMMatrixIdentity();
m_vLookAt.x = 0.0f;
m_vLookAt.y = 0.0f;
m_vLookAt.z = -1.0f;
m_vLookAt.w = 0.0f;
m_vEye.x = 0.0f;
m_vEye.y = 0.0f;
m_vEye.z = 0.0f;
m_vEye.w = 0.0... | true |
9990b21b02f2883839fb8b1612f59a0fa9ec27a5 | C++ | V-vp/SPOJ | /absp1.cpp | UTF-8 | 358 | 3.078125 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
ll array[n];
for(int i=0;i<n;i++)
cin>>array[i];
ll sum=0;
for(int i=0;i<n;i++)
{
sum+=(array[i]*i);
sum-=array[i]*(n-i-1);
}... | true |
7c88b86c58d83b8d55f6486d587aefd0a64e8eaf | C++ | dotQuestionmark/git-github-fundamentals-mukeshgurpude | /Learn-CPP/Day-05/array_intro.cpp | UTF-8 | 626 | 4.34375 | 4 | [] | no_license | // Arrays are the lists of similar data types
#include<iostream>
using namespace std;
int main(void){
// <datatype> arrayName [arraySize]
int arr[] = {1, 2, 3, 4, 5}; // With size as much as the given initialzers
int arr1[5] = {1, 2, 3}; // Give the values for 3 places, remaining are 0
int arr2[5] = {}... | true |
008b744f73c6922956009585fec9d0f577445b47 | C++ | amironi/Interviews | /Calculator/Utils.h | UTF-8 | 753 | 3.140625 | 3 | [] | no_license |
#pragma once
#include <iostream>
#include <stack>
#include <string>
#include <sstream>
#include <map>
#include <vector>
#include <algorithm> // std::all_of
using namespace std;
inline vector<string> split(const string& str, const string& delim)
{
vector<string> tokens;
size_t prev = 0, pos = 0;
do
... | true |
faf1d274f962893b9f131756523a0c6431ad32c9 | C++ | OneMillionBytes/PWMControl | /Src/PWMTimer.cpp | UTF-8 | 1,147 | 2.640625 | 3 | [] | no_license | #include "PWMTimer.hpp"
#include "stm32f1xx_hal.h"
#include "stdio.h"
const char* timerStatusTemplate =
"Prescaler: %u\n"
"Period: %u\n"
"Compare: %u\n";
PWMTimer::PWMTimer(TIM_HandleTypeDef& a_TimerHandle) :
m_TimerHandle(a_TimerHandle) {}
void PWMTimer::setDutyCycle(uint8_t dutyCycle)... | true |
45431adefe80c56c1171f8a6b44416d0494ce369 | C++ | Zhichiang/Visual_Cpp_Design-Experiment | /Chapter_01/1_3.cpp | GB18030 | 326 | 2.96875 | 3 | [] | no_license | #include "stdafx.h"
#include <iostream> ///ͷļ
using namespace std; //ռ
int main()
{
//ʹcoutendlʾҪз
cout << "Hello C++" << endl;
//mainҪһط0
return 0;
}
| true |
ba3ce18445cd805fa43cb7eab8262724a79f2d82 | C++ | Kazanovitz/compiler | /codegen/codegen.cpp | UTF-8 | 20,054 | 2.890625 | 3 | [] | no_license | #include "ast.hpp"
#include "symtab.hpp"
#include "classhierarchy.hpp"
#include "primitive.hpp"
#include "assert.h"
#include <typeinfo>
#include <stdio.h>
class Codegen : public Visitor
{
private:
FILE * m_outputfile;
SymTab *m_symboltable;
ClassTable *m_classtable;
const char * heapStart="_heap_start"... | true |
2114e28191eb0ff766e479e86f693432c7c8f8c0 | C++ | viktorMirev/Personal-Projects | /CompaniesProjectExamPrep/CompaniesProjectExamPrep/Company.cpp | UTF-8 | 1,006 | 3.359375 | 3 | [] | no_license | #include "Company.h"
#include<cstring>
void Company::setName(const char * name)
{
if (this->name) delete[] this->name;
if (name)
{
int size = strlen(name) + 1;
this->name = new char[size];
memcpy(this->name, name, size);
}
}
void Company::copyFromAnother(const Company & other)
{
this->set... | true |
e1685d7c2b067067ebed0b2fe747f3e9a4a1927e | C++ | ccebinger/SWPSoSe14 | /rail-interpreter/src/Action.h | UTF-8 | 17,090 | 3.09375 | 3 | [] | no_license | // Action.h
#ifndef ACTION_H_RAIL_1
#define ACTION_H_RAIL_1
#include "Binding.h"
#include "Dir.h"
#include "NilVar.h"
#include "StringVar.h"
#include "ListVar.h"
#include "Closure.h"
#include "Board.h"
#include "ActivationRecord.h"
#include "Error.h"
class Action
{
public:
virtual void run(std::list<Binding> & dat... | true |
55b48b6a9ecbab6d11d9491a1c0c268780694f57 | C++ | JJackol/SDL | /src/InitError.cpp | UTF-8 | 307 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "InitError.h"
#include <SDL.h>
InitError::InitError() :
exception(),
msg( SDL_GetError() )
{
}
InitError::InitError( const std::string & m ) :
exception(),
msg( m )
{
}
InitError::~InitError() throw()
{
}
const char * InitError::what() const throw()
{
return msg.c_str();
}
| true |
328521bf34788172d01ca5af8b65116cfbed48b6 | C++ | nerdityourself/AnalogPadMidi | /AnalogMidiController.ino | UTF-8 | 4,065 | 2.84375 | 3 | [] | no_license | /*
@author NerdItYourself
@version 1.0, 05/10/2016
*/
// MIDI channel from 0 to 15
#define midichannel 1
#define nPad 6
// Note: we use the same trasmitter pin for all the sensor in order to use less digital pin.
// Note: change array size according to the number of resistive sensor that you want to manage... | true |
9b09cb0c061c6f30d5e40ffb09faa20f09679700 | C++ | ShresthSagar/CPP-Programs | /DS/directindex.cpp | UTF-8 | 454 | 3.234375 | 3 | [] | no_license | #include<iostream>
using namespace std;
int ar[1000]={0};
void ins(int val)
{
ar[val]=1;
cout<<"inserted "<<val<<endl;
}
void sear(int val)
{
if(ar[val]==1)
cout<<"Found "<<val<<endl;
else
cout<<"Not Found "<<val<<endl;
}
void del(int val)
{
ar[val]=0;
cout<<"Deleted "<<val<... | true |
8dbd6a6dceaca60c3a57d6054011c4934be73e7a | C++ | hqnddw/leetcode | /smart-pointer智能指针/test.cpp | UTF-8 | 608 | 3.28125 | 3 | [] | no_license | //
// Created by lwl on 2020/8/7.
//
#include "smart-pointer.h"
class Point {
public:
Point(int xVal = 0, int yVal = 0) : x(xVal), y(yVal) {}
int getX() const { return x; }
int getY() const { return y; }
void setX(int xVal) { x = xVal; }
void setY(int yVal) { y = yVal; }
private:
int x, y;... | true |
2d54ead0de44d8f6f545fa4f4c758a6ead9bd0d5 | C++ | sahn93/problem-solving | /leetcode/hard/Array_and_Strings/5_Game_of_Life/Solution.cpp | UTF-8 | 1,333 | 2.9375 | 3 | [] | no_license | class Solution {
public:
void gameOfLife(vector<vector<int>>& board) {
// 0: 0 to 0, 1: 1 to 0, 2: 0 to 1, 3: 1 to 1
int rows = board.size();
int cols = board[0].size();
for (int i=0; i<rows; i++) {
for (int j=0; j<cols; j++) {
int curr = board[i][j];
... | true |
df2013bdb02a1ffe019612a4079bcc0b4d2a18ae | C++ | espennordahl/iAurora | /src/geometry/shape.h | UTF-8 | 1,539 | 2.5625 | 3 | [] | no_license | //
// shape.h
// Aurora
//
// Created by Espen Nordahl on 01/07/2012.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
#ifndef Aurora_shape_h
#define Aurora_shape_h
#include "core.h"
#include "geometry.h"
#include "attributeState.h"
#include "attributeChange.h"
#include <vector>
namespace Auror... | true |
151fceba9e5f8a7cc60b1163183fc69d6e12139f | C++ | tjoyjoseph/C-_Log_Class | /Log_Class/Log_Class/TestPurposes/SeminarC.cpp | UTF-8 | 2,018 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;
map<char, string> parseArgsValues(int argc, char * argv[]){
vector<string>strings;
map<char, string> MapcharString;
for (int i = 0; i < argc; i++)
... | true |