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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35278148ea9b6333621d688dffc3eff307229615 | C++ | zhangli344236745/Linux-Tutorial | /db_tutorial_cpp/tutorial11/db.cpp | UTF-8 | 28,206 | 2.75 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstring>
#include <string>
#include <fcntl.h>
#include <unistd.h>
enum MetaCommandResult
{
META_COMMAND_SUCCESS,
META_COMMAND_UNRECOGNIZED_COMMAND
};
enum PrepareResult
{
PREPARE_SUCCESS,
PREPARE_NEGATIVE_ID,
PREPARE_STRING_TOO_LONG,
PREPARE_SYNTAX_ERROR,
PREP... | true |
e629389b296643ee6d82429b4445afde41dde93e | C++ | XiaotaoGuo/Leetcode-Solution-In-Cpp | /tree/medium/145.BinaryTreePostorderTraversal.cpp | UTF-8 | 1,800 | 3.609375 | 4 | [
"Apache-2.0"
] | permissive | /*
* @lc app=leetcode id=145 lang=cpp
*
* [145] Binary Tree Postorder Traversal
*
* https://leetcode.com/problems/binary-tree-postorder-traversal/description/
*
* algorithms
* Medium (55.73%)
* Likes: 2082
* Dislikes: 104
* Total Accepted: 415.3K
* Total Submissions: 742.6K
* Testcase Example: '[1,n... | true |
5f0cbc6813c8e121e616a9591f49d53eab58a03b | C++ | dazhiwang/for-copying-line-number | /Desktop/EECS482/P1/p1.cpp | UTF-8 | 2,096 | 2.6875 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <limits>
#include <cmath>
#include "thread.h"
using namespace std;
mutex mutex1;
//mutex mutex2;
cv cv1;
cv cv2;
int tra... | true |
29b56e4b7cb8dd9fb719123df714175142cad15f | C++ | coolnaut/CPP_program | /C++内存管理/C++内存管理/内存管理.h | GB18030 | 3,852 | 3.390625 | 3 | [] | no_license | #pragma once
#include<iostream>
using namespace std;
void CMemory()
{
//malloc(size_t ize)
//ڶϷһ鳤Ϊsizeֽڵ
//sizeΪҪڴռijȣظַ
int* p1 = (int*)malloc(sizeof(int));
//calloc(size_t count, size_t size
//ڶϷcountsizeֽڵ
//ĿռеÿһλʼΪ
int *p2 = (int*)calloc(1, sizeof(int));
//realloc(void *ptr, size_t si... | true |
79a4c85e4d4acb5eaea381d65d4120fa35bcd8d9 | C++ | thegamer1907/Code_Analysis | /CodesNew/4016.cpp | UTF-8 | 1,580 | 2.671875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int n, q;
int search(long long int sum[], int left, int right, long long int key){
if (right < left){
return -1;
}
int mid = (left+right)/2;
if (sum[mid] == key) {
return mid+1;
}
if (sum[mid] > key) {
if (mid > 0 && sum[mid-1... | true |
4de6524696eb9180e680239fa4e39021aeae3586 | C++ | theophie/AID | /sketch_nov29a.ino | UTF-8 | 2,410 | 2.640625 | 3 | [] | no_license |
const int pedalSensor =A0;
const int snareSensor=A1;
const int hihatSensor=A4;
const int threshold = 300;
int pS = 0;
int sS=0;
int hS=0;
//int snareTimer = -1;
int pedalTimer = -1;
//int hihatTimer = -1;
//int noteBuzz; // Data received from the serial port
//int noteBuzzer;
//char noteBuzzer[3];
void setup()... | true |
5e498449711c9ae9b99bfe09378464a8e65f4af0 | C++ | nicolasjinchereau/microwave | /core/source/MW/System/Window.ixx | UTF-8 | 3,740 | 2.5625 | 3 | [] | no_license | /*--------------------------------------------------------------*
* Copyright (c) 2022 Nicolas Jinchereau. All rights reserved. *
*--------------------------------------------------------------*/
export module Microwave.System.Window;
import Microwave.Graphics.RenderTarget;
import Microwave.Math;
import Microwave.Sy... | true |
9c54d1e2fef1673d0e4ac0b5d2a6f97c1b8a0dde | C++ | cburris2/csci333-lab1 | /pe1.cpp | UTF-8 | 240 | 2.875 | 3 | [] | no_license |
#include <iostream>
using std::cout;
using std::endl;
int add(int a);
int main(){
cout<< add(1000) << endl;
return 0;
}
int add(int a){
int sum=0;
for (int i=0; i<a; i++) {
if (i%3==0 || i%5==0) {
sum+=i;
}
}
return sum;
}
| true |
5e330d0ec61ac934b39659dd8258d6992276a31c | C++ | coderdamin/PAT-Basic-Level-Practise | /C++/1009.cpp | GB18030 | 1,439 | 3.640625 | 4 | [] | no_license | //
// һӢҪдеʵ˳ߵ
//ʽ
// һһڸܳȲ80ַַɵʺɿոɣеӢĸСд֣ɵַ
// ֮1ոֿ뱣֤ĩβûжĿո
//ʽ
// ÿռһУľӡ
//
// Hello World Here I Come
//
// Come I Here World Hello
#include <iostream>
using namespace std;
#define SWAP(val1, val2) \
{\
val1 ^= val2; \
val2 ^= val1; \
val1 ^= val2; \
}
void Solution_1();
void Solution... | true |
1c4a3121f853d9cda52e5247938725038e91ac14 | C++ | 24380974/dpdk_router-1 | /test/test.cc | UTF-8 | 1,760 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | #include <limits.h>
#include <gtest/gtest.h>
extern "C" {
#include "../router.h"
#include "../routing_table.h"
}
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
struct ether_addr port_id_to_mac[4];
void check_address(uint8_t a, uint8_t b, uint8_t c, uint8_t d, int next_hop) {
int ip = ... | true |
342abf21ccfdc5be9bac123cc8c86f71915ba718 | C++ | NightHunters/Drawer_console | /Canvas.cpp | GB18030 | 19,117 | 2.828125 | 3 | [] | no_license | #include "Canvas.h"
#include<iostream>
using namespace std;
Canvas::Canvas()
{
pen.setColor(QColor(0, 0, 0, 255));
height = 0;
width = 0;
flag = false;
}
void Canvas::resetCanvas(int wid, int hei)
{
width = wid;
height = hei;
QPixmap p(wid, hei);
pix = p.copy();
pix.fill(QColor(255, 255, 255, 2... | true |
dafab43665a6266a1cbd17f596ae2d82282ac26b | C++ | nrupprecht/Manta | /include/manta/parser/ParseNode.h | UTF-8 | 696 | 2.890625 | 3 | [] | no_license | //
// Created by Nathaniel Rupprecht on 2/2/21.
//
#pragma once
#include "manta/utility/ParserUtility.hpp"
namespace manta {
struct ParseNode {
explicit ParseNode(const std::string& designator);
ParseNode &operator=(const ParseNode &node);
void Add(const std::string &str);
void Add(const std::shared_ptr<... | true |
b082815c1d9f30b726ea2915ec001a79ad6b48ea | C++ | oyefremov/hana | /include/boost/hana/detail/array.hpp | UTF-8 | 1,215 | 2.96875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"BSL-1.0"
] | permissive | /*!
@file
Defines `boost::hana::detail::array`.
@copyright Louis Dionne 2015
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
*/
#ifndef BOOST_HANA_DETAIL_ARRAY_HPP
#define BOOST_HANA_DETAIL_ARRAY_HPP
#include <boost/hana/detai... | true |
3665dfe56d80b7181f1001704a5cc061f9666cac | C++ | barks333/codechef | /flow14.cpp | UTF-8 | 365 | 2.546875 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int t;
float h,cc,ts;
cin>>t;
while(t--)
{
cin>>h>>cc>>ts;
if(h>50 && cc<0.7 && ts>5600)
cout<<10<<endl;
else if(h>50 && cc<0.7)
cout<<9<<endl;
else if(cc<0.7 and ts>5600)
cout<<8<<endl;
else if(h>50 and ts>5600)
cout<<7<<endl;
else if(h>50 || cc<0.7 || ts>5600)
cout... | true |
226a46e38f80f3b3683eee052cc1174ae75b9dc2 | C++ | CaptainTsao/ts | /src/time_series_reader.cpp | UTF-8 | 5,049 | 2.9375 | 3 | [] | no_license | //
// Created by transwarp on 2021/6/22.
//
#include "time_series_reader.h"
#include <iomanip>
#include <boost/lexical_cast.hpp>
std::vector<std::string> ReadHeader(std::ifstream &in_file, CsvFileDefinition &definition) {
std::vector<std::string> result;
std::string header_line;
std::getline(in_file, header_lin... | true |
cae8f5956eb84620dfad34e91a66997f63ff1f24 | C++ | isuckatdrifting/Iapetos | /Issac/Classes/Service/PlayerService.cpp | UTF-8 | 4,361 | 2.53125 | 3 | [
"MIT"
] | permissive | #include "PlayerService.h"
#include "cocos2d.h"
USING_NS_CC;
PlayerService* PlayerService::getInstance()
{
if (inst_ == nullptr)
{
inst_ = new (std::nothrow) PlayerService();
CCASSERT(inst_, "FATAL: Not enough memory");
}
return inst_;
}
void PlayerService::init()
{
model_ = Play... | true |
7e284f9fe4a8cb1b721de7aefe11f1ae4800a8da | C++ | handsomebsn/data-structure | /3/3.31.cpp | UTF-8 | 3,097 | 3.390625 | 3 | [
"BSD-3-Clause"
] | permissive | #include<stdio.h>
#include<stdlib.h>
#define INFEASIBLE -1//参数不合法
#define OK 1
#define ERROR 0
#define OVERFLOW -2
typedef char ElemType;
typedef int Status;//函数状态
typedef struct Node
{
ElemType data;
struct Node *next;
}Node,*Ptrnode;
typedef struct
{
Ptrnode front;
Ptrnode rear;
int length;
}Queue;
Status Ini... | true |
01b1a57e23a4095ef5538937246a98d183e4da86 | C++ | kushkgp/CompetitiveCode | /Arijit/test.cpp | UTF-8 | 2,501 | 2.828125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
void kMarsh(vector<string> grid) {
int m = grid.size();
int n = grid[0].length();
int left[m+1][n+1], up[m+1][n+1];
for( int j = 0; j < n; j++ )
{
for( int i = 0; i < m; i++ )
{
... | true |
14691351848c29eef5330d9ba0d42d9acd9c841d | C++ | RichardHancock/Game-Engine-Programming | /Engine/internal/networking/SocketBase.h | UTF-8 | 1,191 | 3.4375 | 3 | [] | no_license | #pragma once
#include <string>
#include <queue>
/** @brief A socket base class. */
class SocketBase
{
public:
/**
@brief Constructor.
@param [in,out] inHostname The hostname.
@param inPort The port.
*/
SocketBase(std::string& inHostname, int inPort);
/**
@brief Query ... | true |
8de29682c688f82959946fb04ede022c79b5c506 | C++ | ntraft/ubc-WAM95 | /robot/senses/qd2co_system.h | UTF-8 | 749 | 2.640625 | 3 | [] | no_license | #include "stdheader.h"
#include "utils.h"
class Qd2CoSystem : public systems::System {
public:
//Input<double> input_time;
Input<Quaterniond> input_qd;
Output<co_type> output_co;
protected:
Output<co_type>::Value* output_value_co;
public:
Qd2CoSystem(const std::string& sysName = "Qd2CoSystem") :
... | true |
a1b8fbe065f622f0673f71a6931f3a29de13e4c9 | C++ | vcato/qt-quick-6502-emulator | /unit_tests/immediate_mode_AND.cpp | UTF-8 | 6,099 | 2.890625 | 3 | [] | no_license | #include "addressing_mode_helpers.hpp"
struct AND_Immediate_Expectations
{
constexpr AND_Immediate_Expectations &accumulator(const uint8_t v) { a = v; return *this; }
uint8_t a;
NZFlags flags;
};
using ANDImmediate = AND<Immediate, AND_Immediate_Expectations, 2>;
using ANDImmediateMode = Parameteri... | true |
8f5ad271fd197ad417bfa6912afb43078808013d | C++ | yip-jek/RevenueAudit | /src/base/src/gsignal.cpp | UTF-8 | 2,139 | 2.796875 | 3 | [] | no_license | #include "gsignal.h"
#include <iostream>
#include <signal.h>
#include "log.h"
namespace base
{
Log* GSignal::s_pLog = NULL;
bool GSignal::s_bQuit = false;
bool GSignal::Init(Log* pLog)
{
if ( NULL == pLog )
{
return false;
}
s_pLog = pLog;
if ( SetSignal(SIGTERM, SglFuncQuit) == SIG_ERR )
{
std::cout << ... | true |
8fd57f38cc798e530ab883f38f7b7c75e8aaaa2f | C++ | jezowska/SDiZO-Projekt | /Projekt 2/graph_array.cpp | WINDOWS-1250 | 5,923 | 3.296875 | 3 | [] | no_license | #include "graph_array.h"
using namespace std;
GraphArray::GraphArray(int v, int e)
{
n = v;
size = e;
cost = 0;
//tworzenie tablic ze wskaznikow zadeklarowanych w pliku naglowkowym
d = new int[n];
p = new int[n];
key = new int[n];
pp = new int[n];
graph = new int* [n];
inQ = ... | true |
c421b3942ebd6e1cf6ebc90d04d39c7b0dce3cc2 | C++ | sbreeden25/ChangeUp | /src/v5_hal/firmware/include/kinematics/IDriveKinematics.h | UTF-8 | 2,218 | 2.71875 | 3 | [] | no_license | #pragma once
#include "api.h"
#include "nodes/subsystems/drivetrain_nodes/IDriveNode.h"
#include "math/Pose.h"
#include "util/Encoders.h"
#include "util/Timer.h"
#include "eigen/Eigen/Dense"
class IDriveKinematics {
protected:
Rotation2Dd m_initial_angle;
Pose m_pose = Pose(Vector2d(0, 0), Rotation2Dd());
... | true |
717247eb6f594f7b9e886c6fb24ab5ca6fa9234e | C++ | edgeofmoon/GraphView2017 | /MySimple2DGrid.h | UTF-8 | 2,383 | 2.53125 | 3 | [] | no_license | #pragma once
#include "MyVec.h"
#include "MyArray.h"
#include "MyLine.h"
class MySimple2DGrid
{
public:
MySimple2DGrid(void);
~MySimple2DGrid(void);
void SetRange(float startx, float endx, float starty, float endy);
void SetRange(const MyVec2f& start, const MyVec2f& end);
void SetXDivision(int n);
void SetYDiv... | true |
1e6d3200afae4d00c3004a56fb6dc81dc7172be4 | C++ | nirme/rpg_game_engine | /Profiler.h | UTF-8 | 1,710 | 2.5625 | 3 | [] | no_license | #pragma once
#ifndef _PROFILER
#define _PROFILER
#include "utility.h"
#include "Logger.h"
#include <assert.h>
#define MAX_PROFILER_SAMPLES 20
#define IDS_PROFILE_HEADER1 " Min : Avg : Max : # : Profile Name"
#define IDS_PROFILE_HEADER2 "--------------------------------------------"
#define IDS_PROFILE_SAMPLE... | true |
2e489d961672de275d7138c117a5c1dceb0c43e2 | C++ | arnottkid/CS302 | /Sorting/src/sort_stdin.cpp | UTF-8 | 420 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include "sorting.hpp"
using namespace std;
void usage(const char *s)
{
cerr << "usage: sort_driver size iterations seed double-check(yes|no) print(yes|no)\n";
if (s != NULL) cerr << s << endl;
exit(1);
}
main(int argc, const char **argv... | true |
bd043cba08fedfa154e89f74a70fcf1f11c50020 | C++ | bayram53/online-judge | /codeforces.com/149/5/5.cpp | UTF-8 | 474 | 2.796875 | 3 | [] | no_license | # include <stdio.h>
# include <stdlib.h>
# include <algorithm>
# include <string.h>
using namespace std;
int gcd(int n,int m)
{
if(m==0)
return n;
return gcd(m,n%m);
}
int lcm(int a,int b)
{
return a/gcd(a,b)*b;
}
struct students
{
int a,b;
};
int function (void const *x,void const *y)
{
students m=*(student... | true |
bd36aa3a30e9ea7ce002a2817b417bbeeba98f87 | C++ | sharkduino/Arduino_Animal_Tag | /animal_tag/gyro.cpp | UTF-8 | 2,574 | 2.953125 | 3 | [] | no_license | #include "gyro.hpp"
#include <Arduino.h>
#include <SD.h>
#include "fxas_2.h"
#include "debug.h"
// Size of software buffer (samples)
constexpr signed char buffer_s = 32;
// Size of hardware buffer (samples)
constexpr signed char buffer_h = 32;
static FXAS2::sample buffer[buffer_s];
static signed char buffer_i;
/*
*... | true |
9f3b314ad1fe7d174c89852b0530d47366a0a7f3 | C++ | jmdeal/ray-tracer | /src/geometry/Sphere.h | UTF-8 | 626 | 2.921875 | 3 | [] | no_license | #pragma once
#include <optional>
#include "IHittable.h"
#include "Ray.h"
#include "Vec3.h"
class Sphere : public IHittable
{
public:
Sphere() = delete;
Sphere(math::Vec3 origin, double radius, std::shared_ptr<Material> mat) :
origin_(origin), radius_(radius), mat_ptr_(mat)
{}
std::optional<HitReco... | true |
b3ac278daf9c05ddb9279947b20d7d4833718ca1 | C++ | vCharbonnieras/Projet_multimedia | /main_console.cpp | UTF-8 | 4,708 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include "string"
#include <vector>
#include <opencv2/opencv.hpp>
#include "Lighten_darken.cpp"
#include "cv_canny_edge.cpp"
#include "cv_stitching/cv_stitching.cpp"
#include "Dilatation_erosion.cpp"
#include "Face_identification_recognition.cpp"
using namespace std;
using namesp... | true |
7ac002e215384ba0bf30ce61932289ee53c9b29a | C++ | algoboy101/LeetCodeCrowdsource | /backup/source/cpp/[351]安卓系统手势解锁.cpp | UTF-8 | 1,689 | 3.1875 | 3 | [] | no_license | //我们都知道安卓有个手势解锁的界面,是一个 3 x 3 的点所绘制出来的网格。
//
// 给你两个整数,分别为 m 和 n,其中 1 ≤ m ≤ n ≤ 9,那么请你统计一下有多少种解锁手势,是至少需要经过 m 个点,但是最多经过不超过 n 个
//点的。
//
//
//
// 先来了解下什么是一个有效的安卓解锁手势:
//
//
// 每一个解锁手势必须至少经过 m 个点、最多经过 n 个点。
// 解锁手势里不能设置经过重复的点。
// 假如手势中有两个点是顺序经过的,那么这两个点的手势轨迹之间是绝对不能跨过任何未被经过的点。
// 经过点的顺序不同则表示为不同的解锁手势。
//
//
//
//
/... | true |
c5ba6ad41a279889d48c3b732a9f260be86bc4b4 | C++ | contrechoc/arduino_scripts | /scareCrowdeLuxe/scareCrowdeLuxe.ino | UTF-8 | 3,187 | 3.109375 | 3 | [] | no_license | #include "pitches.h"
// notes in the melody:
int melody[] = {
NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
// note durations: 4 = quarter note, 8 = eighth note, etc.:
int noteDurations[] = {
4, 8, 8, 4,4,4,4,4 };
#include <Servo.h>
Servo myservo1; // create servo object to control a servo... | true |
86940de1e86701e0996d342ce4eb3d31896b2a53 | C++ | lee-younggwan/Algorithm | /백준/이런저런/boj_11656.cpp | UTF-8 | 456 | 2.578125 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
string str;
int main()
{
int i, len;
getline(cin, str);
len = str.length();
vector <string> vec(len);
for (i = 0; i < len; i++)
... | true |
7083ecabf0f34a9eb9bcae212578a58d076ee73f | C++ | rsgysel/ChordAlg | /ChordAlgSrc/tests/lb_triang_triangulation_tests.cpp | UTF-8 | 1,393 | 2.703125 | 3 | [
"MIT"
] | permissive | #include "gtest/gtest.h"
#include "ChordAlgSrc/graph.h"
#include "ChordAlgSrc/lb_triang.h"
#include "ChordAlgSrc/triangulation.h"
#include "test_graphs.h"
class LBTriangTest : public ::testing::Test {
public:
void SetUp() {
G_ = nullptr;
H_ = nullptr;
}
void TearDown() {
delete G_... | true |
744fcce6ec4a97808227122c3ec5d223cde80d8e | C++ | NidhishKumarReddy/Coding | /LeetCode/Top-Interview-Questions/Best-Time-to-Buy-and-Sell-Stock.cpp | UTF-8 | 436 | 2.953125 | 3 | [] | no_license | class Solution {
public:
int maxProfit(vector<int>& prices) {
int n = prices.size();
int max = INT_MIN;
int profit = 0;
int ans = 0;
for(int i = n-1; i>=0; i--){
if(prices[i] > max){
max = prices[i];
}
profit = max - prices[... | true |
b6bf04a25d890fed3f9e278d785394dbc25841e1 | C++ | LeverImmy/Codes | /比赛/学校/2019-9-13测试/source/PC14_刘子潮/pool.cpp | UTF-8 | 1,132 | 2.53125 | 3 | [] | no_license | #include<cstdio>
inline int read()
{
register int x=0;
register char ch=getchar();
while(ch<'0' || ch>'9')
{
ch=getchar();
}
while(ch>='0' && ch<='9')
{
x=x*10+ch-'0',ch=getchar();
}
return x;
}
const int T=100005,mod=1000000007;
int t,k,l,r;
inline long long int ny(int x)
{
if(x==1)
{
return 1;
}
re... | true |
ebf6a4a00920327a62293d90e07ec1720476880b | C++ | maximborodin/mipt-algorithms-2016-spring | /lcs/main.cpp | UTF-8 | 2,379 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
#include <ctime>
#include "advancedAlgorithm.h"
#include "trivialAlgorithm.h"
void stringsGen (std::string& str1, std::string& str2, unsigned int len1,
unsigned int len2, unsigned int alphabetSize)
{
str1.resize(len1);
... | true |
aed3f6e8c2b5822ed13ba7f5f2129f6dc8a0708a | C++ | Hishmat786/C- | /num.cpp | UTF-8 | 148 | 2.5625 | 3 | [] | no_license | #include<iostream>
using namespace std;
int main()
{
int d,num;
cin>>num;
while(num>0)
{
d=num%10;
num/=10;
cout<<d<<" ";
}
}
| true |
4d865a4f969933a169b4f47dbce39d02e3f0a65d | C++ | chawkinsuf/ImageTL | /src/SOWAIterator.h | UTF-8 | 920 | 2.6875 | 3 | [
"MIT"
] | permissive | #ifndef __SOWAITERATOR_H__
#define __SOWAITERATOR_H__
// Disable warnings about ignoring throws declarations
#pragma warning( disable : 4290 )
#include <numeric>
#include <iterator>
#include <algorithm>
#include <cmath>
#include "Image.h"
#include "ImageException.h"
#include "Template.h"
#include "OWAIte... | true |
a121c2ddc8089f89f6eaff0a8eec5d9622e371ca | C++ | jac08h/Leetcode-Study-Plan | /Data Structure I/DAY1/maximum_Sum_subarray.cpp | UTF-8 | 656 | 3.21875 | 3 | [] | no_license | // Question Link :- https://leetcode.com/problems/maximum-subarray/
#include <bits/stdc++.h>
using namespace std;
int maxSubArray(vector<int> &nums)
{
int ans = nums[0], i, j, sum = 0;
for (i = 0; i < nums.size(); i++)
{
sum += nums[i];
ans = max(sum, ans);
sum = max(sum, 0);
}... | true |
4fd7bf221536e028db13e3b9887cd1dd908468ed | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/88/199.c | UTF-8 | 224 | 2.53125 | 3 | [] | no_license | void main()
{
char a[40];
int i=0;
gets(a);
printf("\n");
while(*(a+i)!='\0')
{
if(*(a+i)>='0'&&*(a+i)<='9') printf("%c",*(a+i));
else if(*(a+i+1)>='0'&&*(a+i+1)<='9') printf("\n");
i++;
}
} | true |
e4e050601c831fcfce255f0bb605786f0582497f | C++ | rahulratheesh/datastructures | /mystack_client.cpp | UTF-8 | 330 | 2.640625 | 3 | [] | no_license | #include "mystack.h"
int main() {
MyStack<string> stack;
stack.push("Rahul");
stack.push("Rakesh");
stack.push("Ramkesh");
cout << stack.isEmpty() << endl;
cout << stack.pop() << endl;
cout << stack.pop() << endl;
cout << stack.pop() << endl;
cout << stack.isEmpty() << endl;
re... | true |
d8ef989c2e5c6faedaffae31db956668bdac530e | C++ | takeuchiwataru/TakeuchiWataru_QMAX | /吉田学園情報ビジネス専門学校 竹内亘/13_ハッカソン冬/開発環境/接待ゴルフ/result.cpp | SHIFT_JIS | 3,048 | 2.53125 | 3 | [] | no_license | //---------------------------------------------------------------------
// Ug [result.cpp]
// Author : Mikiya Meguro
//---------------------------------------------------------------------
#include "result.h"
#include "manager.h"
#include "scene.h"
#include "Logo.h"
//#include "bg.h"
#include "fade.h"
//#include "resu... | true |
ec6d7fefa3bc8ee8f110321e1fa5385103fb9de7 | C++ | 12tg12tg/katanaZERO | /API_FrameWork/camera.h | UHC | 2,460 | 2.6875 | 3 | [] | no_license | #pragma once
#include "singleton.h"
enum class CAMERASTATE
{
FOLLOWPIVOT,
CHANGEPIVOT,
SHAKE
};
struct tagShakeTime
{
int current;
int max;
int cool;
};
enum FADEKIND
{
FADE_IN, FADE_OUT
};
struct tagFadeInfo
{
FADEKIND fadeKind;
bool isStart;
int minus;
int alpha;
};
class camera : public Singleton<c... | true |
eb5fd62df3101e95dbf5dcc3407ea92a37230000 | C++ | shivral/cf | /1000/30/1032b.cpp | UTF-8 | 609 | 3.1875 | 3 | [
"Unlicense"
] | permissive | #include <iostream>
#include <string>
void solve(const std::string& s)
{
const size_t n = s.length();
unsigned r = 1;
while ((n + r - 1) / r > 20)
++r;
const unsigned c = (n + r - 1) / r, k = c * r % n;
std::cout << r << ' ' << c << '\n';
for (size_t i = 0, j = 0; i < r; ++i) {
... | true |
d772e16f765246f6b23068449e7a7f5de31ef03f | C++ | lingjf/h2unit | /source/json/h2_select.cpp | UTF-8 | 2,059 | 2.859375 | 3 | [
"Apache-2.0"
] | permissive | struct h2_json_select {
struct value {
int index;
h2_string key;
};
h2_vector<value> values;
h2_json_select(const char* selector)
{
enum {
st_idle,
st_in_dot,
st_in_bracket
};
int state = 0;
const char *s = nullptr, *p = selector;
do ... | true |
f268b39fce8a810a9a6c320e25181b6b813c0f99 | C++ | benardp/Wickbert | /Particles/nv_pbuffer.cpp | UTF-8 | 7,635 | 2.515625 | 3 | [] | no_license | //only included if WB_USE_CG is 1
#ifdef WB_USE_CG
// make sure glh_ext is only compiled once
#include "nv_pbuffer.h"
#include <iostream>
using namespace std;
#define REQUIRED_EXTENSIONS "WGL_ARB_extensions_string " \
"WGL_ARB_pbuffer " \
"WGL_NV_render_texture_rectangle " \
... | true |
b474070b29c923b967ca5072997d2b6569c8b4ff | C++ | zv/metamage_1 | /base/chars/encoding/utf8.cc | UTF-8 | 2,081 | 3.015625 | 3 | [] | no_license | /*
utf8.cc
-------
*/
#include "encoding/utf8.hh"
namespace chars
{
static inline bool is_continuation_byte( utf8_t c )
{
return (c & 0xC0) == 0x80;
}
void put_code_point_into_utf8( unichar_t uc, unsigned n_bytes, char* p )
{
switch ( n_bytes )
{
default:
case 0:
break;
case 1:
... | true |
2b65861183ed2884d715ae5ba2a87bf96257298f | C++ | creator83/stm8s003 | /cpp/prj/use_spi.cpp | UTF-8 | 918 | 2.515625 | 3 | [] | no_license | #include "stm8s.h"
#include "spi.h"
#include "delay.h"
#include "tact.h"
Tact frq;
Spi spi1 (Spi::div128);
Pin cs (Gpio::C, 4, Gpio::lowSpeed);
void spi_transmitte_byte (uint8_t d)
{
cs.clear();
spi1.transfer (d);
cs.set();
}
int main()
{
cs.set();
while (1){
for (uint8_t i=0;i<8;++i){
spi_transmitte_byte ... | true |
070e7a9df3d58fc51f6a0b5f90a90b35fd3f6d18 | C++ | kicchi/Procon | /AtCoder/others/nanka/A/main.cpp | UTF-8 | 1,307 | 2.671875 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<string>
#include<cstdlib>
#include<sstream>
#include<queue>
#include<deque>
#include<cmath>
#include<algorithm>
#include<stack>
#include<map>
#include<set>
#include<iomanip>
#define INF 2147483647
#define lli long long int
#define MOD 1000000007
using namespace std;
typedef... | true |
cd06ea6c4a316bed5bd35297083aed027b770ca6 | C++ | HONGJICAI/LeetCode | /cpp/977.SquaresofaSortedArray.cpp | UTF-8 | 684 | 3.109375 | 3 | [] | no_license | class Solution { // Runtime: 100 ms, faster than 96.05% of C++ online submissions for Squares of a Sorted Array.
public:
vector<int> sortedSquares(vector<int>& A) {
vector<int> res;
int mid = lower_bound(begin(A), end(A), 0) - begin(A);
for (int r = mid, l = mid - 1; r < A.size() || l >= 0;)... | true |
8e927452172995f9c345763decfcd2615d7e4c9a | C++ | blewert/a3-udp-chair-cancel-axes | /src/pcars/PCarsMemory.cpp | UTF-8 | 1,428 | 2.53125 | 3 | [] | no_license | #include "..\..\include\pcars\PCarsMemory.h"
using namespace PCars;
SharedMemoryClient::SharedMemoryClient(void)
{
}
SharedMemoryClient::~SharedMemoryClient(void)
{
}
void SharedMemoryClient::BlockUntilDetected(bool waitingAnimation)
{
if (!waitingAnimation)
{
while ((this->game = this->GetSharedMemory()) == NU... | true |
9597425a789cfefecdcc75d3e83d24ef7d1120d0 | C++ | rising-stark/Competitive-Questions | /LeetCode/30-Day Challenge/Day16_LongestValidParenthesis.cpp | UTF-8 | 2,356 | 3.6875 | 4 | [] | no_license | /*
https://leetcode.com/explore/challenge/card/30-day-leetcoding-challenge/530/week-3/3301/
Given a string containing only three types of characters: '(', ')' and '*', write a function to check whether this string is valid.
We define the validity of a string by these rules:
Any left parenthesis '(' must have a corres... | true |
bccee18e2bae10a45c295e1673d76a876ea5c870 | C++ | andrefmrocha/MIEIC_18_19_AEDA_PT2 | /src/Company.cpp | UTF-8 | 35,013 | 3.125 | 3 | [
"MIT"
] | permissive | /*
* Created on: 30/10/2018
* Author: joaomartins
*
* Company.cpp
*/
#include "Company.h"
#include <string>
using namespace std;
static unsigned maxRepairs = 4;
Company::Company(double cardValue, Date d)
{
this->cardValue = cardValue;
date=d;
}
void Company::createCourt()
{
// Creates a new Court and sav... | true |
e72e43392884144a87d370d6a2e64353c11f1756 | C++ | afikur/UVA-Solutions | /11934 Magic Formula.cpp | UTF-8 | 397 | 2.8125 | 3 | [] | no_license | /*
Afikur Rahman (afikur)
UVA 11934
Date: 20.02.17
*/
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,L, counter;
while(cin>>a>>b>>c>>d>>L) {
if(!a && !b && !c && !d && !L) break;
counter = 0;
for(int i=0; i<=L; i++) {
if((a*i*i + b*i + c) ... | true |
0b50d316afe58b7f50f9ca12926713b4e9b64443 | C++ | LinusNeuman/tbs | /TBSA/Source/PathFinding/NavGraph/NavHandle.h | UTF-8 | 3,480 | 2.921875 | 3 | [] | no_license | /*
*Author: Hampus Huledal
*Date: 2016-05-13
*/
#pragma once
#include "NavGraph/Graph/NavGraph.h"
class NavEdge;
class NavVertex;
struct EdgeHandle
{
NavHandle myHandle;
EdgeHandle()
{
myHandle = 0;
myGraph = nullptr;
}
EdgeHandle(NavHandle aHandle, NavGraph* aGraph)
{
myHandle = aHandle;
myGraph = ... | true |
e7cd20c12e7af5b5aaa1b34016d4dac21c1ec192 | C++ | seleneal1996/PRACTICA1_CC2 | /Ejercicio3/main.cpp | UTF-8 | 5,203 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <stdlib.h>
using namespace std;
void quickSort(int a[],int primero,int ultimo)
{
int central,pivote,i,j;
//CAPTUTA DE LA POSICION CENTRAL DEL ARREGLO
central=(primero+ultimo)/2;
// CAPTURA DEL VALOR MEDIO DEL ARREGLO
pivote=a[central];
//SIRVE PARA SEPARAR LOS SEGME... | true |
7c191ab7242655a5914b78d3b5f6c76497c22ad4 | C++ | srinivasdasu/leetcode | /Subsets (I & II).cc | UTF-8 | 4,624 | 3.796875 | 4 | [] | no_license | /*
Subsets
http://leetcode.com/onlinejudge#question_78
Given a set of distinct integers, S, return all possible subsets.
Note:
Elements in a subset must be in non-descending order.
The solution set must not contain duplicate subsets.
For example,
If S = [1,2,3], a solution is:
[
[3],
[1],
[2],
[1,2,3],
[1... | true |
c6c26060cf18418d258cca47965cb024443360a6 | C++ | keshavjoshi142/Code-Archive | /DP/ValidParanthesis.cpp | UTF-8 | 829 | 2.6875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
string A;
int dp[100000];
int max1;
int func(int i)
{
if(i <= 0)
return 0;
if(dp[i] == 0)
{
if(A[i] == ')')
{
if(A[i-1] == '(')
dp[i] = 2 + func(i-2);
else
{
//cout << A[i-1] << endl;
int a = func(i-1);
if(i -a -1 >= 0 && A[i - a... | true |
a68fb68352b1d2d089894cef976cec3da41c8be5 | C++ | zalbhathena/Thesis-Test-Application | /HPA* Program/bin/DCDTsrc/gs_heap.h | UTF-8 | 4,832 | 3.328125 | 3 | [] | no_license | /*=======================================================================
Copyright 2010 Marcelo Kallmann. All Rights Reserved.
This software is distributed for noncommercial use only, without
any warranties, and provided that all copies contain the full copyright
notice licence.txt located at the base ... | true |
cc570d59106c61d9686468c489ecc7702d64b7a4 | C++ | kdesai12/Arduino | /PatientDevice/PatientDevice.ino | UTF-8 | 1,637 | 2.5625 | 3 | [] | no_license | #include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>
#include <RF24Network.h>
RF24 radio(9,10);
// Network uses that radio
RF24Network network(radio);
// Address of our node
const uint16_t this_node = 1;
// Address of the other node
const uint16_t other_node = 0;
const uint64_t pipe1... | true |
faef83464421342aa73575ce597a8aea4ce4f409 | C++ | maximejotterand/cppcourse-brunel | /src/Neurone_unittest.cpp | UTF-8 | 1,691 | 2.78125 | 3 | [] | no_license | #include "neurone.hpp"
#include "network.hpp"
#include "gtest/gtest.h"
#include <iostream>
#include <cmath>
#include "Constant.hpp"
namespace {
TEST(NeuroneTest, Pos_input)
{
Neurone n;
n.setCourant(1.0);
//First update
n.update(0.1, false);
EXPECT_EQ((c1 * 0.0) + (1.0 * R * c2), n.getPot());
//After several... | true |
bd411b13a14d9508a8080a3bb0c476b88e1ad4ae | C++ | psykano/Tag | /src/game/ClientEventSystem.cpp | UTF-8 | 1,603 | 2.71875 | 3 | [] | no_license | #include "ClientEventSystem.h"
void ClientEventSystem::step(float dt) {
for (std::vector<float>::iterator it = dtsSinceLastReceivedMovementInputEvent.begin(); it != dtsSinceLastReceivedMovementInputEvent.end(); ++it) {
*it += dt;
}
for (std::map<unsigned int, float>::iterator it = dtsSinceLastMovementInputEvent.... | true |
b145169a69a834226edda5acb2a51c7762de83d6 | C++ | firoorg/firo | /src/elysium/test/strtoint64_tests.cpp | UTF-8 | 2,978 | 2.921875 | 3 | [
"MIT"
] | permissive | #include "elysium/parse_string.h"
#include "test/test_bitcoin.h"
#include <boost/test/unit_test.hpp>
#include <stdint.h>
#include <string>
using namespace elysium;
BOOST_FIXTURE_TEST_SUITE(elysium_strtoint64_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(strtoint64_invidisible)
{
// zero amount
BOOST_CHEC... | true |
75e1dbf15dc0e5961677e5142d61cc775526dd27 | C++ | patrick1973/hs1-opgave-uitwerkingen | /ArduinoCodePrakticumEE21_opdracht2a/ArduinoCodePrakticumEE21_opdracht2a.ino | UTF-8 | 761 | 2.953125 | 3 | [] | no_license | #include <Bounce2.h>
const int BUTTON_PIN = 2;
const int LED_PIN = 3;
int ledState = LOW;
// Instantiate a Bounce object
Bounce debouncer = Bounce();
void setup()
{
// Setup the button
pinMode(BUTTON_PIN,INPUT);
digitalWrite(BUTTON_PIN,HIGH);
// After setting up the button, setup Bounce object
debounc... | true |
4fe57e628e860ecd4294ccd2494ae1821fc93683 | C++ | mrdylan123/ReSharperPresentatie | /ResharperPresentatie/ResharperFuncties.h | UTF-8 | 588 | 2.625 | 3 | [] | no_license | #pragma once
#include <string>
// Use different include and unused
#include <math.h>
class ResharperFuncties // Non-default destructor
{
public:
ResharperFuncties();
~ResharperFuncties();
int getX(); // Member function may be 'const' in source file
void includeString();
static void variableNotInitialized();
v... | true |
72a57909b9b7deefa56df69fd9de436f25335642 | C++ | JaechanAn/algorithm-study | /Jinaria/three problem per day/2020.1/2020.1.3/2850.cpp | UTF-8 | 805 | 2.546875 | 3 | [] | no_license | #include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
int N;
long long M;
scanf("%d %lld", &N, &M);
vector<long long> tree(N);
for (int i = 0; i < N; ++i)
scanf("%lld", &tree[i]);
long long left = 0;
long long right = 0x7fffffffffffffff;
lo... | true |
10c924661142b437e42a7ccaa576dc52d958cd68 | C++ | speedhunter001/cpp | /oop-quiz-1.cpp | UTF-8 | 2,083 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <cassert>
using namespace std;
int fun1(string s,int pos){
string x;
if (pos<0)
return 0;
int digit;
x=s[pos];
digit=stoi(x);
return digit;
}
string fun2(string s1,string s2){
int d1,d2,maximum,sum;
int carry=0;
string sum_string,sum_string_in_tens,out_string;
if ( s2.length... | true |
01c8f71de5fb13c03de869ac6ee82154ff00cfa4 | C++ | lukemonaghan/YR01_03_Refactor_BitwiseConversion | /Conversion/Conversion.cpp | UTF-8 | 13,382 | 3.015625 | 3 | [] | no_license | //Luke Monaghan - 11/05/2013 - Base 2,10,16 conversion
#include "stdafx.h"
#include "Convert.h"
#include <string.h>
#include <iostream>
#include <climits>
#include <time.h>
#define MAXBITS 32
using namespace std;
bool running = true;
char buffer[48] = {'h','e','l','p'};
Converter ConManager;
void getinput(){
////... | true |
c863fa72b3df67feb98032a1a5ce1ff0cc9b7e10 | C++ | Taoaoxiang/PracticeLeetCode | /Problems/0KXXX/0K1XX/0K11X/No_119_Pascals-Triangle-II.cpp | UTF-8 | 1,705 | 3.71875 | 4 | [] | no_license | //Given a non-negative index k where k ≤ 33, return the kth index row of the Pascal's triangle.
//
//Note that the row index starts from 0.
//
//
//In Pascal's triangle, each number is the sum of the two numbers directly above it.
//
//Example:
//
//Input: 3
//Output: [1,3,3,1]
//
//Follow up:
//
//Could you optimize ... | true |
6abaa7559f607c0623f4d92b95af56aa76d3b090 | C++ | TobeyChao/CPlusPlus_Primer_Learn | /Sort/Main.cpp | UTF-8 | 306 | 3.078125 | 3 | [] | no_license | #include "Sort.h"
#include <vector>
#include <iostream>
int main(int argc, char* argv[])
{
std::vector<int> nums{ 20, 35, 44, 29, 29, 56, 45, 74, 32, 51, 64, 57, 11, 2 };
Sort sort;
sort.CountingSort(nums);
for (auto element : nums)
{
std::cout << element << " ";
}
system("pause");
return 0;
} | true |
67f469de923da39f6614f63784b7cbedbc8750f3 | C++ | PabloHorno/Riego-Autonomo | /RiegoAutonomo/chrono.h | UTF-8 | 502 | 3.1875 | 3 | [] | no_license | #pragma once
class chrono {
public:
chrono() {}
unsigned long resultado;
void start()
{
if(time == 0)
time = millis();
}
unsigned long getTime()
{
return millis() - time;
}
void end()
{
resultado = millis() - time;
time = 0;
}
void delay(unsigned long time, void (*callback_func)()) {
this->sta... | true |
154907051c754a29725be1a5923e13c60a442d7a | C++ | Monster88Ra/RayTracer | /trunk/RayTracer/RayTracer/src/Triangle.cpp | UTF-8 | 3,540 | 2.78125 | 3 | [
"MIT"
] | permissive | #include "Triangle.h"
#include "Intersection.h"
Triangle::Triangle():
Object(),
m_V0(),
m_V1(),
m_V2(),
m_Normal(),
m_UV0(),
m_UV1(),
m_UV2()
{
}
Triangle::Triangle(Vector3f v0, Vector3f v1, Vector3f v2, const Material & lightingMaterial):
Object(lightingMaterial),
m_V0(v0),
m_V1(v1),
... | true |
4b5da1e5b795ead7ec3abe10f701ad4abeba58d2 | C++ | ForyMurguia/2048 | /2048/RandomTreeNode.cpp | UTF-8 | 4,504 | 3.390625 | 3 | [] | no_license | #include "RandomTreeNode.h"
RandomTreeNode::RandomTreeNode()
{
}
RandomTreeNode::~RandomTreeNode()
{
for (auto child : myChildren) {
if (child)
delete child;
}
}
double RandomTreeNode::getFitness() {
return myFitness;
}
void RandomTreeNode::initPlayerNode(GameState & gameState, RandomTreeNode *parent) {
my... | true |
16286ea352642df7d045835afec461a83aa8ce09 | C++ | pizixuan/Experiments | /Data Structure/Experiment_08/Test_03.cpp | UTF-8 | 3,507 | 3.84375 | 4 | [] | no_license | /*
假设二叉树采用二叉链存储结构存储,编写一个程序实现以下功能:
(a)求二叉树b的节点个数并输出;
(b)求二叉树b的叶子节点个数并输出;
(c)求二叉树b的宽度;
二叉树为:N(a(n,C(h(H,g))),K(o(,U(I,v)),e(r(s,i),t(y))))
*/
#include <stdio.h>
#include <malloc.h>
#define MAXSIZE 20
typedef char ElemType;
typedef struct node{
ElemType data;
stru... | true |
d52e6505f851d8215dc952f5d75481190e471190 | C++ | guptaprakhariitr/File_Server | /include/Request.hpp | UTF-8 | 1,983 | 2.515625 | 3 | [] | no_license | #pragma once
#include "../include/Client.hpp"
#include<string>
#include <poll.h>
#define COMPLETED 1
#define ONGOING 0
class Request
{
private:
Client client; // for storing the address of the cleint
char buffer[BUFSIZ] = "\0"; // for receiving ftp request and file data
const char *... | true |
8a9d7c0f48807cf53acc70e01e158dce4b788262 | C++ | Thecarisma/serenity | /Kernel/Lock.h | UTF-8 | 1,539 | 2.765625 | 3 | [
"BSD-2-Clause"
] | permissive | #pragma once
#include <AK/Assertions.h>
#include <AK/Types.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/KSyms.h>
#include <Kernel/Scheduler.h>
class Thread;
extern Thread* current;
static inline u32 CAS(volatile u32* mem, u32 newval, u32 oldval)
{
u32 ret;
asm volatile(
"cmpxchgl %2, %1"
... | true |
31bb7a6c0c1f6ce32939da5de3fc9bd4bea8b411 | C++ | 1ridescent/ACM | /annual/CJ14/A.cpp | UTF-8 | 687 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <set>
#include <cstring>
using namespace std;
int N, X;
set< pair<int, int> > S;
int main2()
{
S.clear();
cin >> N >> X;
for(int i = 0; i < N; i++)
{
int x;
cin >> x;
S.insert( make_pair(x, i) );
}
int cnt = 0;
while(!S.empty())
{
set< pair<int, int> >::iterator first = S... | true |
87358ee7d3da3e456a0b6248928c4030dfb2666a | C++ | shu-man-ski/OOP-Labs | /Lab-3/Lab-3/SemipreciousStone.cpp | WINDOWS-1251 | 926 | 3.34375 | 3 | [] | no_license | #include <iostream>
#include "Stone.h"
using namespace std;
Stone::SemipreciousStone::SemipreciousStone()
{
cout << "\t\t|| ||" << endl;
price = 0;
stone = new Stone;
}
Stone::SemipreciousStone::~SemipreciousStone()
{
cout << "\t\t|| ||" << endl;
delete stone;
}
void Stone::SemipreciousStone::setWeightSem... | true |
d2543d217f9dcd32ae43de6b0be124fe9dfdb67b | C++ | dleliuhin/cservice_template | /src/pack/pack.h | UTF-8 | 1,493 | 2.53125 | 3 | [
"DOC"
] | permissive | /*! \file pack.h
* \brief Data package from multiple sensors.
*
* \authors Dmitrii Leliuhin
* \date July 2020
*/
//=======================================================================================
#pragma once
#include "defs.h"
//===========================================================================... | true |
3ab141b66b5e690447ab476be0dfc44818151992 | C++ | walkdis/-1 | /DoNotEx.cpp | UTF-8 | 270 | 2.53125 | 3 | [] | no_license | // Copyright 2015 <Anna Simakova>
#include "DoNotEx.h"
#include <string>
EmployeeDoNotExist::EmployeeDoNotExist(const string& name) :exception() {
msg = "Sotr: " + name + " do not exist";
}
const char * EmployeeDoNotExist::what() const throw() {
return msg.c_str();
}
| true |
062f46cec1d6d891fdf1fa39f52792368d766a59 | C++ | ZixinLiu/leetcode | /113.path-sum-ii.cpp | UTF-8 | 1,210 | 3.46875 | 3 | [] | no_license | /**
* Definition for a binary tree node.
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
public:
void pathSumHelp(TreeNode * root, int sum, int current, vector<int> v, vector<vector... | true |
207dbcb1ee5bda2552f5870224bb0683b16f8835 | C++ | RaissaVieira/Atividades-LP1 | /roteiro2-LP1/Questao3/Funcionario.h | UTF-8 | 346 | 2.53125 | 3 | [] | no_license | #ifndef FUNCIONARIO_H
#define FUNCIONARIO_H
#include <string>
class Funcionario
{
protected:
std::string nome;
int matricula;
public:
Funcionario(/* args */);
void getNome(std::string nome);
std::string setNome();
void getMatricula(int matricula);
int setMatricula();
virtual double ca... | true |
19f8ad38f2b04ccd76ef323258e8cde9fadb7cf9 | C++ | yyqian/cpp-arsenal | /src/unp/byte_order.cpp | UTF-8 | 286 | 2.859375 | 3 | [
"MIT"
] | permissive | #include <stdio.h>
int little_endian(){
int x = 1;
return *(char*)&x;
}
int big_endian(){
return !little_endian();
}
int main(){
if(big_endian())
printf("big_endian\n");
if(little_endian())
printf("little_endian\n");
return 0;
} | true |
57b436e686ab86716d2eb307b6e9052704a2c14a | C++ | nourtcs369/g33k | /ArduinoProjects/2014/HariTetris/_14_ImprovedCollisionDetection/_14_ImprovedCollisionDetection.ino | UTF-8 | 11,323 | 3 | 3 | [] | no_license |
// Arduino Tetris
// by Hari Wiguna, 2014
// If this project inspires you, please post me a comment on github, youtube (hwiguna), or on g33k.blogspot.com
// I'd love to see your version.
// v0.14 - Need to distinguish collisions. ie: collision with side walls should STILL make it fall down.
// If we move the piec... | true |
bfbc8ac37e2c4553e715265d3e113b4f28646508 | C++ | jswilder/squealing-prune | /lab8/WordHash.h | UTF-8 | 1,692 | 3.515625 | 4 | [] | no_license | // Jeremy Wilder
// Lab 8
#ifndef WORDHASH_H
#define WORDHASH_H
#include <string>
#include <iostream>
#include <fstream>
using namespace std;
class WordHash{
public:
string words[103];
int count[103];
int size;
WordHash(int s);
void addWord(string word);
string findCommon();
};
W... | true |
533c396788977d2d8c623360db18837bb80bcf71 | C++ | stephenlombardi/icggame | /src/ActorModel.cpp | UTF-8 | 4,007 | 2.671875 | 3 | [] | no_license | #include "ActorModel.h"
//ActorModel::ActorModel( ) : currentWeapon( 0 ) { }
//ActorModel::ActorModel( const std::string & _name, float _mass, float _boundingRadius, float _speed ) : name( _name ), position( vec3f( 0.0f ) ), velocity( vec3f( 0.0f ) ), orientation( Vector3( 1.0f, 0.0f, 0.0f ) ), force( vec3f( 0.0f ) ),... | true |
3a89d729c5943feef8cfe963b6e3ec2ee6058f78 | C++ | siddharthkhabia/c-file | /edit distance.cpp | UTF-8 | 1,273 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int min(int a,int b,int c)
{
if(a<=b && a<=c)
{
return a;
}
else if (b<=a && b<=c)
{
return... | true |
71e382ee7116467d23fe465704125b5bda68d01d | C++ | phubbard67/mathing_around | /main.cpp | UTF-8 | 656 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "powerOfTwo.h"
#include "graph.h"
int main(int argc, char *argv[])
{
//computeTwoToTheN();
struct Graph* graph;
int shortestPathDist;
graph = createGraph();
printf("The Graph, where 1 is blocked, and 0 is clear");
printGraph(graph);
//no n... | true |
22c9388aabe355c9055f602f07e269784613f999 | C++ | mateka/pmizer | /pmizer_cmd/pmizer_app.cpp | UTF-8 | 2,779 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "pmizer_app.h"
#include <iostream>
#include <pmize/image.h>
#include <pmize/to_sphere_map.h>
#include <xmp/meta_engine.h>
namespace pmizer {
pmizer_app::pmizer_app()
: m_options{ "Pmizer\t-App for converting cubemaps to panoramic photos" }
{
namespace po = ::boost::program_options;
m_options.add_option... | true |
d45a03cb19769a52981e3c5d175d5afd1822369e | C++ | matbut/Algorithms-And-Data-Structures | /0-Simple-Algorithms/3-Recursion/3.16-Skoki-po-tablicy.cpp | UTF-8 | 810 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include <cstdlib>
#include <ctime>
#include <windows.h>
using namespace std;
const int MAX=10;
void generuj(int tab[]){
srand(time(0));
for(int i=0;i<MAX;i++){
tab[i]=rand()%8+2;
cout << tab[i] << " ";
}
cout << endl;
}
bool skoki(int i,int tab[],int &droga){
c... | true |
f6d23da3f8a5f2ceb1c3ca206a739a08547815e5 | C++ | arunansu/Algorithms | /CPP/GraphDirectedAcyclicity.cpp | UTF-8 | 883 | 3.484375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using std::vector;
using std::pair;
bool isCyclic(vector<vector<int>> &adj, int v, vector<bool> &visited)
{
if (visited[v])
{
return true;
}
else
{
visited[v] = true;
for (size_t i = 0; i < adj[v].size(); ++i)
{
if (visited[adj[v][i]])
{
return true;
}
... | true |
067c548ff6bc87b1c8f4cccfc04a4a22e599c937 | C++ | hornehm/HW02 | /src/HW02App.cpp | UTF-8 | 4,436 | 3.234375 | 3 | [] | no_license | /**
*
*CSE 274 B
*@author Heather Horne
*
*This assignment satisfies A, B, D, and E for Homework #2. I realize this
*is all in one .cpp file, but I had a hard time putting each class in their
*separate .cpp and .h files.
*
*I've used the reverse method from Dr. Brinkman's CSE 274 Class
*
**/
#i... | true |
93e7e19f5b46f34ed0fcadacd4ae189ade2ab759 | C++ | designgreenhouse/arduino | /Blink_LED_w_tempsensor_001/Blink_LED_w_tempsensor_001.ino | UTF-8 | 2,329 | 2.9375 | 3 | [
"CC0-1.0"
] | permissive | /* experiment för att testa och lära hur man läser analog och digital input, samt sätter en digital utgång
och skriver ut ett analogt värde. Kopplar till github
komponenter
* Arduino R3
* tinkerkit sensorshield
* tinkerkit LED
* tinkerkit pushbutton
* tinkerkit temperatur sensor
Lars Lindmark, Design Greenhouse 20... | true |
4c2c59135ed1486b1bd65ab8497b5ebe5a9a2aa8 | C++ | matteo1994/CUDA_ChromaKey_Advanced | /Utility.cpp | UTF-8 | 4,722 | 2.78125 | 3 | [] | no_license | #include <stdio.h>
#include <math.h>
#include "Utility.h"
#include <iostream>
const double pi() { return acos(-1); }
float ColorRGB::RGBtoYf(ColorYCbCr* cY) {
float tmp, tmp1, tmp2;
cY->Y = 0.257*this->r + 0.504*this->g + 0.098*this->b;
tmp1 = -0.148*this->r - 0.291*this->g + 0.439*this->b;
tmp2 =... | true |
7cd68e71c9ace10b7c019913da242a5cd2baa65b | C++ | Kulpreet-Singh/Competitive-Programming-Practice | /zscaler practice/docquity.cpp | UTF-8 | 902 | 2.875 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
int reduce(int input1, int input2[])
{
vector<pair<int, int>> mp;
for(int i=0;i<input1;i++){
mp.push_back(make_pair(input2[i],i+1));
}
int n= input1;
int max=0;
sort(mp.begin(),mp.end());
for(int i=0;i<n-1;i++)... | true |
8cde7015214f9f933f06bf0b6105062a918735a4 | C++ | syvjohan/cppFun | /TicTacToe2/TicTacToe2/ConsoleView.cpp | UTF-8 | 2,659 | 3.265625 | 3 | [] | no_license | #include "Defs.h"
#include "ConsoleView.h"
#include "GameBoard.h"
#include <iostream>
#include <string>
using namespace std;
ConsoleView::ConsoleView() {
}
ConsoleView::~ConsoleView() {
}
void ConsoleView::HandleInput() {
model->SetState(GS_MAINMENU);
do {
int choice = -1;
cin >> choice;
if (model->Valid... | true |
ec86e99d23757668a90b03c9aaf55a17babecfe8 | C++ | ricbit/Oldies | /2012-02-spojlib/chinese_test.cc | UTF-8 | 366 | 3 | 3 | [] | no_license | #include "gtest/gtest.h"
#include "chinese.h"
TEST(ChineseRemainderTest, Eval) {
int mods[4] = {3, 5, 7, 13};
int rems[4] = {1, 2, 3, 4};
ChineseRemainder<int> crt(std::vector<int>(mods, mods + 4));
int ans = crt.eval(std::vector<int>(rems, rems + 4));
EXPECT_EQ(1, ans % 3);
EXPECT_EQ(2, ans % 5);
EXPECT... | true |
482749c807df332cde61d016b6211176c15b1d93 | C++ | AndreasArvidsson/WinDSP | /lib/DSP/src/SineSweepGenerator.cpp | UTF-8 | 1,219 | 2.859375 | 3 | [
"MIT"
] | permissive | #include "SineSweepGenerator.h"
#define _USE_MATH_DEFINES
#include "math.h" //M_PI
#include "Convert.h"
SineSweepGenerator::SineSweepGenerator(const size_t sampleRate, const double frequencyStart, const double frequencyEnd, const double duration, const double gain) {
_sampleRate = sampleRate;
_frequencyStart =... | true |