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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
43633e9ecbd75031b50fa718285699a38a8e59b7 | C++ | chr1shr/am225_examples | /2b_lapack+krylov/blas_test.cc | UTF-8 | 2,003 | 2.875 | 3 | [] | no_license | #include <cstdio>
// Include the BLAS functions
#include "blas.h"
#include "omp.h"
// Amount of time (in seconds) to run each test for
const double duration=4.;
int main() {
// Maximum array size to try: set to 2^26, or 64 MB
const int n=1<<26;
// Create large arrays and fill with data
double *a=n... | true |
4ce5f36e5e4032abb2acffe83c1cea8a51dcfdf8 | C++ | MinaPecheux/Advent-Of-Code | /2019/C++/src/day5.cpp | UTF-8 | 2,813 | 3.46875 | 3 | [] | no_license | /**
* \file day5.cpp
* \brief AoC 2019 - Day 5 (C++ version)
* \author Mina Pêcheux
* \date 2019
*
* [ ADVENT OF CODE ] (https://adventofcode.com)
* ---------------------------------------------
* Day 5: Sunny with a Chance of Asteroids
* =============================================
*/
#include "utils.hpp"
#... | true |
ad1af0fd6cddaa4d49571572b7c04760cd284833 | C++ | Rituresh143/DSA-Practice | /algo/binary-search/search-in-rotated-array.cpp | UTF-8 | 744 | 3.21875 | 3 | [] | no_license | #include <iostream>
using namespace std;
int binary_search(int arr[],int l,int r,int k)
{
while(l<=r)
{
int mid = l + (r-l)/2;
if(arr[mid]<k)
l=mid+1;
else if(arr[mid]>k)
r=mid-1;
else
return mid;
}
return -1;
}
int pivot(int arr[],int n)
{
int l=0,r=n-1;
while(l<r)
{
... | true |
c47822d1358687951bd7bd21b281b3828c6cfb0f | C++ | johnBuffer/Tree2D | /include/scaffold.hpp | UTF-8 | 640 | 2.5625 | 3 | [] | no_license | #pragma once
#include "tree.hpp"
namespace v2
{
namespace scaffold
{
struct Node
{
Vec2 direction;
float length;
uint32_t index;
uint32_t branch_index;
Node()
: direction()
, length(0.0f)
, index(0)
, branch_index(0)
{}
Node(Vec2 dir, float l, uint32_t i, uint32_t branch)
... | true |
53cba98433f8966e30d73b42fbf254348c1c0220 | C++ | ealpizarp/data_structures | /Tareas/Tarea_4/Tarea_4_PT2/Tarea_4/include/Queue.h | UTF-8 | 581 | 3.203125 | 3 | [] | no_license | #ifndef QUEUE_H
#define QUEUE_H
#define DEFAULT_MAX_SIZE 1024
template <typename T>
class Queue {
private:
void operator =(const Queue&) {}
Queue(const Queue& obj) {}
public:
Queue() {}
virtual ~Queue() {}
virtual void enqueue(T element) = 0;
virtual T dequeue() = 0;
virtual T frontValue()... | true |
ded4070d1526e63fb0f3fb9ee021f59d06a9a7d9 | C++ | Stypox/olympiad-exercises | /more/szkopul/pra.cpp | UTF-8 | 1,756 | 2.78125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#define int long long
struct Range {
int index;
int from, to;
};
bool setCmp(const Range* a, const Range* b) {
return a->to < b->to;
}
signed main() {
int N;
unsigned int K;
cin>>N>>K;
vector<Range> ranges(N);
for (int n=0;n<N;++n){
ranges[n].index = n+1;
ci... | true |
e65a673c77c7d3253419b102061e210372c2bd7b | C++ | harryge00/algorithm | /test.cpp | UTF-8 | 629 | 3.15625 | 3 | [] | no_license | // my first program in C++
#include <iostream>
#include <climits>
#include <string.h>
struct s1{
char a;
int b;
};
struct s2{
char a; char c;
int b;
};
struct s3{
char a;
int b;
char c;
};
using namespace std;
int main()
{
if(int k = 0) {
std::cout<<0<<endl;
}
if(int k = 1) {
std::cout<<(k =... | true |
7a03123ac3f4f875f399498aab38011a24eca8c1 | C++ | caozh/Portfolio | /Cpp/Augmented_Reality/Source_code/Main.cpp | UTF-8 | 3,474 | 2.515625 | 3 | [] | no_license | #include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <iostream>
#include "MarkerDetector.h"
using namespace cv;
int main() {
cv::VideoCapture capWebcam(0); // initialize camera and select camera... | true |
e9d9943c833f368dd50978a2251db35ea8c13637 | C++ | suyash0103/Competitive-Coding | /Practice Comp code/changAndPerfectFunction.cpp | UTF-8 | 1,061 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <cassert>
#include <cstdlib>
#include <cmath>
#define MAX 1000005
using namespace std;
vector <int> divisors[MAX];
int main()
{
int A, B;
long long ans = 0;
cin >> A >> B;
int sqrtB = (int)sqrt(B);
for ( in... | true |
637a42d3c651a5527ee4b6882d354fb4030f82a8 | C++ | rafaelrds/competitive-programming | /uri/1098-SequenciaIJ4.cpp | UTF-8 | 234 | 2.875 | 3 | [] | no_license | #include <cstdio>
using namespace std;
int main(){
float x = 0, y = 0;
for (int n = 1; n < 45; ++n)
{
if ( n%4 != 0 ){
x = 0.2 * (n-n%4)/4;
y = n % 4;
printf("I=%lg J=%lg\n", x, x+y);
}
}
}
| true |
50e605da2c07bb26899443b65fa266279bd16bcb | C++ | elliotwoods/ofxRulr | /Plugin_Scrap/src/ofxRulr/Models/Transform.h | UTF-8 | 1,690 | 2.625 | 3 | [] | no_license | #pragma once
#include "ofxCeres.h"
#include <glm/gtx/matrix_decompose.hpp>
namespace ofxRulr {
namespace Models {
template<typename T>
struct Transform_ {
Transform_(const T* const translationParameters
, const T* const rotationParameters)
: translation(translationParameters[0]
, tran... | true |
8425e806843c59c90378b71ad92e5c4955d0e0d8 | C++ | cp-profiler/cp-profiler | /src/cpprofiler/pixel_views/pixel_image.cpp | UTF-8 | 3,100 | 3 | 3 | [] | no_license | #include "pixel_image.hh"
#include "../utils/debug.hh"
#include <QImage>
#include <cassert>
namespace cpprofiler
{
namespace pixel_view
{
PixelImage::PixelImage()
{
image_.reset(new QImage());
resize({width_, height_});
}
PixelImage::~PixelImage() = default;
void PixelImage::setPixel(std::vector<uint32_... | true |
1e1c2e8502c54bcf98bc77ac8d3ac842ff46900b | C++ | huyinhou/leetcode | /783.minimum-distance-between-bst-nodes.cpp | UTF-8 | 2,185 | 3.40625 | 3 | [] | no_license | /*
* @lc app=leetcode id=783 lang=cpp
*
* [783] Minimum Distance Between BST Nodes
*/
/**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
// #define LEETCODE
#ifdef LEETCO... | true |
4ea17f784691f83637a208ca8291314e03fd5d14 | C++ | yewenhui/linuxserver | /logging/LogStream.h | GB18030 | 2,949 | 2.84375 | 3 | [
"MIT"
] | permissive | #ifndef _LOG_STREAM_H_
#define _LOG_STREAM_H_
#include <assert.h>
#include <string.h>
#include <string>
#include <boost/noncopyable.hpp>
using std::string;
namespace detail
{
const int SAMLL_BUFFER = 4000;
const int LARGE_BUFFER = 4000 * 1000;
template<int SIZE>
class FixedBuffer
: private boost::noncopyable
{
... | true |
987fddec6c8d7b300b985f9676d82f1ce4e4ad1a | C++ | jfellus/pgide_old | /src/commands/CommandUntagSelection.h | UTF-8 | 1,424 | 2.59375 | 3 | [] | no_license | /*
* CommandUntagSelection.h
*
* Created on: 14 nov. 2014
* Author: jfellus
*/
#ifndef CommandUntagSelection_H_
#define CommandUntagSelection_H_
#include <commands/Command.h>
#include <module/Document.h>
#include <module/Module.h>
#include <module/Link.h>
#include "../style/Tags.h"
using namespace libboi... | true |
3a8b4b9346d66a42d0363a6441dc35b57115270b | C++ | earl-stephens/4jun20 | /square.cpp | UTF-8 | 303 | 3.921875 | 4 | [] | no_license | #include <iostream>
using namespace std;
int main () {
// Declare n as a floating-pt variable.
double n;
// Prompt and input value of n.
cout << "Input a number and press ENTER: ";
cin >> n;
// Calculate and output the square.
cout << "The square is: " << n * n << endl;
return 0;
}
| true |
2ea7c20ce5be1a7cb5b9f27d64f9a9ce4d405201 | C++ | AlexMachiu/Laborator7 | /StringVar.h | UTF-8 | 1,339 | 2.828125 | 3 | [] | no_license | #pragma once
#include <iostream>
using std::ostream; using std::istream;
using std::cout; using std::cin; using std::endl;
const int MAX_STRING_LENGTH = 100;
class StringVar
{
public:
StringVar(int lungime);
// Initializeaza obiectul care poate avea lungime maxima "lungime".
// Seteaza valoarea obiectului cu siru... | true |
ae23b1c8f21878db00da00daff17fdfc034875d1 | C++ | blenz3/leetcode | /ex1290_convert_binary_number_in_list/solution.cpp | UTF-8 | 973 | 3.1875 | 3 | [] | no_license | /**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
// Copy and or the bits in
int getDecimalValue(ListNode* head) {
std::vector<bool> values;
while (head != n... | true |
4d0837527a9c7638685d61b2b052d7be95eea084 | C++ | jckling/Learn-C | /Task/12/Homework12-9.cpp | UTF-8 | 1,031 | 3.375 | 3 | [] | no_license | #include<stdio.h>
#include<stdlib.h>
void packCharacters(char a, char b);
int main()
{
char a, b;
scanf("%c %c", &a, &b);
packCharacters(a, b);
return 0;
}
void packCharacters(char a, char b)
{
unsigned displaymask = 1 << 15;
unsigned contract;
char c1, c2;
int c;
c1 = a;
c2 = b;
contract = a;
contract <... | true |
f435062dab72dc85c19b5a421d99f92d8248b345 | C++ | tranducson25082000/v-l-i-vu-ng | /draw spuare .cpp | UTF-8 | 3,922 | 2.78125 | 3 | [] | no_license |
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <turtlesim/Pose.h>
#include <iostream>
#include <queue>
#include <iomanip>
using namespace std;
float x, y, theta, v, vt;
float prevx, prevy;
int state = 0;
float target_angle;
float target_distance;
ros::Publisher pub;
const float PI = 3.14159265;
floa... | true |
0386d8c0c44be3b8a3734fb050318c92cb4939e0 | C++ | unagi11/Git_test | /src/main.cpp | UTF-8 | 267 | 3.328125 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
using namespace std;
void func(int&,int&);
int main(int argc, char* argv[]) {
int a, b;
func(a, b);
cout << "Hello, world!" << endl;
cout << "a = "<< a << ", b = "<< b << endl;
return 0;
}
void func(int& a, int& b) {
a = 200;
b = 100;
} | true |
181d9fdb7eaecae3e7b8a03db3cfbf00be61a88f | C++ | alex555155/FlightDirectorAttitudeIndicator | /Software/Xtest/Xtest.ino | UTF-8 | 1,722 | 2.78125 | 3 | [] | no_license | #define XYE_EN PD6
#define X_STEP PD7
#define X_DIR PC5
#define PORTa 0
#define PORTb 1
#define PORTc 2
#define PORTd 3
#define stepperDwellTime 1//in milliseconds
uint8_t IO[3];//controls the IO
void enableXYE(){
//we must turn PD6 low. 2^6=64. and with 191
IO[PORTd] &= 191;
refreshPortD();
}
void di... | true |
9a22d509f4f781ef93f4d883ff9a5550463f8726 | C++ | preboy/9DayGame | /libWorld/src/LibGraphics/Src/DX11/VertexBuffer.cpp | GB18030 | 1,204 | 2.578125 | 3 | [] | no_license | #include "stdafx.h"
#include "VertexBuffer.h"
#include "RenderDevice_DX11.h"
using namespace LibGraphics;
CVertexBuffer::CVertexBuffer()
{
m_vertexBuffer = nullptr;
}
CVertexBuffer::~CVertexBuffer()
{
}
bool CVertexBuffer::CreateBuffer(const RenderDevice_DX11* pRenderDevice, const void* pData, UINT ByteWidth)
... | true |
d4798bde363d686dad966c5d2674b4dc140fe272 | C++ | wincentbalin/DDB | /db.hpp | UTF-8 | 1,393 | 2.640625 | 3 | [
"MIT"
] | permissive | /**
* db.hpp
*
* Database abstraction include part of Disc Data Base.
*
* Copyright (c) 2010-2011 Wincent Balin
*
* Based upon ddb.pl, created years before and serving faithfully until today.
*
* Uses SQLite database version 3.
*
* Published under MIT license. See LICENSE file for further information.
... | true |
32791abbd9161d28ca12f6194b75b5f19e92751c | C++ | Dgriffin12/511_Past | /Project2/Nausea.cpp | UTF-8 | 710 | 3.25 | 3 | [] | no_license | #include "Nausea.h"
#include <iostream>
using namespace std;
Nausea::Nausea()
{
if(throw_where == 0 && trigger <= 1)
{
cout << "Throwing default ctor exception\n";
cout << "Trigger = " << trigger << endl;
throw "default ctor failed!";
}
trigger--;
}
Nausea::Nausea(const Nausea& s)
{
if(throw_where == 1 &&... | true |
b762fdbb8a905e8392fcc3fc7323d4f2737383f2 | C++ | ttendohv/vh2436779 | /CSC5 WIN14/Savitch_8thEd_Chap7_Prob11_NB_012914/main.cpp | UTF-8 | 2,233 | 3.578125 | 4 | [] | no_license | /*
* File: main.cpp
* Author: Victoria Hodnett
* Created on January 29, 2014, 10:18 AM
* Savitch 8th Edition Chapter 7 Problem 11
* Seating Chart
*/
//System libraries
#include <iostream>
#include <iomanip>
using namespace std;
//Global Constants
const unsigned short COLS = 500;
//Function Prototypes
void i... | true |
2cddd3e8a002bd4a956f73f80a6b993269765618 | C++ | madhav-bits/Coding_Practice | /leetMonotoneIncDig.cpp | UTF-8 | 4,363 | 3.71875 | 4 | [] | no_license | /*
*
//****************************************************738. Monotone Increasing Digits.*********************************************
Given a non-negative integer N, find the largest number that is less than or equal to N with monotone increasing digits.
(Recall that an integer has monotone increasing digits if an... | true |
8cfa3486b7561f64490d623595d14c4548a2c3a7 | C++ | jhasaurabh312/InterviewBit | /Maths/unique_path.cpp | UTF-8 | 167 | 2.640625 | 3 | [] | no_license | int calc(int a, int b){
if(a==0 || b==0) return 1;
return (calc(a-1,b)+calc(a,b-1));
}
int Solution::uniquePaths(int m, int n) {
return calc(m-1,n-1);
}
| true |
7c377ef9cf45204f506eb04857e881c43607d507 | C++ | WathisLove/PokemonAE | /src/inventory/items/components/EvoluStatComponent.cpp | UTF-8 | 513 | 2.5625 | 3 | [] | no_license | #include "EvoluStatComponent.hpp"
#include "../../../pokemons/Pokemon.hpp"
EvoluStatComponent::EvoluStatComponent(StatName stat, float factor) :
StatBoostComponent(stat, factor) {
}
ItemEffect* EvoluStatComponent::onStat(int& statValue, StatName stat, PokemonID holder) const {
// Apply the Stat boost if ... | true |
2efb17adc7be7c714c58dc93b953409080961b2e | C++ | GValiente/butano | /butano/include/bn_intrusive_forward_list_fwd.h | UTF-8 | 944 | 2.59375 | 3 | [
"Zlib",
"LicenseRef-scancode-unknown",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | /*
* Copyright (c) 2020-2023 Gustavo Valiente gustavo.valiente@protonmail.com
* zlib License, see LICENSE file.
*/
#ifndef BN_INTRUSIVE_FORWARD_LIST_FWD_H
#define BN_INTRUSIVE_FORWARD_LIST_FWD_H
/**
* @file
* bn::intrusive_forward_list declaration header file.
*
* @ingroup intrusive_forward_list
*/
#include ... | true |
20a279688f287188bd86a420c1d82a29f7e5be19 | C++ | LopezPedrosaAlex/Smash-Fighters-Raylib-Library- | /Shot.hpp | UTF-8 | 1,238 | 3.15625 | 3 | [] | no_license | //
// Shots.hpp
// Smash_Fighters
//
// Created by Alex Lopez on 22/11/19.
// Copyright © 2019 Alex Lopez . All rights reserved.
//
#ifndef Shot_hpp
#define Shot_hpp
#include <iostream>
#include "raylib.h"
using namespace std;
class shot {
Vector2 position;
Vector2 shotvelocity;
int direction;
publi... | true |
cfd102cdb69b21e00f1a077c597963fc43968308 | C++ | wwllww/webrtcpuher | /third/util/strutil.cpp | UTF-8 | 3,738 | 2.9375 | 3 | [] | no_license | #include <algorithm>
#include <string.h>
#include <sstream>
#include <locale>
#include <codecvt>
#include "strutil.h"
namespace util {
namespace str
{
#define STR_TO_NUM(type) \
std::stringstream ss; \
ss << strNumber; \
type num = 0; \
ss >> num; \
return num; \
std::vector<std::string> st... | true |
e9a1386a156b36f17cd81805b718793101e31751 | C++ | programmerjake/hashlife-voxels | /graphics/image.h | UTF-8 | 4,469 | 2.53125 | 3 | [] | no_license | /*
* Copyright (C) 2012-2017 Jacob R. Lifshay
* This file is part of Voxels.
*
* Voxels is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any ... | true |
151c2f395d2e1be142197206a4d25aaa1a4c72a3 | C++ | abhishekxix/Programs | /cpp_course/declare-a-class.cpp | UTF-8 | 786 | 3.546875 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
using namespace std;
class Player //defining a class.
{
//attributes
string name {"Player"};
int health {100}, xp {3};
//methods
void talk(string);
bool is_dead();
};
class Account
{
//attributes
string name {"Account"};
... | true |
9d53cb0f3d27f3a819a1aa89f17c06855ec4a550 | C++ | hj690/OS_Lab | /TwoPassLinker/Module.cpp | UTF-8 | 866 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include "Module.h"
void Module::show(){
int defcount = getDefcount().getDefcount();
vector<pair<Symbol, Raddress> > deflist = getDeflist();
int usecount = getUsecount().getUsecount();
vector<Symbol> uselist = getUselist();
int codecount = getCodecount().getCodecount();
vector<pair<T... | true |
1a63181657462a0623e01c2d7b75f42f9784779d | C++ | emonnemo/Zoo | /src/animals/animal/animal.h | UTF-8 | 4,692 | 3.28125 | 3 | [] | no_license | // file : animal.h
#ifndef ANIMAL_H
#define ANIMAL_H
#include <string>
#include <set>
using namespace std;
/** \brief Class Animal
* \details Kelas abstrak untuk hewan dalam zoo
*/
class Animal {
public:
Animal();
/**
* \brief Constructor
* \details Menciptakan Animal
... | true |
571cbe7bba8ae90a2f0748428020df25b0e8d33e | C++ | Welease/Data-structures-and-algorithms | /lab1/Stack.h | UTF-8 | 859 | 2.984375 | 3 | [] | no_license | //
// Created by tanzilya on 26.02.2021.
//
#ifndef LAB1_STACK_H
#define LAB1_STACK_H
#include <stdlib.h>
#include <iostream>
#include <random>
# define BLUE "\e[34m"
# define DEFAULT "\e[39m\e[0m"
# define GREEN "\e[92m"
# define RED "\e[31m"
typedef struct s_node {
int data;
s_node *next;
} ... | true |
c215a79745bbf569f061be06dc5952585622135e | C++ | Foxious/phEngine | /src/phEngine/application/DeviceState.h | UTF-8 | 261 | 2.640625 | 3 | [] | no_license | #ifndef DEVICE_STATE_H
#define DEVICE_STATE_H
#include <vector>
enum ButtonStates
{
BTN_RELEASE = 0x01,
BTN_DOWN = 1 << 1,
BTN_HELD = BTN_DOWN | BTN_RELEASE,
};
struct DeviceState
{
std::vector<unsigned char> buttons;
std::vector<float> axes;
};
#endif | true |
c91ae9c05395ec496d1722d717d877c304f6d5ea | C++ | felipejoribeiro/Iniciativa_Rayleigh | /Project_RECAP/OpenGlcpp/OpenGlcpp/src/Difusion.h | UTF-8 | 1,383 | 2.734375 | 3 | [] | no_license | #pragma once
// basic Libs
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
// Math Libs
#define _USE_MATH_DEFINES // M_PI constant
#include <math.h>
#include <vector>
// Useful defines
#define log(x) std::cout << x << std::endl
//#define read(x) std::cin >> read
//int read;
class Simulation
{
public:
Si... | true |
d2d8cd497aec8fffddbcebe1775b22a6e503c413 | C++ | robertmitola/Compilers | /compiler.cpp | UTF-8 | 6,942 | 2.875 | 3 | [] | no_license | /*
ROBERT MITOLA
ALAN LABOUSEUR
MARIST COLLEGE
CMPT 432 - DESIGN OF COMPILERS
14 APRIL 2016
*/
#include <iostream>
#include <fstream>
#include <string>
#include <regex>
#include <sstream>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <vector>
#include "lexer.h" // The Lexer
... | true |
d207a5508e8e52cb488a841a89cc934010c710a4 | C++ | nmlgc/ssg | /GIAN07/LZ_UTY.H | UTF-8 | 2,179 | 2.625 | 3 | [
"MIT"
] | permissive | /*
* Packfiles and compression
*
*/
#pragma once
#include "platform/buffer.h"
#include "platform/unicode.h"
#include <array>
// Format
// ------
using fil_checksum_t = uint32_t;
using fil_size_t = uint32_t;
using fil_no_t = uint32_t;
constexpr const std::array<char, 4> PBG_HEADNAME = { 'P', 'B', 'G', 0x1A };
... | true |
dc80e656dfe981d97434640684e75723ab617f14 | C++ | grriffin/cs235-list | /wholeNumber.h | UTF-8 | 1,375 | 3.5625 | 4 | [] | no_license | #ifndef wholeNumber_h
#define wholeNumber_h
#include <ostream>
#include "list.h"
/************************************************
* WHOLE NUMBER
* A class to represent an arbitrary large whole
* number. Currently supports:
* INSERTION : for displaying the number w/o thousands separator
* += : add one WholeNumber ont... | true |
872fad8f20f7195e0fb2617bb6852bbdb6a8a9d4 | C++ | sparclusive/project-system | /code/userprog/frameprovider.cc | UTF-8 | 2,687 | 2.8125 | 3 | [
"MIT-Modern-Variant"
] | permissive | // stackmgr.cc
// Routines to manage user stacks
//
// Copyright (c) 1992-1993 The Regents of the University of California.
// All rights reserved. See copyright.h for copyright notice and limitation
// of liability and disclaimer of warranty provisions.
#include "copyright.h"
#include "frameprovider.h"
#includ... | true |
f68e109596f0fda1fd2ed221fd0e09ca812d2ada | C++ | nexon-97/BSUIR-Study | /CSN/WinSockLab/Lab01/AppEntry.cpp | UTF-8 | 995 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <sstream>
#include <ctime>
#include "Server.h"
using namespace std;
const int REQ_WINSOCK_VER = 2; // Minimum winsock version required
const int DEFAULT_PORT = 4444;
const int TEMP_BUFFER_SIZE = 128;
int main(int argc, char* argv[])
{
int iRet = 1;
Server* AppSer... | true |
16461a4c97f93ef85648cc714e5f0b87b02293cd | C++ | akure/experiments | /moderncpp/oops_dp/observer.cpp | UTF-8 | 1,156 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<memory>
#include<functional>
#include<vector>
using namespace std;
struct observer
{
observer() { std::cout << "ctor observer." << std::endl; }
virtual void notify() = 0;
virtual ~observer() { std::cout << "dtor observer." << std::endl; }
};
struct observer_1 final : public ... | true |
9374dc0c880c37875bf276f3b3a0d78609998cf3 | C++ | VB6Hobbyst7/ModularRoboticManipulator-MRM | /Arduino Code/ArduinoCode.ino | UTF-8 | 7,314 | 2.796875 | 3 | [] | no_license | #include "Pins.h"
#include "Joint.h"
Joint JA(A_STEP_PIN, A_DIR_PIN, A_ENABLE_PIN, A_ENDSTOP_PIN, A_INITIAL_ANGLE, JOINT_TYPE_1);
Joint JB(B_STEP_PIN, B_DIR_PIN, B_ENABLE_PIN, B_ENDSTOP_PIN, B_INITIAL_ANGLE, JOINT_TYPE_2);
Joint JC(C_STEP_PIN, C_DIR_PIN, C_ENABLE_PIN, C_ENDSTOP_PIN, C_INITIAL_ANGLE, JOINT_TYPE_2);
c... | true |
8ea110f9c5f2ac38dcc64ab317867094ab4c2d42 | C++ | xandemnf/EstudosCpp | /aula45_ArquivosOI.cpp | UTF-8 | 624 | 2.765625 | 3 | [] | no_license | #include<iostream>
#include<fstream>
using namespace std;
int main(){
//ofstream, ifstream, fstream;
ofstream arquivoO;
arquivoO.open("aula45_ArquivosIO.txt"/*, ios::app*/); //Posiciona o ponteiro no final do arquivo;
int i=0;
//do{
arquivoO << "Alexandre\n";
arquivoO << "Goncalves\n";
arquivoO << "Teixeira\n";
i+... | true |
9ecf4764bb0faee0a6b8a8a46cda0e8264c3b07e | C++ | abhisheknrl/MPRAscore | /code/types/stringfun.cpp | ISO-8859-1 | 10,259 | 2.71875 | 3 | [] | no_license | /***********************************************************************************
*
* stringfun.cpp -- String utility functions
*
* Erik Persson and Bjrn Nilsson, 1998-
*
*/
#include <stdio.h>
#include <locale> // For toupper and tolower
// #include <stdlib.h>
// #include <stdarg.h>
#include... | true |
fcabdc878ec551b74985839834eda93229a33c6d | C++ | kurenaif/kyopro | /max_flow.cpp | UTF-8 | 859 | 3.03125 | 3 | [] | no_license | class MaxFlow {
struct Edge {
int to, cap, rev;
Edge(int t, int c, int r) :to(t), cap(c), rev(r){}
};
public:
vector<vector<Edge> > G;
vector<bool > used;
MaxFlow(int MAX_V) :G(MAX_V), used(MAX_V) {}
void add_edge(int from, int to, int cap) {
G[from].push_back(Edge(to,cap,G[to].size()));
G[to].push_b... | true |
7c96ea39929940dc59cb8c5ccdab7ad81bbe03bc | C++ | RoynerOM/Piedra-papel-tijera | /main.cpp | UTF-8 | 16,392 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <conio.h>
#include <iomanip>
using namespace std;
//Variables globales y arreglos
int perdidas = 0, ganes = 0, empates = 0,puntos=0, perdidasM = 0, ganesM = 0, empatesM = 0,puntosM=0,Njugadores=0,Nmaquinas=0;
char Jugadas[][20] ={"Pi... | true |
a7a254a7e9b16654c7e9503362d61ae6702e8860 | C++ | jianxinzhu/Chapter-7-Class-Template-Array-and-Vector-Catching-Exceptions | /PrintArray.cpp | UTF-8 | 467 | 3.34375 | 3 | [] | no_license | /* name: jianxin zhu
date: july/20/2020
*/
#include<array>
#include<iostream>
using namespace std;
const int SIZE = 20;
void printArray(array<int, SIZE>a1, size_t beginNumber, size_t endNumber)
{
if (beginNumber < endNumber)
{
cout << a1[beginNumber]<<" ";
printArray(a1, beginNumber+1, endNumber);
}... | true |
222798209da77d71dc9985b8327bd7345ed4e514 | C++ | cipriancus/WormNET | /SeachEngine/ChordFiles/AnonymousChordLibrary/p2p/protocols/chord/ChordNode.h | UTF-8 | 3,878 | 2.546875 | 3 | [] | no_license | #ifndef CHORDNODE_H
#define CHORDNODE_H
#include "IOverlay.h"
#include "AbstractChord.h"
#include "TransportHTTP.h"
#include <string>
#include <map>
#include <vector>
#include <ctime>
class Stabilization;
using namespace std;
struct contact {
ChordNode *node;
Node *selectedNode;
transportCode tr;
ma... | true |
6cb0552d03eab50ccdf3fedaf5d2471969bcf922 | C++ | jeffdk/SpecClass2011 | /Iryna/Assignment02Iryna/Executables/TestAssignment02Iryna.cpp | UTF-8 | 1,666 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include "MyVector.hpp"
#include "OptionParser.hpp"
#include "ReadFileIntoString.hpp"
#include "UtilsForTesting.hpp"
#include "Require.hpp"
#include "Assignment02Iryna.hpp"
int main(int /*argc*/, char** /*argv*/) {
//Try out the new sumVectors function ... | true |
e57bb66e31b08641b69e2e6645fab2887337c8ea | C++ | NEWPLAN/OJ | /data_struct/src/src_ch03/CH03-4.cpp | GB18030 | 383 | 2.875 | 3 | [] | no_license | /*********************************************
* P93 㷨3.7 ͳƶҶӽ㷨
**********************************************/
int count_leafs(BTreePtr pbt)
{
if( pbt== NULL ){
return 0;
}
if((pbt->lchild == NULL) && (pbt->rchild == NULL)){
return 1;
}
return(count_leaf_BT(pbt->lchild) + coun... | true |
d55cafd1036f288f84918b176bb4f62e65d3046f | C++ | code0monkey1/Competitive | /zigzag.cpp | UTF-8 | 1,548 | 2.890625 | 3 | [] | no_license | //zig zag topcoder
#include<bits/stdc++.h>
using namespace std;
int zigzag(const std::vector<int> & v){
int maxi=0;
bool is_negative=0;
int inter_max=0;
bool positive_switch=0;
bool negative_switch=0;
bool start_count=0;
for(int i=0;i<v.size()-1;i++){
if(!start_count){
if(v[i]-v[i+1]... | true |
c723cfe57dc8f848013c021097ea36a308e22de1 | C++ | naturerun/LALRAnalysisGenerator | /LALRAnalysis/DirectedGraph.h | GB18030 | 9,825 | 3.484375 | 3 | [
"MIT"
] | permissive | #pragma once
#include <iostream>
#include <vector>
using std::vector;
template <typename V, typename E> //V,E붨忽캯ƸֵԼ
class Graph //ͼ,洢ṹΪʮ
{
friend class RELALRParsing;
public:
class GraphVertexNode;
struct GraphEdgeNode //߽ڵ
{
typename vector<GraphVertexNode*>::size_type head = 0; //ͷӦ
typename vector<Gr... | true |
6635fa7a680e630da3cb608a0b9691d18944d363 | C++ | przemek29/C_plus_plus | /Chapter 10 - Class/10_13/10_13.cpp | UTF-8 | 399 | 3.328125 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include "person.h"
void presentation(person &someone);
int main()
{
person composer, author;
composer.remember("Fryderyk Chopin", 36);
author.remember("Marcel Proust", 34);
presentation(composer);
presentation(author);
}
void presentation(person &someon... | true |
4fd2861c817b5b86120fc96df3cfe5652318acdb | C++ | icare4mm/mastermind-strategy | /lib/Compare.cpp | UTF-8 | 17,287 | 2.828125 | 3 | [
"MIT"
] | permissive | ///////////////////////////////////////////////////////////////////////////
// Codeword comparison routines.
#include <cassert>
#include <utility>
#include "util/simd.hpp"
#include "util/intrinsic.hpp"
#include "Algorithm.hpp"
//#include "util/call_counter.hpp"
/// Define the following macro to 1 to enable a special... | true |
a4e789e8638eaf3dda31737ad5c165bff024b3cd | C++ | fastpath/LittleIrritations | /Polygon.h | UTF-8 | 689 | 2.796875 | 3 | [] | no_license | #pragma once
#include <vector>
#include <SFML/System/Vector2.hpp>
#include <SFML/Graphics.hpp>
#include <boost/shared_ptr.hpp>
#include <cmath>
class Polygon;
typedef boost::shared_ptr<Polygon> PolygonPtr;
class Polygon
{
public:
Polygon(void);
~Polygon(void);
void addPoint(float p_x, float p_y);
void addPoint(s... | true |
8fd327a7d78d3cfcb74d6c9b542ec76564df077d | C++ | kbc15gc/game | /game/Decide/Decide/GameObject/History/Chip.h | SHIFT_JIS | 1,494 | 2.59375 | 3 | [] | no_license | /**
* `bvNX̒`.
*/
#pragma once
#include "fbEngine\_Object\_GameObject\GameObject.h"
#include "fbEngine\_Object\_GameObject\SoundSource.h"
#include "HistoryInfo.h"
class Player;
class HistoryMenuSelect;
static const float ChipTimer = 4.0f;
/**
* `bvNX.
* ĵ.
*/
class Chip : public GameObject
{
public:
/**
* RXgN^... | true |
28bbf9545c03cb83180cf3f274bec70a1b24244f | C++ | ilijabc/AngryGL | /source/frameworks/glplus/GLView.h | UTF-8 | 1,468 | 2.53125 | 3 | [] | no_license | #ifndef GLVIEW_H
#define GLVIEW_H
#include "glplus_private.h"
class GLView
{
public:
enum DrawingMode
{
Quads = 0,
Triangles,
Lines,
LineLoop
};
private:
class IVertex
{
public:
IVertex* normal(float x, float y, float z);
IVertex* color(unsigned int rgba);
IVertex* texcoord(float u, float v);
f... | true |
a40da0ea4bb09ed79d922689594c7980f561f3be | C++ | oliffur/learning | /Exercises/MinJumps.cpp | UTF-8 | 1,804 | 4.09375 | 4 | [] | no_license | /* given an array of non-negative integers, you are initially positioned at the
* first index of the array; each element in the array represents your maximum
* jump length at that position
*
*/
#include <iostream>
#include <vector>
#include <iterator>
using namespace std;
int findMinJumps(vector<int> jumpArray)... | true |
a21c2c22171ac050704fc874a9d31ad8c17d8888 | C++ | Devilsider/Tencent_Cloud_Backup | /20190521/zuoye/cowString.cc | UTF-8 | 3,932 | 3.453125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <iostream>
using std::cout;
using std::endl;
class CowString{
public:
CowString();
CowString(const char *);
CowString(const CowString &rhs);
CowString &operator=(const CowString &rhs);
~CowString();
const cha... | true |
92561d6d48ceb2a98ded5c73be07cc61a2a5cd08 | C++ | rashedcs/Data-Structure-and-Algorithm | /Graph/BFS GRID.cpp | UTF-8 | 2,007 | 2.734375 | 3 | [] | no_license | //Codechef : https://www.codechef.com/status/CDZ14C,rashedcs
#include<bits/stdc++.h>
using namespace std;
int arr[20][20];
int vis[20][20];
int dist[20][20];
int dr[]={1,0,-1,0};
int dc[]={0,1,0,-1};
int n, m, ans;
int safe(int x,int y)
{
return x>=0 && y>=0 && x<n && y<m;
}
void bfs(int sx, int sy, int dx, ... | true |
669b6be0935d0c9ed4fc6515eea40da679527982 | C++ | starcatneko/TeamProject | /Android/Android1/Android1.NativeActivity/LoadMane.h | UTF-8 | 852 | 2.609375 | 3 | [] | no_license | #pragma once
#include "Typedef.h"
#include <map>
#include <vector>
#include <string>
class LoadMane
{
public:
// デストラクタ
~LoadMane();
// インスタンス変数の取得
static LoadMane* Get(void) {
return instance;
}
// インスタンス化
static void Create(void);
// 破棄
static void Destroy(void);
// 画像の読み込み
int Load(std::string file... | true |
0fca9aa25dd17f5a37b32fdb8d676544d758fc6e | C++ | alecnunn/bookresources | /GameDevelopment/Programming Role Playing Games with DirectX (Second Edition)/BookCode/Chap12/Chars/Chars.cpp | UTF-8 | 67,672 | 2.609375 | 3 | [] | no_license | #include "Core_Global.h"
#include "Frustum.h"
#include "MCL.h"
#include "MIL.h"
#include "MSL.h"
#include "Chars.h"
#include "Spell.h"
cCharacterController::cCharacterController()
{
m_Graphics = NULL; // Clear cGraphics pointer
m_Font = NULL; // Clear cFont pointer
m_Frustum =... | true |
6c2991eb66a8121a59384fb1acb02f22cd35d092 | C++ | sanjusss/nowcoder | /huawei/005计算字符个数.hpp | GB18030 | 980 | 3.234375 | 3 | [] | no_license | #pragma once
/*
Ŀ
дһһĸɵַһַȻַкиַĸִСд
:
һһĸԼոɵַڶһַ
:
ַкиַĸ
ʾ1
ABCDEF
A
1
*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <iterator>
#include <string>
#include <stack>
#include <queue>
#include <random>
#include <ctime>
#include <limits>
#inclu... | true |
8133478aea931e62faf22759eb1de6bcd9f15ad8 | C++ | optimisticlucifer/My_Cpp_Journey | /btd.cpp | UTF-8 | 250 | 2.765625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int btd(int n){
int x=1,sum=0;
while(n>0){
int a=n%10;
sum+=a*x;
x*=2;
n/=10;
}
return sum;
}
int main()
{
int n;
cin>>n;
cout<<btd(n)<<endl;
} | true |
9254ba6c6826cf669c07574ea158cd236c8ccc7a | C++ | groosik/Api | /DikiApi/src/WebsiteFetcher.cpp | UTF-8 | 1,297 | 2.921875 | 3 | [] | no_license | #include "WebsiteFetcher.h"
#include <codecvt>
std::wstring WebsiteFetcher::downloadWebsite(const std::wstring& link)
{
//TODO: implement
return L"..\\additional files\\dog.html";
}
void WebsiteFetcher::loadFileIntoMemory()
{
int i=0;
std::wstring line;
while(getline(fileHandler, line))
codeLines.push_back(li... | true |
7823435fc98f052c8c1d2cc0685e433567156feb | C++ | riscy/a_star_on_grids | /src/benchmarks.cpp | UTF-8 | 2,401 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <fstream>
using namespace std;
#include "benchmarks.h"
#include "graph.h"
#include "heuristics.h"
#include "algorithms.h"
#include "stats.h"
const int RANDOM_SEED = 10;
/// Test a random set of problems
void benchmark_all_algorithms(Graph & graph, int num_problems,
unsigned int ... | true |
02e94825a4883ca5577a582bfddeea1e59f06b3d | C++ | pjha1994/javatempfiles | /gcd_lcm.cpp | UTF-8 | 353 | 3.015625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int gcd1(int a,int b){
return b==0?a:gcd1(b,a%b);
}
int main(){
int T;
cin>>T;
int *gcd = new int[T];
int *lcm = new int[T];
int temp=T;
while(T-->0){
int a,b;
cin>>a>>b;
gcd[T] = gcd1(a,b);
lcm[T] = (a*b)/gcd[T];
}
T=temp;
for(int i=T-1;i>=0;i--)
cout<<gcd[i]... | true |
667dfba99506a57800e9ece5904ec3991bd734e4 | C++ | NicoJiao/DatasetGenerator | /utils/bel2yolo.cpp | UTF-8 | 3,051 | 2.8125 | 3 | [] | no_license | // STD; STL
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
// OpenCV
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
void loadImages(const std::string& path, std::vector<cv::Mat>& imgs, const int& mode)
{
std::vector<cv::... | true |
1795b9afafaf00c190ec9028882bfefba3601b1e | C++ | graphisoft-python/DGLib | /Support/Modules/GSRoot/ThreadSpecificStorage.hpp | UTF-8 | 4,207 | 2.796875 | 3 | [
"Apache-2.0"
] | permissive |
// *****************************************************************************
//
// Declaration and implementation of ThreadSpecificStorage<T> class
//
// Module: GSRoot
// Namespace: GS
// Contact person: SN
//
// *****************************************************************************
#ifndef GS_THREADSP... | true |
6f856f3c59e8873537f2ad9bb74d225ea1d063b6 | C++ | pochka15/OpenGL-GKOM | /gkom-gl/zs2_dzwig/Vertex.h | UTF-8 | 436 | 2.984375 | 3 | [] | no_license | #pragma once
#include <glm/glm.hpp>
class Vertex
{
public:
glm::vec3 Position;
glm::vec3 Color;
glm::vec2 TextureCoords;
Vertex()
{
}
Vertex(glm::vec3 position)
: Position(position)
{
}
Vertex(glm::vec3 position, glm::vec3 color)
: Position(position), Color(color)
{
}
Vertex(glm::vec3 position, g... | true |
7c626f81e1a1ab68bc84bc06d92f6259985ebd45 | C++ | azcbuell/mixr | /include/mixr/simulation/AbstractPlayer.inl | UTF-8 | 3,004 | 2.625 | 3 | [] | no_license | //------------------------------------------------------------------------------
// Class: AbstractPlayer
// Description: inline functions
//------------------------------------------------------------------------------
#ifndef __mixr_models_AbstractPlayer_Inline__
#define __mixr_models_AbstractPlayer_Inline__
// True... | true |
d78d4010b1f58c46b21f00f291328f3e7efae5a9 | C++ | BhawanaWadhwani/InterviewBit | /Math/Find Nth Fibonacci.cpp | UTF-8 | 1,599 | 2.84375 | 3 | [] | no_license | // [ F1 F2 ] * Transition Matrix = [F2 F3]
// [ F1 F2 ] * [ P Q ] = [F2 F3]
// [ R S ]
// F1 * P + F2 * R = F2
// F1 * Q + F2 * S = F3 (F1 + F2)
//we get P=0 && R=1
//and Q=1 && S=1
// [ F1 F2 ] * [ 0 1 ] = [F2 F3]
// [ 1 1 ]
// [ F1 F2 ] * [ 0 1 ] ^ (n-1) = [Fn Fn+1]
// [ 1 1 ]... | true |
c3351951122bbcf7ae6be38ec273984074d6b363 | C++ | snehalmparmar/CPP_Algorithms | /Variant_Parity.cpp | UTF-8 | 864 | 3.140625 | 3 | [] | no_license | #include "Variant_Parity.h"
#include <iostream>
#include <cmath>
/* This algorithm takes O(n) time
unsigned Variant1_Parity(unsigned long x) {
unsigned long result{ 1 };
short count{ 0 };
unsigned long y{ x };
while (result ^= (x & 1)) { //O(n)
//result ^= (x & 1);
count++; //O(1)
x >>= 1;//O(1)
}
return (x... | true |
9bd21e9ec07fc0327a8a9e9cf03736081476fe4d | C++ | asokolov1104/vs2019repo | /cnsVirtFunc/mainVirtFunc.cpp | UTF-8 | 411 | 3.15625 | 3 | [] | no_license | //
#include <iostream>
//
int main()
{
class Base
{
virtual void method() { std::cout << "called from Based" << std::endl; }
public:
virtual ~Base() { method(); }
void baseMethod() { method(); }
};
class A : public Base
{
void method() { std::cout << "called from A \n" << std::endl; }
public:
~A() ... | true |
3c623f5ceeebe2095eaf46cc2f1e9fd0d6f2f91d | C++ | coder965/flame | /src/flame/spare_list.h | UTF-8 | 2,448 | 2.546875 | 3 | [
"MIT"
] | permissive | //MIT License
//
//Copyright (c) 2018 wjs
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publis... | true |
3c350c74668bb50f8a8ad7165fddad7b0ab11f3f | C++ | raobystorm/algorithms | /LCOJ_223/LCOJ_223.cpp | UTF-8 | 453 | 2.75 | 3 | [] | no_license | // LCOJ_223.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
class Solution {
public:
int computeArea(int A, int B, int C, int D, int E, int F, int G, int H) {
if (E >= C || G <= A || B >= H || F >= D)
return (C - A)*(D - B) + (G - E)*(H - F);
else
return (C - A)*(D - B) + ... | true |
febff2461151d2a7519f9022e346ee04904e2654 | C++ | tachyon83/code-rhino | /DAY450~499/DAY482-PROGRAMMERS오픈채팅방/bumjin.cpp | UTF-8 | 987 | 3.09375 | 3 | [] | no_license | #include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <sstream>
using namespace std;
vector<string> solution(vector<string> record) {
vector<string> answer, state;
map<string, string> user;
for(int i = 0; i < record.size(); i++)
{
string str[3];
... | true |
fe89da4d1bc2a03fa6cb45160c68cc02d4b88df0 | C++ | VijayEluri/ads | /cpp/sorting/mergesort.cpp | UTF-8 | 1,744 | 3.859375 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <queue>
using namespace std;
template <class T>
void print(const T &data) {
cout << " " << data;
}
/* Sort a vector of type T
*
* Copying a vector around like this (i.e. v = mergesort(...)) is
* highly inefficient, the right ... | true |
96e95bcc4e36ecc0a1560ab974ab525cc6b3e67c | C++ | ranshiwei/Leetcode | /ReversePolishNotation.cpp | UTF-8 | 1,135 | 3.34375 | 3 | [] | no_license | #include <string>
#include <iostream>
#include <stack>
#include <vector>
#include<boost/regex.hpp>
#include <stdlib.h>
using namespace std;
class Solution{
public:
int evalRPN(vector<string> &tokens)
{
first = tokens.begin();
last = tokens.end();
while(first != last)
{
if(Regex.match(*first,pattre... | true |
a7cfdf08db97d683f0c0123b6dd1372d61178884 | C++ | joostrijneveld/Euler-Project | /problem79.cpp | UTF-8 | 1,176 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <math.h>
#include <string>
#include <sstream>
#include "bigint/BigIntegerLibrary.hh"
using namespace std;
string int2str (int n) {
stringstream ss;
ss << n;
return ss.str();
}
int str2int (string str) {
stringstream ss(str);
int n;
ss >> n;
return n;
}
int main () {
string digits... | true |
57a8463b7262efd78389dcae985b1fad4113b99d | C++ | Shristy-Gupta/Leetcode-top-interview-q | /palindrome LCS.cpp | UTF-8 | 1,262 | 2.796875 | 3 | [
"MIT"
] | permissive | #include<string.h>
class Solution {
public:
string longestPalindrome(string s) {
//https://www.youtube.com/watch?v=wuOOOATz_IA&list=PL_z_8CaSLPWekqhdCPmFohncHwz8TY2Go&index=26
if(s.length()<1){return s;}
if(s.length()==1){return s;}
string t=s;
reverse(t.begin(),t.end());
... | true |
832979129cb7defbee5f5c098aabf0b097941f26 | C++ | ZhaohuiSun/About_Tree | /About_Tree.cpp | UTF-8 | 4,443 | 3.46875 | 3 | [] | no_license | #include<iostream>
#include<stack>
#include<queue>
#include<fstream>
#include<cstdlib>
using namespace std;
//定义节点
typedef struct node
{
struct node *lchild;
struct node *rchild;
char data;
}BiTreeNode, *BiTree;
//按照前序顺序建立二叉树
void createBiTree(BiTree &T) //&的意思是传进来节点指针的引用,括号内等价于 BiTreeNode* &T,目的是让传递进来的指针发生改变
{... | true |
7360487a08bbc1debfed87a03c5336abd0f38833 | C++ | warguss/ProjectRTS | /ServerRoot/server2N/server/include/common/CUser.cpp | UTF-8 | 828 | 2.5625 | 3 | [] | no_license | #include "CUser.h"
CUser::CUser()
{
_x = 0;
_y = 0;
_accelX = 0;
_accelY = 0;
_killInfo = 0;
_deathInfo = 0;
_nickName = "unknown";
_fd = 0;
_health_point = 0;
_score = 0;
}
CUser::CUser(int fd, int32_t x, int32_t y)
{
_x = 0;
_y = 0;
_accelX = 0;
_accelY = 0;
_score = 0;
_fd = fd;
... | true |
55286c02f0e79d60b4a535b748f192a5da768b6b | C++ | Mikeiladay/TP_lab_1 | /TP_1_12/checkInput.cpp | WINDOWS-1251 | 1,254 | 3.265625 | 3 | [] | no_license | #include "checkInput.h"
bool isInt(char c)
{
if (c >= '0' && c <= '9')
return true;
else
return false;
}
bool isSplit(char c)
{
if (c == '.' || c == '/')
return true;
else
return false;
}
bool isInt(string s)
{
if (s.size() < 1)
return false;
for (int i = 0; i < s.size(); i++)
if (s[i] < '0' || s[i... | true |
91e747c9181c6b9f61d34bde0ebab18d3af6e51c | C++ | xianjimli/Elastos | /Elastos/LibCore/src/Elastos/Net/Apache/Protocol/Http/CFixedLengthOutputStream.cpp | UTF-8 | 1,623 | 2.671875 | 3 | [] | no_license |
#include "CFixedLengthOutputStream.h"
ECode CFixedLengthOutputStream::Close()
{
// TODO: Add your code here
if (mClosed) {
return NOERROR;
}
mClosed = TRUE;
if (mBytesRemaining > 0) {
return E_IO_EXCEPTION;
};
return NOERROR;
}
ECode CFixedLengthOutputStream::Flush()
{
... | true |
d55d381b25eb6eea43f86b98e4d9ca9f419cf0c9 | C++ | felixsoum/420J11AS-CppPractice | /CppPractice/CppPractice/Hero.h | UTF-8 | 227 | 2.640625 | 3 | [] | no_license | #include "Monster.h"
#include <memory>
class Hero
{
public:
void attack(const Monster* monster) const;
void attack(std::shared_ptr<Monster> monster);
void attack(std::unique_ptr<Monster>& monster);
private:
int level;
};
| true |
9a1b77311efdbb54579fbd13ad1236be6fc4d1e6 | C++ | emiruner/simge-examples | /polylineeditor/Editor.hpp | UTF-8 | 3,219 | 2.796875 | 3 | [] | no_license | #ifndef MY_EDITOR_HPP_INCLUDED
#define MY_EDITOR_HPP_INCLUDED
#include <simge/glut/Planar.hpp>
#include <simge/util/Polyline.hpp>
#include <vector>
#include <string>
typedef simge::util::Polyline<simge::geom::Point<2> > Polyline2D;
typedef std::vector<Polyline2D> Polyline2DVec;
struct EditorState;
class Editor : p... | true |
1d5dc4abceaadc90ed12443d2f71d2727f5dea4e | C++ | aanoguchi/ECC_CS1_F19 | /Quizzes/Q8.cpp | UTF-8 | 2,559 | 4.0625 | 4 | [] | no_license | // Purpose: Take in the text and be able to find the most common word and output
// it.
// Input:
// txt - String of words separated by spaces where a word consists of
// alpha-numeric characters.
// Output: The most frequent word in the string
string most_common_word(string txt);
// Tests
// ---
// Input ... | true |
d79b57be9a7aefb6d3b58652786e43d0c2c817d6 | C++ | DionysiosB/LeetCode | /26-RemoveDuplicatesFromSortedArray.cpp | UTF-8 | 346 | 2.734375 | 3 | [] | no_license | class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if(nums.size() == 0){return 0;}
int index(0);
for(int p = 1; p < nums.size(); p++){
if(nums[p] != nums[index]){
++index;
nums[index] = nums[p];
}
}
ret... | true |
ab69d6374691e512bed2eb5549e0898ff5e78c6c | C++ | zyzkevin/Introduction-to-Computing | /Big Homework/bot2.cpp | UTF-8 | 9,932 | 2.53125 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include<cmath>
#include <string>
#include <queue>
#include <cstdlib>
#include <ctime>
#include <cstring>
#define GRIDSIZE 8
#define OBSTACLE 2
#define grid_black 1
#define grid_white -1
using namespace std;
double K = 0.2;
int currBotColor;
int gridInfo[GRIDSIZE][GRIDSIZE] = { 0 };
int dx[8]... | true |
0832b7e656c6cdc4ef633729d43b0ad9a1e284a4 | C++ | Wizardyi/MyFirstProject | /main/src/socket/Socket.h | UTF-8 | 793 | 2.5625 | 3 | [] | no_license | #pragma once
#include<stdlib.h>
#include<memory>
#include<sys/socket.h>
#include<netinet/in.h>
#include <arpa/inet.h>
#include<iostream>
#include<string.h>
#include <stdio.h>
#include <unistd.h>
using namespace std;
#define BUFF_SIZE 1024*100
class CSocket
{
public:
CSocket(){
memset(&serv_addr_, 0, sizeof(serv... | true |
627517da910cd64738db83ee072795d6373b52e7 | C++ | gysevvlad/viewapp | /src/tests/reactor_test.cpp | UTF-8 | 9,720 | 2.75 | 3 | [] | no_license | #include <gtest/gtest.h>
#include "src/Reactor.h"
#include "src/helper.h"
template<class HoldFunctor>
class FunctorEventHandler : public Reactor::IEventHandler, HoldFunctor
{
public:
template<class ParamFunctor>
FunctorEventHandler(Reactor & reactor, ParamFunctor && functor) :
HoldFunctor(std::forward... | true |
e6dd3d71f9eb1c06adfb72126f671498ed5f6211 | C++ | Hanzhuo-Gong/Foothill-Work-CPP | /CS 2C Lab6/CS 2C Lab6/CS2CLab6.cpp | UTF-8 | 4,668 | 3.1875 | 3 | [] | no_license | // CS2CLab6.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <string>
#include <ctime>
#include "Penguin.hpp"
using namespace std;
//-------------------Global Prototype-----------------------------
int Hash(int key);
int Hash(const string & key);
int Hash(const Pe... | true |
5db3bf286e61ae94fb987dc5fd1f88e420a84e8a | C++ | LedgerHQ/lib-ledger-core | /core/src/utils/endian.h | UTF-8 | 4,255 | 2.59375 | 3 | [
"MIT"
] | permissive | /*
*
* endian
* ledger-core
*
* Created by Pierre Pollastri on 15/09/2016.
*
* The MIT License (MIT)
*
* Copyright (c) 2016 Ledger
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Softwa... | true |
051c43cf88347e8a2aa6bab1bf1da04a7879bfc6 | C++ | gardenappl/oop-lab1-queue-ip | /src/sorted_vector.h | UTF-8 | 1,241 | 3.828125 | 4 | [] | no_license | #pragma once
#include "comparator.h"
#include <vector>
template<typename T>
struct sorted_vector
{
private:
/*!
* The underlying data vector.
*/
std::vector<T> data_vector;
/*!
* The comparison function to use for sorting the array.
*/
comparator<T> sort_comparator;
public:
/*!
* C... | true |
c90d3f608a2bd196db6a1e2dd77183ee693924f6 | C++ | icylight/fr | /common/ThreadPool.cpp | UTF-8 | 5,326 | 2.546875 | 3 | [] | no_license |
#include "stdafx.h"
#include "ThreadPool.h"
DWORD BeginTime;
LONG ItemCount;
HANDLE CompleteEvent = NULL;
FORCEINLINE
VOID
InitializeListHead(
__out PLIST_ENTRY ListHead
)
{
ListHead->Flink = ListHead->Blink = ListHead;
}
__checkReturn
BOOLEAN
FORCEINLINE
IsListEmpty(
__in const LIST_ENTRY * ListHe... | true |