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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
0f3e3b8e61df9064df218765d3ce5f31458a841b | C++ | LinkItONEDevGroup/LASS | /Device_mbed/Example_Geiger/mbed/PortInOut.h | UTF-8 | 2,833 | 2.65625 | 3 | [
"MIT"
] | permissive | /* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* 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/licenses/LICENSE-2.0
*
* Unless re... | true |
ca4516506a163dbdae32c4444afe70d244f4b299 | C++ | akb825/VertexFormatConvert | /lib/include/VFC/Converter.h | UTF-8 | 13,590 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive | /*
* Copyright 2020-2021 Aaron Barany
*
* 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/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | true |
bf4a5c567e5c4b3ebd5a254bd7e5e701f0c3cf7f | C++ | metaflow/contests | /headers/rnd.h | UTF-8 | 1,314 | 3.296875 | 3 | [
"MIT"
] | permissive | #ifndef _RND_H
#define _RND_H
#include <random>
#include <fstream>
#include <iomanip>
#include <chrono>
#include <algorithm>
class Random {
public:
std::default_random_engine source;
Random() {
source.seed(std::chrono::system_clock::now().time_since_epoch().count());
}
// [a, b)
long long next(long long ... | true |
9a192ea70e780e8f2eec5f6f009ed724e3706a7f | C++ | SeoHyeonMyeong/Practice_Station | /C++ 예제/Sizeof.cpp | UTF-8 | 340 | 3.359375 | 3 | [] | no_license | #include <iostream>
int main(void) {
int a = 10;
int *b = &a;
char c = 'a';
char *d = &c;
std::cout << "a의 크기 : " << sizeof(a) << std::endl;
std::cout << "b의 크기 : " << sizeof(b) << std::endl;
std::cout << "c의 크기 : " << sizeof(c) << std::endl;
std::cout << "d의 크기 : " << sizeof(d) << std::endl;
}
| true |
031da75d9519941dcbd2ccf86e0fc296fc9d6b86 | C++ | LLNL/gidiplus | /MCGIDI/Test/Utilities/MCGIDI_testUtilities.cpp | UTF-8 | 7,898 | 2.515625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
# <<BEGIN-copyright>>
# Copyright 2019, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: MIT
# <<END-copyright>>
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include "MCGIDI_testUtilities.hpp"
#define PRI... | true |
851bcb1796c4e9111377a1ddab2de7ed65b45e34 | C++ | yayahjb/neartree | /DataGen/src/vector_3d.cpp | UTF-8 | 44,802 | 2.53125 | 3 | [] | no_license | #include <cmath>
#include <cfloat>
#include <climits>
#include <iostream>
/* remove the next include if using a local version of rand */
#include <stdlib.h>
#ifdef _MSC_VER
#define USE_LOCAL_HEADERS
#endif
#ifndef USE_LOCAL_HEADERS
#include <vector_3d.h>
#else
#include "vector_3d.h"
#endif
// static const member vari... | true |
2ca11ae7599e76d999c79d86232a904a13e22cc9 | C++ | iamjhpark/BOJ | /_2234.cpp | UTF-8 | 3,006 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <bitset>
#include <vector>
#include <queue>
#include <algorithm>
#include <cstring>
using namespace std;
vector<int> answer;
bool check[50][50];
void BFS(vector<vector<int>> &map, int n, int m) {
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
if (chec... | true |
444a2d04dcd7ad350f93cdba9a46b5dc19b5c844 | C++ | NicolasMrc/exercices-c2 | /Vector.h | UTF-8 | 455 | 2.515625 | 3 | [] | no_license | //
// Created by Nicolas Mercier on 28/09/2016.
//
#ifndef TP2C_VECTOR_H
#define TP2C_VECTOR_H
/**
* Classe Vetcor
*/
class Vector {
private:
int *t;
int taille;
public:
Vector(int taille);
void afficher();
void saisie();
long operator=(Vector v);
Vector operator+(Vector v);
Vector ... | true |
a358a38ded3a8f676931eeee1ce7fbc2d96d3f66 | C++ | to5ta/massive_OpenCL | /exam_excercises/Aufgabe1/Histogram.cpp | UTF-8 | 22,215 | 2.578125 | 3 | [] | no_license | #include "Histogram.h"
#include <cstring>
#include <vector>
#include <assert.h>
#include <cmath>
#include <unistd.h>
#include "../shared/ansi_colors.h"
#include "../shared/clstatushelper.h"
OpenCLMgr *Histogram::OpenCLmgr = nullptr;
Histogram::Histogram(int pixel_per_workitem,
int group_size,
... | true |
d832a73844e2b25f490c3ece6e559b07f4526b03 | C++ | daria-kulikova/linear-congruential-generator | /lcg.cpp | WINDOWS-1251 | 23,794 | 3.09375 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <map>
#include <math.h>
#include <vector>
#include <omp.h>
#include <ctime>
#include "lcg.h"
//
inline long long Generator::LCG::Add(const long long num1, const long long num2) {
return (num1 + num2) % m;
}
//
inline long long Generator::LCG::Subtr(const long... | true |
e7fd2385e87b78b6780353962a2aa6538cc66eca | C++ | n2westman/raytrace | /template-rt.cpp | UTF-8 | 10,704 | 3.046875 | 3 | [] | no_license | //
// CS 174A Project 3
// Ray Tracing
// Nick Westman
// UID 903996152
#define _CRT_SECURE_NO_WARNINGS
#include "matm.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm> //To get max and min, which are used in clamping pixel values
#include <omp.h> //... | true |
487d72129e1ff5856aa6eef58f4606197779905c | C++ | mr-jaffery-hash/A-Simple-Shell | /SimpleShell.cpp | UTF-8 | 8,106 | 2.640625 | 3 | [] | no_license | #include <unistd.h>
#include <stdio.h> /* printf*/
#include <stdlib.h> /* getenv*/
#include <iostream> /*cout*/
#include <cstring> /*strlen*/
#include <string> /*getline*/
#include <string.h> /*strtok*/
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/shm.... | true |
5d716fa5f4ed0a4b6a10defa4bd4a2a494872385 | C++ | PaulDodd/chull | /src/chull.h | UTF-8 | 38,001 | 2.671875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <memory>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <iostream>
#include <fstream>
#include <algorithm>
#include <functional>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Sparse>
#include <eigen3/Eigen/Geometry>
namespace chull{
enum copy_type{shallow, d... | true |
c3e21d3c5316ba4cf9bb59b2c41ee9e673abe8bb | C++ | wangwangbuaa/leetcode_interview | /剑指offer/剑指offer30_包含min函数的栈.cpp | UTF-8 | 959 | 3.71875 | 4 | [] | no_license | /*
返回一个包含栈中最小元素的栈,实践复杂度是O(1)
*/
#include<iostream>
#include<stack>
#include<vector>
#include<climits>
using namespace std;
class Solution
{
public:
void push(int value)
{
stack1.push(value);
if(stack2.size()<1)
stack2.push(value);
else
{
if(stack2.top(... | true |
de1a5196041c2c87bbb52edd7ed493ffebfc23b6 | C++ | ArtemNikolaev/opp-in-cpp | /ch05/_retref.cpp | UTF-8 | 160 | 2.8125 | 3 | [] | no_license | #include <iostream>
int x;
int& setx();
int main() {
setx() = 92;
std::cout << "x=" << x << std::endl;
return 0;
}
int& setx() {
return x;
} | true |
72abb466fb9324965101c9d576ab6cfb4417c1ac | C++ | alexandraback/datacollection | /solutions_2749486_1/C++/Mathew24/main.cpp | UTF-8 | 1,134 | 2.890625 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
#define FOR(a,b) for(int a=0; a<b; a++)
#define ABS(a) ((a)<0 ? (-(a)) : (a))
using namespace std;
vector < char > solution;
int tryN(int n, int x, int y){
solution.resize(0);
while (n>0){
if(ABS(x) > ABS(y)){
if(x>0){
x-=n;
solution.push_back(... | true |
8654814498208a17f280ebb88d4d968ce80da7b2 | C++ | jacob-hegna/jhcrypto | /src/AES/AES.cpp | UTF-8 | 4,526 | 2.96875 | 3 | [] | no_license | #include "AES.h"
jhc::buffer jhc::AES::encrypt_block(jhc::buffer block, jhc::buffer key, jhc::AES::Mode mode) {
// establish Nr and Nk constants for the AES mode
uint key_length = 0;
uint rounds = 0;
switch(mode) {
case Mode::AES_128: key_length = 4 * 4; rounds = 10; break;
case M... | true |
ad5c7ac7f09a6cac87a305e25f0046beb3a9a9ed | C++ | mnickrogers/data-structures | /cpp/linked_list/node.hpp | UTF-8 | 1,028 | 3.28125 | 3 | [] | no_license | //
// node.hpp
// linked_list
//
// Created by Nicholas Rogers on 7/23/19.
// Copyright © 2019 Nicholas Rogers. All rights reserved.
//
#ifndef node_hpp
#define node_hpp
#include <iostream>
template <class T>
class Node
{
public:
Node()
{
_previous = _next = nullptr;
}
Node(T da... | true |
c4654f51ae0d7c53472266d4cb0e640db0280eb9 | C++ | Plantyplantyplanty/CS3A | /shunting_yard.h | UTF-8 | 927 | 2.703125 | 3 | [] | no_license | #define _CRTDBG_MAP_ALLOC
#ifndef SHUNTING_Y_H
#define SHUNTING_Y_H
//REMOVE INTERNALS, DUPLICATE ALL OF HIS TESTS
#include "Queue.h"
#include "Token.h"
#include "Stack.h"
#include "Number.h"
#include "Operator.h"
#include "RightParen.h"
#include "LeftParen.h"
#include "Variable.h"
#include "Function.h... | true |
1d896ddc2ef64d2d18b20066413640b43e51b6d3 | C++ | Joe-Demp/CompetitionCoding | /Deitel&Deitel/Chpt14/Stack.h | UTF-8 | 1,149 | 3.6875 | 4 | [] | no_license | // Stack code taken from fig 14.2 Deitel&Deitel
template<typename T>
class Stack
{
public:
explicit Stack(int = 10);
// destructor - to deal with dynamic memory
~Stack()
{
delete [] stackPtr;
}
bool push(const T &);
bool pop(T &);
bool isEmpty() const
{
return top == -1;
}
bool isFull() const
{
r... | true |
099098f3b7aefdf7be10155e0cf1dbccab193740 | C++ | xeon2007/WSProf | /Components/Sourcecode/AIC/MailSender/TestMailSender/TestLocalTempCopyOfFile.cpp | UTF-8 | 5,191 | 2.546875 | 3 | [] | no_license | #include "stdafx.h"
#ifndef _INHIBIT_TESTING_CODE
#include "TestLocalTempCopyOfFile.h"
#include "..\LocalTempCopyOfFile.h"
#include "..\..\..\..\..\Common\Libraries\No MFC\General\General.h"
#include "..\..\..\..\..\Common\Libraries\No MFC\General\FilePath.h"
BEGIN_TEST_SUITE(TestLocalTempCopyOfFile)
ADD_TEST_METHO... | true |
f6da7c7e7bda8b51f1dd44a9b291c0722e6e2613 | C++ | sebrockm/PA_TimeWarp | /Brocken_Physik/Heap.h | UTF-8 | 1,320 | 2.953125 | 3 | [] | no_license | #ifndef _HEAP_H_
#define _HEAP_H_
#include "Array.h"
#include "cuda_macro.h"
#include "types.h"
template <class T, u32 Size>
class Heap{
private:
Array<T, Size> ar;
u32 count;
public:
CUDA_CALLABLE_MEMBER Heap():ar(), count(0){}
CUDA_CALLABLE_MEMBER u32 length() const {
return count;
}
CUDA_CALLABLE_MEMB... | true |
0a048533a95ca174e59a9bfe4d62c850facafbdf | C++ | Lucas3H/Maratona | /CodCad/CodCad-ContagemdeAlgarismos.cpp | UTF-8 | 390 | 2.671875 | 3 | [] | no_license | #include <iostream>
#define MAXN 100000
using namespace std;
int main(){
int n;
int s[MAXN];
int v[10];
cin >> n;
for (int i = 0; i < n; i++){
cin >> s[i];
while (true){
if(s[i] < 10){
v[s[i]]++;
break;
}
v[s[i]%10]++;
s[i]/=10;
}
}
for(int i=... | true |
ba25e7048e2041938cc4f9915c30d3f488ed7878 | C++ | simonrg/data-structures-patterns | /Spike 13 - Composite Pattern/World.h | UTF-8 | 1,508 | 2.828125 | 3 | [] | no_license | #include <map>
#include <vector>
#include "Component.h"
class Location{
private:
MetaComponent info;
CollectionComponent item_ids;
PositionComponent position;
LocationManagerComponent l;
public:
Location(){};
Location(vector<string>);
MetaComponent& Info(){ return info; }
CollectionComponent& Items(){ retur... | true |
11a7ae729a7e1f0b3c2771dbf9ea8394d083ec7c | C++ | amengede/cpp-practice | /team.cpp | UTF-8 | 853 | 3.734375 | 4 | [] | no_license | /*
How many problems to attempt?
A team has 3 members and is given n problems. For each problem, each team member knows whether they can solve it.
The team will only attempt a problem if 2 out of 3 of them can solve it. How many problems can they attempt?
input: standard, no. of problems and the data s... | true |
b780b5f2633d8bc9e51b468dfd04e91a273f2151 | C++ | wlsgur0726/asd | /asd_test/test_objpool.cpp | UTF-8 | 7,465 | 2.875 | 3 | [] | no_license | #include "stdafx.h"
#include "asd/objpool.h"
#include "asd/util.h"
#include "asd/random.h"
#include <thread>
#include <mutex>
#include <atomic>
#include <vector>
#include <cstdlib>
#include <ctime>
#include <unordered_map>
namespace asdtest_objpool
{
std::atomic<int> g_objCount;
std::atomic<int> g_conCount_default... | true |
7d2ae6aacf3bd9ce933eb5e47aafc1fae4c12ab2 | C++ | belazaras/teardrop | /OpenGL/Classes/Components/Camera.cpp | IBM852 | 2,051 | 3.34375 | 3 | [] | no_license | #include "Camera.h"
// Included here to avoid circular dependencies.
#include <GameObject.h>
#include <Input.h>
#include <Transform.h>
vector <Camera*> Camera::instances;
// Camera(float fieldOfView=45.0, float aspectRatio=16/9, float nearClippingPlane=0.1, float farClippingPlane=100)
Camera::Camera(GameObject *go)
... | true |
45fa98ccb868919448b8986c77534b3a30143a37 | C++ | DenislavNedev/SDA | /LinkedList.cpp | UTF-8 | 721 | 3.890625 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct Node {
int value;
Node* next;
};
class List {
public:
List() {
this->head = NULL;
this->tail = NULL;
}
void add(int value)
{
Node* temp = new Node;
temp->value = value;
temp->next = NULL;
if (head == NULL)
{
head = temp;
tail = temp;
temp... | true |
21bd9d85b0b0f1ff7a75f2b7d8f58373e99ef043 | C++ | HellicarAndLewis/InMotion | /Basic/src/ofApp.cpp | UTF-8 | 5,424 | 2.96875 | 3 | [
"MIT"
] | permissive | #include "ofApp.h"
/*
moved on to Vertical_Horizontal from this version.
key input:
h = hide/show GUI
f = toggle fullscreen
m = hide mouse
important: include ofxGui addons.
changes:
- random width toggle
- two widths to change sizes of different coloured rectangles
- lock width toggle makes uniform... | true |
b13658bfd1c65671f6d55cbf42547cdeb29ed642 | C++ | Conun/abel | /abel/strings/str_split.cc | UTF-8 | 4,011 | 3.3125 | 3 | [
"BSD-3-Clause"
] | permissive | //
#include <abel/strings/str_split.h>
#include <algorithm>
#include <cassert>
#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <iterator>
#include <limits>
#include <memory>
#include <abel/log/raw_logging.h>
#include <abel/strings/ascii.h>
namespace abel {
namespace {
// This GenericFind() temp... | true |
d9450dac67416219e21b6433cf7d964353b1e5c8 | C++ | TasnimZia/UniThings | /CSC101-CPP/CSE-101-master/Arrays.cp | UTF-8 | 891 | 3.328125 | 3 | [] | no_license | #include<iostream>
#include<cstdlib>
#include<ctime>
using namespace std;
int main()
{
//DECLARATION
int n = 5;
int A[5];
//POPULATE
//srand(time(0));
srand(time(NULL));
int ll = 0, ul = 5;
for (int i = 0;i < n;i++)
{
//cout<<"Enter Number "<<i<<": ";
... | true |
82e9152e3b2bd79a01fcbb127b9a28c4f3dc0977 | C++ | mon3/CPP_labs | /prog4/macierz.hpp | UTF-8 | 735 | 2.78125 | 3 | [] | no_license | #ifndef _macierz_hpp_
#define _macierz_hpp_
#include <iostream>
typedef std::pair <int, int> RozmiarMacierzy;
typedef std::pair <int, int> Polozenie;
class Macierz
{
public:
Macierz (std::istream &is);
// tworzy macierz na podstawie strumienia
Macierz (int n, int m);
// tworzy pustą (niezainicjowaną) macierz n x ... | true |
2e792fb509ebcad3fa1f69206e5c3c0ff0915e00 | C++ | liamst19/game-frame | /src/drawing/drawing_text.cpp | UTF-8 | 4,819 | 3.015625 | 3 | [
"MIT"
] | permissive | /** drawing_text.cpp
* Object for rendering text to screen.
*/
#include "drawing_text.h"
#include <string>
#include "drawing_element.h"
#include "../medialayer/medialayer_drawing_renderer.h"
namespace Drawing{
/** Constructor
* @text: Text content
* @ font_src, @font_size: Font source and size
... | true |
6e6649d8bfb0bcb2021b021e129306edbca03ea0 | C++ | williamwii/ubc_proj | /cs314/a2/a2/pose.cpp | UTF-8 | 1,639 | 3.3125 | 3 | [] | no_license | #include <cstdlib>
#include <fstream>
#include <iostream>
#include <sstream>
#include "pose.hpp"
void readPoseFile(char const *path, std::vector<Pose> &poses) {
// Open the file.
std::ifstream fh;
fh.open(path);
while (fh.good()) {
double x, y, z;
std::vector<do... | true |
1d8e19dda28374cd4fb91682d6cf560e1093feee | C++ | MacgyverLin/FBXPreprocessor | /Vertex.h | UTF-8 | 1,669 | 3.109375 | 3 | [
"MIT"
] | permissive | #ifndef _Vertex_h_
#define _Vertex_h_
#include "Vector2.h"
#include "Vector3.h"
#include "Color.h"
#define NUM_COLORS 1
#define NUM_UVS 8
#define NUM_NORMALS 1
#define NUM_TANGENTS 1
#define NUM_BINORMALS 1
class Vertex
{
public:
Vertex();
Vertex(const Vector3& position, const Color& color, const Vector2& uv, con... | true |
12af35f093c0df0a4fb8dbfd5ac9037c2583f014 | C++ | jmborr/code | /cpp/Heavy_atom_code/decapeptide_utils/turn_propensities.cpp | UTF-8 | 1,727 | 2.578125 | 3 | [] | no_license | #include "pdbClasses2.h"
using namespace std;
#include<fstream>
#include<string>
#include<cstring>
/*=================================================================*/
bool test_input(int argc, char ** argv ){
int number_of_arguments = argc -1 ;
if( number_of_arguments != 2 ){
system("clear");
cout << "Usa... | true |
a432e4093a018fd13b12906d3defc63f8099607a | C++ | dima-bmstu/http_downloader | /src/HttpDownloader.cpp | UTF-8 | 3,364 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <sstream>
#include "HttpDownloader.h"
#include "utils.h"
static constexpr char end_of_header[] = "\r\n\r\n";
static constexpr char content_length[] = "Content-Length: ";
HttpDownloader::HttpDownloader(std::unique_ptr<SaverInterface>&& saver,
... | true |
fc87fec0eb270480c624a6a035922580fa6ba652 | C++ | harsh-agarwal/Competitive_programming | /part3/POINT/geometry.h | UTF-8 | 2,430 | 3.171875 | 3 | [] | no_license | #include <stdio.h>
#ifndef GEOMETRY_H_INCLUDED
#define GEOMETRY_H_INCLUDED
class point
{
private:
int x,y;
public:
point(int p=0,int q=0){x=p;
y=q;}
int GetX()const
{
return x;
}
int GetY()const
{
return y;
}
void SetX(const int new_X)
{
... | true |
5b883e4827419ca4dfd3ce39ea7fbedfc74c1228 | C++ | dpalchak/estoppel | /estp/base/meta.hh | UTF-8 | 6,129 | 2.734375 | 3 | [
"MIT"
] | permissive | #pragma once
#include "estp/base/types.hh"
#include <cstdint>
#include <iterator>
#include <type_traits>
#include <utility>
namespace estp {
// Metaprogramming functions
// Credit: many of these are borrow from R. Martinho Fernandes
// See his website Flaming Dangerous (rmf.io)
// Saves redundant typename ... ::ty... | true |
d4ede1cf02a631692ab40469af82e257d613ec3a | C++ | usherfu/zoj | /zju.finished/2110.cpp | UTF-8 | 1,423 | 2.96875 | 3 | [] | no_license | #include<iostream>
// DFS + 剪枝,剪枝条件为奇偶性和数量
using namespace std;
enum {
SIZ = 7,
};
int tab[SIZ][SIZ];
int N,M,T;
int tx,ty,sx,sy, occupy;
int readIn(){
if(scanf("%d%d%d",&N,&M,&T) <= 0 || N + M + T ==0)
return 0;
char ch;
occupy = 0;
for(int i=0;i<N;i++){
for(int j=0;j<M;j++){
... | true |
4d8f46a6bfa9ed83e6cd98cb8f3b76943d1b8fde | C++ | blegal/EN224-Test-et-verification | /2_Hardware/Etape_7/c_code/src/main.cpp | UTF-8 | 2,295 | 2.921875 | 3 | [] | no_license | #include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <paths.h>
#include <termios.h>
#include <sysexits.h>
#include <sys/param.h>
#include <sys/select.h>
#include <sys/time.h>
#include <time.h>
#include <cassert>
#include <iostream>
using name... | true |
d42a92c79e509751e2e6057641de431c8955e077 | C++ | CYR15000/Arduino-INA3221 | /examples/get_started/get_started.ino | UTF-8 | 1,357 | 2.78125 | 3 | [
"MIT"
] | permissive | #include <Wire.h>
#include <Beastdevices_INA3221.h>
#define SERIAL_SPEED 115200 // serial baud rate
#define PRINT_DEC_POINTS 3 // decimal points to print
// Set I2C address to 0x41 (A0 pin -> VCC)
Beastdevices_INA3221 ina3221(INA3221_ADDR41_VCC);
void setup() {
Serial.begin(SERIAL_SPEED);
while... | true |
a6cbc440f2d56dd85f7cdc52bdae0a9251e9ce1a | C++ | AlejandroNegri/POO-Biblioteca | /Biblioteca/VagregarLibro.h | UTF-8 | 602 | 2.625 | 3 | [] | no_license | /**
* @brief Ventana cargar los datos de un nuevo Libro
**/
#ifndef VAGREGARLIBRO_H
#define VAGREGARLIBRO_H
#include "Ventanas.h"
#include "Singleton.h"
class VagregarLibro : public VentanaAgregarLibro {
protected:
/// Guarda el nuevo dato y cierra la ventana (boton "Aceptar");
void ClickAgregarLibroNuevo( wxComman... | true |
bb78c8dced3e4490cfc7607baebfa7f0f710c08c | C++ | DawidK1/AiRRepo | /Maciek/problem3/main.cpp | UTF-8 | 819 | 3.0625 | 3 | [] | no_license | #include <iostream>
#include "vector.h"
#include "iter.h"
#include "toy.h"
#include "shop.h"
#include "company.h"
#include <fstream>
using namespace std;
int main()
{
ifstream file;
file.open("toys1.txt");
vector<toy> list1;
if(file)
{
string name;
float price;
while(file.eof() != true)
{
file >> name... | true |
58c9f8c6d3c1f479c4ce45272202b253683078fe | C++ | wjezowski/neuralNetwork | /include/Layer.h | UTF-8 | 633 | 2.515625 | 3 | [] | no_license | //
// Created by Wojtek on 2018-07-10.
//
#ifndef NEURALNETWORK_LAYER_H
#define NEURALNETWORK_LAYER_H
#include "Neuron.h"
#include <vector>
using namespace std;
class Layer {
private:
vector<shared_ptr<Neuron>> neurons;
public:
Layer(vector<shared_ptr<Neuron>> neurons, float biasWeight = s... | true |
778dd44b8faf3bc4e225ee32cd6785f5e324fb8f | C++ | souayrioss/Periode-SAS | /semaine 1/Challenges Variable/challenge8.cpp | UTF-8 | 365 | 2.90625 | 3 | [] | no_license | #include <stdlib.h>
#include <stdio.h>
#include <string.h>
int main(int argc, char *argv[])
{
int nb1,nb2,nb3,nb4;
double moy,sum;
printf("enter les 4 nombre : \n");
scanf("%d",&nb1);
scanf("%d",&nb2);
scanf("%d",&nb3);
scanf("%d",&nb4);
sum=nb1+nb2+nb3+nb4;
printf("Moyenne est : %.2f \n",sum);
moy=sum/4;
pr... | true |
517b8bd75b3d19636c29e8697af1a1ae7c504461 | C++ | JoKeR-VIKING/DS_Algo | /Coding Ninjas/Time And Space Complexity Analysis/arrayIntersection.cpp | UTF-8 | 2,288 | 4 | 4 | [] | no_license | // You have been given two integer arrays/list(ARR1 and ARR2) of size N and M, respectively. You need to print their intersection; An intersection for this problem can be defined when both the arrays/lists contain a particular value or to put it in other words, when there is a common value that exists in both the array... | true |
82b119e5a99485dca561c2812eb34db7c975aed0 | C++ | alexandraback/datacollection | /solutions_5662291475300352_0/C++/valih10/main.cpp | UTF-8 | 1,192 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<queue>
#include<map>
#include<set>
#include<algorithm>
#include<iomanip>
#include<bitset>
using namespace std;
double d1, d2, d3, d4;
void sol() {
int n;
d1 = d2 = 0;
int... | true |
d78cb3db07c8fb656a5cb9f5a9b95ce495f30c66 | C++ | wujinggrt/PAT | /Basic/1007.cpp | UTF-8 | 987 | 3.5 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <cmath>
using namespace std;
bool is_prime(unsigned n)
{
if (n == 1)
{
return false;
}
if (n == 2)
{
return true;
}
unsigned bound = sqrt(n) + 1;
for (int i = 2; i < bound; ++i)
{
if (n % i == 0... | true |
1c5397b13768e77896ba0452533a7b8b33a2a5f3 | C++ | himanshu777m/LAB-5.5 | /lab5.5_q3.cpp | UTF-8 | 397 | 3.28125 | 3 | [] | no_license | // Programme to print reverse right triangle star pattern
#include<iostream>
using namespace std;
int main()
{
//declaring variable
int i,j,n;
cout << "Enter number of Row: ";
cin >> n;
//print inverted right triangle star pattern
for(i=0; i<n; i++){
for(j=0; (n-i)>j; j++){
cout << "*"; //printing... | true |
aa4954774a709be7228737f14ba2f5258982da41 | C++ | Yan-Song/burdakovd | /contests/timus/train/1413.cpp | UTF-8 | 1,694 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <algorithm>
#pragma comment(linker, "/STACK:16777216")
#define mset(block,value) memset(block,value,sizeof(block))
#define fo(i,begin,end) for(int i=begin; i<end; i++... | true |
bbacbdaafd280119b1a3540cce2c87ac337a0da0 | C++ | BestU/STM32_for_Arduino_BSP | /stm32/libraries/DHT_Sensor/dht.cpp | UTF-8 | 2,543 | 2.9375 | 3 | [] | no_license | #include "dht.h"
#define TIMEOUT 100000
void DHT::begin(uint8_t pin, uint8_t type)
{
_pin = pin;
_type = type;
}
boolean DHT::read(void)
{
int status;
switch(_type)
{
case DHT11:
status = read11(_pin);
break;
case DHT22:
status = read22(_pin);
break;
default:
status = -1;
break;
... | true |
b8c5acba7eb1abc95c00852ab2c33220521302aa | C++ | mjenrungrot/competitive_programming | /UVa Online Judge/v127/12720.cc | UTF-8 | 1,285 | 2.5625 | 3 | [
"MIT"
] | permissive | /*=============================================================================
# Author: Teerapat Jenrungrot - https://github.com/mjenrungrot/
# FileName: 12720.cc
# Description: UVa Online Judge - 12720
=============================================================================*/
#include <bi... | true |
1fe95cca73d3dd1285a444da673777151e7c6b1e | C++ | abagwell/chatProgram | /chatserv.cpp | UTF-8 | 4,739 | 3.125 | 3 | [] | no_license | /*
Name: Andrew Bagwell
Date: 04/30/2016
Assignment: Project1
File: chatserv.cpp
Language: C++
*/
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cstring>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <signal.h>
//constants
#define BACKLOG 20
#d... | true |
ccadbb896e987ec0fc3e5235ee0e7cefeca1b096 | C++ | jwbecalm/Head-First-Design-Patterns-CPP | /Factory/include/Sauce.hpp | UTF-8 | 209 | 2.515625 | 3 | [] | no_license | #ifndef SAUCE_HPP
#define SAUCE_HPP
#include <string>
class Sauce
{
public:
Sauce();
virtual ~Sauce();
virtual std::string toString() = 0;
};
#endif // SAUCE_HPP
| true |
18be6748775d21b52438b1529c42d2aaa3b7634a | C++ | bqqbarbhg/cold | /cold/cold/render/blend_state.h | UTF-8 | 1,171 | 3.0625 | 3 | [
"MIT"
] | permissive | #ifndef _COLD_RENDER_BLEND_STATE_H
#define _COLD_RENDER_BLEND_STATE_H
namespace cold {
// Controls how the renderer blends pixels
struct BlendState {
public:
// A blending factor applied to either source or destination
enum Factor {
_NONE,
// 0
ZERO,
// 1
ONE,
// Source color
SRC_COLOR,
// Destinati... | true |
aa3fb33958aac9eec01d12a2d079354069e53f2c | C++ | rennancl/competitive-programming | /1416.cpp | UTF-8 | 4,077 | 2.8125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <cmath>
#include <iomanip>
#include <vector>
#include <utility>
#include <string.h>
#include <algorithm>
int ep = 20;
long long unsigned int problem_penalty(std::pair <int, int> p, int EP){
/*
A penalidade de um problema é TP + EP x FA, ond... | true |
bbdf4f27606936442a5216c8b3c9c1c845ab478d | C++ | ammarm7/C-Plus-Plus | /Const/Sally.cc | UTF-8 | 278 | 2.625 | 3 | [] | no_license | //Sally.cc
#include "Sally.h"
#include <iostream>
using namespace std;
Sally::Sally(){ //Calling ctor
}
void Sally::printShit(){
cout << "I am the print shit function" << endl;
}
void Sally::printShit2() const{
cout << "I am the constant print shit function" << endl;
}
| true |
4d7630832650a64e5fa451602a4f5e921cc5fe45 | C++ | skyformat99/Camera-Streaming | /Src/Linux/tcpchatclient/main.cpp | UTF-8 | 1,083 | 3.015625 | 3 | [
"MIT"
] | permissive |
#include <iostream>
#include "../netcom/network.h"
using namespace std;
bool g_threadLoop = true;
network::cTCPClient client;
void* PrintRecv(void* arg);
int main(int argc, char **argv)
{
if (argc < 3)
{
cout << "command line <ip> <port>" << endl;
return 0;
}
const string ip = argv[1];
const int port = a... | true |
38023b5c761b998f4aa97c5a103b011b51fdaa6a | C++ | adzkar/cp-archive | /Hackerrank/ProblemSolving/MiniMaxSum.cpp | UTF-8 | 389 | 2.796875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int angka[5];
for(int i = 0; i < 5;i++) scanf("%i", &angka[i]);
vector<int> total(5);
for(int i = 0;i < 5;i++) {
for(int j = 0; j < 5;j++) {
if(i != j) total[i] += angka[j];
}
}
sort(total.begin(), total... | true |
d9f5eb6479366b77d7025956b11ba4e8b1cb2a20 | C++ | JohnieWalkerCZ/LogicOS | /Release/src/ConvertImgs.cpp | UTF-8 | 3,208 | 2.78125 | 3 | [] | no_license | #include "Logic.hpp"
#include "esp_spiffs.h"
#include "ConvertImgs.hpp"
#include <iostream>
#include <cstdio>
void convertImgPre () {
// Konfigurace datového oddílu
esp_vfs_spiffs_conf_t conf = {
.base_path = "/spiffs",
.partition_label = NULL,
.max_files = 5,
.forma... | true |
9ec3cdb6948ab5a333f8eb6a2fa74c734ad3122b | C++ | system-thoughts/leetcode | /863.二叉树中所有距离为-k-的结点.cpp | UTF-8 | 1,809 | 3.40625 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=863 lang=cpp
*
* [863] 二叉树中所有距离为 K 的结点
*/
// @lc code=start
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
vo... | true |
84bb064ada8f9e3d6c2d7fcc9f0380e33da4236d | C++ | Ahuttunen/Shodan | /22aaa/Backround.cpp | UTF-8 | 1,240 | 2.859375 | 3 | [] | no_license | #include "Backround.h"
#include <iostream>
Backround::Backround()
{
BTexture.loadFromFile("Textures/Background.png");
BSprite.setTexture(BTexture);
BSprite.setPosition(0, -BSprite.getGlobalBounds().height);
BSprite2 = BSprite;
BSprite3 = BSprite;
}
Backround::~Backround(void)
{
}
void Backround::draw(sf::Render... | true |
63758d8ae7c32f4211234aec03484a102201c8fc | C++ | bitsai/euler | /cpp/p18.cpp | UTF-8 | 838 | 2.921875 | 3 | [] | no_license | #include "euler.h"
using namespace std;
int main() {
ifstream file( "p18.txt" );
string line;
vector< vector<int> > best_paths;
while( getline( file, line ) ) {
vector<string> cells = tokenize( line, " " );
vector<int> row;
for( int i = 0; i < cells.size(); i++ ) {
int left_ancestor = 0,... | true |
5b3537f8c6dcf7bff09e768aae91c781b6c48799 | C++ | neilkg/clibrary | /vector.h | UTF-8 | 3,941 | 3.765625 | 4 | [] | no_license | #ifndef VECTOR_H
#define VECTOR_H
// NEIL GOLLAPDUI
template <typename T>
class vector {
public:
// constructs an empty container with 0 elements
vector() {
data = new T[10];
elts_capacity = 10;
elts_size = 0;
}
// constructs a container size n with each elements being val... | true |
9eeed7ed98571e6b4d1fb41dc6fce8782c86c6b7 | C++ | stanford-ssi/sats-cs | /databases/Tree preprocessing/generatetree.cpp | UTF-8 | 1,415 | 3.171875 | 3 | [] | no_license | #include <databasenode.h>
#include <databaseanswernode.h>
#include <fstream>
#include <string>
#include <sstream>
using namespace std;
void generateTree(ifstream file) {
databaseNode* root = new databaseNode();
int currID;
int numNeighbors;
string currLine;
//location
while(getline(file, currL... | true |
634b9f8d435f8d034a9bca96e2008bc1f12681fd | C++ | eTakazawa/procon-archive | /atcoder.jp/arc022/arc022_3/Main.cpp | UTF-8 | 771 | 2.71875 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include<map>
#include<queue>
#include<cmath>
#include<algorithm>
#include<utility>
#include<functional>
using namespace std;
vector<vector<int> > g;
vector<int> dist;
void dfs(int now,int pre,int d){
dist[now] = d;
for(int i=0;i<g[now].size();i++){
if(g[now][i... | true |
974232da823af85a8bc8dafc57b4572a66ec8f8c | C++ | kevintank/e_wiz | /Ado.cpp | UHC | 15,894 | 2.515625 | 3 | [] | no_license | // Ado.cpp: implementation of the CAdo class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "testdlg.h"
#include "Ado.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
const TCHAR *oleString = _T("Provider=Microso... | true |
decfb96d45c8ddc6fa7d6ad2e2a194ac39debb5b | C++ | taoyeh/DataStructure | /最大流FF算法.cpp | GB18030 | 1,461 | 2.796875 | 3 | [] | no_license |
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
int map[405][405];
int used[405];
int n,m;
const int INF= 0x3f3f3f3f;
int DFS(int s, int t, int f)
{
if(s==t)
return f;//ҵյˣʱʣµܻõ
int i;
for(i=1;i<=n+m+2;i++)
{
if(map[s... | true |
8a83d9fbe7c5d3fed253328a6b6b314b32b31d04 | C++ | DorAm1010/FlySimul | /printCommand.cpp | UTF-8 | 780 | 3 | 3 | [] | no_license | //
// Created by dor on 1/2/20.
//
#include <iostream>
#include "readingData.h"
#include "printCommand.h"
using namespace std;
/**
* Execute print command.
**/
int PrintCommand::execute() {
ReadingData* readingData = ReadingData::getInstance();
string print;
// get to argument of Print function
readi... | true |
6b4e49e481f410ace224127799069bf393708114 | C++ | wenqf11/LeetCode | /C++/438. Find All Anagrams in a String/solution.h | UTF-8 | 831 | 2.71875 | 3 | [
"MIT"
] | permissive | #pragma once
#include <vector>
#include <queue>
#include <string>
#include <climits>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <set>
using namespace std;
class Solution {
public:
vector<int> findAnagrams(string s, string p) {
vector<int> res, m(256, 0);
if (s.empty()) ... | true |
7aaaf613211157c82b1515ec4e8123593f180643 | C++ | shaimendel/BioTagMonitor | /MeasureGraph/AutoMeasureGraphMin/real_rag.cpp | UTF-8 | 3,252 | 2.5625 | 3 | [] | no_license | #include "real_tag.h"
#include "arch.h"
#include "utils.h"
#include "last_samples.h"
vector* real_pulse_samples;
void real_tag_setup(vector* v) {
real_pulse_samples = v;
}
float voltage_in_pulse = 0;
float current_in_pulse = 0;
float voltage_not_in_pulse = 0;
long num_of_relevant_samples = 0;
unsigned long s... | true |
70a97c7eb75e41e35a84705eb06d2ce9c8260e48 | C++ | LeeChungHyun/Programmers_Coding_Practice | /Stack&Queue/queue_printer.cpp | UTF-8 | 1,548 | 3.65625 | 4 | [] | no_license | #include <string>
#include <vector>
#include <queue>
#include <iostream>
using namespace std;
/*priority_queue<T, Container, Compare> : 원하는 자료형 및 클래스 T를 통해 생성. 여기서 Container는 vector와 같은 컨테이너이며 Compare는 비교함수 클래스이다.*/
int solution(vector<int> priorities, int location) {
int answer = 0;
queue<pair<int,in... | true |
88026ccf2b3473ce368135e598df0d918c353484 | C++ | liuce-/My-Solution-of-Leetcode-Problems | /494. Target Sum/源.cpp | UTF-8 | 1,738 | 3.484375 | 3 | [] | no_license | //You are given a list of non - negative integers, a1, a2, ..., an, and a target, S.Now you have 2 symbols + and -.For each integer, you should choose one from + and -as its new symbol.
//
//Find out how many ways to assign symbols to make sum of integers equal to target S.
//
//Example 1:
//Input: nums is[1, 1, 1, 1, ... | true |
9b123d02131546964318283dd9fc63f46c66818c | C++ | heitoradao/minimos_quadrados | /mmq.cpp | UTF-8 | 1,548 | 3.234375 | 3 | [
"MIT"
] | permissive | #include "mmq.h"
double gi(double x, int i)
{
double resultado = 1;
for (int j = 0; j < i; j++) {
resultado *= x;
}
return resultado;
}
SPonto *PreencheTabela(int *numeroPontos)
{
cout << "Informe o numero de pontos: ";
cin >> (*numeroPontos);
SPonto *tabela = new SPonto[*numeroPon... | true |
84733597efad67cbbf9a3ad7a522c6c4967aa6f4 | C++ | thebravoman/software_engineering_2015 | /VhodnoNivo/Georgi_Stoilov/Georgi_Stoilov_05.cc | UTF-8 | 936 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main(){
int x;
float arr[10];
bool isOrder = false;
bool isSorted = false;
cout << "Insert X between 0 and 10" << endl;
cin >> x;
while(x <= 0 || x >= 10){
cout << "Insert X between 0 and 10" << endl;
cin >> x;
}
for(int count = 0; count < 10; ... | true |
39a04e02cad74df5bf9a04aeb85eedfce965a717 | C++ | puorc/uNetwork | /src/MessageListener.cpp | UTF-8 | 7,341 | 2.75 | 3 | [] | no_license | #include "MessageListener.h"
void MessageListener::start() {
unlink(unix_sock_path);
int main_sock;
if ((main_sock = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
throw std::system_error(EBADF, std::system_category(), "Unable to open Unix socket.");
}
struct sockaddr_un addr;
memset(&addr,... | true |
bda245fcae65d2287fc09a6d42fdc7cc046092f8 | C++ | Topru333/speed-test | /server/cppsrc/Samples/math.cpp | UTF-8 | 2,102 | 3.1875 | 3 | [] | no_license | #include "math.h"
#include <vector>
#include <stdlib.h>
int Math::Fibonacci(int n){
if (n <= 1) {
return n;
} else {
return Math::Fibonacci(n-1) + Math::Fibonacci(n-2);
}
}
int Math::FibonacciMap(int n){
if (n <= 1) {
return n;
}
std::vector<int> table(n+1);
table[0] = 0;
table[1] = 1;
... | true |
f3cce3c0bee9f1012f71b76abb3a4051433dea18 | C++ | sourcecodebd/Sorting-Algoritm | /Linear Search.cpp | UTF-8 | 493 | 3.578125 | 4 | [] | no_license | #include<iostream>
#define size 5
using namespace std;
int linear_search(int arr[], int e)
{
int i,found=-1;
for(i=0; i<size; i++)
{
if(arr[i]==e)
{
found=i;
break;
}
}
return found;
}
int main()
{
int arr[size];
cout<<"Enter value: "<<endl;
for(int i=0; i<size; i++)
{
cin>>arr[i];
}
int e;
co... | true |
3f3d59f7382ba74ddb42397b29d2937f7203780d | C++ | NamrathaHV/Computer_Graphics | /17E_3M-Spin_Cube_change_color.cpp | UTF-8 | 2,821 | 3.296875 | 3 | [] | no_license | /* 17E-3M. /*Write a program to spin a cube clockwise, anticlockwise and change color using menu
callback function. */
#include<gl/glut.h>
#include<gl/GLU.h>
#include<math.h>
#include<iostream>
GLfloat d = 0;
int a = 0;
void MyInit()
{
glClearColor(0, 0, 0, 1);
glEnable(GL_DEPTH_TEST);
}
void Spin()
{
... | true |
04a2117cf6ceb6920f77b55d2717db6be9b1f06b | C++ | suyinlong/leetcode | /393-UTF-8.Validation.cpp | UTF-8 | 1,113 | 2.984375 | 3 | [] | no_license | class Solution {
private:
bool validHelper(vector<int> &data, int p) {
if (p >= data.size())
return false;
if (((data[p] >> 6) & 3) == 2)
return true;
return false;
}
public:
bool validUtf8(vector<int>& data) {
if (data.size() == 0)
return ... | true |
954b71aec9cfd9036a9e4e065c14fe8980559531 | C++ | nawZeroX239/competitive-programming | /UVAOJ/UVAOJ12150.cpp | UTF-8 | 818 | 2.625 | 3 | [] | no_license | #include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <unordered_set>
using namespace std;
int main() {
int n;
int cars[1001];
long sum = 0;
int c, s;
bool b;
unordered_set<int> uset;
while (scanf("%d", &n) && n > 0) {
sum = 0;
b = true;
for (int i = 1; i <= n; i++) {
sc... | true |
c4ae88bf4710c922e3e6b161d3b4df9d6ec31c75 | C++ | minaminao/competitive-programming | /cpp/library/library/NumberTheory.cpp | SHIFT_JIS | 7,090 | 3.1875 | 3 | [] | no_license | #include "ModInt.cpp"
/*
vZʂ𗎂Ƃ
gcd(x%y,y) == gcd(x,y)
y̐ƂAgcd(x%y,y) ̒lŏꍇ
̌ N<=10^9 ̂Ƃ X1344
f̌ N<=10^9 ̂Ƃ X9
*/
//߂ \[g
vector<int> divisor(int x) {
vector<int> ret;
int i;
for (i = 1; i*i < x; i++) {
if (x%i)continue;
ret.emplace_back(i);
ret.emplace_back(x / i);
}
if (i*i == x)ret.emplace_bac... | true |
c79024559d36d90b37fd5204df6c232333b1b4f9 | C++ | vladimir-kirillovskiy/misc | /C++/projects/hspg-glade/main.cpp | UTF-8 | 1,080 | 2.703125 | 3 | [] | no_license | #include <gtkmm/application.h>
#include <gtkmm/builder.h>
#include <glibmm/markup.h>
#include <glibmm/fileutils.h>
#include <iostream>
#include "gui.h"
int main (int argc, char **argv)
{
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create(argc, argv, "org.gtkmm.example");
//Load the Glade file and inst... | true |
8b9ee611be3f051159fb93384aa87bc876085ef1 | C++ | ChrisLundquist/cs250 | /math/Matrix4.cpp | UTF-8 | 4,592 | 3.46875 | 3 | [] | no_license | #include "Matrix4.h"
Matrix4::Matrix4(void) {
Zero();
}
// Copy constructor, copies every entry from the other matrix.
Matrix4::Matrix4(const Matrix4& rhs) {
for( unsigned i = 0; i < 4 * 4; i++)
v[i] = rhs.v[i];
}
// Non-default constructor, self-explanatory
Matrix4::Matrix4(f32 mm00, f3... | true |
b542b96ed4f9210f5b24f50a75b6e6d6c757c412 | C++ | erwinbonsma/BusyBeaverFinder | /BusyBeaverFinder/SweepTransitionGroup.h | UTF-8 | 13,462 | 2.671875 | 3 | [
"MIT"
] | permissive | //
// SweepTransitionGroup.h
// BusyBeaverFinder
//
// Created by Erwin on 13/11/2020.
// Copyright © 2020 Erwin. All rights reserved.
//
#ifndef SweepTransitionGroup_h
#define SweepTransitionGroup_h
#include "LoopAnalysis.h"
#include "Utils.h"
#include "RunSummary.h"
class Data;
class ExecutionState;
#include ... | true |
031d4885339c7bd18c06116448d0acfaf34feae7 | C++ | Pankajadhana97-bit/COMPETITIVE_CODING | /Mirzapur_Election.cpp | UTF-8 | 1,991 | 2.8125 | 3 | [] | no_license | #include<bits/stdc++.h>
/*
Pankaj Adhana
Panjab university;
*/
/* Defined values---------------------------------------------------- */
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
#define cases int t=1;cin>>t; while(t--) { solve();} return 0
#define ll int64_t
/*------------------------------------... | true |
84b489d7c81642ee98d8b0ebb526f13353a44cfa | C++ | DarkCaster/ArduinoOTP | /Firmware/OTPManagerFirmware/eeprom_profile_manager.h | UTF-8 | 1,418 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef EEPROM_PROFILE_MANAGER_H
#define EEPROM_PROFILE_MANAGER_H
#include <Arduino.h>
#include "profile_manager.h"
#include "cipher.h"
class EEPROMProfileManager final : public ProfileManager
{
private:
const uint8_t * const key;
const uint8_t * const tweak;
const size_t keySz;
const size_t tweakSz;
const... | true |
8694f184af93dffd87321046fbe01511016fdf10 | C++ | cross4yu/code4leetcode | /p19_remove_nth_node_from_end_of_list.cpp | UTF-8 | 793 | 3.359375 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* removeNthFromEnd(ListNode* head, int n)
{
int k = n;
ListNode prehead(-1);
prehead.next = head... | true |
8d377a83e520adfbb5445443b5a1610088e8e017 | C++ | motsuSiRO/Deseld | /GameSource/SceneManager.cpp | SHIFT_JIS | 872 | 2.65625 | 3 | [] | no_license | #include "Scene.h"
void SceneManager::Update(float elapsedTime)
{
current_scene->Update(elapsedTime);
}
void SceneManager::Render()
{
current_scene->Render();
}
void SceneManager::ChangeScene(Scene* new_scene)
{
//currentScene.reset(new_scene);
//currentScene->Initialize();
previous_scene.reset(current_scene... | true |
a5bc9171eb1253ee5f239d7a701438ccc67e046d | C++ | seemantaggarwal/CODEFORALL | /ALGOS in C++/TREES/largestbstinbt.cpp | UTF-8 | 3,944 | 3.4375 | 3 | [] | no_license | #include <iostream>
using namespace std;
class node
{
public:
int data;
node *left;
node *right;
node(int d)
{
data=d;
right=NULL;
left=NULL;
}
};
node *buildtree()
{
int data;
cin>>data;
if(data==-1)
{
return NULL;
}
node *root = new node(data);
root->left=buildtree();
r... | true |
52757585beded717be0e085927520c384e697a2f | C++ | Aman-Arcanion9/CP-for-interview-preparation | /GFG - Swap every two bits in bytes.cpp | UTF-8 | 571 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n;
cin>>n;
vector<int> bits;
while(n>0){
bits.push_back(n%2);
n = n/2;
}
int sz = bits.size();
if(sz%2)
bits.push_back(0);
f... | true |
4b4c39283fec3d0707eba60c92ac31afdd77cf5e | C++ | mandalsudipti/competitive_programming | /HackerRank/Sherlock and Subarray.cpp | UTF-8 | 1,684 | 2.84375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define SIZE 2*200003
struct node
{
int maximum , freq ;
node(){}
node (int a , int b)
{
maximum=a;
freq=b;
}
};
node tree[SIZE];
int arr[100000];
node merge(node &lc , node &rc)
{
node tmp;
if(lc.maximum==rc.maximum)
{
... | true |
58b602a8650760885c06ef72688ea1aae071d54f | C++ | mssalvatore/EN605.417.FA | /roulette/analytics.cpp | UTF-8 | 1,651 | 3.515625 | 4 | [] | no_license | #include "analytics.h"
#include <iostream>
template <class T>
void printArray(T * data, size_t size)
{
for (int i = 0; i < size; i++)
{
std::cout<<data[i] << " ";
}
std::cout<<std::endl;
}
template <class T>
double calculateMean(T * data, size_t size)
{
double total = 0;
for (int i = 0... | true |
5552594ebcdb4e27c8516a82abc133e45f8a21e5 | C++ | TheTastyGravy/AIProject | /Project/AI-Game/Swarmer.cpp | UTF-8 | 1,600 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "Swarmer.h"
#include "Leader.h"
#include "raylib.h"
#include "FormationStateBehav.h"
Swarmer::Swarmer(const Vector2& position, const std::shared_ptr<Behaviour> flockingState, const int health) :
Agent(position, 200.0f),
importance(0.0f),
leader(nullptr),
health(health),
maxHealth(health),
flocking(floc... | true |
e52c5e51ce4ee741c33d259332c0d034ffc37105 | C++ | mhigg/3DAirHockey | /AirHockey/Classes/Obj/BallAfter.cpp | SHIFT_JIS | 2,122 | 2.5625 | 3 | [] | no_license | #include "BallAfter.h"
USING_NS_CC;
BallAfter::BallAfter() : _invTime(10)
{
Init();
}
BallAfter::BallAfter(const cocos2d::Vec3 & lPos) : _invTime(10)
{
_localPos = lPos;
Init();
}
BallAfter::~BallAfter()
{
}
void BallAfter::Update(const cocos2d::Vec3 & lPos)
{
if ((_cnt / _invTime) % 2)
{
/// 3W̍XV
for (i... | true |
f2486cdb904c80265cb6b5a0a8f4e5d9b6f4e0be | C++ | nikhita-n/CP | /Practice/Sliding_window_minimum_2D_array.cpp | UTF-8 | 350 | 2.828125 | 3 | [] | no_license | /* A 2D array with NxN dimensions given a window of WxW dimension, find the minimum in all possible windows"
Optimized soln by me - O((N-W+1)*N*W)
Check this for O(N) soln
https://jimmy-shen.medium.com/2d-sliding-window-min-max-problem-e24b0c707a62
Sliding window in general
https://people.cs.uct.ac.za/~ksmith/article... | true |
8169e857bdf98a49cf7bcff5a576540881347a46 | C++ | StonecutterX/DataStructureAndAlgorithm | /LeetCode/P892_surface_of_3d_shape.cc | UTF-8 | 1,363 | 3.1875 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int surfaceArea(vector<vector<int>>& grid) {
if (0 == grid.size()) {
return 0;
}
int row = static_cast<int>(grid.size());
int col = static_cast<int>(grid[0].size());
int cnt... | true |
6a99de23d7453139915c2a57ae600e68c8e71e6c | C++ | Neverous/codeforces | /176/a.cpp | UTF-8 | 655 | 3.1875 | 3 | [] | no_license | /* 2013
* Maciej Szeptuch
* II UWr
*/
#include <cstdio>
char row[4][8];
int white, black;
int main(void)
{
for(int h = 0; h < 4; ++ h)
scanf("%s", row[h]);
for(int h = 0; h < 3; ++ h)
for(int w = 0; w < 3; ++ w)
{
white = black = 0;
for(int i = 0; i < 2; ++ ... | true |
d73230b0c764541601884cbbd70dd02f4f8fc774 | C++ | kopecdav/CircleCi | /_libs_/libraries/RGB_matrix.cpp | UTF-8 | 5,595 | 2.65625 | 3 | [] | no_license | #include "RGB_matrix.h"
DigitalOut* RGB_matrix::CLK;
BusOut* RGB_matrix::ABCD; // Row address.
DigitalOut* RGB_matrix::LAT; // Data latch - active low (pulse up after data load)
DigitalOut* RGB_matrix::OE; // Output enable - active low (hold high during data load, bring low after LAT pulse)
DigitalOut* RG... | true |