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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
6a6105c15080957eaf42e656b9f574e8072fbf39 | C++ | droneboost/scratch_rover | /driver/src/ds1339.cpp | UTF-8 | 5,098 | 3.078125 | 3 | [] | no_license | /*
DS1339 driver.
*/
#include <stdio.h>
#include <unistd.h>
#include "ds1339.h"
using namespace BH;
const char *DS1339::week_days[] = {"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"};
DS1339::DS1339(uint8_t device_address)
: dev_address(device_address)
{
}
DS1339::~DS1339()
{
}
bool DS1339::init()
{
return true;
... | true |
f0adec62cee36b1c16166687967d3a9aca62f19c | C++ | JerryZhou/Raccoon | /framework/src/app/kernel/dwinterlocked.h | UTF-8 | 1,653 | 2.71875 | 3 | [] | no_license | #pragma once
#include <intrin.h>
class DW_APP_EXPORT DwInterlocked
{
public:
/// interlocked increment, return result
static int increment(int volatile& var);
/// interlocked decrement, return result
static int decrement(int volatile& var);
/// interlocked add
static int add(int volatile& var, ... | true |
9d09d2e1c4869b4a8d79b6d7ea61aefbaed7d062 | C++ | William-f-12/heima-CPP-2021-8-7 | /29 C++常用查找算法/count_if.cpp | GB18030 | 527 | 3.5625 | 4 | [] | no_license | #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
// - count_if(ʼν)
class GreaterFive
{
public:
bool operator()(int val)
{
return val > 5;
}
};
void test06()
{
vector<int> v;
for (int i = 0; i < 10; i++)
{
v.push_back(i);
}
int num = count_if(v.begin(), v.end(), GreaterFive())... | true |
54f9f1e19665a137e8268090a42bc5096a321fdc | C++ | HayimShaul/HElib_MatrixOperations | /Matrices.cpp | UTF-8 | 29,478 | 3.265625 | 3 | [] | no_license | #include "Matrices.h"
ostringstream MatricesSizesNotMatch::cnvt;
/* ----- some helping functions ------ */
long myModulu(long num, long mod)
//the regular modulo operator on minus numbers make trouble when trying to calculate enteries in the diagonal matrices.
//for example, -7%3=-1, but I want it to be 2 (-7+3=-4, -... | true |
51872619713b7b4ec66021aba89e48f82f7fdd2b | C++ | libhet/bulk | /src/Bulk_CommandReader.cpp | UTF-8 | 2,321 | 2.890625 | 3 | [] | no_license | #include "Bulk_CommandReader.h"
//const std::string CommandReader::EmptyLine = "";
command_t CommandReader::ReadCommand() {
command_t cmd;
if(IsFirstCommand()) { GetFirstCommandTime(); }
std::getline(m_input, cmd);
return cmd;
}
commands_block_t CommandReader::ReadCommandsBlock() {
if(IsDynamic()... | true |
984893aebb596ea74e8d3e79093f09c177d50827 | C++ | scoiatael/ThingsIdidAtII | /AISD/template.cpp | UTF-8 | 2,111 | 3.34375 | 3 | [] | no_license | /********************
* Lukasz Czaplinski*
* 247926 *
* RNO *
* ******************/
#include <iostream>
#include <vector>
#ifdef SPRAWDZACZKA
#define NDEBUG
#define assert_msg(X, Y) {}
#endif
#ifndef SPRAWDZACZKA
#define assert_msg(X,Y) { if(!X) { Y; } }
#endif
#include <cassert>
#include ... | true |
83d77f3a0bd35abe08c0a69494f3b1e6de681cb9 | C++ | ethz-asl/refill | /src/examples/kalman_filter_example.cc | UTF-8 | 3,741 | 3.140625 | 3 | [
"MIT"
] | permissive | #include <Eigen/Dense>
#include <iostream>
#include "refill/distributions/gaussian_distribution.h"
#include "refill/filters/extended_kalman_filter.h"
#include "refill/measurement_models/linear_measurement_model.h"
#include "refill/system_models/linear_system_model.h"
/*
* This is an example program for using Refill... | true |
b967e1d639329ea921a823e813805420cb84ba96 | C++ | Corillian/dotnetnative | /DotNetNative/System/CharUnicodeInfo.h | UTF-8 | 1,557 | 2.609375 | 3 | [
"MIT"
] | permissive | #ifndef _DOTNETNATIVE_SYSTEM_CHARUNICODEINFO_H_
#define _DOTNETNATIVE_SYSTEM_CHARUNICODEINFO_H_
#include "UnicodeCategory.h"
#include "Char.h"
namespace DotNetNative
{
namespace System
{
class String;
class CharUnicodeInfo
{
public:
static constexpr utf16char HIGH_... | true |
0ddf2af1a884ba82060e254285e477c6f652ccb7 | C++ | nileshjchoudhary/indus | /src/orderparameters/ProbeVolume_Box.h | UTF-8 | 2,830 | 2.90625 | 3 | [
"MIT"
] | permissive | /* ProbeVolume_Box.h
*
* ABOUT:
* - Currently only supports orthorhombic boxes
*
* DEVELOPMENT:
*/
#pragma once
#ifndef PROBE_VOLUME_BOX_H
#define PROBE_VOLUME_BOX_H
// Standard headers
#include <map>
// Core headers
#include "ProbeVolume.h" // Parent class
#include "GenericFactory.h" // Register as a Pr... | true |
c23da328c0967f2f7a27d24d36bec5f1539d97cf | C++ | ReU1107/Project1 | /Project1/Project1/Source/Engine/AnimationSystem/Motion/Motion.h | SHIFT_JIS | 919 | 2.609375 | 3 | [] | no_license | #pragma once
#include "../../Utility/AccessObject.h"
#include <memory>
namespace Engine
{
namespace AnimationSystem
{
// O錾
class Avatar;
class AvatarMask;
// [VNX
class Motion : public AccessObject<Motion>
{
private:
using base = AccessObject<Motion>;
protected:
using AvatarPtr = std::shared_... | true |
a7636aa0dffe879414ce46555705fd8f1012ef1e | C++ | mletic/EmbeddedComputerSystems | /ARDUINO/Blink4/Blink4_ver1.ino | UTF-8 | 2,769 | 3.40625 | 3 | [
"MIT"
] | permissive | /*
Blink 4
Turns on/off LED according to SW position.
Reveals logic behind Arduino digitalRead function
Napisi svoju digitalWrite i pinModeOut funkciju
*/
#define dump(v) Serial.print(v)
//************************************************************************
int digitalRead1(uint8_t pin)
{
volatile p3... | true |
0f8cbe5eb087c1827e33d770a8b40684374ff865 | C++ | sachinsngh165/Competitive-Programing | /codechef/CHFNFRNv7.cpp | UTF-8 | 2,675 | 3.078125 | 3 | [] | no_license | //
// CHFNFRNv7.cpp
//
//
// Created by SACHIN SINGH on 08/09/16.
//
//
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
class Graph
{
int v,*color,*visited;
list <int> *adj;
public:
void addEdge(int,int);
Graph(int);
bool isBipartite();
};
void Graph... | true |
92a5a0efa6dd4e5a3836eab5b023fb14ef5acfa9 | C++ | IvanKosh/ShortestRepetition | /main.cpp | UTF-8 | 809 | 2.96875 | 3 | [] | no_license | /*
* File: main.cpp
* Author: bat
*
* Created on 17 Сентябрь 2015 г., 18:45
*/
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char *argv[]) {
ifstream stream(argv[1]);
string line, temp;
short i, l, j;
bool test;
while (getline(stream, line)) {
test ... | true |
c157bfbd6227e84397d2c2a94b9f5864b5b181c8 | C++ | venky1014/gbash | /echo.cpp | UTF-8 | 2,125 | 2.953125 | 3 | [] | no_license | #include "command.h"
#include "globals.h"
#include <QString>
#include <QDir>
#include <QFile>
#include <QTextStream>
#include <QCommandLineParser>
using namespace std;
echo::echo(QString cmd){
QTextStream out (stdout);
QString output;
if(cmd.contains(">>")){
int index = cmd.indexOf(">>");
... | true |
507b98a7a94566189daad11f2f6d583e245cf11c | C++ | TheGrimsey/NovusCore-AuthMaster | /server/Networking/MessageHandler.cpp | UTF-8 | 472 | 2.546875 | 3 | [
"MIT"
] | permissive | #include "MessageHandler.h"
#include "../ECS/Components/ConnectionComponent.h"
MessageHandler::MessageHandler()
{
for (i32 i = 0; i < Opcode::OPCODE_MAX_COUNT; i++)
{
handlers[i] = nullptr;
}
}
void MessageHandler::SetMessageHandler(Opcode opcode, MessageHandlerFn func)
{
handlers[opcode] = fu... | true |
1887dea93bf81c050dba06b68e11dbeffeb19449 | C++ | wanghuqiang123/C-primertest | /test13-28.cpp | GB18030 | 1,266 | 3.390625 | 3 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
class TreeNode
{
private:
string value;
int count;
TreeNode * left;
TreeNode * right;
public:
TreeNode() :value(""),count(1),left(nullptr), right(nullptr) { }
TreeNode(const string& s = string(),TreeNode* lchild = nullptr,TreeNode* rchild = nullptr) :
va... | true |
5183f9bae2c94b7765b34556fd31d112798dfeca | C++ | MarvinZZJ/WangDaoAlgorithmNotes | /第4章:字符串/4.2:字符串处理/test4-5后缀字符串排序.cpp | UTF-8 | 583 | 3.171875 | 3 | [] | no_license | /*
习题4.5 后缀字符串排序(上海交通大学复试上机题)
https://www.nowcoder.com/questionTerminal/f89f96ea3145418b8e6c3eb75773f65a
*/
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
using namespace std;
int main(){
string str;
while(cin >> str){
string strs[str.size()];
for(int i = 0; i <... | true |
dd448b94c3b9a57110b018bd1c2e31d8f1d245cc | C++ | nathanbeckmann/OPEC | /opec.hpp | UTF-8 | 1,523 | 3.015625 | 3 | [] | no_license | #pragma once
#include <algorithm>
#include "country.hpp"
namespace opec {
class Opec {
public:
enum Countries {
SaudiArabia,
Iran,
Iraq,
Kuwait,
UAE,
Venezuela,
Nigeria,
NumCountries
};
Countr... | true |
65602ece2031e135288bad14bd959b2ab59b5bad | C++ | fabsgc/Terminale-S-Zombie | /source-code/object_bonus.cpp | ISO-8859-1 | 2,943 | 3.1875 | 3 | [] | no_license | #include "object_bonus.hpp"
sf::Image m_imageObjectBonus;
/**
* constructeur
* @access public
* @return void
*/
Object_Bonus::Object_Bonus()
{
if (!m_imageObjectBonus.LoadFromFile(SPRITE_BONUS)) // Si le chargement du fichier a chou
{
std::cout<<"[ERREUR] : [Objec... | true |
6452c4ab304ec6a7c7555e52faccff2bc379202d | C++ | cosmicray001/academic | /problem_solving/LightOJ/1043/14534951_AC_0ms_1700kB.cpp | UTF-8 | 811 | 2.640625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
double ab, ac, bc, abc, def, rto;
double fnc(double a, double b, double c){
double s = (a + b + c) / 2.0;
return sqrt(s * (s - a) * (s - b) * (s - c));
}
double ok(double ad){
double de = (ad * bc) / ab;
double ae = (ad * ac) / ab;
def = fnc(ad, de, ae);... | true |
80e3523bc5a0f8c05acedc86a0f110d5fb210158 | C++ | VilimRoller/Roman-Chess | /RomanChess/RomanChess/Eques.h | UTF-8 | 417 | 2.625 | 3 | [
"MIT"
] | permissive | #pragma once
#include "Figure.h"
class Eques :
public Figure
{
public:
Eques(figureColour figure_colour = figureColour::Red,
BoardCoordinates initial_position = BoardCoordinates{ 0,0 },
int figure_number = 0) {
InitializeFigure(figure_colour, figureType::Eques, initial_position, figure_number);
}
void Se... | true |
732734370ff47a3b4eb432ac00cf9f1d9fb1ca8b | C++ | nur-alam/Problem-Solving | /Uva/3n+1/onlycycle.cpp | UTF-8 | 361 | 2.75 | 3 | [] | no_license | #include<cstdio>
int cycle(int m){
int i=1;
while(1){
printf("%d ",m);
if(m==1){
break;
}
if(m%2==0){
m=m/2;
}
else{
m=3*m+1;
}
i++;
}
return i;
}
int main(){
int m;
scanf("%d",&m);
int max=cycle(m);... | true |
dbcf6a780184f34a8a14c2e9199adbb54e42ea79 | C++ | AlexIsHappy/CodeForces | /cf6A.cpp | UTF-8 | 1,155 | 2.84375 | 3 | [] | no_license | #include <algorithm>
#include <iomanip>
#include <istream>
#include <map>
#include <numeric>
#include <ostream>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>
using namespace std;
// Powered by caide (code generator, tester, and library code inliner)
class Solution {
public:
... | true |
c79dbbbef0af6d06ccacc8afcf96946ff29879f6 | C++ | mviseu/Cpp_primer | /Chapter15/15_36.cc | UTF-8 | 699 | 3.03125 | 3 | [] | no_license | #include "Query.h"
#include "TextQuery.h"
#include "QueryResult.h"
#include <fstream>
#include <iostream>
int main() {
std::ifstream file("input_text.txt");
TextQuery text(file);
Query q = Query("fiery") & Query("bird") | Query("wind");
//print(std::cout, q.eval(text));
//q.eval(text);
std::cout << q;
return ... | true |
8cf12f26c0617bedd9e69a0f1b4ed9f3d5d56402 | C++ | daidodo/dell-virtual-machine | /BuildCmdLine.h | UTF-8 | 5,692 | 2.625 | 3 | [] | no_license | #ifndef BUILDCMDLINE_H
#define BUILDCMDLINE_H
#include <string>
#include <vector>
#include <iostream>
namespace DoZerg{
#ifdef VM_DBG_BLDCMDLINE
#define VM_DBG_BLDCMDLINE0(str) std::cout<<"BuildCmdLine::HandleArguments(): "<<str;
#define VM_DBG_BLDCMDLINE1(str,arg1) std::cout<<"BuildCmdLine::HandleArgum... | true |
e0b34340561d5ea5a612ed9de2eb2bf665e2239a | C++ | RR294/Study | /coding_problems/max_rect_frm_bin_mtx.cpp | UTF-8 | 2,615 | 3.8125 | 4 | [] | no_license | // Program to find max rectangle from binary matrix formed by 1.
#include <iostream>
// 1 0 1 1 0
// 0 1 1 0 1
// 1 1 1 0 1
// 1 1 1 0 0
// 0 1 1 1 1
// In above matrix , rectangle with mix 1 will be eight 1's.
// Time complexity : O(rows * cols)
// Space complexity : number of columns => O(cols)
// to optimise spa... | true |
1bfbb0317df7b494d5b0fc9dadf0780366054c85 | C++ | bahareh-farhadi/C-Projects | /OneDrive/Desktop/Online Courses/C++ Projects/Online Orders Management System/Online Orders Management System/product.h | UTF-8 | 389 | 2.828125 | 3 | [] | no_license | #pragma once
#include <string>
#include <iostream>
using namespace std;
class product
{
protected:
int id;
string name, seller,shipping,ship_date;
double price;
public:
product(int id,string name,string seller,string shipping,string ship_date,double price);
string get_name();
string get_seller();
string get_ship... | true |
1bbb97f3ad53072a11d1837b36cda64c4532ad3a | C++ | Shahin15-1573/mycode-arena | /Uva-OJ/Potentiometers.cpp | UTF-8 | 2,275 | 2.703125 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <iostream>
#include <algorithm>
using namespace std;
#define LI long int
#define LLI long long int
#define ULL unsigned long long
#define memo(array, value) memset(array, value, sizeof(array))
#define MAX 200020
int arr[MAX], tree[... | true |
e7c32ca003a77acd6d9fee07b64e2b11478716e5 | C++ | Fytch/Glossy | /src/window.cpp | UTF-8 | 5,688 | 2.546875 | 3 | [
"MIT"
] | permissive | #include <glossy/window.hpp>
#include <glossy/default_scene.hpp>
#include <glossy/json2glsl.hpp>
#include <glossy/stopwatch.hpp>
#include <glossy/util.hpp>
#include <string>
#include <stdexcept>
#include <cmath>
#include <fstream>
#include <iostream>
void glossy::window::update_resolution( unsigned int width, unsigned... | true |
07f17aebed1998a3b9efa4e42a91063b7e8c2342 | C++ | IkerST/practicas_c | /mayor_suma_30.cpp | UTF-8 | 1,051 | 3.546875 | 4 | [
"MIT"
] | permissive | #include "stdio.h"
#include "iostream"
int main() {
int inp;
int end=0;
int arr[30];
int sum=0;
int max=0;
// Llenar variable con 0s
for (int s=0; s < 30; s++) {
arr[s]=0;
}
system("clear");
std::cout << "\n\t\033[1mBienvenido, este programa sumara 30 numeros o menos y \... | true |
1d1d436edbbbcb1d65e7593a9a1ea9094ef7728d | C++ | spjmurray/AoC2016 | /c++/11a.cc | UTF-8 | 4,786 | 3.34375 | 3 | [] | no_license | #include <set>
#include <list>
#include <algorithm>
#include <iostream>
#include <vector>
// Constants identifying which element in an ElementPair we are refering to
const unsigned int GENERATOR = 0;
const unsigned int CHIP = 1;
// A pair of element objects i.e. generator and chip
typedef std::pair<unsigned int,... | true |
9c8181c89fea82d244b67de88a6c54e56a3c6d46 | C++ | jazcap53/memModel | /pageTable.h | UTF-8 | 2,667 | 2.765625 | 3 | [] | no_license | #ifndef AAJ_PAGE_TABLE_H
#define AAJ_PAGE_TABLE_H
#include <array>
#include <algorithm>
#include <cstdint>
#include "fileShifter.h"
#include "myMemory.h"
#include "aJTypes.h"
#include "aJUtils.h"
namespace MemModel {
/********************
There is one PgTabEntry for each slot in the std::array PageTable::P... | true |
4c64a7f995d27ca243d6eb93061084c65c6f3770 | C++ | xlnx/maybe-cc | /ir-gen/src/type/type.cc | UTF-8 | 3,025 | 2.59375 | 3 | [] | no_license | #include "type.h"
#include "def.h"
TypeView const &TypeView::getVoidPtrTy()
{
static auto s_v = ( [] {
Json::Value ast;
return TypeView(
std::make_shared<QualifiedType>(
DeclarationSpecifiers()
.add_type( QualifiedType( std::make_shared<mty::Void>() ), ast )
.into_type_builder( ast )
.add_le... | true |
0493263f99519076f51f129b1667bbdbaaa5b897 | C++ | stevebraveman/Code | /LUOGU/数列分段Section I.cpp | MacCentralEurope | 355 | 2.546875 | 3 | [] | no_license | //зֶSection I.cpp
#include<iostream>
using namespace std;
int n,m,a[100005];
int main(){
cin>>n>>m;
for(int i=1;i<=n;i++){
cin>>a[i];
}
int tot=0;
int b=0;
for(int i=1;i<=n;i++){
b+=a[i];
if(b==m){
tot++;
b=0;
continue;
}
if(b>m){
b=0;
b+=a[i];
tot++;
}
if(i==n&&b<m){
tot++;
}... | true |
cb6ac6e4c34050f9a462b5954f774f43587e200d | C++ | jayson-adriano/Espressif_ESP32-Scale | /LegacyVersions/ESP32_Example/ESP32_Scale/ESP32_Scale.ino | UTF-8 | 4,344 | 2.640625 | 3 | [
"LicenseRef-scancode-public-domain"
] | permissive | //PROJECT LIBRA SCALE MEASUREMENT SYSTEM
//CODE BY MICHAEL KLOPFER + Calit2 Team (2017)
#include <Hx711.h> //Load Cell A/D (HX711 library)
#include <Adafruit_TLC59711.h> //12 Ch LED Controller, uses SPI only MOSI and CLK
#include <SPI.h>
//Constants
#define portTICK_PERIOD_MS 10
//Interface Assignments
#define HX71... | true |
c84dc8bb5c64979b730b94c4cc187a38807641b7 | C++ | liuxiangbin/LeetCode | /012_IntegerToRoman.cpp | UTF-8 | 1,195 | 4.09375 | 4 | [] | no_license | /*
Given an integer, convert it to a roman numeral.
Input is guaranteed to be within the range from 1 to 3999.
*/
/*
关于罗马数字的几条注意事项:
1、基本数字Ⅰ、X 、C 中的任何一个,自身连用构成数目,或者放在大数的右边连用构成数目,都不能超过三个;放在大数的左边只能用一个。
2、不能把基本数字V 、L 、D 中的任何一个作为小数放在大数的左边采用相减的方法构成数目;放在大数的右边采用相加的方式构成数目,只能使用一个。
3、V 和X 左边的小数字只能用Ⅰ。
4、L 和C 左边的小数字只能用X。
5、D 和M 左... | true |
40b487f5c9837abd2223ebb41e87cfc5329b3ee1 | C++ | cmgp/LabProgAvan0 | /PA_Lab_00_Ejercicio2/source/main.cpp | UTF-8 | 287 | 2.734375 | 3 | [] | no_license | #include <iostream>
#include "a.hpp"
#include "b.hpp"
#include "c.hpp"
int main() {
A a(65);
B b(66);
C c(67);
a.set_b(&b);
a.set_c(&c);
b.set_a(&a);
b.set_c(&c);
c.set_a(&a);
c.set_b(&b);
std::cout << a << "\n" << b << "\n" << c << "\n";
}
| true |
43cc4bfe9c9fd0de208ed10a3a58c37fb1f79319 | C++ | scopchanov/SO-BoldMatch | /src/MainWindow.cpp | UTF-8 | 1,160 | 2.84375 | 3 | [] | no_license | #include "MainWindow.h"
#include <QVBoxLayout>
#include <QLineEdit>
#include <QLabel>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
myString("Today is today")
{
auto *widget = new QWidget(this);
auto *layoutMain = new QVBoxLayout(widget);
auto *edit = new QLineEdit(this);
auto ... | true |
0a960ca9bab2e0618951708aeaf048b72b183d46 | C++ | langrange/LeetCode | /String/ExpressionMatching/ExpressionMatching/ExpressionMatching.cpp | WINDOWS-1252 | 760 | 3.890625 | 4 | [] | no_license | /*
Input : original:"good"; test:"go*"
Output : 1 or 0
Interfacebool isMatch(const char *s, const char *p)
Date: 12/16/2017
*/
#include <iostream>
using namespace std;
bool isMatch(const char *s, const char *p);
int main()
{
const char str[] = "good";
const char p[] = "go*";
cout << isM... | true |
2fa970a91f089bea3c7f7daa0fc91ae6fc7d57ba | C++ | zuzg13/numerical_methods | /lab03/main.cpp | UTF-8 | 4,319 | 2.625 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <time.h>
#include "nrutil.c"
#include "gaussj.c"
#define n 1000
#define m 5
#define max(X,Y) ((X)>(Y)? (X):(Y))
#define min(X,Y) ((X)<(Y)? (X):(Y))
#define abs(X) ((X)>0? (X):-(X))
void matrixvector(double**A, double*x, double*y);
double scalar(double *a, double *b, boo... | true |
229260013e0cda582d0815b08dd3160bfe17a940 | C++ | qzi/cgame | /CGame/src/ctimer.cpp | UTF-8 | 525 | 2.609375 | 3 | [] | no_license | #include "ctimer.h"
#include <gl/glut.h>
// initialize singleton
CTimer *CTimer::m_singleton = 0;
unsigned long CTimer::GetTimeMSec( void )
{
return glutGet( GLUT_ELAPSED_TIME );
}
void CTimer::Initialize( void )
{
m_currentTime = GetTimeMSec(); m_lastTime = 0;
}
void CTimer::Update( void )
{
m_lastTime = m_curr... | true |
11c5b57995e21441a87a7af6570e774c60ee9161 | C++ | wilcroft/starmap-cli | /star.cpp | UTF-8 | 7,821 | 3.109375 | 3 | [] | no_license | #include "star.h"
/**************************************
* PRIVATE FUNCTIONS
**************************************/
void Star::setX(int newX){ x = newX; }
void Star::setY(int newY){ y = newY; }
void Star::addPlanets(std::mt19937* mt){
std::uniform_real_distribution<> dist(0,100);
double pct;
double thr... | true |
215943bef76e5b72f0e1b10eb9c7ae7122178deb | C++ | Hailaylin/C | /C_Language_Promgram-TanHaoQiang/7_function/0718_计算该天是该年的第几天.cpp | UTF-8 | 2,014 | 3.6875 | 4 | [] | no_license | /**
* @file 0718_计算该天是该年的第几天.cpp
* @author your name (you@domain.com)
* @brief
* @version 0.1
* @date 2020-11-25
*
* @copyright Copyright (c) 2020
*
* C语言程序设计
题号:0718 题目:输入年月日,计算是该年的第几天 得分:0
作业提交截止时间:2020/12/20 0:00:00
题目内容:
输入年月日,计算是该年的第几天。
例:
(1)输入:2016,12,31 输出:366
(2)输入... | true |
991cd33937e5a20c0c015d5a9660bdc03796a45f | C++ | amey16/Just-cp-- | /stacks_queues/lv1/next_greater_element_to_right.cpp | UTF-8 | 612 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<stack>
#include<string>
#include<vector>
using namespace std;
int main(){
int n;
cin>>n;
vector<int> arr(n);
stack<int> st;
for(int i=0;i<n;i++){
cin>>arr[i];
}
st.push(arr[arr.size()-1]);
vector<int> newarr(n);
newarr[n-1] = -1;
... | true |
ea09de30ad8f57b8e072ad75efef390c69c67a94 | C++ | DushyantaDhyani/CodeChef | /OCT13/MAANDI.cpp | UTF-8 | 624 | 2.71875 | 3 | [] | no_license | #define MAX 32000
#include<iostream>
#include<cstdio>
#include<vector>
#include<cmath>
using namespace std;
bool check(long num){
long lucky=0;
long overlucky=0;
int r;
while(num>0){
r=num%10;
if(r==7 || r==4){
return true;
}
num=num/10;
}
return false;
}
int main(){
int T;
long N;
long limit;
int ... | true |
b40c88ef251af15da5685cf0ec6e40acba0c8841 | C++ | fatdeer/leetcode | /70-Climbing-Stairs/solution.cpp | UTF-8 | 181 | 2.625 | 3 | [] | no_license | class Solution {
public:
int climbStairs(int n) {
const double s = sqrt(5);
return floor((pow((1 + s) / 2, n + 1) + pow((1 - s) / 2, n + 1)) / s + 0.5);
}
}; | true |
b1cd38fc25dd1a3194ba4c29c498eed3d7bc15f3 | C++ | Srecko727/DataStructures-P1b | /ExpTree.h | UTF-8 | 873 | 2.8125 | 3 | [] | no_license | //
// ExpTree.h
//
//
// Created by Resch,Cheryl on 7/11/19.
//
#ifndef ExpTree_h
#define ExpTree_h
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
//you may change this
struct node
{
string data;
node* left;
node* right;
bool isOp;
int value;
~node();
};
... | true |
b4caef04d5f9a491528166b9df4e4bdc8fc6ac13 | C++ | olligut1/testenvironment | /cppTutorial/Tutorial 3/tut3.cpp | UTF-8 | 510 | 3.25 | 3 | [] | no_license | #include <iostream>
using namespace std;
//Hauptfunktion
int main()
{
const int WOCHENTAGE = 7;
char buchstabe;
/*int Zahl1 = 0;
int Zahl2 = 0;
cout << "Bitte gebe die erste Zahl ein: ";
cin >> Zahl1;
cout << "Bitte gebe die zweite Zahl ein: ";
cin >> Zahl2;
cout << "Das Ergebnis von " << Zahl1 << " * " << ... | true |
6e24b830b061bb363fbb3c40dd67bde4a0354eac | C++ | Abraham-WH/2017ACMtraining | /DAY13 K/main.cpp | GB18030 | 1,022 | 2.9375 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int sample,n,m,l,r,father[1005],ans;
void initset()
{
for(int i = 1; i <= n; i++)
father[i] = i;
return;
}
int searchset(int a)
{
/* if(father[a] != a)
searchset(father[a]);
return father[a];*/
int x;//ٵݹʹ
while(a !... | true |
0baa6879487f5606702378068e3e383fc3cdf761 | C++ | XiandongHu/basic-examples | /Algorithm/sort/merge.cpp | UTF-8 | 942 | 3.421875 | 3 | [] | no_license | #include <stdio.h>
#include "util.h"
static void mergeArray(int a[], int first, int mid, int last, int tmp[])
{
int i = first, j = mid + 1;
int m = mid, n = last;
int k = 0;
while (i <= m && j <= n) {
if (a[i] < a[j]) {
tmp[k++] = a[i++];
} else {
tmp[k++] = a[j++];
}
}
while (i <= m) {
tmp[k++] =... | true |
6e72ac7c5b317e8443685cb30a3b567b3d80c686 | C++ | tal130/C | /DanceClub/DanceClub/Dancer.h | UTF-8 | 632 | 2.953125 | 3 | [] | no_license | #pragma once
#ifndef __DANCER_H
#define __DANCER_H
#include <iostream>
using namespace std;
#include "Human.h"
class Dancer : virtual public Human
{
protected:
int level;
char* style;
public:
Dancer(int level, const Human& human);
Dancer(const Dancer&);
~Dancer();
Dancer& operator=(const Dancer& oth... | true |
323085cfee72906b3c255a5aef9280cf26e6c3bc | C++ | vignesh-cloud-prog/Data-Structures-and-Algorithms | /linkedList/singlyLinkedList/reverseLinkedList.cpp | UTF-8 | 1,331 | 3.921875 | 4 | [] | no_license | #include<iostream>
using namespace std;
class Node
{
public:
int data;
Node *next;
};
void printList(Node *n)
{
Node *temp = n;
while (temp != NULL)
{
cout << temp->data << " ";
temp = temp->next;
}
cout<<endl;
}
Node *addLinkedList()
{
Node *head, *newNode, *temp;
... | true |
b5650d7cad1b054800fc893f98da34940a0080f5 | C++ | AlexandreEichenberger/onnx | /onnx/defs/sequence/defs.cc | UTF-8 | 23,983 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /*
* SPDX-License-Identifier: Apache-2.0
*/
#include "onnx/defs/function.h"
#include "onnx/defs/schema.h"
#include <numeric>
#include <algorithm>
namespace ONNX_NAMESPACE {
static const char* SequenceEmpty_ver11_doc = R"DOC(
Construct an empty tensor sequence, with given data type.
)DOC";
ONNX_OPERATOR_SET_SCHE... | true |
ffc3b945d5070cdf1436b0366f83c8039fce1eaf | C++ | GaoLF/Leetcode | /Basic Calculator II.cpp | UTF-8 | 2,113 | 2.78125 | 3 | [] | no_license | #include<iostream>
#include<string>
#include<vector>
#include <cctype>
#include<algorithm>
#include<math.h>
#include<stack>
using namespace std ;
typedef struct ListNode{
int val;
ListNode * next;
} ListNode;
class Solution {
public:
int calculate(string s) {
vector<int> A;
vector<int> op;
... | true |
a303c66b2d5e3523d58a3f327e9f4f5a8007ef17 | C++ | pce913/Algorithm | /baekjoon/2893.cpp | UHC | 1,821 | 3.421875 | 3 | [] | no_license | #include<stdio.h>
#include<algorithm>
using namespace std;
struct Triangle{
int x, y, r;
Triangle(int _x, int _y, int _r){
x = _x, y = _y, r = _r;
}
Triangle(){}
bool operator==(const Triangle& t)const{
return x == t.x && y == t.y && r == t.r;
}
};
Triangle triangle[15];
Triangle area_of_overlapped_triangle... | true |
cc6350b42c05ecfb09960ec337a03e30e22b1261 | C++ | kbc19b13/PECO | /GameTemplate/Game/Enemy/Move/MoveState/MoveEscape.cpp | SHIFT_JIS | 1,050 | 2.65625 | 3 | [] | no_license | #include "stdafx.h"
#include "MoveEscape.h"
#include "Enemy/Kuma.h"
MoveEscape::MoveEscape(Kuma* kuma) :
IKumaMove(kuma)
{
m_player = Player::P_GetInstance();
//Aj[V̍Đ
//鎞̃Aj[VĐ
}
void MoveEscape::Move()
{
//Ԏ̈ړLq
//ړ̋Lq
//DiscoveryJځ
//EPlayerɕ߂܂ƍSԂɑJڂ
//PlayeȑɋLqtO𗧂ĂďH
//E苗Ɩ߂ԂɑJڂ
//MoveEscapeNX... | true |
7ea2b7e454ce80a316f2f7b685d9834bf4e41be9 | C++ | LTLA/archive-csaw | /src/merge_windows.cpp | UTF-8 | 7,112 | 2.828125 | 3 | [] | no_license | #include "csaw.h"
int split_cluster(const int*, const int*, const int&, const int&, const int&, const int&, int*);
void fillSEXP(SEXP&, const int);
/* We assume that incoming elements are sorted by chr -> start -> end. We then proceed
* to aggregate elements by chaining together elements that are less than 'tolera... | true |
00cd14766a0a34fcb2b35379e2815cb1d4c81c1d | C++ | 8Observer8/Rational | /rational.cpp | UTF-8 | 1,516 | 3.546875 | 4 | [] | no_license | #include "rational.h"
Rational::Rational(int numerator, int denominator) :
mNumerator(numerator),
mDenominator(denominator)
{
}
int Rational::numerator() const
{
return mNumerator;
}
void Rational::setNumerator(int numerator)
{
mNumerator = numerator;
}
int Rational::denominator() const
{
return... | true |
def318e93f5ab833c53c863a488f520a88b780e2 | C++ | Carlos2508/Hoja-de-trabajo-5 | /tarea 5 ejercicio 1.cpp | ISO-8859-1 | 3,850 | 3.484375 | 3 | [] | no_license | /*EJERCICIO#2
Realice un programa que, dado el peso, la altura, la edad y el gnero (M/F) de un grupo de N personas
que pertenecen a un departamento de la repblica, obtenga un promedio de peso, altura y edad de esta
poblacin. Los datos deben guardarse de forma ordenada por edad en un archivo de datos. As mismo
el progra... | true |
c34a8fc92acda468dff2479b0b3230c9f1be772f | C++ | s-nandi/contest-problems | /graph-theory/toposort/sliding_blocks.cpp | UTF-8 | 4,695 | 2.84375 | 3 | [] | no_license | // Toposort, creating dependency graph
// https://open.kattis.com/problems/slidingblocks
// 2018 Singapore Regional
#include <bits/stdc++.h>
using namespace std;
constexpr auto MAXN = 400'000 + 5;
vector dx = {0, -1, 0, 1};
vector dy = {-1, 0, 1, 0};
struct edge {
int to;
};
using graph = vector<vector<edge>>;
... | true |
c711bbb8fbcb267bcc98f62a3cdc207362f9bf9c | C++ | gkonto/openmp | /src/_prod_cons_v01/c3_1/prod_cons.cpp | UTF-8 | 2,328 | 2.65625 | 3 | [
"Apache-2.0"
] | permissive | #include <math.h>
#include <iostream>
#include <time.h>
#include <chrono>
#include <thread>
#include <omp.h>
#include "prod_cons.hpp"
#include "../tools.hpp"
/*
* NOTES:
* Den einai producer consumer pragmatikos
* giati prota perimenei to single na teleiosei kai meta ksekinoyn ta tasks.
*/
Buffer *gl_buffer = 0;... | true |
b8da588f876397991ef935135175bdfb39326cd4 | C++ | mrmh-code/My_problem_solution_different_OJ | /2.CodeForces/50.A. I Wanna Be the Guy.cpp | UTF-8 | 432 | 2.625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int main()
{
set<int>s;
int n;
cin>>n;
int p;
cin>>p;
for(int i=0; i<p; i++){
int a;
cin>>a;
s.insert(a);
}
cin>>p;
for(int i=0; i<p; i++){
int a;
cin>>a;
s.insert(a);
}
if(s... | true |
d5cbf5d98671edf089d8f5f1bfc7f76e2415b5b4 | C++ | jinagii/GripDrive | /Engine/Collision.cpp | UHC | 766 | 3.109375 | 3 | [] | no_license | #include "Collision.h"
bool Collision::CircleCollision(D2D1_POINT_2F point, int radius1, D2D1_POINT_2F point2, int radius2)
{
int distX = point.x - point2.x; // غ
int distY = point.y - point2.y; //
int distT = sqrt((distX * distX) + (distY * distY)); //
// 1 2 ϴµ, ũ... | true |
7f1bbba6301db7634df893b0ad15f58f76e6d539 | C++ | pieisland/2021-coding-test-preparing | /책 문제 풀이/10. 그래프 이론/행성 터널*(210216).cpp | UTF-8 | 2,273 | 3.234375 | 3 | [] | no_license | #include<cstdio>
#include<stdio.h>
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
#include<string>
using namespace std;
//행성 터널
/*
* 거리가 주어진 게 아니었던 문제. 그래서 각 노드사이의 거리를 구해야했는데
* n이 너무 커서 n(n-1)/2로 하기에는 너무 크다.
* 주어진 조건이 |x1- x2| 이런 걸로 하는거라서 밑에처럼 거리를 정할 수 있는 거였다.
* 근데 혼자 생각할 수 있을지는 모르겠다. 이해는 했는데... | true |
66b25e62a676482791b186b47cc98c4968fd9c1e | C++ | hamlet96/LeetCodeProblems | /347_Top_K_Frequent_Elements/main.cpp | UTF-8 | 996 | 3.125 | 3 | [] | no_license | #include <vector>
#include <algorithm>
using namespace std;
class Solution {
public:
vector<int> topKFrequent(vector<int>& nums, int k) {
vector<int> count;
vector<int> answer;
int uniqueCounter = 0;
sort(nums.begin(), nums.end());
for (int i = 0; i < nums.size(); i++) {
int j = i;
int c = 0;
... | true |
73f1d40c3d8488d1deb2ca7bd0022a1bd2e6e684 | C++ | tamenut/stm2 | /skf/CGeneratioNoise.cpp | UHC | 1,331 | 2.828125 | 3 | [] | no_license | #include <iostream>
#include "CGeneratioNoise.h"
#include <time.h>
CGeneratioNoise::CGeneratioNoise(void)
{
Initialize();
}
CGeneratioNoise::~CGeneratioNoise(void)
{
}
void CGeneratioNoise::Initialize(void)
{
/// seed
seed = long(time(NULL));
}
double CGeneratioNoise::NoiseGauss(double i_dblMean, double i_dblDe... | true |
a84f25c1b0350df84e2946f1154af768437d0388 | C++ | auzierk13/mcd | /dallas_esp/ds18b20.ino | UTF-8 | 1,959 | 2.84375 | 3 | [] | no_license |
void setupDs18b20()
{
// start serial port
Serial.begin(9600);
Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library
sensors.begin();
// Grab a count of devices on the wire
numberOfDevices = sensors.getDeviceCount();
// locate devices on the bus
Serial.print("... | true |
d39a1ee1c0d26af4a4efac06ef8a472958da5c8f | C++ | kimdungdt2412/lthdt-18clc6-18127082 | /18127082_W07_01/ex01.cpp | UTF-8 | 326 | 2.640625 | 3 | [] | no_license | #include "Bike.h"
#include "Truck.h"
int main()
{
Bike b;
Truck t;
cout << "Motorbike" << endl;
b.add_a_weight();
b.remove_a_weight();
b.add_fuel();
b.length();
b.fuel_left();
cout << "Truck" << endl;
t.add_a_weight();
t.remove_a_weight();
t.add_fuel();
t.length();
t.fuel_left();
system("pause");
retur... | true |
00034ced79f2a78a91f86ba8d3fa51a31ce41c28 | C++ | ajoathan/pso | /pso.h | UTF-8 | 797 | 2.6875 | 3 | [
"Apache-2.0"
] | permissive | #include<cstddef>
#include<vector>
namespace pso {
class solution {
std::vector<double> values;
public:
solution(std::size_t size);
std::size_t size() const;
double& operator[](std::size_t idx);
const double& operator[](std::size_t idx) const;
solution operator+(const solution &b) const;
solution ope... | true |
23d743dfbcd2ef0408d0bc22c53fc46308671bf1 | C++ | duburcqa/jiminy | /core/src/io/AbstractIODevice.cc | UTF-8 | 8,231 | 2.796875 | 3 | [
"MIT",
"BSL-1.0",
"MPL-2.0",
"BSD-2-Clause"
] | permissive | ///////////////////////////////////////////////////////////////////////////////
///
/// \brief Contains the AbstractIODevice class methods implementations.
///
///////////////////////////////////////////////////////////////////////////////
#include "jiminy/core/Macros.h"
#include "jiminy/core/io/AbstractIODevice.h"
... | true |
9055ec39702f326073c4d1756ea78eeedaba25a5 | C++ | AlexTuckner/School_Projects | /Software Design Robot Project/iteration3/src/event_distress_call.h | UTF-8 | 1,592 | 2.578125 | 3 | [] | no_license | /**
* @file event_collision.h
*
* @copyright 2017 3081 Staff, All rights reserved.
*/
#ifndef SRC_EVENT_DISTRESS_CALL_H_
#define SRC_EVENT_DISTRESS_CALL_H_
/*******************************************************************************
* Includes
****************************************************************... | true |
49833117e20dd8fc6e4bd3870fb13a7365c48b3e | C++ | epoels/SimpleWebCache | /HTTPIMAGEService.cpp | UTF-8 | 3,939 | 2.71875 | 3 | [] | no_license | #include "/USERS/ericpoels/MakeUpTest/SimpleWebCache/headers/HTTPIMAGEService.h"
#include "/USERS/ericpoels/MakeUpTest/SimpleWebCache/headers/HTTPResponseHeader.h"
#include "/USERS/ericpoels/MakeUpTest/SimpleWebCache/headers/HTTPNotFoundExceptionHandler.h"
HTTPIMAGEService::HTTPIMAGEService(FileCache * p_fileCache,boo... | true |
dfa41e04a7a6c3632bd014aaaf8d892420af0879 | C++ | rahulgupta999/RiceFarm | /source/Farm.cpp | UTF-8 | 15,539 | 2.546875 | 3 | [] | no_license | // Ricefarm.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include "Farm.h"
#include <ctime>
#ifdef WIN32
#include <strstream>
#endif
struct comparator
{
bool operator() (riceVariety *first, riceVariety *second)
{
return (first->nonConflictingNeighbo... | true |
02ef080741b1237dbe5b4282a7feb96cbcd3ccbd | C++ | liangf/lc150 | /sort_list.cpp | UTF-8 | 1,712 | 3.71875 | 4 | [] | no_license | #include <iostream>
using namespace std;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *sortList(ListNode *head) {
if (head == NULL) return NULL;
int count = 0;
ListNode *p = head;
while (p != NULL) {
count++;
p = p->next;
... | true |
687d2fb0e3e7a24801b99fb74c57ae64165aa5d2 | C++ | RuslanKutdusov/brdf_playground | /code/Camera.h | UTF-8 | 2,792 | 2.75 | 3 | [] | no_license | #pragma once
#include "Input.h"
enum EProjectionType
{
kInvalidProjection = 0,
kOrthoProjection,
kPerspectiveProjection
};
class BaseCamera
{
public:
BaseCamera() = default;
~BaseCamera() = default;
EProjectionType GetProjectionType() const;
virtual void SetPosition(const XMVECTOR& pos);
virtual void SetDi... | true |
ad8b068126e63af8fed97ff53c4b3799dc5fbf9a | C++ | gitmokr/Education | /Chapter3/3_11up.cpp | UTF-8 | 1,986 | 3.34375 | 3 | [] | no_license | #include "../../Hello, World!/Hello, World!/std_lib_facilities.h"
int main()
{
cout << "How many one - cent coins do you have?\n";
int a;
cin >> a;
cout << "How many five - cent coins do you have?\n";
int b;
cin >> b;
cout << "How many ten - cent coins do you have?\n";
int c;
cin >> c;
cout << "Ho... | true |
c61902ddd51bb4626f9fa0fc8cb4c2ad195e7c2a | C++ | ConstanceYn/GameLoa | /src/MonstreNul.cpp | UTF-8 | 320 | 2.78125 | 3 | [] | no_license | #include "MonstreNul.hpp"
#include "Plateau.hpp"
MonstreNul::MonstreNul(int x, int y):Monstre(x , y){
setSymbole('n');
}
bool MonstreNul::teleport(int x, int y, Plateau& p)
{
if (!bouge){
int a = (rand()%3)-1;
int b = (rand()%3)-1;
bouge = true;
return moving(y+a, x+b, p);
}
return false;
}
| true |
3724d9215dc27267caa4ffb0466559b0621d3fd5 | C++ | Sahar-Alwakily/GitTeam11 | /ProjectTeam11/ProjectTeam11.cpp | UTF-8 | 2,362 | 2.9375 | 3 | [] | no_license | // ProjectTeam11.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream>
#include "Person.h"
#include <fstream>
#include <istream>
#include <iostream>
#include <string.h>
#include "Employee.h"
#include "Student.h"
#include "Employee.h"
#include "WorkingStudent.h"
#... | true |
b1f9b8ee95b35f12ed52d0ed74c5c0c4df88e815 | C++ | pretentiousgit/servo-party | /ADCTouch_Servo/ADCTouch_Servo.ino | UTF-8 | 1,747 | 2.703125 | 3 | [] | no_license | #include <ADCTouch.h>
#include <Servo.h>
#ifdef __AVR_ATtiny85__ // Trinket, Gemma, etc.
#include <avr/power.h>
#endif
// Pin Definitions
#define ADC_BASE A0
#define ADC_READ A1
#define TOGGLE 40 // this is the yes-no threshold for touch
#define ServoPin 9
#define TEST_LED 10
// Values for ADCTouch
int ref0, ref1... | true |
d3bbe86f5f16aa7589db723f22b8281427a2f9b6 | C++ | AvantikaJalote/SEM_3_PRACTICALS_SY | /EXPERIMENT 3/PRAC3C_ALTERNATE.cpp | UTF-8 | 2,829 | 3.765625 | 4 | [] | no_license | #include<iostream>
#include<math.h>
#define pi 3.14
using namespace std;
inline double cube(float length) //calculates volume for cube //inline function
{
double vol=pow(length,3);
return vol;
}
inline double sphere(float radius) //calculates volume for sphere //inline function
{
double vol=(... | true |
b25c0c9ca70d5567bdf1aad96a56666eee4bf29e | C++ | AutumnKite/Codes | /Codeforces/1511F Chainword/std.cpp | UTF-8 | 2,139 | 2.546875 | 3 | [] | no_license | #include <bits/stdc++.h>
const int P = 998244353;
typedef std::vector<std::vector<int>> matrix;
matrix operator*(const matrix &a, const matrix &b) {
matrix s(a.size(), std::vector<int>(b[0].size()));
for (int i = 0; i < (int)a.size(); ++i) {
for (int k = 0; k < (int)b.size(); ++k) {
for (int j = 0; j < (int)b... | true |
0ab7cc0ff16111d7ba7499ebac26c3ada2e7f421 | C++ | arabham/BattleTank | /Source/BattleTank/TankPlayerController.cpp | UTF-8 | 1,904 | 2.59375 | 3 | [] | no_license | // Property of Do Over Games
#include "TankPlayerController.h"
#include "Engine/World.h"
#include "DrawDebugHelpers.h"
void ATankPlayerController::BeginPlay()
{
Super::BeginPlay();
}
void ATankPlayerController::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
AimTowardCrosshair();
}
ATank* ATankPlayerControll... | true |
e59b1e4e457801ca8d2bb66255ba5b90ba69e7ae | C++ | AshtonBowen/2D-mobile-Robotics | /lab2_aria/lab2_aria/lib/edgeFollow.h | UTF-8 | 1,156 | 2.90625 | 3 | [] | no_license | #include <ArAction.h>
#include "PID.h"
#include "Mapping.h"
#include "FrameTime.h"
class edgeFollow : public ArAction
{
public:
edgeFollow(); //A default constructor
virtual ~edgeFollow() {}; //A defualt deconstuctor
virtual ArActionDesired * fire(ArActionDesired d); //A fire function for the action ... | true |
6f1c01a6ba8f729aa03ef322363207914ae33c4d | C++ | championloser/learn | /bo_thread/thread.h | UTF-8 | 399 | 2.5625 | 3 | [] | no_license | #ifndef __THREAD_H__
#define __THREAD_H__
#include<pthread.h>
#include<functional>
namespace jjx
{
class Thread
{
public:
//Thread(std::function<void()> cb);
Thread(std::function<void()> &&cb);
~Thread();
void start();
void join();
private:
static void * pthreadFunc(void *);
private:
pthread_t _pthid;
bool _i... | true |
0364929bcd82828617e5f1c760d1e64bf920f308 | C++ | Parmie/Vanagon | /src/ECUReader/Tools/Button.cpp | UTF-8 | 634 | 2.640625 | 3 | [] | no_license | #ifndef Button_cpp
#define Button_cpp
#include <Arduino.h>
#include "..\Arduino\DigitalInput.cpp"
class Button {
private:
DigitalInput *_input;
void (*_clickHandler)(void*);
void *_clickHandlerData;
typedef void (*callback)(void*);
public:
template<typename T>
Button(DigitalInput *input, ... | true |
0ea82017b514f0515f333325e36380c3c149aa96 | C++ | cpopescu/whisperlib2 | /whisperlib/io/path.cc | UTF-8 | 3,941 | 2.953125 | 3 | [] | no_license | #include "whisperlib/io/path.h"
#include "absl/strings/str_cat.h"
namespace whisper {
namespace path {
absl::string_view Basename(absl::string_view path) {
auto pos = path.rfind(kDirSeparator);
if (pos == absl::string_view::npos) { return path; }
return path.substr(pos + 1);
}
absl::string_view Dirname(absl::s... | true |
0dc8d772500b2353c3d5c388d12ab8fda0e068f1 | C++ | ggjae/Algorithm-CS | /cpp/greedy/1783.cpp | UTF-8 | 557 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int N, M;
int main(void)
{
cin >> N >> M;
if (N == 1)
cout << 1 << endl;
else if (N == 2)
cout << min(4, (M + 1) / 2) << endl;
//1, 2, 3, 4번이 적어도 한번씩은 나와야 한다
else if (N >= 3)
{ //가로가 6까지는 최대 4칸(1번, 4번,... | true |
9eb2856db1b8d727b238c249a8ff63a584d56f54 | C++ | walkccc/LeetCode | /solutions/2024. Maximize the Confusion of an Exam/2024.cpp | UTF-8 | 409 | 2.65625 | 3 | [
"MIT"
] | permissive | class Solution {
public:
int maxConsecutiveAnswers(string answerKey, int k) {
int ans = 0;
int maxCount = 0;
vector<int> count(2);
for (int l = 0, r = 0; r < answerKey.length(); ++r) {
maxCount = max(maxCount, ++count[answerKey[r] == 'T']);
while (maxCount + k < r - l + 1)
--coun... | true |
55c7bf1fa8426a948fe35b39c9ceb05175031072 | C++ | shubhampachori12110095/MDEVLRPTW | /Code/source/Helper.cpp | UTF-8 | 616 | 2.8125 | 3 | [] | no_license | #include "../header/Helper.h"
int** Helper::initializeIntegerMatriz(int length)
{
int **pij = new int *[length];
for(int i = 0; i < length; i++)
{
pij[i] = new int[length];
}
return pij;
}
int** Helper::initializeIntegerMatriz(int length, int width)
{
int **pij = new int *[length];
... | true |
02e18d1ae20e624aaa7c10817984a5ddc5daa81b | C++ | huiyugan/3D_RFUltrasound_Reconstruction | /IntensityCompounding.cpp | UTF-8 | 2,125 | 3.15625 | 3 | [
"MIT"
] | permissive | #include "IntensityCompounding.h"
#include <stdio.h>
#include <iostream>
GaussianWeightedCompounding::GaussianWeightedCompounding(float sigma)
{
m_sigma = sigma;
m_sigmaSQR = pow(sigma, 2.0f);
}
float GaussianWeightedCompounding::evaluate(std::vector<float> *intensityVector, std::vector<float> *distanceV... | true |
6432ff47c9b879107b14f90da247ebcb268d7ad2 | C++ | buotex/problems | /maxprod.cpp | UTF-8 | 982 | 3.1875 | 3 | [] | no_license | #include <vector>
#include <algorithm>
#include <iostream>
using namespace std;
class Solution {
public:
int maxProduct(int A[], int n) {
vector<int> memory(n);
int start =1;
for (int i = 0 ; i < n; ++i){
memory[i] = (start *= A[i]);
if (memory[i] == 0) start = 1;
... | true |
4351193f23cc7dd2758ab77ad78940fb9992b7a6 | C++ | eval1749/evita | /evita/gfx/rect_conversions.cc | UTF-8 | 926 | 2.671875 | 3 | [] | no_license | // Copyright (c) 2014 Project Vogue. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "evita/gfx/rect_conversions.h"
#include <ctgmath>
namespace gfx {
// Returns the largest Rect that is enclosed by the given RectF.
Rect ToEnclose... | true |
4d6d811f6f6413638fb06b4655d36e5cc42c33e7 | C++ | luqmaan/object-oriented | /random-number-generator/aRandomNumberGenerator.h | UTF-8 | 712 | 3.390625 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
class aRandomNumberGenerator {
public:
aRandomNumberGenerator() {
srand ( time(NULL) );
}
void setLow(int l) {
low = (int) l;
}
void setHigh(int h) {
high = h;
}
int generate() {
//if (low == NULL || high == NULL) {
//throw "error, run ... | true |
58e48f4c75cff3c4954f501484907df958af84fb | C++ | muhammadaliwafa/Collection | /Serial Communication Arduino to ESP/ESP_RX/ESP_RX.ino | UTF-8 | 890 | 2.765625 | 3 | [] | no_license | #include <ArduinoJson.h>
#include <SoftwareSerial.h>
SoftwareSerial fromArduino(D2,D3);//(RX, TX ESP)
String dataKirim;
void setup() {
Serial.begin(9600);
fromArduino.begin(9600);
}
void loop() {
if(fromArduino.available())
{
char c = fromArduino.read();
if(c == '}')
{
dataKirim += c; /... | true |
77c7cc01c430285e048f217c51aeadf353beaca3 | C++ | aishwarya4444/codeChallenges | /cp/lb/02_number_theory/euclid/cf_complicatedGCD.cpp | UTF-8 | 467 | 2.75 | 3 | [] | no_license | /*
https://codeforces.com/problemset/problem/664/A
We examine two cases:
a=b — the segment consists of a single number, hence the answer is a.
a<b — we have gcd(a,a+1,a+2,...,b)=gcd(gcd(a,a+1),a+2,...,b)=gcd(1,a+2,...,b)=1.
*/
#include <bits/stdc++.h>
#define si(n) scanf("%d", &n)
#define sll(n) scanf("%lld", &n)
#d... | true |
b603a95cf4e13f197602cc97bf69cd0e275e9460 | C++ | wuyou33/robot_cgmres | /src/common/memory_manager.cpp | UTF-8 | 866 | 2.8125 | 3 | [
"BSD-2-Clause"
] | permissive | #include "common/memory_manager.hpp"
namespace robotcgmres {
namespace memorymanager {
double* NewVector(const int dim) {
if (dim > 0) {
double* vec = new double[dim];
for (int i=0; i<dim; ++i) {
vec[i] = 0;
}
return vec;
}
else {
return nullptr;
}
}
void DeleteVector(double* vec)... | true |
c21fb58b4cddf0dffc521171d52b7d623fcfcc4f | C++ | ByteNybbler/MannVsFate | /MannVsFate/weapon.cpp | UTF-8 | 1,191 | 2.515625 | 3 | [] | no_license | #include "weapon.h"
// Set to 0 to disable debug messages for weapons.
#define WEAPON_DEBUG 0
#if WEAPON_DEBUG
#include <iostream>
#endif
weapon::weapon()
: has_projectiles(false),
arc_fire(false),
can_be_switched_to(true),
does_damage(true),
bots_too_dumb_to_use(false),
can_be_charged(false),
burns(false),
... | true |
f1b6e221cd28ac15fed475e6eb3dd2bb7e969f61 | C++ | Tapia641/escom-sistemas-distribuidos | /7. C++/Desempeño_C++/string.cpp | UTF-8 | 811 | 3.390625 | 3 | [] | no_license | //STRING IPN C++
#include <iostream>
#include <string>
#include <string.h>
using namespace std;
string generateString(){
static const char alphanum[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string s = "";
for (int i = 0; i < 3; ++i) {
s += alphanum[rand() % (sizeof(alphanum) - 1)];
}
return s;
... | true |
dad23c04ebe46e1156369eeb3560d92ed7b9dcbd | C++ | gfcodearq/TP-FINAL-MAVI | /MAVI - TP_FINAL/BaseObjeto.h | UTF-8 | 1,111 | 2.828125 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include <string>
using namespace sf;
using namespace std;
class BaseObjeto
{
public:
BaseObjeto(string fileName, Vector2f vel);
~BaseObjeto(); //destructor
void Draw(RenderWindow* wnd); //dibuja el objeto en pantalla
void Update(float delta_t); //actualiza la ... | true |
ff350dbb85df4df8466080ea59674b928c9ae2b0 | C++ | porcupineG/eviewer | /src/tree/typename.cpp | UTF-8 | 910 | 2.828125 | 3 | [] | no_license | #include "typename.h"
TypeName::TypeName(QString name)
{
this->name = name;
treeWidgetItem = new QTreeWidgetItem();
treeWidgetItem->setText(0, name);
}
QMap<unsigned long long, TypeValue *> *TypeName::getChilds()
{
return &childs;
}
TypeValue * TypeName::insertChild(TypeValue *value)
{
TypeValue ... | true |