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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
c2456ce710c2b91f679662202af3442e72e635e2 | C++ | azconita/worms | /server-main.cpp | UTF-8 | 701 | 2.59375 | 3 | [] | no_license | /*
* server.cpp
*
* Created on: Jun 3, 2018
* Author: gabi
*/
#include "Game.h"
#include "Logger.h"
#include "Socket.h"
logger oLog("server.log");
int main(int argc, char *argv[]) {
char * port = argv[1];
Socket socket(NULL,port);
socket.bind_and_listen();
Socket client = socket.accept_socket(); ... | true |
cacbf8a2e2e6450dd56936b973f5cf3d8d77344e | C++ | ShreyasSubhedar/Codes | /TREES/Find_pair_sum_in_BST.cpp | UTF-8 | 1,921 | 3.71875 | 4 | [] | no_license | / Initial Template for C++
// CPP program to find a pair with
// given sum using hashing
#include <bits/stdc++.h>
using namespace std;
struct Node {
int data;
struct Node *left, *right;
Node(int x) {
data = x;
left = right = NULL;
}
};
Node* insert(Node* root, int key) {
if (root == ... | true |
92271e51d9b16313f6241f8f8040c48e21b48aa3 | C++ | yumkong/cpp_prac | /cc/cc20_2.cpp | UTF-8 | 661 | 3.84375 | 4 | [] | no_license | // make a perfect shuffle of a deck of cards
#include <iostream>
#include <cstdlib>
using namespace std;
void swap(int &a, int &b)
{
int tmp = a;
a = b;
b = tmp;
}
void RandomShuffle(int a[], int n)
{
for(int i = 0; i < n; ++i)
{
// generate random number between i to n - 1
int j ... | true |
bfbd2330f32f1d021c6ddb7408118e6d89449592 | C++ | H-Shen/Collection_of_my_coding_practice | /Hackerrank/Algorithms/Flipping_bits.cpp | UTF-8 | 615 | 2.984375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
// Complete the flippingBits function below.
long flippingBits(long n) {
const static int MAXN = 32;
bitset <MAXN> A(n);
A.flip();
return A.to_ullong();
}
int main()
{
ofstream fout(getenv("OUTPUT_PATH"));
int q;
cin >> q;
cin.ignore(nume... | true |
49bc628b309dd41e5d5b5f60e8e9648d69209796 | C++ | kantuni/LeetCode | /728/self-dividing-numbers.cpp | UTF-8 | 641 | 3.6875 | 4 | [] | no_license | class Solution {
private:
bool isSelfDividingNumber(int n) {
int nc = n;
while (nc > 0) {
int d = nc % 10;
if (d == 0) {
// A self-dividing number is not
// allowed to contain the digit zero.
return false;
}
if (n % d != 0) {
ret... | true |
efc74051034b868bad35e897e876bfe0d1293cad | C++ | MatyazhV/Attestation | /Downloads/2_22.cpp | UTF-8 | 551 | 2.625 | 3 | [] | no_license |
#include <iostream>
#include <cmath>
using namespace std;
float n, a, z,max1;
bool flag = false;
int main()
{
setlocale(LC_ALL, "Rus");
cout << "Введите n" << endl;
cin >> n;
max1 = sin(n + 1 / n);
for (int i = 1; i <= n; i++)
{
if (n > 0)
{
a = sin... | true |
22600ec2ad5f0d9499b6668b5d448966a8fa2498 | C++ | MrHug/Arduino-Simulator | /simulatorCode/BaESimulator/linesegment.h | UTF-8 | 376 | 2.578125 | 3 | [] | no_license | #ifndef LINESEGMENT_H
#define LINESEGMENT_H
#include "line.h"
class LineSegment : public Line
{
public:
LineSegment();
LineSegment(Point start, Point end);
LineSegment(double x1, double y1, double x2, double y2);
bool isIntersect(Line that);
bool containsPoint(Point p);
double length();
... | true |
7bfb90d3fff0e58f372f1de2aa5e358c1207d253 | C++ | datouroony/ControlsVSP | /TestingCode/SteuartPlatformTests/SteuartPlatformTests.ino | UTF-8 | 2,036 | 3 | 3 | [] | no_license | #include <Servo.h>
// What pin to connect the sensor to
#define SENSOR0 A0
#define SENSOR1 A1
#define SENSOR2 A2
Servo motor;
int motorSpeed;
float S0Length0 = 17.9; //mm
float S1Length0 = 17.8;
float S2Length0 = 17.4;
float S0Resistance0 = 70; //ohm 77
float S1Resistance0 = 71;
float S2Resistance0 = 77;
float Resis... | true |
04fdf82d174bb642f8c6892bf39a964a7176975e | C++ | s4mu313/Tensor | /include/Tensor/tensor_ref.h | UTF-8 | 12,337 | 3.234375 | 3 | [] | no_license | #ifndef TENSOR_REF_H
#define TENSOR_REF_H
#include <iostream>
#include <vector>
#include <cassert>
#include "tensor_base.h"
#include "tensor_initializer.h"
#include "tensor_f_decl.h"
#include "../macros.h"
NUM_BEGIN
template <typename T, std::size_t N>
class Tensor_iterator;
/**
* @brief The Tensor_ref class. C... | true |
bce3e9803a883a60d1c6c981cbf27de593e7b6dc | C++ | LeeNJU/LeetCode | /LeetCode/Shortest Distance from All Buildings.cpp | GB18030 | 2,235 | 3.203125 | 3 | [] | no_license | #include<vector>
#include<queue>
#include<algorithm>
//Ŀ:һάֵΪ1buildingֵΪ2obstacleֵͨΪ0free landҪѡһfree
// land,ʹfree landĵ㵽buildingĵḷ̌پ|x1 - x2| + |y1 - y2|
//ⷨ:ɨÿbuildingйѣdistance[i][j]ʾbuildingõľ룬reach[i][j]ʾԵõbuilding
int shortestDistance(std::vector<std::vector<int>>& grid)
{
const int row = grid.size();
i... | true |
acbe01c6ec9404f612bad9116aeea939588d3f6f | C++ | godcrampy/competitive | /problems/ctci/2-linked-list/2-6-palindrome/main.cpp | UTF-8 | 2,118 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <stack>
#include <unordered_set>
#include <vector>
using namespace std;
// ? Singly Linked List Boiler
struct ListNode {
int val;
ListNode* next;
ListNode(int x) : val(x), next(NULL) {}
};
ListNode* arrayToList(const vector<int>& v) {
if (v.size() == 0) return NULL;
ListNode* d... | true |
bd4a3e3cc5155cb370d4dc9e2e9d0ca0006c67ff | C++ | OUC-MYM/Summer-training | /8-20/B.cpp | UTF-8 | 1,273 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>
#include <stack>
#include <vector>
#include <set>
#define PI 3.1415926
#define INF 1<<30
using namespace std;
int N,M;
int fa_a[10010],fa_b[10010];
int find_a(int x)
{
if(fa_a[x]==1)
... | true |
c1718526791cebf3dbbf275147d1bd85acf2dec4 | C++ | lollix91/robby-robot | /codiceArduino/sensori.ino | UTF-8 | 1,484 | 2.578125 | 3 | [] | no_license | #define FILTER_MOVING_NEW 0.8
#define FILTER_MOVING_OLD (1 - FILTER_MOVING_NEW)
#define FILTER_STAYING_NEW 0.2
#define FILTER_STAYING_OLD (1 - FILTER_STAYING_NEW)
void senseDistance(bool staying) {
// legge misura distanza
int actual = Sensori.distance;
if (!staying) {
Sensori.distance = (Distance... | true |
a27fc62a66202548f40f712333bcf6fba89b95e5 | C++ | salipshitz/Reyes | /Reyes/src/Reyes/Core/LayerStack.cpp | UTF-8 | 640 | 2.734375 | 3 | [] | no_license | #include "LayerStack.h"
namespace Reyes {
void LayerStack::PushLayer(Layer *layer) {
m_Layers.emplace(m_Layers.begin() + m_LayerInsertIndex++, layer);
layer->OnAttach();
}
void LayerStack::PushOverlay(Layer *overlay) {
m_Layers.emplace_back(overlay);
overlay->OnAttach();
}
void LayerStack::PopLayer(Laye... | true |
cabe69f2ee9ce7edc009f8e895d14b8ad145c349 | C++ | mbilalakmal/shoAIb | /Lecture.hpp | UTF-8 | 1,755 | 3.265625 | 3 | [
"MIT"
] | permissive | #ifndef LECTURE
#define LECTURE
#include <string> //string
#include <vector> //vector
#include <unordered_map> //unordered_map
#include "json.hpp" //nlohmann::json
typedef std::vector<std::vector<bool>> AVAILABOOL;
/*
Describes a lecture : a course, teacher(s), and section(s)
*/
class ... | true |
e30cd76c20450f9dab74b6639c7b388652693c32 | C++ | qilip/ACMStudy | /baekjoon/11758/source.cpp | UTF-8 | 440 | 3.109375 | 3 | [
"CC-BY-4.0",
"CC-BY-3.0"
] | permissive | #include <stdio.h>
struct point{
int x, y;
point operator- (const point &o) const{
return {x - o.x, y - o.y};
}
};
int ccw(point a, point b, point c){
b = b - a;
c = c - a;
return b.x*c.y - c.x*b.y;
}
int main(void){
point p[3];
for(int i=0;i<3;i++)
scanf("%d %d", &p[i... | true |
7fb6a1876b5cbe88e51a8171caccc01bd24161c6 | C++ | banyi97/Prog2 | /Source.cpp | UTF-8 | 2,659 | 3.375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "GraphStorage.hpp"
template<class T>
class BFS
{
private:
Graph<T> *place1;
Graph<T> *place2;
int _level;
std::vector<std::vector<Graph<T>*>*> *listOfGraph;
public:
BFS(GraphStorage<T> *p, T& place1, T& place2) : _level(0), listOfGraph(new std::vector<std::vector<Gr... | true |
6a24ccb9deeb0eab5f3df24c94d0a8118b3a730d | C++ | Lehm2000/OpenGLSuperBible | /SuperBibleExamples/src/GEControllerInputMousePositionX.h | UTF-8 | 5,367 | 2.890625 | 3 | [] | no_license | #ifndef GECONTROLLERINPUTMOUSEPOSITIONX_H
#define GECONTROLLERINPUTMOUSEPOSITIONX_H
/**
GEControllerInputMousePosition
Purpose: GEController that monitors the X position of the mouse and applies the deltaVec as a multiple of the offset.
Author: Jeff Adams
*/
#include <glm\glm.hpp>
#include "GEControllerConstant.h"... | true |
9b58ddb8db739ef3a72884cdc9792f06449cd059 | C++ | sheric98/minimax_player | /minimax.h | UTF-8 | 1,040 | 2.609375 | 3 | [] | no_license | #ifndef MINIMAX_H
#define MINIMAX_H
#include "wrap.h"
#include <future>
#include <mutex>
#include <optional>
#include <string>
#include <tuple>
#include <unordered_map>
typedef std::tuple<std::string, unsigned> MMKey;
struct MMKeyHash : public std::unary_function<MMKey, std::size_t>
{
std::size_... | true |
845e811a2680cbf3441a04062c7e4ea2629710a6 | C++ | google-code/atp-algo-197 | /StudentWorks/Farafonov_Gennadiy/Azv.cpp | UTF-8 | 2,568 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <bitset>
#include <queue>
#include <complex>
#include <cassert>
using namespace std;
const int inf = int(1e9);
struct point {
i... | true |
b0bd2a1ee818f915e1aaf292b3a0981b51e0d7b0 | C++ | scottjomartin/raspberrypi | /drivers/GPIO.cpp | UTF-8 | 3,045 | 2.984375 | 3 | [] | no_license | /*
* GPIO.cpp
*
* Created on: 17/09/2016
* Author: scottm
*/
#include <string>
#include <fstream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include "../os/PI.h"
#include "GPIO.h"
using namespace std;
const char * GPIO::exportFileName_ = "/sys/class/gpio/export";
const char * GPIO::unexpor... | true |
6d147bf080cc82b6c1a99f331e7faa31e9eb4bd9 | C++ | Hoonly/PAT- | /A1075【PAT_Judge】.cpp | GB18030 | 3,998 | 3.109375 | 3 | [] | no_license | #include<iostream>
#include<string.h>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<iterator>
#include<map>
using namespace std;
struct personal
{
int score[6];//ÿĵ÷-1δͨ룬-2δύעȫʼΪ-2
int total_score;//ܷ
int perfectly_solved;//ֵĿ
bool flag;//Ƿͨ⣬ûеϼ
};
struct handle
... | true |
1f74274ad4e0fa593336aa1bc0ee371461fcfed3 | C++ | rbaygildin/algorithms-cpp | /PointArray/main.cpp | UTF-8 | 3,034 | 3.390625 | 3 | [] | no_license | #include <assert.h>
#include <iostream> // cout
#include "geometry.h"
using namespace std;
// ============== test for Point ======================
void testDefaultPointArrayConstructor(){
PointArray pointArray;
assert(pointArray.getSize() == 0);
}
void testCopyPointArrayConstructor(){
Point points[10];
... | true |
0908902e365fc4e9422a8b54ef8f844684a32146 | C++ | Kawser-nerd/CLCDSA | /Source Codes/AtCoder/arc090/A/2028060.cpp | UTF-8 | 1,266 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sys/time.h>
#include <cmath>
#include <tuple>
#include <queue>
#include <bitset>
using namespace std;
void solve(int n, vector<long long> a1, vector<long long>... | true |
24960571b43d3a1b3a9c7d20f8c6ae998adece96 | C++ | monteiroricardo/Documentos_FATEC | /Algoritmos/Aula 8 - While-DoWhile/ExercícioExemplo02.cpp | ISO-8859-1 | 348 | 2.734375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
#include <locale.h>
main(){
int n,qp=0,qi=0,sp=0;
setlocale(LC_ALL,"");
do{
printf("Valor: ");
scanf("%i",&n);
if(n%2==0){
sp+=n;
qp++;
} else
qi++;
}while(n!=0);
printf("\nQuantidade de pares: %i",--qp);
printf("\nQuantidade de mpares: %i",qi);
printf("\nMdia dos pares: %... | true |
4c1fbfdb5b32c0b3e0b8b393c1d505434c7d0167 | C++ | trett/Renju | /src/controller.cpp | UTF-8 | 1,993 | 2.828125 | 3 | [
"MIT"
] | permissive | #include "controller.h"
#include <QtConcurrent/QtConcurrentRun>
Controller::Controller(QObject *parent) : QObject(parent), m_parent(parent)
{
}
void Controller::initGame(const QVariant &humanChoosenColor)
{
debug("Init game");
m_pl_hmn = new HumanPlayer(m_parent);
m_pl_ai = new SimpleAi(m_parent);
QO... | true |
b03675b268f5dc774a5dcb9e83900f6fa29ac771 | C++ | SunMoonStar2000/examples | /code/Qt/expandable-listwidget/widgetbox.cpp | UTF-8 | 1,020 | 2.6875 | 3 | [] | no_license | #include "widgetbox.h"
#include <QVBoxLayout>
#include <QFrame>
#include <QDebug>
WidgetBox::WidgetBox(QWidget *parent)
: QWidget(parent)
{
m_frame = new QFrame(this);
m_layout = new QVBoxLayout(m_frame);
m_layout->setContentsMargins(0, 0, 0, 0);
m_frame->setSizePolicy(QSizePolicy::Expanding, QSiz... | true |
c90db5c55098e3f15894f9973c78f53518a66bf4 | C++ | ARFNeto-CH/chc20-0914-menu | /Teste4-CPP/menu.cpp | UTF-8 | 5,341 | 2.5625 | 3 | [] | no_license | #include <fstream>
#include <string>
#include <vector>
#include "menu.h"
Menu::Menu()
{ // padrao
argc = 0;
argv = {};
completo = false;
dflt = 1;
opt = 1;
timeout_ms = 80;
linha = 10;
coluna = 10;
};
Menu::Menu(int argc, vector<string>& argv,
int linha, int coluna, int dflt, int opt, int timeout_ms) :
li... | true |
df38ae8fb3cc376c242889bd10c9946b8aa04d3a | C++ | iwanao731/ofxSongle | /src/ofxSongleBeats.hpp | UTF-8 | 1,258 | 2.515625 | 3 | [] | no_license | #pragma once
#include "ofMain.h"
#include "ofxJSON.h"
namespace songle
{
class Beat;
class Bar;
class ofxSongleBeats
{
public:
ofxSongleBeats() {}
~ofxSongleBeats() {}
void load(const string &url);
void loadFile(const string &filename);
int getNumBeats();
int getNumBar();
int getBeatPosition(floa... | true |
c4c6d57932d004879d6f3bf33d1cf4d9ae7384a4 | C++ | DingZhan/Group_Programming_Ladder_Tournament | /L2-002.cpp | UTF-8 | 1,965 | 2.84375 | 3 | [] | no_license | #include <iostream>
#include <iomanip>
#include <cstring>
#include <vector>
#include <cmath>
using namespace std;
struct Node
{
int key;
int next;
};
#define MAX_N 100001
#define MAX_KEY 10001
int main()
{
Node nodes[MAX_N];
bool bTakens[MAX_KEY];
int startAddress, address, key, next, N, i, dupNo... | true |
6be3211efef49a38f62718b41c1e62c57e8a278c | C++ | amitbanerjee1999/Lab-Assignment-3rd-Sem | /Assignments/Lab Assignment Day-10/stack.cpp | UTF-8 | 621 | 3.390625 | 3 | [] | no_license | #include<stdio.h>
#define SIZE 50
using namespace std;
class Stack
{
int arr[SIZE];
int top;
public:
Stack()
{
top=-1;
}
void push(int data)
{
if(!isfull())
arr[++top]=data;
else
throw "overflow";
}
int pop()
{
if(!isempty())
re... | true |
4a89ea92506401dcff62bf3a5999fb06e4a2aafd | C++ | Saroko-dnd/My_DZ | /includes/associative_array.h | UTF-8 | 1,362 | 3.3125 | 3 | [] | no_license | #ifndef ASSOCIATIVE_ARRAY_H_INCLUDED
#define ASSOCIATIVE_ARRAY_H_INCLUDED
#include <iostream>
#include <cstdlib>
#include <string>
class assot_array
{
private:
std::string* str_array;
double* double_array;
int count_;
int counter;
public:
assot_array()
{
str_array=NULL;
... | true |
d643e242adb84d3fac492c18bd5dfbcd57a242aa | C++ | smcheah/Project-SIT210 | /main.cpp | UTF-8 | 1,373 | 3 | 3 | [] | no_license | #include "mbed.h"
#include "ultrasonic.h"
DigitalOut led1(LED1);
PwmOut buzzer(p23);
void dist(int distance)
{
//put code here to happen when the distance is changed
printf("Distance changed to %dmm\r\n", distance);
//closest
if (distance < 80)
{
led1 = 1;
wait(0.1);
... | true |
e44abb0b1c6956f61926d49395a530a0c711e7d0 | C++ | AnTr24/CaveStoryRemake | /CaveStoryRemake/globals.h | UTF-8 | 1,110 | 3.09375 | 3 | [] | no_license | /*************************************************************************
File name: globals.h
Description: Holds global variables for the game. SPOOKY STUFF
**************************************************************************/
//#include guard. Prevents double definitions
#ifndef GLOBALS_H
#define GLOBALS_H
... | true |
a3d374a723cac90977c80313822f9458609d1893 | C++ | faburaya/3fd | /3fd/isam/isam_impl_database.cpp | UTF-8 | 16,907 | 2.53125 | 3 | [
"MS-PL"
] | permissive | #include "pch.h"
#include "isam_impl.h"
#include <cassert>
#include <codecvt>
namespace _3fd
{
namespace isam
{
///////////////////////////
// Database Class
///////////////////////////
/// <summary>
/// Finalizes an instance of the <see cref="DatabaseImpl"/> class.
/// </summary>
Database... | true |
96d421b7b8def8f3d0d9f0622986addeeb2f243e | C++ | kronosaur/TranscendenceDev | /Mammoth/Include/Painters.h | UTF-8 | 10,592 | 2.625 | 3 | [
"LicenseRef-scancode-warranty-disclaimer"
] | no_license | // Painters.h
//
// Transcendence UI Engine
// Copyright (c) 2010 by George Moromisato. All Rights Reserved.
#pragma once
class CHoverDescriptionPainter
{
public:
CHoverDescriptionPainter (const CVisualPalette &VI);
inline void Hide (void) { m_cxWidth = 0; }
inline bool IsVisible (void) const { return (m_cxW... | true |
92de4a8be9a38e3f490dee13a1b9c417b6fd5617 | C++ | lanking520/CYTON_VETA_FILE | /Bridge_model/Arduino_servo_test/Arduino_servo_test.ino | UTF-8 | 523 | 2.65625 | 3 | [] | no_license | #include <VarSpeedServo.h>
VarSpeedServo myservo; // create servo object to control a servo
//Servo myservo_2;
int servo_pos=9;
void setup()
{
Serial.begin(115200);
myservo.attach(servo_pos); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for (int j = 40; j <= 25... | true |
7bb76129f33e0026281694dafbbd28c5ae9c5faa | C++ | ZeroCoolX/KeyLogger | /KeyLogger/Timer.h | UTF-8 | 2,473 | 3.671875 | 4 | [] | no_license | #ifndef TIMER_H
#define TIMER_H
#include <thread>
#include <chrono>
class Timer{
private:
std::thread Thread; // non main blocking thread instance
bool Alive {false}; // thread status
std::function<void(void)> ... | true |
1fda7c66ef80ae33f598b6e087f4706c0cdb2302 | C++ | FrankMuti/LearningAlgorithms | /katcl/data_structures/_seg_tree.cc | UTF-8 | 982 | 2.96875 | 3 | [] | no_license | /**
* author: stein
* created: 2020.09.24 19:20:10
**/
#include <bits/stdc++.h>
using namespace std;
struct Tree {
typedef int T;
static constexpr T unit = INT_MIN;
T f (T a, T b) { return max(a, b); }
vector<T> s;
int n;
Tree (int n = 0, T def = unit) : s (2*n, def) , n (n) {}
void update(int po... | true |
d07258f93452c2b9fd958754dccd29d67d2a2175 | C++ | VisionAerie/vision | /software/src/master/src/backend/DSC_Pointer.h | UTF-8 | 67,962 | 2.671875 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef DSC_Pointer_Interface
#define DSC_Pointer_Interface
/************************
***** Components *****
************************/
#include "DSC_Scalar.h"
/**************************
***** Declarations *****
**************************/
#include "RTlink.h"
/*************************
***** Definition... | true |
8ce46175e133b04e9574ef2ea32ab965ebc208b5 | C++ | Abhinav1997/cpp_playground | /print_enum_names.cpp | UTF-8 | 258 | 2.9375 | 3 | [] | no_license | #include "Axis.hpp"
#include <array>
int main()
{
std::array<Axis, 3> const values { Axes::kX,
Axes::kY,
Axes::kZ };
for (auto&& value : values)
std::cout << value << '\n';
}
| true |
5e82c05314610603bcbee31100a3012d843b57d9 | C++ | cup2of2tea/CompetitiveProgramming | /codeforces/Codeforces_Round_#316_(Div_2)/A_Elections.cpp | ISO-8859-1 | 796 | 2.609375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
int N,M;
cin>>N>>M;
vector<vector<int> > v(M,vector<int>(N));
for(int c=0;c<v.size();c++) for(int c2=0;c2<v[c].size();c2++) cin>>v[c][c2];
vector<int> byCities(M,1);
for(int c=0;c<v.size();c++) for(int ... | true |
fc7c629a51dad5503aae42c1ad1dcc3c11cba47e | C++ | geoo993/OpenGLProject | /Modern_Open_GL_Tutorial/Modern_Open_GL_Tutorial/Camera.h | UTF-8 | 8,167 | 2.875 | 3 | [] | no_license | //
// Camera.h
// ModernOpenGL_Basic
//
// Created by GEORGE QUENTIN on 26/02/2017.
// Copyright © 2017 LEXI LABS. All rights reserved.
//
#ifndef Camera_h
#define Camera_h
#include "Common.h"
// Defines several possible options for camera movement. Used as abstraction to stay away from window-system specific i... | true |
8bbc21f4811e16c3f11d37e6bf70b15c518892ab | C++ | SeanStarkey/map-utilities | /src/IMGUnknownSubfileException.cpp | UTF-8 | 380 | 2.640625 | 3 | [
"Apache-2.0"
] | permissive |
#include "IMGUnknownSubfileException.h"
IMGUnknownSubfileException::IMGUnknownSubfileException(const std::string message_in) : message(message_in) {
}
IMGUnknownSubfileException::~IMGUnknownSubfileException() throw() {
}
const char* IMGUnknownSubfileException::what() const throw() {
std::string ret = std::strin... | true |
006138dbf1b052b0af3f0ca4302478c49cf1e92d | C++ | Overlesss/KalkFigure | /Figure/Model/square.h | UTF-8 | 771 | 3.140625 | 3 | [] | no_license | #ifndef SQUARE_H
#define SQUARE_H
#include "regularpolygon.h"
class Square : public RegularPolygon
{
private:
void createShape(double); //function that builds a square starting from the length of its side
public:
Square(double =1.0); //constructor with one double type parameter, with default val... | true |
0e337a02b52ed7566b3d125b56064b15a3402dee | C++ | jeatdeam/PC2 | /pregunta 1.cpp | UTF-8 | 1,240 | 3.375 | 3 | [] | no_license | #include<iostream>
#include<conio.h>
#include<stdio.h>
#include<time.h>
using namespace std;
void Factorial(int n) {
int fac = 1;
for (int i = n;i > 0;i--) {
fac = fac*i;
}
cout << "El factorial de " << n << " es : " << fac << endl;
}
void Graficar(int n) {
int *y;
y = new in... | true |
7277e86d3919dd2f5767c7215aabd89569b1a0f3 | C++ | tetris0k/Univercity-projects | /Matrix_solve_Choletsky/input_from_file.cpp | UTF-8 | 1,485 | 3.078125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "functions.h"
#define EPS 10E-10
int file_input(FILE* f, int n, double* A, double* A1, double* b){
for (int i = 0; i < n; i++){
for (int j = 0 ; j < i ; j++){
if (fscanf(f, "%lf", &A1[i*n+j]) == 0){
printf("Problem with elements in matrix.\n")... | true |
a3dc8cffd8ced6600174e3f9afcd94ed0330ea5b | C++ | WeightScale/CorrectorSE8R01 | /Sketch2/ButtonsClass.h | WINDOWS-1251 | 1,384 | 2.609375 | 3 | [] | no_license | // ButtonClass.h
#ifndef _BUTTONCLASS_h
#define _BUTTONCLASS_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#define PLUS_CALIBRATION 12 ///< C and A
#define MINUS_CALIBRATION 9 ///< C and B
#define OFFSET_CALIBRATION 10 ///< C and D
#define ACTION_BU... | true |
2ca2d4add0679c60a2a7836853d46766634b8595 | C++ | SadSock/acm-template | /poj/POJ_1321/src/POJ_1321.cpp | WINDOWS-1252 | 1,371 | 2.75 | 3 | [] | no_license | //============================================================================
// Name : POJ_1321.cpp
// Author :
// Version :
// Copyright : 2012-7-8
// Description : DFS
//============================================================================
#include <stdio.h>
#include <string.h>
#define H... | true |
66bcfd1bd7ea21ed65ce45651c08577ca306c6d1 | C++ | shane-martinez/Shay | /PortalEngine/Cam.cpp | UTF-8 | 3,134 | 3.171875 | 3 | [] | no_license | #include "Cam.h"
Cam::Cam()
{
// Camera Position
pos.x = 0;
pos.y = 5;
pos.z = 0;
// Look at
look.x = 0;
look.y = 0;
look.z = 0;
// Up Vector
upVector.x = 0;
upVector.y = 1;
upVector.z = 0;
moveSpeed = 0;
dirLR = 0;
dirFB = 0;
// variables for rotation
rotateSpeed = 0;
rotateAngle = 0;
rotateUD ... | true |
05c7c8a75b0ee43d63cc7cf3dc4a05df51a7b6ea | C++ | ritikadhawan/CSES-problemset-solutions | /Introductory Problems/palindromeReorder.cpp | UTF-8 | 1,102 | 2.859375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int main() {
string s;
cin>>s;
vector<long> freq(26, 0);
for(int i=0; i<s.length(); i++) {
char ch = s[i];
int index = ch - 'A';
freq[index]++;
}
bool oddValueExists = false, solPresent = true;
char oddFreqChar = '.';
... | true |
3a4ba9247e5bf6e1106fd3c74f5457bec775422c | C++ | SMin1620/OpenCV-C- | /Geometric_Processing/2.cpp | UTF-8 | 510 | 2.609375 | 3 | [] | no_license | #include "opencv2/opencv.hpp"
#include <iostream>
using namespace cv;
using namespace std;
int main() {
Mat src = imread("D:/ch2/city1.jpg", IMREAD_GRAYSCALE);
Mat dst;
Mat noise_img = Mat::zeros(src.rows, src.cols, CV_8U);
randu(noise_img, 0, 255);
Mat black_img = noise_img < 10;
Mat white_img = noise_img > 25... | true |
b03e5bac9c9a4debced2d95a85371c557ef86eb0 | C++ | izoodeh/Lotus-GF | /CliExt/Memory.h | UTF-8 | 961 | 2.578125 | 3 | [] | no_license | #pragma once
class CSLock
{
CRITICAL_SECTION m_lock;
UINT m_lockCount;
public:
CSLock(): m_lockCount(0) { InitializeCriticalSection(&m_lock); };
~CSLock() { DeleteCriticalSection(&m_lock); };
inline void Enter() { EnterCriticalSection(&m_lock); m_lockCount++; };
inline void Leave() { m_lockCount--; LeaveCritical... | true |
067569dd6bb013976170c3e9ee34e8cd398f244d | C++ | karlphillip/GraphicsProgramming | /qtLogoBlurGL/GLwindow.cpp | UTF-8 | 9,572 | 2.671875 | 3 | [] | no_license | /* Copyright (C) 2012-2020 Karl Phillip Buhr <karlphillip@gmail.com>
*
* This work is licensed under the Creative Commons Attribution-ShareAlike License.
* To view a copy of this license, visit:
* https://creativecommons.org/licenses/by-sa/2.5/legalcode
*
* Or to read the human-readable summary of the licens... | true |
d8dbd2017e7c1a42981cda1585b989b3ac568d45 | C++ | dariogarcia/tiramisu | /include/Image.hpp | UTF-8 | 1,189 | 2.640625 | 3 | [] | no_license | #ifndef IMAGE_H
#define IMAGE_H
#include <string>
#include <map>
#include "CNNScheme.hpp"
#include "CNNFeatures.hpp"
using std::string;
using std::map;
using std::pair;
class Image {
public:
inline string getImageName() const {return imageName;}
inline string getClassName() const {return className;}
i... | true |
124d30d786b6998f906b687d13555c2221439bb3 | C++ | gurum77/gengine | /gengine-0.1/Engine/GEngine/Src/GCommon/GMatrix.h | UTF-8 | 800 | 2.828125 | 3 | [] | no_license | #pragma once
/**
@brief
- 4 x 4 matrix
*/
class G_EXT_CLASS CGMatrix
{
public:
union
{
struct
{
double _11, _12, _13, _14;
double _21, _22, _23, _24;
double _31, _32, _33, _34;
double _41, _42, _43, _44;
};
double m[4][4];
};
double operator() (UINT Row, UINT Column) CONST{ return m... | true |
3d92df5d1de6ca192a9ba6132b521f98404d1e27 | C++ | Toyohara01/ChatRoom | /ChatWindow.hpp | UTF-8 | 764 | 2.546875 | 3 | [] | no_license | #ifndef CHATWINDOW_HPP
#define CHATWINDOW_HPP
#include "Client.hpp"
#include "Message.hpp"
#include <iostream>
#include <vector>
#include <iterator>
#include <thread>
using namespace std;
const string FUNCTION = "()";
class ChatWindow
{
private:
string ip;
uint16_t port;
int sockID;
Client client;
... | true |
87f5d67487bf223b24a967f477a5aed0fa4c78a4 | C++ | lukasic/ncfm | /src/NCException.h | UTF-8 | 330 | 3.046875 | 3 | [] | no_license | #pragma once
#include <string>
#include <iostream>
//! Pomocna trieda pre vynimky v grafickom rozhrani.
class NCException
{
private:
std::string msg; ///< Informacie o vynimke.
public:
/*!
* \brief Vytvori instanciu vynimky.
* \param msg informacie o vynimke.
*/
NCException(const std::string & msg): msg(msg... | true |
2389c3f2577e93b563e1d980ef25f690198708fb | C++ | Laylatame/Data-Structures | /Tareas de programación/Tarea4/Tarea4/LinkedList.h | UTF-8 | 7,441 | 3.1875 | 3 | [] | no_license | //
// LinkedList.h
// Tarea4
//
// Created by Layla Tame on 2/8/19.
// Copyright © 2019 Layla Tame. All rights reserved.
//
#include "Node.h"
using namespace std;
#ifndef LinkedList_h
#define LinkedList_h
template <class T>
class LinkedList
{
private:
Node<T> *head;
int iSize;
void deleteHelp();
publi... | true |
81d4bc12ec7fec9526425dda6203a22dfe4e5537 | C++ | gametechnology/psi-2013 | /source/Game/StationStats.h | UTF-8 | 578 | 2.671875 | 3 | [] | no_license | #ifndef STATIONSTATS
#define STATIONSTATS
#include "../../include/Engine/Component.h"
#include "Stations/Station.h"
class StationStats : public Component
{
public:
StationStats();
~StationStats();
void increaseHealth(int health);
void increasePower(int power);
void increaseShield(int shield);
void decreaseHealt... | true |
74286cadf77b1981a6f7676cf05810aa5ca01fb6 | C++ | nevergofullretard/Arduino-Learning | /sketch_buttons_dimmable_led/sketch_buttons_dimmable_led.ino | UTF-8 | 1,408 | 2.78125 | 3 | [] | no_license | int ledPin = 11;
int button1 = 9;
int button2 = 10;
int brightness = 0;
int downPin = A1;
int upPin = A0;
int downVal;
int upVal;
int delayTime = 100;
int buzzPin = 12; // buzz pin ist das Ton-Teil, wird verwendet wenn wir auf max oder min Helligkeit sind
int buzzTime = 100;
void setup() {
// ... | true |
4bea3b34a01b2465a1bdeccc9a7eec07f26bee82 | C++ | leezhongshan/3D-Framework | /Framework/Framework/source/src/ResourceManager.cpp | UTF-8 | 2,255 | 2.53125 | 3 | [] | no_license | #include "ResourceManager.h"
#include "FBXLoader.h"
#include "BitmapFont.h"
#include <SOIL.h>
ResourceManager* ResourceManager::m_pInstance = nullptr;
void ResourceManager::Create()
{
if( m_pInstance == nullptr )
m_pInstance = new ResourceManager();
}
void ResourceManager::Destroy()
{
if( m_pInstance != nullptr... | true |
3f572c7b0902ecd3cab1dcea1829c50ba29d4d9c | C++ | navispeed/IFT-3100 | /src/model/model3d/Model3d.cpp | UTF-8 | 1,627 | 2.65625 | 3 | [] | no_license | #include "Model3d.h"
Model3d::Model3d(ofxAssimpModelLoader * model,ofVec3f position)
{
this->position = position;
this->model = model;
this->scale = ofVec3f(1,1,1);
this->angleX = 0;
this->angleY = 0;
this->angleZ = 0;
}
void Model3d::drawObject(map<int, ofLight*>& lights)
{
model->setPosition(position.x,pos... | true |
e5041ef2c1377114a3f897cab850201230708e19 | C++ | zhangzz2015/code | /algorithms/cpp/41_first_missing_positive/FirstMissing.cpp | UTF-8 | 448 | 2.84375 | 3 | [] | no_license | class FirstMissing {
public:
int firstMissingPositive(vector<int>& nums) {
int index = 0, size = nums.size();
while (index < size) {
long current = (long)nums[index] - 1;
if (current >= 0 && current < size && nums[i] != nums[j]) {
swap(nums[index], nums[current]);
} else {
index++;
}
}
for ... | true |
b12e2b69a93f7e208a1c2ae1bf0b0ff166860c83 | C++ | GCZhang/Profugus | /packages/CudaUtils/test/tstHost_Vector.cc | UTF-8 | 4,043 | 2.59375 | 3 | [
"BSD-2-Clause"
] | permissive | //----------------------------------*-C++-*----------------------------------//
/*!
* \file CudaUtils/test/tstHost_Vector.cc
* \author Seth R Johnson
* \date Mon Aug 12 10:29:26 2013
* \brief
* \note Copyright (C) 2013 Oak Ridge National Laboratory, UT-Battelle, LLC.
*/
//-----------------------------------... | true |
3124c579bce773e5ba3370380725301802f6f7d3 | C++ | jatinverma12/Data_And_Algo | /findMissing.cpp | UTF-8 | 971 | 3.328125 | 3 | [] | no_license | #include<iostream>
using namespace std;
void findmissingSorted(int *arr,int size)
{ int i;
int diff=arr[0]-0;
for(i=0;i<size;i++)
{
if(arr[i]-i!=diff)
{
while(diff<arr[i]-i)
{
cout<<i+diff<<"\n";
diff++;
}
}
}
delete arr;
}
void findmissingUnsorted(int *k,int len)
{
in... | true |
2978998e65edbbef45310c6d4640cd61a8b1ca8b | C++ | LunarWatcher/TermUtils | /include/termutil/ColorPrinter.hpp | UTF-8 | 4,016 | 3.21875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "TermUtils.hpp"
#include <any>
#include <codecvt>
#include <iostream>
#include <locale>
#include <sstream>
#include <stdexcept>
#include <string>
namespace termutil {
// Enable forwarding of std::endl
typedef std::basic_ostream<char, std::char_traits<char>> CoutType;
typedef CoutType& (*Standar... | true |
3a8a0692b304d5d9363d8b36425906ab756d0514 | C++ | GreenTangoo/SIEM | /aggregator/time_class/parse_time.hpp | UTF-8 | 1,373 | 3.03125 | 3 | [] | no_license | #ifndef PARSE_TIME_HPP
#define PARSE_TIME_HPP
#include "../parser_txt/parser.hpp"
namespace data_time_space
{
enum monthType{ JANUARY_NUM = 1, FEBRUARY_NUM = 2, MARCH_NUM = 3, APRIL_NUM = 4, MAY_NUM = 5,
JUNE_NUM = 6, JULY_NUM = 7, AUGUST_NUM = 8, SEPTEMBER_NUM = 9, OCTOBER_NUM = 10,
NOVEMBER_NU... | true |
435cf21e34f5d84ffa1d069665c74062406b4950 | C++ | Aksha/Technical-and-Competitive-Programming | /practice/priority_queue_ascending_descending_sort.cpp | UTF-8 | 1,352 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <queue>
using namespace std;
int main() {
vector<int> numbers = {1,72,20,10,0};
vector<string> words = {"hi", "how", "are", "you"};
priority_queue<int> pq;
cout << "Descending order : " << endl;
cout << "Integer: " << endl;
for(int i = 0; i... | true |
c1a7e49f54010eb5a8cbe9f246f768dfc7afa563 | C++ | epitaciosilva/estudosProgramacao | /lp1/empresa_10052018/src/funcionario.cpp | UTF-8 | 1,189 | 3.1875 | 3 | [] | no_license | #include <string>
#include <iostream>
using namespace std;
#include "../include/funcionario.hpp"
Funcionario::Funcionario() { }
Funcionario::~Funcionario() { }
void Funcionario::aumentoSalario() {
this->salario *= 1/100;
}
void operator>> (istream &i, Funcionario &funcionario) {
cout << "Digite o nome do f... | true |
59e814ca4f397f12556a1e213a24ff7126eb329b | C++ | penguin210135/C-language | /11431.cpp | UTF-8 | 3,361 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include "string.h"
using namespace std;
class Char{
friend class Str;
private:
Char(char text):next(NULL){
this->text=text;
}
~Char(){
if(next)
delete next;
}
void print(){
cout<<text;
if(next)
... | true |
80256a2ece36eee34c49e721b52ed25816ec5ec0 | C++ | rbdannenberg/o2 | /test/longtest.cpp | UTF-8 | 5,092 | 2.6875 | 3 | [
"MIT"
] | permissive | // longtest.c -- test long messages that require allocation
//
#include <stdio.h>
#include "o2.h"
#include "assert.h"
#include "string.h"
bool got_the_message = false;
O2blob_ptr a_blob;
char a_midi_msg[4];
int arg_count = 0;
// receive arg_count floats
void service_f(O2msg_data_ptr data, const char *types,
... | true |
c5b5aad687214a9da0d63b2380d8c7b827a99602 | C++ | misoboute/modern-cpp-challenges | /test/chapter01/primenumbers.cpp | UTF-8 | 3,200 | 3 | 3 | [
"MIT"
] | permissive | #include <gtest/gtest.h>
#include "PrimeNumbers.h"
using testing::Test;
using namespace modcppchal::math;
struct PrimeNumbersFixture : public Test
{
PrimeNumbersFixture()
{
}
~PrimeNumbersFixture()
{
}
PrimeNumbers m_Primes;
};
TEST_F(PrimeNumbersFixture, IsPrimeReturnFalseForAllNegati... | true |
9cc3360c28c70b3bde9e6c2372edb5343983b0bb | C++ | justinnqs/ITP-435-Projects | /pa7-justinnqs-master/src/Node.cpp | UTF-8 | 3,393 | 2.796875 | 3 | [] | no_license | #include "Node.h"
#include <sstream>
void NBlock::AddStatement(NStatement* statement)
{
mStatements.emplace_back(statement);
}
void NBlock::CodeGen(CodeContext& context) const
{
// TODO: Loop through statements in list and code gen them
for (NStatement* statement : mStatements)
{
statement->CodeGen(... | true |
d366b2610f6f3231eab3cb8314ee8e66044879e1 | C++ | SeboCode/ETHZ-AlgoLab-2020 | /exercise_11/fighting_pits_of_meereen/main.cpp | UTF-8 | 4,405 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <map>
#include <cmath>
int mask24 = std::pow(2, 24) - 1;
int mask16 = std::pow(2, 16) - 1;
int mask8 = std::pow(2, 8) - 1;
struct State {
int gateDifference;
// We use 8 bits to represent a fighterType.
int lastSentFightersNorth;
int lastSentFightersSouth... | true |
0ce3bec76d4cb299c040a1784395904ab0d94fb4 | C++ | kyung01/Abyss-Mining-Corporation | /Abyss-Mining-Corporation/World.cpp | UTF-8 | 761 | 2.765625 | 3 | [] | no_license | #include "World.h"
using namespace NGame;
void World::init(int worldWidth, int worldHeight)
{
mTiles.resize(worldWidth, worldHeight);
int values = 0;
int simHeight = (int)(worldHeight / 2);
//add sims
for (int i = 0; i < worldWidth; i++) {
addSim(i, simHeight);
}
}
//event listeners
void NGame::World::onSi... | true |
9988a0f227c9a19ca80350d18a111bb437820a72 | C++ | QLubov/ConfShooter | /ConfShooter/ConfigFile.cpp | UTF-8 | 686 | 2.53125 | 3 | [] | no_license | #include "ConfigFile.h"
#include "pugixml.hpp"
using namespace pugi;
ConfigFile::ConfigFile(const std::string& file)
{
xml_document doc;
doc.load_file(file.c_str());
ReadGraphics(doc);
ReadOptions(doc);
}
ConfigFile::~ConfigFile(void)
{
}
void ConfigFile::ReadGraphics(pugi::xml_document &doc)
{
... | true |
9b9fe166442a04687896f4d89752459fbf92b175 | C++ | Hyperzsb/bit-cs | /2020/object-oriented-technology-and-methods/exam/topic-1/complex.h | UTF-8 | 944 | 3.171875 | 3 | [
"MIT"
] | permissive | #ifndef TOPIC_1_COMPLEX_H
#define TOPIC_1_COMPLEX_H
#include <iostream>
class Complex {
private:
/*
* 复数的实部
*/
double real;
/*
* 复数的虚部
*/
double image;
public:
/*
* 类的默认构造函数
*/
Complex();
/*
* 类的带有两个双精度浮点数的构造函数,分别定义了复数的实部和虚部
*/
Complex(double ... | true |
62361d49fa9e6019415aa0367b0fb5d6fd8eabc5 | C++ | TlStephen2011/myCode | /COS1512_ASS02_Q7/RepeatPrescription.h | UTF-8 | 644 | 2.78125 | 3 | [] | no_license | #ifndef REPEATPRESCRIPTION_H
#define REPEATPRESCRIPTION_H
#include <iostream>
#include "Prescription.h"
using namespace std;
class RepeatPrescription : public Prescription {
public:
// default constructor
RepeatPrescription();
// overloaded constructor
RepeatPrescription(string med, string pName, string fun... | true |
cf9b7a6091fe083b766df1fda8eced609ca409d0 | C++ | fantauzzi/SFND_Lidar_Obstacle_Detection | /src/environment.cpp | UTF-8 | 10,434 | 2.75 | 3 | [] | no_license | /* \author of the original Aaron Brown*/
// Create simple 3d highway environment using PCL
// for exploring self-driving car sensors
#include "sensors/lidar.h"
#include "render/render.h"
#include "processPointClouds.h"
// using templates for processPointClouds so also include .cpp to help linker
#include "processPoint... | true |
fc75a6cf28692be1ff73aec2eb92ed5b2c33b04c | C++ | MahsaAbbasian/basicCplusPlus | /randomSum.cpp | UTF-8 | 1,230 | 3.75 | 4 | [] | no_license | #include<iostream>
#include<time.h>
#include<cstdlib>
using namespace std;
int main(){
int randomNumber1, randomNumber2, maxRand, sumOfRandNumbers, userInput;
cout<<"Please enter Maximum range of random numbers you wish to have"<<endl;
cin>>maxRand;
/* srand(time(null)); makes use of the computer's internal clo... | true |
36907ecf89fd85f673e361602fc13f1d9493882c | C++ | sureshmangs/Code | /competitive programming/leetcode/1408. String Matching in an Array.cpp | UTF-8 | 1,181 | 3.234375 | 3 | [
"MIT"
] | permissive | Given an array of string words. Return all strings in words which is substring of another word in any order.
String words[i] is substring of words[j], if can be obtained removing some characters to left and/or right side of words[j].
Example 1:
Input: words = ["mass","as","hero","superhero"]
Output: ["as","hero"]
... | true |
e7bfa4d010f4dc53c862cc7c9d4deb852286a950 | C++ | SaulZhang/NJU-Summary-Vocation-Camp-OJ | /2017A.cpp | GB18030 | 2,240 | 3.1875 | 3 | [] | no_license | /*
ڸöΪ˼ٶΪαĽ
Բòαķ
*/
#include <iostream>
#include <queue>
#include <stack>
#define N 1000+5
using namespace std;
int loc;
int n,sum;
void init(){
loc = 0;
}
int A[N];
struct TreeNode{
int data;
TreeNode* lchild;
TreeNode* rchild;
}Tree[N];
TreeNode* create(){
Tree[loc].lc... | true |
35a5ea2f3cd295df7c56bda89a09910b183f0b68 | C++ | sabhya19/C-Plus-Plus | /data_structures/searchsorted_LL.cpp | UTF-8 | 1,018 | 3.75 | 4 | [
"MIT",
"CC-BY-SA-4.0"
] | permissive | #include <iostream>
using namespace std;
// searching in a sorted linked list
class node {
public:
int info;
node* link;
};
node* search(int, node*);
int main() {
int n, x, i = 1;
cin >> n;
node* start;
node* ptr;
node* temp;
start = new node;
start->info = 19;
ptr = start;
... | true |
f0bb689bbf53c22bee510bfadf44e57abb920993 | C++ | venediklee/School | /Programming Language Concepts(CENG242)/HW4/HW4-StudentPack/Tracer.h | UTF-8 | 1,007 | 3.234375 | 3 | [] | no_license | #ifndef HW4_TRACER_H
#define HW4_TRACER_H
#include "Player.h"
class Tracer : public Player {
public:
Tracer(uint id, int x, int y);
// Name : Tracer
// Priority : { UP, LEFT, DOWN, RIGHT, ATTACK }
// Armor : BRICK
// Weapon : SHOVEL
// HP : 100
// DO NOT MODIFY THE UPPER... | true |
646b36bc9fa9b54eda7185286e1e367f7d9d56fc | C++ | amitprat/PracticeCode | /acessPrivateMembersOfClassUsingPointer.cpp | UTF-8 | 476 | 3.75 | 4 | [] | no_license | #include <iostream>
using namespace std;
class Sol
{
int a,b;
public:
Sol(int a,int b) {
this->a = a;
this->b = b;
}
};
int main()
{
Sol obj(10,208);
void *ptr = (void *)&obj; //we can typecast anything to void pointer
cout<<*(int *)ptr<<endl; //point to ... | true |
59e3321ffe776dd396b25cdca7a18b8eae81b170 | C++ | jhellerstein/arugula | /test/smoke/ints.cpp | UTF-8 | 1,486 | 2.96875 | 3 | [] | no_license | #include "../catch.hpp"
#include "lattice_core.hpp"
#include "merges/maxmin_mrg.hpp"
TEST_CASE("Binary IntMax") {
const Max m;
Lattice li(1, Max{});
Lattice ri(40, Max{});
auto expr = li + ri;
REQUIRE(expr.reveal() == 40);
}
TEST_CASE("Nary IntMax") {
Lattice li(1, Max{});
Lattice lj(4... | true |
93d6eb0aebe59449679eda8793866210387c4642 | C++ | CauchYLIU3551/EigProblem | /c_min_trace/CG/poisson_equation/possion_equation.cpp | UTF-8 | 3,291 | 2.640625 | 3 | [
"MIT"
] | permissive | ////////////////////////////////////////////////////////////////////////////////////////////
// main1.cpp :
//
#include <iostream>
#include <fstream>
#include <AFEPack/AMGSolver.h>
#include <AFEPack/Geometry.h>
#include <AFEPack/TemplateElement.h>
#include <AFEPack/FEMSpace.h>
#include <AFEPack/Operator.h>
#include <... | true |
7b44f733edfca3911f0008b72a4e1410c6969ebe | C++ | Davidlihuang/DataStructure | /DSAInCpp/capter1/segment1_9/include/personal.h | UTF-8 | 723 | 2.703125 | 3 | [] | no_license | #ifndef PERSONAL_H_
#define PERSONAL_H_
#include <fstream>
#include <iostream>
#include <cstring>
class Personal
{
public:
Personal();
Personal(char *, char *, char *, int, long);
//~Personal();
void writeToFile(std::fstream &) const;
void readFromFile(std::fstream &);
void readKey();
int ... | true |
8c44f2cba14c24102bde128ba7580ec8e63ff152 | C++ | jazzpurr/popup14h | /algorithms/modular_arithmetic/handler.cpp | ISO-8859-1 | 856 | 2.6875 | 3 | [] | no_license | // Authors:
// Jesper Norberg, jenor@kth.se
// Didrik Nordstrm, didrikn@kth.se
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include "modular.h"
using namespace std;
//Source: http://en.wikipedia.org/wiki/Modular_arithmetic
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
long... | true |
36e14fcd305ed661159d03a13e8cf9f138d91c5a | C++ | icebear0516/cpp_study | /cpp_study/chapter3-4/code/test4_10.cpp | UTF-8 | 680 | 3.859375 | 4 | [] | no_license | /* 编写一个程序,让用户输入3次40米跑成绩,并显示次数和平均成绩
使用arry对象存储数据
version:0.1
author:李京泽 */
#include <iostream>
#include <array>
using namespace std;
int main()
{
array<float,3> time;
cout << "请输入您第一次40米成绩:";
cin >> time[0];
cin.get();
cout << "请输入您第二次40米成绩:";
cin >> time[1];
cin.get();... | true |
e30ba31cff849f7cfa9dba5484371d5aec6a9b73 | C++ | alexanderbrannlund/ProjektRefereeGameBookQt | /RefereeGameBookDV1553/game.h | UTF-8 | 830 | 2.828125 | 3 | [] | no_license | #ifndef GAME_H
#define GAME_H
#include "referees.h"
#include <QString>
#include <QDate>
class Game
{
private:
QString homeTeam;
QString guestTeam;
QDate date;
int refID;
int penaltiesMin;
int penaltyShots;
int goals;
public:
Game(const QString& homeTeam, const QString& guestTeam, QDate... | true |
e40e3989d544afad04c1f982c821832c41fe1dd5 | C++ | Maakuz/ComponentLek | /Lite_Component_Lek/Lite_Component_Lek/CollisionBox.h | UTF-8 | 555 | 2.546875 | 3 | [] | no_license | #ifndef COLLISIONBOX_H
#define COLLISIONBOX_H
#include "Component.h"
#include "D3DHeader.h"
#include "SimpleMath.h"
#include <sstream>
class CollisionBox : public Component
{
private:
DirectX::SimpleMath::Vector3 mLength;
DirectX::SimpleMath::Vector3 mPos;
public:
CollisionBox(DirectX::SimpleMath::Vector3 pos, Di... | true |
a6a45b829248bee0b40e2f935b4ac67a99b6148d | C++ | thibalte/bitshift | /firmware/Bitshift-master/Bitshift-master.ino | UTF-8 | 938 | 2.8125 | 3 | [
"MIT"
] | permissive | //
// BITSHIFT
// Thibault Brevet, 2015
// release under the MIT license
//
// flash via Arduino IDE on ATTiny45/85 chips
//
int in = 3; // signal in
int shift = 1; // signal out
int heat = 2; // mosfet control
int heatTime = 15000; // how long we heat the panel
int wait = 5000;
int sigTime = 500; // how long we kee... | true |
39478ad0652f43db64939bf9802a0390dda0d71e | C++ | YairHanimov/Searching_Algorithm_Server | /AStar.h | UTF-8 | 5,553 | 2.9375 | 3 | [] | no_license | #ifndef SEARCHING_ALGORITHM_SERVER_ASTAR_H
#define SEARCHING_ALGORITHM_SERVER_ASTAR_H
#include "Searcher.h"
#include "queue"
#include "set"
#include "PriorityQueueState.h"
#include "Cell.h"
#include "compar.h"
#include "Matrix.h"
#include "comparforset.h"
#include "compareStar.h"
using namespace std;
template<class ... | true |
9eedf3a84b0ec51f211182592c58018e95680165 | C++ | yasyamanoi/BaseCrossDx12Study | /Study003/Libs/BaseLib/Basic/BaseMathInc.h | SHIFT_JIS | 51,449 | 2.875 | 3 | [
"MIT"
] | permissive | /*!
@file BaseMathInc.h
@brief vZCN[hNX
@copyright Copyright (c) 2021 WiZ Tamura Hiroki,Yamanoi Yasushi.
*/
#pragma once
#include "stdafx.h"
#include "BaseMath.h"
namespace basecross {
namespace bsm {
//--------------------------------------------------------------------------------------
/// Flt2CC
//---------... | true |
e9246604e2d878d3f589ffa8699392cc39ea1d8b | C++ | SergeiShvakel/TestSynchConnect | /main.cpp | UTF-8 | 1,210 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <boost/thread.hpp>
#include <boost/asio.hpp>
#include "ServerAsynch/ServerAsynch.h"
#include "ClientRequest/ClientRequest.h"
#include "ThreadPoolManager/threadmanager.h"
int main(int argc, char* argv[])
{
std::cout << "Start programm...\r\n";
std::cout << "Hardware max thread count to... | true |
547487b30661966431edf602c284ee07d24fca8a | C++ | MarkMansell/DirectX_Shaders | /Main.cpp | UTF-8 | 1,894 | 2.5625 | 3 | [] | no_license | #include "Application.h"
__int64 frameTimeOld = 0;
__int64 CounterStart = 0;
double countsPerSecond = 0.0;
double frameTime;
int frameCount = 0;
int fps = 0;
double GetFrameTime()
{
LARGE_INTEGER currentTime;
__int64 tickCount;
QueryPerformanceCounter(¤tTime);
tickCount = currentTime.QuadPart - frameTimeOl... | true |
03e4d81ceb5f2860161bfc6946afbba64420b87f | C++ | deanlee-practice/toheaven-2 | /교육/C++ Basic/Day_05/employeeSystem.cpp | UHC | 2,386 | 4.09375 | 4 | [] | no_license | /*
A ȸ α
: Employee
: Permanent ~ ̸, (⺻)
: Sales - ̸, (⺻ + Ǹż * ʽ)
ӽ : Temporary - ̸, (ñ*ٹð)
*/
#include<iostream>
#include<string>
using namespace std;
class Employee { // ֻ Ŭ
string name;
public:
Employee(string name):name(name){}
int getPay() { // ڽ 带 ƾѴ Ļ ڽ 尡 /
... | true |
facc81013dc6a4b423693cf4cd8b47c1cbea2c8f | C++ | WmdLogan/Free_Practice | /Sort/insertion_sort.cpp | UTF-8 | 506 | 3.25 | 3 | [] | no_license | //
// Created by logan on 2020/3/22.
//
#include "insertion_sort.h"
#include <iostream>
using namespace std;
void insertion_sort(int a[], int n){
int i, key;
for (i = 1; i < n; i++) {
int j = i - 1;
key = a[i];
while (a[j] > key && j >= 0) {
a[j+1] = a[j];
j--;
... | true |