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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
4e8da9ad95f05524b06cbf86259e68955795bdb2 | C++ | drguildo/csolutions | /chap19/exercise9.cpp | UTF-8 | 1,974 | 3.765625 | 4 | [] | no_license | #include <iostream>
class Node {
public:
Node(int);
int getValue(void);
Node *getPrev(void);
void setPrev(Node *);
private:
int value;
Node *prev;
};
Node::Node(int n) {
value = n;
prev = 0;
}
int Node::getValue(void) {
return value;
}
Node *Node::... | true |
953c36d6ae7422fd31c75b3c63a69dc5c488f92e | C++ | 1ud0v1c/OpenGL | /mesh.h | UTF-8 | 567 | 2.65625 | 3 | [] | no_license | #ifndef MESH_H
#define MESH_H
#include <iostream>
#include <vector>
#include <glm/glm.hpp>
#include "vertex.h"
class Mesh {
public:
void addVertex(Vertex v);
void addIbo(unsigned int pos);
void addIbos(unsigned int pos, unsigned int pos2, unsigned int pos3);
void displayUvs();
std::vector<unsigned int> g... | true |
f5304545902b55157ce52e1b01b60748ff6ed5d8 | C++ | dolf0204/SPA | /ComplexNumber.cpp | UTF-8 | 562 | 3.234375 | 3 | [] | no_license | #include"ComplexNumber.h"
#include<iostream>
#include<string>
#include<sstream>
using namespace std;
ComplexNumber::ComplexNumber(int a, int b)
{
this->a = a;
this->b = b;
}
ComplexNumber::ComplexNumber(){}
void ComplexNumber::set_real(int a)
{
this->a = a;
}
void ComplexNumber::set_imaginary(int b)
{
this->b ... | true |
07afc6dd0414734dba1ea8c7761d6cd376186fef | C++ | phughes18/Lab_Manager | /labmanager.cpp | UTF-8 | 7,954 | 3.671875 | 4 | [] | no_license | /*********************************************************************
CISC 2000 Fordham University Fall 2019
Instructor: Vincent Mierlak
HW 5. Computer Lab Logging Program.
This program uses dynamic arrays to store login information for
four computer labs. Each of the four labs is referenced by the... | true |
100eb19cc979929eb988fec8ab3cd36a62753020 | C++ | lucaslavandeira/siu_guaramini | /src/server_Course.cpp | UTF-8 | 1,305 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <utility>
#include <set>
#include "server_Course.h"
#include "server_Lock.h"
Course::Course(int subject_id, int course_id, std::string name,
int teacher_id, int quota) :
subject_id(subject_id),
course_id(course_id),
name(name),
teacher_id(... | true |
8ae604ee34c2f8745989f7731235b64139ef0748 | C++ | defacto2k15/TinTorrent | /TinTorrent/View/StoppedResourcesScreen.cpp | UTF-8 | 2,475 | 2.625 | 3 | [] | no_license | #include "StoppedResourcesScreen.h"
#include <iostream>
#include <ncurses.h>
StoppedResourcesScreen::StoppedResourcesScreen(std::string name, Kernel *k) : Screen(name, k)
{
choisePos = 0;
pageNumber = 1;
ProgramInfoProvider infoProvider = kernel->getProgramInfoProvider();
localResources = infoProvider.getRevertedR... | true |
2133c6fd7036a9bf7b6ba5353020a6257bef6304 | C++ | Onetaway/My-Cpp-Way | /My Cpp Way/STL/Friend.h | UTF-8 | 729 | 2.578125 | 3 | [] | no_license | //
// Friend.h
// My Cpp Way
//
// Created by sanlen on 9/3/14.
// Copyright (c) 2014 Onetaway. All rights reserved.
//
#ifndef __My_Cpp_Way__Friend__
#define __My_Cpp_Way__Friend__
#include <stdio.h>
#include <string>
#include <iostream>
using namespace std;
class Friend {
public:
Friend();
~Friend(){... | true |
f9eb9771bd09c8a7c27049ea7b9059b4856955a8 | C++ | Armando437121/OrnelasArmado_CIS5_SUMMER2016 | /CLASS/search/main.cpp | UTF-8 | 1,598 | 3.359375 | 3 | [] | no_license | /*
* File: main.cpp
* Author: Armando Ornelas
* Created on July 11th, 2016, 1:20 PM
* Purpose: Template
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <cstdlib> //Random
#include <iomanip> //Formatting
#include <ctime> //Time
using namespace std; //Namespace of the System L... | true |
78f2369904caa0fffc4d2cc762ba2298c37a6c1a | C++ | briangreeley/11_Virtual_BaseClassPointers_Employee_Manager | /src/Employee.h | UTF-8 | 375 | 2.953125 | 3 | [] | no_license | /*
* Employee.h
*
* Created on: Nov 6, 2017
* Author: keith
*/
#ifndef EMPLOYEE_H_
#define EMPLOYEE_H_
#include <string>
class Employee {
public:
Employee(std::string theName, float thePayRate);
virtual ~Employee();
std::string getName()const;
float pay(float hoursWorked) const;
protected:
std::str... | true |
d1a84684b843be5dfdc75f57c1539158aaa60bdb | C++ | weidaru/logo_detection | /logo_detection_dev/include/LogoletSimulator.h | UTF-8 | 980 | 2.703125 | 3 | [] | no_license | #include <opencv/cv.h>
#include <vector>
#include <tr1/memory>
#ifndef LOGOLETSIMULATOR_H
#define LOGOLETSIMULATOR_H
class dataEntry;
struct Logolet
{
dataEntry* toDataEntry(int size, double target);
double* toArray(int size);
int x, y ,width, height, rowIndex, colIndex;
cv::Mat data;... | true |
03dfa25ad9ddf4fc2a4d1b9757842b0c02ddadd1 | C++ | emanuelpeg/codigoCpp2019 | /tp5/colecction/TP2-POO/lista.cpp | UTF-8 | 1,501 | 3.4375 | 3 | [
"Apache-2.0"
] | permissive | #include "lista.h"
#include <iostream>
using namespace std;
Lista::Lista(){
cantidad=0;
}
Lista::Lista(int valor)
{
acceso = new nodo;
acceso->dato=valor;
acceso->sig=NULL;
cantidad=1;
}
Lista::~Lista(){
nodo *borro=acceso;
nodo *x;
while (borro!=NULL) {
x=borr... | true |
d2f6cc86906d0f1b5044d1abb6b398e039ea2a12 | C++ | wileyw/opencv_swig | /test_function.cpp | UTF-8 | 1,472 | 2.578125 | 3 | [] | no_license | #include "opencv2/objdetect/objdetect.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <cctype>
#include <iostream>
#include <iterator>
#include <stdio.h>
#include "test_function.hpp"
using namespace std;
using namespace cv;
string cascadeName = "haarcascade_frontalface_alt... | true |
42b231f0357271ada2f55de9f934b4ef02752c48 | C++ | lzhou835/leetcode | /164.Maximum_Gap.cpp | UTF-8 | 825 | 2.59375 | 3 | [] | no_license | class Solution {
public:
int maximumGap(vector<int>& nums) {
if(nums.size()<2) return 0;
int mn=INT_MAX, mx=INT_MIN, n=nums.size();
for(auto a:nums){
mn=min(mn, a);
mx=max(mx, a);
}
int size=(mx-mn)/n+1;
int cnt=(mx-mn)/size+1;
... | true |
5a834e2a800ea861dc41df60b8f3423512127478 | C++ | 20143104/KMU | /2017-1/c++/project/tetris02/main.cpp | UTF-8 | 2,053 | 2.578125 | 3 | [] | no_license | #include"main.h"
#include<time.h>
#include<ncurses.h>
#include<fstream>
#include <stdio.h>
#include<iostream>
#include <unistd.h>
using namespace std;
int changefilekey(char cur_key){
if(cur_key=='l')
return 1;
else if(cur_key=='r')
return 2;
else if(cur_key=='g')
return 3;
else if(cur_key=='d')
... | true |
12553d212365b56b7b30757462973ab6d19c22e4 | C++ | evgenypanin/Stiven_Prata_book_cpp | /chapter_7/3.cpp | UTF-8 | 1,399 | 3.484375 | 3 | [] | no_license | #include <iostream>
struct box
{
char maker[40];
float height;
float width;
float length;
float volume;
};
void show_struct(const box *razmer);
void mul_volume(box *structing);
void fill_struct(box *structing);
int main()
{
using namespace std;
box expenses;
fill_st... | true |
f32690f98ee3b53569c7b50cb50173dc22971e02 | C++ | SunNEET/LeetCode | /Array/15_3Sum.cpp | UTF-8 | 1,709 | 3.453125 | 3 | [] | no_license | class Solution {
// 跟前一題2sum是類似的作法,先枚舉一個數字,再直接去找能滿足的情況
// 這題就是直接找j+k = -i,所以用two pointer表示j跟k
// 從前後開始往內找是因為有排序過以後,可以保證a[j+1]>=a[j]而a[k-1]<=a[k]
// 因此,當我們找出來的a[i]+a[j]+a[k]的值<0的話,就去遞增j,可以保證sum增加/不變
// 反之就遞減k,保證sum變小/不變,以此來逼近0,就能在O(n)內找出有可能的j+k組合。
public:
vector<vector<int>> threeSum(vector<int>&... | true |
4d1712eba265c7179beddea2bad6a83d88c0805f | C++ | royforlinux/pi2jamma-fe | /src/core/file/FilePath.hpp | UTF-8 | 658 | 2.65625 | 3 | [] | no_license | #pragma once
#include "core/StringSpan.hpp"
#include <vector>
#include <string>
#define PATH_SEP_STR "/"
const char PATH_SEP_CHAR = '/';
std::string joinPath(const std::initializer_list<StringSpan>& parts);
std::vector<std::string> splitPath(StringSpan stringSpan);
std::string getPathEntryName(StringSpan stringSpan)... | true |
2d6e257939d29d2af93138c9b85638c57f57e84b | C++ | gura-lang/gurax | /src/lib/VType_Object.cpp | UTF-8 | 6,262 | 2.53125 | 3 | [] | no_license | //==============================================================================
// VType_Object.cpp
//==============================================================================
#include "stdafx.h"
namespace Gurax {
//------------------------------------------------------------------------------
// Help
//------... | true |
5f3575e2dc2c6c655f1517daad8e3396051c5928 | C++ | mishranitesh/LeetCode_Solutions | /Easy_Category_Problems/141_Linked_List_Cycle_E.cpp | UTF-8 | 1,661 | 3.578125 | 4 | [] | no_license | /*
141. Linked List Cycle (EASY)
Given a linked list, determine if it has a cycle in it.
To represent a cycle in the given linked list, we use an integer pos which represents
the position (0-indexed) in the linked list where tail connects to.
If pos is -1, then there is no cycle in the linked list.
Input: head ... | true |
594f8b377ecc329628d46134fbb2421c9242b47a | C++ | LGuitron/CyPS | /UnitTest/ValueParametrized/valueParametrized.cc | UTF-8 | 1,140 | 2.796875 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "valueParametrized.h"
using ::testing::Range;
using ::testing::Values;
using ::testing::ValuesIn;
using ::testing::Bool;
using ::testing::Combine;
class Fixture : public ::testing::TestWithParam<int>{};
class Chars: public::testing::TestWithParam<char>{};
class Bools: public::testing... | true |
5bcc343ee2a0ae0ce7a0553faf5a676c627d27bc | C++ | chrystallagh/HavadjiaChrystalla_CSC17a_42824 | /Homework/Assignment 1 /Gaddis_Probl7.6/main.cpp | UTF-8 | 2,310 | 3.421875 | 3 | [] | no_license | /*
* File: newmain.cpp
* Author: chrystallahavadjia
* Purpose: Temperature conversions
* 7.6
*/
//System Libraries
#include <iostream>
#include<fstream>
using namespace std;
//User Libraries
//Global Constants
//Function Prototypes
//Execution Begins Here
int main()
{
const int MONTH = 3;
const... | true |
ec9b787b195bcec1e6dc1dfd547768e653e8171c | C++ | tonytej/XMLParser | /lab2/lab2/lab2.cpp | UTF-8 | 7,520 | 3.171875 | 3 | [] | no_license | // lab2.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <stack>
#include <deque>
#include <regex>
using namespace std;
/*! A class containing a vector of string that makes up a node */
class Node {
p... | true |
64cde444e2bef2630504144b6734e9aa94824790 | C++ | mqssi/JeuDeRole | /TPJeuDeRole/EtreVivant.cpp | UTF-8 | 758 | 3.0625 | 3 | [] | no_license | #include "EtreVivant.h"
using namespace std;
EtreVivant::EtreVivant()
{
this->nom = "";
this->pointdevie = 0;
}
EtreVivant::EtreVivant(std::string nom, int pointdevie)
{
this->nom = nom;
this->pointdevie = pointdevie;
this->positionx = 0;
this->positiony = 0;
}
void EtreVivant::SePositionner(int po... | true |
5d33bf1600edcb3544dafbe025279c3d7ddba65e | C++ | Jialin/ICPC | /Template/leetcode/linked_list.h | UTF-8 | 3,090 | 2.765625 | 3 | [] | no_license | // !macro_gen
// ALL LEETCODE_LINKED_LIST_ALL
#pragma once
#include "common/macros.h"
#include "debug/debug_basic.h"
using namespace std;
#ifdef LOCAL
struct ListNode {
int val;
ListNode* next;
inline ListNode() : val(0), next(nullptr) {}
inline ListNode(int x) : val(x), next(nullptr) {}
inline ListNode(in... | true |
4572217a6323cc44832b5ddb227b479ab926686f | C++ | JakubKivi/PONG | /PONG/PONG.ino | UTF-8 | 513 | 2.578125 | 3 | [
"MIT"
] | permissive | #include <Servo.h> //Biblioteka odpowiedzialna za serwa
Servo serwomechanizm; //Tworzymy obiekt, dzięki któremu możemy odwołać się do serwa
int pozycja = 0; //Aktualna pozycja serwa 0-180
int zmiana = 6; //Co ile ma się zmieniać pozycja serwa?
void setup()
{
Serial.begin(9600);
serwomechanizm.attach(3); //... | true |
7936b39eb6693f6fc8b35d353f37b622fb91b815 | C++ | deepcoder007/spoj | /MAXWOODS.cpp | UTF-8 | 1,521 | 3.078125 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
// a dp problem in 2D
inline int max(int i,int j)
{
if( i>j ) return i;
else return j;
}
inline int min(int i,int j)
{
if( i<j ) return i;
else return j;
}
inline int scan()
{
register int n=0;
register char c=g... | true |
85d0dea6abe46cb4039490e41209097b3995f734 | C++ | Jonariguez/ACM_Code | /UVA/1153.cpp | GB18030 | 1,561 | 2.78125 | 3 | [] | no_license | /****************
*PID:
*Auth:Jonariguez
*****************
ȰսֹʱȺab
aĽֹʱb֮ǰaļӹʱbô
aȻҪbأbļӹ
ʱ䳬˽ֹʱ䣬ô֮ǰĶɾӹʱ
ǸܵĶûб仯ܵļӹʱ
ˣΪԺܸඩ
ҪܾһЩģȶά
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
const int maxn=800000+10;
struct pp{
int nee... | true |
3981fa07c88159ae233952391ed74244aae5c013 | C++ | kotunde/SourceFileAnalyzer_featureSearch_and_classification | /GCJ_Dataset/Data/Aleksander/2974486_5644738749267968_Aleksander.cpp | UTF-8 | 1,650 | 2.625 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
using namespace std;
double g[2][1005];
int a[2][1005];
int ind[2];
pair < double , int > p[2005];
int n;
int pSize;
int ... | true |
7936e82d096437685e07d5218b1783279c3f6db6 | C++ | nicolekurtz/Calendar_app | /calendar_item.cpp | UTF-8 | 13,728 | 3.296875 | 3 | [] | no_license | // Nicole Kurtz
#include "calendar_item.h"
using namespace std;
/*
char * name; // name of calendar item
char * time; // time of calendar item
char * description; // description of calendar item
char * zoom; // zoom id if applicable
*/
// default constructor
item::item(): name(NULL), description(NULL)
{
}
// dec... | true |
4eb643631b6f1c48dc07c5e70f21611b5e0b29f7 | C++ | bigYellowDuck/urllib | /Response.cpp | UTF-8 | 762 | 2.9375 | 3 | [] | no_license | #include "Response.h"
namespace urllib
{
using std::string;
Response::Response(const string& resp)
: resp_(resp)
{
parseRespone();
}
Response::Response(string&& resp)
: resp_(std::move(resp))
{
parseRespone();
}
const string& Response::response() const noexcept
{
return resp_;
}
const string&... | true |
5bdeb097a72bd243ed5c3b6ec6080497d2433c06 | C++ | dlhe/LeetCode | /test/TestSubStringWithConcatenationOfAllWords.cpp | UTF-8 | 395 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include "../src/SubStringWithConcatenationOfAllWords.cpp"
using namespace std;
int main() {
string str = "a";
vector<string> l {"a"};
Solution s;
vector<int> a = s.findSubstring(str, l);
cout << "======" << endl;
for (int i = 0; i < a.s... | true |
e73af55da59c82dd74df63117cbd9b5360c57143 | C++ | SamiMurtaza/DragonBallZ-OOP | /Final/src/Saibaman.cpp | UTF-8 | 5,125 | 2.65625 | 3 | [] | no_license | #include "Saibaman.h"
#include <SDL_mixer.h>
Saibaman::Saibaman(const char* textureSheet, int x, int y, int R, int G, int B) :Enemy(textureSheet, x, y, R, G, B)
{
Saibaman::type = 0;
dead = false;
}
void Saibaman::update(int flag, double i_angle = 0.0)
{
if (flag == 1 && xpos < 750)
{
xpos +=... | true |
85f66e8a895806c990cc00baacbe5e06bef70440 | C++ | OracleMahad/PS | /NQueen.cpp | UTF-8 | 700 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
using namespace std;
int col[100000];
int n;
bool promising(int i){
bool switching= true;
int k=1;
while(k<i&&switching){
if(col[i]==col[k]||abs(col[i]-col[k])==i-k)
switching = false;
k++;
}
return switching;
}
void q... | true |
8ed3c8ae9331af7e14259011dbfba233d4ce0372 | C++ | BearingMe/exercicios-CeV | /exs/mundo_1/c++/028.cpp | UTF-8 | 570 | 3.484375 | 3 | [
"MIT"
] | permissive | /*
028 - Jogo da Adivinhação v1.0
Escreva um programa que faça o computador "pensar" em um número inteiro entre 0 e 5 e peça para o usuário
tentar descobrir qual foi o número escolhido pelo computador. O programa deverá escrever na tela se o usuário venceu ou perdeu
*/
#include <iostream>
#include <time.h>
#inclu... | true |
46904767171c902b16714460eb41640950ab50bf | C++ | shreesh30/Data-Structures-and-Algorithms | /linearSearch.cpp | UTF-8 | 411 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
bool linearSearch(int arr[], int n, int key)
{
bool flag = false;
for (int i = 0; i < n; i++)
{
if (arr[i] == key)
{
flag = true;
break;
}
}
return flag;
}
int main()
{
int arr[] = {5, 2, 1, 10, 100};
... | true |
ef2e13e6ccc30aa29f29e58a4848ac61528160d4 | C++ | vasiliy249/PriorityQueue | /BinomialHeap.cpp | UTF-8 | 8,272 | 3.15625 | 3 | [] | no_license | #include "BinomialHeap.h"
#include <limits>
#include <sstream>
#include <cmath>
////////////////////////////////////////////////////////////////////////////////////////////////////
BinomTreeNode::BinomTreeNode(int key)
: key_(key), left_child_(NULL), right_sibling_(NULL) {}
void BinomTreeNode::Merge(BinomTreeNodePt... | true |
3a2a74387d1e907ad1e9137518a057986ea521bf | C++ | arasu420/greatest_num | /greatest_num.cpp | UTF-8 | 366 | 3.515625 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int a,b,c;
cout << "Enter the 1st num: ";
cin >> a;
cout << "Enter the 2st num: ";
cin >> b;
cout << "Enter the 3st num: ";
cin >> c;
if(a>b && a>c)
{
cout << a << " is greater";
}
else if(b>c)
{
cout << b << " is greater ";
}
else
{
... | true |
b9d7e0a054019ca03a1d41b041748c1cef87fa99 | C++ | whodewho/codefun | /Shuffle_Recover.cpp | UTF-8 | 935 | 2.640625 | 3 | [] | no_license | #include "stdafx.h"
#include "iostream"
#include "vector"
#include "string"
#include "map"
#include <algorithm>
#include <stdlib.h>
#include <time.h>
#include <stack>
#include <sstream>
#include <iomanip>
#include <random>
using namespace std;
void shuffle(vector<int> &num, int &k)
{
int i=0,... | true |
ea138263d266f546cac922da5d6ca34240f005ce | C++ | RickyOrmeno/Final-Project | /AnimalDatabaseFinalProject/AnimalDatabaseFinalProject/Reptiles.h | UTF-8 | 287 | 2.515625 | 3 | [] | no_license | #pragma once
#include "Animal.h"
class Reptiles : public Animal
{
private:
std::vector <std::shared_ptr<Reptiles>> _Reptiles;
public:
Reptiles(std::string name, std::string description);
void addReptile(std::shared_ptr<Reptiles> newReptile);
void showReptiles();
~Reptiles();
};
| true |
33454e8bf71cae2df7ee49f5958976051e25b804 | C++ | ErwanDL/aoc2020 | /day16/main.cpp | UTF-8 | 5,227 | 3.015625 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
template <class T> void printVector(const std::vector<T>& vec) {
std::cout << "{ ";
for (std::size_t i = 0; i < vec.size() - 1; ++i) {
std::cout << vec.at(i) << ", ";
}
s... | true |
0312c0562f2fb41f78904558173bf5324b2d9447 | C++ | VladimirRadev/FMI | /Introduction/IntroductionHomework/Birthday/Birthday.cpp | UTF-8 | 1,389 | 3.5 | 4 | [
"MIT"
] | permissive | /**
*
* Solution to homework assignment 1
* Introduction to programming course
* Faculty of Mathematics and Informatics of Sofia University
* Winter semester 2020/2021
*
* @author Atanas Vasilev
* @idnumber 62577
* @task 1
* @compiler VC
*
*/
#include <iostream>
using namespace std;
int main()
{
const double MONEY_G... | true |
0aa47426839a113fb7cde422f569dbb9fac5240e | C++ | koganie/uecda_client | /src/makeYaku.cpp | SHIFT_JIS | 31,060 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include "Yaku.h"
#include "makeYaku.h"
#include "debug.h"
using namespace std;
//悤̊Q
//joker1[݂̂ɑΉĂ邽߁Â̂g[
void pushYaku(vector<Yaku> *allYaku, int64 cd, int suits, int num, int rank, int rank2, int jps, int jpr){
//J[hrbgAX[gAÃNAẼNiKiAjokerPR̂ƂȊO͓jAgjoker... | true |
a10c3fe67fd35e55d21a53a2abadcc69db7b8574 | C++ | Trietptm-on-Security/heap_history_viewer | /heaphistory.cpp | UTF-8 | 9,940 | 2.796875 | 3 | [
"MIT"
] | permissive | #include <algorithm>
#include <limits>
#include "json.hpp"
// using json = json;
#include "heaphistory.h"
// Constructors for helper classes.
HeapConflict::HeapConflict(uint32_t tick, uint64_t address, bool alloc)
: tick_(tick), address_(address), allocation_or_free_(alloc) {}
// The code for the heap history.... | true |
cdb0f9ad0c5b00e86abd7ad4c8b33a4702f120f0 | C++ | mingliang-99/c_practise | /practise/c_lianbiao/c_lianbiao_leetcode/c_lianbiao_leetcode/main.cpp | UTF-8 | 6,748 | 3.5625 | 4 | [] | no_license | //
// main.cpp
// c_lianbiao_leetcode
//
// Created by mingliang on 2020/12/11.
//
#include <iostream>
struct ListNode{
int val;
struct ListNode *next;
ListNode(int x):val(x),next(nullptr){}
};
//生成测试链表
ListNode* createList(int len){
if(len == 0){
return NULL;
}
int val;
ListNod... | true |
4f093571ace6482bfddf1c85703f7c0bd2e2ed1d | C++ | ViniciusLobo/Lights-of-World | /New/SincroB-core/SincroB-core/Core/maths/vec3.cpp | UTF-8 | 3,026 | 3.484375 | 3 | [] | no_license | #include "vec3.hpp"
namespace engine { namespace maths {
vec3::vec3(const float& x, const float& y, const float& z)
{
this->x = x;
this->y = y;
this->z = z;
}
vec3& vec3::add(const vec3& vector)
{
x += vector.x;
y += vector.y;
... | true |
f8d80de605a32e5ce737a955de4a7bd841ac781a | C++ | OS2World/APP-SCIENCE-SimRobot2 | /Vector.cpp | UTF-8 | 5,657 | 2.84375 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /***********************************************************************
**** ****
**** SimRobot ****
**** Universitaet Bremen, Fachbereich 3 - Informatik ****
**** Zentrum fuer Kognition... | true |
8f27fddfb293ea5e2f7557b0f59bcee91da39e7e | C++ | renyajie/Learning | /Algorithm/基础/数据结构/kmp/kmp.cpp | GB18030 | 431 | 2.890625 | 3 | [] | no_license | // s[]dzıp[]ģʽnsijȣmpij
// ע±궼1ʼ, ne[1] = 0;
// next
for(int i = 2, j = 0; i <= m; i++) {
while(j && p[i] != p[j + 1]) j = ne[j];
if(p[i] == p[j + 1]) j++;
ne[i] = j;
}
// ƥ
for(int i = 1, j = 0; i <= n; i++) {
while(j && s[i] != p[j + 1]) j = ne[j];
if(s[i] == p[j + 1]) j++;
if(j == m) {
j = ne[j];
// ƥɹ
}... | true |
21e1cfd5cfeb418dd19acf0d10d2ed3bdb7917a6 | C++ | cpptt-book/2nd | /08_type_erasure/03_shared_ptr_implementation.cpp | UTF-8 | 1,733 | 3.53125 | 4 | [
"CC0-1.0"
] | permissive | // Copyright (c) 2014
// Akira Takahashi, Fumiki Fukuda.
// Released under the CC0 1.0 Universal license.
class shared_deleter_base {
public:
shared_deleter_base() {}
virtual ~shared_deleter_base() {}
virtual void destroy() = 0;
};
template <class T, class D>
class shared_deleter : public shared_deleter_base {
... | true |
e22fe4d799f59b4190014d4b574b6ca491d1cf3e | C++ | dbmartinez/Starting-Out-With-C-plus-plus | /CH.4/PC4.cpp | UTF-8 | 1,161 | 4.34375 | 4 | [] | no_license | // Areas of Rectangles
// Libraries needed
#include<iostream>
using namespace std;
// Main function
int main()
{
// Variables
int length1,
width1,
length2,
width2,
area1,
area2;
// Description
cout << "\nEnter in length and width for 2 rectangles, when done ";
cout << "entering in ... | true |
17ba16c8d3673f4b72b31746c94b90eef2f9bfd0 | C++ | bpgabin/gl-golf | /VoidEngine/VoidEngine/ThirdPersonCamera.cpp | UTF-8 | 1,647 | 3.078125 | 3 | [
"MIT"
] | permissive | #include "ThirdPersonCamera.hpp"
#include <iostream>
ThirdPersonCamera::ThirdPersonCamera(GolfBall* golfBall) : Camera(perspective)
{
mGolfBall = golfBall;
mOffset = mGolfBall->getPosition() ;
radius = 2.0f;
}
void ThirdPersonCamera::handleMouseMovement(float x, float y)
{
glm::vec3 worldCoordinates;
//glm::v... | true |
538e390f8c59dfdaa751e15d3bf7718fec3968f4 | C++ | OptimalAlgorithm/algo-study | /2020-02-13 2주차/종범/보물섬.cpp | UTF-8 | 1,255 | 2.5625 | 3 | [] | no_license | // https://www.acmicpc.net/problem/2589
#include<iostream>
#include<algorithm>
#include<queue>
#include<cstring>
using namespace std;
const int MAX = 50;
int N, M, ans;
char MAP[MAX][MAX];
bool check[MAX][MAX];
int dx[] = { 0,0,1,-1 };
int dy[] = { 1,-1,0,0 };
int bfs(int sx, int sy) {
queue<pair<pair<int, int>, i... | true |
f1c967a4ca82f2c181c12bccea6d575fd49e3c12 | C++ | grigorypalchun/Server | /main.cpp | UTF-8 | 2,604 | 2.90625 | 3 | [] | no_license | #include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdio.h>
#include <iostream>
#include <fcntl.h>
#include <string.h>
#include <vector>
using namespace std;
int sendall(int s, char *buf, int len, int flags)
{
int total = 0;
int n;
while(total < len)
{
n = send(s... | true |
549ac283417262d80a4d7d07ce0ab8cb5c236973 | C++ | jennyaoym/chess | /piece.h | UTF-8 | 666 | 2.90625 | 3 | [] | no_license | #ifndef PIECE_H
#define PIECE_H
#include <string>
class Square;
class Checkerboard;
class Piece {
protected:
std::string colour;
int value;
Square *sq;
char name;
Checkerboard *cb;
public:
Piece(std::string colour, Square *sq, Checkerboard *cb);
virtual ~Piece();
virtual char getname() const = 0;
... | true |
295256c5c916c635f9e3f81fed531e0447ccaa64 | C++ | rafaelapure82/C-Parte-2 | /matricula de honor.cpp | UTF-8 | 768 | 3.40625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(void)
{
int nota;
cout << "Introduzca una calificacion numerica entre 0 y 10:";
cin >> nota;
cout << "La calificacion del alumno es" << endl;
if (nota == 10)
{
cout << "Matricula de Honor" << endl;
}
else if (nota >= 9)... | true |
46c306364b04ccc5948c2d28bf1003aba9a4a951 | C++ | ferreiracaf/POO | /Gerenciador de Oficina Mecânica/Código/cliente.cpp | UTF-8 | 1,888 | 3.078125 | 3 | [] | no_license | #include "cliente.h"
string Cliente::getTelefone() const
{
return telefone;
}
void Cliente::setTelefone(const string &value)
{
telefone = value;
}
string Cliente::toString() const{
stringstream ss;
ss << nome << ", tel: " << telefone << endl << "Veiculos:" << endl;
for(Automovel * aut : veiculo... | true |
067d54dcb37a28a6e4bd06719303c92df63a22eb | C++ | BackupTheBerlios/robotm6 | /robot2005/src/devices/simu/motorSimu.cpp | ISO-8859-1 | 1,388 | 2.765625 | 3 | [] | no_license | #include "implementation/motorSimu.h"
#include "log.h"
#include "simulatorClient.h"
// ============================================================================
// ============================== class MotorSimu ==========================
// ========================================================================... | true |
546ee4f0e9d52ce1671a6d21405cc24b6963ccfa | C++ | JacobMiske/PaintBot | /StepperMotor.ino | UTF-8 | 1,783 | 2.84375 | 3 | [] | no_license | #include <Stepper.h>
const int ledPin = 8;
Stepper upStepper1(360, 0, 1, 2, 3);
Stepper upStepper2(360, 0, 1, 2, 3);
Stepper horizontalStepper(360, 0, 1, 2, 3);
Stepper motionStepperLeft(360, 0, 1, 2, 3);
Stepper motionStepperRight(360, 0, 1, 2, 3);
void setup() {
// put your setup code here, to run once:
Serial... | true |
83382a03b13c5f5e0fe0748b3ef9466d63b9608c | C++ | freshie9098/DynamicProgramming | /4.Palindromic Subsequence/2.Count Palindromic Subsequences.cpp | UTF-8 | 1,043 | 2.859375 | 3 | [] | no_license | // Count Palindromic Subsequences
// I/P: abcd O/P: 4
#include <bits/stdc++.h>
using namespace std;
// Recursive
int cntPS(string s, int i, int j) {
if (i == j)return 1;
if (i > j)return 0;
if (s[i] == s[j])return 1 + cntPS(s, i, j - 1) + cntPS(s, i + 1, j);
return cntPS(s, i, j - 1) + cntPS(s, i + 1, j) - cntPS... | true |
54b783d0a47efc58881d77bd5b8f5b39dfbdc3d4 | C++ | jcjolley/school | /objectOriented/lectures/section4/skeet/skeet.cpp | UTF-8 | 5,831 | 3.15625 | 3 | [] | no_license | /***********************************************************************
* Program:
* Skeet. Play the wonderful Skeet game using OpenGL
* Author:
* Br. Grimmett
* Summary:
***********************************************************************/
#include "point.h" // Objects have a position
#includ... | true |
8de3fe6e577c867cfc712213182027d7a05fadc0 | C++ | kamyu104/LeetCode-Solutions | /C++/find-two-non-overlapping-sub-arrays-each-with-target-sum.cpp | UTF-8 | 882 | 2.859375 | 3 | [
"MIT"
] | permissive | // Time: O(n)
// Space: O(n)
class Solution {
public:
int minSumOfLengths(vector<int>& arr, int target) {
unordered_map<int, int> prefix = {{0, -1}};
vector<int> dp(arr.size());
int result = numeric_limits<int>::max(), min_len = numeric_limits<int>::max();
int accu = 0;
for... | true |
c59e1a257d6547db1d286de5b0184b2a9cb9f383 | C++ | zohairajmal/competitive-programming-problems | /leet-stickers-to-spell-word/test.cpp | UTF-8 | 2,100 | 3.015625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
vector<string> stickers;
string target;
int n;
vector<int> dp;
int finalState;
int minStickers(int state){
int& ret = dp[state];
if(ret == -1){
if(state == finalState){
ret = 0;
... | true |
1608e88a36e3f39ecdd86098cfd7c6096b34959d | C++ | quangh33/Coding-Interview-Practice | /Leetcode/adhoc/hash table/243.shortest-word-distance.cpp | UTF-8 | 398 | 2.859375 | 3 | [] | no_license | class Solution {
public:
int shortestDistance(vector<string>& words, string word1, string word2) {
unordered_map<string, int> pos;
int i = -1;
int res = words.size();
for(string w: words) {
pos[w] = ++i;
if (w == word1 && pos.count(word2) != 0) res = min(res, i - pos[word2]);
if (w == word2 && pos.count(w... | true |
767ca15ac1f61c164041f431e8b64b3e662b823b | C++ | fthiebolt/neOCampus-arduino | /neosensor/libraries/M5Unit-RELAY/examples/Unit_2RELAY_M5Core/Unit_2RELAY_M5Core.ino | UTF-8 | 1,543 | 2.625 | 3 | [
"MIT"
] | permissive | /*
*******************************************************************************
* Copyright (c) 2022 by M5Stack
* Equipped with M5Core sample source code
* 配套 M5Core 示例源代码
* Visit for more information: https://docs.m5stack.com/en/unit/2relay
* 获取更多资料请访问: https://docs.m5stac... | true |
aca97bff8bd3669f8378b0cfd2fae303dc4f73d1 | C++ | Nickqiaoo/trigger | /invite_module.cc | UTF-8 | 1,671 | 2.765625 | 3 | [] | no_license | #include "invite_module.h"
#include <string>
InviteModule::InviteModule(){
num_to_code_map_={{0,'0'},{1,'1'},{2,'2'},{3,'3'},{4,'4'},{5,'5'},{6,'6'},{7,'7'},{8,'8'},{9,'9'},{10,'a'},
{11,'b'},{12,'c'},{13,'d'},{14,'e'},{15,'f'},{16,'g'},{17,'h'},{18,'i'},{19,'j'},{20,'k'},
{21,'l'},{22,'m'},{23,'n'},{24,'o... | true |
846e951fed1109dde84cb7672c907c11161649c7 | C++ | locolocoer/mycode | /Game-Programming-Using-Qt-5-Beginners-Guide-Second-Edition-master/Chapter08/Custom Widgets/chess/ver2/chessview.cpp | UTF-8 | 481 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "chessview.h"
#include "chessboard.h"
ChessView::ChessView(QWidget *parent) : QWidget(parent)
{
}
void ChessView::setBoard(ChessBoard *board)
{
if(m_board == board) return;
if(m_board) {
// disconnect all signal-slot connections between m_board and this
m_board->disconnect(this);
... | true |
c37e34ce6185a4b25cbefc7fdf23a9847e2f038f | C++ | Yiluhuakai22/algorigthm-study | /LeetCode_C++/435_eraseOverlapIntervals/solution.h | UTF-8 | 691 | 3 | 3 | [
"MIT"
] | permissive | #include <vector>
#include <algorithm>
using std::vector;
class Solution
{
public:
int eraseOverlapIntervals(vector<vector<int>> &intervals)
{
if (intervals.empty())
{
return 0;
}
sort(intervals.begin(), intervals.end(), [](vector<int> a, vector<int> b)
... | true |
372fcecdb02d5a6ef32c9bc24a673244a19a208d | C++ | gajdosech2/scan-filtering | /HIROVisualizer/HIRO/include/HIRO_DRAW/ElementRenderer.h | UTF-8 | 5,994 | 2.515625 | 3 | [] | no_license | /*
Copyright (C) Skeletex Research, s.r.o. - All Rights Reserved
Unauthorized copying of this file, via any medium is strictly prohibited
Proprietary and confidential
*/
#ifndef HIRO_DRAW_ELEMENT_RENDERER_H
#define HIRO_DRAW_ELEMENT_RENDERER_H
#include <GLW/Texture.h>
#include <GLW/UniformBuffer.h>
#include <HIRO... | true |
79f18012e93aa939ea57137a8112d2f32d2a1c30 | C++ | hurou927/atcoder | /cpp/header/my_util.hpp | UTF-8 | 1,535 | 2.765625 | 3 | [] | no_license | #ifndef _MY_UTIL_HPP_
#define _MY_UTIL_HPP_
#define ALL(a) (a).begin(),(a).end()
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define MAXINDEX(c) distance((c... | true |
32b7b1a799db2f1ae551ab0a79b46d4ff7d355a4 | C++ | ZzzandyzzZ/Problemas-UVA | /732 - Anagrams by Stack.cpp | UTF-8 | 957 | 3.203125 | 3 | [] | no_license | //732 - Anagrams by Stack
#include <bits/stdc++.h>
using namespace std;
string w1,w2;
int size;
stack<char> pil;
void secuencias(char op,int i,int o,string cad,stack<char> pila,string se){
//cout<<i<<" "<<o<<" "<<cad<<endl;
if(i>size||o>size||o>i)return;
//if(op=='o'&&pila.empty())return;
... | true |
c48a46b16006d84ef59b282e998fd55793ee3850 | C++ | ahuertaalberca/C-Plus-Plus | /Homework/HW6/newproverb-1-exercise-3.cpp | UTF-8 | 1,732 | 4.21875 | 4 | [
"MIT"
] | permissive | // This program will allow the user to input from the keyboard
// whether the last word to the following proverb should be party or country:
// "Now is the time for all good men to come to the aid of their _______"
// The user will input a word to finish the sentence.
// JESUS HILARIO HERNANDEZ
#include <iostream>
#i... | true |
f5593516fcce4f8cfb068b59a43655732611d6ee | C++ | shishirkumar1996/cp | /algos_and_data_structures/algo/fft.cpp | UTF-8 | 1,386 | 3.09375 | 3 | [] | no_license | #include<bits/stdc++.h>
#define cd complex< double >
#define vcd vector< cd >
using namespace std;
vcd fft(vcd a){
int n= a.size();
if(n==1)return vcd(1,a[0]);
vcd w(n); // for storing n complex nth roots of unity
for(int i=0;i<n;i++){
double alpha = 2*M_PI*i/n;
w[i] = cd(cos(alpha),sin(alpha));
... | true |
cfaaeec06c63fb28f82f9a77ee1b61c2cf4d39d5 | C++ | Hugo2121/Mind | /cmpt419/Proj/hanz/data_prep/index_extract/ExtractImages.cpp | UTF-8 | 3,267 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include "string_helper.h"
#include "gnt_helper.h"
#ifdef WIN32
#else
#include <sys/stat.h>
#endif
using namespace std;
map<unsigned int, vector<GNTSampleInfo>> ReadGNTInfoFile(string info_name) {
FILE* bin_file = fopen(info_nam... | true |
d67e378d08352c1771546f46e7e69538311d4a3b | C++ | winterthediplomat/Parallel-Road-Rage | /RoadRage/solver.cpp | UTF-8 | 1,803 | 2.734375 | 3 | [] | no_license | //#include "StdAfx.h"
#include <iostream>
#include "solver.h"
using namespace std;
Solver::Solver()
{
this->acceptConstraints=new QVector<Constraint*>;
this->rejectConstraints=new QVector<Constraint*>;
}
/*
void Solver::getSolutions(Path startSolution, QVector<Path> *solutions)
{
QMessage::critical(this, ... | true |
7f64a840e52c54e77b40244695159cef490335bb | C++ | prattmic/waldo | /io/linux_byteio.cc | UTF-8 | 1,556 | 2.84375 | 3 | [] | no_license | #include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <utility>
#include "external/nanopb/util/task/status.h"
#include "external/nanopb/util/task/statusor.h"
#include "io/linux_byteio.h"
using io::LinuxByteIO;
util::StatusOr<LinuxByteIO> LinuxByteIO::OpenFile(const char *filename) {
int fd = open(fil... | true |
d0f576b32a93b8b048281f757e6eb90f8c614637 | C++ | balvig/lifeboxes | /libraries/Sleep.cpp | UTF-8 | 1,484 | 2.921875 | 3 | [] | no_license | #include "Sleep.h"
namespace Lifeboxes {
const uint32_t RTC_SLEEP_COUNT_REGISTER = 65;
const uint32_t UPPER_LIMIT = 8760; // Arduino randomly decided to sleep for 2809417741 hours
Sleep::Sleep(uint32_t cyclesToSleep, uint64_t sleepingInterval) {
_defaultCyclesToSleep = cyclesToSleep;
_sleepingInterval... | true |
3599807ce68a7ce37a7459fc4087cbf4e7177a15 | C++ | AJnad/CIS-22A-C-- | /Assignment 10/rockpaperscissors.cpp | UTF-8 | 1,914 | 3.453125 | 3 | [] | no_license | /**
* Ajay Nadhavajhala
* CIS 22A 9:30-11:20 AM M/W
*/
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
string player1, player2, choice1, choice2;
cout << "Let's play Rock-Paper-Scissors!" << endl;
cout << "Player one, please enter your name: ";... | true |
d1e15613c32cf9eb17917141689504c1503bdaef | C++ | langmead-lab/vargas | /include/scoring.h | UTF-8 | 3,585 | 2.59375 | 3 | [
"MIT"
] | permissive | /**
* Ravi Gaddipati
* Jan 10, 2016
* rgaddip1@jhu.edu
*
* @brief
* Program CL parsing and scoring structs.
*
* @copyright
* Distributed under the MIT Software License.
* See accompanying LICENSE or https://opensource.org/licenses/MIT
*
* @file
*/
#ifndef VARGAS_SCORING_H
#define VARGAS_SCORING_H
#includ... | true |
199a2e6dd241ce4c23046ed22fa68204381fd1ab | C++ | figoxu/CPPPraticse | /lang/ioteck/ioteck_course/chap5/private/main.cpp | UTF-8 | 450 | 3.609375 | 4 | [] | no_license | #include <iostream>
using namespace::std;
class Animal{
public:
Animal() {}
void eat() const {cout << "eat" << endl;}
};
class Cat : public Animal
{
public:
Cat() {}
void maew() { cout << "maew" << endl; }
};
class Duck : private Animal
{
public:
Duck() {}
void stretchNeck() {cout << "stretch" << endl;}
};
v... | true |
26b5a6553028503c84d0ce980a2dc95d702c45d4 | C++ | jessiefrederick/UTN | /Laboratorio de Comp I/Trabajo Practico - 1/Ejercicio - 1.cpp | UTF-8 | 408 | 2.84375 | 3 | [] | no_license | //Nombre: Jessie Frederick
//TP Nº: 1
//EJ Nº: 1
//Comentarios:
#include<iostream>
using namespace std;
int main(void) {
int cantidadHorasTrabajadas;
int valorHora;
cout << "Ingresar cantidad de horas trabajadas: ";
cin >> cantidadHorasTrabajadas;
cout << "Ingresar valor hora de trabajo: ";
c... | true |
21eb5a044e9e67644417a7cfdaa053b54a413c18 | C++ | AdityaChettri/cppProgram1 | /Assignment1.cpp | UTF-8 | 303 | 2.6875 | 3 | [] | no_license | /*Author:Aditya Chettri
DOC:17th November2020
Pattern Printing
*/
#include<iostream>
using namespace std;
int main()
{
for(int i=1;i<=7;i++)
{
for(int j=i;j<=7;j++)
{
cout<<j;
}
cout<<"\n";
}
for(int i=6;i>=1;i--)
{
for(int j=i;j<=7;j++)
{
cout<<j;
}
cout<<"\n";
}
return 0;
}
| true |
4ffbf9e898f2b8584ad21bd324591be90c024fc8 | C++ | ArttuHeinonen/oo2 | /Content.cpp | ISO-8859-1 | 588 | 2.515625 | 3 | [] | no_license | #include "Content.h"
Content* Content::content;
Content::Content(void) //ladataan sislt
{
//backgroundTex.loadFromFile("res/taivas.png");
if (!playerTex.loadFromFile("res/player.png")){
printf("Error: Player texture not found!\n");
}
if (!calibri.loadFromFile("res/calibri.ttf")){
printf("Error: font not found... | true |
b9d82b1df6aa77a969bd653e50587c28b990151f | C++ | jadkins89/CSCI2270_DataStructures | /Assignment_6/main.cpp | UTF-8 | 2,376 | 3.703125 | 4 | [] | no_license | #include <iostream>
#include "MovieTree.hpp"
#include <fstream>
#include <sstream>
//Function Declarations
void printMenu();
void mainMenu(MovieTree &theTree);
int main(int argc, char* argv[]) {
MovieTree testTree;
char* filename = argv[1];
std::ifstream documentStream(filename, std::ios::in);
if (documentStream... | true |
213bc331161bb1788db826f8df6f090f2e40cfc0 | C++ | XeCycle/cxxtest | /incompatible-reinterpret-warning.cc | UTF-8 | 213 | 2.59375 | 3 | [] | no_license | struct compat {
void* x;
};
struct incompat {
int a, b;
};
int main()
{
compat c;
incompat i;
(void) reinterpret_cast<void*&>(c); // good
(void) reinterpret_cast<void*&>(i); // warn
return 0;
}
| true |
423464ef511ec67bbae09fc0612d7efbada489e0 | C++ | Lenyeto/Realtime | /Lab_03_WB/build/vs2015/LogManager.h | UTF-8 | 734 | 2.703125 | 3 | [] | no_license |
#include <fstream>
#include <iostream>
#define LL_DEBUG 0x000001
#define LL_NORMAL 0x000010
#define LL_WARNING 0x000100
#define LL_ERROR 0x001000
#define LL_SCRIPT 0x010000
#define LL_ALL 0x011111
/*! The LogManager Prototype */
namespace ssuge {
class LogManager {
public:
/*! The Constructor Prototype */
L... | true |
51407b10e64e05980c55cf09301989407b147551 | C++ | exvayn/CPP-Coding | /student's work/9. динамические структуры данных и модульное программирование/f3.cpp | UTF-8 | 191 | 3.015625 | 3 | [] | no_license | #include <iostream>
int f3(int *A, int i){
std::cout<<"\nSpisok: ";
if (i>=0)
for (int j=i;j>=0;j--)
std::cout<<A[j]<<" ";
else std::cout<<"empty";
std::cout<<"\n\n";
return (0);
} | true |
3d2fa00071d6c07eb6d8cc89f30f5414a8698fdb | C++ | vishwanath-ek/ProgrammingPractice | /C++/simple_programs/useOfStatic/tcpp_pg443_1.cpp | UTF-8 | 626 | 3.328125 | 3 | [] | no_license | #include <iostream>
using std::cout; using std::endl;
int
returnNextElement(int *arg = NULL){
static int *ptr = NULL;
if(arg){
ptr = arg;
if( *ptr == -1 ){
}
return *ptr;
}
ptr += 1;
if(*ptr == -1){
return (-65535);
}
return *ptr;
}
int
main(int ar... | true |
218b6ad32ba8e286e73d968319dcbdb9f42e6cd1 | C++ | zhouliyfly/MyLeetCode | /39.h | GB18030 | 2,005 | 3.4375 | 3 | [] | no_license | #ifndef _39_H //ܺ
#define _39_H
#include <vector>
//֣ targetΪ鷳ࣩܶ
class Solution_39 {
public:
std::vector<std::vector<int>> combinationSum(std::vector<int>& candidates, int target) {
if (candidates.empty())
return res;
std::vector<int> vec;
findcombinationSum(candidates, target, 0, vec);
return res;
}
pri... | true |
4276148d0d745151db19e02f80b013c9d1d6826e | C++ | dhoule/sketch_statusesupdate | /sketch_statusesupdate.ino | UTF-8 | 3,159 | 3.1875 | 3 | [] | no_license | /*
SendATweet
Demonstrates sending a tweet via a Twitter account using the Temboo Arduino Yun SDK.
This example code is in the public domain.
*/
#include <Bridge.h>
#include <Temboo.h>
#include "TembooAccount.h" // contains Temboo account information
#include "TwitterAccount.h"
/*** SUBSTITUTE YOUR VALUES B... | true |
92c917587de8f61dc67aabe24aa60821fc3a37b3 | C++ | bimomuhamadr/MONITOR_UDARA | /Test_MQ7.ino | UTF-8 | 862 | 3.046875 | 3 | [] | no_license | #define pinSensor 36 // mendefinisikan bahwa pin yang digunakan
// untuk membaca sensor adalah pin A0
void setup()
{
Serial.begin(9600);
}
long RL = 1000; // 1000 Ohm
long Ro = 830; // 830 ohm ( SILAHKAN DISESUAIKAN)
void loop()
{
int sensorvalue = analogRead(pinSensor); // membaca nilai ADC dari s... | true |
b7c4e00edff601ef91bd9fbda9ea353f7b77d539 | C++ | sageslayers/CP | /AtCoder/ABC160/E.cpp | UTF-8 | 1,767 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std ;
int main () {
ios_base::sync_with_stdio;
cin.tie(0) ;
cout.tie(0) ;
int x , y , a, b , c ;
cin >> x >> y >> a >> b >> c ;
vector <int> red(a) ;
vector <int> blue(b);
vector <int> nocolor(c);
for ( int i = 0 ; i < a ; i ++ )
cin >> red[i] ;
for... | true |
4097c46751482013eb734d377495c01b6f557e51 | C++ | andresfelipehenao/proyecto | /Estudiante.cpp | UTF-8 | 918 | 2.9375 | 3 | [] | no_license | #pragma once
#include "Estudiante.h"
Estudiante::Estudiante()
{
}
Estudiante::Estudiante(int identificador, string nombre, int telefono, int multa)
{
this->identificador=identificador;
this->nombre=nombre;
this->telefono=telefono;
this->multa=multa;
}
Estudiante::~Estudiante()
{
... | true |
4922ffa4f89f82014992fb7d49dc92fc1d2a7650 | C++ | countryhu/algorithm | /now_coder/cracking_the_code_interview/9_recursion/8_countWays.cc | UTF-8 | 1,345 | 3.640625 | 4 | [] | no_license | #include <iostream>
#include <map>
#include <deque>
using namespace std;
/**
题目描述
有数量不限的硬币,币值为25分、10分、5分和1分,请编写代码计算n分有几种表示法。
给定一个int n,请返回n分有几种表示法。保证n小于等于100000,为了防止溢出,请将答案Mod 1000000007。
测试样例:
6
返回:
2
-------
题目分析
**/
class Coins {
public:
int countWays(int n) {
int coins[4] = {1,5,10,25}... | true |
4bf8030857069bb3663708d9fe48433d48c72084 | C++ | guangmushikong/AirplaneView | /mypolygon.h | UTF-8 | 870 | 2.546875 | 3 | [] | no_license | #ifndef MYPOLYGON_H
#define MYPOLYGON_H
#include <QPolygonF>
#include <QPointF>
#include <QLineF>
class mypolygon
{
public:
mypolygon();
const QPolygonF getCore(){ return _core; }
void setCore(const QPolygonF& core){ _core = core; }
void optimizeCoord(QPointF _trans, double _scale);
private:
QPolygonF _cor... | true |
edbb7271cdbd24bc27043ff5ca6c1b811292223e | C++ | herumi/misc | /slow_sin.cpp | UTF-8 | 751 | 2.78125 | 3 | [] | no_license | /*
cl /EHsc /Ox /Ob2 /fp:fast /Zi slow_sin.cpp
cl /EHsc /Ox /Ob2 /fp:fast /arch:AVX /Feslow_sin_avx.exe /Zi slow_sin.cpp
Core i7-2600 3.4GHz / Windows 7 Ultimate
VS2012(x64) VS2013(x64)
slow_sin 1.33 1.34
slow_sin_avx 1.33 6.27
*/
#include <stdio.h>
#include <ma... | true |
d3c0d5dd09129ebb7ac24fcd7545416831943caa | C++ | WelsonP/sorceryGame | /concreteminion.h | UTF-8 | 688 | 2.609375 | 3 | [] | no_license | #ifndef __CONCRETEMINION__
#define __CONCRETEMINION__
#include "minion.h"
class ConcreteMinion final: public Minion {
public:
/* void attack(int dmg) override;
void attack(int, int) override;
void getAttacked() override;
void die() override;*/
// TODO const, param names
//void notify(Subject &whoFrom) o... | true |
f56ce1a8732363c708821e779870b65f4c46dd15 | C++ | vaaleyard/coding4fun | /Algar/CodePit/soma_fat.cpp | UTF-8 | 927 | 3.21875 | 3 | [] | no_license | /*
*
* Leia dois valores inteiros M e N indefinidamente. A cada leitura, calcule e escreva a soma dos fatoriais de cada um dos valores lidos. Utilize uma variável apropriada, pois cálculo pode resultar em um * valor com mais de 15 dígitos.
*
* Entrada
* O arquivo de entrada contém vários casos de teste. Cada caso... | true |
3b1104cb3f38602818178cc6ded8d2f403a23138 | C++ | ArtSin/OOP_Task4 | /ElectricalCircuitCalculator.cpp | UTF-8 | 18,515 | 2.703125 | 3 | [] | no_license | #include <QQueue>
#include "ElectricalCircuitCalculator.h"
#include "ElectricalElementsManager.h"
// Нахождение лидера компоненты в СНМ
QPoint ElectricalCircuitCalculator::dsuLeader(QPoint u)
{
// Нахождение лидера с эвристикой сжатия путей
return (dsuParent[u] == u) ? u : (dsuParent[u] = dsuLeader(dsuParent[... | true |
c14f2346eddd7b50a8e828e1235ef2581a39625f | C++ | zhanggyb/skland | /include/skland/core/rect.hpp | UTF-8 | 7,456 | 3.21875 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2016 Freeman Zhang <zhanggyb@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applic... | true |
449d83f2fc0823217b0ee9daa54f50de2ff2171b | C++ | patricksinclair/FinalTangle | /src/TangleRunAction.cc | UTF-8 | 3,285 | 2.53125 | 3 | [] | no_license | #include "TangleRunAction.hh"
#include "G4Run.hh"
#include "G4Threading.hh"
#include "G4AutoLock.hh"
#include <cassert>
#include <fstream>
TangleRunAction *TangleRunAction::fpMasterRunAction = 0;
std::vector<std::vector<TangleRunAction::Data> *> TangleRunAction::fPointers;
std::vector<std::vector<TangleRunAction::cry... | true |
1046242d259ccf1821dc0cfd12f0257f210bcaeb | C++ | marrusian/C | /Programare Procedurala/Solutiile ecuatiei x^2-y^2=k.cpp | UTF-8 | 1,595 | 2.90625 | 3 | [] | no_license | #include<iostream>
#include<cmath>
int main(void)
{
using namespace std;
int k = 0, sir_divizori[100] = {}, counter = 2;
sir_divizori[1] = 1;
cout << "Introduceti un numar intreg: ";
cin >> k;
if((k%2 == 0) && ((k%4) != 0))
cout << "Ecuatia nu are solutii intregi";
else if(k%2 == 1)
{
bool flag = tru... | true |