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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
8edafe31e74867dd0b0450de1b05b78a39052380 | C++ | tvrandhavane/cs293Project | /finalCode.cpp | UTF-8 | 20,282 | 2.96875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <list>
#include <string>
#include "block.h"
#include "complex.h"
#define PI 3.14159265
#define Flow 40
#define Fhigh 15000
using namespace std;
//Little endia... | true |
9fab14dfa5afd95dd3bfd348af3dfe1f272918e9 | C++ | mPorst/cppGameEngine | /sdlBlubb/forces.cpp | UTF-8 | 375 | 2.765625 | 3 | [] | no_license | #include "forces.h"
void applyForce(physicsObject object, glm::vec3 force) // make object move
{
object.setSpeed( object.getSpeed() + accelerationFromForce(object, force) ); // acceleration from force needs to be multiplied by frametime ! Frametimemanager !!!
}
glm::vec3 accelerationFromForce(physicsObject object, g... | true |
00362bf080e17bba53a2600a389d122101f3ddca | C++ | p-robot/gridsim | /include/Node.h | UTF-8 | 3,160 | 3.40625 | 3 | [
"CC-BY-4.0"
] | permissive | #ifndef NODE_H
#define NODE_H
#include "Point.h"
#include "Config.h"
class Cell;
class Grid;
/**
Describes one node in the landscape. Status is described
as an integer, 0 = susceptible, 1 = exposed, 2 = infectious,
3 = detected, 4 = removed.
*/
class Node
{
public:
/**
Construct using x and y coor... | true |
ab7024035c69db34f0fcc315000897764330b16b | C++ | R4GH4V/geeksforgeeks-Practise | /School/Print 1 to n without using loops.cpp | UTF-8 | 544 | 3.484375 | 3 | [] | no_license | /*
Print numbers from 1 to n without the help of loops.
Input:
The first line of the input contains T denoting the number of testcases. First line of test case contain number n.
Output:
Numbers from 1 to n will be printed.
Constraints:
1 <=T<= 100
1 <=N<= 990
Example:
Input:
1
10
Output:
1 2 3 4 5 6 7 8 9 10... | true |
28fd2baf6bae8698188e1d9ae22b7ad929c40274 | C++ | cauassa/AED1_2016-2 | /equipe3/Eqp3_q8.cpp | ISO-8859-1 | 1,148 | 3.375 | 3 | [] | no_license | //Lista 1 - Reviso
//Questo 8 - Dada uma matriz real Amxn, verificar se existem elementos repetidos em A.
using namespace std;
#include <cstdlib>
#include <iostream>
#include <iomanip>
#define MAX 100
main(){
int matriz[2][2], i, j, k, elementos[MAX], repetidos[MAX], cont1, cont2;
cout << "D... | true |
3e7f34ae7e35348ef3f35e0aa42088587166ce15 | C++ | daniil6/RBKLib | /src/read_file.cpp | UTF-8 | 964 | 3.234375 | 3 | [] | no_license | #include <fstream>
#include <vector>
std::string ReadFileS(std::string line)
{
setlocale(LC_ALL, "Russian");
std::ifstream in(line); // Open file for read
if(in.is_open())
getline(in, line);
in.close(); // Close file
return line;
}
std::string ReadFileL(std::string line)
{
setlocale... | true |
bf3493489ead4d218443135ebc20060c57b8c826 | C++ | GiovanniMarchetto/advanced_programming_exam_2020 | /src/bst.cpp | UTF-8 | 11,731 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include <utility> // std::forward, move
#include <string>
#include <sstream>
#include "Node.h"
#include "Iterator.h"
#include "ap_error_ext.h"
#include "bst.h"
#ifndef ADVANCED_PROGRAMMING_EXAM_2020_BST_CPP
#define ADVANCED_PROGRAMMING_EXAM_2020_BST_CPP
template <typename value_type, typename... | true |
f67d116c632c7118e49989c7068076c0aad1bbe8 | C++ | ZhenyingZhu/ClassicAlgorithms | /src/CPP/src/epi/chapter17/LongestNondecreasingSubsequenceLength.cpp | UTF-8 | 1,698 | 3.375 | 3 | [] | no_license | #include "LongestNondecreasingSubsequenceLength.hpp"
#include <vector>
#include <iostream>
#include <stdexcept>
#include <cassert>
#include "../../MyUtils.h"
using std::vector;
using std::cout;
using std::endl;
namespace epi {
namespace chapter17 {
int LongestNondecreasingSubsequenceLength::findNextIdxOfLastN... | true |
6d32d2c2ec3da1dbc2dff502f621b0ff878647fd | C++ | alanrpfeil/Tic-Tac-Toe-OpenGL- | /Rect.h | UTF-8 | 750 | 3.078125 | 3 | [] | no_license | #ifndef Rect_h
#define Rect_h
#include <iostream>
using namespace std;
struct Rect{
float x, y, w, h;
bool isused;
char occupied;
Rect() {
x = 0.0, y = 0.0, w = 0.0, h = 0.0, isused = 0, occupied = ' ';
}
void Rec(float xcoord, float ycoord, float wcoord, float hcoord) {
x = xcoord, y ... | true |
82ab67b8ae0d3456e91041515a930d21a623352d | C++ | Weinsen/neurotick | /source/connector.cpp | UTF-8 | 2,474 | 2.53125 | 3 | [] | no_license | #include "connector.hpp"
namespace neurotick {
// void Connector::connect(Model& model, std::string receptor, std::string layer)
// {
// std::vector<NeuronBase *>* neurons1 = model.getLayer(receptor).getNeurons();
// std::vector<NeuronBase *>* neurons2 = model.getLayer(layer).getNeurons();
// for (auto n... | true |
3227ba6ac30faae21b0bc8252f342ba3b233a12c | C++ | schlomer/ripper | /rips/rip_data_database.cpp | UTF-8 | 1,126 | 2.6875 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | /**************************************
Rip Server (C) 2019 Shannon Schlomer
**************************************/
#include "pch.h"
using namespace rip;
using namespace rip::data;
// database
database::database(std::string name) : name(name)
{
}
std::shared_ptr<container> database::add_container(std::string _... | true |
0cea3b0e2b0aada29a575dadd9dbbe26b3b102ed | C++ | jgilbertfpv/rcjoy | /RCJoy/STM32F407DISC_RC_JOY/EEPRom.cpp | UTF-8 | 3,830 | 2.828125 | 3 | [] | no_license | #include "EEPRom.h"
static inline int16_t changeEndianness(int16_t val)
{
return (val << 8) | ((val >> 8) & 0x00ff);
}
static inline uint16_t changeEndianness(uint16_t val)
{
return (val << 8) | ((val >> 8) & 0x00ff);
}
static inline int32_t changeEndianness(int32_t val)
{
return (val << 24) |
((val << 8) ... | true |
c81fa5c3f6732635f46c86d19bf746773620746f | C++ | nuts4nuts4nuts/CSI281 | /Practice Project 2 - LLs/term.h | UTF-8 | 1,232 | 3.40625 | 3 | [] | no_license | /*Author: David Johnston
Class: CSI-281-01
Assignment: pa 2
Date Assigned: 9/5/13
Due Date: 9/12/13 - 12:30
Description: The purpose of this program is to recieve two polynomials from the user and add them together using a linkedlist backbone.
Certification of Authenticity:
I certify that this assignment is entirely my... | true |
57f47fc15547408d825d65fb9b79d3d3f44fdf91 | C++ | TapanManu/cprogs | /cpp/math/trailzeros.cpp | UTF-8 | 225 | 3.171875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int trailzeroes(int n){
return n==0?0:n/5+trailzeroes(n/5);
}
int main(){
//no of trailing zeros in factorial of number
int factnum = 9;
cout<<trailzeroes(factnum);
}
| true |
3789a2d7b3548d8e988eda55b5afec195a02bed1 | C++ | idontknoooo/my-code | /advanced-cpp/lec/Exception_examplecode/numeric_example1.cpp | UTF-8 | 2,877 | 2.984375 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<sstream>
#include<string>
#include<vector>
#include<numeric>
#include<cmath>
#include<ctype.h>
using namespace std;
struct CalcResult{
double ret1, ret2;
double vol1, vol2, corr;
};
double ret_calc(const double& p1, const double& p2);
void read_stock_px(vector<d... | true |
9c157022ae3d359574c163e33a67a0bbf22ceb6d | C++ | DaniSchechter/Protobuf-Stripper | /src/ftpBridge.hpp | UTF-8 | 990 | 2.515625 | 3 | [] | no_license | #ifndef FTP_BRIDGE_HPP_
#define FTP_BRIDGE_HPP_
#define SECURE_UPGRADE_MESSAGE "234 Proceed with negotiation"
#include "bridge.hpp"
#include "ftpsBridge.hpp"
class FtpBridge: public Bridge<HttpSocketType>
{
public:
// Construct an Http bridge with a given client socket
// On which the bridge connector accep... | true |
ee665cb87a80f5f03a107107678614c717100690 | C++ | JoselingFH/Estructuras-repetitivas | /Seccion 4 ejercicio 6.cpp | WINDOWS-1250 | 530 | 3.875 | 4 | [] | no_license | //6.Escriba un programa que calcule X elevado a Y, donde tanto x como y son enteros positivos, sin utilizar la funcin pow.
#include<iostream>
#include<stdlib.h>
using namespace std;
int main(){
int x,y,i,solucion = 1;
cout<<"\tPrograma para hacer potencias.\n";
cout<<"Introduce la base de la potencia x: ";... | true |
2f3a3ee7bf36b30410e0f4dcbfdafc855c09fbe6 | C++ | NikDelhi/Carrom | /src/walls.cpp | UTF-8 | 767 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "header.h"
using namespace std;
int Wall :: getPos()
{
return no;
}
Hole Wall :: getHole1()
{
return hole1;
}
Hole Wall :: getHole2()
{
return hole2;
}
double Wall :: getLength()
{
return length;
}
double Wall :: getWidth()
{
return width;
}
double Wall :: getHeight()
{
return heig... | true |
f384416d0323a224d0abe9926ad540c95ca858c0 | C++ | ShnapDozer/LB4 | /LR4/LR4.cpp | UTF-8 | 1,409 | 3.21875 | 3 | [] | no_license | #include "pch.h"
#include <iostream>
#include <stdio.h>
using namespace System;
const int n = 5, m = 5;
void input(array<int, 2>^ a, Random^ rnd)
{
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
a[i, j] = rnd->Next() / 10000000 -
100;
Console::Write(L"{0,4} ", a[i, j]);
}
Console::... | true |
eceed460941acb55ccbac47e553a1dd87a542eb2 | C++ | fulstock/prak4sem | /up09-1.cpp | UTF-8 | 860 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <string>
// S -> XY
// X -> aXb | ab
// Y -> PY1 | P1
// bP -> Pb
// aP -> a0
// 0P -> 00
int check (std::string str)
{
size_t idx = 0;
int flag = 1;
size_t len = str.length();
int n = 0;
int m = 0;
while (idx < len && str[idx] == 'a') {
idx++;
n++;... | true |
1ed57c1e4ad4882fb9523c252b9d5054fbd433f3 | C++ | rahulsoibam/freenexus | /src/base/settingsstorage.h | UTF-8 | 767 | 2.546875 | 3 | [] | no_license | #ifndef SETTINGSSTORAGE_H
#define SETTINGSSTORAGE_H
#include <QObject>
#include <QVariantHash>
#include <QTimer>
#include <QReadWriteLock>
class SettingsStorage: public QObject
{
Q_OBJECT
SettingsStorage();
~SettingsStorage();
public:
static void initInstance();
static void freeInstance();
st... | true |
5c130ad6640b317e375b8414efe1fcc3e2ff1a1d | C++ | LBONTEN/LNJ_DREAMTEAMFEVER | /src/Tests/XMLParserTests.h | UTF-8 | 5,353 | 2.546875 | 3 | [] | no_license | /* Created by Joren Van Borm & Lenny Bontenakel
*/
#ifndef LNJPSE_PROJECT_XMLPARSERTESTS_H
#define LNJPSE_PROJECT_XMLPARSERTESTS_H
#include "../RoadSystem.h"
#include "../XMLParser.h"
#include "../Output.h"
#include "fileHelpers.h"
#include <gtest/gtest.h>
#include <algorithm>
#include <fstream>
/**
* Test fixtu... | true |
344f912af2ebb9af97f16735df0a50a642ef4d74 | C++ | manofmountain/LeetCode | /236_LowestCommonAncestorOfABinaryTree.cpp | UTF-8 | 2,445 | 3.515625 | 4 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
//3.39%
class Solution {
public:
TreeNode* lowestCommonAncestor(TreeNode* root, TreeNode* p, TreeNode* q) {
... | true |
9fc37af357d625d376a715e050bdd9406723e96d | C++ | azurite/numCSE18-code | /final_exam_fs18/1/1.cpp | UTF-8 | 3,237 | 2.90625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <vector>
#include <chrono>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
using namespace Eigen;
MatrixXd quadraticSpline(const VectorXd &x, const VectorXd &y) {
int N = x.size()-1;
MatrixXd out(N, 3);
VectorXd delta_x = x.tail(N) - x.head(N);
VectorXd delta_x2 = (delta... | true |
ae62a33053771dd70d26c03d94a43e692b37ec90 | C++ | nandita-manchikanti/DAA-lab-codes | /WEEK2/Ques3.cpp | UTF-8 | 2,213 | 3.578125 | 4 | [] | no_license | #include<iostream>
#include <bits/stdc++.h>
using namespace std;
void pattern1(int n)
{
cout<<"Pattern-1"<<endl;
int i;
int j;
for(i=n;i>=1;i--)
{
for(j=1;j<=i;j++)
{
cout<<j<<" ";
}
cout<<"\n";
}
cout<<"\n";
}
void pattern2... | true |
b4a0a733191694e8d04c0fa1760c8438210dcecb | C++ | samueljrz/Competitive-Programing | /NepsAcademy/Programação Básica - 1/Controlando Código/Repetição/Todos Div.cpp | UTF-8 | 306 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
using namespace std;
int main () {
int x=0, *v, count=0;
cin >> x;
v = (int *) malloc(x*sizeof(int));
for(int i=1; i<=x; i++){
if((x % i) == 0){
v[count] = i;
count++;
}
}
for(int i=0; i<count; i++){
cout << v[i];
cout << " ";
}
return 0;
} | true |
6de1ce3a3e07e1604be194bdf3af260609884363 | C++ | OIdiotLin/problemset | /BZOJ/3240.cpp | UTF-8 | 1,942 | 2.609375 | 3 | [] | no_license | /*
Machine: Class4_B2
System: Windows7 SP1 32bit
*/
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <ctime>
#include <algorithm>
typedef long long LL;
using namespace std;
#define SpeedUp ios::sync_with_stdio(false)
#define Judge
//#define Debug
#d... | true |
cf5a519231a3502b0f791d1542eb2734d62f0b7f | C++ | lede701/yaag | /TheArena/AIMonster.cpp | UTF-8 | 2,708 | 2.921875 | 3 | [] | no_license | #include "AIMonster.h"
#include "CharacterData.h"
namespace Game{ namespace Entity{ namespace Monsters{ namespace AI
{
AIMonster::AIMonster(LPVECTOR2D player, LPVECTOR2D me, LPVECTOR2D exit)
{
_player = player;
_me = me;
_attackPos = me->Clone();
_exit = exit;
_doIFlee = false; // Of course I don't flee ... | true |
4ce1231ae894e89b4c5474c47e0688ef7c1462e2 | C++ | rlaxoghd94/Algorithm_Study | /backup-old_study/Baekjoon/DFS/10026.cpp | UTF-8 | 1,745 | 3.140625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#define MAX_N 101
int N;
char map[MAX_N][MAX_N];
bool visited[MAX_N][MAX_N] = { false };
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int cntBefore = 0, cntAfter = 0;
bool isColorBlind = false;
void resetVisited(){
for (int i = 0; i < N; i++)
for (... | true |
94b7872f743f1a823b3dddacc394099bb19a34f5 | C++ | ArnabBir/interviewbit-solutions | /ListCycle.cpp | UTF-8 | 863 | 3.28125 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
ListNode * getStartNode(ListNode * ptr , ListNode * A){
ListNode * temp1 = ptr;
ListNode * temp2 = ptr;
int k = 1;
while(temp1->next != temp2)... | true |
3a163fd7ea6d14334e2600c0fe990b12eb69613f | C++ | Py-Contributors/AlgorithmsAndDataStructure | /C++/Algorithms/Maths/maxPairwiseProduct.cpp | UTF-8 | 2,648 | 4.125 | 4 | [
"MIT"
] | permissive | /*
Find the maximum product of two distinct numbers in a sequence of non-negative integers
Input: A sequence of non-negative integers
Output: The maximum value that can be obtained by multiplying two different elements from the sequence.
Input format. The first line contains an integer n. The next line ... | true |
488d8c8d0e216d8f0057a4bf79c255afb2a42726 | C++ | eedowdy/Choreograph | /samples/src/pockets/cobweb/ButtonBase.cpp | UTF-8 | 2,685 | 2.640625 | 3 | [
"BSD-2-Clause"
] | permissive | //
// ButtonBase.cpp
// WordShift
//
// Created by David Wicks on 4/24/13.
// Copyright (c) 2013 __MyCompanyName__. All rights reserved.
//
#include "ButtonBase.h"
using namespace cinder;
using namespace pockets;
using namespace cobweb;
ButtonBase::ButtonBase( const Rectf &bounds ):
mHitBounds( bounds )
{}
Butt... | true |
2510622a7f35cabeb327dcf52b16c24338da409a | C++ | TDCRanila/IGART-BT | /AI/BT/Nodes/composite_node.cpp | UTF-8 | 684 | 2.6875 | 3 | [] | no_license | #include <AI\BT\Nodes/composite_node.h>
CEREAL_REGISTER_TYPE(iga::bt::CompositeNode)
CEREAL_REGISTER_POLYMORPHIC_RELATION(iga::bt::BaseNode, iga::bt::CompositeNode)
/**
* igart namespace
*/
namespace iga {
namespace bt {
CompositeNode::CompositeNode() {
this->node_type_ = NodeType::COMPOSIT... | true |
56c45000e0f1eeca5476d96a530916e141ace1d4 | C++ | 0x1un/wintools | /wintools/utils.cpp | UTF-8 | 2,335 | 2.78125 | 3 | [
"Apache-2.0"
] | permissive | #include "utils.h"
#include <iostream>
using namespace std;
string get_md5(LPCWSTR filename);
string Utils::md5sum_file(LPCWSTR in)
{
return get_md5(in);
}
string get_md5(LPCWSTR filename)
{
DWORD dwStatus = 0;
BOOL bResult = FALSE;
HCRYPTPROV hProv = 0;
HCRYPTHASH hHash = 0;
HANDLE hFile = NULL;
BYTE rgbFi... | true |
5ffa4d89d394e56a8360e3f9dad18cf785d2620b | C++ | shivammaheshwari9837/Data-Structures-and-Algorithms-C-plus-plus | /Linked List/Multiply two linked list.cpp | UTF-8 | 416 | 3.109375 | 3 | [] | no_license | /*
Ques :- Multiply two linked list in O(1) space..
*/
long long multiplyTwoLists (Node* l1, Node* l2)
{
//Your code here
Node *p = l1;
ll n1 = 0,n2 = 0;
while(p!=NULL)
{
n1 = ((n1*10)%mod + (p->data)%mod)%mod;
p = p->next;
}
p = l2;
while(p!=NULL)
{
n2 = ((n2*10)%mod + ... | true |
a4b0edf61a107135e14528e79e1106056843bcb5 | C++ | GuilhermeWillahelm/DataStructure | /SelectionSort/SelectionSort/SelectionSort.cpp | ISO-8859-1 | 2,120 | 3.203125 | 3 | [] | no_license | // SelectionSort.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <locale>
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;
void selectionSort(int vet[], int tam);
void printVector(int vet[], int tam);
int main()
{
setlocale(LC_ALL, ... | true |
b3f5d7d0863e47bc01fb80bc710becd02cfc04bf | C++ | eujuu/Algorithm | /baekjoon/백준 1011 Fly me to the Alpha Centauri.cpp | UTF-8 | 442 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
int main() {
using namespace std;
long long T, x, y, cnt, i, length;
cin >> T;
for (int j = 0; j < T; j++) {
cin >> x >> y;
i = 1;
length = y - x;
for (;; i++) {
if (i * i > length)
break;
}
if ((i - 1)*(i - 1) == length)
cnt = 2 * (i - 1) - 1;
else if ... | true |
af3bec03371f5e7e064dfd5c12afbf679c942fe6 | C++ | Anthonykung/KidSpirit-Coding-In-Action-Intro | /terminal.cpp | UTF-8 | 1,956 | 2.734375 | 3 | [] | no_license | /***********************************************************************
* ** Program Filename: terminal.cpp
* ** Author: Anthony Kung (Anthony.lol)
* ** Date: 14 April 2019
* ** Description: Key logger
* ** Have an awesome day!
* ** Input: User input, numbers/strings, text files
* ** Output: Numbers/stri... | true |
6dadd1c970ea29c582dded2a4ff5c223a3cfceb0 | C++ | salom12/google-hashcode | /PracticeRound/pizza.cpp | UTF-8 | 6,145 | 3.46875 | 3 | [] | no_license | /*
* Google HashCode 2017
* Practice Problem - Pizza
*/
#include <iostream>
#include <vector>
#include <fstream>
#include <cmath>
using namespace std;
typedef unsigned int uint;
/* Finds all ordered pairs of numbers whose product is n
*/
vector<pair<uint, uint>> find_products(uint n) {
vector<pair<uint, u... | true |
b3768d36e8c188d33ff6f1242939eea12ee4a04a | C++ | qsnake/deal.II | /include/deal.II/integrators/local_integrators.h | UTF-8 | 5,608 | 2.6875 | 3 | [] | no_license | //---------------------------------------------------------------------------
// $Id: local_integrators.h 24574 2011-10-07 23:03:53Z bangerth $
//
// Copyright (C) 2010, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Pl... | true |
d9379d5f7e69d65f91ba8768d5d9ab5ac5164668 | C++ | arnabxero/online-judges-problem-solutions | /Codeforces/Contests/0935/D-2.cpp | UTF-8 | 1,468 | 2.65625 | 3 | [] | no_license | // Problem name: Fafa and Ancient Alphabet
// Problem link: https://codeforces.com/contest/935/problem/D
// Submission link: https://codeforces.com/contest/935/submission/35504187
#include <bits/stdc++.h>
#define MAX ((int)100000)
#define MOD ((ll)1000000007)
#define endl '\n'
using namespace std;
typedef long long... | true |
dd904de6914408d8f281f3ca57a21e397e30181c | C++ | phoenix76/final_project | /calculate/oop_calculate/WinForm_old.cpp | WINDOWS-1251 | 9,255 | 2.5625 | 3 | [] | no_license | #include "WinForm.h"
void cWinForm::Run()
{
MSG msg;
while(GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
UnregisterClass("Calculator", m_hInstance);
DestroyWindow(m_mainWnd);
}
bool cWinForm::Initialize()
{
m_mainWnd = NULL;
test = "test";
for(short count = 0; count < 21... | true |
78bed2a730e61eb05070c3b07efa8975cda468a1 | C++ | iShubhamRana/DSA-Prep | /DP-patterns/Decision-Making/02-house-robber-2.cpp | UTF-8 | 1,276 | 2.828125 | 3 | [] | no_license | class Solution
{
int HouseRobberOne(vector<int> &A, int start, int end)
{
if (start > end)
return 0;
int robPrev = A[start], doNotRobPrev = 0;
for (int i = start + 1; i <= end; ++i)
{
int robCurr = A[i] + doNotRobPrev;
int doNotRobCurr = max(ro... | true |
da217ba73b4311c38e7b064125a1610203b7c71e | C++ | arieshan/OperatingSystem | /Bus_Simulation/projects/BUSSIMULATION_Optimization/CS520_HomeWork2_BUSSIMULATION/Event.h | UTF-8 | 1,349 | 3 | 3 | [] | no_license | /* * * * * * * * * * * * * * * * * * * * * * * * *
* course : CS_520 *
* First Name : Xiao *
* Second Name : Li *
* CWID : 10409766 *
* Subject : Home_work_2 Bus_Simulation *
* * * * ... | true |
71a6505a4ad351dc077e602882a6f3d166238fd5 | C++ | musakhan18/OOP | /OOP Assignment 2/OPP Assignment 2/Task 1/Date.cpp | UTF-8 | 2,278 | 3.515625 | 4 | [] | no_license | #include "Date.h"
Date::Date()
{
Day = 01;
Month = 01;
Year = 2000;
}
Date::Date(int D, int M, int Y)
{
Day = D;
Month = M;
Year = Y;
}
Date::Date(const Date& other)
{
Day=other.Day;
Month=other.Month;
Year=other.Year;
}
bool Date::validatedate()const
{
bool Valid;
if (Day <= ... | true |
d7f2f2d7b45e4de31e178573090a28488fed2d81 | C++ | Skr1mpl/Voenkomat | /Checks.cpp | WINDOWS-1251 | 9,093 | 2.78125 | 3 | [] | no_license | #include "Checks.h"
void setColor(int text, int background) {
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hStdOut, (WORD)((background << 4) | text));
}
string encryptPass(string pass) {
string encrypt;
for (int i = 0; i < pass.length(); i++) {
char c = pass[i];
c... | true |
8c215c0908949286e2edd3fed5f44e21a4b66eab | C++ | SilverHL/Leetcode | /931.下降路径最小和.cpp | UTF-8 | 1,210 | 2.6875 | 3 | [] | no_license | #include <vector>
#include <climits>
using namespace std;
/*
* @lc app=leetcode.cn id=931 lang=cpp
*
* [931] 下降路径最小和
*/
// @lc code=start
class Solution {
public:
int minFallingPathSum(vector<vector<int>>& A) {
if (A.empty()) return 0;
int n = A.size();
if (n == 1)
retur... | true |
8688896e5b12d75a84f5860e8ca9087b5b580c94 | C++ | d-nalbandian0329/cpp | /normal/test3_28.cpp | UTF-8 | 610 | 3.546875 | 4 | [] | no_license | // コンテナを継承してパラメータ化継承によってメンバを追加する
#include <iostream>
#include <vector>
#include <list>
template <class Base>
class Printable : public Base {
public:
using Base::Base;
std::ostream& print_on(std::ostream& stream,
const char* delim = " ") const {
for (const auto& x : *this) {
stream << x << delim;
}
r... | true |
cb2c9ae7a12d13ec2b5f4639a4ad21b4df033e26 | C++ | GenguoWang/CppLib | /test/testSegTree.cpp | UTF-8 | 702 | 2.546875 | 3 | [] | no_license | #include "../SegTree.h"
void testSegTree()
{
int pos[10001];
memset((void*)pos,0,sizeof(pos));
pos[0] = 1;
pos[10000] = 1;
kingo::SegTree st(0,10000);
st.insert(0);
st.insert(10000);
int tests = 1000,l,r;
while(tests--)
{
int num = rand()%9000+1;
if(pos[num]) cont... | true |
2a84a7a7f287f496017b868dd079fcbdc7cca6d7 | C++ | abonifacio/juego-sensor-mov | /sensor/sensor.ino | UTF-8 | 2,020 | 2.984375 | 3 | [
"MIT"
] | permissive | /*
Sensor de proximidad y al ser inferior a 10cm
envia un pulso de alarma por el pin 13
HC-SR04 conexiones:
VCC al arduino 5v
GND al arduino GND
Echo al Arduino pin 6
Trig al Arduino pin 7
Descargar planos de conexiones en http://elprofegarcia.com/
*/
#define Pecho 6
#define Ptrig 7
#define CANT_MUESTR... | true |
28e5572edd292526ac7fd4899e148f8473d8006b | C++ | curtisbright/swinekeeper | /minesolver/CInputField.cpp | UTF-8 | 1,552 | 2.9375 | 3 | [] | no_license |
#include "StdAfx.h"
#include "CInputField.h"
#include "CMineArray.h"
std::string CInputField::toString() const {
if (m_nIsKnownBomb)
return std::string("B");
else if (m_bCovered)
return std::string("C");
else
{
char str[2];
str[0] = '0' + m_nCount;
str[1] = 0;
... | true |
26a2cbb44b621c4558377bdba3302d63c9ea5300 | C++ | MTASZTAKI/ApertusVR | /include/apeQuaternion.h | UTF-8 | 8,394 | 2.640625 | 3 | [
"LicenseRef-scancode-free-unknown",
"MIT"
] | permissive | /*MIT License
Copyright (c) 2018 MTA SZTAKI
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dist... | true |
da77b32949ef4aca7bc56eee4fbbc94c81103ca8 | C++ | emilymye/shippingnetwork | /Instance.cpp | UTF-8 | 28,005 | 2.515625 | 3 | [
"BSD-3-Clause"
] | permissive | #include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <cctype>
#include "Nominal.h"
#include "Instance.h"
#include "ActivityImpl.h"
#include "Engine.h"
#include "Entity.h"
#include "Reactors.h"
//#include "EntityReactor.h"
using names... | true |
2239cb8b1473fecd4b2494af65ce763c789a3cb5 | C++ | ramsharan072011/arduino-sketches | /UtraSonicSensor/UtraSonicSensor.ino | UTF-8 | 1,541 | 2.5625 | 3 | [
"Apache-2.0"
] | permissive | #include <Servo.h>
int trigger = 4;
int echo = 3;
int time=0;
int distance = 7;
float speed;
Servo servo1;
void setup() {
Serial.begin(9600);
pinMode(trigger,OUTPUT);
pinMode(echo,INPUT);
pinMode(2,OUTPUT);//Red
pinMode(6,OUTPUT);//Yellow
pinMode(5,OUTPUT);//Green
pinMode(8,OUTPUT);//Buzzer
servo1.... | true |
8d3aa27effdcfece9db78b8d419b88b8368d93b1 | C++ | sulicat/graphics | /ray_tracer_03/src/projectile.cpp | UTF-8 | 284 | 2.75 | 3 | [] | no_license | #include "../include/projectile.h"
Projectile::Projectile( Tuple _pos, Tuple _vel ){
pos = _pos;
vel = _vel;
}
std::string Projectile::toString(){
std::cout << "Projectile:\n";
std::cout << " pos:\t" << pos << "\n";
std::cout << " vel:\t" << vel << "\n";
return "";
}
| true |
384a84671da4639802d31b94ee650a7e5a8c6973 | C++ | zhangsj1007/leetcode | /210_CourseScheduleII/Solution.hpp | UTF-8 | 1,457 | 3.203125 | 3 | [] | no_license | class Solution {
public:
//1.需要检查dfs是否有环
//2.onpath的使用
//3.reverse的使用
vector<int> findOrder(int numCourses, vector<pair<int, int>>& prerequisites) {
vector<unordered_set<int>> graph = makeGraph(numCourses, prerequisites);
//stack<int> toposort;
vector<bool> visited(numCourses, fa... | true |
fe2e9ffc43f19dadd5c1a6e4b74666900170e4ff | C++ | dingxuan2000/cse100-pa1 | /test/bst/test_BST.cpp | UTF-8 | 7,681 | 3.4375 | 3 | [] | no_license | #include <algorithm>
#include <fstream>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <gtest/gtest.h>
#include "BST.hpp"
#include "util.hpp"
using namespace std;
using namespace testing;
/* Empty BST test starts here */
TEST(BSTTests, EMPTY_TREE_HEIGHT_TEST) {
BST<int> bst;
... | true |
8fa2fa57d7e2a0f5204ba07212d7307caca43103 | C++ | delefme/Algorismia | /1. Backtracking-Permutations/EspeciesIncompatibles.cc | UTF-8 | 1,202 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector<char> CharVec;
typedef vector<int> Vec;
typedef vector<Vec> Taula;
int n, incomp;
CharVec especies;
Taula compatibles;
Vec posats, V;
void escriu() {
for (int i = 0; i < n; ++i) cout << especies[V[i]];
cout << endl;... | true |
d4b436dac55037ecf109ce5bee9a221a88316604 | C++ | soplist/study-c-cpp | /c++/day02/11 time.cpp | GB18030 | 774 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <ctime>
#include <iomanip>//ʽĿͷļ
using namespace std;
class Time{
public:
int h;
int m;
int s;
//1
void dida(){
s++;
if(s==60){ s=0; m++; }
if(m==60){ m=0; h++; }
if(h==24){ h=0;}
}
//ʾʱ
void show(){
cout<<setfill('0');//˼˵0հλ
cout<<setw(2)<<h<<":"<<setw(2)
<<m<<":"<<... | true |
5a4947b03fa58cb0735505556eb57dbe56fc3a8b | C++ | CraigSanto/225Examples | /225examples/arrays/example2.cpp | UTF-8 | 1,091 | 3.796875 | 4 | [] | no_license | #include <iostream>
using namespace std;
/* Declaring DYNAMIC (heap) arrays:
* Note that the initial values of the arrays are 0, and not garbage
* The print method still doesn't like taking in these values.
*
* K: I don't think this is true ^. I ran the code and added a printArr before the for loop
* and the out... | true |
a9f7c2de869a8d765e503bab52dc42bff5059036 | C++ | Antecarlo/CursoC | /modulo3/eclipse/factura_llamadas/Factura.cpp | UTF-8 | 1,854 | 2.96875 | 3 | [] | no_license | /*
* Factura.cpp
*
* Created on: 2 oct. 2019
* Author: antonio
*/
#include "Factura.h"
#include <iostream>
#include <memory>
long Factura::NUM_FACT =1;
Factura::Factura(){
this->numeroFact=0;
this->baseImp=0;
this->iva=0;
}
Factura::Factura(Fecha f, Cliente c,float iva){
this->fecha=f;
this->numeroF... | true |
810aa86b09cbee1254b1478f9fad5c70be24033d | C++ | ryyyyan-taylor/csci2270 | /HW/Assignment6/MovieTree.cpp | UTF-8 | 4,323 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include "MovieTree.hpp"
using namespace std;
MovieTree::MovieTree(){
root = NULL;
}
MovieTree::~MovieTree(){
}
void print(TreeNode *x){
if(x==NULL) {
return;
}
print(x->leftChild);
cout<<"Movies starting with letter:"<< x->titleChar<<endl;
LLMovieNode *n = new LLMovieNode;
n = x->head... | true |
f814b33010531aa53316543c0fc39cbe1d0e1e44 | C++ | mehdithreem/sharifcup | /robotic_logic/Tests/MovingObjTest.cpp | UTF-8 | 714 | 2.578125 | 3 | [] | no_license | #include "../Include/MovingObj.h"
#include "../Include/geometry.h"
void testUpdate() {
MovingObj testObj;
geometry::Vector v(10,10);
std::vector<geometry::Vector> vertices;
// vertices.push_back(geometry::Vector(10,10));
// vertices.push_back(geometry::Vector(0,0));
// vertices.push_back(geometry::Vector(10,4... | true |
116d80d07be42d9dbe8b6bb08bd804329ca06587 | C++ | mandemeskel/CSE180-Robotics-Final | /src/cse180final/make_plan.cpp | UTF-8 | 3,320 | 2.5625 | 3 | [] | no_license | // http://wiki.ros.org/map_server?distro=kinetic
#include <ros/ros.h>
#include <ros/console.h>
#include <nav_msgs/OccupancyGrid.h>
#include <nav_msgs/MapMetaData.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <typeinfo>
#include <fstream>
using namespace std;
#define NODE_NAME "make_plan"
// ... | true |
a46f8a1f4bbb5897d76f81b2d1dd60a183bd738f | C++ | Abiduddin/Competitive-Programming-Codes | /All ACM Codes/net/practice_recursion_5.cpp | UTF-8 | 252 | 2.9375 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
int sum(int i,int j, int k)
{
if(j==0)
return 1;
k=k+pow(i,j)+sum(i,j-1,k);
return k;
}
int main()
{
int i,j,k;
scanf("%d %d",&i,&j);
k=sum(i,j-1,0);
printf("%d\n",k);
}
| true |
1a0545c513048ce0cc0192a711fc3e63e2f93ed3 | C++ | tectronics/diesel2d | /Diesel/collision/CharBuffer.h | UTF-8 | 577 | 2.609375 | 3 | [] | no_license | #ifndef CHARBUFFER_H
#define CHARBUFFER_H
#include <stdio.h>
#include "..\dxstdafx.h"
namespace ds {
class CharBuffer {
public:
CharBuffer(uint32 size);
virtual ~CharBuffer();
void reset() {
m_Index = 0;
m_Total = 0;
}
uint32 size() const {
return m_Total;
}
... | true |
78817bd9e6377566f373dc00e65a41217e52c729 | C++ | YanMario/coding | /code_ping/大数据/bitmap.cpp | UTF-8 | 6,379 | 3.28125 | 3 | [] | no_license | //
// Created by yanpan on 2019/8/11.
//
#if 0
#include <iostream>
using namespace std;
char *g_bitmap = NULL;
int g_size = 0;
int g_base = 0;
//功能:初始化bitmap
//参数: size:bitmap的大小,即bit位的个数
// start:起始值
//返回值:0表示失败,1表示成功
int bitmap_init(int size, int start)
{
g_size = size/8+1; //100个位/8 就是 100/8 + 1 个字节
... | true |
2dcd6617f88334881217603a3b8832c65ae735b2 | C++ | JohnnyGuye/ArenIA | /Prototypes/Base Ogre/Ogre1Test/Gauge.h | UTF-8 | 3,963 | 3.625 | 4 | [] | no_license | #pragma once
/**
* @file Gauge.h
* @author Samory Ka
* @summary : This class represents a simple gauge.
*/
class Gauge
{
//----------------------------------------------------------------- PUBLIC
public:
//-------------------------------------------- Constructors - destructor
/** @brief Copy constructor
... | true |
c3113a77889e2f848148f197705b67aaf0bd8c30 | C++ | lafreak/design-patterns | /include/observer.hpp | UTF-8 | 517 | 3.21875 | 3 | [] | no_license | #pragma once
#include <functional>
#include <list>
template <typename T>
class observable
{
std::list<std::function<void(const T&)>> m_observers;
public:
void attach(const std::function<void(const T&)>&);
void notify();
};
template<typename T>
void observable<T>::attach(const std::function<voi... | true |
5ca87d9b0a37cd2e3f5b348506666898b2112a7e | C++ | projectsf/snippets | /cpp/examples/gridNetExamples/smartnos-developer-platform/smartnosapplicationframework/include/ApplicationEnforcementScheduler.hpp | UTF-8 | 647 | 2.515625 | 3 | [] | no_license | #ifndef APPLICATION_ENFORCEMENT_SCHEDULER_HPP_
#define APPLICATION_ENFORCEMENT_SCHEDULER_HPP_
#include <string>
#include <boost/property_tree/ptree.hpp>
class SmartNosApplication;
class ApplicationEnforcementScheduler
{
public :
enum ScheduleType
{
OneTime,
Periodic,
Unknown
};
ApplicationEnforcemen... | true |
ff6fab87cda6e41df8666c355a7796186ba97aaa | C++ | jpoirier/x-gauges | /Nesis/Instruments/src/Scale.h | UTF-8 | 3,905 | 2.59375 | 3 | [] | no_license | #ifndef INSTRUMENT_SCALE_H
#define INSTRUMENT_SCALE_H
/***************************************************************************
* *
* Copyright (C) 2009 by Kanardia d.o.o. [see www.kanardia.eu] *
* Writen by: ... | true |
1324d910ca4d15f916d4764a4928c96fd7100810 | C++ | lagoon9024/problem-solving | /BOJ/boj16234.cpp | UTF-8 | 1,559 | 2.609375 | 3 | [] | no_license | //boj16234
#include <iostream>
#include <queue>
#include <vector>
#include <cstring>
#include <cmath>
int N, L, R;
int map[50][50];
int dr[4] = { -1, 0, 1, 0 };
int dc[4] = { 0, -1, 0, 1 };
int flag = 0;
int check[50][50];
typedef struct {
int r, c;
}pos;
using namespace std;
void movemove(int r, int c) {
queue<po... | true |
14465b0c401a51d946b25a47bd5101b297e0c415 | C++ | lmarent/EconomicSimulator | /network_agents_ver2/foundation/src/Provider.cpp | UTF-8 | 9,837 | 2.734375 | 3 | [
"MIT"
] | permissive |
#include <Poco/Util/ServerApplication.h>
#include "FoundationException.h"
#include "Provider.h"
#include <limits>
namespace ChoiceNet
{
namespace Eco
{
Provider::Provider(std::string id, ProviderCapacityType capacity_type):
_id(id), _type(capacity_type)
{
}
Provider::~Provider()
{
std::map<std::string, ResourceAva... | true |
711d4afd311592febef48e68e039c57f3f6f1285 | C++ | scruffymcnunchuck/Sort_Project | /bubble-sort.cpp | UTF-8 | 746 | 3.25 | 3 | [] | no_license | //============================================================================
// Name : bubble-sort.cpp
// Author :
// Date :
// Copyright :
// Description : Implementation of bubble sort in C++
//============================================================================
#include "sort.h"
vo... | true |
657c32aefded9c534e2b69d70d2fc0aa72a2d119 | C++ | ferluque/TDAImagen | /src/1umbralizar.cpp | UTF-8 | 3,472 | 3.609375 | 4 | [] | no_license | /**
* @file 1umbralizar.cpp
* @brief Fichero con la función umbralizar y su prueba
* @author Fernando Luque (fl1562001@correo.ugr.es)
* @date Octubre 2020
*
* Para llamar al ejecutable correspondiente <ejecutable> <imagen_origen> <umbral_min> <umbral_max> <imagen_destino>
*/
#include "Imagen.h"
#include "image... | true |
5b8a385c8b7cc02ab81be5a90413e4272238c9ef | C++ | josealeixopc/AEDA-Part2 | /Código/Servico.cpp | WINDOWS-1252 | 3,569 | 3.0625 | 3 | [] | no_license | /*
* Servico.cpp
*
* Created on: 27/10/2015
* Author: ASUS
*/
#include "Camiao.h"
#include "Cliente.h"
#include "Empresa.h"
#include "Frota.h"
#include "Servico.h"
#include "sequentialSearch.h"
/**
* \brief Cria um Servio usando os parmetros para definir as sua caracteristicas
* \param id ID do ... | true |
845cf7fba19ddf571c5d7f1f1721a1e0e9107488 | C++ | mbaluda/GLCAlib | /GLblur.cpp | UTF-8 | 2,860 | 3 | 3 | [] | no_license | ///\file GLblur.cpp
///\brief GPGPU-based blur convolution filter.
///
///Realizes a convolution using the GLCAlib library.\n
// includes
#include <iostream>
#include "GLCAlib.h"
///\brief Implements in GLSL the convolution for blurring images
///
///Convolution Matrix 3x3\n
///0.1 0.1 0.1\n
///0.1 0.2 ... | true |
ac1f85b310352efa91823214c9f55ba20c10c8e4 | C++ | thecodingwizard/competitive-programming | /POI/POI16-Not_Nim.cpp | UTF-8 | 10,819 | 3.484375 | 3 | [] | no_license | /*
* Same solution as editorial
*
* Player A wants to end game in fewest moves, player B wants to stall
* - With pen and paper we get that if player A repeatedly removes stones from one pair until it's gone,
* a pair of n stones will take him floor(log2(n))*2 + 4 steps
* - However, after one stack of stones is ... | true |
5f5978f4afdaee653d959f07dba01a53c41891d7 | C++ | daffafzn/latihan | /3 jarak antara tanggal.cpp | UTF-8 | 1,208 | 2.90625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
char opsi;
do
{
system("cls");
struct {
int hari, bulan, tahun;
} pertama, kedua;
struct {
int hari, bulan, tahun;
} selisih;
cout << "Masukkan Tanggal Pertama (dd:mm:yy) \n\n";
cout << "Hari = ";
cin >> pertama.hari;
cout << "Bu... | true |
b1dbbe0986fdc94468e0cf3aea428d065bd5657b | C++ | reginabezhanyan/study_tasks_contests | /2kurs/IV sem/7k/7-1.cpp | UTF-8 | 514 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <string>
struct MyException
{
std::string str;
public:
MyException(std::string str_) : str(str_) {}
~MyException()
{
std::cout << str << std::endl;
}
};
void f(std::string str)
{
if(str == "\0") {
throw -1;
}
MyExcep... | true |
9f0a56118ff1a30af63bf051e448ff1422c67d9e | C++ | vbtang/DevSoft | /Src/Edislab/Edislab Pro/DataDefine.h | UTF-8 | 1,924 | 3.3125 | 3 | [] | no_license | #pragma once
struct CMeColor
{
CMeColor()
: red(0)
, green(0)
, blue(0)
, alpha(1.0)
{
}
CMeColor(double r, double g, double b, double a = 1.0)
: red(r)
, green(g)
, blue(b)
, alpha(a)
{
}
void setColor(double r, double g, double b, double a = 1.0)
{
red = r;
green = g;
blue = b;
alpha =... | true |
61e90dce7468d78b95e4278dff528284224a9d0b | C++ | lhgcs/linuxProjectDemo | /util/jsonUtil.h | UTF-8 | 4,270 | 2.921875 | 3 | [] | no_license | /*
* @Description: cjson生成和解析
* @Version: 1.0
* @Autor: lhgcs
* @Date: 2019-10-20 13:14:10
* @LastEditors: lhgcs
* @LastEditTime: 2019-10-29 17:43:14
*/
class jsonUtil {
public:
/**
* @brief cjson_parse_string
* @param str json字符串
* @param key 键
* @return 值(字符串)
* 解析JSON包
*/
/**
* @descripti... | true |
f5dd24c553f567e92afd0ffb949e1b69c54e780f | C++ | Audrie8a/Arqui-1 | /Practicas/Practica1/Cartel/Cartel/Cartel.ino | UTF-8 | 3,540 | 2.625 | 3 | [] | no_license |
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
//Aclaraciones: Modulo 0= Matriz 2 ; Modulo 1= Matriz 1
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 2
#define CP_PIN 10 //LOAD
#define DATA_PIN 11 //DIN
#define CLE_PIN 13 //CLK
MD_Parola myDisplay = MD_Parola(HARDWARE_TYPE, DATA_... | true |
e923fbc3e34a3a5f1dcbe4dab5851ec7775d8302 | C++ | sigmafx/DotClk | /DmdFrame.cpp | UTF-8 | 1,456 | 3.125 | 3 | [] | no_license | #include <Arduino.h>
#include "DmdFrame.h"
DmdFrame::DmdFrame()
{
width = 128;
height = 32;
Clear();
}
byte DmdFrame::GetDot(int x, int y)
{
if(!CheckRange(x, y))
{
return 0x00;
}
return frame.dots[y][x];
}
void DmdFrame::SetDot(int x, int y, byte value)
{
if(!CheckRange(x, y))
{
return;
... | true |
4f265e0d8de2cd1bd74d87c549f4721a35cc4597 | C++ | MateusAttie/C | /Matriz/Exercicio6.cpp.cpp | UTF-8 | 701 | 2.75 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
#include<stdlib.h>
#include<time.h>
#define ordem 4
int main ()
{
int tabela[ordem][ordem],i,j,maior = 0;
srand(time(0));
for(i = 0; i < ordem;i++)
{
for(j = 0 ; j < ordem;j++)
{
tabela[i][j] = rand()%(ordem*ordem);
printf("%d\t",t... | true |
96edb6448259083d564ce610aa763f2cd5a2d1a2 | C++ | samuelbearman/TheGarage | /DataStructures341/projects/project5/ProbeHashTable.cpp | UTF-8 | 5,922 | 3.3125 | 3 | [] | no_license | #ifndef PROBE_HASH_TABLE_CPP
#define PROBE_HASH_TABLE_CPP
#include "ProbeHashTable.h"
#include <iostream>
// Overloaded Constructor
template <typename T>
ProbeHashTable<T>::ProbeHashTable(unsigned int (*hashFunc)(const T&), int n) {
m_table = new HashTableEntry<T>[n];
m_capacity = n;
m_size = 0;
this... | true |
b423d29017a9137c1d916a8c8c5692c20416e13b | C++ | yuchenguangfd/Arena | /poj/P2075.cpp | UTF-8 | 3,383 | 3.515625 | 4 | [] | no_license | /*
* Problem: Tangled in Cables
* http://poj.org/problem?id=2075
*/
#include <vector>
#include <string>
#include <limits>
#include <algorithm>
#include <cstdio>
template <class T>
class WeightedDirectedGraphAsAdjMatrix {
public:
typedef T WeightType;
WeightedDirectedGraphAsAdjMatrix(int numV... | true |
d5fab21a7b37030d64aae043db5b8c21ce8ce812 | C++ | AlinGeorgescu/HackerRank-Solutions | /HR - Problem Solving/DiagonalDifference.cpp | UTF-8 | 914 | 3.875 | 4 | [
"MIT"
] | permissive | /**
* Copyright 2018
* Diagonal Difference
*/
#include <iostream>
#include <vector>
using std::cin;
using std::cout;
using std::vector;
int diagonalDifference(vector< vector<int> > a, int n) {
/**
* PD = primary diagonal
* SD = secondary diagonal
*/
int sumPD = 0, sumSD = 0;
for (int... | true |
a027035ed703963d83a878c09be9350cfdd4c4cc | C++ | Gonghaoran7719/QT_Demo | /MD5/widget.cpp | UTF-8 | 2,305 | 2.625 | 3 | [] | no_license | #include "widget.h"
#include "ui_widget.h"
Widget::Widget(QWidget *parent) :
QWidget(parent),
ui(new Ui::Widget)
{
ui->setupUi(this);
setWindowTitle(QString("MD5"));
ValInit();
}
Widget::~Widget()
{
md5Thread.exit();
md5Thread.wait(10*1000);
delete ui;
}
void Widget::ValInit()
{
/... | true |
03d5c43e19de6fe1ea1d6a8b6a0a277d615f3ece | C++ | avsobolev/prata_cpp_exercises | /chapter5/05_02.cpp | UTF-8 | 1,290 | 3.640625 | 4 | [] | no_license | /* 05_02.cpp
Занятия по книге Стивена Прата "Язык программирования С++" (2012, 6-е издание).
Упражнения по программированию. Глава 5, страница 255, упражнение 2
Перепишите код из листинга 5.4 с использованием объекта array вместо
встроенного массива и типа long double вместо long long. Найдите значение 100!... | true |
1fcb6c96a2b8bdff4e2d38129ef5058cbd87d9b0 | C++ | saksham-jain01/Data-Structures-and-Algorithms | /linked-lists/Node.h | UTF-8 | 159 | 2.765625 | 3 | [
"MIT"
] | permissive | #ifndef NODE_H
#define NODE_H
template <typename T>
class Node{
public:
T data;
Node<T>*next;
Node(T d):data(d),next(NULL){}
};
#endif
| true |
55f7aeaf77d5df2ecbb98eff2bc307ed951c1d71 | C++ | qtux/ggj15 | /src/Menu.cpp | UTF-8 | 4,119 | 2.5625 | 3 | [
"MIT"
] | permissive | /*
* Copyright (c) 2015-2017 Annemarie Mattmann, Johannes Mattmann,
* Matthias Gazzari, Moritz Hagemann, Sebastian Artz
*
* Licensed under the MIT license. See the LICENSE file for details.
*/
#include "Menu.hpp"
#include "Editor.hpp"
#include "Level.hpp"
#include "Credits.hpp"
#include <fstream>
#include <sstre... | true |
7f6530e382a18c58fcab651e2bb3b7da708f9abc | C++ | MiXo20/LearningPro | /Struct/fraction.cpp | UTF-8 | 5,595 | 3.390625 | 3 | [] | no_license | #include "fraction.h"
void Fraction::Display()
{
if(chasel==1)
cout <<chasel/NSD(chasel, denominator)<<' ';
else
cout << chasel/NSD(chasel, denominator)<<'/'<<denominator/NSD(chasel, denominator)<<' ';
}
int NSD(int ch, int den)
{
if(den==0)
return abs(ch);
else
return ... | true |
c45727acf22185ff5d2b94b25b31b765b232b293 | C++ | Snow20132573/Compiler | /procedure/lexical_analysis/compile.cpp | GB18030 | 21,645 | 2.78125 | 3 | [] | no_license | #include<cstring>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<iomanip>
#include<sstream>
using namespace std;
//ؼ
char* key[]= {"if","else","for","while","do","return","int","void","main","break","continue","cout","float"};
//ʶ
struct name
{
char ID[20];
} name[1000];
int namenum=... | true |
939349ef6e67a05e7b11be8bc95342ee078eebd8 | C++ | xrj-sysu/hdu_submit | /hdu2473.cpp | UTF-8 | 1,394 | 2.84375 | 3 | [] | no_license | #include<iostream>
#include<set>
#include<cstdio>
using namespace std;
// 题目给的n的大小是骗人的
// the key is to open the b array. I have tried add a new value but failed.
int a[1000005];
int b[1000005];
void init(int n) {
for (int i = 0; i < n; ++i) {
a[i] = i;
b[i] = i;
}
}
int find(int x) {
if (... | true |
bc073ea5d6f68dad06ec5ada4e2999c7f1feeb50 | C++ | CreepyCreature/Simple3D | /simple3d/src/gfx/ShaderProgram.cpp | UTF-8 | 5,396 | 3.09375 | 3 | [
"BSD-2-Clause"
] | permissive | #include "ShaderProgram.h"
#include <string>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vector>
ShaderProgram::ShaderProgram()
{
program_ = glCreateProgram();
}
// When passing the Program by value it gets destroyed and deletes
// eveything from the actual Program. Check for this!
ShaderPr... | true |
9b9709f6442c4a99b5af1fd50eaa0bb6779d8ef3 | C++ | kimichang/Algorithm | /algorithm/leetcode/test.cpp | UTF-8 | 1,347 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <exception>
class father
{
public:
std::string name;
virtual std::string getName(){return this->name; };
father(std::string s = "father"){ name = s;};
};
class son : public father
{
std::string getName(){ return "son";};
};
class mother
{
};
struct s1
{
... | true |
bb1586328fa1e356b536e72b1feeb1ca472bab8e | C++ | ricpersi/ClickHouse | /dbms/src/Functions/FunctionsJSON.h | UTF-8 | 7,640 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include <Functions/IFunction.h>
#include <Common/config.h>
#if USE_SIMDJSON
#include <Columns/ColumnConst.h>
#include <Columns/ColumnString.h>
#include <DataTypes/DataTypeFactory.h>
#include <Common/typeid_cast.h>
#include <ext/range.h>
#ifdef __clang__
#pragma clang diagnostic push
#pragma cl... | true |
3dfde306336130eb0282dd45a591e91024038001 | C++ | M4573R/UVa-Online-Judge-1 | /10394 - Twin Primes/10394 - Twin Primes.cpp | UTF-8 | 1,823 | 2.6875 | 3 | [] | no_license | //******************************************************************
// Coded by: Huynh Nhat Minh
// Problem Code: 10042 - Smith Numbers
// Verdict: Accepted
//******************************************************************
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <algorithm>
#include <cstri... | true |
4a9b829f01a1db242d4aa3ebf7c558d649d5dd7a | C++ | ifknot/fbuf | /canvas_factory.h | UTF-8 | 11,742 | 2.859375 | 3 | [
"MIT"
] | permissive | #ifndef FBUF_CANVAS_FACTORY_H
#define FBUF_CANVAS_FACTORY_H
#if (defined (LINUX) || defined (__linux__))
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <string>
#include <sstream>
#include <... | true |