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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
163a342af809b4cb1121fff92cd00865d9514f9b | C++ | YuhanLiu11/ME759 | /HW10/reduce.cpp | UTF-8 | 260 | 2.609375 | 3 | [] | no_license | #include "reduce.h"
float reduce(const float* arr, const size_t l, const size_t r) {
float local_res = 0;
#pragma omp parallel for simd reduction(+:local_res)
for (size_t i = l; i < r; i++) {
local_res += arr[i];
}
return local_res;
} | true |
8dd5554a57630e64586de971cae98460e5c761c1 | C++ | Jia-Joe/AlgorithmLevel | /HashTable/HashTable/ChainSymbolTable.h | UTF-8 | 1,130 | 3.515625 | 4 | [] | no_license | #pragma once
template<class T1=char,class T2=int>
class ChainSymbolTable
{
private:
class Node
{
public:
T1 key;
T2 val;
Node *next;
Node(){ this->next = NULL; }
Node(T1 key,T2 val)
{
this->key = key;
this->val = val;
this->next = NULL;
}
};
public:
Node *first;
ChainSymbolTable()
{
f... | true |
a64357be66183b63fed87bcc8a50ccb76ccdb597 | C++ | rtodinova/OOP-praktikum | /DArray.cpp | UTF-8 | 1,136 | 3.390625 | 3 | [] | no_license | #include "DArray.h"
#include <iostream>
using namespace std;
DArray::DArray()
{
size = 0;
capacity = 0;
array = NULL;
}
DArray::DArray(DArray const& d)
{
size = d.size;
capacity = d.capacity;
array = new int[capacity];
for (int i = 0; i < size; i++)
array[i] = d.array[i];
}
DArray::~DArray()
{
delete[]arr... | true |
39c7a130926bc91f911a2be68021df075af1691f | C++ | medranSolus/PEA | /PEA/DisjunctiveSet.cpp | UTF-8 | 818 | 2.984375 | 3 | [] | no_license | #include "pch.h"
#include "DisjunctiveSet.h"
DisjunctiveSet::Node::Node(long long upNode, long long nodeRank) : up(upNode), rank(nodeRank) {}
long long DisjunctiveSet::findSet(long long vertex)
{
if (set[vertex].getUpNode() != vertex)
set[vertex].setUpNode(findSet(set[vertex].getUpNode()));
return set[vertex].get... | true |
af9ed4c50d1ca4a3b0b1cb9826b9291495ee78ed | C++ | hal-seiya-yamazaki-0428/2D_Shooting | /sprite.cpp | SHIFT_JIS | 15,987 | 2.734375 | 3 | [] | no_license | #include <d3d9.h>
#include <d3dx9.h>
#include "texture.h"
#include "mydirectx.h"
//=====================================================
//O[oϐ
//=====================================================
static D3DCOLOR g_color = D3DCOLOR_RGBA(255, 255, 255, 255);
//=============================================... | true |
f9a6df0fb6f00d9e5f8f386499bac3201504c87a | C++ | aukdata/gb7avr | /firmware/src/utils.cpp | UTF-8 | 655 | 2.5625 | 3 | [] | no_license | #include <stdlib.h>
#include <util/delay.h>
#include "utils.hpp"
int __cxa_guard_acquire(__guard* g)
{
return !*reinterpret_cast<char*>(g);
}
void __cxa_guard_release(__guard* g)
{
*reinterpret_cast<char*>(g) = 1;
}
void __cxa_guard_abort(__guard*g ) {}
void __cxa_pure_virtual() {}
void* operator new(size_... | true |
ee89760b094d2a11a114e9bba88220dbf42ce676 | C++ | tyoma/micro-profiler | /frontend/tests/ProjectionViewTests.cpp | UTF-8 | 4,815 | 2.671875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <frontend/projection_view.h>
#include "helpers.h"
#include <test-helpers/helpers.h>
#include <ut/assert.h>
#include <ut/test.h>
using namespace std;
namespace micro_profiler
{
namespace tests
{
namespace
{
struct POD
{
int a;
int b;
double c;
};
POD mkpod(int a, int b, double... | true |
7c58dd4cd230a9b2ea52cf6c06d2000342b1949e | C++ | Luckily777/C- | /C++0c061401.cpp | GB18030 | 5,589 | 3.53125 | 4 | [] | no_license |
//listʵ
#include <iostream>
using namespace std;
//List: ˫ͷѭ
template < class T>
struct ListNode
{
T _value;
ListNode<T>* _next;
ListNode<T>* _prev;
ListNode(const T& val = T())
:_value(val)
, _next(nullptr)
, _prev(nullptr)
{}
};
template <class T, class Ref, class Ptr>
struct ListIterator
{
typedef L... | true |
e28b63decda0821fdaf2176b4536fc0e64fc219c | C++ | ZeroDestru/meus-pogramas-em-C | /Arvores, listas encadeadas, entre outros/Resta um.cpp | UTF-8 | 1,507 | 2.84375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
#include <time.h>
#include <iostream>
struct dados{
struct dados *esq;
int info;
struct dados *dir;
};
typedef struct dados NO;
void cria_LSE(NO ** Inicio, NO **Fim){
*Inicio=NULL;
*Fim=NULL;
}
void Ins_Inicio(NO **Inicio, NO **Fim, int v){
NO *p = (NO *... | true |
1908b807705f446d5a03f4f844908132aea81149 | C++ | sooyoungmoon/WSN_Simulation | /DIHA_NEWLKH/DIHA_NEWLKH/Atk_FRA.cpp | UHC | 1,676 | 2.5625 | 3 | [] | no_license |
#include "Atk_FRA.h"
#include <fstream>
using namespace std;
void Atk_FRA::forgeEvntMsg(EvntMsg* msg) // ʿ?
{
int hop = msg->hop;
if (hop == 0) // hop count 0̸ ¥ MAC
{
list<MAC*>::iterator it = msg->macs.begin();
for (it; it != msg->macs.end(); it++)
{
MAC* mac = *it;
// MAC 尡 Ѽ 尡 ƴϸ ߸ CODE (... | true |
202231470b51764318bc4c0061b68dae27872f64 | C++ | Maxinary/Raytracer | /Ray.cpp | UTF-8 | 331 | 2.890625 | 3 | [] | no_license | #include "Ray.h"
Ray::Ray():pos(vectors::vec3(0,0,0)),direction(vectors::vec3(0,0,0)){}
Ray::Ray(const vectors::vec3 pos, const vectors::vec3 direction) : pos(pos), direction(direction){}
vectors::vec3 Ray::posAtDist(double dist){
return vectors::vec3(pos.x+direction.x*dist, pos.y+direction.y*dist, pos.z+direction.... | true |
1f752e917653e0633bac30b480982b08baad1a27 | C++ | chief-r0cka/poisson-blend | /poisson.cpp | UTF-8 | 4,931 | 3.15625 | 3 | [] | no_license | #include "poisson.h"
// Считаем лапласиан как поток векторного поля через данную точку,
// Аппроксимируя суммой частных производных первого порядка
float Poisson::laplace(cv::Point p, cv::Mat& img){
return 4*img.at<float>(p)
- img.at<float>(p + cv::Point(1,0)) - img.at<float>(p + cv::Point(-1,0))
... | true |
e2be1ee730b661a4080232787e5d6cf86d79d41f | C++ | mtfranzen/luci-connect | /test/src/luciconnect/node_test.cc | UTF-8 | 4,326 | 2.625 | 3 | [
"MIT"
] | permissive | #include "luciconnect/node_tests.h"
namespace {
class ServiceMock : luciconnect::Node {
public:
ServiceMock(std::shared_ptr<luciconnect::Connection> connection) : luciconnect::Node(connection) {}
void Run() {
this->Connect();
json register_message = {
{"serviceName", "addingNumbers"}... | true |
6d1235dbf2bcdc0f0ca47085106b5e09cf6cafe9 | C++ | ragavsachdeva/DynTTP | /Instance/Solution.hpp | UTF-8 | 4,239 | 3.15625 | 3 | [
"MIT"
] | permissive | #ifndef SOLUTION_HPP
#define SOLUTION_HPP
#include <vector>
#include "Instance.hpp"
#include "City.hpp"
#include "Item.hpp"
using namespace std;
#define PRINTALL(arr) for(int i = 0; i < arr.size(); i++) { cout << arr[i] << " "; } cout << endl;
class Solution {
public:
Solution(): tour({}), items({}), objecti... | true |
7c31d64dfa2ba7bd6e7f0948a065b9306900de50 | C++ | DARKREDHAYABUSA/Unit5_Assignment_Licon | /Transaction.h | UTF-8 | 12,314 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <iomanip> //for setw
#include <fstream> //write a file
#include <unistd.h> //for sleep command
#ifndef TRANSACTION_H
#define TRANSACTION_H
using namespace std;
//********Class Style**********/
class MenuItemList
{
private:
string name;
doub... | true |
94b63fa2b18e32a69d98daa64d550f7acd36f2c2 | C++ | shivamgohri/ds_codes | /Arrays/merge_2arrays.cpp | UTF-8 | 784 | 3.421875 | 3 | [] | no_license | //https://practice.geeksforgeeks.org/problems/merge-two-sorted-arrays/0
#include <iostream>
#include <vector>
using namespace std;
int main(){
int t;
cin>> t;
while(t--){
int n1, n2;
cin>> n1 >>n2;
vector<long int> arr1(n1,0);
vector<long int> arr2(n2,0);
for(int i=0; i<n1; i++)
cin>> arr1[i];
... | true |
1a3a799ed373735855a120f969e0cadefc365659 | C++ | mykyusuf/AssemblyReader | /CPUProgram.cpp | UTF-8 | 733 | 2.953125 | 3 | [] | no_license | #include "CPUProgram.h"
//Class constructerı çağrılınca readfile fonk çağırır
CPUProgram::CPUProgram(string myk) {
ReadFile(myk);
}
//Dosya okuma fonksiyonu, okudugunu string arraye atar
CPUProgram::CPUProgram(int option) {
opt=option;
}
CPUProgram::CPUProgram(){}
void CPUProgram::ReadFile(string... | true |
3c2c68d523f56b137c93f5e6d2b5082df651956e | C++ | dmkz/competitive-programming | /codeforces.com/Codeforces Ladder 1500-1599/0363B.cpp | UTF-8 | 719 | 3.15625 | 3 | [] | no_license | /*
Problem: 363B. Fence
Solution: dynamic programming, two pointers, brute force
*/
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(0); std::cout.tie(0); std::cerr.tie(0);
int n, len;
std::cin >> n >> len;
... | true |
7f642dbb0c696a1879bba75d59c0bb2b2d107d22 | C++ | migmartri/slacktronic | /devices/arduino/LEDs/slacktronic_LED.ino | UTF-8 | 1,578 | 3.421875 | 3 | [
"Apache-2.0"
] | permissive | /*
It reads characters from the serial input and sends digital writes or low depending on its value.
Capital leters means HIGH, downcase LOW.
Currently, the actuators are hardcoded to for outputs
*/
char receivedChar;
boolean newData = false;
const int ACTUATOR_A = 2;
const int ACTUATOR_B = 6;
const int ACTUATOR... | true |
b1b518d97db25c7207732a99677a268e8f79f3df | C++ | gpoleszuk/kinematic | /src/Library/Stream/NtripServer.cpp | UTF-8 | 1,383 | 2.546875 | 3 | [] | no_license | #include "NtripServer.h"
#include "Parse.h"
NtripServer::NtripServer(const char* host, const char* port, const char *mount,
const char *user, const char *passwd)
: Socket(host, port)
{
debug("NtripServer::NtripServer(%s, %s, %s, %s, %s) ErrCode=%d\n",
host, port, mount, u... | true |
5517cc80c65e111bd48a3a13c77c7cb383c0bb4c | C++ | drusk/scratch | /patch-boundaries/src/patch.cpp | UTF-8 | 1,291 | 3.109375 | 3 | [] | no_license | #include "patch.h"
std::vector<Point> Patch::GetBorderPoints() {
std::vector<Point> borderPoints;
for (int x = minX; x <= maxX; ++x) {
borderPoints.push_back(Point(x, minY));
borderPoints.push_back(Point(x, maxY));
}
/* Don't do corner points twice! */
for (int y = minY + 1; y < m... | true |
c653b14c7c5a84fe08fdc782073db4d6873fbee8 | C++ | Ypsillonn/PPE | /capteur.ino | UTF-8 | 1,140 | 2.6875 | 3 | [] | no_license | const int pingPin = 7;
const int pin = 2;
int buttonState = 0;
/**************************************************************************/
void setup() {
Serial.begin(9600);
pinMode(pin, INPUT);
}
/**************************************************************************/
void loop() {
float d... | true |
0a217b384bd5a24f29daf1fb3a4b3ee74830c35c | C++ | antautu/CPTR246 | /tree.h | UTF-8 | 13,761 | 3.828125 | 4 | [] | no_license | /************************************************
tree.h - binary tree that holds integers
************************************************/
#ifndef _TREE_H
#define _TREE_H
#include <fstream>
using namespace std;
class BinaryTreeNode{
friend class BinaryTree;
public:
// CONSTRUCTORS
BinaryTre... | true |
bdd1c2c2ea513cffa21857def28746373d14af64 | C++ | jschfflr/hacker.org | /bricolage/object.cpp | UTF-8 | 211 | 2.640625 | 3 | [] | no_license | #include "object.h"
#include <atomic>
std::atomic<long long> count;
Object::Object() {
count.fetch_add(1);
}
Object::Object(const Object&) {
count.fetch_add(1);
}
Object::~Object(){
count.fetch_sub(1);
} | true |
8a770de84160d910d87394153af243eb4682475f | C++ | killbug2004/deianeira | / deianeira --username badteen@sina.com/exe/Deianeira/common/sysmodule.cpp | GB18030 | 1,322 | 2.546875 | 3 | [] | no_license | #include "sysmodule.h"
//ϵͳģб
PSYSTEM_MODULE_LIST GetSystemModuleList()
{
//ָ붨
PNtQuerySystemInformation NtQuerySystemInformation;
HMODULE hModule;
ULONG ulSize;
NTSTATUS status;
PSYSTEM_MODULE_LIST pSystemModuleInfo;
//ģ
if(!(hModule=LoadLibrary(L"ntdll.dll")))
{
return NULL;
... | true |
d84ce153e695bf82d79cc8e1ca6052405838fbe5 | C++ | JessicaALeite/A_lib | /Maths/Diophantine_Linear.cpp | UTF-8 | 1,393 | 3.28125 | 3 | [] | no_license | #include<iostream>
#include<map>
#include<cstdio>
#include<vector>
#include<stack>
#include<set>
#include<algorithm>
using namespace std;
void divide(long long a,long long b,long long &q,long long &r)
{
q=a/b;
r=a%b;
}
long long mod(long long a,long long b)
{
return (a+b)%b;
}
long long ext_euclidean_itr(long... | true |
81a4d1078ea385238db86b391f942823444c9551 | C++ | Cheese-5040/Comp-2011 | /lab/harrison.cpp | UTF-8 | 14,007 | 3.53125 | 4 | [] | no_license | // pa2.cpp
// COMP2011 (Fall 2020)
// Assignment 2: Subtring Pattern Matching
//
// Name: Shih-heng, LO
// Student ID: 20654493
// Email: sloab@connect.ust.hk
#include <assert.h>
#include <iostream>
#include <limits>
using namespace std;
// C string termination character
const char NULL_CHAR = '\0';
// The "not f... | true |
56e0af5a79f589bb03d023e27b757b2a555c88d5 | C++ | LM1107/mygit | /workspace/hqyj/c++/day3/const_class.cpp | UTF-8 | 668 | 3.640625 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Demo{
public:
Demo(int ,int );
void setVal(int ,int ) const;
int getVal();
void display(){}
int z;
private:
const int x;
int y;
};
Demo::Demo(int a ,int b):x(a),y(b)
{
}
void Demo::setVal(int a,int b) const
{
}
int Demo::getVal()... | true |
beae0348680d200effac372f9a6dc9a21687db6a | C++ | vanshsehgal2001/Leetcode | /Leetcode_Arrays_Easy/RelativeSortArray.cpp | UTF-8 | 719 | 3.0625 | 3 | [] | no_license | class Solution {
public:
vector<int> relativeSortArray(vector<int>& arr1, vector<int>& arr2) {
int arr[1001]={0};
for(int i=0;i<arr1.size();i++){
arr[arr1[i]]++;
}
vector<int> output;
for(int i=0;i<arr2.size();i++){
int ele=arr2[i];
// outp... | true |
f2612aabdea8fdd19c2b0c1cc4bde36f3450a573 | C++ | Blackcat12/Informatica_3 | /E_24_fattoriale con sottoprogrammi.cpp | WINDOWS-1252 | 542 | 3.3125 | 3 | [
"MIT"
] | permissive | #include<stdio.h>
#include<stdlib.h>
/*
program:fattoriale con sottoprogramma
Diego Gattari
3INA
13/09/2017
versione 1.0
*/
int main () {
int r;
int n;
do{//ciclo per rendere l'inserimento del numero corretto
printf("Inserisci un numero: ");
scanf("%d", & n);
}while(n<0);
r=fat_n(int n);//o... | true |
ad6befce74c7279ca2b3ad07794f002e645cdc7f | C++ | HackEduca/Mixly_Arduino | /mixly_arduino/arduino/portable/sketchbook/libraries/SevenSegmentTM1637/src/SevenSegmentExtended.h | UTF-8 | 1,337 | 2.890625 | 3 | [
"GPL-2.0-only",
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
SevenSegmentTM1637 - class to control a 4 digit seven segment display with a TM1636 or TM1637 driver IC
Created by Bram Harmsen, September 25, 2015
Released into the public domain.
Licence: GNU GENERAL PUBLIC LICENSE V2.0
# Changelog
v1.0.0 25-10-2015
* First release
*/
#ifndef SevenSegmentExtende... | true |
022f435060b9f64ece2ba235caa212bc1dac040b | C++ | Neology92/complex-test | /src/Statistics.cpp | UTF-8 | 830 | 3.359375 | 3 | [] | no_license | #include <iostream>
#include "Statistics.hh"
/*!
* Plik zawiera definicje metod zawartych w klasie Points
*/
Points::Points(){
count = 0;
pool = 0;
}
void Points::goodAnswer(){
pool++;
count++;
}
void Points::badAnswer(){
pool++;
}
void Points::check(Complex pattern, Complex answer){
if(patte... | true |
dd63a923b7fdc940dc63c7293e6d0425fd5f8703 | C++ | kevin-chshen/C-11_exercise | /test/container/IocContainer.h | UTF-8 | 1,800 | 3.109375 | 3 | [] | no_license | #pragma once
#include <unordered_map>
#include <functional>
#include <memory>
#include <string>
#include <iostream>
#include "Any.h"
class IocContainer
{
public:
IocContainer() {};
~IocContainer() {};
public:
template <typename T, typename Denped, typename... Args>
typename std::enable_if<!std::is_base_of<T, Denp... | true |
84861c5e6bcf32618a13bf0ba28d4fbdd61364ff | C++ | greenfox-zerda-sparta/besszerf | /week-06/Day-3_templates/07.cpp | UTF-8 | 1,036 | 4.125 | 4 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
typedef unsigned int uint;
template<class T, class P>
class Example {
private:
T item1;
P item2;
public:
Example(T i1, P i2);
T get_item1();
P get_item2();
void set_item1(T item);
void set_item2(P item);
};
template<class T, c... | true |
8e21c13a2e579a158b75014736e6766ff9c485ff | C++ | Maxime-Tong/Happy_new_year_present | /Characters.cpp | GB18030 | 3,219 | 2.90625 | 3 | [] | no_license | #include "Characters.h"
#include<vector>
#include<queue>
#include<iostream>
#include<conio.h>
#include<windows.h>
using namespace std;
void Put(string c)
{
for (int i = 0; i < c.size(); ++i) {
cout << c[i];
Sleep(10);
}
Sleep(500);
}
bool is_legal(int map[row][column],COORDINATE& node)
{
if (node.x >=column |... | true |
8515ab847325264f32434988dfc56d7da251d8d1 | C++ | HaeilSeo/console.h | /main.cpp | UHC | 3,265 | 2.921875 | 3 | [] | no_license | #include<iostream>
#include"DDS.h"
#include"keyboard.h"
#include"graphic.h"
class Player {
public:
/////////÷̾ /////////
DDS_FILE* dds[8]; //DDS κ̹ 迭
float px;
float py;
float Speed;
int imgldx; // κ ̹ 迭 ε
///////÷̾ Լ////////
void init() {
int subImgWidth = 184; //κ ̹ ̿
int subImg... | true |
1230df5014faae8bcb91bab5c1887c2dcd496383 | C++ | yashasvimisra2798/CodesByYashasvi | /C++/Class.cpp | UTF-8 | 2,876 | 4.4375 | 4 | [] | no_license | // You have to create a class, named Student, representing the student's details, as mentioned above, and store the data of a student.
// Create setter and getter functions for each element; that is, the class should at least have following functions:
// get_age, set_age
// get_first_name, set_first_name
// get_last_n... | true |
05070913ce32b9b5f5ce691595d2e48ab5c43a36 | C++ | choupi/puzzle | /leetcode/p1461.cpp | UTF-8 | 406 | 2.765625 | 3 | [] | no_license | class Solution {
public:
bool hasAllCodes(string s, int k) {
unordered_set<string> kset;
int kcnt = 1 << k;
int len = s.size();
//cout << len-k+1<< endl;
for (int i=0;i<len-k+1;i++) {
//cout << s.substr(i, k) << endl;
kset.insert(s.substr(i, k));
... | true |
8498efaccba3d19a80ca9b7331be046c2157445d | C++ | elamitie/apex | /engine/graphics/view/Camera.cpp | UTF-8 | 2,781 | 2.796875 | 3 | [] | no_license | #include "Camera.h"
#include <math.h>
#include "utils/Math.h"
#include "input/Keyboard.h"
#include "input/Mouse.h"
#include "utils/Logger.h"
Camera::Camera(glm::vec3 pos, glm::vec3 up) {
Position = pos;
mTargetDistance = mDistance = pos.z;
WorldUp = up;
mScrollDirty = false;
Calculate... | true |
649ad58b37d57736b699bd2584b574019421f0e7 | C++ | NerdyCrow/OAP-sem2 | /Лаб 3/Lab №3 v16.2/Lab №3 v16.2/Lab №3 v16.2.cpp | MacCyrillic | 545 | 2.75 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<string>
using namespace std;
void search(char str[]) {
ofstream fout;
fout.open("FILE1.txt");
char st;
fout << str;
fout.close();
ifstream fin;
fin.open("FILE1.txt");
char arr[20];
int i = 0;
while (!fin.eof())
{
fin.get(st);
if (st=='2'||st=='4'||st==... | true |
aaec392ba5e6ee04b18ded77ffe60bcdbaa55412 | C++ | adiwang/uvnet | /test/test_pb.cpp | UTF-8 | 1,858 | 3.15625 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include "../pb/netmessage.pb.h"
class Protocol
{
public:
Protocol() {}
virtual ~Protocol() {}
virtual void Process(const char* buf, int length) = 0;
};
class CProtocol1 : public Protocol
{
public:
CProtocol1() {}
virtual ~CProtocol1() {}
static CProtocol1* GetInstance() { static CProtocol1 ... | true |
dc483a2942c21f855eecc1cd1803e0b4c233c82a | C++ | dzimbeck/BitBay | /src/qt/qwt/qwt_interval.cpp | UTF-8 | 8,399 | 3 | 3 | [
"MIT"
] | permissive | /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
**************... | true |
db64ed8876bbe7676f27e7dd336434b32bff8ea6 | C++ | Bekwnn/OpenGLSpring | /source/MayaCamera.cpp | UTF-8 | 4,636 | 2.78125 | 3 | [] | no_license | #include "MayaCamera.hpp"
#include <iostream>
struct MayaCamera::MayaCameraImpl
{
MayaCameraImpl() :
dolly(100.0f),
tumbleVector(45.0f),
trackVector(0.0f),
lastPos(0.0f),
movement(MayaCamera::CameraMovements::IDLE)
{
resetMatrices();
}
void resetAll()
... | true |
e3b1e888a54520dcc72645a06de8dee054392ccb | C++ | Rookiee/CPlusPlus | /C++Primer/8_7.cc | UTF-8 | 951 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <vector>
using namespace std;
typedef vector<string>::iterator Iterator;
istream &r (istream & is) {
string sval;
while(is >> sval , !is.eof() ) {
if(is.bad() )
throw runtime_error(" IO stream corrupted.");
if(is.fail() ) {
... | true |
b3198ed9444119d64b1ff1ce3a48367fbd7c824c | C++ | sahilrastogi25/interview-prep | /leetcode-problems/Recursion/josephusProblem.cpp | UTF-8 | 550 | 2.890625 | 3 | [] | no_license | class Solution {
public:
void solve(int index, int k, vector<int>&v, int&ans) {
int n = v.size();
if (n == 1) {
ans = v[0];
return;
}
index = (index + k) % n;
v.erase(v.begin() + index);
solve(index, k, v, ans);
}
int findTheWinner(int ... | true |
04f770b6eb7c7c50dc338f5a049170628ce80d17 | C++ | Dima-Git/RayTracer | /Textures.h | UTF-8 | 2,173 | 2.96875 | 3 | [] | no_license | #pragma once
#ifndef _TEXTURES_H_
#define _TEXTURES_H_
#include "Vec3.h"
#include <math.h>
double noise_function(Vec3 v);
double zoomed_noise(Vec3 p, Vec3 origin, Vec3 size, Vec3 patch_size);
double smooth_noise(Vec3 p, Vec3 origin, Vec3 size, Vec3 patch_size);
double turbulence(Vec3 p, Vec3 origin, ... | true |
03146d22a40889fdac1832cd5ccb13c271b1d2dc | C++ | ddomovic/PlaneLeveling | /PlaneLevelingSDL2/Plane.cpp | UTF-8 | 1,897 | 2.6875 | 3 | [] | no_license | #include "pch.h"
#include "RandomForceApplier.h"
#include "Game.h"
#include "Component.h"
#include "SpriteComponent.h"
#include "Actor.h"
#include "Plane.h"
//use this one if there's no plane sprite file, otherwise use the second one
Plane::Plane(Game *game, int plane_size, RandomForceApplier *rfa) : Actor(game), _pla... | true |
6fd346fbd8a833bd6343e785b1939eff3674f981 | C++ | kumarvis/AlgoPractice | /AlgoMadeEasy/Tree/FindMaxBtree.hpp | UTF-8 | 693 | 3.296875 | 3 | [] | no_license | #ifndef FIND_MAX
#define FIND_MAX
#include<iostream>
#include<stack>
#include<limits>
#include "CreateBST.hpp"
using namespace std;
int findMaxBtree(struct Node* root) {
if (root == NULL)
return numeric_limits<int>::min();
int res = root->data;
int l = findMaxBtree(root->left);
int r = findMaxBtree(root->right)... | true |
03c919444a277411d342708522e55b5c58626143 | C++ | kuronekonano/OJ_Problem | /1087 Leyni, LOLI and Cap.cpp | GB18030 | 747 | 3.140625 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int t,n,a[56];
scanf("%d",&t);//ΪnߵñΪm
while(t--)//ʣµñΪn-mñӵ˿ñΪn-m-1ûñӵ˿ñΪn-m
{
int sum=0;//n-mΪñӵmΪûñӵ(n-m)*(n-m-1)+m*(n-m)=sum
scanf("%d",&n);//(n-m)*(n-1)=sum
for(int i=1;i<=n;i++)//˿ñsumһΪʣñn-1
{
scanf("%d",&a[i]);... | true |
463b4d5c11389c56284c30776eae696633dd6c70 | C++ | tomm1990/simpleConsoleForm | /MethodsInSoftwareTask3/NumericBox/NumericBox.h | UTF-8 | 558 | 3.09375 | 3 | [] | no_license | #pragma once
#include "../Panel/Panel.h"
#include "../Label/Label.h"
#include "../Button/Button.h"
class NumericBox : public Panel{
public:
NumericBox(int, const int, const int);
virtual ~NumericBox();
string getValue() const { return to_string(number); }
void setValue(const int);
Label* getLabel() const { return... | true |
e0dd6a295fed8b672438a46f5b2aab84e135cf3e | C++ | PatrykKudyk/Snake-z-obiekt-wki | /PROJEKT_SNAKE/JedzenieWieksze.cpp | UTF-8 | 523 | 2.75 | 3 | [] | no_license | #include "JedzenieWieksze.h"
JedzenieWieksze::JedzenieWieksze(int szerokosc, int wysokosc)
{
polozenie_x = szerokosc / 2;
polozenie_y = wysokosc / 2;
}
JedzenieWieksze::~JedzenieWieksze()
{
}
int JedzenieWieksze::getPolozenieX()
{
return polozenie_x;
}
int JedzenieWieksze::getPolozenieY()
... | true |
f151de908ca3f9f8aa3ed39cc61379bc0fd7276d | C++ | stoma-siarhei/BinaryTree | /src/BinaryTree.h | UTF-8 | 1,131 | 3.484375 | 3 | [] | no_license | #include <iostream>
#ifndef nullptr
#define nullptr NULL
#endif
template <class K, class D>
class BinaryTree
{
protected:
struct Node {
K key;
D data;
Node *left, *right;
Node(K _key, D _data) : key(_key), data(_data), left(nullptr), right(nullptr) {}
~Node()
{
... | true |
2c7e0bd5082244b1022e2463aa991fd0e4219164 | C++ | awesomeabhi34/cpc-prep | /week 5/first 1 in infinite array.cpp | UTF-8 | 332 | 3 | 3 | [] | no_license | int func(int arr[]){
int lo=0;
int hi=1;
while(arr[h]==0){
l=h;
h=2*h;
}
int ans=myf(arr,l,h);
return ans;
}
int myf(int arr[],int l,int r){
while(l<=r){
int mid=l+(r-l)/2;
if(arr[mid]==1 && (mid==0||arr[mid-1]==0)){
return mid;
}
if(arr[mid]==1){
r=mid-1;
}else{
l=mid+1;
}
}
r... | true |
c7279d983dc1aab3a8adc3a2bca7a47c023d5de1 | C++ | HungMingWu/librf | /librf/src/when_v2.h | UTF-8 | 16,049 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
namespace resumef
{
using any_t = std::any;
using std::any_cast;
}
//纠结过when_any的返回值,是选用index + std::any,还是选用std::variant<>。最终选择了std::any。
//std::variant<>存在第一个元素不能默认构造的问题,需要使用std::monostate来占位,导致下标不是从0开始。
//而且,std::variant<>里面存在类型重复的问题,好几个操作都是病态的
//最最重要的,要统一ranged when_any的返回值,还得做一个运行时通过下标设置std::vari... | true |
9ee51b9e1f5f3438eefbc3c89930775ff7befb5c | C++ | xiangpeng93/MFCameraPlayer | /TopoBuilder.cpp | UTF-8 | 14,173 | 2.546875 | 3 | [] | no_license | #include "TopoBuilder.h"
//
// Initiates topology building from the file URL by first creating a media source, and then
// adding source and sink nodes for every stream found in the file.
//
HRESULT CTopoBuilder::RenderURL(PCWSTR fileUrl, HWND videoHwnd)
{
HRESULT hr = S_OK;
do
{
m_videoHwnd = v... | true |
9d27bb5e17dedcfca30b118b95e7f1cd43bcd7eb | C++ | MrJiu/eBox_Framework | /component/uGUI/U_GUI.h | WINDOWS-1252 | 3,167 | 2.71875 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #ifndef __U_GUI_H
#define __U_GUI_H
extern "C" {
#include "ugui.h"
}
//class LCD_DRIVER{
//public:
// UG_RESULT _HW_DrawLine( UG_S16 x1, UG_S16 y1, UG_S16 x2, UG_S16 y2, UG_COLOR c );
// void _HW_DrawPixel( UG_S16 x, UG_S16 y, UG_COLOR c );
// UG_RESULT _HW_FillFrame( UG_S16 x1, UG_S16 y1, UG_S16 x2, UG_S16 y2, UG_... | true |
7b5688726f021cb314ad1ff8216d5de50f07836a | C++ | GaryCao97/CodeWarehouse | /C++/dev/try/game2.cpp | GB18030 | 3,986 | 2.828125 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<conio.h>
#include<ctime>
#include<Windows.h>
using namespace std;
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0)
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1)
#define TOP 1
#define LEFT (2 * TOP)
#define MAX_SIZE 40
#define R... | true |
9f95c55e8ef94465cb1ffe55bc3eaaa561bb3f6a | C++ | WeyrSDev/TouchMIDI | /RotaryEncoder.h | UTF-8 | 717 | 3.015625 | 3 | [] | no_license | #ifndef __ROTARYENCODER_H
#define __ROTARYENCODER_H
#include "Encoder.h"
constexpr bool SWAP = true;
constexpr bool NOSWAP = false;
class RotaryEncoder : public Encoder {
public:
RotaryEncoder(uint8_t pin1, uint8_t pin2, bool swapDirection = false, int divider = 1) : Encoder(pin1,pin2), m_swapDirection(swapDirecti... | true |
2e74268cd135bab8f4d6168d35aca343338a9611 | C++ | feixiangxiaoshu/Leetcode | /208字典树.cpp | UTF-8 | 1,082 | 3.453125 | 3 | [] | no_license | //
// Created by Administrator on 2020/7/12.
//
class Trie {
private:
bool isEnd=0;
Trie* next[26]={nullptr};
public:
/** Initialize your data structure here. */
Trie() {
}
/** Inserts a word into the trie. */
void insert(string word) {//以next存字母
Trie* node=this;
for(char c:... | true |
5e919a78d29549cb8fcfbec5b4ef9413c905bc91 | C++ | derickfelix/pppucpp_answers | /Part01/09.Technicalities-Classes-etc/Chrono.cpp | UTF-8 | 3,629 | 3.546875 | 4 | [] | no_license | // Chrono.cpp
#include "Chrono.h"
namespace Chrono {
// Member function definitions
Date::Date(int yy, Month mm, int dd)
: y(yy), m(mm), d(dd)
{
if (!is_date(yy, mm, dd)) throw Invalid();
}
const Date& default_date()
{
static Date dd {2001, Month::jan, 1}; // start of 21st century
return... | true |
dbf81cf19977be63481fce0e8d1ab97553121597 | C++ | minghaoPA/hair_utils | /src/XForm.h | UTF-8 | 13,699 | 3.15625 | 3 | [
"MIT"
] | permissive | #ifndef XFORM_H
#define XFORM_H
/*
Szymon Rusinkiewicz
Princeton University
XForm.h
Transformations (represented internally as column-major 4x4 matrices)
Supports the following operations:
xform xf, xf2; // Initialized to the identity
XForm<float> xf3; // Just "xform" is XForm<double>
xf=xfor... | true |
9e970ad25f36eb2464b59bff6281802754a58fef | C++ | fiorentinogiuseppe/curso_cpp | /secao_8/VariavelEstatica.cpp | UTF-8 | 284 | 2.6875 | 3 | [] | no_license | //
// Created by giuseppe on 16/04/2020.
//
#include<iostream>
int ContadorChamadas(){
static int NumChamadasDaFuncao = 0;
return ++NumChamadasDaFuncao;
}
int main(){
for(int i = 0; i<5; i++){
std::cout << ContadorChamadas() << std::endl;
}
return 0;
} | true |
885f0cc6ab391a8a2d346685137e4a81b6e1b8ba | C++ | CindyKXLiu/LifeGUI | /cell.h | UTF-8 | 1,502 | 3.234375 | 3 | [] | no_license | #ifndef CELL_H
#define CELL_H
#include <cstddef> // defines size_t i.e. an unsigned int
#include <iostream>
#include <string>
#include "subject.h"
#include "observer.h"
#include "info.h"
class Cell : public Subject, public Observer {
const int LOWER_BOUND = 2;
const int UPPER_BOUND = 3;
const int REVIVAL ... | true |
922f2ec08b38e6222dbcc4c02a406fe22c05ccd5 | C++ | Lee-DongWon/Baekjoon_Problems | /11170.cpp | UTF-8 | 433 | 3.125 | 3 | [] | no_license | #include <stdio.h>
int count(int n) {
int cnt = 0;
if (n == 0) {
return 1;
}
else {
while (n > 0) {
if (n % 10 == 0) {
cnt++;
}
n /= 10;
}
return cnt;
}
}
int main() {
int t;
int sum = 0;
scanf("%d", &t);
while (t--) {
int a, b;
sum = 0;
scanf("%d %d", ... | true |
377c3ae6ec9d73d0ac8eb48fe664a579a1507932 | C++ | joraojr/trabalhoed2 | /001/main.cpp | UTF-8 | 1,625 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include "SplayTree.h"
#include "Trie_RW.h"
using namespace std;
int main()
{
Trie_RW Trie;
string line;
ifstream myfile ("/home/jorao/Documentos/trabalhoed2/001/Dicionarios/novos/dic2"); // ifstream = padrão ios:in
if (myfile.is_open())
... | true |
ed7657b37a07a2d4d4598d7c8bce3785a9851a70 | C++ | MattMorris1996/GameOfLife | /main.cpp | UTF-8 | 1,314 | 3.125 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
#include <vector>
#include "life.h"
#include "display_sdl.h"
using namespace std;
int main(void)
{
const int COLUMNS = 500;
const int ROWS = 500;
const int WINDOW_WIDTH = 1000;
const int WINDOW_HEIGHT = 1000;
Display display(WINDOW_WIDTH, WINDOW_HEIGHT);
... | true |
82b0c12a1120b0169bca40e327ab59feb46e60d7 | C++ | huiaidan/WebServer | /base/Socket.h | UTF-8 | 489 | 2.671875 | 3 | [] | no_license |
#include<sys/socket.h>
#include<arpa/inet.h>
#include"Data.h"
using namespace std;
class Socket
{
public:
Socket(int lifd=-1):listenfd(lifd)
{}
~Socket()
{}
void socket_init();//初始化socket结构体serv_addr
void listenfd_create();//创建listenfd;一个eventloop只有一个
void socket_bind();//绑定listenfd到socket结构体
void socket_list... | true |
258b28d8b157042c885fb7ed137c27fc0ae63090 | C++ | ThouCheese/floating_n | /f/floor.cpp | UTF-8 | 544 | 2.609375 | 3 | [] | no_license | template<size_t M, size_t E>
F<M, E> constexpr F<M, E>::floor() const
{
// will do nothing if the last digit of the mantissa has value less than
// one.
if (this->abs() < ONE)
return ZERO;
BitArray<s_bits> exp = get_exp() - s_exponent_bias;
// make sure that the exponent is not greater than ... | true |
2019638e7fc99b1c221b0509bcf43be294f89a45 | C++ | ailyanlu/ACM_LeetCode | /ACM_Programfan/[LeetCode]Convert Sorted List to Binary Search Tree/[LeetCode]Convert Sorted List to Binary Search Tree.cpp | UTF-8 | 1,715 | 3.484375 | 3 | [] | no_license | // [LeetCode]Convert Sorted List to Binary Search Tree.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
// [LeetCode]Invert Binary Tree.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <vector>
using namespace std;
/*
Input... | true |
5e3e73a3e62c1bb7b30bc4e6e878ec140c2a2ce8 | C++ | sand0636/RFID | /RFID-Network-Build-master/tests/Power consumption tests/RF24MeshPowerUse/RF24MeshPowerUse.ino | UTF-8 | 1,881 | 2.75 | 3 | [
"MIT"
] | permissive |
/*
* Code to test the actual data rate and number of packets dropped using the RF24Mesh. This is largely taken from the transfer example for the RF24 library
* Ben Duggan
* 9/16/18
*/
#include "RF24.h"
#include "RF24Network.h"
#include "RF24Mesh.h"
#include "printf.h"
#include <SPI.h>
/*** Variables to change *... | true |
8d70005c6a1f8edd93c24c57c5a89a878435d761 | C++ | maqalaqil/swag-c- | /Examples/lua/embed3/embed3.cpp | UTF-8 | 5,127 | 2.703125 | 3 | [] | no_license | /* embed3.cpp A C++ embedded interpreter
This will register a C++ class with Lua, and then call a Lua function
passing C++ objects to this function.
*/
/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
#if !defined(alaqil_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_C... | true |
489314ebdc67a5f20a9960c633293c8f317a5b0f | C++ | fsilvestrim/cpp-tweenlib | /src/Animation.h | UTF-8 | 986 | 2.828125 | 3 | [
"MIT"
] | permissive | /*
* Animation.h
* AnimationProject
*
* Created by Filipe Silvestrim on 4/29/09.
* Copyright 2009 __MyCompanyName__. All rights reserved.
*
*/
#include "Object.h"
class Animation
{
public:
static const int TRANSLATE = 0;
static const int LOOKAT = 1;
static const int ROTATE = 2;
static const int SCALE ... | true |
4e5daa6f3eb88691d0de9447d9f0cb7739352ce4 | C++ | accessmvsk/CodingPractice | /BinaryToDecimal.cc | UTF-8 | 1,190 | 3.6875 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <cmath>
#include <cstring>
// Program to convert decimal to binary and again binary to decimal
// XXX what if number is signed ?
int main()
{
std::string inputNumber;
std::cout<<"please enter the input number "<<std::endl;
std::cin>>inputNumber;
int decima... | true |
41ec7e6749799dcbde7843535c035817210b0e9a | C++ | andyryan/Volume-Renderer | /Volume Renderer/Volume Renderer/Colour.h | UTF-8 | 5,320 | 3.171875 | 3 | [] | no_license | #pragma once
#include <ostream>
#define RGB 3
#define RGBA 4
#define GREYSCALE 1
#define COMPRGB 6
#define COMPGREY 2
class Colour
{
public:
Colour(void)
{
_nbChannels = 3;
_intensities = new float[3];
for (int i = 0; i < _nbChannels; i++){
_intensities[i] = 0;
}
}
Colour(const int nbChannels, const... | true |
e5a1c2f9c6cec870e64855aa40b93b2fc2e47e48 | C++ | EliiFlipz/prueba1 | /Suma2Numeros.cpp | UTF-8 | 187 | 2.78125 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main(){
int n1, n2, resp;
cout<<"Ingrese dos numeros: "<<endl;
cin>>n1;
cin>>n2;
resp=n1+n2;
cout<<"La respuesta es: "<<resp;
}
| true |
49b0f29f0880956b0b9fcdbc3242cb8923336f65 | C++ | hkaushalya/CDFPhoJets | /PhoFlat/PhoFlat/NewJetList.hh | UTF-8 | 1,857 | 2.5625 | 3 | [] | no_license | #ifndef NEWJETLIST_HH
#define NEWJETLIST_HH
#include "Stuple.hh"
#include <string>
#include <vector>
#include "FreeFunctions.hh"
#include "PhotonList.hh"
#include "ElectronList.hh"
#include "JetList.hh"
class NewJetList
{
public:
NewJetList();
void AddUnused(Stuple& stuple, std::vector<int>UsedPho, std::vector<... | true |
2f2a2e4fddcc283a223c6e8247da253339f1e3ed | C++ | beta382/Tetris | /src/Screen/PauseScreen.h | UTF-8 | 3,828 | 2.8125 | 3 | [] | no_license | /*
* Authors: Wes Cossick, Evan Green, Austin Hash, Taylor Jones
* Assignment name: Tetris: Spring 2014 Group Project
* Assignment description: Write an awesome Tetris clone
* Due date: Apr 30, 2014
* Date created: Apr 27, 2014
* Date last modified: Apr 27, 2014
... | true |
63843542787dd057997e474721ac79ec37fde9a2 | C++ | w0lker/ACM | /leetcode/Two sum.cpp | GB18030 | 851 | 3.453125 | 3 | [] | no_license | #include <vector>
using namespace std;
//ӶO(nlog(n)) hashmapԴﵽO(n)Ӷȡ
class Solution {
public:
vector<int> twoSum(vector<int> &numbers, int target) {
vector<int> vec(numbers);
//òȽ
for(int i=1;i<vec.size();++i){
int tmp = vec[i];
int j = i - 1;
while(j>=0 && vec[j]>tmp){
vec[j+1] = vec[j];
... | true |
bb39a579689aa5452375f336425f9abf5faa6962 | C++ | MasterMaxLi/TemplateStudy | /普通函数与函数模板调用优先权.cpp | GB18030 | 593 | 3.5 | 4 | [
"Apache-2.0"
] | permissive | #include<iostream>
using namespace std;
//1.ͨͺģ嶼Եãȵͨ
void myPrint(int a, int b)
{
cout << "ͨ\n";
}
template<class T>
void myPrint(T a, T b)
{
cout << "úģ\n";
}
template<class T>
void myPrint(T a, T b,T c)
{
cout << "غģ\n";
}
void test01()
{
//ͨģIJбǿƵúģ
//myPrint<>(1, 2);
char a = 'a';
char b = 'b';
//иƥ»ȵú... | true |
45b70f0622a4f93ca2a62e69157915cece25f05c | C++ | Ogimle/ne | /src/Game/gamemap.h | UTF-8 | 3,064 | 2.6875 | 3 | [] | no_license | #ifndef GAMEMAP_H_INCLUDED
#define GAMEMAP_H_INCLUDED
#include <vector>
#include "../Utils/micropather.h"
#include "editor.h"
class C_GameMap : public micropather::Graph
{
private:
int MAPX, MAPY;
int maxDir;
public:
std::vector<void*> path;
micropather::MicroPather* aStar;
float totalCost;
... | true |
e1107b2b3d10bb5f3da7d57129629ef1817e893c | C++ | aminallam/algorithms | /solutions/028_Crystal_dp.cpp | UTF-8 | 1,195 | 2.90625 | 3 | [] | no_license | // Problem: http://icpcres.ecs.baylor.edu/onlinejudge/index.php?option=com_onlinejudge&page=show_problem&problem=1955
// Submit: Same As Previous
// Problem Number: 11014
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
typedef long long LL;
/////////////////////////////////////... | true |
b0383c20add6cb2828aca774376a05c8eb035c6d | C++ | MargaritaCastro/dd-cut-and-lift | /src/bdd_conic_diag.cpp | UTF-8 | 54,582 | 3.015625 | 3 | [] | no_license | //
// Created by Margarita Castro on 2019-08-09.
//
#include "bdd_conic_diag.h"
#include <fstream>
#include <algorithm>
#include <queue>
using namespace std;
// Construct BDD from scratch
void bdd_diag::construct_bdd() {
if (is_constructed){
cout << "BDD is already constructed" << endl;
return;... | true |
d1ad4edc0a9ee987e5f54a4232733cea5c745bee | C++ | zqnnn/coding-note | /practice/130_maxSlidingWindow.cpp | UTF-8 | 3,299 | 3.734375 | 4 | [] | no_license | //
// Created by zqn on 2019/9/4.
//
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
using namespace std;
//简单粗暴型。。竟然过了
class Solution {
public:
int max_num(vector<int>& nums, int i, int j){
int max_res = 0;
for(int q = i; q < j; q++){
max_res = max(max_res, nums[... | true |
d0ff0740373f6827403ef1d5f9f8603b20aa7e47 | C++ | CZ-CE3004-MDP-Group10/MDP-Group-10 | /Arduino/Libraries/Sensors/Sensors_Read_Sensor_Analog.cpp | UTF-8 | 1,623 | 3.609375 | 4 | [] | no_license | // MULTIDISCIPLINARY DESIGN PROJECT SEMESTER 2 YEAR 20-21 GROUP 10 SENSORS READ ANALOG VALUES FROM SENSORS FILE.
// Include the sensors header file.
#include "Sensors.h"
// Read and obtain the average of all sensor's analog values.
void Sensors::readSensor()
{
sensorA0_avg = 0;
sensorA1_avg = 0;
sensorA2_avg = 0;
... | true |
2f436eb7ca64e3f00e572e255a280af7a7d0d0a9 | C++ | YavuzSelimGugen/BusCardSystem | /kod/main.cpp | UTF-8 | 7,425 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include "person.h"
#include "admin.h"
#include "user.h"
using namespace std;
//Ön tanımlar.
void menu(person *dizi[10]);
void adminPanel(int i, person *dizi[10]);
void adminGiris(person *dizi[10]);
void userPanel(int i, person *dizi[10]);
//Admin panelinde işlemler yapıldıktan sonra y/n işlemini y... | true |
b6ca66b03b4731779437bf7d49f611d51552fc18 | C++ | AlexeiRubin/CDAC_ACTS | /ADS/15_JUL_2020/Assignment_3_Bitset.cpp | UTF-8 | 385 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
#define MAX_OF_RANGE 100
using namespace std;
int main()
{
int N;
bitset<MAX_OF_RANGE> arr;
cin >> N;
while(N != 0)
{
if(arr[N - 1] != 0)
cout << "Duplicate Entry of : " << N << endl;
else
arr[N - 1]... | true |
5d227cff0972339fbbee33d5ff866b5e6da7efaa | C++ | Wayne-Zen/practice | /basket/basket.hh | UTF-8 | 1,331 | 3.359375 | 3 | [] | no_license | #ifndef BASKET_HH
#define BASKET_HH
#include <memory>
#include <set>
#include <iostream>
#include "quote.hh"
#include "print_total.hh"
namespace {
class Basket {
public:
void AddItem(const Quote& sale) {
items_.insert(std::shared_ptr<Quote>(sale.clone()));
}
void AddItem(Quote&& sale) {
items_.insert(std... | true |
734ea2b7db7d80cdbf21d3dde2a794ecdeb38511 | C++ | Saragimaru/ipol_cpp | /src_test/test_polsym.cpp | UTF-8 | 3,247 | 2.8125 | 3 | [] | no_license | #include <stdio.h> /* printf */
#include <time.h>
#include <iostream>
#include <math.h>
void polleg(int const, double const *, int const, double *);
void polqkm(int const, int const, double const *, int const, double *);
void polrtm(int const, int const, double const *, int const, double *, double *);
voi... | true |
9c3f8c5fadd5720915a4707845b47a329f7ad621 | C++ | Barbuseries/IAJV_TP1 | /EntityNames.h | UTF-8 | 449 | 2.9375 | 3 | [] | no_license | #ifndef NAMES_H
#define NAMES_H
#include <string>
enum
{
ent_Nobody,
ent_Miner_Bob,
ent_Elsa,
ent_Drunkard_Clay,
ent_Barman,
MAX_ENTITY_INDEX
};
inline std::string GetNameOfEntity(int n)
{
switch(n)
{
case ent_Miner_Bob:
return "Miner Bob";
case ent_Elsa:
return "Elsa";
case... | true |
1bc8a37293c05cc615ac8f3e8e968306cc84468e | C++ | inmatarian/freezzt | /src/fileListModel.cpp | UTF-8 | 4,681 | 2.84375 | 3 | [
"MIT"
] | permissive | /**
* @file
* @author Inmatarian <inmatarian@gmail.com>
* @section LICENSE
* Insert copyright and license information here.
*/
#include <string>
#include <vector>
#include <dirent.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <algorithm>
#include <cassert>
#include "debug.h"
#incl... | true |
b404c93a59bfc2fe44a727f27a01524d5ce90801 | C++ | avast/retdec | /include/retdec/llvmir2hll/hll/output_manager.h | UTF-8 | 3,640 | 2.546875 | 3 | [
"MIT",
"Zlib",
"JSON",
"LicenseRef-scancode-unknown-license-reference",
"MPL-2.0",
"BSD-3-Clause",
"GPL-2.0-only",
"NCSA",
"WTFPL",
"BSL-1.0",
"LicenseRef-scancode-proprietary-license",
"Apache-2.0"
] | permissive | /**
* @file include/retdec/llvmir2hll/hll/output_manager.h
* @brief A base class of all output managers.
* @copyright (c) 2019 Avast Software, licensed under the MIT license
*/
#ifndef RETDEC_LLVMIR2HLL_HLL_OUTPUT_MANAGER_H
#define RETDEC_LLVMIR2HLL_HLL_OUTPUT_MANAGER_H
#include <string>
#include "retdec/llvmir2hll/... | true |
1c5b4f37eb4f3c5414e54c5362e39228a28b3619 | C++ | nandohdc/INF1010 | /T7 - Grafos/maze.cpp | UTF-8 | 3,326 | 3.046875 | 3 | [] | no_license | #include "maze.h"
#include <fstream>
#include <random>
#include <iostream>
#include <algorithm>
#include "unionfind.h"
#include "graph.h"
int randomInt( int from, int to )
{
std::random_device rand_dev;
std::mt19937 generator(rand_dev());
std::uniform_int_distribution<int> distr(from, to);
return dis... | true |
bc8b7875f2bf2fecaac80d60a84baaf4a505bdff | C++ | thtfive/USACO_Training | /pancakes/pancakes.cpp | UTF-8 | 2,026 | 2.71875 | 3 | [] | no_license | /*
ID:thtfive
LANG:C++
*/
#include<iostream>
#include<fstream>
#include<string>
using namespace std;
int partition(int *array,int p,int q)
{
int i=p-1;
for (int j=p;j<q;j++)
{
if(array[j]>array[q])
{
i++;
int tmp=array[j];
array[j]=array[i];
a... | true |
811362aec054ad24b20bc858e5451e02bd4e1e44 | C++ | akkk12/CodingQuestions | /recursion/PhoneKeypad.cpp | UTF-8 | 674 | 3.28125 | 3 | [] | no_license | #include<iostream>
using namespace std ;
char keypad[][10] = {" ", " ","ABC","DEF","GHI","JKL","MNO","PQRS","TUV","WXYZ"};
void generateNames(char *in , char *out , int i , int j ){
if(in[i] =='\0'){
out[i] ='\0';
cout<<out<<endl;
return ;
}
int digit = in[i] - '0';
if(digit == 0 || digit == 1... | true |
a5897c7ab3f89fabf45e4d6d9c7545be46448e56 | C++ | oknashar/Problem-Solving | /CodeFights Challenges/roadsBuilding.cpp | UTF-8 | 832 | 2.71875 | 3 | [] | no_license | // problem link : https://codefights.com/arcade/graphs-arcade/kingdom-roads/nCMisf4ZKpDLdHevE/
// solution by : youssef_ali
// codefights profile : https://codefights.com/profile/youssef_ali
std::vector<std::vector<int>> roadsBuilding(int cities, std::vector<std::vector<int>> roads) {
std::vector<std::vector<int>>... | true |
d369f3ab187dc1dab84c9dcf8dfb530dbc6f964b | C++ | dinhtuyen3011/cpp | /OOP Concepts/1. Sources/Exceptions_DAO_02.cpp | UTF-8 | 392 | 3.375 | 3 | [] | no_license | /* Trying to delete pointer to a local stack allocated variable. */
#include <bits/stdc++.h>
using namespace std;
int main()
{
int x;
int* ptr1 = &x;
// x is present on stack frame as
// local variable, only dynamically
// allocated variables can be destroyed
// using delete oper... | true |
826446a555742e8bbeebac83b8723411b4300bcf | C++ | vtil-project/VTIL-Core | /VTIL-Common/util/task.hpp | UTF-8 | 3,383 | 2.921875 | 3 | [] | permissive | #pragma once
#include <thread>
#include <future>
#include <optional>
#include <memory>
#include "type_helpers.hpp"
// [Configuration]
// Determine whether or not to use thread pooling for tasks.
//
#ifndef VTIL_USE_THREAD_POOLING
#ifdef _DEBUG
#define VTIL_USE_THREAD_POOLING false
#else
#de... | true |
403bd90c6f6d5971a7b472a5a66edff907ac7669 | C++ | Chickking-Website/SomeFile | /201801/test002.cpp | GB18030 | 765 | 3.546875 | 4 | [] | no_license | #include <cstdio>
int n, arr[100 + 1];
bool visited[100 + 1];
void print() {
for (int i = 1; i <= n; i++) {
printf("%5d", arr[i]);
}
putchar('\n');
}
void dfs(int start) {
if (start == n) {
print();
return;
} // ʼ±ڽ±꣬ȫɣ˳
for (int i = 1; i <= n; i++) {
if (!visited[i]) { // ĿǰҪʵλδʹ
... | true |
420514b30b60a629c7a8a02be27577aefe072aa0 | C++ | thejoggeli/matrix-raspi-3d | /Ledlib/Remote/Keys.cpp | UTF-8 | 931 | 2.890625 | 3 | [] | no_license | #include "Keys.h"
namespace Ledlib {
std::string KeyCodeToString(KeyCode KeyCode){
switch(KeyCode){
case KeyCode::A: return "A";
case KeyCode::B: return "B";
case KeyCode::X: return "X";
case KeyCode::Y: return "Y";
case KeyCode::Up: return "Up";
case KeyCode::Down: return "Down";
case KeyCode::Left: return "... | true |
0a2d31c65d72a6cf2c76f4679791ac3df4000616 | C++ | pfe1223/error-code | /Wordrange/AVL.h | UTF-8 | 1,947 | 3.84375 | 4 | [] | no_license | #ifndef AVL_h
#define AVL_h
#include<iostream>
#include <string>
using namespace std;
// node struct to hold data
class Node
{
public:
string key;
int tree_size = 0;
Node *left, *right, *parent;
Node() // default constructor
{
left = right = parent = NULL; // setting ev... | true |