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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
cd817a0d0b2d4c261bf17d92296d616cc9e154af | C++ | RadionaOrg/LoRa_Fuzine | /tilt/tilt.ino | UTF-8 | 807 | 3.0625 | 3 | [] | no_license | //KY017 Mercury open optical module
int Led = 2 ;// define LED Interface
int buttonpin = 4; // define the mercury tilt switch sensor interface
int val ;// define numeric variables val
int count = 0;
bool state, prevState;
void setup ()
{
pinMode (Led, OUTPUT) ;// define LED as output interface
pinMode (buttonpin, ... | true |
21e92400c586a16345f52669a03ccee5f0e60ccc | C++ | Sumit1608/CodingNinjas-C-Foundation-Solution | /Lecture 10/Print like a wave.cpp | UTF-8 | 606 | 3.40625 | 3 | [] | no_license | #include<iostream>
using namespace std;
void printWave(int arr[][100],int row, int column){
int m = row, n = column;
for(int j=0; j<n; j++){
if(j%2 == 0){
for(int i=0; i<m; i++){
cout<<arr[i][j]<<" ";
}
}
else{
for(int i=m-1 ; i>=0; i--){
cout<<arr[i][j]<<" ";
}
}
}
}
int main(){
in... | true |
7bdcdd8c9b488f442dddec4051aa62221b622297 | C++ | ngaarrr/LearningCPP | /Practice/Session13/struct.cpp | UTF-8 | 504 | 3.84375 | 4 | [] | no_license | #include <iostream>
struct Students
{
std::string name;
int age;
int grade;
};
int main()
{
Students student1;
student1.name = "negar";
student1.age = 17;
student1.grade = 12;
std::cout << "Name: " << student1.name << std::endl;
std::cout << "Age: " << student1.age << std::endl;
... | true |
5b0c65cdb91ab2589be44ec7ddfd6fe9d972d39a | C++ | SaulZhang/Algorithm-Templates | /1-PAT专题训练/STL应用/1054.cpp | UTF-8 | 559 | 2.53125 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std;
int n,m,x;
vector<int>Vec;
unordered_map<int,int> Ma;
int main()
{
cin>>n>>m;
for(int i=1;i<=m;i++){
for(int j=1;j<=n;j++){
cin>>x;
if(Ma.count(x)==0)
... | true |
7141a4a55a4818e583e81b5bb99a2c22892e8a4d | C++ | buptlxb/leetcode | /1st/rotate_list.cpp | UTF-8 | 1,747 | 3.625 | 4 | [] | no_license | #include <iostream>
using std::cout;
using std::endl;
struct ListNode {
int val;
ListNode *next;
ListNode(int x) : val(x), next(NULL) {}
};
class Solution {
public:
ListNode *rotateRight(ListNode *head, int k) {
if (!head || !head->next)
return head;
int n = lenof(head);
... | true |
662f91bda6f59bc22987e4cef68dccad5cd387cd | C++ | quzery/Leetcode2019 | /26.删除排序数组中的重复项.cpp | UTF-8 | 489 | 2.90625 | 3 | [] | no_license | /*
* @lc app=leetcode.cn id=26 lang=cpp
*
* [26] 删除排序数组中的重复项
*/
class Solution {
public:
int removeDuplicates(vector<int>& nums) {
if(nums.size() == 0){
return 0;
}
int i = 0, j = 0;
while(i<nums.size()-1){
if(nums[i] == nums[i+1]){
i++;
... | true |
983014cac8afbe1a6c9d4ecc60a0e963bba8b2cf | C++ | CM4all/beng-proxy | /src/pool/StringBuilder.hxx | UTF-8 | 588 | 2.71875 | 3 | [] | permissive | // SPDX-License-Identifier: BSD-2-Clause
// Copyright CM4all GmbH
// author: Max Kellermann <mk@cm4all.com>
#pragma once
#include "AllocatorPtr.hxx"
#include "util/StaticVector.hxx"
#include <string_view>
template<size_t MAX>
class PoolStringBuilder {
StaticVector<std::string_view, MAX> items;
public:
void push_... | true |
07952623bbcd36d42be6f68580ee3f7cc8d733dd | C++ | miguelsantoss/AVT1516 | /src/PerspectiveCamera.cpp | UTF-8 | 1,221 | 2.625 | 3 | [] | no_license | #include "PerspectiveCamera.h"
#include "Camera.h"
#include "GameManager.h"
#include <stdio.h>
PerspectiveCamera::PerspectiveCamera(float fov, float ratio, float dnear, float dfar) {
_fov = fov;
_ratio = ratio;
_near = dnear;
_far = dfar;
}
PerspectiveCamera::~PerspectiveCamera() {}
void PerspectiveCamera::upd... | true |
45ed63c099d71c8530dc29be1ed64ee5438d0571 | C++ | Hung150/Lab8 | /Excercise4.cpp | UTF-8 | 688 | 3.28125 | 3 | [] | no_license | #include<stdio.h>
#include<math.h>
int main(){
float x,y;
printf("enter the coordinates x");
scanf("%f", &x);
printf("enter the coordinates y");
scanf("%f", &y);
if(fmin(x,y)>0){
printf("the point is in the first quadrant");
}else
{
if(fmax(x,y)<0){
printf("the ... | true |
27c7ce20e9d182d6cf3a6898d1c4312c68a23eab | C++ | JakMobius/mipt | /sem_1/course_algorithms/hw_contest_4/D.cpp | UTF-8 | 8,258 | 3.5 | 4 | [
"MIT"
] | permissive | /*
Даны n отрезков на прямой. Пара отрезков называются вложенной, если отрезки не совпадают, и один отрезок содержит второй. Посчитать количество пар вложенных отрезков.
*/
#include <cstdlib>
#include <cstdio>
#include <climits>
template <typename T>
const T &min(const T &first, const T &second) {
return first < sec... | true |
e30e120b2751e92ca536a52b7f676a231aca88d3 | C++ | tomsloj/PSZT-rozdzielanie-ciastek | /src/main.cpp | UTF-8 | 7,939 | 2.59375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <random>
#include <tuple>
#include <cfloat>
#include <climits>
#include "EvolutionarySolution.hpp"
#include "IterativeSolution.hpp"
#include "TestGenerator.hpp"
using namespace std;
const int NUMBE... | true |
8e9059c716f582bdc72360048112f24c197d4f10 | C++ | moyin1004/learning | /TimeLine/20190218/netlib/v3/Thread.h | UTF-8 | 650 | 2.65625 | 3 | [] | no_license | /// @file Thread.h
/// @author moyin(moyin1004@163.com)
/// @data 2019-02-10 11:04:57
#ifndef __THREAD_H__
#define __THREAD_H__
#include "Noncopyable.h"
#include <pthread.h>
#include <functional>
namespace wd {
class Thread
:Noncopyable
{
public:
using ThreadCallback = std::function<void()>;
Thr... | true |
70c72494531b906dea8301cd9cb7ace847e69764 | C++ | Dj0ulo/UniTag | /UniTag.cpp | UTF-8 | 3,627 | 2.84375 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include "Utils.h"
#include "UniTag.h"
using namespace std;
using namespace UniTag;
using namespace utils;
UniTag::Frame::Frame()
{
}
UniTag::Frame::Frame(const std::string &flag_, const std::vector <char> &data_)
{
data = data_;
flag = flag_;
}
bool UniTag::Frame::... | true |
d3bb88c40f02b1fd049ed1368430c03e77a8ec7a | C++ | LeeJuhae/42_projects | /cpp_module/cpp08/ex01/main.cpp | UTF-8 | 1,493 | 3.390625 | 3 | [] | no_license | #include "./span.hpp"
int main(void)
{
std::cout << "\n\t\t\033[1;31m SPAN TEST\033[0m" << std::endl;
Span span1 = Span(7);
Span span2 = Span(100);
Span span3 = Span(10);
std::cout << ">>> TEST_1: span1 = Span(7) <<<" << std::endl;
span1.addNumber(1);
span1.addNumber(3);
span1.addNumber(20);
span1.addNumbe... | true |
6c6cea1d1420ce9cc644111ca66cb5ff797ba7ad | C++ | OC-MCS/p2finalproject-02-NateBellcock | /game/Projectle.h | UTF-8 | 1,829 | 3.078125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <list>
using namespace std;
#include <SFML/Graphics.hpp>
using namespace sf;
class Projectle
{
private:
Sprite missile;
bool isOnSreen;
public:
Projectle(Texture& missileTexture, Sprite ship)
{
missile.setTexture(missileTexture);
missile.setPosition(ship.getPosition()... | true |
88f83756029099ec7fbc386154dcb1cad4154255 | C++ | IgorYunusov/ZheatEngine | /ZheatEngine/ZheatEngine/UIParamWidget.h | UTF-8 | 9,952 | 2.546875 | 3 | [] | no_license | #pragma once
#include <limits>
#include <QWidget>
#include <QList>
#include <QVariant>
#include <QLineEdit>
#include <QLayout>
#include <QString>
#include <QValidator>
#include "Scan.h"
#include "ScanNBytes.h"
#include "ScanFloatType.h"
#include "HelperFunctions.h"
class UIParamWidget : public QWidget
{
Q_OBJECT
... | true |
013882d3bee1866f61beb844270e7db8bcea4294 | C++ | Hyski/ParadiseCracked | /muffle/new.h | UTF-8 | 1,262 | 2.640625 | 3 | [] | no_license | #if !defined(__NEW_H_INCLUDED_7552370787048739__)
#define __NEW_H_INCLUDED_7552370787048739__
//=====================================================================================//
// void *operator new() //
//===========================================... | true |
d4d8e4becb31181e9b02105850dfc0db64ad7fa6 | C++ | MaciejGrudziaz/character-editor | /CHARACTER_EDITOR/ConsoleLayer.h | UTF-8 | 1,330 | 2.90625 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include "ConsoleCommand.h"
struct ConsoleLayer {
std::string name;
ConsoleLayer* parent;
std::vector<ConsoleLayer*> children;
std::vector<ConsoleCommand*> commands;
virtual void InitCommands() = 0;
ConsoleLayer(std::string name_) :name(name_),parent(nullptr) { ... | true |
93845b201c588db2411b15782249903b6edfec79 | C++ | kostr2010/game-engine | /src-next/utils/vec2.hpp | UTF-8 | 517 | 3.59375 | 4 | [] | no_license | #pragma once
#include <iostream>
// ====================
// Vec2
// implementation of the simple 2d vector
struct Vec2 {
int x, y;
};
bool operator==(Vec2 left, Vec2 right) {
return (left.x == right.x) && (left.y == right.y);
}
void operator+=(Vec2& left, Vec2& right) {
left.x += right.x;
left.y += right.y... | true |
3b9ea313173a899a906869a3c8ca1c2ad5608ae6 | C++ | NikosKolitsas/algolab | /initial_problems/aliens/aliensfalse.cpp | UTF-8 | 3,320 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <algorithm>
#include <assert.h>
using namespace std;
struct Alien{
unsigned long start;
unsigned long end;
bool proud;
bool operator<(const Alien& rhs) const{
return start < rhs.start;
}
Alien(int s,int e){ start = s; end=e; proud=true; }
Alien(){};
};
int mai... | true |
6b32250c2ade3b62f7502a6830cac2716d239c8a | C++ | leoreisdias/hangmanGame-C | /forca.cpp | UTF-8 | 5,521 | 2.515625 | 3 | [] | no_license | #include<bits/stdc++.h>
#include<windows.h>
#define tamanho 20
using namespace std;
char palavra_sec[tamanho];
char chutes[26];
int chutes_dados = 0;
int verifica_letra(char letra);
int chute_feito();
int enforca();
void intro();
void chute();
int chute_feito(char letra);
int ganhou();
void forca();
... | true |
5155068e8b3aa005ddcf4b485c988668ad891c6f | C++ | PiKesi522/Cpp-Test | /1046c.cpp | UTF-8 | 1,241 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <math.h>
#include <cstring>
#include <sstream>
using namespace std;
int present_location = 0;
void print()
{
cout << "case #" << present_location << ":" << endl;
return;
}
... | true |
46425a2f93d33322d57e5ef19d64f4e872d8ce2a | C++ | xueer828/practice_code | /cpp/POJ/poj1018.h | GB18030 | 4,709 | 2.65625 | 3 | [] | no_license | #ifndef _TEST_
#define _TEST_
// poj1018
// Copyright (c) 2012/12/08
// Author: xdutaotao (xdutaotao@gmail.com)
// Communication System
// 1<=1<=100 豸1<=mi<=100 ̵Ĵͼ۸B/P /۸
//DPʽ: f(n)=max{(B(n-1)+Bn)/(P(n-1)+Pn)}
//ȷ˼·ΪBPΪԼҪ"ʱ̶"ijһȻһļֵ
// + ö , ˮ
#include <cstdio>
#include <iostream>
#include <f... | true |
4504b186c6e918522c75b7e84f18b2620ffe699d | C++ | axshen/reproducibility_ci | /sample_code/cpp/Creature.h | UTF-8 | 828 | 3.28125 | 3 | [] | no_license | // Copyright 2021 Austin Shen
#ifndef SAMPLE_CODE_CPP_CREATURE_H_
#define SAMPLE_CODE_CPP_CREATURE_H_
#include <iostream>
#include <string>
class Creature {
protected:
std::string m_name;
char m_symbol;
int m_health;
int m_strength;
int m_gold;
public:
Creature(std::string name, char symbol... | true |
0fb956303bb5d2137a4748ca577e71e636885542 | C++ | UtotingPuwet/2021_Spring_CSC5 | /Project1/Constructing_Deck_V2/main.cpp | UTF-8 | 1,721 | 3.59375 | 4 | [] | no_license | /*
Author: Christian Fuentes
Date: April 18th, 2021 11:14pm
Purpose:Upgrading to make it print lines when certain number chosen using
switch case
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <cstdlib> //Random library
#include <ctime> //Time librar... | true |
fe6db2f1fd9912dee58013bceb4eeec9304857fc | C++ | kfaeghi/BTP305 | /Station.cpp | UTF-8 | 3,156 | 2.90625 | 3 | [] | no_license | /*
Name: Khashayar Faeghi
Senca Email: kfaeghi@myseneca.ca
Seneca Id: 125630186
Date: 11/28/2020
I have done all the coding by myself and only copied the code that my professor provided to complete my workshops and assignments.
*/
#include "Station.h"
size_t Station::id_generator = 0;
size_t Station::m_wi... | true |
173816160dd10e00fef486441552d453075e4fcd | C++ | SkingXQ/codeTraining | /cppVersion/missingNumber.cpp | UTF-8 | 695 | 3.046875 | 3 | [] | no_license | /*
Link: https://leetcode.com/problems/missing-number/
Tips: similar with first missing number
*/
class Solution {
public:
int missingNumber(vector<int>& nums) {
if(!nums.size()) return 1;
int s = nums.size();
for(int i=0; i<s; i++) {
cout<<nums[i]<<endl;
if(... | true |
71c3452cd17534ab554708c0a146b5dfd1cb41db | C++ | joeaoregan/LIT-Yr3-AdvancedDigitalGameProgramming | /2-CodeBlocks/BoundaryStuff.h | UTF-8 | 963 | 2.6875 | 3 | [] | no_license | /*
2017/04/25 Joe made this
#include <SDL.h>
#include "Observer.h"
#include "GameObject.h"
#include "Message.h"
// Observer Virtual Base Class
class BoundaryStuff : public Observer { // Boundary Stuff class is a sub type of the Observer class
public:
~BoundaryStuff() { // Destructor
}
//virtua... | true |
26f9f2515ec47a1affa45c0f9db7d944a1c05114 | C++ | DDDANBO/All-In-One-Project | /数据结构实验/实验二/实验二 一元稀疏多项式计算终版.cpp | GB18030 | 10,033 | 3.15625 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2
#define N 7 //Ķʽĸ
#define M 20 //ķΧ
typedef int ElemType;
typedef int Status;
typedef struct //ıʾ
{
float coef; // ϵ
int expn; /... | true |
e97ace04901b60695a9b2606b6643425ca44f7f6 | C++ | yardimli/Arduino | /kit/kit.ino | UTF-8 | 3,219 | 2.8125 | 3 | [] | no_license | int xPin = 0;
int yPin = 0;
int WalkSpeed = 25;
int potpin = 0; // analog pin used to connect the potentiometer
int WalkDirection = 0;
int WalkRGB = 0;
int OldWalkSpeed = 0;
int RedColor = 255;
int BlueColor = 255;
int GreenColor = 255;
#define BLUE_LED_DIO 10 /* Select the DIO for driving the BLUE LED */
#d... | true |
5b7d4c2dd9caba2d90296603f1a2e569bb2f5f4d | C++ | ecolog/IndustrialC | /preprocessor/main.cpp | UTF-8 | 1,583 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <sstream>
#include <stack>
#include <fstream>
extern int yylex();
extern FILE *yyin;
extern std::string cur_filename;
extern bool pp_gen_line_markers;
extern bool pp_retain_comments;
//extern std::stack<unsigned int> line_nums;
//extern std::stack<std::string> filenames;
FILE *output_file;... | true |
c19059b40e53e58bbcc6916cd4d7bfc74230e3d6 | C++ | Pkotova/Object-Oriented-Programming | /Polinom/task01/Polinom.cpp | UTF-8 | 6,187 | 3.09375 | 3 | [] | no_license | #include "stdafx.h"
#include "Polinom.h"
#include "Coefficient.h"
#include<iostream>
using namespace std;
void Polinom::copy(const Polinom& other)
{
this->power = other.power;
this->size = other.size;
this->capacity = other.capacity;
this->coefficients = new Coefficient[capacity];
for (int i = 0; i < other.size; ... | true |
891d42a2eb0e67aa26ed149af32b78c5b9353d35 | C++ | evilncrazy/spooner | /src/include/object.h | UTF-8 | 760 | 2.828125 | 3 | [
"MIT"
] | permissive | #ifndef SPOONER_OBJECT_H
#define SPOONER_OBJECT_H
#include <string>
enum ObjectType {
T_NONE, T_INT, T_DECIMAL, T_FUNCTION, T_CLOSURE, T_LIST, T_EXPR, T_NAME,
T_MAP
};
ObjectType str_to_type(const std::string& str);
// defines the functionality and attributes shared by all objects in Spooner
class SpObject ... | true |
2385df05359c164afb55dcf4e75b2a692bc96fa3 | C++ | HunterSun2018/sqlite_orm | /dev/pragma.h | UTF-8 | 5,426 | 2.578125 | 3 | [
"MIT",
"AGPL-3.0-only"
] | permissive | #pragma once
#include <string> // std::string
#include <sqlite3.h>
#include <functional> // std::function
#include <memory> // std::shared_ptr
#include <vector> // std::vector
#include "error_code.h"
#include "util.h"
#include "row_extractor.h"
#include "journal_mode.h"
#include "connection_holder.h"
namespac... | true |
e12805bb85fcf8ec20408b1af5f0c0f51c72b6b3 | C++ | anfavretto/JogoCores_PG201602 | /Jogo/JogoCores.cpp | ISO-8859-1 | 7,244 | 2.578125 | 3 | [] | no_license | #include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <GLFW/glfw3.h>
#include <vector>
#include <time.h>
#include "Jogo.h"
#include "Imagem.h"
#include "Fonte.h"
#include <stdlib.h>
#include <string>
#include<fstream>
using namespace Jogo;
using namespace std;
const int TotalRetangulosComprimento = 20;... | true |
fa53e9927c753cfe4a43023e4e38a88d7cdcfb21 | C++ | chen0040/cpp-ogre-mllab | /HTTPEngine/HTTPManager.cpp | UTF-8 | 3,684 | 2.8125 | 3 | [
"MIT"
] | permissive | #include "HTTPManager.h"
#include <Ogre.h>
#include "../OSEnvironment/OSEnvironment.h"
#include "../tinyxml/tinyxml.h"
HTTPManager* HTTPManager::mSingleton=NULL;
HTTPManager::HTTPManager()
: mEnabled(false)
{
if(mSingleton==NULL)
{
mSingleton=this;
}
else
{
throw Ogre::Exception(42, "Multiple instances not a... | true |
ae1cffd5aa565e5c2331859186efa5f0f2e3b436 | C++ | rekafekili/DataStructure | /BOJ/2230.cpp | UHC | 898 | 2.96875 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
using namespace std;
int N;
unsigned long M;
int seq[100001];
unsigned long res = 2000000000;
// 2230 :
int main(void) {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
cin >> N >> M;
for (int i = 0; i < N; i++)
{
cin >> seq[i];
}
sort(seq, seq +... | true |
17776f9237a128f9ca459650f2638cc687570510 | C++ | cow-coding/algorithm | /BOJ/C++/4796.cpp | UTF-8 | 645 | 2.8125 | 3 | [] | no_license | #include <iostream>
using namespace std;
int main()
{
int cnt{1};
while (1)
{
unsigned long long int L, P, V;
cin >> L >> P >> V;
if (L ==0 && P == 0 && V == 0)
break;
else {
unsigned long long int tmp;
tmp =... | true |
d314ad98448dc3a75537644b94e53ae166b7f65c | C++ | Arcan1010/Raycasting-engine | /include/Observer.h | UTF-8 | 1,070 | 2.875 | 3 | [] | no_license | //
// Created by Mateusz on 31.07.2020.
//
#ifndef GAME_OBSERVER_H
#define GAME_OBSERVER_H
#include "Camera.h"
#include "typedefs.h"
class Observer
{
Camera camera;
float sightRange;
float sightAngle;
// Ray casting variables
float rayStartingAngle;
float rayAngleDifference;
public:
//C... | true |
8371e5c438f900e6a43f5d1c84dfbb0142f11bc1 | C++ | jasons8021/POSD_ERDiagram | /ERDiagram/ERDiagram_UnitTesting/IntegrationTest.cpp | BIG5 | 14,247 | 2.90625 | 3 | [] | no_license | #include "IntegrationTest.h"
void IntegrationTest::SetUp()
{
_mkdir("testdata");
ofstream outputFile("testdata/test_file1.erd");
outputFile << "E, Engineer" << endl;
outputFile << "A, Emp_ID" << endl;
outputFile << "R, Has" << endl;
outputFile << "A, Name" << endl;
outputFile << "E, PC" << endl;
outputFile << ... | true |
ae583874148e651147b02980e1c990ee129979e7 | C++ | bojotamara/MapReduce | /partition.h | UTF-8 | 632 | 3.203125 | 3 | [] | no_license | #pragma once
#include <pthread.h>
#include <map>
// Comparator struct that allows the sorting of char * keys
struct CStringComparator {
bool operator()(char* a, char* b);
};
// Struct for the intermediate data structure used by the mappers and reducer
struct Partition
{
// holds the key/value pairs
st... | true |
fa4255b693539af6b12b84359634d4a2972bbfb2 | C++ | ocdian/competitive-code | /AtCoder/Educational DP Contest/F - LCS/main.cpp | UTF-8 | 1,115 | 2.703125 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
int dp[3010][3010];
string a,b;
string generateLCS(int n, int m) {
string lcs = "";
while (n > 0 && m > 0)
{
if (a[n-1]==b[m-1]) {
lcs += a[n-1];
n--;
m--;
}
else {
if (dp[n-1][m]>dp[n][m-1]... | true |
902109b9038a45b0c68a4a61e50fd128e63e732c | C++ | kbavishi/MineBench | /SEMPHY/programs/rateShift/posData.h | UTF-8 | 1,780 | 2.84375 | 3 | [] | no_license | // $Id: posData.h 2399 2014-03-13 22:43:51Z wkliao $
#ifndef POS_DATA
#define POS_DATA
#include "someUtil.h"
#include <iostream>
#include <iomanip>
class posData {
public:
posData(int num,const string& content, int numOfSeqsWithoutGaps, int numOfSeqs) :
_num(num), _content(content), _numOfSeqsWithoutGaps(numOf... | true |
586fed469160627c5f54cbb260ec14e532024c4b | C++ | RucheCo/project | /Arduino/DHT11.cpp | UTF-8 | 432 | 2.53125 | 3 | [] | no_license |
#include <SimpleDHT.h>
// for DHT11,
// VCC: 5V or 3V
// GND: GND
// DATA: 2
// 100nF entre VDD et GND
// R: 1.5 Kohm
int pinDHT11 = 2;
SimpleDHT11 dht11;
unsigned int GetHumidity() {
// read without samples.
byte humidity = 0;
byte temperature = 0;
if (dht11.read(pinDHT11, &temperature,... | true |
00b9c367085298f39c8e951b153db8d596b08f80 | C++ | Liam0205/leetcode | /algorithm/0811-Subdomain-Visit-Count/solution.cc | UTF-8 | 947 | 2.71875 | 3 | [] | no_license | class Solution {
public:
vector<string> subdomainVisits(vector<string>& cpdomains) {
std::unordered_map<std::string, size_t> visit_count;
for (auto s : cpdomains) {
std::istringstream iss(s);
size_t count;
std::string domain;
iss >> count >> domain;
... | true |
48ace0cbd7cc2ece71407331c5e03215601cdf5a | C++ | stradivarius10/Stradivarius | /ex5/Observer.cpp | UTF-8 | 702 | 2.53125 | 3 | [] | no_license | #include "Observer.h"
/* This code is a copy of the code we saw in class. YOSSI approved to use it as is!*/
//================================================================================
// Subject Implemenation
//================================================================================
void Subject::Atta... | true |
711c37295ceec19f4cac13ddc5d1a4827dee60ed | C++ | sticnarf/hane | /src/utils/buffer.cpp | UTF-8 | 4,841 | 3.265625 | 3 | [
"MIT",
"Vim",
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | #include "buffer.hpp"
#include <cstring>
#include <algorithm>
#include <stdexcept>
Buffer::Buffer()
: length(0), head(0) {
blocks.push_back(new BufferBlock);
}
void Buffer::push(const char *bytes, size_t len) {
size_t bytesPtr = 0;
while (bytesPtr < len) {
BufferBlock *block = blocks.back(... | true |
8ebce158430e0df2ec79b89096ccc82036ff3178 | C++ | TaniyaPeters/BorealEngine | /include/VertexBuffer.h | UTF-8 | 1,074 | 3.234375 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#include "Vertex.h"
namespace Boreal {
/**
* @brief Allows user to create and manage vertex buffers
*
* @section Description
*
* The vertex buffer class allows the user to create, bind, and unbind vertex buffers. This is used to create models along with the index buffer.
*
*/
class VertexBuffer {... | true |
0c3784bc09cbc237f5e625172f80a2dbdde2ce88 | C++ | rheehot/Algorithm-40 | /BOJ/1316/1316.cpp | UHC | 1,276 | 3.578125 | 4 | [] | no_license | #include <iostream>
bool isGroupWord(std::string str) {
bool check[26] = { false, };
int i = 0;
while (i < str.length() - 1) {
if (str[i] != str[i + 1]) {
check[str[i] - 'a'] = true;
if (check[str[i + 1] - 'a']) return false;
}
i++;
}
return true;
}
int main() {
int n, cnt = 0;
scanf("%d", &n);
st... | true |
727dc17fd8b027622b8a5bfa33990d72ee5f6a45 | C++ | GunterMueller/DBJ | /dbj/include/DbjRecordIterator.hpp | UTF-8 | 4,190 | 2.515625 | 3 | [] | no_license | /*************************************************************************\
* *
* (C) 2004-2005 *
* Lehrstuhl fuer Datenbanken und Informationssysteme *
* Friedrich-Sc... | true |
68092a7b475a6467e4c72c24394b007a07e2efa2 | C++ | ebirenbaum/ParticleSolver | /cpu/src/constraint/contactconstraint.cpp | UTF-8 | 2,254 | 2.640625 | 3 | [
"MIT"
] | permissive | #include "contactconstraint.h"
ContactConstraint::ContactConstraint(int first, int second, bool st)
: Constraint(), i1(first), i2(second), stabile(st)
{
}
ContactConstraint::~ContactConstraint()
{
}
void ContactConstraint::project(QList<Particle *> *estimates, int *counts)
{
Particle *p1 = estimates->at(i1)... | true |
fb954b00f86c4d815da366eb63374d4a92f7cd2c | C++ | wayne155/Algorithm | /templates/binary_search/binaryPow.cpp | UTF-8 | 875 | 3.203125 | 3 | [] | no_license | //
// Created by dell on 2021/9/8.
//
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long LL
// binaryPow 求 a^b % m
// 基于以下事实
// b % 2 = 1 : a^b = a * a ^(b-1)
// b % 2 = 0 : a^b = a^(b/2) * a^(b/2)
LL binaryPowRecursive( LL a, LL b , LL m ){
if (b ==0 ) return 1;
if ( b %2 ) r... | true |
4599690203bf36e9a50da7702b9428c604c7a29a | C++ | nessim-m/CS-202 | /myStackMain.cpp | UTF-8 | 2,285 | 4.25 | 4 | [] | no_license | #include <iostream>
#include <string>
#include "myStack.h"
using namespace std;
int main()
{
string str;// string variable to cin user input
cout<< "Enter the arithmetic expression: ";
getline(cin, str);
int leftside=0;
int rightside=0;// int counter variable
int k=0;// int counter variab... | true |
5d687d40e4a308add03b37278b7650ff04f3a102 | C++ | FOSS-society/libre-engine | /include/system/Mouse.hpp | UTF-8 | 645 | 2.703125 | 3 | [] | no_license | #ifndef MOUSE_HPP
#define MOUSE_HPP
#include "../math/vector2.hpp"
#include <SDL2/SDL.h>
namespace libre{
namespace system{
enum class ButtonPress{
LEFT,MIDDLE,RIGHT,X1 , X2, NONE
};
class Mouse{
private:
math::Vector2<int32_t> mousePosition;
ButtonPress m_ButtonPress;
... | true |
6a76ea3cfe4a60da07d10276c3995202dc5e908c | C++ | clatisus/ACM-ICPC-Team-Archive | /zhongzihao-personal/51nod/1170.cpp | UTF-8 | 11,634 | 2.671875 | 3 | [] | no_license | #include<bits/stdc++.h>
typedef long long ll;
typedef __int128 i128;
const ll base1 = 1ll << 50;
const ll base2 = 298023223876953125ll;
int tot;
struct Big{ // 仅支持非负整数
static ll base; // 修改它时记得修改输入输出格式
static int type;
static int maxbit;
std::vector <ll> a;
int len;
Big():len(0){}
B... | true |
d46027d39961450b6be59b861c658fdbf4b856e1 | C++ | openbmc/phosphor-ipmi-blobs | /test/ipmi_close_unittest.cpp | UTF-8 | 1,318 | 2.703125 | 3 | [
"Apache-2.0"
] | permissive | #include "ipmi.hpp"
#include "manager_mock.hpp"
#include <cstring>
#include <string>
#include <gtest/gtest.h>
namespace blobs
{
using ::testing::Return;
TEST(BlobCloseTest, ManagerRejectsCloseReturnsFailure)
{
// The session manager returned failure to close, which we need to pass on.
ManagerMock mgr;
... | true |
950e39136521222d30808d76ee8729b1f913e3ee | C++ | iwoplaza/Desidia-Engine | /Desidia Engine/src/engine/gameobject/component/ComponentMesh.cpp | UTF-8 | 1,407 | 2.59375 | 3 | [] | no_license | #include "ComponentMesh.hpp"
#include "../../rendering/shader/ShaderManager.hpp"
#include "../../rendering/geometry/Mesh.hpp"
#include "../../Resources.hpp"
#include "../../rendering/material/Material.hpp"
#include <iostream>
ComponentMesh::ComponentMesh(std::string _model, std::string _material, unsigned int _polygon... | true |
6f5c36c3c75c1463127705356969ddc7f61658bb | C++ | minotru/Bizarre | /character_interface.cpp | UTF-8 | 4,011 | 3.25 | 3 | [] | no_license | #include "stdinclude.h"
#include "character.h"
#include "items.h"
void createCharacter( Character& pers )
{
int k;
cout << "Hi \nPress 1. to start a new game \nPress 2. to load saved parametres\n";
cin >> k;
while ( k<1 || k>2 )
{
cout << "Incorrect enter, try again" << endl;
... | true |
9782b6bcd6e09d2e3f23d8ffcbfe84cbb75fecbd | C++ | housemeow/POSD | /103598010/103598010_Test/ellipse_decorator_test.cpp | UTF-8 | 1,428 | 3.03125 | 3 | [] | no_license | #include "stdafx.h"
#include <limits.h>
#include "gtest/gtest.h"
#include "ellipse_decorator.h"
#include "node.h"
class MockGraphics : public IGraphics
{
public:
void drawText(string text, int x, int y, int width, int height)
{
throw string("drawText");
}
void drawRectangle(int x1, int y1, int ... | true |
5932ae0bcff12328aff818d5455c9feeeb427de8 | C++ | dibakma/revreaddy | /src/MeanSquaredDisplacement.cpp | UTF-8 | 4,930 | 2.8125 | 3 | [] | no_license | /* MeanSquaredDisplacement.cpp */
#include "MeanSquaredDisplacement.h"
MeanSquaredDisplacement::MeanSquaredDisplacement(
std::vector<Particle>& activeParticles,
unsigned int pTypeId,
double time,
double boxsize,
std::string inFilename)
{
this->recPeriod = 1;
this->clearPeriod = 0;
this->filename = inFilename;... | true |
2ac1e8812d6d450451e79820a10f39fd51edb7bb | C++ | dududududd/Computer-Graphics | /完全镜面反射【区域光】渲染/Ray casting/World.h | GB18030 | 3,321 | 2.546875 | 3 | [] | no_license | #pragma once
#include<vector>//vector
#include"ViewPlane.h"
#include"Sphere.h"
#include"Plane.h"
#include"GeometricObject.h"
#include"Whitted.h"
#include"Maths.h"
class Light;
#include"Camera.h"
class PinHole;
#include"Instance.h"
//#include"Grid.h"
//#include"CBezierPatch.h"
#include"CTeapot.h"
#include"Box.h"
#inc... | true |
658ce73cf3501f41e62ae77f534785edd9f62a98 | C++ | yqekzb123/homework-wkdb | /system/abort_txn_queue.h | UTF-8 | 833 | 2.59375 | 3 | [] | no_license |
#ifndef _ABORTTXN_QUEUE_H_
#define _ABORTTXN_QUEUE_H_
#include "global.h"
#include "universal.h"
struct abort_txn_entry {
uint64_t penalty_end;
uint64_t txn_id;
abort_txn_entry() {
}
abort_txn_entry(uint64_t penalty_end, uint64_t txn_id) {
this->penalty_end = penalty_end;
this->txn_id = txn_id;
}... | true |
f0da57ef18f2e944c7a9945da6cd09c14da019e3 | C++ | rkgilbert10/CSCI-21-FALL-2015 | /Project3/DLNode.h | UTF-8 | 1,642 | 3.359375 | 3 | [] | no_license | /* Header file for DLNode
* Created by Rachel Gilbert
* Created:10/30/15
* Modified: 10/31/15
* Notes:
*/
#pragma once
#include <iostream>
#include <sstream>
using namespace std;
class DLNode {
private:
int contents;
DLNode* nextNode;
DLNode* previousNode;
public: ... | true |
c7315435e6600161a8588740f4f66df8815e1b5a | C++ | bamelegari/cs372_chainOfResponsibility | /assemblers.cpp | UTF-8 | 920 | 2.578125 | 3 | [] | no_license | //assemblers.cpp
#include "assemblers.h"
#include <iostream>
using std::cout;
using std::endl;
void partAAssembler::assemble(char part)
{
if (part == 'A')
cout << "Assembling part A" << endl;
else
{
cout << "Assembler A skipping" << endl;
assemblyInterface::assemble(part);
}
}
void partBA... | true |
40ecd815da4693df7975699e62d10a70a79adaf7 | C++ | zyxrrr/LeetCode | /300-Longest Increasing Subsequence/Solution.cpp | UTF-8 | 696 | 2.6875 | 3 | [] | no_license | class Solution {
public:
int lengthOfLIS(vector<int>& nums) {
if (nums.empty()){return 0;}
int maxans = 1, maxtmp = 0;
vector<int> ans(nums.size(), 1);
for (int i = 1; i < nums.size(); i++){
maxtmp = 0;
for (int j = 0; j < i; j++){
... | true |
3c9ca135cef60b4ae56c4de88cb969cc053b6607 | C++ | HaoyaWHL/LeetCode | /LeetCode_List/86. Partition List.cpp | UTF-8 | 868 | 3.609375 | 4 | [] | no_license | // 86. Partition List
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
ListNode* partition(ListNode* head, int x) {
if (head==NULL) { return NULL; }
... | true |
65c8d1e436c760a8124bb53b26b0cc80060011f6 | C++ | ahamache/projet_lo21 | /xml_dom.cpp | UTF-8 | 12,667 | 2.828125 | 3 | [] | no_license | #include "xml_dom.h"
#include <iostream>
using namespace std;
Xml_Dom::Xml_Dom(const QString& param) : QWidget(){
QDomDocument *dom = new QDomDocument("list_Automate"); /*! On créé un objet dom de type QDomDocument*/
QFile xml_doc("save_autocell.xml"); /*! On ouvre le fichier XML qui contient les autom... | true |
1ab0c632c53ecfeb4d471d1ff035f9119c3b15cb | C++ | kamyu104/LeetCode-Solutions | /C++/parse-lisp-expression.cpp | UTF-8 | 1,747 | 3.0625 | 3 | [
"MIT"
] | permissive | // Time: O(n^2)
// Space: O(n^2)
class Solution {
public:
int evaluate(string expression) {
vector<string> tokens{""};
unordered_map<string, string> lookup;
vector<pair<vector<string>, unordered_map<string, string>>> stk;
for (const auto& c : expression) {
if (c == '(')... | true |
48a904eafd0c5ce14ac920ca9911c947223bcdbc | C++ | cc-catch/cppcourse | /course02/homework01/joost/linkedlist.h | UTF-8 | 447 | 3.15625 | 3 | [] | no_license | #pragma once
#include <array>
#include <stdexcept>
#include <memory>
struct Node
{
int value;
Node* next;
};
class LinkedListInt
{
public:
LinkedListInt();
//LinkedList(IteratorInt);
int size() const; // time complexity = 1
void append(int value); // time complexity = o*n
int pop_front(); // time complexity ... | true |
8caa1709462111a492dfba886e41f18faca8817e | C++ | shootan/Terraria | /terraria/HelloWorld/win32/AttackManager.h | UTF-8 | 1,574 | 2.734375 | 3 | [] | no_license | #pragma once
#include "cocos2d.h"
using namespace cocos2d;
#include "ItemManager.h"
#include "Object_Hero.h"
class AttackManager
{
private:
AttackManager()
{
m_pHero = NULL;
instance = NULL;
}
~AttackManager()
{
m_pHero = NULL;
instance = NULL;
}
Object_Hero* m_pHero;
public:
static AttackMana... | true |
73096e61a25b2de3578ac50b4ccd12e917128551 | C++ | Computational-Physics-Research/Computational-Physics-1 | /CxxProgramming/MolecularDynamics/src/particlegod.cpp | UTF-8 | 4,630 | 3.03125 | 3 | [] | no_license | #include <vector>
#include <random>
#include <fstream>
#include <string>
#include <sstream>
#include "../include/particlegod.hpp"
#include "../include/particle.hpp"
#include "../include/settings.hpp"
void ParticleGod::generate_particles()
{
int idx = 1;
// Generate particles on a quasi random grid
// eac... | true |
a3d0b2e43a299dccd7455923470d2b8f74c39570 | C++ | socc-io/algostudy | /BackTrackWorld/scale/scale_by_young.cpp | UTF-8 | 1,041 | 3.109375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
using namespace std;
int cnt;
int compare(const void * a, const void * b)
{
return (*(int*)a - *(int*)b);
}
void UtilGetNumber(int _jurely_num, int _mid, int start, int _jurely[], int sum)
{
for (int j = start; j < _jurely_num; j++) {
if (_jurely[j] + sum > _mid)
break... | true |
65242b24eeab91fd8598ad6e278c022ecffad7fd | C++ | asundov/Parking_Sensor_Project | /Transmitter/Sensors.cpp | UTF-8 | 836 | 2.859375 | 3 | [] | no_license | #include "Sensors.h"
#define IN4 4
const int trigPin = 5;
const int echoPin = 6;
SENSORS::SENSORS(){}
SENSORS::~SENSORS(){}
float SENSORS::distance(){
long duration;
int distance = 0;
delayMicroseconds(10);
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
// ... | true |
e7731b2e7b4e86fa300cfdc69522d8f263eea0ba | C++ | xixi2/linux_system_programing | /process/mmap1.cpp | UTF-8 | 695 | 2.640625 | 3 | [] | no_license | //
// Created by xixi2 on 2020/3/5.
//
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/mman.h>
int main(int argc, char *argv[]) {
int fd = open("english.txt", O_RDWR);
int len = lseek(fd, 0, SEEK_END);
void *ptr = mmap(NULL, len, PROT_READ ... | true |
f082d0805ce1a66fc8ed3b9b931bbbecab7b28be | C++ | hinnalear/esp32cam-demo | /Misc/VeryBasicWebserver.ino | UTF-8 | 14,527 | 2.8125 | 3 | [] | no_license | // ----------------------------------------------------------------
//
//
// ESP32 / ESp8266 very basic web server demo - 11Jan21
//
// shows use of AJAX to show updating info on the web page
//
//
// ----------------------------------------------------------------
// ----------------------------------... | true |
23479739fccde07f4bb9b80a3bcdf3e867d29dae | C++ | holequotin/Discrete-Math | /subset1.cpp | UTF-8 | 1,028 | 3.453125 | 3 | [] | no_license | #include<iostream>
using namespace std;
//Khai báo giá trị ban đầu
void Init(int k,int arr[]){
for(int i=1;i<=k;i++){
arr[i]=i;
}
}
void Out(int arr[],int k){
for(int i=1;i<=k;i++){
cout<<arr[i]<<" ";
}
cout<<endl;
}
//Hàm sinh phần tử tiếp theo,tìm phần tử đầu tiên chưa đạt max rồi... | true |
b178e6f4e1255bb49663fb965c65f682fee52d7e | C++ | bgoodger/engsci331 | /eigen/myEigenFunctions.h | UTF-8 | 580 | 2.703125 | 3 | [
"MIT"
] | permissive | /*
EIGEN FUNCTION HEADER FILE
Ben Goodger
1822049
*/
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#define PI 3.14159265358979323846
#define eps 0.00000000000000000000001
void power_method(double **A, double *y, int n, double &lamdba, double delta);
void eigen_all (double **A, double ... | true |
f0f8f14ca536f3f096e3e3be98802fec19b6b5a6 | C++ | paulosuzart/graphic_editor | /src/VerticalSegmentCommand.cpp | UTF-8 | 814 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | /*
* VerticalSegmentCommand.cpp
*
* Created on: Jan 14, 2017
* Author: suzart
*/
#include "VerticalSegmentCommand.h"
namespace paulosuzart {
VerticalSegmentCommand::VerticalSegmentCommand(GraphEditor* editor,
string command) :
Command(editor, command) {
}
VerticalSegmentCommand::~VerticalSegmentComma... | true |
caf783686d0a8142a52ac9f281086519e674ce0b | C++ | skxabc/skx | /c++_learn/src/specialTemplate/specialTemplate.cpp | UTF-8 | 566 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <cstring>
using namespace std;
//function template
template<class T>
int compare(const T& l, const T& r){
cout<<"in template<class T>..."<<endl;
return l-r;
}
//function template special
//template <>
int compare(const char* l, const char* r){
cout<<"in special template<>..."... | true |
62f512f26e72777cebe681ddf314a4db57d2ce2b | C++ | IvanFilipov/FMI-OOP | /theoritical_examples/Polymorphism/Farm/Dog.cpp | UTF-8 | 326 | 3.046875 | 3 | [] | no_license | #include "Dog.h"
Dog::Dog(const char* src) : Animal(src) {
}
void Dog::makeSound() {
std::cout << "Dog with name " << name << " : bark! \n";
}
Animal* Dog::clone() {
//this is how we make a new heap object as same as ours
//and we return base class pointer in order to use the polymorphism
return new Dog(*th... | true |
8c6c266e438928b762650cba4f2d7ca50d1024e1 | C++ | cminusbrain/my_own_std | /transport/socket/io_socket.h | UTF-8 | 567 | 2.90625 | 3 | [] | no_license | #pragma once
#include <transport/socket/base_socket.h>
#include <vector>
#include <cstdint>
class IoSocket : public BaseSocket
{
public:
IoSocket();
explicit IoSocket(int fd);
IoSocket(IoSocket &&another) noexcept;
IoSocket &operator=(IoSocket &&another) noexcept ;
void Send(std::vector<uint8_... | true |
a7d3d25a34dc77fc4439cfedf484cc2afc78ab14 | C++ | closedsum/core | /CsPlugin/Source/CsCore/Public/Types/Property/Value/CsProperty_Value.h | UTF-8 | 1,731 | 2.65625 | 3 | [
"MIT"
] | permissive | // Copyright 2017-2023 Closed Sum Games, LLC. All Rights Reserved.
#include "Types/Property/CsProperty.h"
#pragma once
template<typename ValueType>
struct TCsProperty : public ICsProperty
{
public:
ValueType DefaultValue;
ValueType Value;
ValueType Last_Value;
protected:
bool bDirty;
public:
TMulticastDelegate<v... | true |
b7bdd05b5bd570406b5e2e1c546aa76551a49584 | C++ | jpiercefield/CPlusPlus | /CSC 2110/Prog2/prog2.cpp | UTF-8 | 966 | 3.59375 | 4 | [] | no_license | //James Logan Piercefield
#include "deck.h"
//Main of the Program, This also counts the consolidations for us.
//Meanwhile it also tracks how many consecutive consolidations we have
int main()
{
int num_consolidation=0;
int num_consecutive_consolidation=0;
int num_max_consolidation=0;
Deck list;
ifstream file("d... | true |
e1e3dbff0b3a905655c678c6721c6c18de53384d | C++ | mkltaneja/DS-ALGO | /TREE_revision/graph_1.cpp | UTF-8 | 4,171 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
class edge
{
public:
int v = 0;
int w = 0;
edge(int v, int w)
{
this->v = v;
this->w = w;
}
};
int N = 7;
vector<vector<edge>> graph(N, vector<edge>());
// BASIC=============================================================... | true |
a68229d3c852f93ba9d2d9d92a39290ab59a28b9 | C++ | boryssmejda/CryptoChallenges | /src/Numbers/inc/Decimal.hpp | UTF-8 | 730 | 3.03125 | 3 | [] | no_license | #pragma once
#include <array>
#include "BaseNumber.hpp"
#include "Binary.hpp"
namespace crypto
{
class Decimal final: public BaseNumber
{
public:
explicit Decimal(const crypto::Binary& t_binaryRepresentation);
explicit Decimal(const std::string& t_number);
auto getStringRepresentation() const -> std::str... | true |
f25a7c3a0ca5e8414fc33d233b45492e4f4a0d98 | C++ | Bots-United/joebot | /wpstat3d/cwpstuff.h | UTF-8 | 9,392 | 2.65625 | 3 | [] | no_license | /******************************************************************************
JoeBOT - a bot for Counter-Strike
Copyright (C) 2000-2002 Johannes Lampel
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the F... | true |
e8218e8087c03d0942459835c28a60dd369e4e60 | C++ | kyleashcraft/COMP130 | /labs/lab09/nine_increments.cpp | UTF-8 | 500 | 3.96875 | 4 | [] | no_license | //File: nine_increments.cpp
//Name: Ashcraft, Kyle
//Date: 2/14/2018
//Compiler used: MS Visual Studio 2018
//Purpose: Increment from 0 to 117 in steps of 9 using a for and while loop.
#include <iostream>
using namespace std;
int main(){
cout << "Output from the for-loop... \n";
for(int i = 0; i ... | true |
8ed385b9b047493b438c8b743999e84cf0be9915 | C++ | Minyeob/Algorithm | /Algorithm Practice/Algorithm Practice/11444.cpp | UTF-8 | 633 | 2.859375 | 3 | [] | no_license | #include <cstdio>
#include <map>
using namespace std;
map<long long, long long> trans;
#define div 1000000007LL;
long long fibo(long long n)
{
if (n == 1 || n == 2)
return 1;
else if (trans[n])
return trans[n];
else
{
if (n % 2 == 1)
{
long long m = (n + 1) / 2;
long long result = fibo(m)*fibo(m) + f... | true |
23af4c5df3f42bb1006ef7c4ee91619a5b55fab3 | C++ | mcarreiro/martin301290-sistemasoperativos | /tp2/src/backend-pthreads-aMano/RWLock.cpp | UTF-8 | 380 | 2.609375 | 3 | [] | no_license | #include "RWLock.h"
RWLock :: RWLock() {
pthread_rwlock_init(&(this->rwlock),NULL);
}
void RWLock :: rlock() {
pthread_rwlock_rdlock(&(this->rwlock));
}
void RWLock :: wlock() {
pthread_rwlock_wrlock(&(this->rwlock));
}
void RWLock :: runlock() {
pthread_rwlock_unlock(&(this->rwlock));
}
void RWLock :... | true |
f98b546b6c3a9116d5e442bc8557bf88f5cf931b | C++ | andeplane/molecular-dynamics | /src/filemanager/filemanager.cpp | UTF-8 | 2,380 | 2.546875 | 3 | [] | no_license | #include <filemanager/filemanager.h>
#include <topology.h>
#include <particles/atom.h>
#include <filemanager/mts0io.h>
#include <system.h>
#include <unitconverter.h>
FileManager::FileManager() :
m_movieFile(NULL)
{
}
FileManager::~FileManager()
{
if(isMovieFileOpen()) m_movieFile->close();
}
bool FileManage... | true |
6ff7c25c570e3051ad672b9a610074f7a0b8d2cc | C++ | RaideNetSquad/shapes | /main.cpp | UTF-8 | 1,184 | 3.625 | 4 | [] | no_license | #include <iostream>
#include "vector.h"
double dotProduct(const Vector& vect_A, const Vector& vect_B);
double crossProduct(const Vector& Vector1,const Vector& Vector2);
bool collinear (const Vector& Vector1, const Vector& Vector2);
int main()
{
double v1x = 0.0;
double v1y = 10.0;
double v2x = 10.0;
d... | true |
36aa2eb3d80d395bce6facf7919346d00c148544 | C++ | dfm/AstroFlow | /astroflow/ops/kepler_op.cc | UTF-8 | 2,593 | 2.734375 | 3 | [
"MIT"
] | permissive | #include "tensorflow/core/framework/op_kernel.h"
#include "tensorflow/core/framework/tensor_shape.h"
#include "tensorflow/core/framework/shape_inference.h"
#include <cmath>
#include <limits>
using namespace tensorflow;
template <typename T>
inline T kepler (const T& M, const T& e, int maxiter, float tol) {
T E0 = ... | true |
efe2042d0c0fc3687983194dd8637dc182240a5a | C++ | algorithm-archivists/GathVL | /include/objects/curve.h | UTF-8 | 522 | 2.765625 | 3 | [
"MIT"
] | permissive | #ifndef GATHVL_CURVE_H
#define GATHVL_CURVE_H
#include "object.h"
#include "../types/color.h"
#include "../types/vec.h"
struct curve : object {
color clr;
vec origin;
std::vector<vec> points;
void draw(cairo_t *) const override;
curve(const std::vector<vec>& points, vec origin) :
clr({1.... | true |
c5022a8c95194fbcd996a0fb58b4b66faf5806f4 | C++ | JPenuchot/eve | /include/eve/function/ellint_1.hpp | UTF-8 | 3,349 | 2.90625 | 3 | [
"MIT"
] | permissive | //==================================================================================================
/*
EVE - Expressive Vector Engine
Copyright : EVE Contributors & Maintainers
SPDX-License-Identifier: MIT
*/
//==================================================================================================
#pr... | true |
8acf6456edfb19322edd7804bfc58e56908bf015 | C++ | AlterFritz88/intro_to_prog_c_plus_plus | /task_1_5_15.cpp | UTF-8 | 380 | 3.09375 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int maxs = 0, n;
vector<int> array;
cin >> n;
while (n != 0){
array.push_back(n);
cin >> n;}
for (int i=1; i < array.size() - 1; i++){
if ((array[i-1] < array[i]) and (array[i] > array[i+1])){
... | true |
6e86d18e134614b95255a3e71c7ac960a46952f0 | C++ | CrimsonCrow/codeforces | /4-div_2_A/05/helpful_maths.cpp | UTF-8 | 521 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
int main() {
std::string st = "";
std::cin >> st;
std::vector<char> vc;
std::string re = "";
for(auto i : st) {
if(i == '+'){
continue;
} else {
vc.push_back(i);
}
}
std::sort(vc.begin(), vc.end());
for(auto i : vc){
... | true |
5555963c89fe9ed9f36bd5858a9ad5c36e34feab | C++ | MatloobAltaf/LUMS-Projects | /CHESS on Console/UInterface.cpp | UTF-8 | 4,111 | 3.421875 | 3 | [] | no_license | #include <iostream>
//#include <iomanip>
#include <string>
#include <vector>
#include <chrono>
using namespace std;
#include "UInterface.h"
// Save the next message to be displayed (regardind last command)
string next_message;
// User interface
// All the functions regarding the user interface are in this section
//... | true |
510f10f1e2af6fa63926db2ab16fdc340d66a2ea | C++ | bradbell/dismod_at | /include/dismod_at/weight_info.hpp | UTF-8 | 1,759 | 2.546875 | 3 | [] | no_license | // SPDX-License-Identifier: AGPL-3.0-or-later
// SPDX-FileCopyrightText: University of Washington <https://www.washington.edu>
// SPDX-FileContributor: 2014-22 Bradley M. Bell
// ----------------------------------------------------------------------------
# ifndef DISMOD_AT_WEIGHT_INFO_HPP
# define DISMOD_AT_WEIGHT_INF... | true |
dc100f59da21a4c180203ffe4a2074a3e030981f | C++ | haibin-chen/leetcode_record | /leetcode_29.cpp | UTF-8 | 3,950 | 3.765625 | 4 | [] | no_license | //
// Created by 陈海斌 on 2020-01-25.
//
#include <string>
#include <iostream>
using namespace std;
//divide two integers without using multiplication, division and mod operator.
//思路1 减法 超时
/*
class Solution {
public:
int divide(int dividend, int divisor) {
if (dividend < INT32_MIN or divisor < INT32_MIN ... | true |
bb86fc26fa16db961266807fd8acc9ac487cc74f | C++ | sameer-h/CSCE121 | /Homeworks/miscellaneous/LW5/pimain.cpp | UTF-8 | 852 | 3.234375 | 3 | [
"MIT"
] | permissive | #include <iostream>
#include <cstdlib>
#include <cmath>
using namespace std;
bool isInseedno(double x, double y, double r)
{
// inscribed inseedno of the circle
return sqrt(x*x + y*y) <= r;
}
bool throwDart(int s)
{
int x, y;
x = -s / 2 + rand() % (s + 1);
y = -s / 2 + rand() % (s + 1);... | true |