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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
55896e5f029d0cc9afe360bd584871b779992aff | C++ | CodingWD/course | /c/niuhongli/chapter02/ex2.21.cpp | UTF-8 | 170 | 3.25 | 3 | [] | no_license | #include<iostream>
int main()
{
int sum=0;
for (int i=0; i!=10; ++i){
sum+=i;
std::cout << " Sum from 0 to " << i << " is " << sum << std::endl;
}
return 0;
}
| true |
b5eb63d784a671c0bfd8730e48284c626766146c | C++ | anuin-cat/QG | /Code-1/duLinkList/duLinkedList.cpp | UTF-8 | 2,737 | 3.265625 | 3 | [] | no_license | #include "../head/duLinkedList.h"
using namespace std;
/**
* @name : Status InitList_DuL(DuLinkedList *L)
* @description : initialize an empty linked list with only the head node
* @param : L(the head node)
* @return : Status
* @notice : None
*/
Status InitList_DuL(DuLinkedList *L) {
if(... | true |
3d9fa4bfc7c3f4c842c5e70cae71959374d4459c | C++ | jk793092/CPlusPlus | /CircularqueueusingArray.cpp | UTF-8 | 1,540 | 3.625 | 4 | [] | no_license | #include<iostream>
using namespace std;
class CircularQ
{
private:
int size;
int front;
int rear;
int *A;
public:
CircularQ(){}
~CircularQ(){delete []A;}
void display();
void create();
void enqueue();
int dequeue();
int isFull();
int isEmpty();
};
void Circular... | true |
d6ceba4e40b977d90b9d5474a715d31677c12944 | C++ | Keeqlin/HMM | /include/hmm.hpp | UTF-8 | 8,995 | 2.890625 | 3 | [] | no_license | #ifndef HMM_HPP
#define HMM_HPP
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iostream>
#include <list>
#include <memory>
#include <random>
#include <vector>
class SimpleHMM {
public:
struct Lambda {
Lambda(std::vector<std::... | true |
1ff4a7e3158af83e49dbae74c6af9966e8018212 | C++ | rollfatcat/ProblemSet | /演算法題型分類/STL練習題/set/f929.cc | UTF-8 | 1,018 | 3.34375 | 3 | [] | no_license | /* 給定N格的初始值和Q次操作,輸出查詢時陣列中第一個0的位置?
* 1 x : 將陣列中第一個值是0位置的數值設定為 x
* 2 x : 將陣列中第 x 個位置的數值設定為0
* 3 : 輸出陣列中第一個值是0的位置
* 解題關鍵:set
* 容器必須支援 找到最小值/刪除指定數字/插入數字 ... set
*/
#include<bits/stdc++.h>
using namespace std;
const int MaxN=1e6;
const int MaxQ=1e5;
int num[MaxN];
int main(){
int N, Q, opt ,x;
set<int> memo;
... | true |
e444080b0d08c96edf74948a7980aaa22e82a683 | C++ | bonezuk/athena | /source/common/src/DebugOutput.cxx | UTF-8 | 4,833 | 2.75 | 3 | [] | no_license | #include "common/inc/DebugOutput.h"
#include "common/inc/Log.h"
//-------------------------------------------------------------------------------------------
namespace omega
{
namespace common
{
//-------------------------------------------------------------------------------------------
// DebugOutputItem
//---------... | true |
7336b76c8633f00509f1ae2176533c262977a6e3 | C++ | alexgavrisyuk/Cocos2d-x___test-project | /PlayerBulletGraphicComponent.h | UTF-8 | 806 | 2.515625 | 3 | [] | no_license | #ifndef __PLAYER_BULLET_GRAPHIC_COMPONENT_H__
#define __PLAYER_BULLET_GRAPHIC_COMPONENT_H__
#include "cocos2d.h"
#include "GraphicComponent.h"
using namespace std;
using namespace cocos2d;
class PlayerBulletGraphicComponent : public GraphicComponent
{
public:
PlayerBulletGraphicComponent(int attack, const std::stri... | true |
b20649433ce90824911a928fc74748e8e83d6d05 | C++ | donovan-PNW/jCS162 | /completed/project1/project1.cpp | UTF-8 | 2,780 | 3.859375 | 4 | [] | no_license |
#include <iostream>
#include <fstream>
using namespace std;
void carCategory(char nextChar, int& usCount, int& euroCount, int& japanCount);
void weightClass(char nextChar, int& betweeen1And2, int& between2And3, int& between3And4, int& above4);
int main()
{
int semiCount;
int index;
char letter;
char nextCha... | true |
c73cd87378d454548bf0a9bbae93f20645645880 | C++ | lucasprimo375/Programming-Lab | /huffman_coding/utils.h | UTF-8 | 1,804 | 2.71875 | 3 | [] | no_license | #ifndef UTILS_H
#define UTILS_H
#include <string>
#include <unordered_map>
#include <vector>
#include "min_heap.h"
#include "node.h"
namespace Utils {
void print_file(std::string file_name);
std::unordered_map<char, int>* get_frequency_table(std::string file_name);
void insert_characters(std::unordered_map<char,... | true |
03f207eadf6ac167e1b31053299020999de834b7 | C++ | twinsavitha/suresh-atu-c-sessions | /C++Sessions/Upload/STL/Stacks.cpp | UTF-8 | 533 | 3.765625 | 4 | [] | no_license | /*
* Stacks.cpp
*
* Created on: 24-Dec-2013
*/
#include <iostream>
#include <stack>
int main()
{
std::stack<int> stObj;
stObj.push(23);
stObj.push(-7);
stObj.push(0);
std::cout << "The element at top is " << stObj.top() << "\n";
std::cout << "Number of elements in the stack is " << stObj.... | true |
483a940acbd2274e8232318acdc0beac90c4c011 | C++ | fengwang/larbed-refinement | /include/f/variate_generator/vg/distribution/gaussian_tail.hpp | UTF-8 | 3,552 | 2.515625 | 3 | [] | no_license | /*
vg -- random variate generator library
Copyright (C) 2010-2012 Feng Wang (feng.wang@uni-ulm.de)
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 Free Software Foundation, either version 3 of the License, or
(at your op... | true |
0a2484c80c850794969755f039d73685fb22b91e | C++ | evilknivel/ESP_Windowsensor | /ATtiny/firmware.ino | UTF-8 | 2,318 | 2.671875 | 3 | [] | no_license | #include <avr/sleep.h>
#include <avr/interrupt.h>
//Prototypen:
void gotoSleep(void);
#define esp_power 2
#define esp_ready 4
#define switch_state 1
#define sensor 3
volatile bool wakeup = false;
bool statusSleep = true;
bool boottime = false;
void setup() {
pinMode(sensor, INPUT);
pinMode(esp_ready, ... | true |
20282c571a41221579e9a568959fd010e266ccc4 | C++ | monowireless/Act_samples | /Unit_brd_CUE/Unit_CUE.cpp | UTF-8 | 3,442 | 2.5625 | 3 | [] | no_license | #include <TWELITE>
#include <CUE>
bool b_activate_adc3_4 = false;
/*** the setup procedure (called on boot) */
void setup() {
auto&& cue = the_twelite.board.use<CUE>();
the_twelite.begin(); // here cue object is setup.
}
/*** run only once at the initial */
void begin() {
auto&& cue = the_twelite.board.u... | true |
5fa270f351d5454d4a46d5d9b408a68018e0daea | C++ | adriacb/ADS | /n_queens.cc | UTF-8 | 2,169 | 3.828125 | 4 | [] | no_license | // snippet of a class to implement the n times n chess board for the n-queens problem
#include<iostream>
#include<vector>
using namespace std;
class Board {
private:
// insert the code of the representation here
// representation of the board, MATRIX, booleans
int n;
vector<vector<int> > b;
public:
B... | true |
0e0a3a18f4b929df8cbd6cf2625f0f19c2573a15 | C++ | SovietDoge47/HW7 | /driver.cpp | UTF-8 | 3,009 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "myFunctions.hpp"
#include "LinkedList.hpp"
using namespace std;
int main(int argc, char** argv)
{
//URL* u1 = new URL("https://api.hearthstonejson.com/v1/25770/enUS/cards.json");
//cout << u1->getContents() << endl;
//string jsonString = "[{\"fname\":\"val1\... | true |
91a6fd512d87647dea156b57c02b1f8041a5f266 | C++ | motomoto95/cc1-rep1 | /FIFA/Team.cpp | UTF-8 | 509 | 2.921875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include "Team.h"
using namespace std;
Team::Team(){
Tname="";
}
Team::~Team(){
for (int i = 0; i < 11; ++i)
{
delete []equipo[i]; }
delete []equipo;
}
Team::Team(string pname){
Tname=pname;
}
void Team::insertaPlayer(Player x){
for (int i = 0; i < 11;... | true |
6a892944e64e7c2cec364ff14a7cbd3507d8f8ed | C++ | rojas70/learning_ros_noetic | /Part_3/example_opencv/src/find_connected_components.cpp | UTF-8 | 2,193 | 2.828125 | 3 | [] | no_license | //test use of blob detection
#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <cv_bridge/cv_bridge.h>
#include <sensor_msgs/image_encodings.h>
#include <opencv2/core/utility.hpp>
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include <opencv2/highgui/highgui.hpp>
static con... | true |
339179489aee6f9ed04a9d5aa3f1cb3eeb62ad12 | C++ | sanjeetboora/CppCompetitive | /InterviewPreparation/LeetcodeCompanywise/Amazon/FavoriteGenres.cpp | UTF-8 | 2,340 | 3.15625 | 3 | [] | no_license | //https://leetcode.com/discuss/interview-question/373006
#include <bits/stdc++.h>
using namespace std;
unordered_map<string, list<string> > favoritegenre(
unordered_map<string, list<string> > userMap, unordered_map<string, list<string> > genreMap) {
unordered_map<string, list<string> > result;
unordered_map<stri... | true |
2581c53dc99434d627ac1d38d93c0274929763d7 | C++ | SushkovVA/rdevices | /RTemperatureSensorDHT/rtemperaturesensordht.cpp | UTF-8 | 1,349 | 2.625 | 3 | [] | no_license | #include "iostream"
#include "rtemperaturesensordht.h"
#include "pi_2_dht_read.h"
const int DHT_TYPE = 22;
RTemperatureSensorDHT::RTemperatureSensorDHT(QString name, int gpioOut, QObject *parent) :
RDevice(name, parent),
gpioOutPin(gpioOut)
{
addParameter("Temperature", DEFAULT_VALUE, ValueType_double, "... | true |
dec6f2eeaf8fc8ca67755cf8eecef6f1373e960e | C++ | yenan2500254897/cppLearn | /cppPrimerLearn/test.cpp | UTF-8 | 718 | 3.5625 | 4 | [] | no_license | #include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int a[] = {1,2,3};
//不能用+连接字符串和数字
std::cout<<"a[] size is: " << sizeof(a)/sizeof(*a)<<std::endl;
std::cout<<"hello world"<<std::endl;
vector<int> test ;
test.push_back(1);
test.push_back(2);
test... | true |
1adcbccedf59a7a0b725bfc5c12e1f6285acc7e0 | C++ | WenShihKen/uva | /Leetcode/Implement strStr().cpp | UTF-8 | 310 | 2.65625 | 3 | [] | no_license | class Solution
{
public:
int strStr(string haystack, string needle)
{
if (needle == "")
return 0;
const char *temp = strstr(haystack.c_str(), needle.c_str());
if (temp - haystack.c_str() < 0)
return -1;
return temp - haystack.c_str();
}
}; | true |
9fd1e01c1eaf08e55eefa4c93299591199658a45 | C++ | seco/esp8266_and_arduino | /_61-mma-8452-promini/a-01-simple/a-01-simple.ino | UTF-8 | 1,014 | 2.609375 | 3 | [] | no_license | #include <Wire.h>
#include <MMA8452.h>
MMA8452 accelerometer;
void setup()
{
Serial.begin(115200);
Serial.print(F("Initializing MMA8452Q: "));
Wire.begin();
bool initialized = accelerometer.init();
if (initialized)
{
Serial.println(F("ok"));
accelerometer.setDataRate(MMA_100hz);
accelerometer.setRan... | true |
e8140384925508f8df38b47234658d3c24e0ab78 | C++ | dscnsec/DSC-NSEC-Algorithms | /7. Dynamic Programming/lucky_pairs/lucky_pairs_merlin.cpp | UTF-8 | 1,828 | 3.421875 | 3 | [] | no_license | /**
* lucky_pairs_merlin.cpp
* Find longest common subsequence in two strings
*
* Description-
* Lets find longest common subsequence of two strings first
* In order to find longest common subsequence, we need to form a 2D dp array
* Any cell dp[i][j] denotes the longest common subsequence that can be formed usi... | true |
dac5ae08adb0303f0453b373d49418f32551abbf | C++ | ij96/Honeywell_RSC | /example/example.ino | UTF-8 | 1,384 | 2.875 | 3 | [
"MIT"
] | permissive | /*
circuit:
pin name pin number on Arduino
DRDY 6
CS_EE 7
CS_ADC 8
MOSI (DIN) 11
MISO (DOUT) 12
SCK 13
*/
#include "Honeywell_RSC.h"
// pins used for the connection with the sensor
// the other you need are controlled by the SPI library):
#define DRDY_P... | true |
e534e617ccac9616438dddb0598ad858f7f07f90 | C++ | tinng95/Core-Scheduler | /OSAssignment1/OSAssignment1/Instruction.h | UTF-8 | 340 | 2.78125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <string.h>
using namespace std;
class Instruction
{
public:
Instruction(string instruction, int data);
Instruction();
~Instruction();
void setInstruction(string instruction);
void setData(int data);
string getInstruction();
int getData();
private:
string instruction;... | true |
4278c071e28411a63633d4e92044b40e630c10c6 | C++ | VMPR-21/Neydorff | /Experementator.h | UTF-8 | 1,424 | 2.578125 | 3 | [] | no_license | #ifndef EXPEREMENTATOR_H
#define EXPEREMENTATOR_H
#include "IExperementator.h"
#include <vector>
#include "IRegressionCoefficientTable.h"
class IExperimentTable;
//абстрактный класс для восхождения по градиенту и поиска экстремума.
class Experementator : public IExperementator
{
public:
//запу... | true |
7fe82b1d001aff785b49300cf3326479bcd19479 | C++ | GabeOchieng/ggnn.tensorflow | /program_data/PKU_raw/61/1465.c | UTF-8 | 378 | 2.546875 | 3 | [] | no_license | int F(int m)
{
int f[m],i;
for(i=0;i<m;i++)
{
if(i==1||i==0)
{
f[i]=1;
}else{
f[i]=f[i-1]+f[i-2];
}
}
return f[m-1];
}
int main()
{
int n,j;
scanf("%d",&n);
int s[n],r[n];
for(j=0;j<n;j++)
{
scanf("%d",&s[j]);
r[j]=F(s[j]);
}
for(j=0;j<... | true |
d90f7f4f6cdf71c7e0c62e4de23912ee74ddd724 | C++ | fuhailin/show-me-cpp-code | /leetcode_cc/377.combination-sum-iv.cc | UTF-8 | 749 | 3.453125 | 3 | [
"LicenseRef-scancode-generic-cla",
"Apache-2.0",
"BSD-2-Clause"
] | permissive | #include <iostream>
#include <vector>
using namespace std;
class Solution {
public:
int combinationSum4(vector<int>& nums, int target) {
int n = nums.size();
//dp[i]表示容量为i的背包有几种组合方式
vector<int> dp(target + 1, 0);
dp[0] = 1;
for (int i = 1; i <= target; ++i) {
... | true |
035335c2f2ae46f87a48e29d270dbfff21dbb26f | C++ | kai-zhang-er/multi-task-rpi2 | /TD5/PosixThread.h | UTF-8 | 2,154 | 3.15625 | 3 | [
"Apache-2.0"
] | permissive | /**
* @file PosixThread.h
* @author ZK
* @brief
* @version 0.1
* @date 2021-04-03
*
* @copyright Copyright (c) 2021
*
*/
#ifndef POSIXTHREAD_H_INCLUDED_2021_04_03
#define POSIXTHREAD_H_INCLUDED_2021_04_03
#include <pthread.h>
#include <exception>
using namespace std;
class PosixThread
{
public:
/**... | true |
505e192732cb1b067c9194a4a0c4228b7076eb42 | C++ | cristeigabriel/basil | /tests/csgo.cc | UTF-8 | 2,487 | 2.671875 | 3 | [
"WTFPL"
] | permissive | #include "../basil.hh"
#include <iostream>
#include <stdexcept>
using namespace basil;
int main() {
try {
// capture contents of process named "csgo.exe" in the process list
basil::ctx obj("csgo.exe");
// print name and pid
std::cout << "name: " << obj.get_name() << " pid: " << obj... | true |
c8fdbfd896498a0258105728a5c1b3007764a871 | C++ | HoloborodkoMykhailo/training | /IP_02_Holoborodko_dop_2/Source.cpp | UTF-8 | 3,336 | 3.265625 | 3 | [] | no_license | /*Згенерувати цілочисельну матрицю Q (p x n), яка містить як додатні, так і від’ємні елементи із діапазону [-90, 90]. Серед рядків матриці, що містять від’ємні елементи
на головній діагоналі, знайти "особливий" елемент матриці, вважаючи "особливим" елемент, сума цифр якого є максимальною.На основі зміненої матриці Q ... | true |
e52e02cb32a35a825ca9ddfc48957b404a4af1db | C++ | ichsnn/algoritma | /pemilihan/UpahKaryawan1.cpp | UTF-8 | 923 | 3.3125 | 3 | [] | no_license | #include <iostream>
#include <string>
int main() {
//DEKLARASI
const int JamNormal = 48;
const int UpahLembur = 3000;
std::string nama;
char gol;
int jjk;
float lembur;
int upahperjam;
int upahtotal;
//ALGORITMA
std::cout<<"Nama : ";std::getline(std::cin, nama... | true |
b500c2d9f2ad80f8eded88442bf056f028e5b475 | C++ | GrahamDumpleton-abandoned/ose | /software/include/OTC/memory/arena.hh | UTF-8 | 6,354 | 2.890625 | 3 | [
"LicenseRef-scancode-generic-exception",
"BSD-3-Clause",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | #ifndef OTC_MEMORY_ARENA_HH
#define OTC_MEMORY_ARENA_HH
/*
// This file is part of the OSE C++ class library.
//
// Copyright 1993 OTC LIMITED
// Copyright 1994-2004 DUMPLETON SOFTWARE CONSULTING PTY LIMITED
*/
#include <OTC/memory/mpobject.hh>
#include <OTC/memory/align.hh>
#ifdef __GNUG__
#if (__GNUC__ < 3) && (_... | true |
4804ebd2ec529eb18841e2fc5fb3087eb4fe325d | C++ | kfilipec/rasberrypi3 | /switchInput.cpp | UTF-8 | 673 | 2.65625 | 3 | [] | no_license | #include <iostream>
#include <wiringPi.h>
using namespace std;
int switchState;
#define GREEN 18
#define RED 15
#define switchInput 14
int main(){
wiringPiSetupGpio();
pinMode(GREEN, OUTPUT);
pinMode(RED, OUTPUT);
pinMode(switchInput, INPUT);
while(1){
switchState= digitalRead(switchInput);
if(switchS... | true |
095a7e4f6086555428a831c7120fdcab2d849de7 | C++ | yinghaoawang/MIS | /src/Parser/SetStrCharParser.cpp | UTF-8 | 1,274 | 2.734375 | 3 | [] | no_license | #include "SetStrCharParser.h"
#include <cstring>
SetStrCharParser::SetStrCharParser() {}
Parser *SetStrCharParser::Clone() {
return new SetStrCharParser();
}
std::vector<Token> SetStrCharParser::Tokenize(Cache * const cache, const std::string &str) {
std::vector<Token> tokens;
std::vector<std::string> str_toks = ... | true |
d02fd5091fd5a59092dd9ccea402c2e7d60f8e40 | C++ | mRooky/Rooky | /Source/Platform/Vulkan/VulkanBase.cpp | UTF-8 | 598 | 2.5625 | 3 | [] | no_license | /*
* Base.cpp
*
* Created on: Aug 14, 2018
* Author: rookyma
*/
#include "VulkanBase.h"
#include <cxxabi.h>
#include <string>
#include <cassert>
#include <iostream>
namespace Vulkan
{
Base::Base(void) = default;
Base::~Base(void) = default;
std::string Base::GetClassName(void) const
{
int status = 0;
... | true |
b37858b40484e23165ef33d116194c71246e770f | C++ | jingt06/cc3k | /cc3kCurses/potion.cc | UTF-8 | 323 | 2.53125 | 3 | [] | no_license | #include "potion.h"
#include "item.h"
using namespace std;
Potion::Potion() : isFromM(false){}
const char Potion::getType(){
return 'P';
}
const char Potion::getChar(){
return 'P';
}
const bool Potion::getisFromM(){
return isFromM;
}
void Potion::setisFromM(bool change){
isFromM = change;
}
Potion::~Potion()... | true |
f6df59c9e5d8bd784776cc058b4665722b2e6c33 | C++ | Dhruvik-Chevli/Code | /CodeChef/strno.cpp | UTF-8 | 1,048 | 2.703125 | 3 | [] | no_license | #include <iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
using namespace std;
typedef long long int ll;
#define EPS 1e-9
#define pb push_back
#define FOR(i, a, b) for(ll i = a; i < b; i++)
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
void solve(int n, int k)
{ ... | true |
dd2fa103671b2fbd22d57129561a17175f048116 | C++ | wenyi1994/Wissenschaftliches-Programmieren | /Uebung6/Planeten/particle_dynamics.cpp | UTF-8 | 5,144 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include "particle.h"
#include "verlet.h"
using namespace std;
//globale Variablen:
particle *Teilchen;
size_t ntot;
// Deklarationen:
void init_structure(string);
void force_calculation(particle*const,const int ntot);
void ... | true |
5288c93eabee9d91566443a348e58a2db20637ae | C++ | eliogovea/breakout | /include/breakout/core/state.hpp | UTF-8 | 1,922 | 2.953125 | 3 | [] | no_license | #pragma once
#include <iostream>
#include <vector>
#include <glm/glm.hpp>
#include "util.hpp"
namespace breakout::core {
struct ball {
glm::vec2 center;
glm::float32 radius;
glm::vec2 velocity;
int32_t strength;
};
struct brick {
glm::vec2 center;
glm::float32 width;
glm::float32 height;
int32_t ... | true |
65b049716d5e391792a75a77f4b19e69e6022ca1 | C++ | seanjedi/Practice_Problems | /vectors.cpp | UTF-8 | 2,165 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <unordered_map>
using namespace std;
void iterators(vector<int> example){
for (auto i = example.begin(); i != example.end(); ++i)
cout << *i << " ";
cout << "\nReverse" << endl;
for (auto ir = example.rbegin(); ir != e... | true |
5c7fb5bea8deace7a208f1e6979b5d9d927f6658 | C++ | HaMinhThanh/SupperMarioBros3 | /SupperMario/SupperMario/Camera.cpp | UTF-8 | 699 | 3 | 3 | [] | no_license | #include "Camera.h"
Camera::Camera(int width, int height)
{
Width = width;
Height = height;
Position = D3DXVECTOR3(0, 0, 0);
}
Camera::~Camera()
{
}
void Camera::SetPosition(float x, float y)
{
SetPosition(D3DXVECTOR3(x, y, 0));
}
void Camera::SetPosition(D3DXVECTOR3 pos)
{
Position = pos;
}... | true |
1f8820293351325cd9ed972a5b382aa0401e567e | C++ | cbrghostrider/Hacking | /leetcode/_001361_validateBTreeNodes.cpp | UTF-8 | 2,292 | 3.734375 | 4 | [
"MIT"
] | permissive | class Solution {
// For a binary tree to be valid:
//
// 1. EXACTLY 1 node has no parent.
// 2. All other nodes have EXACTLY 1 parent.
// 3. No node has more than 2 children. (Implicit in input format)
// 4. If both left and right children exist, they must be different. Covered by 2.
// 5. ... | true |
025d18e2857cdeb2e731edf5d6ebc0605fc237bc | C++ | github2mon/Data-Structure-and-Algorithm | /Data Structure/5. String/string.h | UTF-8 | 2,466 | 3.578125 | 4 | [] | no_license | #pragma once
class String
{
private:
char* str;
int len;
public:
String();
String(String& s);
String(char* s) { *this = s; }
~String() { delete str; }
String& operator=(String& s);
String& operator=(char* s);
int isEmpty() { return len == 0; }
int length() { return len; }
int comp(String s);
String* concat... | true |
5111657360804f5585880741106ab0d50025e8a7 | C++ | andyprowl/ape | /Ape/World/Scene/src/CameraSelector.cpp | UTF-8 | 4,841 | 2.765625 | 3 | [] | no_license | #include <Ape/World/Scene/CameraSelector.hpp>
#include <Ape/World/Scene/Scene.hpp>
#include <Basix/Range/Search.hpp>
#include <Basix/Range/Transform.hpp>
#include <algorithm>
#include <numeric>
namespace ape
{
namespace
{
auto getAddressOfFirstCamera(Scene & scene)
-> Camera const *
{
auto const & cameras... | true |
69577030bdb2aaab4e86264bae7e72224cf30f63 | C++ | infotraining/cpp-17-2020-11-30 | /any-variant/tests.cpp | UTF-8 | 4,379 | 3.578125 | 4 | [] | no_license | #include <algorithm>
#include <numeric>
#include <iostream>
#include <string>
#include <vector>
#include <any>
#include <variant>
#include "catch.hpp"
using namespace std;
TEST_CASE("any")
{
std::any anything;
REQUIRE(anything.has_value() == false);
anything = 3;
anything = 3.14;
anything = "te... | true |
92bd53f29cfa3aa29ce05b0f2816fd6fc8df6d64 | C++ | Rijutady/asciiArtGallery | /AsciiImage.cpp | WINDOWS-1250 | 2,424 | 3.40625 | 3 | [] | no_license | #include "AsciiImage.h"
AsciiImage::AsciiImage()
{
// Add defaults here
title = "";
id = "";
name = "";
image = "";
categ = "";
url = "";
}
bool AsciiImage::LoadImage(ifstream &file)
{
// get rid of empty line
while (getline(file, title))
{
if (title != " ")
{
break;
}
}
... | true |
a130b34db4f95b2ba3622c5a2a5ecabcbae54bec | C++ | wuerges/vlsi_verification | /cpp/test_harness.hpp | UTF-8 | 1,614 | 2.625 | 3 | [] | no_license | template <typename P>
void test_parser(
char const* input, P const& p, bool full_match = true)
{
using boost::spirit::qi::parse;
char const* f(input);
char const* l(f + strlen(f));
if (parse(f, l, p) && (!full_match || (f == l)))
std::cout << "ok" << std::endl;
else
std::cou... | true |
6bbdfdb51ca37c0ce70f5dd811018afc4e9be352 | C++ | jolin1337/opgl-Test-Projects | /floor/floor.cpp | UTF-8 | 1,561 | 2.671875 | 3 | [] | no_license | /***
Floor example/test for Glut
*/
#include "mouse.h"
#include "key.h"
#include "floorTexture.h"
bool texture = false, reflect = false, shadow = false;
void redraw(){
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
if(texture)
redrawFloor();
glutSwapBuffers();
}
void settings(int v){
if(texture)
floor... | true |
fd03945a30e798c93dfa0d17ddb48499c725c158 | C++ | DanubeRS/INB371 | /INB371_W3/src/Q4.cpp | UTF-8 | 2,074 | 3.90625 | 4 | [] | no_license | /*
GetDomain (c) Daniel Park 2013
Simple program to calculate the domain of a supplied array
v0.1
====
-Initial creation
v1.0
====
-Completed program
*/
#include <iostream>
#include <cstdio>
#include <cstdlib>
using namespace std;
//Function Prototypes
void MinMax(int a[], i... | true |
6903767d711a3a86d076d74ff85d4dc90f9d9c9a | C++ | Anurag845/OOP | /temp6.cpp | UTF-8 | 615 | 3.625 | 4 | [] | no_license | #include<iostream>
using namespace std;
template <class T1>
class Base
{
T1 bdata;
public:
void getdata()
{
cout<<"Enter base data"<<endl;
cin>>bdata;
}
void showdata()
{
cout<<"Base data is "<<bdata<<endl;
}
};
template <class T2>
class Derived : public Base<T2>
{
T2 ddata... | true |
2f56826d691bc82da1fc9f1e8ad78300c3ec7331 | C++ | AlishaKhoja/school-work | /es1037a-assignments/a1/main_a1.cpp | UTF-8 | 1,106 | 3.546875 | 4 | [] | no_license | #include "Point.h"
int main(){
Point c[4]; //Create array of 4 point objects
c[1]= Point(7, 7); //Define the second point in the array to hold 7, 7
c[2]= Point(6, 5); //Define the third point in the array to hold 6, 5
Point *b[3]; //Create an array of 3 point pointers
b[0]= c + 2; //First pointer holds a... | true |
a6fc6b82fdcbe9988ec0ea2f2233083f167ea5a2 | C++ | abeaumont/competitive-programming | /cses/1622.cc | UTF-8 | 312 | 2.53125 | 3 | [
"WTFPL",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | // https://cses.fi/problemset/task/1622/
#include <bits/stdc++.h>
using namespace std;
int main() {
string s;
cin >> s;
sort(s.begin(), s.end());
vector<string> r;
do r.push_back(s); while (next_permutation(s.begin(), s.end()));
cout << r.size() << "\n";
for (string &s : r) cout << s << "\n";
}
| true |
420ef12d4657a3eacae96c1e228ac8efeaaa95a7 | C++ | Draouch/CCOMP | /FinalProject/Enemigo.cpp | UTF-8 | 2,408 | 2.65625 | 3 | [] | no_license | #include "Enemigo.h"
#include "Objeto.h"
#include "Random.h"
#include <SFML/Graphics.hpp>
#include <iostream>
#include <vector>
using namespace sf;
using namespace std;
Enemigo::Enemigo(){
rect.setSize(Vector2f(dimensionx,dimensiony));
rect.setPosition(Vector2f(600,200));
sprite.setTextureRec... | true |
51bd67d75e3c3d09204fd0504017132f094f69b4 | C++ | google/jsonnet | /third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/ext/fast_float/tests/powersoffive_hardround.cpp | UTF-8 | 3,958 | 2.84375 | 3 | [
"Apache-2.0",
"MIT"
] | permissive | #include "fast_float/fast_float.h"
#include <iostream>
#include <random>
#include <sstream>
#include <vector>
#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(__MINGW64__) || defined(sun) || defined(__sun)
// Anything at all that is related to cygwin, msys and so forth will
// always use this fallback beca... | true |
04c07aa5aefe510a616990a7a7e4d6c6077e5822 | C++ | z1230601/BAKK_Prodanovic_Zaric_OBD | /OBDMiddleware/configurations/src/DatabaseXMLHandler.cpp | UTF-8 | 1,923 | 2.78125 | 3 | [] | no_license | #include "DatabaseXMLHandler.h"
DatabaseXMLHandler::DatabaseXMLHandler()
{
}
DatabaseXMLHandler::~DatabaseXMLHandler()
{
}
void DatabaseXMLHandler::handleNode(xmlpp::Node* node)
{
if(is_writing_)
{
writeHandleNode(node);
} else
{
readHandleNode(node);
}
}
void DatabaseXMLHandler:... | true |
dacbdd6e3276ad39ee4394e700cc7adeb49ca975 | C++ | ItsRico/cityevac_proto | /evac.cpp | UTF-8 | 11,263 | 2.546875 | 3 | [] | no_license | #include <cstdlib>
#include "evac.h"
#include "EvacRunner.h"
#include <math.h>
using namespace std;
int compare (const void * a, const void * b)
{
const Road* p = (Road*)a;
const Road* q = (Road*)b;
return ( q->peoplePerHour - p->peoplePerHour);
}
Evac::Evac(City *citie, int numCitie, int numRoads) : numCit... | true |
0e48fedd30aeed146fafc1da2baf5d9d9d29faac | C++ | dendisuhubdy/IntXLib4CPP | /IntXLib.Test/src/MulOpTest.h | UTF-8 | 2,174 | 2.953125 | 3 | [
"MIT"
] | permissive | #define BOOST_TEST_MODULE MulOpTest
#include "../IntX.h"
#include "../Utils/Constants.h"
#include <string>
#include <fstream>
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(MulOpTest)
BOOST_AUTO_TEST_CASE(PureIntX)
{
BOOST_CHECK(IntX(3) * IntX(5) == IntX(15));
}
BOOST_AUTO_TEST_CASE(PureIntXSig... | true |
d3a55511cf23b114852ca6d90f5365b8aa79f6cd | C++ | greenfox-zerda-sparta/nmate91 | /week_06/11-24/Cars.hpp | UTF-8 | 332 | 2.78125 | 3 | [] | no_license | #ifndef CARS_H
#define CARS_H
#include <iostream>
#include <string>
#include <vector>
#include <time.h>
using namespace std;
class Cars {
private:
string name_of_the_car;
string color_of_the_car;
string plate_number;
vector<string> car_types;
vector<string> car_colors;
public:
Cars();
string get_car();... | true |
41d70878f53969e8ce6cec75b7774a8ed41da0f5 | C++ | stevealbertwong/coursework | /c_c++/socket-block-nonblock-timeout/select-timer-block/test_select.cc | UTF-8 | 4,146 | 2.765625 | 3 | [] | no_license | /*
no error checking for clean logic
author: steven wong
g++ -std=c++14 test_select.cc -o test_select
// telnet establish tcp session
telnet localhost 8888
telnet 127.0.0.1 8888
then type hello, hello will show up in every connected terminal
*/
#include <stdio.h>
#include <string.h> //strlen
#include <stdlib.h>
#i... | true |
7c05a79c859df1a38f5b645c5e693e79c6aa85da | C++ | sunkaiiii/study_computer_science | /Algorithm_Exercises/字符串全排列.cpp | UTF-8 | 706 | 3.4375 | 3 | [] | no_license | #include<iostream>
#include<algorithm>
void Permutation(char*);
void Permutation(char*,char*);
void Permutation(char *pStr)
{
if(pStr==NULL)
return;
Permutation(pStr,pStr);
}
void Permutation(char *pStr,char *pBegin)
{
if(*pBegin=='\0')
{
std::cout<<pStr<<std::endl;
}
else
{
for(char* pCh=pBeg... | true |
359c50cb1eb11666d78078f58a631e990344758c | C++ | cp-shen/SimpleGF | /src/utils/Application.cpp | UTF-8 | 489 | 2.640625 | 3 | [] | no_license | #include <SimpleGF/utils/Application.h>
using namespace SimpleGF;
Application::Application()
{
}
Application::~Application()
{
}
std::shared_ptr<Window> Application::_window = nullptr;
void Application::init(int wWidth, int wHeight, const char* title)
{
_window = std::shared_ptr<Window>(new Window(wWidth, wHei... | true |
505479cb03b49ed2b731e6b3e6cd09295706b4e5 | C++ | reactorlabs/ght-pipeline | /include/hash.h | UTF-8 | 2,010 | 3.15625 | 3 | [] | no_license | #pragma once
#include <cstdint>
#include <string>
#include <ostream>
#include <cassert>
template<unsigned BYTES>
struct Hash {
static_assert(BYTES % 4 == 0, "Invalid hash size");
Hash() = default;
Hash(std::string const & hex) {
assert(hex.size() == BYTES * 2);
for (... | true |
4e37efddf5215a25b8ff60153908e6bb2bed4efb | C++ | mavd09/notebook_unal | /Math/Simpson.cpp | UTF-8 | 670 | 2.921875 | 3 | [] | no_license | /// Complexity: ?????
/// Tested: Not yet
inline lf simpson(lf fl, lf fr, lf fmid, lf l, lf r) {
return (fl + fr + 4.0 * fmid) * (r - l) / 6.0;
}
lf rsimpson (lf slr, lf fl, lf fr, lf fmid, lf l, lf r) {
lf mid = (l + r) * 0.5;
lf fml = f((l + mid) * 0.5);
lf fmr = f((mid + r) * 0.5);
lf slm = simpson(fl, fmid, f... | true |
694f77c9bead27b9f4578e4d4fec95dc816fcdb3 | C++ | CoderName200/Lab7 | /lab_7/lab_7/lab_7.cpp | UTF-8 | 5,093 | 3.375 | 3 | [] | no_license | #include <iostream>
using namespace std;
template<typename T> void swap(T& a, T& b) {
T c(std::move(a)); a = std::move(b); b = std::move(c);
}
template <class T> const T& max(const T& a, const T& b) {
std::cout << "Вызванна шаблонная функция max" << std::endl;
return (a < b) ? b : a;
}
char*... | true |
75563cd18546f705f8f65948ac2140294766cc7f | C++ | itiievskyi/42-CPP-Pool | /day00/ex01/Contact.class.cpp | UTF-8 | 2,709 | 2.546875 | 3 | [] | no_license | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Contact.class.cpp :+: :+: :+: ... | true |
7be3b293bbf1454b066283764e2fd19c2f16212b | C++ | bxl295/m4extreme | /include/External/stlib/packages/ads/array/SparseArray1.ipp | UTF-8 | 19,119 | 3.109375 | 3 | [
"BSD-2-Clause"
] | permissive | // -*- C++ -*-
#if !defined(__ads_SparseArray1_ipp__)
#error This file is an implementation detail of the class SparseArray.
#endif
namespace ads {
//
// Constructors etc.
//
// Construct a 1-D array sparse array from the values and indices.
template<typename T>
template<typename IndexForwardIter, typ... | true |
f77c123807c74eb939294363b7286aa839151037 | C++ | FranciscoRomano/INFT561 | /projects/INFT561/ConsoleCanvas.h | UTF-8 | 2,014 | 2.8125 | 3 | [] | no_license | #pragma once
/** Dependencies **********************************************************************************/
#include "Win32.Console.h"
/** Declarations **********************************************************************************/
#include "default.h"
#include "Buffer.h"
class ConsoleCanvas {... | true |
0f10c5167a1db204fcca506be93b65afc6a122e7 | C++ | szp35/Usb-uart-serial-port-communication | /scketchArduino.ino | UTF-8 | 8,317 | 2.546875 | 3 | [] | no_license | #define inbits 14 // число значений в массиве, который хотим получить
#define b 50 //задержка в передаче между каналами microseconds 50
#define c 50 //задержка после передачи в мс
//byte receivenew;
byte indexsend;
bool recievedflag;
bool sendingflag;
bool startflag;
bool stopflag;
bool pwmflag;
bool flagone;... | true |
86f129c0412f7d1e14c7f090f0c885a2e1c51eda | C++ | DannyPhantom/City-Generation | /CityGeneration/DynamicRoadGeneration/Square.h | UTF-8 | 450 | 2.578125 | 3 | [] | no_license | #pragma once
#include <vector>
#include "../Libraries/glm/glm.hpp"
class Line;
class Square
{
public:
Square();
~Square();
bool lineBelongsTo(Line *line);
std::pair<Square*, Square*> splitByLine(Line *line);
std::vector<Line *> getLines();
bool pointBelongsTo(glm::vec2 point);
bool pointBelongsToInside(glm::v... | true |
3859ce120eee234d58b3d65a5ddc54db4accaf81 | C++ | dhruvvgandhi/IOT-PRACTICAL | /17SE02CE017-SECE4031-PRACTICAL-11-2.ino | UTF-8 | 1,565 | 3.03125 | 3 | [
"MIT"
] | permissive | //L293D
//Motor A
const int motorPin1 = 5; // Pin 14 of L293
const int motorPin2 = 6; // Pin 10 of L293
//Motor B
const int motorPin3 = 10; // Pin 7 of L293
const int motorPin4 = 9; // Pin 2 of L293
//This will run only one time.
void setup(){
//Set pins as outputs
pinMode(motorPin1, OUTPUT);
pi... | true |
1b231a742185444d0ed4e10f9a5d844807655d76 | C++ | muhammedzahit/Deitel_Solutions | /CPP_How_To_Program_Solutions/3.14 Employee Class/employee.cpp | UTF-8 | 1,475 | 3.84375 | 4 | [] | no_license | /*
#include <iostream>
#include <string>
class Employee{
private:
std::string first_name;
std::string last_name;
int salary;
public:
explicit Employee(std::string name1,std::string name2,int salary);
void setFirstName();
std::string getFirstName();
void setLastName();
std::string getLa... | true |
a24a3224d4811e44232f7b73e1f46e35b0fd95dc | C++ | bxy09/HAC | /src/fscore/fscore.cpp | UTF-8 | 5,401 | 2.921875 | 3 | [] | no_license | #include<iostream>
#include<fstream>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
using namespace std;
struct class_node
{
int label;
float num;
float fscore;
};
struct cluster_tree_node
{
vector<int> label;
float num;
};
void init_class(ifstream&, vector<struct class_node>&, vector<int>&... | true |
6c670d9aee70c0d9792c7fbee5124d1cc44ce060 | C++ | cdsama/cdscript | /src_test/test_lexer_string.cpp | UTF-8 | 5,516 | 2.609375 | 3 | [
"MIT"
] | permissive | // Copyright (c) 2019 chendi
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#include <iostream>
#include <limits>
#include <sstream>
#include "catch2_ext.hpp"
#include "lexer.hpp"
using namespace cd;
using namespace script;
TEST_CASE("Lexer-String", "[core][lexer][strin... | true |
a64c5d4d831c81d36637dde9f9f659e62259cc2b | C++ | Michael-A-Berger/DailyProgrammer | /DP_Hard281/DP_Hard281/MS_Creator.h | UTF-8 | 768 | 3.171875 | 3 | [
"MIT"
] | permissive | /*
Context: https://www.reddit.com/r/dailyprogrammer/comments/50s3ax/
Created by Michael Berger
*/
#pragma once
//Inclusions & Usings
#include <iostream>;
#include <ctime>;
using std::cout;
using std::endl;
using std::cin;
//The MS_Creator class
class MS_Creator
{
//Public variables & methods
public:
MS_Creato... | true |
a17f50da893eb18fa79dd79a624e30d22d9d02a9 | C++ | usherfu/zoj | /zju.finished/2511.cpp | UTF-8 | 1,039 | 2.859375 | 3 | [] | no_license | #include<iostream>
#include<cmath>
#include<vector>
using namespace std;
const double eps = 1e-8;
struct Node {
int no;
double score;
bool operator < (const Node&rhs) const {
if( fabs(score - rhs.score) < eps)
return no < rhs.no;
return score > rhs.score;
}
};
struct cmp{
... | true |
a54cd21194128570bd6ce21f03d7fc5ab1581293 | C++ | Psunu/SchoolProjectServer | /SchoolServer/MooIn/TestClient/main.cpp | UTF-8 | 2,262 | 2.8125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdio>
#include <unistd.h>
#include <arpa/inet.h>
typedef int SOCKET;
using namespace std;
const char RASP = '0';
const char ANDROID = '1';
char name[10] = "박선우";
char status = '4';
typedef struct {
char name[10];
char status;
} Packet;
int mai... | true |
e4df0f2dbfe1f76f9e59209f20557b53d7f5e0f1 | C++ | thegamer1907/Code_Analysis | /contest/1542578648.cpp | UTF-8 | 1,272 | 2.703125 | 3 | [] | no_license | #include<bits/stdc++.h>
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PB push_back
using namespace std;
bool check(int arr[16], int pos, int m, vector<int> possib, int count){
// cout << count << " " << pos << " -- ";
// for (auto el : possib) cout << " " << el;
// cout << endl;
if (... | true |
394f2923822686b4c50871e1b8d1435edc6fa5da | C++ | LeeJehwan/Power-C-Programming | /PART1/PART1/problem18.cpp | UHC | 1,272 | 3.46875 | 3 | [] | no_license | #include <iostream>
#include <stdio.h>
using namespace std;
int strlen(char * str) {
int cnt = 0;
while (str[cnt] != '\0') {
cnt++;
}
return cnt;
}
void strcpy(char * str1, char * str2) {
int idx = 0;
while (str2[idx] != '\0') {
str1[idx] = str2[idx];
idx++;
}
str1[idx] = '\0';
}
void swap_str(char *st... | true |
b79d9aa92d1aa87f6475a6d53de410f61c38c73a | C++ | thekirjava/BSU | /Cryptography/Lab1/Vigenere.cpp | UTF-8 | 945 | 2.984375 | 3 | [] | no_license | //
// Created by JUSTONEIDEA on 19.09.2021.
//
#include "Vigenere.h"
#include <utility>
Vigenere::Vigenere(std::string keyword):keyword(std::move(keyword)) {
}
std::string Vigenere::encrypt(const std::string& data) const {
return processString(data, 1);
}
std::string Vigenere::decrypt(const std::string &data... | true |
7c5df7a9c93fb2e9fc83ceef1129b9d7951c4ceb | C++ | OlegSchwann/Technopark-algorithms | /3-й модуль/1 задание/CArcGraph.hpp | UTF-8 | 1,101 | 3.34375 | 3 | [] | no_license | // Необходимо написать реализацию интерфейса IGraph:
// CArcGraph, хранящий граф в виде одного массива пар {from, to}.
// Очень медленно будет работать.
#include "IGraph.hpp"
#ifndef INC_1_CARCGRAPH_HPP
#define INC_1_CARCGRAPH_HPP
class CArcGraph : public IGraph {
public:
explicit CArcGraph(int n) : number_of_ve... | true |
671fb992856e3f83b4f1248d08dcbe1054df03d4 | C++ | triffon/oop-2019-20 | /labs/4/lab6 - files part 1/Source.cpp | UTF-8 | 2,047 | 3.3125 | 3 | [
"MIT"
] | permissive | #include "Student.h"
#include "StudentDynamic.h"
#include <iostream>
#include <fstream>
#include <cassert>
using namespace std;
void assertEqual(const Student& s1, const Student& s2) {
assert(strcmp(s1.getName(), s2.getName()) == 0);
assert(s1.getFn() == s2.getFn());
}
void assertEqual(const StudentDynamic& s1, co... | true |
40a838023a738891fe848ad7711afcd3a1b20e3c | C++ | mmamyan/Virtual-Assembler-Interpreter | /Headers/Instruction.h | UTF-8 | 970 | 2.671875 | 3 | [] | no_license | //
// Created by Narek Hovhannisyan and/or Milena Mamyan on 10/14/18.
//
#ifndef VIRTUAL_MACHINE_OPCODEPARSER_H
#define VIRTUAL_MACHINE_OPCODEPARSER_H
#include "LanguageConstants.h"
#include <cstdint>
class Instruction {
private:
static const uint8_t REGISTERS_ORDER_MASK = 0b00000011;
static const uint8_t JU... | true |
3106a19de9fb9f1423193cc772f4e9db56739ca2 | C++ | sebastiaan1997/reflectxx | /src/parser/definition_base.hpp | UTF-8 | 948 | 2.890625 | 3 | [] | no_license | #ifndef REFLECT_DEFINITION_BASE_HPP
#define REFLECT_DEFINITION_BASE_HPP
#include <string_view>
namespace rf {
class DefinitionBase {
private:
std::string_view _file;
std::size_t _line_number;
std::string_view _src;
protected:
constexpr DefinitionBase(std::string_view file, ... | true |
e1b23305617d978396c6344e5788140f5b429c73 | C++ | NazmulHasanMoon/OJ | /Random/cf-A. Anton and Danik-379-2.cpp | UTF-8 | 456 | 2.53125 | 3 | [] | no_license | #include<iostream>
#include<cstdio>
#include<cstring>
#define sz 100005
using namespace std;
char c[sz];
int main()
{
long int i,x,y,n;
scanf("%ld",&n);
getchar();
x=y=0;
for(i=0;i<n;i++)
{
scanf("%c",&c[i]);
if(c[i]=='A')
x++;
else
y++;
}
... | true |
53a6d884509057b9221d5d7cbaf6828c79db57a3 | C++ | LievreAI/unreal-follow-lead-ai | /Source/FollowLeadAI/Player/PlayerCharacter.cpp | UTF-8 | 6,034 | 2.5625 | 3 | [
"MIT"
] | permissive | #include "PlayerCharacter.h"
#include "Camera/CameraComponent.h"
#include "Components/InputComponent.h"
#include "Components/CapsuleComponent.h"
#include "Components/SkeletalMeshComponent.h"
#include "GameFramework/Controller.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/SpringArmComp... | true |
57357313fad588c426b7b45c0c3f8b01a0a7a4c4 | C++ | student-leti/map_words | /main.cpp | UTF-8 | 1,524 | 3.21875 | 3 | [] | no_license | #include <fstream>
#include <iostream>
#include <set>
#include <map>
#include <string>
#define word_lenght 50
using namespace std;
int main(){
char word[word_lenght];
int i = 0;
map<string, int> vacebulary;
set<int> count;
set<string> words;
set<string>::iterator it;
string path;
ifstream file;
cout<< "... | true |
104dd9d2c3c4450ed7d4fdfe1d3dddbf1d67aa33 | C++ | littlee1032/fkalg | /POJ/1239/main.cpp | UTF-8 | 1,824 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 90;
char s[maxn];
int len, dpforward[maxn], dpbackward[maxn];
bool cmp(int s1, int t1, int s2, int t2);
int main()
{
while(true)
{
scanf("%s", s);
len = strlen(s);
if(len == 1... | true |
58da83da0cc3073aa633dd7d9fea1ba395c6ba40 | C++ | qucphng0205/Ninja-Gaiden | /LearningDirectX2/Effect.cpp | UTF-8 | 408 | 2.609375 | 3 | [] | no_license | #include "Effect.h"
Effect::Effect(D3DXVECTOR3 position, float durationTime) {
this->durationTime = durationTime;
this->position = position;
}
bool Effect::Update(double dt) {
//false will destroy this
anim->Update(dt);
if (anim->GetPercentTime() > durationTime)
return false;
return true;
}
void Effect::R... | true |
37f6c9457316bec983f9a265bf0a7dccf0bafe17 | C++ | MinaPecheux/Advent-Of-Code | /2019/C++/src/day10.cpp | UTF-8 | 8,455 | 3.546875 | 4 | [] | no_license | /**
* \file day10.cpp
* \brief AoC 2019 - Day 10 (C++ version)
* \author Mina Pêcheux
* \date 2019
*
* [ ADVENT OF CODE ] (https://adventofcode.com)
* ---------------------------------------------
* Day 10: Monitoring Station
* =============================================
*/
#include <algorithm>
#include <cm... | true |
c95250e4236f1a991226d7dd96a01ef241a70cc2 | C++ | hpuxiaoqiang/coding | /DataStrcture/数据结构书中算法的实现/BasicOperate/ListQueue.cpp | GB18030 | 1,077 | 3.296875 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#define OK 1
#define ERROR 0
typedef int ElemType;
using namespace std;
typedef struct QNode{
struct QNode *next;
ElemType data;
}QNode,*QueuePtr;
typedef struct{
QueuePtr front;
QueuePtr rear;
}LinkQueue;
//һյ
int InitQueue(LinkQueue &Q){
Q.front = Q.rear = new QNode;
Q.fro... | true |
19ccd04fa22a677c2a80ac8e45e3d6f3ad88a6cc | C++ | edwinsolisf/my_game_engine | /src/Vector.cpp | UTF-8 | 396 | 2.984375 | 3 | [] | no_license | #include "Vector.h"
namespace gmath
{
Vector<3>::Vector(const Vector<2>& other, const float& _z)
{
x = other.x;
y = other.y;
z = _z;
}
Vector<4>::Vector(const Vector<3>& other, const float& _w)
{
x = other.x;
y = other.y;
z = other.z;
w = _w;
}
Vector<2> Vector<3>::ToVec2() const
{
return { x... | true |
ca7b06a23731fd1a672613fb45487207327a1be1 | C++ | alexandraback/datacollection | /solutions_2692487_0/C++/sebii/motes.cpp | UTF-8 | 888 | 2.890625 | 3 | [] | no_license | #include <algorithm>
#include <iostream>
#include <set>
#include <vector>
using namespace std;
int solve(vector<int> motes, int A, int N)
{
int j = 0;
while (j < N && motes[j] < A) {
A += motes[j];
++j;
}
int ans = N - j;
if (A - 1 == 0)
return ans;
int ans2 = 0;
... | true |
d083da31c52ec53a178cfc8ef7b521bc8cc1459c | C++ | ar1kumar/rudeSalad | /moisture_sensor.ino | UTF-8 | 719 | 2.640625 | 3 | [] | no_license | #include <LiquidCrystal.h>
int Contrast=100;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
analogWrite(6,Contrast);
lcd.begin(16, 2);
}
void lcdMessage(String input, String input2){
lcd.clear();
lcd.setCursor(0, 0);
... | true |
dd1796c05cb31078a25189b1d960755c345d4ee9 | C++ | kocubinski/torque_sockets | /core/formatted_string_buffer.h | UTF-8 | 2,423 | 2.890625 | 3 | [
"MIT"
] | permissive | // Copyright GarageGames. See /license/info.txt in this distribution for licensing terms.
class formatted_string_buffer
{
public:
formatted_string_buffer()
{
_dynamic_buffer = 0;
_len = 0;
}
formatted_string_buffer(const char8 *fmt, ...)
{
va_list args;
va_start(args, fmt);
_dynamic_buffer = 0;
form... | true |
e378d81b74a462bb9d162d0fef3159afb77db118 | C++ | apoorv-kulkarni/leetcode | /missingNumber.cpp | UTF-8 | 594 | 3.546875 | 4 | [
"MIT"
] | permissive | // Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missing from the array.
// Example 1:
// Input: [3,0,1]
// Output: 2
// Example 2:
// Input: [9,6,4,2,3,5,7,0,1]
// Output: 8
// Note:
// Your algorithm should run in linear runtime complexity. Could you implement it u... | true |
94b2b82d9098f390bd2f6a563f9619789de2b83b | C++ | eriser/AudioLab | /AudioSynth/AudioSynth/FIFO.h | UTF-8 | 1,659 | 3.109375 | 3 | [
"CC0-1.0"
] | permissive | //
// FIFO.h
// Synth_Osc2
//
// Created by Ness on 8/20/15.
// Copyright (c) 2015 Ness. All rights reserved.
//
#ifndef __Synth_Osc2__FIFO__
#define __Synth_Osc2__FIFO__
#include <stdio.h>
class FIFO;
class Node{
friend class FIFO;
public:
Node(float val):data(val),next(NULL){};
~Node(){};
privat... | true |
ddebd018196ce021e14f331f09ce7565886ba404 | C++ | RJ-Mitra/Programming101_CPP | /findLeastSubArrToSortFullArray.cpp | UTF-8 | 1,450 | 4.09375 | 4 | [] | no_license | /*Given a list of numbers, find smallest the sub-array, which if sorted,
will lead to the entire list getting sorted. Return length of the sub-array
Approach 1: Sort the list and compare both lists. The part which is not
matching is the required sub-array that needs to be sorted.
Approach 2: (below) Find the least nu... | true |
6a8d47589ad60b396a4990e663c0fbc6dce5169d | C++ | Tomev/kMedoidsAlgorithm | /groupingAlgorithm/cluster.cpp | UTF-8 | 12,612 | 2.640625 | 3 | [] | no_license | #include <clocale>
#include <iostream>
#include <math.h>
#include <QDebug>
#include "cluster.h"
double cluster::_deactualizationParameter = 0.999;
cluster::cluster(){}
cluster::cluster(long index) : index(index) {}
cluster::cluster(std::shared_ptr<sample> object, bool isMedoid) : object(object)
{
findRepresentati... | true |
e0459763e6857080f5d3446d63ee7635ca40a511 | C++ | Yappedyen/Helloworld | /13function.cpp | GB18030 | 2,265 | 3.984375 | 4 | [] | no_license | #include<iostream>
using namespace std;
#include "swap.h"
int add(int a, int b) //a,bΪβ
{
int sum;
sum = a + b;
return sum;
}
//ֵݣǺʱʵνֵβ
//ֵʱβηı䣬Ӱʵ
//Ҫֵʱдvoid
void swap1(int num1, int num2)
{
int temp = num1;
num1 = num2;
num2 = temp;
//return; ֵҪԲдreturn
}
//ʽ
//
void test01()
{
cout << "" << endl;
}... | true |