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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
76ef3d60971cd9b285d0967522384d9661c0890b | C++ | moukayz/AlgorithmTraining | /leetcode/344.cpp | UTF-8 | 971 | 4.25 | 4 | [
"MIT"
] | permissive | /*
Reverse String
Write a function that reverses a string. The input string is given as an array of characters char[].
Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory.
You may assume all the characters consist of printable ascii characters.... | true |
5677bb9ffbb4ffdf583cb088beb2022b36e2f7e3 | C++ | VladasZ/Homework | /C++/Урок 32 - Виртуальные функции/Урок 32 - Виртуальные функции/Square.cpp | UTF-8 | 852 | 3.84375 | 4 | [] | no_license |
class Square{
public:
virtual float square() = 0;
};
class Rectangle: public Square{
public:
int high;
int length;
Rectangle(int high, int length) : high(high), length(length){}
virtual float square(){
return high*length;
}
};
class Circle : public Square{
public:
int radius;
Circle(int radius):radius(radi... | true |
ee4691971eb22afb223b391dd9c50776445ee433 | C++ | Etherealblade/Programming-Contest-Challenge-Book | /Chapter04/Section4-2/Nim/Nim/Nim.cpp | UTF-8 | 482 | 2.84375 | 3 | [] | no_license | /*
Page 311
*/
#include <iostream>
#include <algorithm>
using namespace std;
#define MAX_N 1024
int N, Arr[MAX_N];
void solve()
{
int x = 0;
for (int i = 0; i < N; i++)
{
x ^= Arr[i];
}
if (x != 0)
{
puts("Alice");
}
else
{
puts("Bob");
}
}
int main()
{
FILE *file;
freopen_s(&file, "input.txt",... | true |
6d8ef61f883f2f6fc5eeaee6b6cf8cfdf0c5aa44 | C++ | HarshRaikwar/Leetcode-Submissions | /788.cpp | UTF-8 | 730 | 2.8125 | 3 | [] | no_license | class Solution {
public:
int rotatedDigits(int n) {
unordered_set<int> valid;
valid.insert({2,5,6,9});
unordered_set<int> invalid;
invalid.insert({3,4,7});
int count = 0;
for(int i=1 ; i<=n ; i++){
int num = i;
int flag = 1, cnt=0;
... | true |
dbb74a610e1e35c071acab22ff59083845f063cc | C++ | bbw7561135/Numerical-Algorithms-2020 | /001.cpp | UTF-8 | 6,260 | 2.71875 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<fstream>
using namespace std;
/////////////////////////////////////////////
//2nd-order finite-volume implementation of inviscid Burger's
//with piecewise linear slope reconstruction
//u_t + u*u_x = 0 with outflow conditions
/////////////////////////////////////////////
//... | true |
8916b38213c056e4cd4443144e692a4912c5adff | C++ | AshleySetter/AdventOfCode2019 | /day2/part2.cpp | UTF-8 | 2,617 | 3.609375 | 4 | [] | no_license | #include <iostream>
#include <string>
#include <fstream>
#include <sstream>
#include <vector>
#include <typeinfo>
// pass vector by reference as passing the vector intself creates a copy
void read_initial_state(std::vector<int> &Intcode){
std::ifstream readfile;
std::string filetext;
readfile.open("input.txt"... | true |
40661c37fc7934aab94bdf71db6eb25869d3f1d4 | C++ | blajzer/laminaFS | /src/util/Semaphore.h | UTF-8 | 627 | 2.890625 | 3 | [
"MIT"
] | permissive | #pragma once
// LaminaFS is Copyright (c) 2016 Brett Lajzer
// See LICENSE for license information.
#include <condition_variable>
#include <mutex>
#include <cstdio>
namespace laminaFS {
namespace util {
class Semaphore {
public:
Semaphore(uint32_t value = 0) : _value(value) {}
~Semaphore() {}
void notify() {
... | true |
243f587eccacf598e58bd4c42daff623dff1dcb1 | C++ | chastis/TickTackToe | /Tick_Tack_Toe/Game.cpp | UTF-8 | 14,429 | 2.875 | 3 | [] | no_license | #include "Game.h"
#include <iostream>
//size of cell in px
#define CELL_SIZE 160
void merge(std::vector<Attack> &lines)
{
for (int i = 0; i < lines.size(); i++)
{
for (int j = i + 1; j < lines.size(); j++)
{
if (lines[i].line.end == lines[j].line.start && lines[i].line.type == lines[j].line.ty... | true |
e480ca0e543b11d4e18234adede7133e91040cb2 | C++ | SanketChidrewar/Coding-Challenges | /CPP ASSIGNMENT/ASSIGN_5/ASSIGN_5_QUE_3/src/manager.h | UTF-8 | 477 | 2.734375 | 3 | [] | no_license | /*
* manager.h
*
* Created on: 09-Mar-2020
* Author: sunbeam
*/
#ifndef MANAGER_H_
#define MANAGER_H_
#include<iostream>
#include"employee.h"
using namespace std;
class manager : public employee
{
private:
float bonus;
public:
manager();
manager(int id,float sal,float bonus);
int get_Bonus();
void se... | true |
0d093e7523621eb4380224638f20f866afe87ed2 | C++ | lovelyyoshino/learnopencv | /Contour-Detection-using-OpenCV/cpp/contour_extraction/contour_extraction.cpp | UTF-8 | 1,985 | 2.78125 | 3 | [] | no_license | #include<opencv2/opencv.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main() {
/*
Contour detection and drawing using different extraction modes to complement
the understanding of hierarchies
*/
Mat image2 = imread("../../input/custom_colors.jpg");
Mat img_gray2;
c... | true |
54b1210558d284a7af5e4c3e455c6a48bcd96f38 | C++ | Mewael/SpringMvcProject | /revision/linked_list/cpp/queue/queue.cpp | UTF-8 | 1,583 | 3.375 | 3 | [] | no_license | //Filmon Gebreyesus
//03/04/2015
//demo for data structure concepts
#include<iostream>
#include"queue.h"
#include<string.h>
using namespace std;
Llist::Llist()
{
front=NULL;
size=0;
}
Llist::~Llist()
{
while(front!=NULL)
{
tmpPtr=front;
front=front->next;
delete tmpPtr;
}
}
void Llist::push_back(string d... | true |
431effeb2bb8796ec16178cd61f2cbe4cd5d8e17 | C++ | rjoleary/programming-problems | /project-euler/problem13.cpp | UTF-8 | 615 | 3.015625 | 3 | [
"MIT"
] | permissive | #include <cstdint>
#include <fstream>
#include <iostream>
#include <sstream>
int main()
{
std::ifstream file("problem13.txt");
std::int64_t sum = 0;
for (int i = 0; i < 100; i++)
{
// Only read the first 15 digits. It works out the same as
// long as addition is concerned.
... | true |
afa7855f8ddf4d7e6868919f933c0e2e61abe5a7 | C++ | akuendig/algolab | /week_10_linear_and_quadratic_programming/1_diet/diet/main.cpp | UTF-8 | 2,295 | 2.671875 | 3 | [] | no_license | #include <iostream>
#include <cassert>
#include <CGAL/basic.h>
#include <CGAL/QP_models.h>
#include <CGAL/QP_functions.h>
#include <vector>
#include <cmath>
using namespace std;
#ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h>
typedef CGAL::Gmpz ET;
#else
#include <CGAL/MP_Float.h>
typedef CGAL::MP_Float ET;
#endif
// pro... | true |
410417aed5f7ef090b0104cc53310e5aa612aff8 | C++ | jacktaylor2048/tone_piano | /tone_piano/src/main.cpp | UTF-8 | 3,235 | 3.21875 | 3 | [] | no_license | #include <conio.h>
#include <iostream>
#include "note.h"
const int CONSOLE_WIDTH = 64;
const int CONSOLE_HEIGHT = 16;
const unsigned char DEFAULT_NOTELENGTH = 150;
const unsigned char MIN_NOTELENGTH = 10;
const unsigned char MAX_NOTELENGTH = 255;
const char ESCAPE_KEY = 27;
// Clear console
void clear()
{
DWORD n;
... | true |
fdad5aca3fee4cbf751a8dfeb84e5f73c7ab2978 | C++ | prakharvk/ns3 | /socket/server.c | UTF-8 | 1,413 | 2.984375 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <arpa/inet.h>
#include <unistd.h>
using namespace std;
int main(){
int ssock, csock;
unsigned int length;
struct sockaddr_in server, client;
if((ssock=socket(AF_INET, SOCK_STREAM, 0)) ... | true |
e38567c70f0477d0760c91d539bef0f25c238302 | C++ | tnotstar/tnotbox | /C++/Learn/Cplusplus4c/generic_arrsum.cpp | UTF-8 | 538 | 3.765625 | 4 | [] | no_license | #include <iostream>
using namespace std;
template <class Summable>
Summable arrsum(T *arr, int n) {
Summable sum = 0;
for (int i = 0; i < n; i++)
sum += arr[i];
return sum;
}
int
main () {
double arr[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
int n = sizeof(arr)/sizeof(arr[0]);
cout << "... | true |
9d7f1687abd89d1159538d20f2e88e9ccf52a22f | C++ | JasonDeras/Proyecto2_CTJ_EDD1 | /TDA_Tree.cpp | UTF-8 | 4,300 | 3.140625 | 3 | [
"MIT"
] | permissive | #include "TDA_Tree.h"
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <fstream>
#include <sstream>
#include <vector>
using namespace std;
TDA_Tree::TDA_Tree(int Nodos){
this->root = 0;
for (int i = 0; i < Nodos; i++){
nodes.push_back(new Tree_Node(nullptr,nullpt... | true |
1bdb5d07fe1e7aaa12039536dbd5f3f28c74bd71 | C++ | Kushagra-Kapoor25/Revising-CPP | /Searching/PairWithGivenSumInSortedArray.cpp | UTF-8 | 509 | 3.390625 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
bool pairSum(int arr[], int size, int x)
{
int left = 0, right = size - 1;
while (left < right)
{
if ((arr[left] + arr[right]) == x)
return true;
else if (x > (arr[left] + arr[right]))
left++;
else
righ... | true |
c951021c49c551c14d8d53813f47e148ee142dd0 | C++ | LeoBrilliant/OpenTS | /PriorityQueue.h | WINDOWS-1252 | 1,487 | 3.546875 | 4 | [
"Apache-2.0"
] | permissive | /*
* PriorityQueue.h
*
* Created on: 2016126
* Author: LeoBrilliant
*/
#ifndef STL_PriorityQueue_H_
#define STL_PriorityQueue_H_
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
template<typename T, class Container = vector<T>,
typename Compare = less<typename ... | true |
cfdbba43208e7014cab486f4a9c8ea5d6b4a18c5 | C++ | AltaOhms/desktop_buddy | /Desktop_buddy/Desktop_buddy.ino | UTF-8 | 5,333 | 2.6875 | 3 | [] | no_license | /****************************************************************
Code to demonstrate how to control the microview to smile and
frown base on values from a photoresistor SparkFun electronics.
24 Feb 2014 - Pamela - SparkFun Electronics @hello_techie
Jim - SparkFun Electronics - Graphics for the smile and frown code
... | true |
f1884a09b0603f655ed9a81f7f0b44b21c25601e | C++ | masumhabib/quest | /lib/src/negf/RgfResult.cpp | UTF-8 | 625 | 2.578125 | 3 | [
"Apache-2.0"
] | permissive | /*
* File: RgfResult.cpp
* Copyright (C) 2014 K M Masum Habib <masum.habib@gmail.com>
*
* Created on February 13, 2014, 3:41 PM
*/
#include "negf/RgfResult.h"
namespace quest{
namespace negf{
RgfResult::RgfResult(string tag, uint N, int ib, int jb):
tag(tag), N(N), ib(ib), jb(jb)
{
}
void RgfResul... | true |
645ca884e7847c8106faff1c5e71c69ac1ed67f7 | C++ | john19950730/SpaProjectRepo | /source/LineOfCodeData.cpp | UTF-8 | 501 | 2.640625 | 3 | [] | no_license | #pragma once
#include<stdio.h>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
#include "LineOfCodeData.h"
#include "Keywords.h"
#include <regex>
#include <stack>
#include <utility>
int LineOfCodeData::store(string type, string aData
, std::stack <std::pair<int, string>> nestlevel) {
... | true |
7f5f858efc5bae982ed7ab47e6034f82d1acffdf | C++ | kobakazu0429/atcoder-cpp | /src/APG4b/ex20/main.cpp | UTF-8 | 896 | 2.71875 | 3 | [
"MIT"
] | permissive | #include <bits/stdc++.h>
#define rep(i, n, init) for (int i = init, len = (n); i < len; ++i)
#define ALL(x) (x).begin(), (x).end()
#define len(x) ((int)(x).size())
#define int long long
#define float long double
using namespace std;
int count_report_num(vector<vector<int>> &children, int x) {
if (len(children[x]) ==... | true |
8c50b6c54b5d5e9828662fc4a7f9c117c589346e | C++ | peteole/telemetryProtocol | /src/DataSchema.cpp | UTF-8 | 2,076 | 3 | 3 | [] | no_license | #include "DataSchema.h"
String BasicSensorValue::toJSON()
{
return "{\"name\": \"" + this->name + "\", \"size\": " + this->size + ", \"type\": \"" + this->type + "\"}";
}
char *SensorValueList::getMessage()
{
uint16_t position = 0;
for (int i = 0; i < this->length; i++)
{
char *partialMessage = ... | true |
0c88cde60957fb33fa8ff1f12c7b34c77db29b40 | C++ | NguyensAlot/CST320 | /cAstNode.h | UTF-8 | 971 | 2.609375 | 3 | [] | no_license | #pragma once
//*******************************************************
// Purpose: Base class for all AST nodes
//
// Author: Philip Howard
// Email: phil.howard@oit.edu
//
// Editor: Anthony Nguyen
// Email: anthony.nguyen@oit.edu
//
// Date: 2/20/2015
//
//*******************************************************
#i... | true |
6baefd48aa1ec3f026f1f979925aa30b4774a1e8 | C++ | NikolayCheremnov/CalculationMethodsLabs | /Logger/ilogger.h | UTF-8 | 273 | 2.53125 | 3 | [] | no_license | #ifndef ILOGGER_H
#define ILOGGER_H
#include <iostream>
#include <ctime>
using namespace std;
class ILogger
{
protected:
string get_current_time_str();
public:
ILogger();
virtual ~ILogger() {};
virtual void log(string msg) = 0;
};
#endif // ILOGGER_H
| true |
780907c73b56989066a36a04622c17a3d3d9b75c | C++ | alexfordc/Quan | /Utilities/Socket/Thread.h | UTF-8 | 1,820 | 2.671875 | 3 | [] | no_license | #if !defined(Thread_H)
#define Thread_H
#include "SysEvent.h"
//#define UseWin32Thread
#if !defined(UseWin32Thread)
#include <process.h>
#endif
////////////////////////////////////////////////////////////////////////
// Thread
class Thread
{
public:
enum
{
idCancel,
idSuspend,
idResume,
idEnd,
idNoEv... | true |
29ddc62053552b21974fb5629e002a2206f066ea | C++ | acharras/piscine_cpp | /cpp_04/ex01/AWeapon.hpp | UTF-8 | 1,464 | 2.625 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* AWeapon.hpp :+: :+: :+: ... | true |
f287e5ac73b02ec441367931c11e2b3c5b99ae3a | C++ | bollu/proGenY | /src/util/logObject.h | UTF-8 | 4,447 | 3.296875 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <assert.h>
#include "strHelper.h"
#include <typeinfo>
#include "../core/Hash.h"
/*!
@file logObject.h
Logging objects are present on this file
*/
namespace util{
/*! \enum logLevel
an Enum of various Logging levels available
*/
enum logLevel{
/*! Information. used... | true |
d41b74b15346877daeb7877a262ea0594918bf11 | C++ | zgansc/leetcode | /cpp/471-480/Encode String with Shortest Length.cpp | UTF-8 | 1,438 | 2.734375 | 3 | [
"MIT"
] | permissive | class Solution {
map<string, string> cache;
string solve(string str) {
string ans(str);
int len = str.length();
for (int i = 1; i <= len/2; i++) {
if (len % i != 0) continue;
string part = str.substr(0, i);
int dups = len / i;
boo... | true |
5e3d08d7c21258555d686c17b56990923cf310a2 | C++ | dakl/foobar | /photon-firmware.ino | UTF-8 | 1,344 | 2.578125 | 3 | [] | no_license | /*
* This is a minimal example, see extra-examples.cpp for a version
* with more explantory documentation, example routines, how to
* hook up your pixels and all of the pixel types that are supported.
*
*/
#include "application.h"
#include "neopixel/neopixel.h" // use for Build IDE
// #include "neopixel.h" // use... | true |
76cc2c4442d74d0b6625aaa060d56948dc3dad3b | C++ | yehyun3459/algorithm | /Baekjoon/P16986(인싸들의 가위바위보)/yhyh.cpp | UTF-8 | 1,504 | 2.953125 | 3 | [] | no_license | //문제를 제대로 안봐서 한참 헤맴..
//1. 지우 순서 정함(순열)
//2. 가위바위보 시뮬레이션 후 이기는지 확인
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int N, K;
int A[10][10];
int rps[3][20];
int visited[10];
int win[3]; //승리한 횟수
bool isValid = false;
bool Solve()
{
memset(win, 0, sizeof(win));
int p1 = 0, p2 = 1; //초기 플레이어
... | true |
91044d65b433ec272585bfc467a70a5fc111e577 | C++ | aleksandra-blasevac/cpp-qt-gui-zork | /room.h | UTF-8 | 1,118 | 2.78125 | 3 | [] | no_license | #ifndef ROOM_H
#define ROOM_H
#include <map>
#include <QString>
#include <vector>
#include "item.h"
#include "npc.h"
using namespace std;
#include <utility> //for pair
#define NORTH 0
#define EAST 1
#define SOUTH 2
#define WEST 3
class Room
{
private:
QString description;
QString mapImageFile;
QString... | true |
9ac8e7cae7f4dbcc99d0fc6d8a93d6481b74c17c | C++ | PhilipGe/CPPANN | /MNIST_Processing/support/MNISTTester.cpp | UTF-8 | 2,417 | 2.875 | 3 | [] | no_license | #include <iostream>
#include "MNISTTrainerV2.hpp"
#include <eigen/Eigen/Dense>
#include "../../include/Network.hpp"
#include "../../FileStorage/NetworkSaver.cpp"
#include <sqlite3.h>
#include <string>
#include "MNISTTester.hpp"
int outputValue(MatrixXd outputMatrix){
double maxC = outputMatrix(0,0);
int resul... | true |
f23817d6625394cf58ea6451131908bae33acda8 | C++ | jpac1207/SPEA2-Paralelo | /SPEA2/PSO.h | UTF-8 | 1,291 | 2.53125 | 3 | [] | no_license | #pragma once
#include<cstdlib>
#include<ctime>
#include<math.h>
#include<vector>
#include<stdlib.h>
#include"ObjectiveFunction.h"
#include"ZDT.h"
#include"Population.h"
#include"Individual.h"
using namespace std;
class PSO
{
public:
PSO();
~PSO();
void run(Population* population);
vector<double> getLimiteSuperi... | true |
712ca0bf25425a8b63f22d722b7edcd6af28eb79 | C++ | yuanqinguo/MemPool | /TestObj.h | UTF-8 | 483 | 2.8125 | 3 | [] | no_license | #ifndef TEST_OBJ_H
#define TEST_OBJ_H
#include <iostream>
#include <string>
int g_GlobalIndex = 0;
class TestObj
{
public:
TestObj()
{
m_index = g_GlobalIndex++;
//std::cout<<"TestObj() Create Obj index = "<<m_index<<std::endl;
}
~TestObj()
{
//std::cout<<"~TestObj() Delete Obj index = "<<m_index<<std::en... | true |
c4c6ff472c02a6e6527ef5d9a0e348e1d3dc61e0 | C++ | yujingda/dogeBase | /dogeBase/record.h | GB18030 | 2,699 | 3.078125 | 3 | [] | no_license | #pragma warning(disable:4996)
#pragma once
#include<string.h>
#include"table.h"
// int 1 float 2 long 3 char 4 varchar 5 double 6 date 7
//͵Ѿint͵ˣӶʱܷ
class record
{
public:
record(char* Tschema, table* t)
{
memset(tempRecord, 0, 4096);
memset(schema, 0, 1000);
strcpy(schema, Tschema);
tableFile = t;
}
recor... | true |
fb2aaa85fad73e6b342fa50e2fcf31ac59670bdb | C++ | xeonrsa/COS2611_ASSIGNMENT_4_CPP | /main.cpp | UTF-8 | 1,500 | 4.15625 | 4 | [] | no_license | #include <iostream>
#include <queue>
using namespace std;
bool isInLanguageL(queue<char> & w);
int main()
{
string tString;
queue<char> tQueue;
cout << "Enter word:";
cin >> tString;
for (int i = 0; i < tString.length(); i++)
{
tQueue.push(tString[i]);
}
c... | true |
ec7784a98d32f8adc41543a6946d0f6560649750 | C++ | Rishit-dagli/using-control-p5-in-processing-with-arduino | /_7_segment_arduino.ino | UTF-8 | 2,044 | 2.75 | 3 | [
"MIT"
] | permissive | int x = 0 ;
void setup()
{
pinMode( 2 , OUTPUT);
pinMode( 3 , OUTPUT);
pinMode( 4 , OUTPUT);
pinMode( 5 , OUTPUT);
pinMode( 6 , OUTPUT);
pinMode( 7 , OUTPUT);
pinMode( 8 , OUTPUT);
pinMode( 9 , OUTPUT);
Serial.begin(9600);
digitalWrite(2, LOW);
digitalWrite(3, LOW);
digitalWrite(4, LOW);
digi... | true |
42d76ab4d84154bd6ff5a20c48590a42525f4ba4 | C++ | andrey-golubev/opencl-sandbox | /common/thread_pool.hpp | UTF-8 | 2,235 | 3.140625 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <atomic>
#include <functional>
#include <future>
#include <list>
#include <mutex>
#include <thread>
#include <vector>
#include "require.hpp"
namespace thr {
namespace detail {
struct ThreadPool {
ThreadPool(std::size_t threads) : m_alive(true) {
REQUIRE(threads >... | true |
e4b0823fe987d114b12f9e788167059db4ee0658 | C++ | shehzarr/File-Compressor | /17L-4177.cpp | UTF-8 | 24,050 | 3.03125 | 3 | [] | no_license | #include <iostream>
#include <conio.h>
#include <list>
#include <fstream>
using namespace std;
class heap;
template<class T>
class bstnode;
struct dat
{
char key;
int freq;
dat(char c = '\0', int f = 0)
{
key = c;
freq = f;
}
void print()
{
cout << key << " ";
cout << freq;
cout << "\n";
}
voi... | true |
b07250bbb4d4395c289a2036233e9d189e5c3b8f | C++ | vinay-12345678/Cplus | /hashmap/sumit malik/v-2.cpp | UTF-8 | 1,140 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
vector <string> find(vector <vector <string> >v){
unordered_map <string,bool> m;
unordered_map <string,string> mp;
for(auto i:v){
mp[i[0]]=i[1];
if(m.count(i[0])){
m[i[0]]=0;
}
else
m[i[0]]=1;
m[... | true |
6097df1c621f74dda40756088a872d9de9842227 | C++ | eddyc/Signals | /Signals/VectorMaths.hpp | UTF-8 | 529 | 2.546875 | 3 | [] | no_license | //
// VectorMaths.hpp
// Signals
//
// Created by Edward Costello on 15/01/2018.
// Copyright © 2018 Edward Costello. All rights reserved.
//
#ifndef VectorMaths_hpp
#define VectorMaths_hpp
Vector<T> &fill(const T);
Vector<T> &clear();
Vector<T> &multiply(const T);
Vector<T> &add(const T);
static void add(const V... | true |
4b7fa94408641f51d5f6f2b0d938e9244a818d3d | C++ | kchaloux/kitten | /yarn/JumpIfNone.cpp | UTF-8 | 377 | 2.671875 | 3 | [
"MIT"
] | permissive | #include "JumpIfNone.h"
#include "Option.h"
#include "State.h"
#include <ostream>
void
JumpIfNone::write(std::ostream& stream) const {
stream << "jn " << offset;
}
Offset
JumpIfNone::exec(State& state) const {
const auto a = state.pop_data();
const auto& value = a->value<Option>();
if (value) {
state.pu... | true |
518306271b31260a608e0c692ef876934e691aa7 | C++ | xiaoyu602/Heap | /Heap.cpp | GB18030 | 525 | 3.0625 | 3 | [] | no_license | #include "Heap.h"
//void Test() //
//{
// int a[] = {10,16,18,12,11,13,15,17,14,19};
// Heap<int> hp(a,sizeof(a)/sizeof(a[0]));
// //hp.Push(20); //Ԫ20
// hp.Push(2); //Ԫ2
// hp.Pop(); //ɾɾȼߣ
//}
void Test1()
{
int a[] = {10,16,18,12,11,13,15,17,14,19};
//Heap<int> hp(a,sizeof(a)/sizeof(a[0... | true |
844428be34a14bd08d1ea9fbfc7d5f703a23bb34 | C++ | petricm/DDMarlinPandora | /src/DDScintillatorPpdDigi.cc | UTF-8 | 4,993 | 2.75 | 3 | [] | no_license | #include "DDScintillatorPpdDigi.h"
#include <assert.h>
#include "CLHEP/Random/RandPoisson.h"
#include "CLHEP/Random/RandGauss.h"
#include "CLHEP/Random/RandBinomial.h"
#include <iostream>
using std::cout;
using std::endl;
// this applies some extra digitisation to scintillator+PPD hits (PPD=SiPM, MPPC)
// - poisson fl... | true |
2852099d366467ef342297de605b4bb3d83df934 | C++ | codingnoye/cpp_project | /main.cpp | UTF-8 | 19,690 | 2.65625 | 3 | [] | no_license | #include <ncurses.h>
#include <chrono>
#include <string>
#include <ctime>
#include <fstream>
#include <deque>
#include <cstring>
using namespace std;
const int TITLE1 = 14;
const int TITLE2 = 15;
const int MISSION = 11;
const int INFO = 10;
const int MISSION_X = 12;
const int MISSION_V = 13;
const int BKGRD = 16;
co... | true |
2abb3240958479b8c05b5b5caba48746408750c9 | C++ | Jodonghyun/aa1-17 | /aa1-17-rpt05/AA17_tmp36_sensor/AA17_tmp36_sensor.ino | UTF-8 | 587 | 2.8125 | 3 | [] | no_license | //
// AA00, TMP36 sensor
//
#define TEMP_INPUT 0
// or int TEMP_INPUT = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
//getting the voltage reading from the temperature sensor
int value = analogRead(TEMP_INPUT);
// Print value
Serial.print("AA16,AA17,value=");
Serial.print(value... | true |
13fc99bc63a1f09417bfb3d6da206f55492844c7 | C++ | henrygranados/Advanced_programming | /CASTLE/Location.cpp | UTF-8 | 2,090 | 3.515625 | 4 | [] | no_license | #include "Location.h"
Location::Location()
: name("")
{
monster = 0;
adventurer = 0;
visited = false;
}
Location::Location(string n)
: name (n)
{
monster = 0;
adventurer = 0;
visited = false;
}
void Location::setName(string n)
{
name = n;
}
void Location::setMonster(Monster * m)
{
monster = m; //new Monst... | true |
37e004f9838af609a6a4a7aa10ff622e50fe4298 | C++ | shulgaalexey/CtCI | /3_6.cpp | UTF-8 | 1,568 | 4.0625 | 4 | [] | no_license | // 3.6 Write a programm to sort a stack in ascending order (with biggest items on top).
// You may use at most one additional stack to hold items, but you may not copy the elements
// into any other data structure (such as an array).
// The stack supports the following operations: push, pop, peek, isEmpty
#include <io... | true |
9a5d7fe9f028828d1a98bccf255605c70d957709 | C++ | kamilmaj94/ConsoleCubes | /ConsoleCubes/Game.hpp | UTF-8 | 1,578 | 2.578125 | 3 | [] | no_license | #pragma once
#include "Console.hpp"
#include "Field.hpp"
#include "Block.hpp"
#include "Timer.hpp"
#include "Menu.hpp"
#include "ParameterMenuOption.hpp"
enum class GameMode
{
GAME = 1,
MENU,
};
class Game
{
Console mConsole;
GameMode mCurrentMode;
Field mField;
Field mNextBlockField;
Ti... | true |
cd6d739988a6ba8151bae6fb75eb73da28171499 | C++ | Ruthercode/OOP_lab_Mironchenko_KTbo2-7 | /lab2-3/interactor.cpp | UTF-8 | 3,990 | 3.265625 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include "queue.h"
#include "stack.h"
#include "food.h"
#include "customer.h"
#include "interactor.h"
#include "factory.h"
void Interactor::_help() const
{
std::cout <<"===========================================\n";
std::cout << "Disclaimer: \nYou have a restaurant.\n";... | true |
c5163986510ef4283f9cbac24bbcd26381d4171c | C++ | eTakazawa/procon-archive | /atcoder.jp/future-meets-you-contest-2018-open/future2018career_a/Main.cpp | UTF-8 | 6,640 | 2.859375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
#if 0
#define LOG_OP(a, b, c, d, e) (cerr << a << " " << b << " " << c << " " << d << " " << e << endl)
#define LOG(a) (cerr << a << endl)
#else
#define LOG_OP(a, b, c, d, e) (cout << a+1 << " " << b+1 << " " << c+1 << " " << d+1 << " " << e << endl)
#define LOG(a)
#endif
... | true |
c435b443ddfae5c7b4038fd34925280051f4862d | C++ | ElliotSis/Projets | /C:C++/POO Polytechnique/TP1/include/chauffage.h | UTF-8 | 823 | 3.3125 | 3 | [] | no_license | #ifndef CHAUFFAGE_H
#define CHAUFFAGE_H
/** \brief Classe représentant le Chauffage d'une Maison.
* \author Elliot Sisteron
* \date 16/09/2015
*/
class Chauffage {
public:
/** \brief Constructeur par défaut.
*/
Chauffage();
/** \brief Destructeur par défaut.
*/
virtual ~Ch... | true |
d0657b51ef9f2bc4c88426db1340bb43e84723bd | C++ | aviaryal/cse1325 | /elsa/sprint_1/order.cpp | UTF-8 | 841 | 3.203125 | 3 | [] | no_license | #include "order.h"
Order::Order(Customer &customer):_customer(customer)
{
}
Order::~Order()
{
}
/*
Order::Order(const Order &rhs):_customer{rhs._customer},_product{rhs._product}
{
}
Order & Order::operator=(const Order &order)
{
this->_customer=order._customer;
this->_product=order._product;
//for(auto v: thi... | true |
944164da0bd43ea54d3ef64007120cc47605d26c | C++ | aishjb/90-days-ofCode-c- | /8_vector_demo.cpp | UTF-8 | 559 | 3.25 | 3 | [] | no_license | #include<iostream>
#include<vector>
using namespace std;
int main()
{
vector<int>v;
for(int i=0;i<100;i++)
{
cout<<"capacity"<<v.capacity()<<endl;
cout<<"size"<<v.size()<<endl;
v.push_back(i);
}
/*
v.push_back(11);
v.push_back(12);
v.push_back(13);
for(int i=0;i<v.size();i++)
{
cou... | true |
e319cd7fb25a70cd391679db963481f630c6afe5 | C++ | brandonjones085/finalZooTycoon | /Turtle.cpp | UTF-8 | 624 | 2.6875 | 3 | [] | no_license | /*******************************************************************************
** Author: Brandon Jones
** Date: 04/21/2019
** Description: This is the ant class for the langstons ant program
*******************************************************************************/
#include "Turtle.hpp"... | true |
ec2f4a458e6d5055a0fbdf7f60def51b2ca81712 | C++ | azartheen/leetcode | /30days-challenge/202004/day4.cpp | UTF-8 | 1,147 | 3.8125 | 4 | [
"MIT"
] | permissive | /*
Move Zeroes
Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.
Example:
Input: [0,1,0,3,12]
Output: [1,3,12,0,0]
Note:
You must do this in-place without making a copy of the array.
Minimize the total number of operations.
*/
class... | true |
1df3612653aa96be9917516bdbce6551c90e43e7 | C++ | zayim/ProgrammingIntro | /LV3/LV3Z4.cpp | UTF-8 | 337 | 3.171875 | 3 | [] | no_license | #include <iostream>
#include <cmath>
using namespace std;
int main()
{
float r=0.0,x;
int i=-1,n;
cout << "Unesi n: "; cin >> n;
cout << "Unesi otpore: ";
while (++i<n)
{
cin >> x;
r+=(1.0/x);
}
cout << "Ukupan paralelni otpor: " << 1.0/r << endl;
... | true |
a0d685ef2456027017c17b66e0aec44bcbc5e5b4 | C++ | duand/wifi-car-esp8266 | /WifiCarESP8266_AP/WifiCarESP8266_AP.ino | UTF-8 | 2,898 | 3.265625 | 3 | [] | no_license | /**
@file WifiCarESP8266_AP.ino
@brief Simple example of Wifi Car controlled by a web server in AP Mode. See also :
http://www.instructables.com/id/A-very-cheap-ESP8266-WiFi-smart-car-controlled-by-/
List of commands to control the car :
- http://<YourIP>:<YourPort>/?State=F (... | true |
bbc4f1e2d2f93122ab5a549afb4158cd9e23c0ab | C++ | Liuqianqian007/learncs | /algorithm/201101_oj380.cpp | UTF-8 | 863 | 2.96875 | 3 | [] | no_license | /*************************************************************************
> File Name: 201101_oj380.cpp
> Author: liuqian
> Mail:
> Created Time: Tue 03 Nov 2020 04:46:32 PM CST
************************************************************************/
#include<iostream>
#include<string>
#include<algorithm>
usin... | true |
d9085d7e24b0d7fd3a14d4fea0b4005cbc20bc9f | C++ | wzyy2/chromium-browser | /chrome/browser/installable/installable_task_queue_unittest.cc | UTF-8 | 2,998 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive | // Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/installable/installable_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
using IconPurpose = content::Manifest::Icon::I... | true |
0c23df45e3168f0086825d242272996197849a0a | C++ | Masters-Akt/CS_codes | /leetcode_sol/2121-Intervals_Between_Identical_Elements.cpp | UTF-8 | 1,574 | 3.46875 | 3 | [] | no_license | //M-1 - Brute Force - O(N2) - TLE
class Solution {
public:
vector<long long> getDistances(vector<int>& arr) {
map<int, vector<int>> m;
for(int i=0;i<arr.size();i++) m[arr[i]].push_back(i);
vector<long long> ans(arr.size(), 0);
for(auto x: m){
vector<int> ind = x.second;
... | true |
b6906fdc14d9ce98450b4c2bc33d78a3ef05d847 | C++ | Kn-Jakub/SmartServer | /inc/Thread.h | UTF-8 | 2,014 | 3.125 | 3 | [] | no_license | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/*
* File: Thread.h
* Author: JosoP
*
* Created on Utorok, 2017, decembra 19, 16:57
*/
#ifndef THREAD_H
#define... | true |
0d78036a9ef4673287b663e54a326185be0bdd97 | C++ | GhermanCristian/Sem2_OOP | /Lab Tests/TestLab10OOP2018/userInterface.cpp | UTF-8 | 2,516 | 3.40625 | 3 | [] | no_license | #include "userInterface.h"
#include <iostream>
#include <fstream>
void UserInterface::addRefrigeratorInterface(){
int uniqueID;
int weight;
std::string usageClass;
bool hasFreezer;
std::cin >> uniqueID >> weight >> usageClass >> hasFreezer;
this->actionController.addRefrigerator(uniqueID, weight, usageClass, ha... | true |
488a5180869653afab731296d7d75c4d57576f7d | C++ | variablemayank/competetive-programming-codes | /Problem b DIV 373.cpp | UTF-8 | 332 | 2.734375 | 3 | [] | no_license | #include<stdio.h>
int main()
{
int t; int arr[200000],i;
scanf("%d",&t);
while(t--)
{
int n; scanf("%d",&n);
for( i=0;i<n;i++)
{
scanf("%d",&arr[i]);
}
for(i=0;i<n;i++)
{
if(arr[i]%2==1)
{
arr[i+1]= arr[i+1]-1;
}
}
if(i==n-1 && arr[i]%2==1) printf("NO\n");
else printf("YES\n... | true |
dbac40bbceab85818ce89745d26db9560420ba56 | C++ | ssribeiro/abjalu | /arduino_codes/NodeMCU_SLAVE_ONE/protocol.ino | UTF-8 | 973 | 2.75 | 3 | [] | no_license | const char BOARD_ADDRESS = '1';
/*
* PROTOCOL
*
* sample:
*
* 0AR -> read board 0 sensor
* 1AR -> read board 1 sensor
*
* 0A1S -> set relay for board 0 to ON (1)
* 1A0S -> set relay for board 1 to OFF (0)
*/
void sayMaster(String s) {
writeMode();
delay(500);
rsSerial.println(s);
rsSerial.flush()... | true |
b65e51ad340f280febe2b976a326144421377efc | C++ | matthewh806/mandelbrot | /mandelbrot/fractal_plotter.cpp | UTF-8 | 1,363 | 2.875 | 3 | [] | no_license | //
// fractal_plotter.cpp
// mandelbrot
//
// Created by Matthew on 11/01/2019.
// Copyright © 2019 Matthew Harris. All rights reserved.
//
#include "fractal_plotter.hpp"
#include <FreeImage.h>
const int N = 256;
const int N3 = N * N * N;
std::tuple<int, int, int> get_rgb_piecewise_linear(int n, int iter_max) {
... | true |
7fe51375146693dd0a424299ba2e42537b7e514c | C++ | TomLott/ft_containers | /map.cpp | UTF-8 | 53,863 | 3.3125 | 3 | [] | no_license | #include "map.hpp"
#include <string>
#include "utils.hpp"
#include <vector>
#include <list>
#include <stack>
bool singleDigit(const int& value) {
return (value < 10);
}
struct isEven {
bool operator()(const int& value) {
return (value % 2) == 0;
}
};
bool sameRemainderOfDivision(int first, int second) {
if (firs... | true |
4ec9b5d2616b8607995c226b58e6facd97bbbde8 | C++ | Umarahmad87/Pacman | /Ghost.h | UTF-8 | 10,205 | 3.0625 | 3 | [] | no_license | /*
* Ghost.h
*
* Created on: Apr 30, 2016
* Author: umar
*/
#ifndef GHOST_H_
#define GHOST_H_
#include <GL/glut.h>
#include <iostream>
#include <set>
#include "Board.h"
#include "util.h"
enum Movements { Left , Right , up , down };
class Ghost:public Board{
int move_r;
int Frightened;
public:
Ghost(in... | true |
4e288345d12da8d92e2e0e3d7dacdb1e9d2612b2 | C++ | ndsev/zserio | /compiler/extensions/cpp/runtime/src/zserio/JsonParser.h | UTF-8 | 8,325 | 2.96875 | 3 | [
"BSD-3-Clause"
] | permissive | #ifndef ZSERIO_JSON_PARSER_H_INC
#define ZSERIO_JSON_PARSER_H_INC
#include "zserio/AnyHolder.h"
#include "zserio/JsonDecoder.h"
#include "zserio/JsonTokenizer.h"
#include "zserio/Span.h"
namespace zserio
{
/**
* Json Parser.
*
* Parses the JSON on the fly and calls an observer.
*/
template <typename ALLOC = std:... | true |
28c4cc15759e75a895ab7f9d880af4693ce738f6 | C++ | mehtadome/Programming-Projects | /C++ Projects/Dictionary/utils.cpp | UTF-8 | 707 | 3.078125 | 3 | [] | no_license | //
// utils.cpp
// C++ Final
//
// Created by Ruchir Mehta on 7/21/16.
// Copyright © 2016 Rucker. All rights reserved.
//
#include <iostream>
#include "utils.hpp"
#include <string>
int stringLength (const char* src) { // finds the string length of the user's input
if (src == NULL)
return false;
... | true |
14ff5849d013e5f19282157d0d9bf73973e858bd | C++ | Psykomusic/MobileGame | /PlayerWithSwipper/src/additional_functions.cpp | UTF-8 | 954 | 2.828125 | 3 | [
"BSD-2-Clause"
] | permissive | #include "additional_functions.hpp"
using namespace std;
vector<string> split(string data, string separateur)
{
vector<string> tab;
size_t pos;
if(separateur.length() > 0)
{
while ((pos = data.find(separateur)) != string::npos)
{
tab.push_back(data.substr(0, pos));
... | true |
321a18a8c3930879c56a6133f48745b029a8fb81 | C++ | Skb-Hssn/DU-Predator | /BCC.cpp | UTF-8 | 1,330 | 2.734375 | 3 | [] | no_license | /*
- 1 based indexing
*/
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int timer = 0;
vector<int> G[N];
vector<int> low(N), disc(N), par(N), vis(N);
vector<pair<int, int>> ST;
vector<vector<pair<int, int>>> BCC;
void dfs(int cur)
{
disc[cur] = low[cur] = timer;
timer++;
vis[cur] = true... | true |
797948aaafce126f3c49e79ce64409866c3a8938 | C++ | eunho5751/BarrageShooting | /source files/Character.cpp | UHC | 1,110 | 2.515625 | 3 | [] | no_license | #include "PCH.h"
#include "Character.h"
#include "EntityMgr.h"
#include "InputMgr.h"
#include "ImageData.h"
#include "def.h"
CCharacter::CCharacter(ImageData * _image, float _scale, float _speed, float _x, float _y)
: CEntity(_image, _scale, 1.0f, _speed, 0.0f, _x, _y)
{
}
void CCharacter::Update(float... | true |
f2f7f09df05396668870b481b76a86ecb5e80f4a | C++ | matthewguillory65/IntroToProgramming | /IntroToProgramming/Conditionals/Conditionals.cpp | WINDOWS-1250 | 3,923 | 4.25 | 4 | [] | no_license | #include <iostream>
int main()
{
int num3 = 0;
int num4 = 0;
char bleh = 0;
int Whatever;
//Number 1
int s;
int z = 0;
if (z == 0)
{
s = 100;
}
std::cout << s;
std::cout << "\n";
//Number 2
std::cout << "Please input two numbers" << std::endl;
int num1;
int num2;
std::cin >> num1 >> num2;
... | true |
854014653df33245f8a65b8e2e919cd9f5191c13 | C++ | drummerpva/GoStackRocketSeat | /mapa.cpp | ISO-8859-1 | 2,358 | 3.046875 | 3 | [] | no_license | #include <stdio.h>
#include <stdlib.h>
#include <locale.h>
/*
Trabalho MAPA de Douglas Poma - Curso ADS - Unicesumar - 52/2019
*/
struct livro{
int codigo = -1;
char autor[50];
char nome[50];
char editora[50];
};
int menu = 3;
int cod = 0;
int i;
main(){
setlocale(LC_ALL, "Portuguese");
livro livros[5];
while(... | true |
a914f7bdb935b5daf287f76a00fd4cbe4c95217a | C++ | rjLelis/lista-de-exercicio-de-programacao | /exercicio 7.cpp | UTF-8 | 470 | 3.796875 | 4 | [] | no_license | /*Programa em C que receba três valores e calcule a expressão abaixo:
√(cos(x)² + sen(y)² + sen(z²)²)
-------------------------------
2 + cos(3) + cos(4)
*/
#include<iostream>
#include<math.h>
using namespace std;
main(){
float x, y, z, res;
cout<<"Digite tres numeros: ";
cin >> x >> y >> z;
... | true |
93cdeaec4d480299f614424e93eca41e8dcc49bc | C++ | yaishenka/SomeStuff | /SomeDAFEstudy/алгоритмы/1 семестр/Задание 1/5_2.cpp | UTF-8 | 2,346 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std ;
struct Deque {
private:
char *buffer;
int end,size, capacity;
void resize (int length) {
char *new_buffer = new char[length];
for (int i=0; i<end;++i) {
ne... | true |
69f8f4df6de003ee01ffca2fa1e5381dadd023ef | C++ | SabikAbtahee/Code-Problems | /lightoj-1043-Triangle partitioning/1043-Triangle partitioning.cpp | UTF-8 | 520 | 2.59375 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
void file(){
freopen("input.txt","r",stdin);
freopen("output.txt","w",stdout);
}
void solve(){
double AB,AC,BC,ratio;
double R,AD;
cin >> AB >> AC >> BC >> ratio;
R=(ratio)/(ratio+1);
AD=AB*sqrt(R);
cout << setprecision(10)<<AD<<"\n";
}
void run(){
int testCa... | true |
06582fa44498c8a685a1e6beb0c836acbaecb2ee | C++ | SongM/HelpLeetcodeCPP | /p138_20200831.cpp | UTF-8 | 811 | 3.203125 | 3 | [] | no_license | /*
// Definition for a Node.
class Node {
public:
int val;
Node* next;
Node* random;
Node(int _val) {
val = _val;
next = NULL;
random = NULL;
}
};
*/
class Solution {
public:
Node* copyRandomList(Node* head) {
if (head==NULL) return(NULL);... | true |
12e05462ff2d4c84ece2c59a357f46ad48e7ac6d | C++ | josterholt/turn_based_rpg_server | /gamestate.cpp | UTF-8 | 10,886 | 2.546875 | 3 | [] | no_license | #include "gamestate.h"
#include "gameclient.h"
#include <fstream>
#include "rapidjson/istreamwrapper.h"
#include <iostream>
#include "utils.h"
#include <math.h>
#include "npcs.hpp"
#define PI 3.14159265
GameState::GameState() {
char s[25];
gen_random(s, 24);
s[24] = '\0';
strcpy(this->token, s);
// Default scr... | true |
18fda64dc0b4dd86e6f7837a3a18eb48d7e2baa3 | C++ | Maxswang/DataStructureAPI | /SeqStack/SeqStack/main.cpp | GB18030 | 638 | 3.359375 | 3 | [] | no_license | // main.cpp
// ˳ṹջIJԳ
#include <stdio.h>
#include "seqstack.h"
void play()
{
int i = 0;
SeqStack *stack = NULL;
int a[10];
for (i = 0; i < 10; ++i) {
a[i] = i + 1;
}
stack = SeqStack_Create(20);
// ջ
for (int i = 0; i < 5; ++i) {
SeqStack_Push(stack, &a[i]);
}
printf("len:%d \n", SeqStack_Size(stac... | true |
f73510bcbdf3a31e0af97ea3c4cae0eb46a6f5a8 | C++ | Guillembonet/Lemmings_VJ-FIB | /Button.cpp | UTF-8 | 2,366 | 2.71875 | 3 | [] | no_license | #include <GL/glew.h>
#include <GL/gl.h>
#include <glm/gtc/matrix_transform.hpp>
#include "Button.h"
Button *Button::createButton(glm::vec2 geom[2], glm::vec2 texCoords[2], std::function<void()> callback, Texture *buttonTex, ShaderProgram *program)
{
Button *quad = new Button(geom, texCoords, callback, buttonTex, pro... | true |
75c7346713ec3f4ac5bdb70c41942cc54b4f6d7d | C++ | codingpotato/Lox-modern-cpp | /src/compiler.cpp | UTF-8 | 657 | 2.75 | 3 | [
"MIT"
] | permissive | #include "compiler.h"
namespace lox {
Compile_error Compiler::make_compile_error(const std::string& message,
const Token& token) noexcept {
return Compile_error{
"[line " + std::to_string(token.line) + "] Error at " +
(token.type != Token::eof ? "'" + token.lex... | true |
650208af8b2055caea94a40a6744886929b2b6c2 | C++ | kaito1111/GameTemplete | /GameTemplate/myEngine/ksEngine/sound/WaveFileBank.h | SHIFT_JIS | 1,780 | 3.171875 | 3 | [] | no_license | /*!
*@brief g`f[^oNB
*/
#pragma once
#include <map>
class WaveFile;
using WaveFilePtr = std::shared_ptr<WaveFile>;
using WaveFilePtrMap = std::map<unsigned int, WaveFilePtr>;
/*!
*@brief g`f[^oNB
*@details
* x[hꂽg`f[^oNɓo^邱Ƃo܂B
* o^ꂽg`f[^͍ēǂݍ݂sKvȂAoNėp邱Ƃo܂B
*/
class WaveFileBank {
public:
WaveFileBank();
~Wa... | true |
988818b642f4edada255284dbefc4c82fd07e044 | C++ | sailor-ux/mycodes | /leetcode_vscode/sxl/sec9/9_6.cpp | GB18030 | 2,364 | 3.140625 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {
sort(candidates.begin(), candidates.end());
vector<int> combination;
vector<vector<int>> combinations;
v... | true |
a02900148777acf98cd6a37fe23681f605869c4e | C++ | granjero/ifts_14_CA | /CA_guia1_ej5/main.cpp | UTF-8 | 800 | 3.78125 | 4 | [] | no_license | /*
* File: main.cpp
* Author: juanmiguel
*
* Created on 21 de mayo de 2016, 15:00
*/
#include <stdio.h>
#include <math.h>
/*
*
*/
//declaro funciones
float funcion(float);
main()
{
//variables
float x;
float resultado;
//recibe las variables que se igresan por teclado
printf(... | true |
c12b0ef719bfbe86738c5fc67e214f8d7a39fbeb | C++ | etri3600/SandEngine | /SandEngine/Scene/Node.cpp | UTF-8 | 1,589 | 2.71875 | 3 | [] | no_license | #include "Node.h"
#include "STime.h"
extern IGraphicsInterface* gGraphics;
void SNode::Tick()
{
auto CurrentTime = STime::GetTime();
auto milliseconds = m_Time > 0 ? CurrentTime - m_Time : 0LL;
m_Time = CurrentTime;
double delta = static_cast<double>(milliseconds) / 1000.0;
if (m_bDirty)
{
Draw(delta);
m_b... | true |
37210d346e3f1548359ef43473a7fc69baab30f9 | C++ | kitoriaaa/CppLearn | /LearnFromScratch/Part04/4-3.cpp | UTF-8 | 378 | 3.0625 | 3 | [] | no_license | #include <iostream>
namespace A {
int count = 2;
namespace P {
int count = 5;
int GetCount()
{
return count;
}
} // namespace P
} // namespace A
namespace B {
int count = 4;
} // namespace B
int main()
{
std::cout << A::count << std::endl;
std::cout << B::count << std::endl;
st... | true |
669326928a7c56607727eddae3ce3b10f00e4b2d | C++ | wwwkkkp/Algorithm | /Leetcode/118. 杨辉三角_递推.cpp | UTF-8 | 749 | 3.265625 | 3 | [] | no_license | //118. 杨辉三角
给定一个非负整数 numRows,生成杨辉三角的前 numRows 行。
在杨辉三角中,每个数是它左上方和右上方的数的和。
示例:
输入: 5
输出:
[
[1],
[1,1],
[1,2,1],
[1,3,3,1],
[1,4,6,4,1]
]
//递推
class Solution {
public:
vector<vector<int>> generate(int n) {
if(!n)return {};
vector<vector<int>>v;
v.push_back({1});
... | true |
3b0509b6a58ec1d60f82eef314fc589e22d9e8d5 | C++ | ommmirage/MMO-Client-Server | /NetCommon/net_message.h | UTF-8 | 2,326 | 3.328125 | 3 | [] | no_license | #pragma once
#include "net_common.h"
enum class MsgTypes
{
MovePlayer
};
struct message_header
{
// Enum class ensures that the messages are valid at compile time
MsgTypes type;
uint32_t size = 0;
};
struct message
{
message_header header;
std::vector<uint8_t> body;
size_t size() const
{
return sizeof(mes... | true |
addadc0559fb1f0c306519c64866092218c436d7 | C++ | jiaty/CPP | /20131009/main.cpp | BIG5 | 2,515 | 3.53125 | 4 | [] | no_license | #include <cstdlib>
#include <iostream>
using namespace std;
class Ctime{
public:
int hour;
int minute;
int second;
int duration() //00:00:00}l
{
return (hour*60*60)+(second*60)+(second);
}
};
int main(int argc, char *argv[])
{
Ctime time1;
C... | true |
8177afee94fec87e1dee17bffd8276c4864d1198 | C++ | cding2/f21-cse20312 | /Lec21_Code/include/deque.h | UTF-8 | 1,016 | 3.390625 | 3 | [] | no_license | #ifndef DEQUE_H
#define DEQUE_H
#include "dllist.h"
template< class T >
class deque{
private:
dllist<T>* the_list;
public:
deque() : the_list( new dllist<T>() ) {}
~deque() {
delete the_list;
}
deque(const deque<T>& copy) : the_list( new dllist<T>() ) {
*the_list = copy.th... | true |
76993ce1c298c3b14a4fe5c8d3e816515cadcc15 | C++ | guaidoukx/LeetCode | /h0199.h | UTF-8 | 1,480 | 2.90625 | 3 | [] | no_license | //
// Created by 项雅丽 on 2019/12/12.
//
#ifndef LEETCODE_H0199_H
#define LEETCODE_H0199_H
#include <iostream>
#include <map>
#include <set>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <string>
#include <memory>
#include <numeric>
using namespace std;
namespace h0199 {
struct Tr... | true |
8054de914b10a0f527cd9364f1876d54918041aa | C++ | najosky/darkeden-v2-serverfiles | /src/server/gameserver/skill/ShineSword.cpp | UHC | 2,809 | 2.53125 | 3 | [] | no_license | //////////////////////////////////////////////////////////////////////////////
// Filename : ShineSword.cpp
// Written by : elca@ewestsoft.com
// Description :
//////////////////////////////////////////////////////////////////////////////
#include "ShineSword.h"
#include "SimpleTileMissileSkill.h"
#include "Effect... | true |
5aa983b354d46572adf82a691a3906d5353c35a4 | C++ | gsalomao/cppdbc | /include/cppdbc/database.hpp | UTF-8 | 3,265 | 2.609375 | 3 | [
"MIT"
] | permissive | /*
* Copyright (C) 2020 Gustavo Salomao
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, pub... | true |
4b06cfd9367ae450b391d8654b23e196781f751f | C++ | MaheshBharadwaj/Pharmacy-Management | /Pharmacy.cpp | UTF-8 | 3,178 | 2.921875 | 3 | [] | no_license | ///Pharmacy.cpp
#include <iostream>
#include <sstream> ///String Stream
#include <string>
#include <iomanip> ///Output alignment
#include <conio.h> ///getch()
#include <fstream>
#include <ctime> ///current date-time
#include <queue> ///STL Queue
#include <dirent.h> ///directory accessing
#include... | true |
8ca48305689fff90fffdc11990329b5bcbbae198 | C++ | aking6083/kingTranAssn3 | /kingTranAssn3/KingTran-assn3-main.cpp | UTF-8 | 2,348 | 2.71875 | 3 | [] | no_license | /*****************************************************************************
// CODE FILENAME: KingTran-assn3-main.cpp
// DESCRIPTION:
// CLASS/TERM: CS372 Spring 8 Week 1
// DESIGNER: Adam King & Christopher Tran
// FUNCTIONS:main()
//
//
//**************************************************************************... | true |
29120d5ceceb6f1ef7200d93c48e76f9c8d96fb6 | C++ | coreyabshire/ants | /t3.cc | UTF-8 | 5,356 | 2.625 | 3 | [
"Apache-2.0"
] | permissive | #include <iostream>
#include <vector>
#include <cassert>
using namespace std;
typedef int v0i;
typedef vector<int> v1i;
typedef vector<v1i> v2i;
typedef bool v0b;
typedef vector<v0b> v1b;
typedef vector<v1b> v2b;
enum { _, X, O };
struct t3m {
size_t x, y;
t3m() : x(9999), y(9999) {};
t3m(size_t x, size_t y)... | true |