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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
2b75db6326ac321a98e38ebfc91e32afcc991b1e | C++ | Vipulk1605/Competitive_Coding | /28.Recursion_IV_Subset_Based/03.0_1_Knapsack_Recursion.cpp | UTF-8 | 594 | 3.015625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int profit(int n, int c, int *wt, int *prices){
if(n == 0 || c == 0){
return 0;
}
//rec case
int ans = 0;
int inc, exc;
inc = exc = INT_MIN;
//include
if(wt[n-1] <= c)
inc = prices[n-1] + profit(n-1, c-wt[n-1], wt, prices);
... | true |
ffd731e18fc2a95a7e418fd6192b86790e9a09d9 | C++ | malaya7/CS150-intro-to-programming-Cpp | /h28/person.h | UTF-8 | 240 | 2.796875 | 3 | [] | no_license | #ifndef PERSON_H
#define PERSON_H
#include <string>
class Person
{
public:
Person();
Person(const std::string&name, int age);
std::string getName() const;
int getAge() const;
private:
std::string name;
int age;
};
#endif
| true |
398003dfdbf6ddf1ba3ff3c36ad7cf1563ecb45f | C++ | Danverr/HSE-Course | /module-1/homework/BigInteger/biginteger.h | UTF-8 | 1,871 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
#include <cmath>
class BigInteger {
public:
const int BASE = 10;
const int DIGITS_LEN = log10(BASE);
BigInteger();
BigInteger(int);
BigInteger(long long int);
BigInteger(std::string);
std::string toString() const;
bool operator==(const BigInteger&) con... | true |
601d94dfdf510fa75f7738f9dcfc4ffd6fc4bbba | C++ | Inflanty/cpp_course | /Fractal/CFractalCreator.h | UTF-8 | 1,153 | 2.640625 | 3 | [] | no_license | // Name : CFractalCreator.h
#ifndef _FRACTALCREATOR_H_
#define _FRACTALCREATOR_H_
#include <string>
#include <utility>
#include <vector>
#include "CBitmap.h"
#include "CMandelbrot.h"
#include "CZoomList.h"
#include "CZoom.h"
#include "CRGB.h"
using namespace bitmap;
class CFractalCreator {
public:
static const int... | true |
d0f6a6a07bcd732b59902eb82cdacb9532d02fdd | C++ | AlexisAubineau/StarShooter | /StarShooter/HitBoxComponent.h | UTF-8 | 1,129 | 2.515625 | 3 | [] | no_license | #ifndef HITBOXCOMPONENT_H
#define HITBOXCOMPONENT_H
#include <list>
#include <SFML/Graphics.hpp>
class Entity;
class HitboxComponent
{
private:
sf::Sprite& sprite;
sf::RectangleShape hitbox;
sf::FloatRect nextPosition;
float offsetX;
float offsetY;
std::string m_tag;
bool CanDamage;
public:
std::list<std::s... | true |
b2a7d70634625ab9d2a5f9030e6479d40a1eff59 | C++ | AnkilP/ieeextreme_prep | /google_kick/circlething.cpp | UTF-8 | 4,111 | 3.125 | 3 | [
"MIT"
] | permissive | #include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution {
public:
queue<pair<int,int>> bfs_q;
void traverse_graph(vector<vector<int>>& A, vector<vector<int>>& visited, int index1, int index2){
if(index1 + 1 < A.size()){
if(A[index1 ... | true |
a54e86425aaff8e60ced2523bf5b936277974d25 | C++ | liangcevv/StudentManagementSystem | /searchdialog.cpp | UTF-8 | 2,311 | 2.59375 | 3 | [
"MIT"
] | permissive | #include "searchdialog.h"
#include "ui_searchdialog.h"
#include "mainwindow.h";
#include "common.h"
SearchDialog::SearchDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::SearchDialog)
{
ui->setupUi(this);
}
SearchDialog::~SearchDialog()
{
delete ui;
}
void SearchDialog::initUi()
... | true |
562a889b7c919991864f52280f736f651a5fb8d6 | C++ | EasonZhu/rcc | /vxl/vxl-1.13.0/core/vidl_vil1/examples/vidl_vil1_mpegcodec_example.cxx | UTF-8 | 2,146 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | // This is an example of how to use vidl_vil1_mpegcodec,
// written by Ming Li(ming@mpi-sb.mpg.de),
// Max-Planck-Institut fuer Informatik, Germany, 29 Jan 2003.
// may not work for some format mpeg2 files due to the fixed
// load_mpegcodec_callback function !!
#include <vcl_cassert.h>
#include <vcl_cstdlib.h>
#inclu... | true |
74a8eb2cb6cb127cfc27a1281cf591d0ec0b84d2 | C++ | xxjwxc/oauth2 | /oauth2Client/cpp/oauth2Client/Public_linux/src/Tools/MyStream/MyStreamBase.h | GB18030 | 2,865 | 2.671875 | 3 | [] | no_license | /********************************************************************
ʱ: 2017/05/25 15:06:23
ļ: MyStreamBase.h
: лС
emal: 346944475@qq.com
: 1.лл
2.
˵: 1. ֧map,vector,stringͣ
2. ָ֧лл
*******... | true |
973e877d1f495a4f109f516378a656e8060b0f11 | C++ | KobiHawk/BlackJack | /BlackJack/Dealer.h | UTF-8 | 258 | 2.578125 | 3 | [] | no_license | #pragma once
#include "Player.h"
/*
Dealer.h
Child of Player
The dealer only has one revealed card, and can only take very limited actions.
*/
class Dealer : public Player
{
public:
Dealer();
~Dealer();
Card* getRevealedCard();
void printHand();
};
| true |
1df5fb35edff2f7218232030598a751b5121746b | C++ | TXKCOME/NeoCrowd | /NeoCrowdLib/NeoCrowdLib.cpp | UTF-8 | 2,958 | 2.640625 | 3 | [] | no_license | #include "NeoCrowdLib.h"
#include <regex>
#include <unistd.h>
#include <fcntl.h>
#include <stdio.h>
<<<<<<< HEAD
void RunRecongizeService(const char* _inputPath, const char* _areaString, const char* _outputPath)
{
string inputPath(_inputPath);
string outputPath(_outputPath);
string areaString(_areaString)... | true |
e7bc7de532a510b31b4590b88c8f42d66d132112 | C++ | 2023PHOENIX/11-week-workshop | /week 4/LinkedList/AddTwoNumber.cpp | UTF-8 | 1,415 | 3.359375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
class Node
{
public:
int data;
Node *next;
};
Node* MakeLinkList(int *arr,int n){
Node *head = new Node;
head->data = arr[0];
head->next = nullptr;
auto last = head;
for(int i=1;i<n;i++){
Node *temp = new Node;
temp->data = arr[i];
temp->next... | true |
479dbb128b7aa5103622c2f47bee70089d39be61 | C++ | lugt/UMAD | /UMAD/UMAD/SourceFiles/util/parallelindex/ft.cpp | UTF-8 | 752 | 2.78125 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
int
main(int argc, char **argv)
{
fstream ifs("../data/ufile.txt", ios::in);
if (!ifs)
{
cout << "failed to open file ufile.txt" << endl;
return -1;
}
long fileloc = 0;
char buffer[1024];
for (int i=0; i < 3; i++)
{
int n... | true |
0e3d3e83dc767698a4bf6303ade61c56aca6c2c4 | C++ | ZYChimne/Homework-FTPClient | /include/DownloadFileTask.h | UTF-8 | 3,591 | 2.6875 | 3 | [] | no_license | #ifndef DOWNLOADFILETASK_H
#define DOWNLOADFILETASK_H
#include "../include/FTPSession.h"
#include <QObject>
#include <fstream>
#include <cstring>
#include <iostream>
namespace ftpclient
{
/**
* @brief 下载任务类
* 调用 start() 开始任务
* 调用 resume() 继续任务
* 调用 stop() 停止任务
*/
cl... | true |
ef6ec039dd36c1f622262e961d9762b646b0c01e | C++ | gwtak/My_Leetcode | /leetcode原生/23_合并K个排序链表_hard/暴力法_自己写的.cpp | UTF-8 | 1,119 | 3.3125 | 3 | [] | no_license | /*合并 k 个排序链表,返回合并后的排序链表。请分析和描述算法的复杂度。
示例:
输入:
[
1->4->5,
1->3->4,
2->6
]
输出: 1->1->2->3->4->4->5->6
来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/merge-k-sorted-lists
著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。*/
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;... | true |
d58d369cbcb363dff80eb875754657affc770890 | C++ | mush-musha/University-Management-System-UML-AND-CODE | /Courses.h | UTF-8 | 1,874 | 3.671875 | 4 | [] | no_license | #pragma once
#include<string>
#include<iostream>
#include<vector>
using namespace std;
class Courses
{
public:
Courses()=default;
~Courses()=default;
//setters
void set_courses_enrolled(string);
void set_coursewise_attendance_percentage(float);
void set_course_wise_marks(float);
void change_course_enrolled(int,s... | true |
fbcc01de40f2387f3ab6b54c986d7f782e33cc8a | C++ | shouko/algorithms_iccad2016 | /src/answerstack.h | UTF-8 | 475 | 2.796875 | 3 | [] | no_license | #ifndef _ANSWERSTACK_H_
#define _ANSWERSTACK_H_
#include <stack>
#include <utility>
using namespace std;
class Gate;
class Wire;
typedef union AnsEntry {
Gate* g;
Wire* w;
} AnsEntry;
enum AnsEntryType {
ANS_GATE,
ANS_WIRE
};
class AnswerStack {
public:
AnswerStack() {};
~AnswerStack() {};
void inser... | true |
bd88d5426dbc15fefb0659e332b869696e5bf99d | C++ | dsupr/230-Final-Project | /Stack.cpp | UTF-8 | 382 | 3.015625 | 3 | [] | no_license | #include "Stack.h"
void TStack::push(BinaryTreeNode *p)
{
TStackNode *newNode = new TStackNode();
newNode->data = p;
newNode->next = top;
top = newNode;
}
bool TStack::pop(BinaryTreeNode * &p)
{
if (top == nullptr)
{
return false;
}
p = top->data;
TStackNode *delNode = top... | true |
8e633a0a7e1039e01adf22a7387eee47dad87470 | C++ | hanswenzel/lArTest | /include/AuxDetHit.hh | UTF-8 | 4,906 | 2.75 | 3 | [] | no_license | /*
* File: AuxDetHit.h
* Author: wenzel
*
* Created on October 22, 2018, 2:35 PM
*/
#ifndef AUXDETHIT_H
#define AUXDETHIT_H
#include <vector>
#include <iostream>
class AuxDetHit {
private:
int ID; ///< Geant4 copy ID
int trackID; ///< Geant4 supplied track ID
float energyDeposited; ///< total ene... | true |
2e2d48052ff4fc39de1c13ddc2bc6e8af176f264 | C++ | mitchellspryn/ClankRoboticsPlatform | /clank/lib/motor/LiteMotor/LiteMotor.hpp | UTF-8 | 794 | 2.546875 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | #ifndef LITEMOTOR_HPP
#define LITEMOTOR_HPP
#include "motor/IMotor.hpp"
#include "configuration/Configuration.hpp"
#include "hardware/GpioPin.hpp"
#include "hardware/PwmPin.hpp"
#include <string>
#include <stdexcept>
namespace Clank
{
namespace Motor
{
class LiteMotor : IMotor
{
public:
Lit... | true |
b9fd30b87e161f00e22b759ce5b2252e1003379d | C++ | uzairjan/Coding-at-LiU | /TND012 - Programming (Autumn 2013)/Lab 2/Lab 2 Ex 1.cpp | UTF-8 | 2,099 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main ()
{
//declare variables
int age, age_1, age_2;
int price_1 = 0;
int price_2 = 30;
int price_3 = 80;
const double rabatt = 0.8;
int option;
double tot_price, price_F, price_S;
// user input - opt... | true |
611e38528526ba7fc161e4bebbd4b3276313a579 | C++ | manucapo/VectorVisualizer | /Point.hpp | UTF-8 | 652 | 3.03125 | 3 | [
"MIT"
] | permissive | //
// Point.hpp
// SeminarProjectManu
//
// Created by Manuel Telleria on 09.03.18.
#pragma once
#include <math.h>
class Point{
double x;
double y;
public:
void setX(double value){
x = value;
}
void setY(double value){
y = value;
}
double getX(){
... | true |
abc690d9251e3e3d0588d594176b4ac3e566bf29 | C++ | nganhkhoa/CTDL-GT | /include/tut6lab.h | UTF-8 | 2,720 | 3.21875 | 3 | [] | no_license | #ifndef TUT6LAB_H
#define TUT6LAB_H
#include <AVL.h>
namespace week6
{
namespace lab
{
class SumPathTree : public data::AVL<int> {
data::SinglyLinkedList<data::SinglyLinkedList<int>*>* path;
int sum;
public:
SumPath... | true |
d10461a5ec6f92ab2023ac7040aeed63e22ce7b0 | C++ | Y-puyu/Everyday_Coding | /20200223 搜索二维矩阵 数学 二分法 多方法.cpp | GB18030 | 2,232 | 3.265625 | 3 | [] | no_license | // ִʱ :12 ms, C++ ύл53.83%û
// ڴ :10.1 MB, C++ ύл5.29%û
class Solution {
public:
bool searchMatrix(vector<vector<int>>& matrix, int target) {
if (matrix.empty() || matrix[0].empty())
return false;
for (int i = 0; i < matrix.size(); ++i) {
for (int j = 0; j < matrix[0].size... | true |
5835daeae87baf636c7e475d68d2139a073aaa67 | C++ | meyersh/gimli | /archives/431/project3/project3.cgi.cpp | UTF-8 | 11,734 | 2.9375 | 3 | [] | no_license | /*
* Handle the webapp junk.
* Shaun Meyer, Mar 2012
*/
// TODO: Game serialization for saving + loading
// TODO: game_id persistance
// TODO: game_id timeouts
// TODO: ?
#include <iostream>
#include <sstream>
#include <vector>
#include "session.hpp"
#include "Pente.hpp"
using namespace std;
#define MAX_GAME_AGE... | true |
77f2b28cad1c51ed88e6d1d818d40f91c0ccbfcf | C++ | FJinn/fjinn.github.io | /Experiences/Programming/C++/DataStructureAndAlgorithm/Week 3/Week 3 Bubble Sort.cpp | UTF-8 | 1,866 | 3.671875 | 4 | [
"Unlicense"
] | permissive | #include <iostream>
#include "windows.h"
#include <vector>
#include <ctime>
using namespace std;
vector <char> Charlist;
void RandomOrder()
{
for (int i=0; i<Charlist.size(); i++)
{
int randomIndex;
do
{
randomIndex = rand () % Charlist.size();
}while(randomIndex == i);
char temp = Charlist[i];
Charl... | true |
38837ecf686bf43e970d1db26a1eaed0d4aafab0 | C++ | jsj2008/framework2d | /Log/Log.cpp | UTF-8 | 1,338 | 2.53125 | 3 | [] | no_license | #include "Log.h"
#include <Log/GameConsole.h>
#include <Log/UninitialisedLogger.h>
#include <SDL/SDL_timer.h>
#include <iostream>
Log g_Log;
Log::Log()
{
//ctor
logger = new UninitialisedLogger;
}
Log::~Log()
{
//dtor
}
void Log::init()
{
logger = logger->newLogger(new GameConsole());
}
vo... | true |
ea761d303b2caa1787a4f33f0e6bd4c800b199f1 | C++ | ozanarkancan/blg-hws | /blg335e-analysis-algorithms/AoA/BigUnsignedInt.h | UTF-8 | 3,644 | 2.875 | 3 | [] | no_license | #ifndef BIGUNSIGNEDINT_H
#define BIGUNSIGNEDINT_H
#include <deque>
#include <string>
#include <limits.h>
#include <math.h>
#include <stdint.h>
#define base (uint64_t)UINT_MAX + 1 //define base as 2^32
using namespace std;
class BigUnsignedInt
{
private:
deque<unsigned int> digits;//Represent... | true |
864440e0c8fa3368457b68f207094060a0112a7a | C++ | diypa571/MyCppExercises | /class1/Class1/class1.cpp | UTF-8 | 1,022 | 3.71875 | 4 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
class aliens {
public:
aliens () {
cout <<"This will be run automaticly,... \n";
cout <<" When an object of the class is created... \n";
}
void display() {
cout << "Aliens exist.... \n ";
}
void xx() {
cout << "xxxxx function \n";
}
int addition(i... | true |
d36621a9421a19a34e5e02ed1699605d480c8f8b | C++ | nnovoice/acmuva | /solutions/acm/QuirksomeSquares256/QuirksomeSquares256.cpp | UTF-8 | 2,246 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
const unsigned int MAXNUMBERS = 100000000;
const unsigned int MAXSQUARES = 19999;
unsigned int squares[MAXSQUARES];
void GetNumbers (unsigned int num, unsigned int& a, unsigned int& b, int digits)
{
if (digits == 1) {
a = num ... | true |
b30619bcbcc95bb5491b93fdaa03f13b977eb00b | C++ | sjnonweb/spoj | /Solutions/CANDY3.cpp | UTF-8 | 404 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdio>
using namespace std;
int main()
{
long long int test,n,i,j,sum;
cin>>test;
while(test--)
{
getchar();
cin>>n;
sum=0;
for(i=0;i<n;i++)
{
cin>>j;
sum=(sum+j)%n;
}
if(sum==0)
... | true |
e36b5a3b92e0c4c9c01c00aa8e67d7cb6062d3a8 | C++ | lionem2018/Baekjoon_Algorithm | /C++/10818_C.cpp | UTF-8 | 534 | 3.1875 | 3 | [] | no_license | /*
2020/02/26
Baekjoon Online Judge
Problem 10818: 최소, 최대
N개의 정수가 주어진다. 이때, 최솟값과 최댓값을 구하는 프로그램을 작성하시오.
*/
#include <iostream>
int main(void)
{
int size, number, min = 1000000, max = -1000000;
scanf("%d", &size);
for(int i = 0; i < size; i++)
{
scanf("%d", &number);
if(min > number)
... | true |
bc21bba8eb5493479331117f89902ce65e80b7fa | C++ | GregoryVanlaer/c_multi | /topics/classes-overview/destructor-usage.cpp | UTF-8 | 163 | 2.59375 | 3 | [] | no_license | class Foo
{
int* p;
public:
// Constructor allocates
Foo() : p(new int) { }
// Destructor deallocates
~Foo()
{
delete p;
}
}
| true |
8efde1149c1356e509cd78b8ca7536769cb35ed3 | C++ | kruztev/FMI-DSA | /data_structures/tree/trie_tree/trie.cpp | UTF-8 | 2,359 | 3.484375 | 3 | [
"MIT"
] | permissive | /*******************************************************************************
* This file is part of the "Data structures and algorithms" course. FMI 2018/19
*******************************************************************************/
/**
* @file trie.cpp
* @author Vasilena Peycheva
* @date 03.04.2019
*... | true |
cc3def44c9a0d06a9b7d2e11a8a5e8de3f3f6f13 | C++ | futuristek/leetcode | /google/347.top-k-frequent-elements.cpp | UTF-8 | 1,394 | 3.546875 | 4 | [] | no_license | /*
* [347] Top K Frequent Elements
*
* https://leetcode.com/problems/top-k-frequent-elements/description/
*
* algorithms
* Medium (51.88%)
* Total Accepted: 196.8K
* Total Submissions: 361.3K
* Testcase Example: '[1,1,1,2,2,3]\n2'
*
* Given a non-empty array of integers, return the k most frequent elemen... | true |
12e712be9d6b9479fc1c78d1ec006d270309576e | C++ | fabinhoh13/fabinhoh13 | /UFOP/Disciplinas/Terceiro Periodo/Programação Orientada a Objetos/TP1/src/Casa.h | UTF-8 | 669 | 2.546875 | 3 | [] | no_license | // Created by Igor Santiago - 19.1.4033 and Fábio Fernandes - 19.1.4128 on 11/2021.
#ifndef CASA_H
#define CASA_H
#include "Imovel.h"
using namespace std;
class Casa : public Imovel{
int andares;
bool sala_jantar;
public:
Casa(int = 0, float = 0, string = "", string =... | true |
6ddce204de704559d12208b098326dd94926450a | C++ | Wolfenry/PerturBaldosa | /Baldosa.h | UTF-8 | 1,040 | 2.796875 | 3 | [] | no_license | #pragma once
#include <SFML\Graphics.hpp>
using namespace sf;
class Baldosa
{
public:
Baldosa(Vector2f size, Texture* textura, float posX, float posY);
~Baldosa();
void SetPosition(Vector2f pos);
Vector2f GetPosition();
float GetX();
float GetY();
void recuadropantalla();
void draw(RenderWindow &window);
vo... | true |
b3b6d7af86a257b55f69881da5c15a966dbfe41c | C++ | prickle/GameBloke | /src/teensy-speaker.cpp | UTF-8 | 922 | 2.765625 | 3 | [] | no_license | #include <Arduino.h>
#include "teensy-speaker.h"
#include "globals.h"
TeensySpeaker::TeensySpeaker(uint8_t pinNum) : PhysicalSpeaker()
{
toggleState = false;
needsToggle = false;
speakerPin = pinNum;
pinMode(speakerPin, OUTPUT); // analog speaker output, used as digital volume control
mixerValue = numMixed ... | true |
6148f6b5a2681aeb7f54075af235b606a4ebfba7 | C++ | AlgorithmOnline/youngbin | /2020_1005_2217.cpp | UTF-8 | 430 | 2.765625 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
vector<int> v;
int N;
int ans;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> N;
for (int i = 0; i < N; ++i)
{
int num;
cin >> num;
v.push_back(num);
}
sort(v.begin(), v.end());
int temp;
for (int i... | true |
aefafe108e9453ec252509cfe4d3e103307d9a34 | C++ | vijaythyagarajan/Web-based-Code-Repository-Search-Engine | /Display/Display.h | UTF-8 | 1,905 | 3.328125 | 3 | [] | no_license | #pragma once
/////////////////////////////////////////////////////////////////////
// Display - DisplayFile Package (Source Code Publisher) //
// Vijay Thyagarajan, CSE687 - Object Oriented Design, Spring 2019 //
/////////////////////////////////////////////////////////////////////
/*
* Package Operations:
... | true |
55514c40b1b21f57a4b28f650a0d871a33150180 | C++ | lmontigny/Practice_Cpp | /Pointers.cpp | UTF-8 | 574 | 3.25 | 3 | [] | no_license | // Pointer.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
int var = 8;
void* ptr = nullptr;
ptr = &var;
//*ptr = 10; // not working because void
int* ptr1 = nullptr;
ptr1 = &var;
*ptr1 = 10;
// On the heap
char* buffer... | true |
1a5fa2de08efd6910cdc883144005f650c938417 | C++ | achallion/intranet-lan-chat-app | /main.cpp | UTF-8 | 2,892 | 2.671875 | 3 | [] | no_license | #include "headers.hpp"
int main()
{
cout << GRN << "Welcome To End To End Encrypted Intranet Lan System";
user me;
user frnd;
cout << GRN << "\n\nWhat is Your Username : " << YEL;
cin >> me.name;
cout << GRN << me.getname() + " , Do You want to connect to your friend : (y/n) " << YEL;
char ... | true |
d9d29654597d25648f2a0de06b5882edf749470f | C++ | mnrn/Introduction-to-Algorithms | /ComputationalGeometry/Segments/Submission2/submission2.cpp | UTF-8 | 18,641 | 3.53125 | 4 | [] | no_license | /**
* @brief 線分を扱います
* @date 2016/03/20
*/
//****************************************
// 必要なヘッダファイルのインクルード
//****************************************
#include <vector>
#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
//****************************************
// オブジェクト形式マクロの定義
//*****... | true |
ffee3cbbb180a77aeb55be8f0ff1fa80173ff01f | C++ | guithin/BOJ | /2606/Main.cpp | UTF-8 | 567 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<vector>
using namespace std;
vector<int> vec[101];
bool check[101] = { 0 };
void dfs(int cur) {
check[cur] = true;
for (int i = 0; i < vec[cur].size(); i++) {
int next = vec[cur][i];
if (check[next] == true)
continue;
dfs(next);
}
}
int main() {
int n, m;
scanf("%d %d", &n, &... | true |
d95757acd14714555999a0439156eb8b8f14ab6a | C++ | Datta2901/Algorithmic-Implementations | /Graph/Graph Traversals(BFS & DFS)/BFS/Snake & ladder problem using BFS.cpp | UTF-8 | 5,219 | 4 | 4 | [
"MIT"
] | permissive | /* Problem description ---->
Vivek takes out his Snakes and Ladders game and stares at the board, and wonders: If he had absolute control
on the die (singular), and could get it to generate any number (in the range 1-6 ) he desired, what would
be the least number of rolls of the die in which he'd be able to reach th... | true |
a2015dc9874ce6b09c783c626a2503be967a7131 | C++ | askeySnip/OJ_records | /UVa/10557.cpp | UTF-8 | 1,681 | 2.71875 | 3 | [] | no_license | /*
ID: leezhen
TASK: practice
LANG: C++11
*/
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <bitset>
using namespace std;
typedef vector<int> v... | true |
cc392ea8c0ca04fb6a4b7e6de8f8d2b5444859cb | C++ | boates/accelerated_cpp | /6/6_sg/grade.cpp | UTF-8 | 2,706 | 3.625 | 4 | [] | no_license | // source file for the grade functions
#include <stdexcept>
#include <vector>
#include <list>
#include "grade.h"
#include "median.h"
#include "Student_info.h"
using std::domain_error; using std::vector;
// function to compute a sutdent's grade
double grade(double midterm, double final, double homework) {
return 0.2*... | true |
84e143b8fb78750c2de3d48bd3af82ab8ced419d | C++ | AaronMooney/Qwixx | /Qwixx_Assignment/player.cpp | UTF-8 | 3,042 | 3.171875 | 3 | [] | no_license | /*
Assignment: Qwixx
Author: Aaron Mooney 20072163
Module: Games Development 1
*/
#include "player.h"
#include <iostream>
#include <algorithm>
using namespace std;
//Create new player and scoresheet for that player
Player::Player(int playerId) :
m_playerId(playerId)
{
p_board = new ScoreSheet();
}
//deconstruc... | true |
93c0bb363c9a3edee7f464760bbd197b990961d2 | C++ | TheElderMindseeker/Project_I | /pill/Pill.cpp | UTF-8 | 610 | 2.765625 | 3 | [] | no_license | //
// Created by Даниил on 21.09.2017.
//
#include "Pill.hpp"
Pill::Pill (float pill_percentage, float death_rate, float problems_rate, float no_reaction_rate) : pill_percentage (
pill_percentage), death_rate (death_rate), problems_rate (problems_rate), no_reaction_rate (no_reaction_rate) {}
float Pill::ge... | true |
b9f73d0ebd5da3fbbb5bd7f54f2282a45e643bad | C++ | yangsha-wan/leetcode | /cpp/103BinaryTreeZigzagLevelOrderTraversal/Solution.cpp | UTF-8 | 1,740 | 3.25 | 3 | [] | no_license | //
// Created by baidu on 17/10/2016.
//
#include <vector>
#include <queue>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode(int x) : val(x), left(NULL), right(NULL) {}
};
class Solution {
public:
vector<vector<int>> zigzagLevelOrder(TreeNode *root) {
... | true |
7b9e2b53ffe837d2f80ae1980e50820be7025f26 | C++ | whillet/AccountBook | /AccountBook/AccountBook.cpp | UTF-8 | 415 | 2.796875 | 3 | [] | no_license | #include <cstdio>
#include "Time.h"
#include "Data.h"
using namespace std;
void printTime(Time & time)
{
char tempString[15];
time.getTIme(tempString, 15);
printf(tempString);
printf("\n");
}
int main()
{
Time test,test2,test3("20000631000000");
Data a;
test2.setTime(test.getTIme());
printf("Hello world!\n"... | true |
0f1c336513a482f1d403eff91d10164d97a2050f | C++ | mpound/carma | /carma/ui/rtd/windows/rtdwho.cc | UTF-8 | 5,482 | 2.5625 | 3 | [
"FSFUL"
] | permissive | #include "carma/util/Program.h"
#include "carma/ui/rtd/common/CarmaDisplay.h"
#include "carma/ui/rtd/common/Connections.h"
#include <unistd.h>
#include <cstring>
using namespace ::std;
using namespace log4cpp;
using namespace carma::util;
using namespace carma::ui::rtd;
/**
* A slight variant on the normal interger ... | true |
d4bdde39a0fe6e30f29f3979fdc3834c00059c3c | C++ | alexandraback/datacollection | /solutions_2463486_0/C++/natha0x6e/fair.cpp | UTF-8 | 1,386 | 3.140625 | 3 | [] | no_license | #include <iostream>
//using http://www.shoup.net/ntl/ for handling large numbers
#include <NTL/ZZ.h>
NTL_CLIENT
//mid = true if the
ZZ makePal(ZZ x, bool mid)
{
ZZ result = x;
if(mid)
{
x /= 10;
}
while(x > 0)
{
result *= 10;
result += x % 10;
x /= 10;
}
return result;
}
bool isFair(ZZ x)
{
Z... | true |
4f0112e628f16429c2703c653bece27e2369ca77 | C++ | skwee357/sk-graphics-engine | /SkgeCore/include/Render/SkgeResource.hpp | UTF-8 | 1,185 | 2.75 | 3 | [
"MIT"
] | permissive | /*
* This File is a part of SK-Game Engine.
*
* Copyright (c) 2009 by Dmitry skwo Kudryavtsev / SK-Software
* s.kwee357@gmail.com
*/
#ifndef SKGE_RESOURCE_H_
#define SKGE_RESOURCE_H_
#include "Skge.hpp"
namespace skge{
/**
* Resource Information.
*/
class SKGE_API ResourceInfo{
private:
... | true |
e2acb49e3d4c561e738c1873a68679a65a948d3a | C++ | VirajeeAmarasinghe/MultiCashGame | /NewMultiCashGame.cpp | UTF-8 | 26,198 | 3.3125 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<stdlib.h>
#include<windows.h>
#include<fstream>
#include<time.h>
#include<iomanip>
using namespace std;
void login();
int menu();
void help();
void displayLetterGrid();
int ** randomHiddenGrid();
int insertInitialAmount();
void selection_options();
void calculate_and_d... | true |
113b590d937c7188ee886762532518475883b7be | C++ | kityprincess/ponder10-wordcount | /wc/wc/bst.h | UTF-8 | 18,287 | 3.515625 | 4 | [] | no_license | /***********************************************************************
* Component:
* Week 09, Binary Search Tree (BST)
* Brother Helfrich, CS 235
* Author:
* Shayla Nelson, Matthew Burr, Kimberly Stowe, Bryan Lopez
* Summary:
* The BST class creates a binary search tree and the BSTIterator
* class... | true |
0e40816bf7304edee39af97e8f2b2e296d38266b | C++ | DavidAStevenson/extendible-hashing | /test/ehfbucket_gtest.cc | UTF-8 | 2,593 | 2.765625 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "ehfconsts.h"
#include "ehfbucket.h"
#include <fcntl.h>
TEST(EHFBucketConstruction, Simple) {
// TODO Interesting thing here is I need to pass a file handle
// This is bad from perspective of testing this thing
// Perhaps better design would be to abstract a file handle into a... | true |
1bd32fc9c34bbc1d8246482fee4df619eab7d9fd | C++ | Lixin-SCUT/cpp-primer | /chapter16/homework16.50.cpp | UTF-8 | 759 | 2.6875 | 3 | [] | no_license | #pragma warning(disable:4996)
#include <iostream>
#include<vector>
#include<string>
#include<list>
#include<algorithm>
#include<numeric>
#include<functional>
#include<iterator>
#include<fstream>
#include<map>
#include<set>
#include<unordered_map>
#include<sstream>
#include<memory>
#include<utility>
us... | true |
80793df2aa9268d7917cefe2b68d704378310444 | C++ | spurscoder/forTest | /src/cpp/2016-11-20/__Coding 29 Combinations.cpp | UTF-8 | 1,092 | 3.890625 | 4 | [
"MIT"
] | permissive | /**
Description: Combinations
Given two integers n and k, return all possible Combinations of k numbers out of
1...n
For example,
if n = 4 and k = 2, a solution is:
[[2,4],[2,3],[3,4],[1,2],[1,3],[1,4]]
Tags:
Backtracking, Array
*/
class Solution {
public:
/**
* @param n: Given the range of numbers
* @... | true |
355a0165c1fc071138333c1e5c7feae2240f640a | C++ | emifervi/POO | /ClassRoom/main.cpp | UTF-8 | 2,201 | 4 | 4 | [] | no_license | /**
* The program allows the user to give a class room a name, a room number where the class will be taken, a capacity of students and allows the user to sign up students for the class.
* Author: Emilio Fernando Alonso Villa A00959385.
* Date: January 31st, 2018
*/
#include <iostream>
#include <string>
... | true |
d8876aa96f841f851efbdc9ee0ed63d0c6ccf7d1 | C++ | PengJiaqiao/CampusRecruitment_Diary | /百度2016实习生真题/乘法表.cpp | UTF-8 | 1,084 | 2.984375 | 3 | [] | no_license | /* https://exercise.acmcoder.com/online/online_judge_ques?ques_id=3819&konwledgeId=40 */
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
using namespace std;
long long int GetCntOfNoGreater(long long int n, long long int m, long long int target)
{
long long int res = 0;
for (int i... | true |
ee8771879c6ce63c61a220878b636134ae69c1a5 | C++ | euyuil/icpc-training-solutions | /usaco/1-1-ride.cc | UTF-8 | 560 | 3.390625 | 3 | [] | no_license | /*
ID: 31415926
LANG: C++
TASK: ride
*/
#include <cstdio>
#include <string>
#include <cstdlib>
#include <iostream>
using namespace std;
long prodmod47(const string &str)
{
long prod = 1;
for (size_t i = 0; i < str.size(); ++i)
prod *= (str[i] - 'A' + 1);
return prod % 47;
}
int main()
{
freo... | true |
57abda389444c7279943cb9bd28449e220174fc5 | C++ | BriskoCube/Teaching-HEIGVD-GEN-Labo5 | /src/main/Rental.h | UTF-8 | 527 | 2.625 | 3 | [] | no_license | //
// Created by julien on 07.06.19.
//
#ifndef GEN_LABO5_RENTAL_H
#define GEN_LABO5_RENTAL_H
#include "AbstractRental.h"
class Rental : public AbstractRental {
public:
Rental(std::shared_ptr<AbstractMovie> movie, int daysRented);
int getDaysRented() const;
AbstractMovie* getMovie() const;
static... | true |
039e5c6b4de0821efb81b85f38d78ced815a3628 | C++ | ryanvolum/CS278-GitHub-Repo | /Desktop/Fall 2013/Programming Languages/sudoku/sudoku/Sudoku.h | UTF-8 | 1,086 | 3.0625 | 3 | [] | no_license | Name: Ryan Volum
VUnet ID: volumrh
e-mail: ryan.h.volum@vanderbilt.edu
Class: CS270
Honor Code: I promise that I neither gave nor received help on this assignment
#include <iostream>
#include <string>
#include <set>
using namespace std;
#ifndef Project1_Sudoku_h
#define Project1_Sudoku_h
class Sudoku{
private... | true |
de43921c04ed5a3902cbbe4e676d6a5c0787f559 | C++ | cesarl/Algorithm-Course | /part1/quick_find/UF.cpp | UTF-8 | 370 | 2.828125 | 3 | [] | no_license | #include "UF.hh"
template <int N>
void UF<N>::setUnion(int p, int q)
{
int pid = this->list_[p];
int qid = this->list_[q];
for (int i = 0; i < this->size_; ++i)
{
if (this->list_[i] == pid)
{
this->list_[i] = qid;
}
}
}
template <int N>
bool UF<N>::isConnected(int p, int q)... | true |
42f0bae7c771a3818736382139101062a8f3a379 | C++ | wolski-m/Smart-D-LED-API | /Patterns/color.h | UTF-8 | 526 | 2.671875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | class colorClass {
protected:
public:
// RGB Color
uint8_t red;
uint8_t green;
uint8_t blue;
// HSV Color
uint8_t hue = 215;
uint8_t saturation = 255;
uint8_t value = 255;
void setHSV()
{
for (int i = 0; i <= dled.num_leds; i++) {
for (int i = 0; i <= dled.num_leds; i++) {
dl... | true |
ef13060eba0eac626947670a1081a7280ea1ab7d | C++ | iammarajul/competitive_programming | /Codeforecs/1017A.cpp | UTF-8 | 414 | 2.6875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int arr[n+1];
int m;
for(int i=0;i<n;i++)
{
int a,b,c,d;
cin>>a>>b>>c>>d;
if(i==0) m=a+b+c+d;
arr[i]=a+b+c+d;
}
sort(arr,arr+n,greater<int>());
for(int i=0;i<n;i++)
{
... | true |
951ddfb2b5f1d47b33a024360856d414f95fa2e8 | C++ | JakeEMuller/CS3421-CompOrg | /CPUSIM/CS3421_emul.cpp | UTF-8 | 4,955 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "Cpu.h"
#include "Memory.h"
#include "clock.h"
using namespace std;
int main(int argc, char** argv) {
if(argc <= 1){
return 0; //for testing purposes
}
//get the name of the file from the command lin... | true |
762605079bfd8c8e5637e861b33b72ce486216ec | C++ | david-andrew/PRS_robot | /RobotDriver/PressModule.cpp | UTF-8 | 5,814 | 2.9375 | 3 | [
"MIT"
] | permissive | /**
MIT License
Copyright (c) 2019 David-Andrew Samson
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, co... | true |
4f9c8eb9c1172e5f5bca78ca24e5a1ebad32e4c2 | C++ | dariahazaparu/FMI | /Year I/Data Structures/TEMA II/exercitiu4/main.cpp | UTF-8 | 4,669 | 3.15625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
using namespace std;
ifstream f("exercitiu4matrice.txt");
struct coada{
int info;
coada * prev, * next;
}*pointer_global_prim_element,
*pointer_global_ultim_element;
void push_right( int x )
{
coada * s = new coada;
if (!pointer_global_prim_element)
{
... | true |
e7596646a4ab5636da3c506cb12912d6823867d3 | C++ | AryanRaj315/CompetitiveProgrammingSolutions | /RandomDFSExperiment.cpp | UTF-8 | 456 | 2.796875 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
const int N = 1e6+5;
vector<int> g[N];
bool vis[N];
void dfs(int u){
for(int v: g[u]){
if(vis[v]) continue;
else dfs(v);
}
}
int main(){
int n, m, u, v;
cin >> n>> m >> u >> v;
while(m--){
cin >> u >> v;
g[u]... | true |
0acfb89fd5d02af9fff197de2397203aca568d5d | C++ | frazierde12/Sample-C-Code-for-Classes | /CSC1180/Complex.h | UTF-8 | 374 | 2.890625 | 3 | [] | no_license | #ifndef COMPLEX_H
#define COMPLEX_H
class Complex
{
public:
// Constructor(s)
Complex(int, int);
// Accessors
int getReal()const;
int getImaginary()const;
// Mutators
void setReal(int);
void setImaginary(int);
std::string printComplex();
Complex operator+(Complex);
private:
// member da... | true |
bae522d3c627d13eb217e1e87d23a44d4d5c9f35 | C++ | kinetickansra/algorithms-in-C-Cplusplus-Java-Python-JavaScript | /Algorithms/searching/C++/binary_search.cpp | UTF-8 | 1,633 | 4.5625 | 5 | [
"MIT"
] | permissive | /*
Binary Search
-----------
A searching algorithm that finds the position of a target value
within a sorted array.
Time complexity
---------------
O(log(N)), where N is the number of elements in the array.
Space complexity
----------------
O(1).
*/
#include <iostream>
#... | true |
65088e3caff9cfda85c02a0d6c6c8ef54ed73a71 | C++ | ppershing/mosaic-from-images | /trunk/src/ThumbnailStack.cpp | UTF-8 | 2,075 | 2.546875 | 3 | [] | no_license | // created and maintained by ppershing
// please report any bug or suggestion to ppershing<>fks<>sk
#include "ThumbnailStack.h"
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include <SDL/SDL_rotozoom.h>
#include <string>
#include "MyAssert.h"
#include "Cache.h"
ThumbnailStack::ThumbnailStack(){
stack.r... | true |
44e9464e46d428b434687e631b320e09667e7a1c | C++ | chrihill/CSC375_Data-Structures | /Queue/main.cpp | UTF-8 | 535 | 3.21875 | 3 | [] | no_license | #include <iostream>
#include "Queue.h"
using namespace std;
int main()
{
Queue<int> q;
q.enque(10);
q.enque(20);
int val;
q.dequeue(val);
cout << val << endl;
Queue<int> q2;
q2 = q;
q2.enque(30);
q2.peek(val);
c... | true |
75e21efb9c12834d77fff422ab331db930b4bce0 | C++ | deepakantony/competitive_programming | /uva_online_judge/programming_paradigms/dynamic_programming/CoinChange_674.cxx | UTF-8 | 1,924 | 3.28125 | 3 | [] | no_license | // Coin Change
// Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and
// 1-cent. We want to make changes with these coins for a given amount of
// money.
//
//
// For example, if we have 11 cents, then we can make changes with one 10-cent
// coin and one 1-cent coin, two 5-cent coi... | true |
ff36ff4be77dcc6204b468fb72fd50bddffd8235 | C++ | TECHMATHEMA/Linguagem-C-_-exerc-cios-e-demais | /exercicio_lista2_1_múltiplo de 3.cpp | WINDOWS-1252 | 493 | 3.296875 | 3 | [] | no_license | /* 5 - Escreva um algoritmo que receba um nmero e imprima uma das mensagens: mltiplo de 3 ou no mltiplo de 3.*/
#include<stdio.h>
#include<conio.h>
#include<math.h>
#include<stdlib.h>
#include<locale.h>
main() {
setlocale(LC_ALL, "Portuguese");
int b;
printf("\n\n Escreva o nmero inteiro \n\n");
... | true |
bfebeed9e5504a4bad0f3b851ebfab3f47fa7059 | C++ | lyost/d3d12_framework | /d3d12_framework/private_inc/D3D12/Textures/D3D12_TextureCube.h | UTF-8 | 2,919 | 2.8125 | 3 | [] | no_license | #ifndef D3D12_TEXTURE_CUBE_H
#define D3D12_TEXTURE_CUBE_H
#include <d3d12.h>
#include "Graphics/GraphicsCore.h"
#include "Graphics/Textures/TextureCube.h"
class D3D12_TextureCube : public TextureCube
{
public:
/// <summary>
/// Creates a D3D12 texture
/// </summary>
/// <param name="graphics">
/... | true |
9ffe15d73860f6a2fc19d2a761c7f794b4d3af33 | C++ | nuup20/Craftman-Engine | /dqUtility/src/dqVector2i.cpp | ISO-8859-3 | 3,888 | 2.75 | 3 | [] | no_license | #include <assert.h>
#include "dqVector2.h"
#include "dqVector2i.h"
#include "dqPlatformMath.h"
#define Math PlatformBaseMath
namespace dqEngineSDK
{
Vector2i::Vector2i()
{
}
Vector2i::Vector2i(DEF_INIT::E)
{
//TODO: Hago una evaluacin primero, o una igualacin.
}
Vector2i::Vector2i(... | true |
12469de0163177d7c5b59ad09705513232c7f821 | C++ | azharsid96/MovementAlgorithms | /of_v0.11.0_vs2017_release/apps/myApps/Movement Algorithms Project/AIMovementAlgorithms/AIMovementAlgorithms/src/DynamicBlendedBehavior.cpp | UTF-8 | 2,130 | 3.328125 | 3 | [
"MIT"
] | permissive | #include "DynamicBlendedBehavior.h"
DynamicBlendedBehavior::DynamicBlendedBehavior(float maxAccelerationMagnitude, float maxAngularAccelerationMagnitude)
{
this->maxAccelerationMagnitude = maxAccelerationMagnitude;
this->maxAngularAccelerationMagnitude = maxAngularAccelerationMagnitude;
}
DynamicBlendedBehavior::~D... | true |
5de28a8da844a29c731c76e9dcfc3981578b48de | C++ | ysripath/Practice | /Spring2018/printBalancedParanthesis.cpp | UTF-8 | 2,952 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
using namespace std;
bool isValid(string s) {
int l = s.length();
if (l < 2)
return false;
stack<char> bracketStack;
for (int i = 0; i < l ; i++)
{
... | true |
247c8fd6f0b78ffb9dd7de152dffc33025f30dc5 | C++ | JustFlare/ClickHouse | /dbms/src/AggregateFunctions/AggregateFunctionFactory.cpp | UTF-8 | 10,393 | 2.9375 | 3 | [
"Apache-2.0"
] | permissive | #include <AggregateFunctions/AggregateFunctionFactory.h>
#include <DataTypes/DataTypeAggregateFunction.h>
#include <DataTypes/DataTypeArray.h>
#include <DataTypes/DataTypeNullable.h>
#include <DataTypes/DataTypesNumber.h>
#include <IO/WriteBuffer.h>
#include <IO/WriteHelpers.h>
#include <Interpreters/Context.h>
#incl... | true |
8850ee8818e1b05534b9076e90f6e3efa1d85f78 | C++ | yular/CC--InterviewProblem | /LintCode/lintcode_wood-cut.cpp | UTF-8 | 975 | 3.234375 | 3 | [] | no_license | /*
*
* Tag: Binary Search
* Time: O(lgn)
* Space: O(1)
*/
class Solution {
public:
/**
*@param L: Given n pieces of wood with length L[i]
*@param k: An integer
*return: The maximum length of the small pieces.
*/
int woodCut(vector<int> L, int k) {
// write your code here
int... | true |
fdeab7825d3b25e32abc03a327dfeccbc0c31f67 | C++ | resoliwan/cprimary | /l09/11_usenamesp.cpp | UTF-8 | 577 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include "11_namesp.h"
void other(void);
void another(void);
int main(void)
{
using debts::Debt;
Debt golf = { {"f_1", "l_1"}, 1};
debts::showDebt(golf);
another();
other();
return 0;
}
void other(void)
{
using namespace debts;
Debt two[2];
for (int i = 0; i < 2; i++)
getDe... | true |
05ec3691ab16fec60ac5b51eaa7d81cc1e90047b | C++ | Capri2014/math | /test/unit/math/rev/mat/fun/softmax_test.cpp | UTF-8 | 2,352 | 2.515625 | 3 | [
"BSD-3-Clause",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <stan/math/rev/mat.hpp>
#include <gtest/gtest.h>
#include <test/unit/math/rev/mat/fun/util.hpp>
#include <test/unit/math/rev/mat/util.hpp>
#include <vector>
TEST(AgradRevMatrix, softmax) {
using Eigen::Dynamic;
using Eigen::Matrix;
using stan::math::softmax;
using stan::math::vector_v;
EXPECT_THROW... | true |
614b84c2db7e3f8668bc59b45e1e3635cd828eae | C++ | lebinhe/AF | /detail/strings/string_hash.h | UTF-8 | 859 | 2.78125 | 3 | [] | no_license | #ifndef AF_DETAIL_STRINGS_STRINGHASH_H
#define AF_DETAIL_STRINGS_STRINGHASH_H
#include "AF/assert.h"
#include "AF/basic_types.h"
#include "AF/defines.h"
namespace AF
{
namespace Detail
{
/*
* Simple hash utility for C strings.
*/
class StringHash {
public:
enum {
RANGE = 256
... | true |
22eafb45e2f217044756afd30e638d56555d20cd | C++ | naningntch/ProFun1 | /8.1.cpp | UTF-8 | 549 | 2.71875 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int count1, count2;
scanf("%d %d", &count1, &count2);
int def = count1 - count2;
for (int i = 0; i < count1; i++) {
for (int j = 0; j < count1; j++) {
if (((i < count2) && (j + i < count2)) || ((j >= def) && (j - i >= def)) || ((i >= def) && (i - j >=... | true |
e6202cacc45aa5eccb106d0cda2446e374d2cad8 | C++ | centhoang/BlasterMasterEngine | /BlasterMasterEngine/Assets/Bullets/Enemy/EnemyBullet.cpp | UTF-8 | 2,206 | 2.546875 | 3 | [] | no_license | #include "d3dpch.h"
#include "EnemyBullet.h"
#include "Core/SceneManager/SceneManager.h"
#include "Assets/Particles/NormalExplosion.h"
#include "Assets/Characters/Sophia/Sophia.h"
#include "Assets/Characters/Jason/Jason.h"
EnemyBullet::EnemyBullet(float x, float y, bool pHorizontal, bool pIsFacingRight)
: Object2D(x, ... | true |
2e7a224e8a947ded65ceebe320d548f613413789 | C++ | jaime-varela/RKF45 | /rk45/rk45utils.h | UTF-8 | 1,494 | 2.953125 | 3 | [
"MIT"
] | permissive | #pragma once
#include "rk45Concepts.h"
namespace RungeKutta
{
//error calculation function
template<NumT number = double,Index index = int,CoordinateContainer<number> coords>
number err_norm(const coords& a)
{
number result =0;
for(index i = 0; i < a.size();i++)
{
result += (a[i])*(a[i]);... | true |
470a1d19efbf632ea6f704c60ab0f0cd0c0d74a9 | C++ | oanaatasie/POO | /P2_TEMA_13/Tema 13/include/Matrice.h | UTF-8 | 582 | 2.75 | 3 | [] | no_license | #ifndef MATRICE_H
#define MATRICE_H
using namespace std;
class Matrice{
private:
int **a;
public:
Matrice();
Matrice(int **a);
Matrice(const Matrice &matrice);
int** getMatrice();
int getdim(int **a) const;
void setMatrice(int **a);
Matrice& operator=(const Matrice &matr... | true |
ab574a803b95f67bcfe69b6c77f793b70cbd76dd | C++ | togashi13/402 | /ColorImageClass.cpp | UTF-8 | 2,889 | 2.890625 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "const_pro2.h"
#include "ColorClass.h"
#include "RowColumnClass.h"
#include "ColorImageClass.h"
ColorImageClass::ColorImageClass()
{
for (int i = 0; i < IMAGE_ROW; ++i)
{
for (int j = 0; j < IMAGE_COL; ++j)
{
pixels[i][j].setToBla... | true |
4f5721b9c1b00829315f51769ab7d7608075d788 | C++ | kburgon/salem-candy-dispenser | /salemTrigger/salemTrigger.ino | UTF-8 | 921 | 2.765625 | 3 | [
"MIT"
] | permissive | const int buttonPin = 6;
bool sendMsg = true;
String results = "1";
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
// If sendMsg == false, then the pi is playing a sound byte. Don't check for a trigger.
... | true |
ff5dc5ba681ebe7bdbaa8457dc93412dd663384c | C++ | dtruhlar/Sachy | /klavesnice2SP/klavesnice2SP.ino | UTF-8 | 2,521 | 3 | 3 | [] | no_license | #include <Keypad.h>
int LED_CLOSE = 11; // červená LED
int LED_OPEN = 12; // zelená LED
const byte ROWS = 4; // 4 řádky
const byte COLS = 4; // 4 sloupce
// sem se budou ukládat stiskuté znaky
char pressedKey[5] = {'0','0','0','0'};
// náš kód pro otevření dveří
char code[5] = {'1','9','4','7'};
// zde si n... | true |
1afbcf9c99e56ef7d73c7c05c220263de7ab464f | C++ | rmahidhar/algorithms | /c++/algorithms/segment-tree/segment-tree.cpp | UTF-8 | 2,740 | 3.609375 | 4 | [] | no_license | //
// Created by Mahidhar Rajala on 8/20/17.
//
#include <vector>
#include <functional>
#include <iostream>
#include <algorithm>
template<class T>
const T& max(const T& a, const T& b)
{
return (a > b) ? a : b;
}
template<class T>
T sum(const T& a, const T& b)
{
return a + b;
}
template<class T>
const T& m... | true |
89d98022b81dd39661f28e0ad153abef4f5fad15 | C++ | Risgrynsgrot/bammi | /src/StreamQuad.cpp | UTF-8 | 2,786 | 2.8125 | 3 | [] | no_license | #include "StreamQuad.h"
#include <assert.h>
#include "ErrorHandler.h"
#include "WindowHandler.h"
void StreamQuad::Init(SDL_Renderer* aRenderer, Vector2i aSize)
{
assert(aRenderer != nullptr);
myRenderer = aRenderer;
myTexture = SDL_CreateTexture(myRenderer, SDL_PIXELFORMAT_RGB888, SDL_TEXTUREACCESS_STREAMING, aSiz... | true |
ec2ec5e1b6808c3184dd0606a3128c42d0259b86 | C++ | ChenxiTang/ece1373_project_lstm_seizure_detection | /c_code/fir_top/fir_top.cpp | UTF-8 | 2,317 | 2.546875 | 3 | [] | no_license | /*Top Level 22-channel 5-band FIR code with optimisation in HLS*/
/*Written by: Chenxi Tang */
/*Last Updated: 25 June 2019 */
/*Developed with Vivdo design suite 2017.2 */
/*Part of the course project for ECE1373 Digital Des... | true |
0a19da155a3754c965dba3e4781995f7c9315cac | C++ | wserrantola/SeekurJr | /seekur_12.04/packages/CAMERA_STEREO/mobile_ranger/include/mobile_ranger/libfrdev/FrImageLUTProc.h | UTF-8 | 2,699 | 2.53125 | 3 | [] | no_license | /****************************************************************************
* Copyright (c) 2007 by Focus Robotics.
*
* All rights reserved. No part of this design may be reproduced stored
* in a retrieval system, or transmitted, in any form or by any means,
* electronic, mechanical, photocopying, recording, or ... | true |
6b2186344cb013cde60ec011f4f86ccdb17853f5 | C++ | Cesaario/TrabalhoPraticoIndustrial | /ExibiçãoDeDefeitos/ExibicaoDeDefeitos.cpp | UTF-8 | 1,540 | 2.703125 | 3 | [] | no_license | #include <windows.h>
#include <process.h>
#include <stdio.h>
#include <conio.h>
#include <errno.h>
#include <string>
#include <iostream>
#include "DefeitoSuperficieTira.h"
#define TAMANHO_MENSAGEM 37
int main()
{
printf("Processo de exibicao de defeitos iniciando...\n");
HANDLE Handle_Console = GetStdHandle(STD... | true |
7a43e0a939420e3f08864a10a41b4c4cc1f08a8a | C++ | Burakkarakoyun/C-works | /Girilen Metinde Harf Arama.cpp | ISO-8859-9 | 808 | 2.796875 | 3 | [] | no_license | //girilen metinde ka tane istenilen harften oldugunu bulan program
//Burak KARAKOYUN
#include<stdio.h>
#include<locale.h>
char harf(char cumle[100],char ara){
int sayac=0;
for(int i=0;cumle[i]!='\0';i++){
//bu ksmda girilen cmledeki karakterleri tek tek istenilen harfle ayn m diye karlatryoruz.aynysa saya 1 ar... | true |
034e598bedce877a6e3a70e6de6e7600308c461a | C++ | hikerLi/gameserver | /KCP/connection.cpp | UTF-8 | 2,058 | 2.59375 | 3 | [] | no_license | #include "connection.h"
#include <iostream>
#include <cstring>
#include <KCP/connectionmanager.h>
#include <Common/logmanager.h>
#include <Common/memorypool.h>
#include <Common/common.h>
Connection::Connection()
{
}
Connection *Connection::Create(const kcp_conv_t &conv, const Endport &ePort, ConnectionManager *conn... | true |