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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c444c08759a22eadc04191dd870aeda2a088c3bf | C++ | xiaodarbor/GET1033-Project | /rain_code/rain_code.ino | UTF-8 | 5,637 | 2.890625 | 3 | [] | no_license |
//define all LEDs
int Row1 = 13; //level 1
int Row2 = 12; //level 2
int Row3 = 11; //level 3
int Col1 = 10;
int Col2 = 9;
int Col3 = 8;
int Col4 = 7;
int Col5 = 6;
int Col6 = 5;
int Col7 = 4;
int Col8 = 3;
int Col9 = 2;
int rowmax = 3;
int colmax = 9;
int Col[9];
int Row[3];
... | true |
7912e919c3728c1f378384e32871c717a75c3f01 | C++ | salhyun/TerrainEditor | /RenderWare/LightScatteringData.h | UTF-8 | 2,651 | 2.53125 | 3 | [] | no_license | #pragma once
#include "Vector3.h"
#include "Vector4.h"
struct sLightScatteringShaderParams
{
Vector4 vBeta1;
Vector4 vBeta2;
Vector4 vBetaD1;
Vector4 vBetaD2;
Vector4 vSumBeta1Beta2;
Vector4 vLog2eBetaSum;
Vector4 vRcpSumBeta1Beta2;
Vector4 vHG;
Vector4 vConstants;
Vector4 vTermMultipliers;
Vector4 vSoilRe... | true |
8d45598d3a5cbae2a2c05202b48fc500a083a6fe | C++ | Sherry-Shi/hashtable | /hashtable_implementation.cpp | UTF-8 | 6,405 | 3.296875 | 3 | [] | no_license | 下面的代码实现,可以说还是算很标准的hashmap的实现,hashmap里面的hash function需要自己实现,就像priority_queue里面的comparator, hash_function也是作为一个template 参数进行定义的,需要用户自己去实现。
下面的hashmap实现, 包含:
1. getEntry, putEntry, remove, size, isEmpty()等api
2. 对hashmap经常可能出现的conflict进行了处理,用的是 separate chaining来做的;
3. 处理了当hashtable的存储空间超过了load_factor的时候,需要进行resize的需求
4.... | true |
2ba1379272f7f7a80146cd2a82c1e6aa981424b1 | C++ | cronin101/AcceleratedCPP | /Containers/bettergrader.cpp | UTF-8 | 1,052 | 3 | 3 | [] | no_license | #include <algorithm>
#include <iomanip>
#include <ios>
#include <iostream>
#include <stdexcept>
#include <string>
#include <vector>
#include "grade.h"
#include "student_info.h"
using namespace std;
int main(const int argc, const char** argv) {
vector<Student_Info> students;
string::size_type max_name_len = 0;
... | true |
700b7f10b6dd8224581a288579c1af05d444424a | C++ | kapilchhajer-zz/problem_solving | /leetcode/ReorderList.cpp | UTF-8 | 2,243 | 3.484375 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
using namespace std;
/**
* Definition for singly-linked list. */
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode* split(ListNode *head){
ListNode *temp;
temp... | true |
86942e76658a9e9fe0ca7f37fa697756675f35de | C++ | wurikiji/algorithm-PS | /acmicpc/1546.cpp | UTF-8 | 444 | 2.859375 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
int n;
vector<int> v;
scanf("%d", &n);
while(n--) {
int temp;
scanf("%d", &temp);
v.push_back(temp);
}
sort(v.begin(), v.end());
double dap = 0.0;
for(int i = 0 ;i < v.s... | true |
d7d1e755bb54b6eef9ddb455bf47064256df0d67 | C++ | santiago-alvarezjulia/Taller2c | /TP3/common_socket.cpp | UTF-8 | 3,758 | 2.53125 | 3 | [] | no_license | #define _POSIX_C_SOURCE 200112L
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdbool.h>
#include <errno.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <iostream>
#include <string>
#include "common_socket.h"
#include "common_SocketError.h"
#define OK 0
#define ERRO... | true |
45bc5b5db2569834082b7c22421f8503db5ef4f6 | C++ | ErickEnriquez/CSE-310 | /Project 1/Code/project1.cpp | UTF-8 | 33,956 | 3.046875 | 3 | [] | no_license | /*Erick Enriquez
*/
#include<cstring>
#include <string>
#include <iostream>
#include "defns.h"
using namespace std;
// helperfunctions
bool compare(mlb_stats,mlb_stats,std::string);//will compare 2 teams year
bool checkEquality(mlb_stats,mlb_stats,string);
bool compareName(mlb_stats,mlb_stats);// ... | true |
ca838e442b494dfd7037eef57c503208ce2c4ce2 | C++ | luizinbrzado/FATEC | /Lista 3.1 - Ex7.cpp | ISO-8859-1 | 508 | 3.328125 | 3 | [] | no_license | /*Criar um algoritmo que leia um nmero (NUM) e ento imprima os mltiplos de 3 e
5, ao mesmo tempo, no intervalo fechado de 1 a NUM*/
#include <stdio.h>
#include <locale.h>
main() {
setlocale(LC_ALL, "");
int i, num, tres, cinco;
printf("Coloque um nmero: ");
scanf("%d", &num);
for(i=1; i<=num; i++) {
... | true |
53de3520fc9326df28d4edc8ed7148f196b734e4 | C++ | mfc10001/baoluo | /ise/examples/game_server/game_core/GamePackage.cpp | UTF-8 | 5,047 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive |
#include "GameItemManager.h"
#include "../game_define/EntryBase.h"
#include "GamePlayer.h"
#include "../bass_class/Entry.h"
#include "../game_define/ItemBase.h"
#include "GameItem.h"
PackageBase::PackageBase(GameItemManager* im, uint32 type)
: m_size(0)
, m_type(type)
, m_im(im)
{
initCapacity();
}
inline uint32... | true |
0f025fe854bf2af02948d5ef774524b5d3b634d8 | C++ | nian0601/CubeEngine | /Solution/Engine/CE_FileSystem.cpp | UTF-8 | 3,589 | 2.859375 | 3 | [] | no_license | #include "stdafx.h"
#include "CE_FileSystem.h"
bool CE_FileSystem::GetAllFilesFromDirectory(const char* aDirectory, CE_GrowingArray<FileInfo>& someOutFilePaths)
{
CE_ASSERT(strlen(aDirectory) + 3 < MAX_PATH, "Path to directory is too long");
CE_String directory = aDirectory;
directory += "/*";
WIN32_FIND_DATA da... | true |
74ee9b05d6841c57aa162cb755fe21a43c5d2a72 | C++ | hilbertanjou/OJ | /Codeforces/272 - Codeforces Round #167 (Div. 2)/C.cpp | UTF-8 | 1,414 | 2.515625 | 3 | [] | no_license | #include <algorithm>
#include <cstdio>
using namespace std;
#define l x << 1
#define r (l) + 1
typedef long long LL;
const int MAXN = 444444;
LL d[MAXN], e[MAXN];
inline void push(int x) {
if (e[x]) {
d[l] = d[r] = e[l] = e[r] = e[x];
e[x] = 0;
}
}
inline void update(int x) {
d[x] = m... | true |
9afe09108614b63561e4b51e466c18fe29c54754 | C++ | aidanjoh/ENCM511_Fall2019 | /Lab0_BF609_MOCKEDLEDandSwitches_Core0/src/Lab0_GeneralCode.cpp | UTF-8 | 6,221 | 2.578125 | 3 | [] | no_license | /*
* Lab0_GeneralCode.cpp
*
* Created on: September 19, 2019
* Author: Aidan
*/
#include <sys/platform.h>
#include "adi_initialize.h"
#include "Lab0_BF609_MOCKEDLEDandSwitches_Core0.h"
#include <stdio.h>
#define GARBAGE_VALUE 0xF2
//The garbage value was -1 before and (0xF2)
static bool My_Init_SwitchInt... | true |
819d73aa499e9b488ed0936d6f92a70d6aa721d9 | C++ | ekaterin17/Coursera-cpp | /4 Brown/Brown Belt Final/Transport A/parse.h | UTF-8 | 450 | 2.59375 | 3 | [] | no_license | #pragma once
#include <utility>
#include <string_view>
#include <optional>
std::pair<std::string_view, std::optional<std::string_view>> SplitTwoStrict(std::string_view s, std::string_view delimiter = " ");
std::pair<std::string_view, std::string_view> SplitTwo(std::string_view s, std::string_view delimiter = " ");
... | true |
c8f4c5c9040eb0dea6969cdd7ce468f1e56a2f2a | C++ | Sarthak2/3rdSem-Data-Structures-Lab | /Labs_5_6_Application_Of_stacks/queueusingstack.cpp | UTF-8 | 672 | 2.90625 | 3 | [] | no_license | #include <iostream>
#include "stack1.cpp"
using namespace std;
class QusingStack{
stack1 s1, s2;
public :
void enQ(char ele)
{
while(!s1.isEmpty())
{
s2.push(s1.pop());
}
s1.push(ele);
while(!s2.isEmpty())
{
s1.push(s2.pop());
}
}
... | true |
fcc3185402ace4c15da5588431f8de33b0de3228 | C++ | vovadenisov/c-_project | /ourproject/container.h | UTF-8 | 2,117 | 2.890625 | 3 | [] | no_license | #ifndef CONTAINER_H
#define CONTAINER_H
#include <string>
#include <vector>
#include <map>
#include <SDL/SDL.h>
#include <iostream>
#include <stdio.h>
#include <ctime>
#include <stdlib.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_image.h>
#include <form.h>
#include <queue>
#include <utility>
using namespace std;
cl... | true |
1cfcb4cb39be86ec52b44bc92d2169a3a42f926b | C++ | WagnerMarcos/Algo2TP2 | /include/Complex.h | UTF-8 | 3,645 | 3.265625 | 3 | [] | no_license | #ifndef COMPLEX_H
#define COMPLEX_H
#include <iostream>
#include <limits>
#include <algorithm>
#include <cmath>
// Función para la comparación con margen de error:
template<typename T>
inline bool almostEqual(T a, T b);
template <typename T = long double>
class Complex {
T x;
T y;
static T acceptableDelta;
public... | true |
488989dba26c8295737431defc1ad9bdcd716abb | C++ | Turan-Chowdhury/Labs | /Data Structure Lab program/MID/Pattern Matching.cpp | UTF-8 | 597 | 3.265625 | 3 | [] | no_license | #include<iostream>
#include<cstring>
using namespace std;
int main()
{
char T[100], P[100];
cout<<endl<<"Enter a String Text : ";
cin.getline(T,100);
cout<<endl<<"Input Pattern : ";
cin.getline(P,100);
int s = strlen(T);
int r = strlen(P);
int k = 0;
int max = s-r;
while(k<... | true |
69234fcc6ba4de9da0f40b3d2d5c969f71fc00e4 | C++ | NefedovDA/Huffman | /utility/main.cpp | UTF-8 | 3,447 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstring>
#include "header/file_compress.h"
#include "header/file_decompress.h"
#include "header/file_writer.h"
#include "header/file_reader.h"
#include <ctime>
#include <random>
#include <cassert>
//uint8_t buf[83886080];
int main(int argc, char **argv) {
if (argc ==... | true |
9db20c08c17bbb4a410d359defe8fe78c24c2cb5 | C++ | MachineGunLin/LeetCode_Solutions | /无标签/284. 顶端迭代器.cpp | UTF-8 | 3,701 | 4.28125 | 4 | [] | no_license | /*
这题给的类原型里PeekingIterator类公有继承自类Iterator,所以我们可以调用基类的next()和hasNext()方法。
虽然在class Iterator里只对next()和hasNext()方法做了声明,但是实际上类外肯定对这两个方法做了实现,所以我们
是可以直接调用Iterator::next()和Iterator::hasNext()来获取迭代器的下一个元素以及判断是否还存在下一个元素。
我们再来看子类PeekingIterator,这个类里我们要实现peek()、next()、hasNext(),还需要在构造函数里进行初始化。
先看peek(),因为返回值是int类型,是当前遍历到的元素的下一... | true |
6eeec125afe7f64fd76b79d879d81a27ee836623 | C++ | emeitu/test | /boost/main.cpp | UTF-8 | 1,931 | 2.5625 | 3 | [] | no_license | /*************************************************************************
> File Name: main.cpp
> Author:
> Mail:
> Created Time: Mon 20 Apr 2015 06:06:04 PM CST
************************************************************************/
#include<iostream>
using namespace std;
#include <boost/program_option... | true |
3274c670c8d79d10685571aaaaf81ad85a48d104 | C++ | Minusie357/Algorithm | /BackjoonAlgorithm/1043. 거짓말.cpp | UTF-8 | 1,608 | 2.59375 | 3 | [
"Unlicense"
] | permissive | //#include <iostream>
//#include <vector>
//#include <queue>
//using namespace std;
//
//#ifdef _DEBUG
//#include "Utility.h"
//#endif // _DEBUG
//
//
//
//constexpr int nmax = 51;
//int main()
//{
// ios::sync_with_stdio(false);
// cin.tie(NULL);
//
// int n, m;
// cin >> n >> m;
//
// int num_truth_people;
// cin >> ... | true |
0cbb56203829eeb6772d831aff80c1aa162c1a41 | C++ | WillPlumHub/RPG | /commandMenu.cpp | UTF-8 | 1,713 | 3.890625 | 4 | [] | no_license | /*This program is meant to manage the command selection.
Firstsly, a menu is output to show the user their options.
Secondly, the user is prompted to type the command they wish to execute.
Then, the program should check the user's responce and take the appropriate action.*/
#include <iostream>
#include <string>
#inclu... | true |
dae7578e44a5ebc39fe481834e4bd12936d0c0ef | C++ | pawanrj7/DSA | /Recersive_reverse_of_linklist.cpp | UTF-8 | 859 | 3.71875 | 4 | [] | no_license | #include<iostream>
using namespace std;
struct node
{
int data;
struct node *next;
}*head=NULL;
void create(int arr[], int n)
{
struct node *t, *last;
head= new node;
head->data=arr[0];
head->next= NULL;
last=head;
for(int i=1;i<n;i++)
{
t= new node;
t->d... | true |
90e09fedc2eb0c52ba13ecec06865fd71bc36f9e | C++ | jongtae0509/codeup | /4000/4021_1.cpp | UTF-8 | 452 | 2.734375 | 3 | [] | no_license | /**************************************************************
4021번
jongtae0509
C++
정확한 풀이코드 길이:233 byte(s)
수행 시간:0 ms
메모리 :1120 kb
****************************************************************/
#include<stdio.h>
int main(){
int a[8];
int i;
int sum=0;
for(i=0;i<7;i++){
scanf("%d",&a[i]);
}
for(i=0;i<7;... | true |
d9b98ce9024b7494f0e5363a8d13f81d802a1a2b | C++ | teraNybble/rotateGame | /Projectile.cpp | UTF-8 | 706 | 3.078125 | 3 | [] | no_license | #include "Projectile.h"
Projectile::Projectile() : GameObject(Game2D::Rect(0, 0, 1, 1))
{
Projectile(Game2D::Pos2(0, 0));
}
Projectile::Projectile(Game2D::Pos2 pos) : GameObject(Game2D::Rect(pos,1,1))
{
speed = 100;
setSprite(Game2D::Sprite(Game2D::Rect(pos,1,1), Game2D::Rect(0, 0.5, 0.19921875, 0.19921875)));
s... | true |
d4b64a1f92accff17e0986bdae32929610ed1952 | C++ | AdrianSad/Gravity-Simulation | /Simulation/PlanetInfo.cpp | UTF-8 | 969 | 2.953125 | 3 | [] | no_license | #include "PlanetInfo.hpp"
#include <iostream>
#include <iomanip>
PlanetInfo::PlanetInfo(){
font.loadFromFile("fonts/Pixel.ttf");
text.setFont(font);
text.setCharacterSize(12);
text.setFillColor(sf::Color::White);
text.setPosition(250, 10);
}
void PlanetInfo::update(float elapsedTime, Universe universe, RenderW... | true |
a9633cc5a9000a6c47b8d3703b79a5ae233d7f14 | C++ | allstarschh/training-handout | /debugging/ex_static_assertions_cpp/ex_static_assertions_cpp.cpp | UTF-8 | 306 | 3.0625 | 3 | [
"BSD-3-Clause"
] | permissive | //--> slide
enum E { A, B, C, NumElements };
static const char * strings[] = { "A", "B", "C" };
static_assert( sizeof strings / sizeof *strings == NumElements,
"Oops, 'strings' and 'E' don't have the same number of elements" );
//<-- slide
int main()
{
(void)strings;
return 0;
}
| true |
8e39325cdabecbb3a16ece198c1ccba3d8c32275 | C++ | a-quelle/CppStuff | /Chess/main.cpp | UTF-8 | 2,397 | 2.515625 | 3 | [
"MIT"
] | permissive | #include "mainwindow.h"
#include <QApplication>
QImage emptyBoard;
QImage blueBox;
QImage redBox;
QImage blackBox;
QImage whiteBox;
std::vector<QImage> pieceSprites;
void loadAssets(){
QImageReader reader("/home/anton/QtCode/Chess/images/board.jpg");
reader.setAutoTransform(true);
emptyBoard = reader.read... | true |
7acb407ee532a58707bb7ef015b331c64083fe12 | C++ | rthomas67/te466-monster-moto-single-channel-arduino | /arduino/te466_driver/libraries/te466_driver/SignalInputPin.h | UTF-8 | 1,581 | 3.03125 | 3 | [
"MIT"
] | permissive | #include <Arduino.h>
#include "Signal.h"
/*
* SignalInputPin.h
*
* Created on: Nov 25, 2016
* Author: rrt
*/
#ifndef LIBRARIES_TE466_DRIVER_SIGNALINPUTPIN_H_
#define LIBRARIES_TE466_DRIVER_SIGNALINPUTPIN_H_
class SignalInputPin : public Signal {
/*
* The pin from which the digital ... | true |
dfdbaa3dc6e2350fa15512ee88e9267aa2dd9af7 | C++ | cbrown3010/EsperantoArduino | /EspernatoSketch.ino | UTF-8 | 908 | 3.265625 | 3 | [] | no_license | #include <Servo.h> //Import the servo header
Servo panCamera, tiltCamera; //Initialize both motors
String data = ""; //Empty string to receive commands
void setup() {
servoPan.attach(10); //Assign servos to pins
servoTilt.attach(11);
Serial.begin(9600); //Set baudrate of 9600
}
void loop() {
w... | true |
5a6fcd2ecb1d61b98dad2dad95e42b9ee7b018de | C++ | yohshiy/programmers_notes | /lang/cpp/coroutine/EnumerableMixin.h | UTF-8 | 1,574 | 3.203125 | 3 | [
"MIT"
] | permissive | ///
/// Enumerable Mixin クラス
///
///
#ifndef __ENUMERABLE_MIXIN_H__
#define __ENUMERABLE_MIXIN_H__
#include <boost/coroutine2/coroutine.hpp>
/// Enumerable Mixin.
/// 継承して Each メソッドを実装すると
/// イテレーターを返す begin(), end() が使えるようになる
template <typename ElementType>
class EnumerableMixin
{
using coroutine_type = typena... | true |
8118adb1746dfdca81270fa5357bc4292339990a | C++ | GreenStaradtil/AU-E19-E1OPRG | /L08/E8.1/AccessCode.cpp | UTF-8 | 1,755 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include "AccessCode.h"
void createCode( char codeAlias[] )
{
int ascii;
srand( time(0) );
for( size_t index=0; index<CODE_SIZE; index++ )
{
ascii = (rand()%75 + 48);
// if ascii number is NOT a letter or digit (check ASCII table)
if( 57<ascii && ascii<65 || 90<asci... | true |
fc957ef5fa320403a44c3489d1b454dddf434e4c | C++ | shrutiarora312/Compiler-lab-codes | /accept string/string_accepted.cpp | UTF-8 | 779 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
#include<string.h>
#include<stdio.h>
using namespace std;
int main()
{
char string[20];
int state=0,count=0;
cout<<"the grammar is: S->aS, S->Sb, S->ab \n";
cout<<"enter the string to be checked \n";
gets(string);
while(string[count]!='\0')
{
switch(state)
... | true |
b5520f7d27156b0d981971460edff86611010f6f | C++ | ThomasV42/Tete_Robotisee | /src/ServoMoteurRC.h | UTF-8 | 4,399 | 3.109375 | 3 | [] | no_license | /**
\file ServoMoteurRC.h
\class ServoMoteurRC
\brief Classe permettant le controle des servomoteurs fonctionnant en MLI Modulation par largeur d'impulsions)
\version 1.00
*/
#ifndef SERVOMOTEURRC_H
#define SERVOMOTEURRC_H
#include <iostream>
#include <string>
#include <vector>
#include "serialib.h"
#include "Servo... | true |
244960f57454810b1793a781c159c5472d7a2604 | C++ | RobertKraaijeveld/GrandeOmegaVisualization | /lib/DataProcesser/src/StatisticalAnalyzer/Classifiers/KNearestNeighbours/KNearestNeighbours.cpp | UTF-8 | 4,702 | 2.734375 | 3 | [] | no_license | #include "KNearestNeighbours.h"
#include "../../../Utilities/Utilities.h"
#include "../../Point/IClusteringPoint.h"
#include "../../GenericVector/GenericVector.h"
#include <vector>
#include <limits>
#include <iostream>
std::vector<std::shared_ptr<IClusteringPoint>> KNearestNeighbours::getNearestNeighbours(std::shared... | true |
904fcb2d3c3e6c365097fc3c6a61403d1ee71a1f | C++ | krishauser/KrisLibrary | /meshing/TriMesh.h | UTF-8 | 3,170 | 3.265625 | 3 | [] | permissive | #ifndef MESHING_TRIMESH_H
#define MESHING_TRIMESH_H
#include <KrisLibrary/math3d/primitives.h>
#include <KrisLibrary/math3d/Triangle3D.h>
#include <KrisLibrary/math3d/Ray3D.h>
#include <KrisLibrary/utils/IntTriple.h>
#include <vector>
#include <iosfwd>
/** @defgroup Meshing
* @brief Classes defining operations on ba... | true |
e608fc2ec05569a79149f0da14881de93bd3fb11 | C++ | zfzackfrost/incredible_vulk | /include/ivulk/core/uniform_buffer.hpp | UTF-8 | 4,135 | 2.890625 | 3 | [
"MIT"
] | permissive | /**
* @file uniform_buffer.hpp
* @author Zachary Frost
* @copyright MIT License (See LICENSE.md in repostory root)
* @brief `UniformBufferObject` class.
*/
#pragma once
#include <ivulk/config.hpp>
#include <ivulk/core/buffer.hpp>
#include <ivulk/core/shader_stage.hpp>
#include <iomanip>
#include <typeindex>
n... | true |
387bd7ecf3248eff03d636bf0384893bc6c8f3ef | C++ | adarshkumar8225/practice_c- | /SOLDVAL.cpp | UTF-8 | 782 | 2.796875 | 3 | [] | no_license | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
vector<int> a(n),l(n);
for(int i=0;i<n;i++)
{ cin>>a[i];l[i]=a[i];}
vector<int> r=l;
... | true |
97e6bce8e23fcad79a6d4794c06778060f8add80 | C++ | Hunter54/Expression-Evaluator | /main.cpp | UTF-8 | 1,569 | 3.671875 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include "Parse_evaluate.h"
#include <string>
using namespace std;
int main() {
string a;
int c;
do{
cout<<"\n\n\n__________MENU__________";
cout<<"\n 1-Enter new expression:";
cout<<"\n 2-Parse to prefix notation";
cout<<"\n 3-Evaluat... | true |
35693b00bf75769e9fbb525ce8afef1d25b75835 | C++ | aivarasatk/Piltuvelis | /exportwindow.cpp | UTF-8 | 4,466 | 2.578125 | 3 | [] | no_license | #include "exportwindow.h"
#include <QHBoxLayout>
#include <QDir>
#include <QFileDialog>
#include <QMessageBox>
ExportWindow::ExportWindow(QStringList genOptions, QWidget *parent) : QDialog(parent)
{
//formuojam opcija kelti i gen faila
optionExportToGen = new QCheckBox(textExportToGenFile);
opt... | true |
f257475deb5d650dde212e44fa913504dfd71d39 | C++ | JamShan/XYZGameEngine | /XYZGameEngine/Engine/Base/Collection/Array/Array.hpp | UTF-8 | 1,402 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | //
// Array.hpp
// XYZGameEngine
//
// Created by Leo on 2016/11/28.
// Copyright © 2016年 Leo. All rights reserved.
//
#ifndef Array_hpp
#define Array_hpp
#include <stdio.h>
#include "Object.hpp"
#include "Locker.h"
namespace XYZGame
{
typedef struct _ArrayNode
{
public:
_ArrayNode *next;
... | true |
d1f0c93ebd9797487239d31077cd4e01912f0403 | C++ | wildstang/2011_software | /CheesyPoofCode/matlab/mat.cpp | UTF-8 | 6,151 | 3.046875 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | #include <iostream>
#include "matrix.h"
const int num_inputs = 2;
const int num_outputs = 2;
const int num_states = 4;
//this is some complex code written by Austin Schuh which was made obsolete
//by the use of a different matrix library, but was kept because it
//represents a lot of work and could possibly be recycl... | true |
c4ec849b9ca76c9b0433f3f6a356ede3b685aedd | C++ | Matthew-E-Gould/Past-Projects | /IoT Plant Grower Sim/CW1/Weather.cpp | UTF-8 | 1,079 | 3.296875 | 3 | [] | no_license | #include "Classes.h"
Weather::Weather(uint16_t random1, uint16_t random2, uint16_t random3)
{
//intialisation works similarly to nextday to on intialisation class will run nexday
nextDay(random1, random2, random3);
}
Weather::~Weather()
{
}
void Weather::nextDay(uint16_t random1, uint16_t random2, uint... | true |
3641b9ea487528c1490b09d3dce390040b550603 | C++ | jvont/bones | /bones/core/typedefs.h | UTF-8 | 988 | 2.921875 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <functional>
#include <memory>
namespace bones
{
// signed integers
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
// unsigned integers
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
u... | true |
78003b32f21249dd024de337fe18aab613c799c2 | C++ | KushRohra/GFG_Codes | /Easy/Roof Top.cpp | UTF-8 | 387 | 2.625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--) {
int n,i;
cin>>n;
int a[n];
for(i=0;i<n;i++)
cin>>a[i];
i=0;
int j=0,maxLen=-1;
while(i<n) {
j=i+1;
while(j<n && a[j]>a[j-1])
j++;
maxLen=max(maxLen,j-i... | true |
99148efcd5f3a99a474512811f712c5d78c47dcb | C++ | dzzhan/exam | /exam/candy.cpp | UTF-8 | 1,097 | 3.296875 | 3 | [] | no_license | #include "pch.h"
int candy(int* ratings, int ratingsSize) {
int totalSize = ratingsSize;
int i = 0;
int* candyCnt = (int*)malloc(sizeof(int) * ratingsSize);
memset(candyCnt, 0, sizeof(int) * ratingsSize);
for (i = 0; i < (ratingsSize - 1); i++) {
if ((ratings[i] < ratings[i + 1]) && (candyCnt[i] >= candyCnt[i +... | true |
31adf87d4791a0441602c0a4630669fdd11124f1 | C++ | oldnick85/anamnesis | /anamnesis_trm/terminal/io/ctrmio_combine.cpp | UTF-8 | 452 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "ctrmio_combine.h"
#include <iostream>
#include <sstream>
Result_t CTrmIO_Combine::ParseSamples(const std::string &str, std::list<std::string> &str_samples) const
{
if (str.empty())
return Result_t(RES_EMPTY_STRING);
str_samples.clear();
std::stringstream str_stream(str);
std::string... | true |
c55174be3720cc574ae7133d22f6f5c894274e5d | C++ | poleindraneel/NumericalFieldTheory | /ConsoleApplication/SquarePlate.h | UTF-8 | 535 | 3.0625 | 3 | [] | no_license | #ifndef SQUAREPLATE_H
#define SQUAREPLATE_H
#pragma once
class SquarePlate
{
private:
int nX; // Must be not even
int nY; // How many SmallSquares are used to approximate the plate
int nN; // Total number of SmallSquares
double side; //length of the side in meter
Vektor<SmallSquare> vPlate; //Plate composed of Sma... | true |
4249f9bc4d48ee079b50b12f8d9e9666ff2fec96 | C++ | nabeelsiddiqui314/Picture-Sorting-Visualizer | /Picture_Sorting_Visualizer/Application.cpp | UTF-8 | 1,712 | 2.921875 | 3 | [] | no_license | #include "stdafx.h"
#include "Application.h"
#include "Shuffle.h"
#include "BubbleSort.h"
Application::Application() {
m_window.create(sf::VideoMode(800, 600), "Picture Sorter");
m_array = std::make_shared<PictureArray>();
applyTextureToImage();
const auto& pictureSize = m_array->getImageBuffer().getSize();
c... | true |
1d0c91d15432d6906b2162468f562a8f2d047523 | C++ | arponbasu/CS101_1stSem | /Lab Sub/dept_main.cpp | UTF-8 | 524 | 2.734375 | 3 | [] | no_license | #include "department.h"
int main(){
department c;
int inp, num, marks; cin>>inp;
while(inp!=-1){
if(inp==1){
cin>>num>>marks;
c.setMarks(num,marks);
}
else if(inp==2){
cout<<c.getHighest()<<endl;
}
else if(inp==3){
cout<<c.getAverage()<<endl;
}
else if(inp==4){
cin>>num;
c.fetchStud... | true |
e5715750bf963319a7a36f686e8247ecccb6da4c | C++ | piyushsoni/FactoryPattern | /Rectangle.h | UTF-8 | 269 | 2.65625 | 3 | [] | no_license | #pragma once
#include "Shape.h"
#include <iostream>
using namespace std;
class Rectangle : public Shape
{
public:
Rectangle();
virtual ~Rectangle();
virtual ShapeType GetType() { return Type_Rectangle; }
private:
float points[4][3];
};
| true |
2272e319956190cb8668f1cc0412f383b1012409 | C++ | vanshika1405/programming-assignment | /p25.cpp | UTF-8 | 299 | 2.609375 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
void main()
{
int n,r,sum=0,count=0;
printf("enter a no");
scanf("%d",&n);
while(n!=0)
{
r=n%10;
sum=sum+r;
n= n/10;
count++;
}
printf(" sum is%d",sum);
printf(" \ncount is%d",count);
getch();
}
| true |
665731c18f043a455bd61fc52c277c7874f3b0bd | C++ | thunderning/Wraiden2 | /Wraiden2/Plane.h | GB18030 | 671 | 2.859375 | 3 | [] | no_license | #pragma once
#include "Item.h"
class Plane :
public Item
{
protected:
int life; //
int move_speed; //ƶٶȣÿxμƶһֵԽٶԽ
Bullet bullet; //ӵ
public:
Plane();
~Plane();
Bullet launch_bullet();
int get_life();
int change_life(int dmg);
void flesh_bullet();
bool move_to_left(int k, int l, int h); //ֵ߽1~l1~... | true |
563825d2235ced8d71b5a20ca46e7fd234f9c571 | C++ | prasad-access/cpp | /remove_contDuplicates.cpp | UTF-8 | 1,090 | 3.4375 | 3 | [] | no_license | /******************************************************************************
Program to remove continuous occurance of duplicates
Example : I/P "MMMMMMMMMMMMMMMMMMMMMMMICCCROOOOFOCUUUUSS";
O/P : MICROFOCUS
*******************************************************************************/
#include <iost... | true |
06e12c488055e3a35b76b3efe0084a8321f3eb9f | C++ | Superlokkus/code | /src/mkdt_example_client.cpp | UTF-8 | 4,618 | 2.6875 | 3 | [
"MIT"
] | permissive | /*! @file mkdt_example_client.cpp
*
*/
#include <iostream>
#include <string>
#include <map>
#include <thread>
#include <vector>
#include <algorithm>
#include <iterator>
#include <functional>
#include <boost/asio.hpp>
#include <boost/log/trivial.hpp>
#include <mkdt_lib.hpp>
#include <object_remoting_mockup_adapter.... | true |
3b2a84ea0dbea257f1a2efe4cfff32bd11e2300b | C++ | menghsun/pd2 | /lec08/string_operations.cpp | UTF-8 | 954 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
string s1("happy");
string s2("birthday");
string s3;
cout << "s1: " << s1;
cout << "\ns2: " << s2;
cout << "\ns3: " << s3;
cout << "\ns2 == s1?: " << ((s2==s1)?"true":"false");
cout << "\ns2 != s1?: " << ((s2!=s1)?"true":"false");
cout ... | true |
4d4ad2d94f1029ae4dcd756e14b28ec8caaf2ab7 | C++ | basanets/SoftwareDesignPatterns | /structural/bridge/bridge/radio.h | UTF-8 | 640 | 3.1875 | 3 | [] | no_license | #ifndef RADIO_H
#define RADIO_H
#include "device.h"
#include <string>
class Radio : public Device
{
public:
Radio();
virtual ~Radio() = default;
Radio(const Radio & radio) = default;
Radio(Radio && radio) = default;
Radio & operator = (const Radio & radio) = default;
Radio & operator = (Radi... | true |
716679d3be63839b2e15d03d58f94e8bec46dacf | C++ | connectthefuture/psdmrepo | /PSQt/tags/V00-00-05/include/Logger.h | UTF-8 | 2,470 | 2.5625 | 3 | [] | no_license | #ifndef LOGGER_H
#define LOGGER_H
//--------------------------
#include "PSQt/LoggerBase.h"
#include <QObject>
namespace PSQt {
//--------------------------
// @addtogroup PSQt Logger
/**
* @ingroup PSQt Logger
*
* @brief Logger - singleton for LoggerBase
*
* Connects LoggerBase with GUILogger using metho... | true |
e15a8f43902475e2f9cb8e9f677bce2d4bc78b21 | C++ | fincht96/Graphics-Output-Device | /RenderuC/BMPRead/src/memory.h | UTF-8 | 454 | 2.578125 | 3 | [] | no_license |
//********************************************************************************************************
// Memory class
//
// Base Memory class, used to allocate data to specifed memory locations,
//
#ifndef MEMORY_H
#define MEMORY_H
class Memory
{
public:
// pure virtual function to b... | true |
b0e6c74b4aa6c723110b368c993269db15f1ce33 | C++ | Sarthakdtu/C-Codes | /Others/strange order.cpp | UTF-8 | 2,027 | 3.03125 | 3 | [] | no_license | #include<bits/stdc++.h>
#include<vector>
using namespace std;
void display(vector<int> v)
{
int a=0;
vector<int>::iterator i;
for(i = v.begin();i!= v.end();i++)
{
a++;
cout<<*i<<" ";
}
// cout<<"no of elmnts "<<a;
}
void displayA(int *arr, int n)
{
for(int i=2;i<n+1;i++)
cout<<i<<" : ... | true |
3f7830ff44188dd0f2fcbd43b37f24b30c9904d0 | C++ | daniellelshen/19-CMPE-126-Archive | /lab 9 - hash/Lab9 - cmpe126.1.cpp | UTF-8 | 1,428 | 3.109375 | 3 | [] | no_license | //============================================================================
// Name : 1.cpp
// Author : Danielle Shen
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#in... | true |
4fb8508d31cdb1d52db6c840bea92b566040cff5 | C++ | abhikoh68/OOPS-lab | /object oriented programming/lab 3_1a.cpp | UTF-8 | 229 | 2.71875 | 3 | [] | no_license | #include<iostream>
using namespace std;
void display(int);
int main()
{
int n,i,k;
cout<<"Enter a Number:- ";
cin>>n;
display(n);
}
void display(int m)
{
int i;
for(i=0;i<m;i++)
{
cout<<"WELL DONE\n";
}}
| true |
650290035d4c7768dda5879481678ffac06a6192 | C++ | neha30/Data_structure | /sum_x.cpp | UTF-8 | 1,147 | 3.578125 | 4 | [] | no_license | //Write a C program that, given an array A[] of n numbers and another number x, determines whether or not there exist two elements
//in S whose sum is exactly x.
//Let x be the given sum and MyVec[] be the array in which we need to find pair.
//1) create the hasmap MyMap
//2) Do following for each element MyVec[i] i... | true |
dfb0e8c8b866c0290b03d2b1ff25e98280d2420a | C++ | Shada/Wanshift | /Renderer/ReaderINI.h | UTF-8 | 1,508 | 2.734375 | 3 | [] | no_license | #pragma once
#include <map>
#include <string>
#include <vector>
typedef std::map<std::string,std::string> Attributes;
struct Node_INI
{
private:
Attributes attributes;
public:
std::string getValue(std::string _key)
{
Attributes::iterator aIt = attributes.find(_key);
std::string value = "Invalid";
if(aIt !=... | true |
a94d84bc9b3ed65bc4d7367965b5db9ad59ea322 | C++ | AndrewLam97/CS008 | /Recursion/Recursion/random_fractal.h | UTF-8 | 2,426 | 3.890625 | 4 | [] | no_license | #ifndef RANDOM_FRACTAL_H
#define RANDOM_FRACTAL_H
#include <cassert>
#include <iomanip>
#include "../../!includes/useful/useful.h"
using namespace std;
class fractal
{
private:
int level = 0;
int call = 0;
public:
// fractal::fractal(double left_height, double right_height, double width, double epsilon){
... | true |
28f3951af5b4707100e92cc2dcc672cec6ff40d7 | C++ | markusfoote/NVISII | /src/nvisii/transform.cpp | UTF-8 | 29,606 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #include <nvisii/transform.h>
#include <nvisii/entity.h>
#include <glm/gtx/matrix_decompose.hpp>
namespace nvisii {
std::vector<Transform> Transform::transforms;
std::vector<TransformStruct> Transform::transformStructs;
std::map<std::string, uint32_t> Transform::lookupTable;
std::shared_ptr<std::recursive_mutex> Tran... | true |
31b018c740cf94c027a0f9222a2e8d9384e35308 | C++ | sharanyakamath/Competitive-Programming | /codechef/XORIER.cpp | UTF-8 | 1,086 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
#define lli long long int
using namespace std;
lli xorPairCount(lli arr[], lli n, lli x, lli y)
{
lli result = 0;
unordered_map<lli, lli> m;
for (lli i=0; i<n ; i++)
{
lli curr_xor1 = x^arr[i], curr_xor2 = y^arr[i];
if (m.find(curr_xor1) != m.end())
... | true |
d6636a0dcdeede2b2a1cfd49b45c64adc9c3bd85 | C++ | Aidan79225/Leetcode | /Medium/866. Smallest Subtree with all the Deepest Nodes.cpp | UTF-8 | 931 | 3.1875 | 3 | [] | 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) {}
* };
*/
class Solution {
public:
TreeNode* subtreeWithAllDeepest(TreeNode* root) {
vector<int> dp(501, -1);
int ... | true |
efc54830b2a668084201767237b045d4c810a4cc | C++ | ABHISHEK-G0YAL/Competitive-Programming | /practice/SPOJ/Edit_Distance_Again.cpp | UTF-8 | 422 | 2.671875 | 3 | [] | no_license | // https://www.spoj.com/problems/EDIT/
#include <iostream>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
string s;
int c1,c2;
while(cin>>s)
{
c1=0;
c2=0;
for(int i=0;i<s.length();i++)
{
if(i%2==0)
{
if(s[i]>90)
++c1;
else
++c2;
}
els... | true |
4f9dd995191d9ba5f8ec8e1247c49713a4695516 | C++ | KireinaHoro/assignments | /week9/p_encode.cc | UTF-8 | 675 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
string itoa(int i)
{
string ans;
while(i > 0)
{
ans.append(1, i % 10 + '0');
i /= 10;
}
reverse(ans.begin(), ans.end());
return ans;
}
string encode(string in)
{
if(!in.length())
return... | true |
eafc2be0bc2174e3fd03f93b4bb7f56631ae9406 | C++ | bathetrade/DeepBluesSimulation | /DeepBluesSimulation/Pawn.cpp | UTF-8 | 573 | 2.796875 | 3 | [] | no_license | #include "Pawn.h"
#include "ILevel.h"
using namespace std;
Pawn::Pawn()
{
SetPriority(1);
}
std::string Pawn::ToString() const
{
return "Pawn";
}
vector<Point> Pawn::GeneratePossibleMoves() const
{
auto currentPosition = GetPosition();
vector<Point> possibleMoves = { currentPosition + Point(1,0) };
return poss... | true |
7a31cd48f52a54833943fc3b4917aa16975e553f | C++ | robostar-ye/data_structure | /exp5/exp5_1.cpp | GB18030 | 3,636 | 3.78125 | 4 | [] | no_license | #include <stdio.h>
#define MAX_LEN (100) //
typedef int key_type; // ؼΪint
typedef char info_type;
typedef struct
{
key_type key; // ؼ
info_type data; // ,Ϊinfo_type
}rec_type; ... | true |
a1bd20c3dcbe7fb28eb7acddd821c7c82df35e08 | C++ | ankurag12/flippy | /include/LSM6DS33.h | UTF-8 | 2,295 | 2.71875 | 3 | [] | no_license | #ifndef LSM6DS33_H_
#define LSM6DS33_H_
#include <cstdint>
#include <map>
typedef std::uint8_t byte;
enum Axis { X = 0, Y = 2, Z = 4 };
class LSM6DS33 {
public:
LSM6DS33(int host_id = -1);
bool init(uint odr_accel = 1660, uint fs_accel = 2,
uint filter_bw_accel = 200, uint odr_gyro =... | true |
38bb39cbed20166c2ca5f29d76e66718821bf8a9 | C++ | Keigo-Iwakuma/LeetcodeSubmissions | /solutions/485.max-consecutive-ones.cpp | UTF-8 | 589 | 2.890625 | 3 | [] | no_license | /*
* @lc app=leetcode id=485 lang=cpp
*
* [485] Max Consecutive Ones
*/
// @lc code=start
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int max_l = 0;
int p_z = -1;
for (int i=0; i<nums.size(); i++) {
if (nums[i] == 0) {
if (i - p_z... | true |
59bda80ebeab1287abcba800ff7307ca9928d334 | C++ | Cody-Duncan/ShadyTreeEngine2 | /ShadyTreeEngine/Graphics/DirectX/DirectX_PrimitiveBatch.cpp | UTF-8 | 9,574 | 2.59375 | 3 | [] | no_license | #include "Graphics\DirectX\DirectX_PrimitiveBatch.h"
#include "Resources\BufferResourcer.h"
#include "Resources\Resources.h"
#include "Graphics\DirectX\DirectX_GraphicsDevice.h"
#define BatchSize 4096
#define Invalid_Buffer_ID -1
DirectX_PrimitiveBatch::DirectX_PrimitiveBatch(GraphicsDevice* deviceIn) :
Primitiv... | true |
d9a0f909f3a8348408f9fe6ac9bf1c9618e18645 | C++ | WMostert1/COS132-Crash-Course | /DT/DT.cpp | UTF-8 | 543 | 3.484375 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main(){
cout << "Data Type : Size in bits" << endl;
cout << "------------------------------" << endl;
cout << "int : " << sizeof(int)*8 << endl;
cout << "unsigned int : " << sizeof(unsigned int)*8 << endl;
cout << "char : " << sizeof(char)*8 << endl;
cout <<... | true |
5fc2dd6d4442fafc59724ac2b5080787b29b69cd | C++ | Lut99/RayTracer | /src/lib/animations/camera/CameraRotation.cpp | UTF-8 | 3,085 | 2.8125 | 3 | [] | no_license | /* CAMERA ROTATION.cpp
* by Lut99
*
* Created:
* 2/1/2020, 4:55:47 PM
* Last edited:
* 3/3/2020, 4:54:39 PM
* Auto updated?
* Yes
*
* Description:
* The CameraRotation class models the movement of a Camera that circles
* around a point. In this animation, the Camera looks at the same... | true |
519551fb86df2133412dd165dbe140e5b4dce0c1 | C++ | afakihcpr/cpp-sort | /testsuite/sorters/default_sorter.cpp | UTF-8 | 2,870 | 3.03125 | 3 | [
"MIT",
"BSL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LLVM-exception",
"Zlib",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (c) 2015-2018 Morwenn
* SPDX-License-Identifier: MIT
*/
#include <algorithm>
#include <forward_list>
#include <functional>
#include <iterator>
#include <list>
#include <vector>
#include <catch2/catch.hpp>
#include <cpp-sort/sorters/default_sorter.h>
#include <cpp-sort/sort.h>
#include <testing-tools/d... | true |
6ea918087c26b339ba3707fc4cb51dd7a0b61e29 | C++ | oninoni/OniEngine | /Engine/Engine/Mesh.cpp | UTF-8 | 2,533 | 2.546875 | 3 | [] | no_license | #include "stdafx.h"
#include "Vertex.h"
#include "RecourceLoader.h"
#include "Shader.h"
#include "PhongShader.h"
#include "ShaderHandler.h"
#include "Mesh.h"
Mesh::Mesh(ShaderHandler* shaderHandler, Vertex* vertices, uint nVert){
init(shaderHandler, vertices, nVert);
}
Mesh::Mesh(ShaderHandler* shaderHandler,... | true |
af2be3061e472c451db388c292235b0d88e312ec | C++ | etiennedub/TP_Algo | /TP2/reseau.cpp | UTF-8 | 12,674 | 3.375 | 3 | [] | no_license | #include <set>
#include "reseau.h"
#include <algorithm>
//
// Created by etienned on 10/31/16.
//
/** \brief Constructeur de la classe Reseau.
*
* un objet est créer et mémorisé.
*
*/
Reseau::Reseau(){
}
/**
* \brief Ajouter un nouveau sommet au graphe.
*
* \param numero: numero du sommet.
*
* \exception l... | true |
6c3c8f6de3e7b4a2793df54a43a8020ce9d9d7ad | C++ | marc-hanheide/cogx | /subarchitectures/vision.sa/branches/spring-school-2011-DEPRECATED/src/c++/vision/components/ShapeDescriptor3D/DShape3D/Vector2I.hh | UTF-8 | 462 | 2.515625 | 3 | [] | no_license | /**
* $Id: Vector2I.hh,v 1.1.1.1 2008/02/29 10:12:02 jp Exp $
*/
#ifndef VECTOR2I_HH
#define VECTOR2I_HH
#include "PNamespace.hh"
namespace P
{
/**
* Vector2
*/
class Vector2I
{
public:
int x, y;
Vector2I();
Vector2I(const Vector2I &);
Vector2I(int xx, int yy) : x(xx), y(yy) {}
~Vector2I(){}
Vec... | true |
3dabaf434c3c2862d503bdbf6193e2136f5b1a5b | C++ | Moonfish/smartrain2 | /src/RelayController.cpp | UTF-8 | 1,912 | 2.765625 | 3 | [] | no_license | /*
* RelayController.cpp
*
* Created on: Dec 20, 2014
* Author: russell
*/
#include <linux/i2c-dev.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <exception>
#include <system_error>
#include "RelayController.h"
#include "util.h"
RelayControl... | true |
1189560694ea000a0c2b00e5f4c7aa8c476b9773 | C++ | giltolley/Data-Structures-and-Algorithms | /Linked-List/LinkedList/Test.cpp | UTF-8 | 1,729 | 3.359375 | 3 | [] | no_license | #include "stdafx.h"
#include "LinkedList.h"
int main()
{
string userInput;
char choice;
bool exit = false;
RecordList myRecord;
vector<string> listView;
string art;
string title;
string year;
while (exit != true)
{
cout << "+================================================+" << endl;
... | true |
799b06923363adf9b42654260d1e3ca94a9587c8 | C++ | NelsonGomesNeto/Competitive-Programming | /Online Judges/CodeForces/Contests/1241 - Codeforces Round #591 (Div. 2, based on Technocup 2020 Elimination Round 1)/E - Paint the Tree.cpp | UTF-8 | 1,903 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
#define DEBUG if(0)
#define lli long long int
#define ldouble long double
using namespace std;
/* Tutorial:
For each vertex, you can choose at most k edges to add to the answer (and you
can't add the same edge twice). Formally, for each vertex u, you either choose
or not the edge(u, pare... | true |
50f176a0e23edf8362a048dd123de7d62e791b0c | C++ | mistervunguyen/starting-out-with-c-plus-plus-early-objects-solutions | /Programming Challenges/Chapter09/9_11.cpp | UTF-8 | 3,515 | 3.875 | 4 | [] | no_license | // Chapter 9 - Programming Challenge 11, Ascending Circles
// This modifies Program 8-31 from Chapter 8 to create an array of 7 Circle
// objects, use a Bubble Sort to arrange them in ascending order of radius
// size, and then compute and display their areas. Displaying the circle radii
// along with their areas ... | true |
f14bdc11afb024b86ea9aeadc4320271ef60dab0 | C++ | JinhaJjing/Algorithm | /Algorithm/Solved/소수 만들기.cpp | WINDOWS-1252 | 564 | 3.46875 | 3 | [] | no_license | // https://programmers.co.kr/learn/courses/30/lessons/12977
// ܼ
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
bool isPrime(int num) {
for (int i = 2; i <= sqrt(num); i++)
if (num % i == 0) return false;
return true;
}
int solution(vector<int> nums) {
int answer = 0;
for (int i... | true |
9826a2c700c0aa68913dd38ec4e14909fae05904 | C++ | compagnb/compagnb_sims2014 | /Wk3_HW_NotBallParticles/src/ofApp.cpp | UTF-8 | 2,443 | 2.65625 | 3 | [] | no_license | //
//
// Wk3_HW_NotBallParticles
//
// Created by compagnb on 9/13/14.
//
//
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
ofSetVerticalSync(true);
//load the image
surf.loadImage("images/test.jpg");
ofSetBackgroundAuto(false);
... | true |
06be442fef324ab7fafb37ece4b69ed33c06f113 | C++ | stank2010/code-competitive-programming | /cdoecube.in.th/183_Plagiarist.cpp | UTF-8 | 1,232 | 2.84375 | 3 | [] | no_license | #include "stdio.h"
struct sakan
{
int count,num;
}tree[1100001],Null;
int z[200000],n;
int make_tree(int h,int l,int index)
{
if(h==l)
{
tree[index].num = z[h];
tree[index].count = 1;
}
else
{
int mid=(h+l)/2;
tree[index].count += make_tree(h,mid,2*index+1);
tree[index].count += ... | true |
9e83cfdcc5b76152c40b33625dee7c5d72695632 | C++ | josewannan98/Practica1_EDD_2 | /EDD_practica1_201612331/src/Lista_restaurantes.cpp | UTF-8 | 839 | 3.03125 | 3 | [] | no_license | #include "Lista_restaurantes.h"
Lista_restaurantes::Lista_restaurantes()
{
//ctor
this->primero = nullptr;
this->ultimo = nullptr;
}
Lista_restaurantes::~Lista_restaurantes()
{
//dtor
}
void Lista_restaurantes::ingresar_restaurante(NodoRestaurantes *nodo)
{
NodoRestaurantes *nuevo = nodo;
nu... | true |
943b8f52581478be0848005696238a1d9ebf8f66 | C++ | CR7-Messi/Algorithm | /Hashing-H.cpp | UTF-8 | 1,060 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int N = 1000;
int num[N], indegree[N];
struct cmp {
bool operator()(int i, int j) {
return num[i] > num[j];
}};
int main() {
int i, j, n, m, k, flag = 0;
scanf("%d", &n);
vector<vector<int> > g(n);
priority... | true |
9e7c5e21cb26f68df7d8bb08ec4d79032c6e1620 | C++ | WeAreChampion/notes | /c/base/Char A + B.cpp | UTF-8 | 418 | 3.578125 | 4 | [
"Apache-2.0"
] | permissive | #include<iostream>
using namespace std;
int f(char a)
{
int value;
if(a >= '0' && a <= '9') { //is number
value = a - '0';
} else if(a >= 'a' && a <= 'z') { //is lower word[a-z]
value = a - 87;
} else if(a >= 'A' && a <= 'Z') { //is upper word[A-Z]
value = a - 55;
}
return value;
}
int main()
{
char a[10... | true |
6f08b4af8df0daebfcb5bd2dc5ce2e4c8a3361a7 | C++ | wjddlsy/Algorithm | /Baekjoon/baek_2904_수학은너무쉬워/main.cpp | UTF-8 | 1,155 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
int gcd(int a, int b) {
return b?gcd(b, a%b):b;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int N;
cin>>N;
map<int, int> primes;
vector<map<int, int>> numbers(N);
for(i... | true |
edb70b638b2e3f9861892764fc5bce124810cb18 | C++ | uchihaitachi08/daily_code | /hackerearth/practice/e_test.cpp | UTF-8 | 1,015 | 3.40625 | 3 | [] | no_license | #include<iostream>
#include<stack>
#include<cmath>
using namespace std;
void print_ver(int**arr,int top,int bottom,int col){
bool check = (top>bottom);
for(int i=top;(check) ? (i>=bottom) : (i<=bottom); (check) ? i-- : i++){
cout<<arr[i][col]<<" ";
}
cout<<endl;
}
void print_hor(int** arr,int left,int right,int ... | true |
af1b340d45353f5dbe02d58820ca66758825c80a | C++ | ablondal/comp-prog | /Practice/Club_Prac_5/f.cpp | UTF-8 | 1,141 | 2.5625 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
typedef long long ll;
typedef long double ld;
#define max(a,b) ((a>b)?a:b)
#define min(a,b) ((a<b)?a:b)
// const ld EPS = 1e-9;
int n;
ld m;
int a[1001], sa[1001], b[1001], sb[1001];
bool canwork(ld fuel){
for(int i=0; i<n; ++i){
fuel =... | true |
98bc2e8aa4123d8867c17de8d2a183cb65d7bf0f | C++ | linaben1/ProjetCpp | /FilesCpp_h/Mini.cpp | UTF-8 | 1,136 | 2.6875 | 3 | [] | no_license | #include "Projet.h"
/********************************************************************************************************/
void DistributionPoints::InitAdvantages()
{
nbPointsFree = 15;
nbPointsExperience = 0;
}
int DistributionPoints::GetExperience(int retirePoints)
{
nbPointsExperience = nbPointsExperience ... | true |
f51ad31dc706a9437d4cf73faa88ed22dd9defaa | C++ | AvihaiAdler/Coffee-Shop-STL | /CoffeeShop.cpp | UTF-8 | 3,677 | 3.34375 | 3 | [] | no_license | #include "CoffeeShop.h"
CoffeeShop::CoffeeShop(const std::string& name, const Address& address) : address(address)
{
setName(name);
customersMaxSize = SIZE_MULTIPLIER;
employeesMaxSize = SIZE_MULTIPLIER;
shiftsMaxSize = 3;
productsMaxSize = SIZE_MULTIPLIER;
}
CoffeeShop::CoffeeShop(CoffeeShop&& other)... | true |
b8e9a87818a4f391d3a9cf35f3250e589be8e59c | C++ | Rostin/NeuralNet | /RostinNE/RostinNE/Neuron.cpp | UTF-8 | 2,463 | 3.046875 | 3 | [] | no_license | #include "stdafx.h"
#include "Neuron.h"
namespace Core {
Neuron::Neuron(unsigned numOfOutputs, unsigned myIndex):
m_myIndex {std::move(myIndex)}
{
m_outputWeights.reserve(numOfOutputs);
for (auto c{ 0u }; c < numOfOutputs; ++c)
{
auto& w{ m_outputWeights.emplace_back() };
w.weight = getRandomWeigh... | true |
c3644fd9ea570f09ea061cecbc5e9853937400eb | C++ | elkprostoelk/1year_cpp_labs | /лабы 1 курс с++/Lab6/Zavd1/Zavd1.cpp | UTF-8 | 454 | 3.4375 | 3 | [] | no_license | #include<iostream>
using namespace std;
class Student
{
public:
unsigned int age;
string sex;
float stypendia;
};
int main()
{
Student std1, std2;
std1 = { 20,"male",1300. };
std2 = { 21,"female",1600. };
Student stud[2] = { std1,std2 };
for (int i = 0; i < 2; i++)
{
cout << "Student " << i+1 << endl;
cout... | true |
5ebabb26e1e0cdef02a8be524b84b6fb8571d7f8 | C++ | cs15b047/CF | /Problems/Practice/C/278.cpp | UTF-8 | 1,900 | 3.4375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll num_elements;
vector<ll> elements;
map<ll, ll> partition_1, partition_2;
void initialize(){
scanf("%lld", &num_elements);
elements.resize(num_elements);
for(int i = 0;i < num_elements; i++)scanf("%lld", &elements[i]);
}
void populate_parti... | true |