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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
a73b597c5862106b4c9cfe987107b86cbdea6abc | C++ | diantaowang/cocoding | /937_k_closest.cc | UTF-8 | 940 | 2.703125 | 3 | [] | no_license | #include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <iostream>
#include <tuple>
#include <queue>
#include <stack>
#include <queue>
using namespace::std;
class Solution {
public:
vector<vector<int>> kClosest(vector<vector<int>>& points, int K) {
priority_queue<pa... | true |
e337f6bf2c57c41ac78eef3adce9e4c087f9f1d5 | C++ | StartAt24/Cpp_stuff | /design_patterns/command_pattern.cpp | UTF-8 | 823 | 3.140625 | 3 | [] | no_license | #include <iostream>
using namespace std;
class Receiver{
public:
void act(){
cout << "receiver act" << endl;
}
};
class Command{
public:
Command(){
}
virtual ~Command(){
}
virtual void excute() = 0;
private:
Receiver* recv_;
};
class Invoker{
public:
Invoker(Command* cm... | true |
85575f589757f82642114d153bcbc8a74998088c | C++ | D34Dspy/warz-client | /External/NaturalMotion/common/XMD/src/XMD/ItPolygon.cpp | UTF-8 | 24,731 | 2.53125 | 3 | [] | no_license | //----------------------------------------------------------------------------------------------------------------------
/// \file ItPolygon.cpp
/// \note (C) Copyright 2003-2005 Robert Bateman. All rights reserved.
//------------------------------------------------------------------------------------------------------... | true |
adc8026ea8f2281442c01090201762261675ad79 | C++ | BrittanyBlairDesign/Programming-2- | /Project3/BunnyTask.cpp | UTF-8 | 4,670 | 3.15625 | 3 | [] | no_license | /*
BunnyTask defines all Methods and functions involved in progressing the bunny farm forward.
BrittanyBlair
*/
#include <iostream>
#include <string>
#include <stdlib.h>
#include "Bunnies.h"
#include "BunnyTask.h"
//Population counting maximum bunnies, adult males adult females, and mutations.
int g_cou... | true |
2c794c610a871f8cc3a289103ecd0e1567eee271 | C++ | FALCH2000/Project_1 | /Interface/constructor.cpp | UTF-8 | 3,125 | 2.890625 | 3 | [] | no_license | #include "constructor.h"
Constructor::Constructor(string path, string object) {
this->path_= path;
this->object_=object;
}
vector<Song *> *Constructor::getSongsList() {
return &this->SongsList;
}
void Constructor::ParseCSV(int start, int end) {
if(this->object_=="Songs"){
Parse_Songs(start,e... | true |
77d65efa6d973e066b6e7e1181275ea01946eb18 | C++ | lxlyh/Adept-Engine | /GraphicsEngine/Source/TDPhysics/TDSAT.cpp | UTF-8 | 4,155 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "TDSAT.h"
#include "Shapes/TDAABB.h"
#include "Shapes/TDBox.h"
#include "Shapes/TDMeshShape.h"
namespace TD
{
TDSAT::SatInterval TDSAT::GetInterval(TDBox* box, const glm::vec3 axis)
{
const int VertCount = 8;
glm::vec3 vertex[VertCount];
const glm::vec3 Centre = box->GetPos();
const glm::vec3 HalfEx... | true |
01bb0b289ac748a42ed4514fe8030e2db1fdd8c3 | C++ | DingFeng0103/CS561 | /Assignment1/Node.h | UTF-8 | 850 | 2.828125 | 3 | [] | no_license | #ifndef __NODE__
#define __NODE__
#include<vector>
#include<string>
#include<iostream>
#include"Path.h"
#define UNEXPLORED 0
#define EXPLORED 1
using namespace std;
class Node
{
private:
Node* ptrParentNode;
int PathOrder;
string Name;
int State;
int TotalCost;
int TrafficEstimate;
vector<Path> vecPaths;
No... | true |
09e613aaada47b91f6aaa393bf3f4315c807d58e | C++ | DorShaar/catch-the-flag | /CatchTheFlag/Point.h | UTF-8 | 390 | 3.03125 | 3 | [] | no_license | #pragma once
using namespace std;
class Point
{
int coordinateX;
int coordinateY;
public:
Point() : coordinateX(0), coordinateY(0) { };
Point(int newXCoord, int newYCoord) : coordinateX(newXCoord), coordinateY(newYCoord) { };
// Setters and Getters.
int getXcoordinate();
void setXCoordinate(int newXCoordinate... | true |
6267ca40b5b4967d46798e771457209ff82b64d5 | C++ | lewissbaker/generator | /tests/nested_test.cpp | UTF-8 | 8,727 | 3.09375 | 3 | [
"BSL-1.0"
] | permissive | ///////////////////////////////////////////////////////////////////////////////
// Copyright Lewis Baker, Corentin Jabot
//
// Use, modification and distribution is subject to the Boost Software License,
// Version 1.0.
// (See accompanying file LICENSE or http://www.boost.org/LICENSE_1_0.txt)
/////////////////////////... | true |
6088e4c803382c35d0183056ff91191b0fd79910 | C++ | Madzik890/Wykop-Virus | /Source/UsbParameter.cpp | UTF-8 | 1,138 | 2.734375 | 3 | [] | no_license | #include "UsbParameter.hpp"
#include <Windows.h>
void UsbParameter::mainFunc()
{
getDeviceList();
}
std::string UsbParameter::getInformation()
{
std::string text;
text += "\n [Parametry USB] \n";
text += "Liczba podlaczonych urzadzen: " + std::to_string(u_connectedDevices) + "\n";
text += "[/Parametry USB] \n";... | true |
dafd1a22a1295b5ca623e9b100c9b44bdc216afc | C++ | shoumitro-cse/data-structure-solving | /BinaryTree/Misc/MaxBend.cpp | UTF-8 | 3,059 | 3.6875 | 4 | [] | no_license | // Path length having maximum number of bends
// g++ MaxBend.cpp && ./a.out
#include <bits/stdc++.h>
using namespace std;
// structure node
struct Node {
int key;
struct Node* left;
struct Node* right;
};
// Utility function to create a new node
struct Node* newNode(int key)
{
struct Node* node = new... | true |
3dee611511549b85896c1a20ebc4946f00f9dd6f | C++ | sraihan73/Lucene- | /core/src/java/org/apache/lucene/search/Multiset.cpp | UTF-8 | 1,005 | 2.734375 | 3 | [] | no_license | using namespace std;
#include "Multiset.h"
namespace org::apache::lucene::search
{
Multiset<T>::IteratorAnonymousInnerClass::IteratorAnonymousInnerClass(
shared_ptr<Multiset<std::shared_ptr<T>>> outerInstance,
unordered_map<T, int>::const_iterator mapIterator)
{
this->outerInstance = outerInstance;
this-... | true |
3837b530d7f9d4d60d97c1a6336762c74611bc23 | C++ | bsparnochia/clase-array-cpp | /src/main.cpp | ISO-8859-1 | 605 | 3.546875 | 4 | [] | no_license | /*
* main.cpp
*
* Created on: 12 may. 2020
* Author: brian
*/
#include "Array.h"
#include <iostream>
int main(){
/* defino un arreglo con tamao 2 */
Array a(2);
/* arreglo inicializado por vector temporal */
Array b = { 6,3,7};
/* copia de b en c */
Array c (b);
/* asigno un vector "b" a "a" */
... | true |
12673cbd5926c04ed021ace1bbe5bceeead4e39e | C++ | joe-zxh/OJ | /剑指offer/面试题42 连续子数组的最大和.cpp | UTF-8 | 360 | 2.984375 | 3 | [] | no_license | class Solution {
public:
int FindGreatestSumOfSubArray(vector<int> array) {
int sz = array.size();
if(sz==0){
return 0;
}
int pre=array[0];
int retsum=pre;
for(int i = 1;i<sz;i++){
pre = pre+array[i]>array[i]?pre+array[i]:array[i];
retsum = pre>retsum?pre:r... | true |
f9ca3cd99c0bfaee2ffc9e96956701f9e1a4b275 | C++ | ernikus/Edabit-Challenges-Cpp | /5. VERY HARD/Longest Alternating Substring/main.cpp | UTF-8 | 4,215 | 3.234375 | 3 | [] | no_license | //Title: Longest Alternating Substring
//Difficulty: Very Hard
//Source: https://edabit.com/challenge/R95FfS8PGtsCLxnKH
//Soln Author: ernikus
#include "Solution.h"
#include <iostream>
#include <string>
#include <vector>
extern std::string longestSubstring(std::string digits);
extern bool isEven(cons... | true |
6c9bfc8877f6e5fb62d844e99e8501f8dd38829f | C++ | cdzech/DBBenchmark | /src/Layout/Relationship.cpp | UTF-8 | 2,165 | 2.9375 | 3 | [] | no_license | /*
* Relationship.cpp
*
* Created on: Oct 28, 2014
* Author: root
*/
#include "Relationship.h"
namespace HDDTest
{
Relationship::Relationship(std::string name, uint64_t size, unsigned int pagesPerExtent, unsigned int pageSizeInKB)
{
this->name = name;
this->extents.reserve(size);
this->unallocatedExten... | true |
4b559136c97234d9f6782d9388ef6b7a7225b7d8 | C++ | zl1704/zlcompiler | /src/tree/Ident.hpp | UTF-8 | 485 | 2.78125 | 3 | [] | no_license | /*
* Ident.hpp
*
* Created on: 2017年12月8日
* Author: ZL
*/
#ifndef TREE_IDENT_HPP_
#define TREE_IDENT_HPP_
#include "Expression.hpp"
/**
* 标识符
*/
class Ident:public Expression {
public:
string name;
Symbol* sym;
Ident();
Ident(int pos,string name):Expression(pos),name(name.data()){
sym = NULL;
};
vi... | true |
cc968590525b681f8ce04eb2c32fa33513b1cd50 | C++ | chriscoo/CA-Frogger | /CAFrogger/Projectile.h | UTF-8 | 1,109 | 2.625 | 3 | [] | no_license | /**
@file Projectile
@author Chris Arsenault Chris.arsenault06@gmail.com
@version 1.0
@section LICENSE
This software is based on the material accompanying the book "SFML Game Development" see License.txt
Additions and modifications are my sole work for prog 1266
@section DESCRIPTION
<your description of the purpo... | true |
3952b5eb954cfb8db303586f9a6399ed8484287d | C++ | ksvcng/code | /documents/codechef/november challange/3.cpp | UTF-8 | 1,035 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include <vector>
#include <algorithm>
#include<string>
#include<math.h>
using namespace std;
int main()
{ int t,n,p;
cin>>t;
while(t--){
int r,j=1,i=0;
cin>>n>>p;
if(n==1 || n==2){cout<<"impossible"<<endl;}
else if(p==1 || p==2){cout<<"impossible"<<endl;}
else{
char ar... | true |
7370f27829f59fdd5a7c08905c8333a95276d098 | C++ | JediChou/jedichou-study-algo | /standard-cpp/cpp-WrxBegVC2008/Ex4_02.cpp | UTF-8 | 443 | 3.28125 | 3 | [] | no_license | // From Wrox Begining Visual C++ 2008, page 157
// Ex4_02.cpp
// Initialize array
#include <iostream>
#include <iomanip>
using std::cout;
using std::endl;
using std::setw;
int main(void)
{
int value[5] = {1, 2, 3};
int junk [5];
cout << endl;
for( int i = 0; i < 5; i++)
cout << setw(12) << v... | true |
6a47a6809921dfe4868f8b40203e1822240f4fdc | C++ | adhaase/decision-crawler | /hero.cpp | UTF-8 | 1,261 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <windows.h> // WinApi header
#include "hero.h"
Hero::Hero() {
vitality = 25;
attack = 5;
agility = 5;
luck = 5;
}
void Hero::setvitality(int vitality, Hero &h) {
h.vitality = vitality;
}
void Hero::setAttack(int attack, Hero &h... | true |
b6c98c0be62e2ad510ceaea9031612e4769c9ebc | C++ | sharma18b/DSA_Codes | /Assignment1/ques4.cpp | UTF-8 | 599 | 2.53125 | 3 | [] | no_license | #include <stdio.h>
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
void timetable(int x)
{
int num_of_classes,num_students,num_teachers,total_hrs,hrs_per_class,break_betw_class;
cout << " please enter the number of classes ";
cin >> num_of_classes;
cout << " please enter the num_students ";
... | true |
3da964e95913aa3f41aef900923af823cfb78db2 | C++ | hadashiA/sometuke | /sometuke/process/process.cc | UTF-8 | 1,597 | 2.671875 | 3 | [] | no_license | #include "sometuke/process/process.h"
#include "sometuke/process/repeat.h"
#include "sometuke/process/sequence.h"
#include "sometuke/process/process_timer.h"
#include <functional>
namespace sometuke {
shared_ptr<Process> Process::Repeat(int num) {
shared_ptr<Process> repeat(new class Repeat(shared_from_this(), ... | true |
9b8e0f14b4b9e6a6857f767e0258027e2416102a | C++ | mseidel42/apfelxx | /inc/apfel/operatorerbl.h | UTF-8 | 693 | 2.5625 | 3 | [
"MIT"
] | permissive | //
// APFEL++ 2017
//
// Authors: Valerio Bertone: valerio.bertone@cern.ch
//
#pragma once
#include "apfel/operator.h"
namespace apfel
{
/**
* @brief The class, derived from the Operator class, defines a
* special kind of Object necessary for the evolution of GPDs in the
* ERBL region.
*/
class Opera... | true |
e6a5fc79d938ed33069f8376e8df4872730b3061 | C++ | ptahmose/ArchImgProc | /ArchImgProc/Bitmap/datastore.h | UTF-8 | 3,223 | 3.34375 | 3 | [] | no_license | #pragma once
#include <algorithm>
namespace ArchImgProc
{
/// <summary> Return value for CDataStore::AddOrSetValue. </summary>
enum class DataStoreStatusCode
{
/// <summary> The item was new and it was successfully added. </summary>
OK_Added,
/// <summary> The item was already present, and it was successful... | true |
4fe9029236ec530427625493e2cf0c5055c54281 | C++ | Jisti007/Mobile-Project-ideal-broccoli | /gles3jni/app/src/main/cpp/game/scenes/MovementAnimation.cpp | UTF-8 | 1,166 | 2.796875 | 3 | [] | no_license | #include "MovementAnimation.h"
#include "../GameMap.h"
MovementAnimation::MovementAnimation(
Actor* actor, Scene* scene, glm::vec2 destination,
bool follows, float speed, bool blocking
) : Animation(blocking) {
this->actor = actor;
this->scene = scene;
this->destination = destination;
this->follows = follows;
t... | true |
8caef793860a92beeed7a76f82b32fa830cb4b9e | C++ | zlite/OpenMVrover | /pulsein_test/pulsein_test.ino | UTF-8 | 607 | 2.609375 | 3 | [] | no_license |
const int BAUD_RATE = 9600;
int RC;
int RC1_pin = 3;
int RC2_pin = 4;
int RC3_pin = 5;
unsigned long RC1_value;
unsigned long RC2_value;
unsigned long RC3_value;
void setup() {
Serial.begin(BAUD_RATE);
pinMode(RC1_pin, INPUT);
pinMode(RC2_pin, INPUT);
pinMode(RC3_pin, INPUT);
}
void loop() {
// pu... | true |
7224ba882f590d138347f72d2dc2c603df903748 | C++ | MORETechnologies/MoreArduinoController | /DriveController.h | UTF-8 | 607 | 2.84375 | 3 | [] | no_license | #ifndef DriveController_h
#define DriveController_h
#include "MotorController.h"
#include <Arduino.h>
class DriveController
{
public:
DriveController(int leftSpeedPin, int leftDirectionPin1, int leftDirectionPin2, int rightSpeedPin, int rightDirectionPin1, int rightDirectionPin2);
void setup();
void goFor... | true |
d397e439db98a1470bc9dc6765c0224933cc7029 | C++ | NLGRF/Advance-Compro | /mid term/week 3.1/ex2.cpp | UTF-8 | 302 | 3.234375 | 3 | [] | no_license | #include <stdio.h>
int main()
{
int d,even = 0 ,odd = 0;
long num;
printf("Enter a number : ");
scanf("%ld",&num);
while(num>0){
d = num%10;
if(d%2==0){
even++;
}
else
odd++;
num = num/10;
}
printf("count event = %d \n",even);
printf("count odd = %d \n",odd);
return 0;
}
| true |
a0887172f4b858a5e1274bbb2669febb0b1fe03d | C++ | LUTLJS/CodeForces | /DataStructure/Extended Euclidean Algorithm.cpp | UTF-8 | 447 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b, int& x, int& y) {
x = 1, y = 0;
int x1 = 0, y1 = 1, a1 = a, b1 = b;
while (b1) {
int q = a1 / b1;
tie(x, x1) = make_tuple(x1, x - q * x1);
tie(y, y1) = make_tuple(y1, y - q * y1);
tie(a1, b1) = make_tuple(b1,... | true |
7ba2889ab1a93e1fb9bec953776a0e4d4fdf39df | C++ | 1432849339/SimpleJson | /SimpleJson/stage/thread.h | UTF-8 | 1,357 | 2.703125 | 3 | [] | no_license | /* =====================================================================================
* Author: Zhang Wen(zhangwen@szkingdom.com)
* Created: 2014-6-20 14:57
* Description:
* =====================================================================================
*/
#ifndef ISON_BASE_THREAD_H_
... | true |
de45f36d142f09dea27afe2a359010984a34bd49 | C++ | agancsos/cpp | /preparer/src/AMGString/amgstring.h | UTF-8 | 571 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef __AMGSTRING_H_INCLUDED__
#define __AMGSTRING_H_INCLUDED__
#include <iostream>
#include <string>
#include <vector>
using namespace std;
/**
This class helps manipulate custom string objects
*/
class AMGString{
private:
string str;
public:
AMGString();
AMGString(string st);
~AMGString();
string... | true |
a05ea97639f22eb227ee10c2f51be02221266cee | C++ | JaysonSunshine/Portfolio | /Software_Engineering/C++/parentheses(without_subsets).cpp | UTF-8 | 1,085 | 3.734375 | 4 | [] | no_license | #include <algorithm>
#include <iostream>
#include <string>
using namespace std;
void parentheses(int left_remain, int right_remain, int left_have, int right_have, string word){
if(left_remain == 0 && right_remain == 0){
if(left_have == right_have)
cout << word << endl;
}
else if(left_remain == 0){
if(left_h... | true |
64baf97ae297118a0837b8961bdea414cb9995da | C++ | mashood951/Random-Programs | /ASCII code finer.cpp | UTF-8 | 253 | 3.015625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main()
{
string name;
cout << "Enter a name : " << endl;
getline(cin, name);
for (int i = 0; i < name.size(); i++)
{
cout << (int)name[i] << endl;
}
system("pause");
return 0;
}
| true |
f141cc06e49a0363cc6f771561a11b0afe878983 | C++ | Trung-Rei/Project-MMT-Socket-HTTP | /C++/TCPServer.cpp | UTF-8 | 2,187 | 2.953125 | 3 | [] | no_license | #include "TCPServer.h"
#include <iostream>
#include <WS2tcpip.h>
#include <string>
#pragma comment (lib, "ws2_32.lib")
using namespace std;
// khởi tạo để lắng nghe tại PORT
TCPServer::TCPServer(short port)
{
_port = port;
}
// Bắt đầu server
void TCPServer::start()
{
// Initialze winsock
WSADATA wsData;
WORD ... | true |
637e5e89db7e9dd1bd3b47f0e6dd221b6ab9de56 | C++ | Hecrecerelle/hello-world | /cpoint.cpp | WINDOWS-1252 | 223 | 2.859375 | 3 | [] | no_license | #include "cpoint.h"
cpoint::cpoint(int x1,int y1)
{
x=x1;
y=y1;
}
cpoint::cpoint(cpoint &obj)//캯
{
x=obj.x;
y=obj.y;
}
int cpoint::getx(void)
{
return x;
}
int cpoint::gety(void)
{
return y;
}
| true |
a13b8012a8128e5973e7ecb9ef15f926958ca2b1 | C++ | buptrh/leetcode | /Round1/592.Fraction Addition and Subtraction.cpp | UTF-8 | 4,285 | 3.546875 | 4 | [] | no_license | // Given a string representing an expression of fraction addition and subtraction, you need to return the calculation result in string format. The final result should be irreducible fraction. If your final result is an integer, say 2, you need to change it to the format of fraction that has denominator 1. So in this ca... | true |
208ff22ab01d6bf4462682569b01b084d7b870de | C++ | taichunmin/uva | /AC/10302.cpp | UTF-8 | 177 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<cmath>
using namespace std;
int main()
{
long long a;
while(cin>>a)
{
long long b=(a*(a+1))/2;
cout<<b*b<<endl;
}
}
| true |
5a60e0e9d1dd57fc1708d9fbf9d464539e26e236 | C++ | DarkShadowM/InterviewBit-Topicwise-Solutions | /Arrays/Rearrange the array.cpp | UTF-8 | 1,295 | 3.453125 | 3 | [] | no_license | void rearrangeUtil(vector<int> &arr, int n, int i)
{
// 'val' is the value to be stored at 'arr[i]'
int val = -(i+1); // The next value is determined
// using current index
i = arr[i] - 1; // The next index is determined
// using current value
... | true |
d9281379c21a5eb55444dcad9820eb4ffaeda16a | C++ | suzannealdrich/cs143-pp1-lexical-analysis | /declaration.cc | UTF-8 | 738 | 3.21875 | 3 | [] | no_license | /* File: declaration.cc
* --------------------
* Implementation of Declaration class.
*
* pp1: You need to fill in the class implementation and define
* additional member data/functions as needed. See declaration.h
* for comments.
*/
#include "declaration.h"
#include "utility.h"
Declaration::Decla... | true |
7f3bc092ae0a3c4619ebffcb14b498506f4842a5 | C++ | Kwon770/icon_c_lesson | /mentor/1108_mission_solution.cpp | UTF-8 | 931 | 3.546875 | 4 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int mission1() {
int arr[5] = {1, 2, 3, 4, 5};
int* ptr;
ptr = arr;
for (int i = 0; i < 5; i++) {
ptr[i] = ptr[i] + 2;
printf("%d\n", ptr[i]);
}
return 0;
}
int mission2() {
int size, temp, sum = 0;
... | true |
492456ca81f2f00cb079971aaf300b9db38ce350 | C++ | pawellazicki/C_Homework | /sem 1/7.12/main.cpp | UTF-8 | 379 | 2.90625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
float row(float a,float b,float c,float x)
{
return a*x*x+b*x+c;
}
int main()
{
float a,b,c,x;
printf("podaj a=");
scanf("%f", &a);
printf("podaj b=");
scanf("%f", &b);
printf("podaj c=");
scanf("%f", &c);
printf("podaj x=");
scanf("%f", &... | true |
254f0d6e8144bf40b0425d20482fa732e8970b78 | C++ | barbaric1/cppcourse-brunel | /neuron.cpp | UTF-8 | 4,497 | 2.765625 | 3 | [] | no_license | #include "neuron.hpp"
#include <vector>
#include <cmath>
#include <iostream>
#include <random>
#include <cassert>
using namespace std;
/*! \brief All the constants used to make Neuron work.
*
* The first two constants are the ones to change if we wish to obtein a different graph.
**/
const double VARIABLE_RATIO =... | true |
c94e52bc44d60f0bbaa1d17e86fc9b792ba9e501 | C++ | travelbeeee/ProblemSolving | /Programmers/N-Queen.cpp | UTF-8 | 1,240 | 3.203125 | 3 | [] | no_license | #include <string>
#include <vector>
using namespace std;
int answer;
bool visited[12][12];
bool isCanPutQueen(int row, int col, int n) {
// visited[row][col] 에 Queen을 놓을 수 있는지!
// 위아래 체크
for (int i = 0; i < n; i++)
if (visited[i][col] && i != row) return false;
// 위 좌, 우측 대각선 체크
for (int ... | true |
57b325c8960838c3caffe54faa96fa7e3a47f0f4 | C++ | Xilinx/Vitis_Libraries | /data_analytics/L1/include/hw/xf_data_analytics/text/editDistance.hpp | UTF-8 | 7,525 | 2.546875 | 3 | [
"Apache-2.0",
"BSD-3-Clause"
] | permissive | /*
* Copyright (C) 2019-2022, Xilinx, Inc.
* Copyright (C) 2022-2023, Advanced Micro Devices, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licens... | true |
e2e97123ebe1e5d3481770782c28b10f1dfc9456 | C++ | evanmiller067/cs260 | /assignments/housing/familymgr.cpp | UTF-8 | 651 | 3.0625 | 3 | [] | no_license | #include "familymgr.h"
#include <iostream>
using namespace std;
familymgr::familymgr(): table(7877)
{}
void familymgr::addFamily(const family& f)
{
table.insert(f.getID(), f);
}
void familymgr::printAllFamilies()
{
table.dumpTable();
}
void familymgr::printSmallCircle(const char* id)
{
cout << "Printing family and... | true |
840c07a1bd0786d26fdd2e4b31940538fdad2c8d | C++ | ZarkianMouse/Initial-programming | /Programming (1st, 2nd semesters)/CodeBlocks Assignments/Project 3/checkOpen.hpp | UTF-8 | 561 | 3.078125 | 3 | [] | no_license | #ifndef CHECKOPEN_HPP_INCLUDED
#define CHECKOPEN_HPP_INCLUDED
// checkOpen is used to determine if input file
// could be successfully opened in program
// precondition: is passed input file by reference
// postcondition: returns false if input file failure
// returns true otherwise
bool checkOpen(std::... | true |
09f525506d7c68452f609258b46dfa30c104d5a1 | C++ | nimbuscontrols/EIPScanner | /src/sockets/BaseSocket.h | UTF-8 | 1,548 | 2.65625 | 3 | [
"MIT"
] | permissive | //
// Created by Aleksey Timin on 11/18/19.
//
#ifndef EIPSCANNER_SOCKETS_BASESOCKET_H
#define EIPSCANNER_SOCKETS_BASESOCKET_H
#include <vector>
#include <cstdint>
#include <string>
#include <chrono>
#include <functional>
#include <memory>
#include <system_error>
#include "EndPoint.h"
namespace eipScanner {
namespa... | true |
f5548301e0e81b74980c77b0c6e55ffa2c67018f | C++ | EcutDavid/oj-practices | /leetcode/1051.cpp | UTF-8 | 305 | 2.65625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
class Solution {
public:
int heightChecker(vector<int>& heights) {
vector<int> cp = heights;
sort(cp.begin(), cp.end());
int ret = 0;
for (int i = 0; i < cp.size(); i++) {
if (cp[i] != heights[i]) ret++;
}
return ret;
}
};
| true |
7ea79538a38117f016ebb5e936b31b0467fc22f5 | C++ | TheRedLady/Data-Structures-Pract | /Final Projects/81368/Huffman_Coding/HuffmanDecoder.cpp | UTF-8 | 2,173 | 2.75 | 3 | [] | no_license | #include "BTree.h"
#include "HuffmanDecoder.h"
void HuffmanDecoder::decode(ifstream &tableCode, ifstream &codeFile, ofstream &decodeFile){
map<char, int>table;
vector<string> readedCharacters;
string str = "";
char characterToRead;
bool chekFor = true;
while (tableCode.get(characterToRead)){
if (ch... | true |
c664836c8028ed710bb3d2d44ce964e03b269b48 | C++ | shadercoder/RenderMaster | /GameEngine/Source/Renderer/Cameras/Camera.h | UTF-8 | 4,764 | 2.71875 | 3 | [] | no_license | #pragma once
#include "../../Math/Vector.h"
#include "../../Math/Matrix.h"
#include "../../Math/Geometry/Frustum.h"
#include "../../Graphics/Other/Viewport.h"
class Entity;
class Camera
{
protected:
/**
View and Projection matrices
**/
Mat4x4 m_view;
Mat4x4 m_prevView;
Mat4x4 m_projection;
Mat4x4 m_prevProj;
... | true |
4e32b0d0c9670cef28a48cae824e2bd5b89303d6 | C++ | jjzhang166/Eagle3D | /jni/Material.cpp | UTF-8 | 1,616 | 2.609375 | 3 | [] | no_license | #include "Material.h"
#include <Shader.h>
#include <RenderOfCamera.h>
Material::Material(){
}
void Material::AddTexture(string name,Texture texture){
textureMap[name]=texture;
}
Texture Material::GetTexture(string name){
return textureMap[name];
}
void Material::AddVector3(string name,Vector3 target){
vecto... | true |
956f77aedd58b242543d1b8222cf9ffbe3a19c37 | C++ | KangZehui/speed_test | /src/Addons/GeoStar/include/geomathd/nearest_finder_base.h | UTF-8 | 2,933 | 2.640625 | 3 | [] | no_license | // nearest_finder_base.h: interface for the nearest_finder_base class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_NEAREST_FINDER_BASE_H__142B17FB_7C56_4CA3_9EF4_185F0C3DAC71__INCLUDED_)
#define AFX_NEAREST_FINDER_BASE_H__142B17FB_7C56_4CA3_9EF4_185F0C3DAC71__INCLUDED_
... | true |
391b681a1e525c7f2750a75cdb8690eef9784229 | C++ | vicentesi/so2 | /trabalhoFinal-Vicente-Fernando-Taciane/ip_datagram_receiver.h | UTF-8 | 2,610 | 2.703125 | 3 | [] | no_license | /*
* ip_datagram_receiver.h
*
* Created on: Nov 24, 2013
* Author: vicente
*/
#ifndef IP_DATAGRAM_RECEIVER_H_
#define IP_DATAGRAM_RECEIVER_H_
// TEMPO MAXIMO DE ESPERA
#define WAIT_TIME 1000 // chronometro eh em microssegundos = 1 millis
#include "chronometer.h"
#include "ip_datagram.h"
using namespace E... | true |
99e465bb50f1b0be8c0632b808dd076db347268f | C++ | uchiiii/fmm-bem-relaxed | /include/executor/P2P.hpp | UTF-8 | 2,885 | 2.84375 | 3 | [] | no_license | #pragma once
/** @file P2P.hpp
* @brief Dispatch methods for the P2P stage
*
*/
#include "Direct.hpp"
struct P2P
{
//////////////////////////////////////
/////// Static Dispatchers ///////////
//////////////////////////////////////
struct ONE_SIDED {};
struct TWO_SIDED {};
/** One sided P2P
*/
t... | true |
d84f0ac040bd4c617f51e84edceaadad00498108 | C++ | yunn0504/ycyang | /Algorithm/Algorithm/1260.cpp | UTF-8 | 1,285 | 2.890625 | 3 | [] | no_license | //1260 DFS,BFS
#include<iostream>
#include<fstream>
#include<string>
#include<queue>
#include<stack>
using namespace std;
void DFS(int, int);
void BFS(int, int);
int check(int);
void init(int);
int graph[1001][1001];
int visit[1001];
int find[1001];
stack<int> stack1;
queue<int> queue1;
int main()
{
int n, m, v;
... | true |
4e9e264884365a958f7c8e0fbcf48627329bee59 | C++ | Vipiao/HeroesOfTheCitadel | /Heroes_of_the_Citadel/Heroes_of_the_Citadel/Sphere.cpp | UTF-8 | 1,172 | 3.140625 | 3 | [] | no_license |
#include "Sphere.h"
uint64_t Sphere::m_totalNumSpheres{ 0 };
Sphere::Sphere () {
m_id = m_totalNumSpheres++;
calculateMomentOfInertia ();
}
void Sphere::calculateMomentOfInertia () {
m_momentOfInertia = 2.0 / 5.0 * m_mass * m_radius * m_radius * m_momentOfInertiaMultiplier;
}
void Sphere::setRadius... | true |
de1fb3f027466b29bd1fcfafd77022c17c4d3033 | C++ | mversace/LeetCode | /LeetCode/Problems/001-050/25. Reverse Nodes in k-Group.h | GB18030 | 2,045 | 3.984375 | 4 | [] | no_license | #pragma once
/*
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.
k is a positive integer and is less than or equal to the length of the linked list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is.
You may not alter t... | true |
92b43a4f8a784b75198191bd0ef7d9c7d7fd3f6e | C++ | DrFeelgreat/Aquatorium | /rob_lab1_1/Screen.h | UTF-8 | 575 | 2.609375 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
class Screen :public sf::Drawable, sf::Transformable
{
public:
Screen();
~Screen();
bool load(const std::string & textureFile, sf::FloatRect textureCoord, sf::Vector2u size, sf::Vector2f position);
void setMaxFrame(int frameNumber);
void nextFrame();
void visibility(boo... | true |
73be3ba17e2116c0c8285e04ebb7e8b1a9ce3872 | C++ | BankC/BC2448630 | /HomeWork/Assignment 1/Savitch_8thEdition_Chap1_Prob8/main.cpp | UTF-8 | 1,011 | 3.515625 | 4 | [] | no_license | /*
* File: Chapter1 Problem 8
* Author: Bank Conway
* Created on June 26, 2014, 11:08 AM
* Purpose
*/
#include <iostream>
using namespace std;
int main(int argc, char** argv)
{
//Declare variable
unsigned short penny, nickel, dime, quarter,pamt, nkamt, damt, qramt, total;
//User interac... | true |
2e2be33f5bd710fe0c491312f0c819a0b1cb9629 | C++ | DanNixon/CSC8503_AdvancedGameTechnologies | /Build/ncltech/Utility.cpp | UTF-8 | 3,724 | 3.421875 | 3 | [] | no_license | #include "Utility.h"
#define NOMINMAX
#include <Windows.h>
#include <algorithm>
#include <shlobj.h>
#include <sstream>
/**
* @brief Splits a string by a delimiter.
* @param str String to split
* @param delim Delimiter
* @return Vector of substrings
*/
std::vector<std::string> Utility::Split(const std::string &s... | true |
c27d256c15c92813d794afc5cddf1dad458d6a57 | C++ | gutioliveira/Algorithms | /URI/1907.cpp | UTF-8 | 1,742 | 2.765625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define MAX 1025
int campo[MAX][MAX];
int A,B;
void bfs( int a, int b ){
queue < pair<int,int> >q;
q.push(make_pair(a,b));
pair <int,int> atual;
while(!q.empty()){
atual = q.front();
q.pop();
if ( atual.first - 1 > 0 && campo[atual.first-1][atual.secon... | true |
86cb27e21582c22eaeb2afafdf07f9a326a8a465 | C++ | Alecfut07/Programacion-ATS | /POO (Programacion Orientada a Objetos)/Clase Tiempo (Alec).cpp | ISO-8859-1 | 1,181 | 4.40625 | 4 | [] | no_license | /*Construya una clase Tiempo que contenga los siguientes atributos enteros:
horas, minutos y segundos. Haga que la clase contenga 2 constructores, el
primero debe tener 3 parmetros Tiempo(int, int, int) y el segundo slo tendr
un campo que sern los segundos y desensamble el nmero entero largo en horas,
minutos y segundo... | true |
75aeec5b0e460109284481882557c032a60d002e | C++ | Wibben/WCIPEG | /ccc97s3.cpp | UTF-8 | 763 | 3.265625 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int t,undefeated,oneloss,eliminated;
cin >> t;
for(int i=0; i<t; i++) {
cin >> undefeated;
cout << "Round 0: " << undefeated << " undefeated, 0 one-loss, 0 eliminated" << endl;
oneloss = eliminated = 0;
int round = 1;
while(un... | true |
f28b83fe7bee1f06a064f2bb0c13e6f2cd8bd846 | C++ | myk502/ACM | /hdu_oj/hdu1175 correct.cpp | GB18030 | 1,826 | 2.625 | 3 | [] | no_license | #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <queue>
#include <climits>
using namespace std;
const int MAX = 1003;
const int dirx[5] = {0,0,1,0,-1};
const int diry[5] = {0,1,0,-1,0};
bool visit[MAX][MAX];
int map[MAX][MAX];
int wan[MAX][MAX];
int n,m,bx,by;
bool ... | true |
177ed38e395fb6a2ea13e7f09d3a9534d16f672b | C++ | rohit-0308/CPP-Placement-Practice-Problems | /5. 2D Arrays/Spiral_order_print.cpp | UTF-8 | 993 | 2.828125 | 3 | [] | no_license | #include "bits/stdc++.h"
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int a[n][m];
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cin >> a[i][j];
}
}
int row_start = 0, column_start = 0, row_end = n - 1, column_end = m - 1;
... | true |
27c11dc64dfc1d2d452e46125e0c30903208bf6f | C++ | nikifaets/bytesmack | /src/main.cpp | UTF-8 | 2,860 | 2.5625 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <string>
#include "HTree.h"
#include <queue>
#include <cassert>
#include <unordered_map>
#include "Encoder.h"
#include "Bitset.h"
#include "Utils.h"
#include "FileReader.h"
#include "Archiver.h"
#include "FilePathManager.h"
#include "CLIParser.h"
/*
Командният интер... | true |
a3de8082c310f0572ce0d0c4439d07291309ad2c | C++ | blockspacer/Unity2018ShaderCompiler | /Tools/BugReporterV2/qt_face/tests/src/AttachmentItemViewTest.cpp | UTF-8 | 6,350 | 2.78125 | 3 | [] | no_license | #include "AttachmentItemView.h"
#include "attachment/Attachment.h"
#include "attachment/AttachmentProperties.h"
#include "AttachmentDummy.h"
#include "AttachmentSpy.h"
#include "AttachmentPropertyStub.h"
#include "shims/logical/IsEmpty.h"
#include "shims/attribute/GetSize.h"
#include "shims/attribute/GetRawPtr.h"
#inc... | true |
84051be18befa53caee4a889aa759621ec97b975 | C++ | Divyarajsinh/lb-Arduino-Code | /LBCards/GVSDuino/GVSDwATP/GVSwATP.ino | UTF-8 | 1,147 | 3.078125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | /*
GVSwATP
Tests the LEDs on the ATP daughter card when it is mounted above a GVSDuino card.
Bounce a light across the LEDs.
*/
// The LEDs follow
int progLED = 7;
int errLED = 8;
int hbLED = 9;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin... | true |
1d58638d093324dba85d90c80b4ddc2c401537a6 | C++ | jay-jay-chang/DX11 | /framework/ModelExample/src/utility.h | UTF-8 | 354 | 2.59375 | 3 | [] | no_license | #pragma once
#include <windows.h>
#include <string>
#include <vector>
using namespace std;
static string utf16ToUTF8(const wstring &s)
{
const int size = ::WideCharToMultiByte(CP_UTF8, 0, s.c_str(), -1, NULL, 0, 0, NULL);
vector<char> buf(size);
::WideCharToMultiByte(CP_UTF8, 0, s.c_str(), -1, &buf[0], size, 0, N... | true |
27a5143a9735e004dc77d1cc0d05a946b26beb1b | C++ | titiloxx/Anti-debugging | /DebugHook/dllmain.cpp | UTF-8 | 997 | 2.640625 | 3 | [] | no_license | // dllmain.cpp : Defines the entry point for the DLL application.
#include "windows.h"
#include <iostream>
#include <fstream>
#include <map>
DWORD funcion = 0x77666000;
bool Hook(void* toHook, void* ourFunct, int len)
{
if (len < 5)
{
return false;
}
DWORD curProtection;
VirtualProtect(toHook, len, PAGE_EXECUTE... | true |
9e65650d14b32f1ce6a0a169ea9323f7988a6cae | C++ | Jasonarea/Baekjoon_ | /Divide_Conquer/Divide_Conquer/1517_버블소트.cpp | UTF-8 | 754 | 2.8125 | 3 | [] | no_license | #include <cstdio>
int a[500000];
int b[500000];
long long solve(int start, int end) {
if(start == end) return 0;
int mid = (start + end)/2;
long long ans = solve(start, mid) + solve(mid+1, end);
int i = start; int j = mid + 1;
int k = 0;
while (i <= mid || j <= end) {
if (i <= mid ... | true |
5becb918b9419ef522204045df91f11511ac12d2 | C++ | JanKuiken/rp3synth | /src/filter.cpp | UTF-8 | 1,299 | 2.875 | 3 | [] | no_license | #include "filter.h"
#include <cmath>
#include "utils.h"
Filter::Filter(int in_rate)
{
rate = in_rate;
}
void Filter::Start(double in_frequency, std::string in_type, double in_sensitifity)
{
// IIR filter constants for a low pass filter
sensitifity = bounds_limit(in_sensitifity, 0.0, 1.0);
filtertype... | true |
2ea7a25668b738103e5ba3343f745c22fa8b9fed | C++ | letuananh035/Paint32 | /Source/Paint32/CLine.cpp | UTF-8 | 1,898 | 2.578125 | 3 | [] | no_license |
#include "CLine.h"
#include "Exception.h"
namespace Paint32{
namespace Model{
void CLine::SetDraw(COLORREF color, COLORREF colorbg,
POINT lefttop, POINT rightbottom,
int iPenStyle, int iPenWidth, bool bSetRop){
this->ColorBG = colorbg;
this->Color = color;
this->LeftTop = lefttop;
this->RightBott... | true |
7e55f7d93a3d911cb94ec7a606dff2199454bcc9 | C++ | exgile/pangya-server-1 | /src/common/timer.cpp | UTF-8 | 1,586 | 3.1875 | 3 | [] | no_license | #include "timer.h"
#include <map>
#include <memory>
std::map<int, std::unique_ptr<Worker>> timers;
void timer_init() {
// Create timer
for (int i = 0; i < MAX_TIMER; ++i) {
timers[i] = std::make_unique<Worker>();
timers[i]->enabled = false;
}
}
int aquire_timerid() {
for (int i = 0; i < MAX_TIMER; ++i) {
i... | true |
e1789dd5fefb69ccce8007fba7abcd4eb9b524ab | C++ | rleonard21/Sphere-Simulator | /Simulator.h | UTF-8 | 2,564 | 2.9375 | 3 | [] | no_license | //
// Created by robert on 6/25/20.
//
#ifndef SPHERE_SIM_SIMULATOR_H
#define SPHERE_SIM_SIMULATOR_H
#include "Sphere.h"
#include "Vector.h"
#include <vector>
const double gravity = -9.81;
const double airDensity = 1.225;
// EFFECTS: struct for passing parameters to simulator constructor
struct SimulationParamete... | true |
6f68dae46e49e166179e0a4578ac31455612fff5 | C++ | ParCoreLab/Split_SpTRSV | /src/matrix.cpp | UTF-8 | 2,526 | 2.71875 | 3 | [] | no_license | // matrix.cpp
#include <matrix.h>
#include <common.h>
csr_matrix::csr_matrix(ind_type * const csrRowPtr,
ind_type * const csrColIdx,
val_type * const csrVal,
const sz_type m,
const sz_type n,
const sz_type nnz,
... | true |
f8f2e9fc27ce055ff3fbe263e68d58bc7157383a | C++ | juliawong22/LAIG | /LAIG-1/src/Parser.cpp | WINDOWS-1252 | 27,242 | 2.84375 | 3 | [] | no_license | #include <sstream>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cctype>
#include <iostream>
#include <vector>
#include "Parser.h"
#include "PerspectiveCamera.h"
#include "OrthoCamera.h"
#include "Appearance.h"
#include "Node.h"
#include "Animation.h"
using namespace std;
/*Recebe:
* string tex... | true |
858b0eef090c7f4be29661f780bbaab610ae1d61 | C++ | meethkr/CppPrimer | /C3/323.cc | UTF-8 | 403 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using std::vector;
int main()
{
vector<int> ivec;
int temp;
for (int i = 0; i < 10; i++)
{
std::cin >> temp;
ivec.push_back(temp);
}
for (auto it = ivec.begin(); it != ivec.end(); it++)
{
*it = *it * 2;
}
for (auto i:... | true |
e508ffba97d8a886ba4ae47462631710b02706ca | C++ | WhiZTiM/coliru | /Archive2/69/9082582e73376e/main.cpp | UTF-8 | 1,397 | 2.59375 | 3 | [] | no_license | #include <vector>
#include <unordered_map>
#include <boost/variant.hpp>
namespace libdocplus {
typedef bool Boolean;
typedef int Integer;
typedef double Real;
typedef std::vector<unsigned char> ByteBuffer;
typedef ByteBuffer String;
typedef ByteBuffer Name;
typedef ByteBuffer Stream;
cl... | true |
1c5303cf64d2186f0175930162010d5b098bd692 | C++ | acherian18/SIT107 | /BLINKSOS.ino | UTF-8 | 2,822 | 2.578125 | 3 | [] | no_license | void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
}
void morse()
{
//morse code for 's'- three short blinks
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(500); // wait for a half second
digitalWrite(LED_BUILTIN, LOW); // turn the LE... | true |
a87985805d4cc17b48715f3ba2c09f42a65d51ec | C++ | hellsdeur/exercises-concrete-math | /src/3_3.cpp | UTF-8 | 939 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <vector>
std::vector<int> concatenar(std::vector<int> vec1, std::vector<int> vec2) {
std::vector<int> concatenacao;
concatenacao.insert(concatenacao.end(), vec1.begin(), vec1.end());
concatenacao.insert(concatenacao.end(), vec2.begin(), vec2.end());
return concatenacao;
}
int main()... | true |
062951c49268bfd7f45241e9798e2314904459e3 | C++ | 15cm/LeetCode | /313.super-ugly-number.hpp | UTF-8 | 519 | 2.890625 | 3 | [] | no_license | class Solution {
public:
int nthSuperUglyNumber(int n, vector<int>& primes) {
int m = primes.size();
vector<int> ptr(m), f(n);
f[0] = 1;
for(int i = 1; i < n; i++) {
f[i] = INT_MAX;
for(int j = 0; j < m; j++) {
f[i] = min(f[i], f[ptr[j]] * prim... | true |
a98061c4dbb4de41e91dbc33688323646cd5818c | C++ | jerryhanhuan/test-code-backup | /UI/Bkwin/bkwindemo/branches/FileSearch.h | GB18030 | 2,603 | 2.625 | 3 | [] | no_license | /********************************************************************
created: 2008/10/17
filename: FileSearch.h
file base: FileSearch
file ext: h
author: huchao
purpose: Windows ļķװ
*********************************************************************/
#pragma once
#include <Windows.h>
#include <atlstr.h... | true |
36c89d686b14620066a15a4c9147ab1bca1bb885 | C++ | MirekJ/SC | /scOOP/mc/pairenergycalculator.h | UTF-8 | 8,105 | 2.921875 | 3 | [] | no_license | /** @file pairenergycalculator.h*/
#ifndef PAIRENERGYCALCULATOR_H
#define PAIRENERGYCALCULATOR_H
/*
* Calculates energy of a pair of Particle
* One particle stored as a internal state
*/
#include "../structures/topo.h"
#include "../structures/Conf.h"
class PairEnergyCalculator
{
private:
Pa... | true |
36a7fefb4303c2b689d8ac3c838f6637f8411e63 | C++ | jocanas/projects | /rgb.cpp | UTF-8 | 2,053 | 2.78125 | 3 | [] | no_license | const int pins[6] = {3,5,6,9,10,11};
int color[3] = {255,255,255};
void setup(){
for(int i = 0; i < 6; i++){
pinMode(pins[i], OUTPUT);
}
randomSeed(analogRead(0));
Serial.begin(9600);
}
void loop(){
// int color[3] = { 255, 255, 255 };
int incomingByte = 0;
if(Serial.available() > 9){
incomingByte... | true |
3e07394f57a0a52bd9e794ab284d47797690754f | C++ | CMcFeaters/light_monitor | /client_test_photo_resist/array_wifi.h | UTF-8 | 1,093 | 2.65625 | 3 | [] | no_license | /*
test.h - library for testing libraries
*/
#ifndef array_wifi_h
#define array_wifi_h
#define BED_TIME 2100
#define WAKE_TIME 600
#include <WiFiClient.h>
#include "Arduino.h"
class my_wifi
{
public: //publically accessible stuff
my_wifi(char* ssid,char* pw, char* host,int port, IPAddress ip, IPAddress ... | true |
af62baa698c9984fa4540ff6d0f146246fea80ba | C++ | Iximiel/Tesina-Calcolo2 | /CrankSolverDD.cpp | UTF-8 | 3,796 | 2.609375 | 3 | [] | no_license | #include "CrankSolver.hpp"
#include <iostream>
#include <fstream>
#ifdef DEBUG
#include <cmath>//per gli abs
void wait(){
cout<< "Premi enter per continuare."<<endl;
cin.get();
}
#endif //DEBUG
using namespace std;
CranckSolver::CranckSolver(const tridiag &mat, int Ns, int Nt,/* std::string opt,*/ double CCi, do... | true |
a1f2873897a0625b4bc66fb3586ce9e5c97624a2 | C++ | pauzabalgoitia/tarea-algoritmos- | /numeros iguales.cpp | UTF-8 | 325 | 2.640625 | 3 | [] | no_license | #include<conio.h>
#include<stdio.h>
#include<iostream>
float a,b;
main(){
printf("indique el primer numero");
scanf("%f", &a);
printf("indique el segundo numero");
scanf("%f", &b);
if (a==b)
{
printf("los numeros son iguales");
}
else
{
printf("los numeros son diferentes");
}
getche();... | true |
273f903d94109978cf3beb38735b0defb519d7b7 | C++ | jkjan/Baekjoon | /1495.cpp | UTF-8 | 897 | 2.546875 | 3 | [] | no_license | #include <iostream>
#define MAX_VOL 1001
#define MAX_SONG 101
using namespace std;
int main() {
int N, S, M;
int dp[MAX_SONG][MAX_VOL];
int V[MAX_SONG];
cin >> N >> S >> M;
fill(&dp[0][0], &dp[MAX_SONG-1][MAX_VOL], -1);
for (int i = 1; i <= N; i++) {
cin >> V[i];
}
dp[0][S] =... | true |
7d9c241af4aa999f1ba711904b1b8267fbf42185 | C++ | GaaH/VegetableCrushSaga | /src/views/StartView.cpp | UTF-8 | 1,187 | 2.734375 | 3 | [] | no_license | #include <SFML/Window/Event.hpp>
#include "views/StartView.hpp"
#include "controllers/GameController.hpp"
#include "Globals.hpp"
StartView::StartView(Controller *controller, sf::RenderWindow &window):
View(controller),
window(window)
{
auto font = globals.getFontManager().getResource("wombo_font");
start_te... | true |
ef6fcebe8487c3c38cceb8c243d17b6135b3f5a3 | C++ | dcoded2/tftp-client | /src/tftp/packet/data.cpp | UTF-8 | 812 | 2.609375 | 3 | [] | no_license | #include <tftp/packet/data.h>
namespace tftp {
namespace packet {
data::data () : packet (Opcode::OP_DTA) {}
data::data (char* buf) : packet (Opcode::OP_DTA) {
unpack (buf);
}
// data::data (char* buf, uint16_t size) : packet (Opcode::OP_DTA) {
// unpack (buf, size);
// }
uint16_t data::pack (char* buf) ... | true |
7e2fdf3ead1c26919e308d2a162a3fe938f8463d | C++ | hys2rang/WHrkTLQKF | /samsungProblems/2DarrayCalc.cpp | UTF-8 | 2,027 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <list>
#include <vector>
#include <algorithm>
#pragma warning(disable:4996)
using namespace std;
const int MAX = 110;
struct Num {
int cnt, n;
};
vector<int> calc(int arr[], int size);
bool compare(Num a, Num b);
int main()
{
int cnt;
int cy = 3, cx = 3;
int r, c, k;
int arr[MAX][MAX]... | true |
c66115f6013c29ed8bec2657e6e78372ad31b19e | C++ | avocado-bytes/light-controller | /light.ino | UTF-8 | 2,529 | 3.046875 | 3 | [] | no_license |
const int minimum = 400;
const int lightSensor = A0;
const int sensitivity = A1;
const int relayOutput = 7;
const byte bufferMax = 127;
byte buffer = 0;
void setup() {
pinMode(lightSensor, INPUT);
pinMode(sensitivity, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
pinMode(relayOutput, OUTPUT);
Serial.begin(9600);
}
... | true |
872019365b40d5fcaaa0bd7a2511b0e1143c33ae | C++ | sherlockwxl/cs343 | /a4/q1voter.cc | UTF-8 | 1,191 | 2.75 | 3 | [] | no_license | #include "q1voter.h"
#include "q1printer.h"
#include <iostream>
extern MPRNG mprng;
extern bool printmode;
// class constructor for voter
Voter::Voter( unsigned int id, unsigned int nvotes, TallyVotes & voteTallier, Printer & printer ):
id(id), nvotes(nvotes), voteTallier(voteTallier), printer(printer){};
// main ... | true |
78d0f704a1f49442455dc0840cc2d4f925586c1b | C++ | RunaticMoon/BOJ | /백준/2675 문자열 반복.cpp | UTF-8 | 397 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
int main() {
int T, loop_number;
string str, newstr;
cin >> T;
for (int test_case = 0; test_case < T; ++test_case) {
cin >> loop_number >> str;
newstr = "";
for (auto it = str.begin(); it != str.end(); ++it) {
for (int i = 0; i < loop_number; +... | true |
ee14fd11c7a7ebe8d679d85a78ae7cfe92aa3ba8 | C++ | TanavShah/SPOJ | /cpp_codes/bandw.cpp | UTF-8 | 725 | 2.640625 | 3 | [] | no_license | // Saheb Aaje Su Karvana?
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
while(1)
{
string s1,s2;
cin >> s1 >> s2;
if((s1 == "*") && (s2 == "*"))
{
break;
}
vector<int> pos;
for(int i = 0 ; i < s1.length() ; i++)
{
if(s1.at(i) != s2.at(... | true |
74351117bf504c1cf7ef35ae18b2f35686bf9cbb | C++ | mostafaelsayyad/ProblemSolving | /C++/UVA/UVA_summing digits.cpp | UTF-8 | 573 | 2.6875 | 3 | [] | no_license | #include<iostream>
#include<sstream>
using namespace std;
int conv(string st)
{
long long result;
stringstream(st) >> result;
return result;
}
string converttostring(long long num)
{
string s;
//SS ss;
stringstream ss;
ss<<num;
ss>>s;
return s;
}
int main()
{
string str;
while(cin>>str)
{
... | true |
b2ba9b5721a3ed9f4b015fb9ce9dae646727a9dc | C++ | mfazekas/cpp_primitives_benchmark | /Tests/MallocTests.cpp | UTF-8 | 1,974 | 2.640625 | 3 | [] | no_license |
#include "PerfTestRegistry.h"
#include "PerfTestBase.h"
#include <stdlib.h>
#include <sstream>
template <int size>
class MallocFreeCallPerfTest : public PerfTestBase {
public:
virtual int perform (int& rounds_,int fourtytwo_,int random_) {
int result = 0;
for (int i = 0; i < rounds_; ++i) {
... | true |
ec7ab64d4540ca8aa1a96561f0db6e3e9448ff02 | C++ | NilsKarlbrinkMalmquist/EDAF50 | /Labs/lab1/buggy_programs/sum.cc | UTF-8 | 294 | 3.125 | 3 | [] | no_license | #include <iostream>
#define N (4)
int x = 1000;
int a[]{ 1, 2, 3, 4 };
int y = 2000;
int main()
{
int sum{0};
std::cout << "welcome to the buggy sum program. the sum should be 10\n";
for (int i = 0; i <= N; i++)
sum += a[i];
std::cout << "sum = " << sum << "\n";
return 0;
}
| true |