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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
54da8c75d102b395308ca6acfdcbaffe706aee55 | C++ | saranfly/DesignPatterns | /ObserverPattern/digitalclock.cpp | UTF-8 | 508 | 2.9375 | 3 | [] | no_license | #include "digitalclock.h"
DigitalClock::DigitalClock(ClockTimer *s) : QWidget(s)
{
_subject = s;
_subject->Attach(this);
}
DigitalClock::~DigitalClock()
{
_subject->Detach();
}
void DigitalClock::Update(Subject *theChangedSubject)
{
if(theChangedSubject == _subject)
{
Draw();
}
}
voi... | true |
1cbea5a623a4d92f0705e8c140199be170bd56ce | C++ | Linearity/cetra | /src/tests.h | UTF-8 | 6,559 | 2.796875 | 3 | [] | no_license | #include <cxxtest/TestSuite.h>
#include <math.h>
#include "TetMesh.h"
class MyTestSuite1 : public CxxTest::TestSuite
{
public:
void testVolume(void)
{
SlVector3 verts[4];
verts[0] = SlVector3(0, 0, 0);
verts[1] = SlVector3(1, 0, 0);
verts[2] = SlVector3(0, 1, 0);
verts[3] = SlVector3(0, 0, 1);
IndexT... | true |
4a7526916ae5dc6c4ef99969dffb55083ce30ba9 | C++ | benjyberk/ADP-ex4 | /Serializer.cpp | UTF-8 | 3,253 | 2.96875 | 3 | [] | no_license | //
// Benjy Berkowicz - 336182589
// Advanced Programming 2016-2017 Bar Ilan
//
#include "Serializer.h"
#include "StandardTaxi.h"
#include "LuxuryTaxi.h"
using namespace std;
std::string Serializer::serializeDriver(Driver * d) {
ostringstream buildString;
buildString << d->getID() << ';' << d->getAge() << ';... | true |
e8bf2740314822b8b2bfe70325f1f40cb8e39a3a | C++ | iansu81/Ian_play | /Leetcode/17_letter_comb_phone_num.cpp | UTF-8 | 1,710 | 4.03125 | 4 | [] | no_license | #include <iostream>
#include <vector>
#include <unordered_map>
using namespace std;
class Solution
{
public:
vector<string> letterCombinations(string digits)
{
vector<string> result;
if(digits.size() == 0)
{
return result;
}
// 建立一個table去求所有按鍵的字母
unor... | true |
b4c9546a45d059f76289d2824ba1e6b0e351c384 | C++ | vrsys/lamure | /mesh_preprocessing/include/lamure/mesh/old/Chart.h | UTF-8 | 14,726 | 2.890625 | 3 | [
"BSD-3-Clause"
] | permissive | #include "CGAL_typedefs.h"
#include "eig.h"
#include "utils.h"
// struct to hold a vector of facets that make a chart
struct Chart
{
uint32_t id;
std::vector<std::shared_ptr<Facet>> facets;
std::vector<bool> facets_are_inner_facets;
std::vector<Vector> normals;
std::vector<double> areas;
bool a... | true |
b29de88f24674ad4badc86c8cbff9e46edfc5027 | C++ | fras2560/GraphicsClass | /fras2560_a3/a3.cpp | UTF-8 | 17,429 | 2.546875 | 3 | [] | no_license | /*
* Name: Dallas Fraser
* ID: 110242560
* Class: CP411
* Assignment: 3
* Date: 10/24/2013
* File: a2.cpp
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <GL/glut.h>
#include <time.h>
#include "World.hpp"
#include "Camera.hpp"
#include "Point.hpp"
#include "Cube.hpp"
#include "Light.hpp"
... | true |
5cd301791ede8170e0164ab5987136536dcb8153 | C++ | levelp/cpp | /03/HomeWork_OOP_stack_q/main.cpp | UTF-8 | 1,720 | 4.09375 | 4 | [] | no_license | // Домашняя работа
// ---------------
#include <iostream>
#include <cstdlib>
using namespace std;
//-->
// Элемент стека и очереди
struct E {
int value; // Значение элемента
E* next; // Указатель на следующий элемент
};
// Стек
struct Stack {
E* top; // Вершина стека
// Конструктор
Stack() : top(NULL) {}
... | true |
5938741a272c7c21ac417ae811ad3d86a0c1407e | C++ | jeag2002/SpaceShooter2D-EngineTest | /2dLight source/Collision.cpp | UTF-8 | 9,318 | 2.90625 | 3 | [] | no_license | #include "Collision.h"
namespace Collide
{
bool isColliding(SDL_Surface* a, int ax, int ay, SDL_Surface* b, int bx, int by){
float aright = ax + a->w;
float bright = bx + b->w;
float abottom = ay + a->h;
float bbottom = by + b->h;
if(aright < bx ||bright < ax || bbottom < ... | true |
156af42ce26205ae336938ff9857a98fadf3cb12 | C++ | Guillermocala/Practica-cpp | /Miscelanea_1/ejercicio17.cpp | UTF-8 | 1,583 | 3.8125 | 4 | [] | no_license | /*
*Guillermo Cala; dec/ 04/ 2018
*elaborar un algoritmo que muestre los primeros 100 n�meros de izquierda a derecha usando un array de dos dimensiones
*la �ltima fila a mostrar� la suma de sus respectivas columnas.
*/
#include <iostream>
using namespace std;
void FillArray(int list[][15], const int * Fil, const int * ... | true |
33566de28934be89aa04baa7aca16ad1d332af6f | C++ | Arildlil/cpp-opengl-game | /src/core/material.h | UTF-8 | 767 | 2.84375 | 3 | [] | no_license | #ifndef MATERIAL_H
#define MATERIAL_H
#include <../../include/glm/glm.hpp>
namespace Core {
class Material {
public:
Material(glm::vec3 ambient, glm::vec3 diffuse, glm::vec3 specular, float shininess);
virtual ~Material();
bool operator==(const Material& other);
... | true |
9906080cd6166a11fd12a50ae6d83ac445e162de | C++ | prasium/Core-problems | /Binary Search Tree/Sorted Array to balanced BST (Recursive).cpp | UTF-8 | 1,503 | 2.96875 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n"
const int N = 100;
const int mod = 1e9 + 7;
int n, m;
#define MAX 256
#define MAX_WORD_LEN 500
struct node{
int key;
node* left;
node* right;
};
node* newnode(int data)
{
node* NN = new node;
NN->key = data;... | true |
39c45af4450a2a61796eecaad00cfa623dd8d10e | C++ | NachiketUN/jaeger-tracing-cpp | /examples/App.cpp | UTF-8 | 9,966 | 3.0625 | 3 | [
"Apache-2.0"
] | permissive | // jaeger client adapted from https://github.com/jaegertracing/jaeger-client-cpp
// btree code adapted from https://www.geeksforgeeks.org/b-trees-implementation-in-c/
#include <iostream>
#include <yaml-cpp/yaml.h>
#include <jaegertracing/Tracer.h>
#include <bits/stdc++.h>
#define N 4
struct node {
// key... | true |
882ad1222bce1ef47971036ade990836f760ecc2 | C++ | thrallm/cudenver | /csci_1411/lab09/pointers.cpp | UTF-8 | 1,266 | 4.625 | 5 | [] | no_license | // This program demonstrates the use of pointer variables
// It finds the area of a rectangle given length and width
// It prints the length and width in ascending order
// Mason Thrall
#include <iostream>
using namespace std;
int main(){
int length; // holds length
int width; // holds width
int area; // hol... | true |
bc00a9470f68b53cb1a1798aa80d20a390ec1d17 | C++ | abstrakraft/stuff | /toolkit/viewer.h | UTF-8 | 7,145 | 2.625 | 3 | [] | no_license |
#ifndef __TOOLKIT_VIEWER_H__
#define __TOOLKIT_VIEWER_H__
#include "stdwx.h"
#include "camera.h"
#include "gl_utils.h"
#include "color_based_selection.h"
#include "error.h"
// An opengl canvas window that maintains camera state and allows camera motion
// via mouse and key commands:
//
// * Pan: Right button drag,... | true |
44db81fa9d3906204731512c45eb47b16b7fbdd2 | C++ | erickjshepherd/Chess-AI-Graphics | /Chess_Graphics/Chess Graphics.cpp | UTF-8 | 44,225 | 2.796875 | 3 | [] | no_license |
#include "stdafx.h"
#include <stdio.h>
#include <iostream>
#include "Definitions.h"
#include "windows.h"
#include "Color.h"
#include <SDL.h>
#include <SDL_image.h>
#undef main
#define Depth 5 // Sets the depth the alpha beta function will search
using namespace eku;
using namespace std;
void set_board(Tile* boar... | true |
02290279df94611c4dba4ae4601235f2871ebd0e | C++ | zvova7890/lg-phone-develop | /gcc/Sources/LampFM/LocalFSProtocol.cpp | UTF-8 | 6,078 | 2.609375 | 3 | [] | no_license | #include "LocalFSProtocol.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <fs.h>
#include <string.h>
#include <Api/ApiLinkLib/ApiLink.h>
typedef struct
{
int fd;
int pos;
int size;
}File;
static File fds[128];
void init_fds()
{
for(i... | true |
14502ebd08b30a733dd957a12886f3226c398cee | C++ | Satyankar15/C-C-Lab-Extra | /ACDLAB PDA ambncndm.cpp | UTF-8 | 636 | 3.125 | 3 | [] | no_license | #include<iostream>
#include<vector>
#include<string.h>
using namespace std;
int main()
{
vector<char> a;
a.push_back('Z');
int n,i;
char x,y;
bool Bflag=0;
string word;
cout<<"Enter string\n";
cin>>word;
n=word.length();
for(i=0;i<n;i++)
{
x=word[i];
if(x=='a' && Bflag==0)
{
a.p... | true |
e64566fac62ceb9746eb8fd0b0b17d8f50a521a7 | C++ | MajickTek/hesperus2 | /source/engine/core/hesp/math/geom/Plane.h | UTF-8 | 1,525 | 3 | 3 | [] | no_license | /***
* hesperus: Plane.h
* Copyright Stuart Golodetz, 2008. All rights reserved.
***/
#ifndef H_HESP_PLANE
#define H_HESP_PLANE
#include <boost/shared_ptr.hpp>
using boost::shared_ptr;
#include <hesp/math/vectors/Vector3.h>
namespace hesp {
/**
This enumeration represents the result of classifyi... | true |
1cae88491fb36b8f1d84a729ecd48a97d05e7e3f | C++ | KEROLIS/Codeforces-solutions | /Even_Odd_Positive_and_Negative.cpp | UTF-8 | 471 | 2.734375 | 3 | [] | no_license | // https://codeforces.com/group/MWSDmqGsZm/contest/219432/problem/C
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include<iomanip>
using namespace std;
int main()
{
int y=0,even=0, odd=0,pos=0,ne=0;
long long int x;
cin>>y;
for(int i=0; i < y; i++)
{
cin>>x;
if (x%2==0)
even++;
el... | true |
f742f112ca10246a68bb17392a3c656d599b4cb7 | C++ | BobLuStudio/Gair_3.2 | /Gair_3.2/remote.ino | UTF-8 | 1,640 | 2.640625 | 3 | [] | no_license |
bool fromremote()
{
char commandFromRemote[11];
if (receiveCommandFromRemote(commandFromRemote))
{
mode = (uint8_t)commandFromRemote[1];
rstate[Xaxis] = floatStructor(2, commandFromRemote);
rstate[Yaxis] = floatStructor(4, commandFromRemote);
rstate[Zaxis] = floatStructor(6, commandFromRe... | true |
53d9413af5f2ef0fdf8aa01a414329ca07a8704e | C++ | sirgal/Port-Sniffer | /ports/emulatedport.h | UTF-8 | 4,552 | 2.65625 | 3 | [] | no_license | #ifndef EMULATEDPORT_H
#define EMULATEDPORT_H
#include <QMap>
#include <QDebug>
#include <QThread>
#include "ports/port.h"
#include "port_settings/emulatedport_settings.h"
#include "gui_builders/emulatedport_guibuilder.h"
class EmulatedPort : public Port
{
Q_OBJECT
public:
using settings_type = EmulatedPort... | true |
974d49be335c976cd6395dcb9636de812fbc5d84 | C++ | SeniorProjects-CS-Illinois/USGS2012 | /test/StatusTests.cpp | UTF-8 | 1,964 | 2.53125 | 3 | [] | no_license | #include "StatusTests.h"
#include <iostream>
using std::cout;
using std::endl;
void StatusTests::initStatusTest() {
Status modelStatus;
QCOMPARE(Status::UNCONFIGURED, modelStatus.getState());
}
void StatusTests::setStatusTest() {
Status modelStatus;
QCOMPARE(modelStatus.getState(), Status::UNCONFIGURED)... | true |
55944919f1cceaf604181195ba077eeb5cd3a01c | C++ | 5for3to1/OpenCNN | /OpenCNN-4.0/OpenCNN-4.0/main.cpp | GB18030 | 680 | 2.625 | 3 | [] | no_license | #include"Deepface.h"
void thread01()
{
Deepface lighten_CNN;
lighten_CNN.forward("feature_512_1");
}
void thread02()
{
Deepface lighten_CNN;
lighten_CNN.forward("feature_512_2");
}
void main()
{
Deepface lighten_CNN;
lighten_CNN.forward("feature_512");
//ʵlighten-CNN
//Deepface lighten_CNN_1;
//Deepface li... | true |
8e481002c51e8ddbc466144857158b9587421c25 | C++ | SazPavel/Modern_problems_of_informatics_3 | /test/before/1.cpp | UTF-8 | 1,110 | 2.796875 | 3 | [] | no_license | #include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include <sys/time.h>
#include <mpi.h>
#include <math.h>
#include <inttypes.h>
enum { m = 10000, n = 10000 };
/* dgemv: Compute matrix-vector product c[m] = a[m][n] * b[n] */
void dgemv(float *a, float *b, float *c, int m, int n)
{
for (int i = 0; i < m; i++) {
... | true |
81f019203f91b532d1f2e1687521ea372a073e88 | C++ | Athrun1027/pat | /A/A1011.cpp | UTF-8 | 445 | 2.875 | 3 | [] | no_license | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
double a[3]={0};
for(int i = 0; i < 3; i++){
double W, T, L;
cin>>W>>T>>L;
a[i] = max(W, T);
a[i] = max(a[i], L);
if(a[i] == W){
printf("W ");
}else if(a[i] == T){
prin... | true |
9671179da498c9dc450cda4ad4e1feb8f8a678f0 | C++ | reiman2222/school-assigments | /3300/assignment1/hailstone.cpp | UTF-8 | 3,067 | 4.25 | 4 | [] | no_license | // CSCI 3300
// Assignment: 1
// Author: Jack Edwards
// File: hailstone.cpp
// Tab stops: 4
//This program asks the user to enter a number then prints the hailstone
//sequence of that number, the length of said hailstone sequence,
//the largest number in said hailstone sequence and the starting num... | true |
f71412c4a3edab016e82bfbdec075cd93c552b78 | C++ | G-Nikita/C-Programs | /findPrimeNo.CPP | UTF-8 | 847 | 3.140625 | 3 | [] | no_license | #include<stdio.h>
#include<conio.h>
int main()
{
int i,r1,r2,r3,r4,n;
printf("enter the number upto which you want to find prime numbers");
scanf("%d",&n);
if(n>=11)
{
printf("prime numbers are 2,3,5,7");
for(i=2;i<=n;i++)
{
r1=i%2;r2=i%3;r3=i%5;r4=i%7;
if(r1!=0&&r2!=0&&r3!=0&&r4!=0)
printf(" %d,",i);
... | true |
0c49c63ba8f865796b855b74c965930564528729 | C++ | sleepyjun/PS | /BOJ/23288/23288.cpp | UTF-8 | 2,600 | 2.546875 | 3 | [] | no_license | // https://www.acmicpc.net/problem/23288
#include <algorithm>
#include <iostream>
#include <limits>
#include <string>
#include <vector>
#include <queue>
using std::cin; using std::cout;
using ull = unsigned long long;
using pii = std::pair<int, int>;
const int INF = std::numeric_limits<int>::max();
const int DIR[4][2]... | true |
1b2420e782d0c5143c8eddac0740d05ca219b396 | C++ | DikranHachikyan/c-11-14-17-20190414 | /02/12-lambda-vars.cpp | UTF-8 | 617 | 2.984375 | 3 | [] | no_license | #include <iostream>
#include <typeinfo>
#include <string>
int global_value = 20;
// void foo(){
// static int v = 2;
// std::cout<<"v="<<++v<<std::endl;
// }
int main(){
static int static_z = 1;
const int const_port = 80;
auto show = [msg="Message Text"](){
static_z = 11;
global_... | true |
21992da24e2931e1200335f4d4bbe86707cce8c8 | C++ | viv-india/Viv_lib | /suffixtree.cpp | UTF-8 | 5,544 | 3.0625 | 3 | [] | no_license | #include<bits/stdc++.h>
using namespace std;
#define MAX_CHAR 256
/*******************************************the Skeleton************************************************************/
struct Node {
struct Node *children[MAX_CHAR];
struct Node *suffixLink;
int start;
int *end;
int suffixIndex;
};
/*... | true |
7d6fa8542cac98191a8f50aaf3003c108e2700f3 | C++ | ViteFalcon/godot | /modules/roklegend/blib/math/Polygon.cpp | UTF-8 | 6,084 | 2.765625 | 3 | [
"CC-BY-4.0",
"MIT",
"LicenseRef-scancode-free-unknown",
"OFL-1.1",
"Bison-exception-2.2",
"FTL",
"GPL-3.0-or-later",
"BSD-3-Clause",
"Zlib",
"CC0-1.0",
"GPL-3.0-only",
"BSL-1.0",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"LicenseRef-scancode-nvidia-2002",
"BSD-2-Clause",
"Li... | permissive | #include "Polygon.h"
#include "Line.h"
#include "Rectangle.h"
#include <limits>
#include <blib/math/Triangle.h>
#include <blib/util/Log.h>
#include <poly2tri/poly2tri.h>
#include <clipper/clipper.hpp>
using blib::util::Log;
namespace blib
{
namespace math
{
bool Polygon::intersects(const Line &line) const
{
... | true |
47b0ea5ba8111e7cd3c2504a558cca5c07570207 | C++ | extcpp/graph | /include/ext/property_map/property_map.hpp | UTF-8 | 3,534 | 2.703125 | 3 | [] | no_license | // Copyright - 2020 - Jan Christoph Uhde <Jan@UhdeJC.com>
#ifndef EXT_GRAPH_PROPERTY_MAP_PROPERTY_MAP_HEADER
#define EXT_GRAPH_PROPERTY_MAP_PROPERTY_MAP_HEADER 1
#include <iostream>
#include <iterator>
#include <vector>
#include <map>
//#include <ext/macros/assert.hpp>
//#include <ext/util/bit_tricks.hpp>
#include <c... | true |
754166e8c7a676a0471bacfce416593f4cff8f87 | C++ | aeremin/Codeforces | /alexey/Solvers/11xx/1106/Solver1106B.cpp | UTF-8 | 2,239 | 2.71875 | 3 | [] | no_license |
#include <Solvers/pch.h>
#include "algo/io/baseio.h"
#include "algo/io/readvector.h"
#include "iter/range.h"
using namespace std;
// Solution for Codeforces problem http://codeforces.com/contest/1106/problem/B
class Solver1106B {
public:
void run();
};
void Solver1106B::run() {
int n_dishes = read<int>()... | true |
712751a7c1d4b2395c4885e073ec4c9a0d45041d | C++ | DongJoonLeeDJ/jhy0409 | /4 Arduino/210203_buzzer_tone_serial/5_mun1/5_mun1.ino | UTF-8 | 830 | 2.78125 | 3 | [] | no_license | void setup() {
// 거실등 ON, 알람 2회
// 거실등 OFF, 알람 1회
// PC프로그램에서 메시지 수신
// 거실등 ON
// 거실등 OFF
Serial.begin(9600);
#define LED 13 //변수로 지정하면 코드가 길어질 때 변수값만 수정가능
#define BUZZER 10
pinMode(LED, OUTPUT);
pinMode(BUZZER, OUTPUT);
Serial.begin(9600);
}
void loop() {
if(Serial.available()){
char ch =... | true |
9860b22ac2bda7613316ea68e514fe19382f6dde | C++ | RichyHBM/PlanetGeneratorFYP | /src/framework/Input/Input.hpp | UTF-8 | 366 | 2.65625 | 3 | [] | no_license | #ifndef INPUT_HPP
#define INPUT_HPP
#include "./Keyboard.hpp"
#include "./Gamepad.hpp"
class Input
{
public:
enum Type {
KEYBOARD,
GAMEPAD
};
Input();
~Input();
void SetType( Type t );
void Update();
static Input Manager;
protected:
Type mType;
Keyboard mKeyboard... | true |
6f2abfff03588673453e5ed571e24a3208ca61c7 | C++ | MingNine9999/algorithm | /Problems/boj2304.cpp | UTF-8 | 903 | 2.984375 | 3 | [] | no_license | //Problem Number : 2304
//Problem Title : 창고 다각형
//Problem Link : https://www.acmicpc.net/problem/2304
#include <iostream>
using namespace std;
int col[1001];
int main(void)
{
ios::sync_with_stdio(false);
cin.tie(0);
int n;
int l, h;
int maxIndex = 0, lastIndex = -1;
cin >> n;
for (int... | true |
93df703581518bd453908a124a96871e56624605 | C++ | avinashpalamanda/Algorithmic-toolbox | /Array_string/anagram.cpp | UTF-8 | 591 | 3.5 | 4 | [] | no_license | #include<iostream>
#include<string.h>
using namespace std;
void anagram(char* buffer_1,char* buffer_2){
if(strlen(buffer_1) != strlen(buffer_2)){
cout<<"Not an Anagram\n";
return;
}
int count[256]={0};
int i=0;
while(i<strlen(buffer_1)){
count[*(buffer_1+i)]++;
count[*(buffer_2+i)]--;
i... | true |
603f6b237ac901f3d5e3c27fce5f86cb2bfd7d8c | C++ | lineCode/Rendu | /src/apps/pathtracer/BVHRenderer.hpp | UTF-8 | 2,750 | 2.71875 | 3 | [
"MIT"
] | permissive | #pragma once
#include "PathTracer.hpp"
#include "raycaster/RaycasterVisualisation.hpp"
#include "scene/Scene.hpp"
#include "renderers/Renderer.hpp"
#include "graphics/Framebuffer.hpp"
#include "input/ControllableCamera.hpp"
#include "graphics/ScreenQuad.hpp"
#include "Common.hpp"
/**
\brief Renderer coupled with a... | true |
c17e26796f5eda7cca52895707050ef95f0a0b5d | C++ | ehudhala/Siesta | /src/ast.h | UTF-8 | 1,409 | 2.796875 | 3 | [] | no_license | #pragma once
#include <string>
#include <vector>
#include "boost/variant.hpp"
class NumberExprAst;
class VariableExprAst;
class BinaryExprAst;
class CallExprAst;
class PrototypeAst;
class FunctionAst;
using ExprAst = boost::variant<
NumberExprAst,
VariableExprAst,
boost::recursive_wrapper<BinaryExprAst... | true |
704e1daa37a05a138e0cc0fc324d76c473e1c981 | C++ | jtlai0921/ArduinoWearableProjects_Codefiles | /ArduinoWearableProjects_Codefiles/Chapter 4/ch4_3.ino | UTF-8 | 1,034 | 2.78125 | 3 | [] | no_license | int powerPin[]={
19,18,17,16,14,9,8,6,5,4,3};
int gndPins[]={
12,11,10};
int refreshRate=200;
void setup(){
for(int i=0; i<20;i++){
pinMode(i,OUTPUT);
}
//
for(int j=0;j<3;j++){
digitalWrite(gndPins[j],HIGH);
}
}
void loop(){
nightrider();
}
//
void nightrider()
{
/*Instead of starting to loop through the columns we lo... | true |
79ec3b37efa5c0cd3253c4b25b1e201c4518311d | C++ | TeoPaius/Projects | /c++/Diverse problems and algorithms/Problems/alocari/alocari/recapitulare/2/main.cpp | UTF-8 | 447 | 2.515625 | 3 | [] | no_license | #include <fstream>
#include <cstring>
using namespace std;
ifstream is("2.in");
ofstream os("2.out");
int main()
{
int n;
char a[20];
char b[20];
int cnt = 0;
is >> n;
is.get();
is.getline(a, 19);
for ( int i = 0; i < n - 1; ++i )
{
is.getline(b, 19);
if ( strstr(b ... | true |
8a046d26101efbf83b2ac0466bb74c3110866c6c | C++ | tiger1710/didactic-octo-funicular | /source/c++(c)-code/algospot.com/DRUNKEN.cpp | UTF-8 | 1,304 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#define endl '\n'
using namespace std;
typedef pair<int, int> point;
class Drunken {
private:
const int INF = 987654321;
int V, E;
int T;
vector<int> delay;
vector<vector<int>> adj, W;
void input(void) {
cin >> V >> E;
delay = vector<int>(V);
W =... | true |
b9c7a2daa9368d574e6b39c73a271ecf161a5011 | C++ | moophis/leetcode_solutions | /Binary Tree Inorder Traversal.cpp | UTF-8 | 2,997 | 3.578125 | 4 | [] | no_license | /**
* Definition for binary tree
* struct TreeNode {
* int val;
* TreeNode *left;
* TreeNode *right;
* TreeNode(int x) : val(x), left(NULL), right(NULL) {}
* };
*/
class Solution {
void recursive(vector<int> &result, TreeNode *root) {
if (root == nullptr) {
return;
... | true |
dd9dd09fdbe491c9ea700546115d87689aafc637 | C++ | boveloco/plataformGameEditor | /ROOT - Level Editor/src/GameObject.h | UTF-8 | 824 | 2.765625 | 3 | [] | no_license | #pragma once
#include<SDL.h>
class Vector2D;
class Texture;
class RigidBody2D;
class GeometricShape;
class GameObject
{
protected:
Texture *m_image;
RigidBody2D *m_transform;
public:
GameObject();
GameObject(Texture *, Vector2D *, GeometricShape *);
~GameObject();
//get
RigidBody2D *GetTransform() const;
Ve... | true |
3c08b367891c5ef186ae570db123386e694a4482 | C++ | dhruvie/CSES | /Dynamic Programming/RemoveDigits.cc | UTF-8 | 567 | 2.90625 | 3 | [
"MIT"
] | permissive | #include<bits/stdc++.h>
using namespace std;
#define int long long
#define Mod 1000000007
//Greedy Approach
// int RemoveD(int n)
// {
// int ans=1;
// while(n>9)
// {
// int x=n,max_d=0;
// while(x!=0)
// {
// max_d=max(x%10,max_d);
// x/=10;
// }
// n-=max_d;
// ans++;
// }
// return ans;
// }... | true |
2f88e88d8bfce0756a6a620f87de59bae06d668d | C++ | jenseh/happah | /happah/kdtree/KDTree.cpp | UTF-8 | 1,287 | 3 | 3 | [
"BSD-3-Clause"
] | permissive | #include "KDTree.h"
KDTree::KDTree(TriangleMesh3D_ptr triangleMesh, hpuint maxTrianglesPerBox) {
vector<hpvec3>* verticesAndNormals = triangleMesh->getVerticesAndNormals();
vector<hpuint>* indices = triangleMesh->getIndices();
vector<Triangle>* result = new vector<Triangle>();
result->reserve(indices->size... | true |
2a06c29ac5f3f640136d71cc5b8f65c8d4fa88e4 | C++ | dadaxian/TankRobot | /HC_SR04.cpp | GB18030 | 932 | 2.703125 | 3 | [] | no_license | #pragma once
#include "arduino.h"
#include "HC_SR04.h"
#include"MyMath.h"
HC_SR04::HC_SR04(int trigPin, int echoPin) {
this->echoPin = echoPin;
this->trigPin = trigPin;
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}
int HC_SR04::getDistance()
{
//begin:
// һ10usĸȥTrigPin
digitalWrite(trigPin, LOW);
dela... | true |
0933bbc95a20984cbcd69ddff5caf3965c8ff1d6 | C++ | Sealatron/asm-curses | /src/include/asm-curses.h | UTF-8 | 2,110 | 2.890625 | 3 | [] | no_license | #ifndef NCURSES_CONTROLLER_H
#define NCURSES_CONTROLLER_H
#include <curses.h>
#include <iostream>
#include <memory>
#include <sstream>
#include <memory>
namespace nc{
enum BorderType{
E_NO_BORDER = 0x0,
//Edge Masks
E_SINGLE_BORDER = 0x1,
E_DOUBLE_BORDER = 0x2,
//Corner Ma... | true |
f89c3d4bd772750efbdabf8f7d571c6eb7fc6acb | C++ | jacobwpeng/alpha | /alpha/TcpConnection.h | UTF-8 | 3,252 | 2.59375 | 3 | [] | no_license | /*
* =============================================================================
*
* Filename: TcpConnection.h
* Created: 04/05/15 11:45:41
* Author: Peng Wang
* Email: pw2191195@gmail.com
* Description:
*
* ================================================================... | true |
a613506bf036b323c77bff73c50721995212d034 | C++ | godotengine/godot | /thirdparty/astcenc/astcenc_vecmathlib_neon_4.h | UTF-8 | 24,571 | 2.546875 | 3 | [
"MIT",
"OFL-1.1",
"JSON",
"LicenseRef-scancode-nvidia-2002",
"BSD-3-Clause",
"Zlib",
"MPL-2.0",
"CC0-1.0",
"BSL-1.0",
"Libpng",
"Apache-2.0",
"LicenseRef-scancode-public-domain",
"Unlicense",
"LicenseRef-scancode-free-unknown",
"CC-BY-4.0",
"Bison-exception-2.2",
"LicenseRef-scancode... | permissive | // SPDX-License-Identifier: Apache-2.0
// ----------------------------------------------------------------------------
// Copyright 2019-2022 Arm Limited
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy
// of ... | true |
74ce01db8096768f4b53229e9f94471e23b63241 | C++ | ar43/NES_Emulator | /src/machine/user_interface/textbox.cpp | UTF-8 | 3,152 | 2.765625 | 3 | [] | no_license | #include "textbox.h"
#include "text.h"
Textbox::Textbox(SDL_Renderer* renderer, int x, int y, int w, std::string text)
{
this->renderer = renderer;
SetActive(true);
SetColor(0xff, 0xff, 0xff);
SetRect(x, y, w, 18);
this->text = text;
text_obj = new Text(renderer, x+2, y+2, text,Textbox::text_size);
text_obj->re... | true |
f279e5628905fd436de66a212ece4399e0fc60c5 | C++ | hig-dev/audiovisualizer | /AudioVisualizer/SpectrumData.cpp | UTF-8 | 12,299 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "pch.h"
#include "SpectrumData.h"
#include "ScalarData.h"
#include "AudioMath.h"
#include "VectorData.h"
namespace winrt::AudioVisualizer::implementation
{
struct VectorDataIterator : implements<VectorDataIterator, Windows::Foundation::Collections::IIterator<AudioVisualizer::VectorData>>
{
size_t _curren... | true |
5fd1b7228237c940bccc24f74b4c9f8e95f20150 | C++ | yang-yiming-cool/DHT | /src/message_controller.cpp | UTF-8 | 2,862 | 2.65625 | 3 | [] | no_license | #include "../include/libheaders.h"
#include "../include/message_controller.h"
#include <iostream>
#include <string.h>
message_controller::message_controller(short _port, const char *_ip)
{
socket_fd = socket(AF_INET, SOCK_STREAM, 0);
if (socket_fd < 0)
{
std::cout << "创建套接字失败" << std::endl;
... | true |
7fe2a48c281aa1f550e9db685ef3041b54e4b408 | C++ | longranger2/C- | /26进制数.cpp | UTF-8 | 670 | 2.75 | 3 | [] | no_license | #include<stdio.h>
#include<string.h>
int main()
{
int n,i,j;
scanf("%d",&n);
char a[150][150]={0};
int b[150]={0};
for(i=0;i<n;i++)
{
scanf("%s",a[i]);
b[i]=strlen(a[i]);
}
int t;
for(i=0;i<n-1;i++)
{
for(j=i+1;j<n;j++)
{
if(b[i]>b[j])
{
t=b[i];
b[i]=b[j];
b[j]=... | true |
69d32b3fa2daeb6988009e71d6ba3d4d750648f5 | C++ | nasa/DdsJs | /DdsJs/DataWriterWrap.hh | UTF-8 | 29,852 | 2.578125 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference",
"BSD-3-Clause"
] | permissive | /**
* \file DataWriterWrap.hh
* \brief Contains the definition of the \c DataWriterWrap class.
* \date 2014-10-15
* \author Rolando J. Nieves
*/
#ifndef DATAWRITERWRAP_HH_
#define DATAWRITERWRAP_HH_
#include <cstdlib>
#include <sstream>
#include <uv.h>
#include <node.h>
#include <node_object_wrap.h>
#include <Dd... | true |
52de7124dbb142d0cd2d8dbc8fa9e01bd059d3cf | C++ | NHERI-SimCenter/smelt | /test/filter_func_tests.cc | UTF-8 | 6,893 | 2.640625 | 3 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | permissive | #include <vector>
#include <catch2/catch.hpp>
#include "function_dispatcher.h"
TEST_CASE("Test filter functions", "[FilterFuncs][Helpers]") {
SECTION("Test highpass Butterworth filter") {
int filter_order = 13;
double cutoff_freq = 250.0 / 500.0;
// Should throw error for order less than 1 and greater ... | true |
fd5d65b04abc84c01a5955c07de93bf6122d3554 | C++ | Akshatadeo04/CMPE180A-Data-Structure-and-Algorithms-in-C- | /hashTable.cpp | UTF-8 | 1,073 | 3.84375 | 4 | [] | no_license | #include <iostream>
#include <list>
using namespace std;
class Hash{
int bucket;
list<int> *table;
public:
Hash(int b){
bucket = b;
table = new list<int> [bucket];
}
void inserting(int key){
int index = key%bucket;
table[index].push_back(key);
}
... | true |
cda12d593a7d012d26c76dc70e6b53dfe22fa4ce | C++ | Dibbo-56/cpp-programming | /Teach_Yourself_C++/chapter 6/6.7_1.cpp | UTF-8 | 1,131 | 3.40625 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
class strtype{
char *p;
int len;
public:
strtype(char *s){
int l;
l = strlen(s)+1;
p = new char [l];
if(!p){
cout<< "Alloacation error" << endl;
exit(1);... | true |
14d3ab0161a32ef8d98ac911f244af695d69c0d1 | C++ | GitImpulseIt/KazEngine | /Maths/Sources/Matrix/Matrix.hpp | ISO-8859-2 | 20,559 | 3.203125 | 3 | [] | no_license | #pragma once
#define VECTOR_N 4
#include "../Vector/Vector.hpp"
#define VECTOR_N 3
#include "../Vector/Vector.hpp"
#include <array>
#include <cmath>
#define IDENTITY_MATRIX {1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1}
#define ZERO_MATRIX {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}
namespace Maths
{
class Matrix4x4
{
pr... | true |
10ff834a277ab71248b0a52aad60aef35d8ed8ec | C++ | evertonmj/cpp_activities | /comet.cpp | UTF-8 | 998 | 3.453125 | 3 | [] | no_license | //comet.cpp
/* Problem Description:
Halley comet is a comet of short period of the solar system, completing a lap around the sun every 76 years;
on the last occasion he became visible from Earth in 1986, several space agencies have sent probes to collect samples of its tail and thus confirm theories about their chemi... | true |
47cf2e1fadb3250d61e3f974136a0fc5e25eb470 | C++ | bowei437/Intro-to-C-ECE-1574 | /Lab3/resistors.cpp | UTF-8 | 1,159 | 2.53125 | 3 | [] | no_license | #include "resistors.h"
using namespace std;
void computeResistance( istream& in, ostream& out )
{
double resistor; // this is a double float for the resistor
double resistor2;
double resistor3;
//int TotalSet=3;
int initial=0;
int count = 0;
double answer;
double answer2;
double answer3;
//cout << "Pl... | true |
b9597b95b3d58507e977fd27eaa39bec1128b990 | C++ | sheigl/cpp-httpclient | /SimpleClient/httprequest.cpp | UTF-8 | 963 | 2.625 | 3 | [] | no_license | #define _CRT_SECURE_NO_WARNINGS
#ifndef REQ_H
#define REQ_H
#include "httprequest.h"
#endif
#ifndef STD
#define STD
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
HttpRequest::HttpRequest(char *method, char *url) {
printf("Creating HttpRequest()\r\n");
int size = sizeof(char) * 256;
this->... | true |
cbfa8dfdf13929353ad83fc76479802aa6ff8347 | C++ | cristo512/SFML_2.3 | /Player.h | UTF-8 | 1,741 | 2.578125 | 3 | [] | no_license | #pragma once
#include <SFML/Graphics.hpp>
#include "Game.h"
#include "PlayerSettings.h"
#include "Obstacle.h"
#include <iostream>
#include <vector>
class Player
{
public:
Player(PlayerSettings settings);
~Player(void);
void checkEvents(std::vector<Obstacle> obstacles);
void draw();
void setMoveKeys(sf::Keyboard::... | true |
9d15ac21dbaca30d73ca989b13434f4c54cdbf48 | C++ | murrdock/Leetcode_Solutions | /misc/856.cpp | UTF-8 | 556 | 3.125 | 3 | [] | no_license | class Solution {
public:
int scoreOfParentheses(string S) {
vector<string> bal;
int l = 0, pos = 0;
for(int i = 0; i < S.length(); i++) {
if(S[i] == '(') l++;
else l--;
if(l == 0) {
bal.push_back(S.substr(pos, i-pos+1));
pos... | true |
88114ad20fb04f01aedf7466eb5deaa7b49069e4 | C++ | minhtri1396/MyPlan | /Source/MyPlan/CText.cpp | UTF-8 | 3,084 | 3 | 3 | [] | no_license | #include "stdafx.h"
#include "CText.h"
#include <math.h>
//Chuyển chuỗi dãy số thành wchar
//Ex: _strCode = 65|66|67 => output: ABC
WCHAR* CText::DencyptToWchar(CHAR *_strCode)
{
WCHAR *lpwStrResult = NULL;
CHAR lpStrNum[11];
__int32 lenStr = strlen(_strCode);
__int32 lenWStr = lenStr;
if (lenWSt... | true |
b7f48556ec854f7d690b35fe9eb21a9b82babd39 | C++ | lambdald/Leetcode | /332. Reconstruct Itinerary/源.cpp | UTF-8 | 1,228 | 3.53125 | 4 | [] | no_license | /*
* Given a list of airline tickets represented by pairs of departure and arrival airports [from, to],
* reconstruct the itinerary in order.
* All of the tickets belong to a man who departs from JFK. Thus, the itinerary must begin with JFK.
*/
#include<vector>
#include<unordered_map>
#include<set>
#include<stack>
usi... | true |
26a8cd42e2d974bcea94d772342df516b12b8893 | C++ | Jbok/Baekjoon_Online_Judge | /1500/1525.cpp | UTF-8 | 4,129 | 3.5625 | 4 | [] | no_license | #include <iostream>
#include <deque>
//#include <vector>
#include <set>
#include <algorithm>
using namespace std;
typedef struct node
{
int x;
int cnt;
}Node;
int ccount = 0;
int main()
{
int str[9];
// 입력 받은 숫자 순서를 배열로 저장
for (int i = 0; i < 9; i++)
{
cin >> str[i];
}
// 입... | true |
db47100c5224abf24c639c34c2e8a196e4c347b5 | C++ | alexhilton/miscellaneous | /cc-work/basics/oop-in-cpp/chap03/database.cc | UTF-8 | 5,345 | 3.75 | 4 | [
"Apache-2.0"
] | permissive | /*
* database.cc
*
* implement a database class which manipulates a table of Employee
* records. It can create database, add and remove records, display
* table and find information about one record.
* It is based on Employee class which maniputlates the information
* of an employee including name, boss, departm... | true |
e4e631a2ea3fe85dd3a1d4c1b9984c74e4cdcf79 | C++ | evolvedmicrobe/cc2r | /src/ConsensusCore2/matrix/ScaledMatrix.cpp | UTF-8 | 1,271 | 2.921875 | 3 | [] | no_license |
#include <algorithm>
#include <cmath>
#include <iomanip>
#include "ScaledMatrix.h"
namespace PacBio {
namespace Consensus {
ScaledMatrix::ScaledMatrix(int rows, int cols, Direction dir)
: SparseMatrix(rows, cols), logScalars_(cols, 0.0), dir_{dir}
{
}
ScaledMatrix::ScaledMatrix(const ScaledMatrix& other)
: ... | true |
51594aaf1f43b2858386782ec413b888e3b30576 | C++ | dias-wagner/tableau | /statman.cpp | UTF-8 | 3,521 | 3.015625 | 3 | [
"MIT"
] | permissive | // statman: generates the S_n family of theorems.
#include <cstdio>
#include <cstring>
#include <fstream>
#include <iostream>
#include <cstdlib>
using namespace std;
#include "formula.h"
//
// Usage: statman -from n0 -to n [-n]
//
// Generates all the formulae S_n0, S_(n0+1), ..., S_n
//
// -n: generates formulae ... | true |
aef79bfa72a054a995097f5b7a42125f33843329 | C++ | Spirit45/OOP_FS | /exfatClass.cpp | UTF-8 | 2,261 | 2.75 | 3 | [] | no_license | #include <iostream>
#include <windows.h>
#include <cmath>
#include "exfatClass.h"
typedef struct
{
BYTE Offset_OEM[3]; // Смещение до имени файловой системы
BYTE OEM_Name[8]; // Имя файловой системы
BYTE Offset_TotalSectors[61]; // Смещение до значения количества секторов в ФС
ULONGLONG ... | true |
ec7e5c8057f591641670c46e4861f8ff971a01b5 | C++ | drlongle/leetcode | /algorithms/problem_0729/other1.cpp | UTF-8 | 627 | 3.203125 | 3 | [] | no_license | class MyCalendar {
public:
struct interval {
interval(int f, int s):mF(f),mS(s) {}
int mF;
int mS;
bool operator<(const interval& obj) const
{
return this->mF < obj.mF;
}
};
set<interval> bookings;
MyCalendar() {
}
bool book(int star... | true |
b5ef2c47a2e636c921f0cc579b9815ca745885b8 | C++ | ParaLock/InitiumGameEngine | /SolidumEngine/Solidum/GraphicsRendering/SpatialAccelerationStructures/include/TypeOptimizedTree.h | UTF-8 | 2,112 | 3.171875 | 3 | [] | no_license | #pragma once
#include "../../../sysInclude.h"
template<typename T, typename E_TYPE>
class TypeOptimizedTree
{
private:
struct RootNode {
E_TYPE _type;
std::list<T> _childNodes;
};
std::list<RootNode> _rootLists;
public:
TypeOptimizedTree() {};
~TypeOptimizedTree() {};
void addNode(T node) {
E_TYPE type... | true |
6f8fac4d516611f18b8ce8462c4b300367ba4a1c | C++ | xmen1412/Pseudocode | /UFC_Project2.cpp | UTF-8 | 20,839 | 2.8125 | 3 | [
"Unlicense"
] | permissive | MAIN PROGRAM
procedure prcBurger
procedure prcFriedChicken
procedure prcFrenchFries
procedure prcIceCream
procedure prcDrink
procedure prcBurgerPackage
procedure prcFriedChickenPackage
numeric nGrandTotal
Begin
nGrandTotal = 0
numeric nCash, nChange
character cRepeat, cChoice
cRepeat = "Y"
while (cR... | true |
6c8eb8ff5a7b939704a5574919737162dd684143 | C++ | Group7-1project/Project | /Project/src/Calculator.cpp | UTF-8 | 2,886 | 3.28125 | 3 | [] | no_license |
#include "Calculator.h"
void Calculator::DisplayMenu(){
//This will display the menu of the calculator.
cout << "Welcome to the flopless calculator! To begin calculating, simply enter an equation.\n";
cout << "To retrieve last answer, type ans.\n";
cout << "Radicals can be input as rad_index(number)\n... | true |
6edd441e54419e0b9f9a96d63fed3462db91952e | C++ | errantti/ontheedge-editor | /Editor source/OtE/Edgewalker/Utilities.h | ISO-8859-1 | 6,755 | 2.78125 | 3 | [
"MIT"
] | permissive | // On the Edge Editor
//
// Copyright 2004-2021 Jukka Tykkylinen
//
// 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... | true |
d1d102f4374557fe3b636ce82d40a977506ccb6d | C++ | Q10Viking/ACM_ICPC | /Online_judge/HDU/hdoj_1890.cpp | UTF-8 | 6,015 | 2.59375 | 3 | [] | no_license | #include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 100015
#define inf 1<<29
#define LL long long
#define Key_value ch[ch[root][1]][0]
using namespace std;
int pre[N],ch[N][2],root,tot1; //分别表示父结点,键值,左右孩子(0为左孩子,1为右孩子),根结点,结点数量
int size[N]; //分别表示子树规模,内存池,内存池容量
i... | true |
e182e4c20c6a673b2952d8033bb7098466b6c617 | C++ | a0124453/collections | /InterviewQuestions/StacksAndQueues/test.cpp | UTF-8 | 889 | 3.578125 | 4 | [] | no_license | #include <cstdio>
#include <stack>
void towerOfHanoi(char src, char mid, char dest, int size) {
if (size <= 0) {
return;
} else if (size == 1) {
printf("Move %d from %c to %c\n", size, src, dest);
return;
} else {
towerOfHanoi(src, dest, mid, size - 1);
printf("Move ... | true |
de745f5a738d635b3eb6c1ca2ed5bb76613efd57 | C++ | letmejustputthishere/ABC | /src/ast/Block.cpp | UTF-8 | 2,931 | 2.953125 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | #include <iostream>
#include <exception>
#include "ast_opt/ast/AbstractNode.h"
#include "ast_opt/ast/Block.h"
#include "ast_opt/ast/VarDecl.h"
json Block::toJson() const {
std::vector<AbstractStatement *> stmts;
stmts.reserve(countChildrenNonNull());
for (auto c : getChildrenNonNull()) {
stmts.push_back(dyna... | true |
e87fd09deb04f5893f00fbfce7c304c8dbdc20c4 | C++ | dayeondev/AlgoStudy | /Greedy/1049_기타줄.cpp | UTF-8 | 765 | 2.609375 | 3 | [] | no_license | #include <bits/stdc++.h>
#include <algorithm>
using namespace std;
int n, m;
vector<int> bundle, piece;
int main(void){
cin >> n >> m;
int tmp1, tmp2;
for(int i = 0; i < m; i++){
cin >> tmp1 >> tmp2;
bundle.push_back(tmp1);
piece.push_back(tmp2);
}
sort(bundle.begin(), b... | true |
4927ede72063b3439ea9cd8e5de669bb1208dcb2 | C++ | jsj2008/alchemy3d2 | /Engine/trunk/Engine/Math/AlchemyVector2.h | UTF-8 | 1,830 | 2.671875 | 3 | [] | no_license | #pragma once
/*
* AlchemyVector2.h
* IOS
*
* Created by lin fuqing on 12-5-30.
* Copyright 2012 AstepGame. All rights reserved.
*
*/
#include "AlchemyFloat2.h"
#include "AlchemyFloat4.h"
#include "AlchemyMatrix3x3.h"
#include <math.h>
namespace alchemy
{
FLOAT2& Transform(FLOAT2& Output, const FLOAT4& Mat... | true |
bed3a45e3e398471d682fa990aa0e79f5e5224f2 | C++ | anmolgulati10/Algo | /Recursion/replace all pie.cpp | UTF-8 | 544 | 2.875 | 3 | [] | no_license | #include<iostream>
using namespace std;
string pi(string str)
{
if(str.length()==0)
{
return "";
}
char ch=str[0];
string ros=str.substr(1);
string result=pi(ros);
if(ch=='p' and result[0]=='i')
{
string p="3.14";
return p+result.substr(1);
}
else
{... | true |
f189ab42ca33b24617cf828504ca5fedd5b70292 | C++ | albertorobles2000/Ejercicios-sobre-la-STL-conjuntos-y-listas | /src/ejercicio18.cpp | UTF-8 | 729 | 3.328125 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
template<typename T>
void intecalar(vector<T> &v, vector<pair<int, T>> pos){
int contador = 0;
for(typename vector<pair<int, T>>::iterator it = pos.begin(); it != pos.end(); ++it){
int posicion= it->first+contador;
if(posicion>(int)v.size(... | true |
03be6a4c49bd4e129a2c21d4d3b009b2c7611bb7 | C++ | jluzh-bcb/open_show | /2017/train-通讯录系统/work/林源/person.cpp | UTF-8 | 593 | 3.265625 | 3 | [] | no_license | #include "person.h"
ostream &operator <<(stream& out,person& Person)
{
out <<"id:"<<Person.id<<endl<<"name:"<<Person.name<<endl<<"age:"<<Person.age<<endl<<"sex:"<<Person.sex<<endl<<"phone:"<<Person.phone<<endl;
return out;
}
person &operator=(person &Person)
{
this->name=Person.name;
this->id=Person.id;
this->age=... | true |
5d0a27e07cccded4bf90fe68da62f8b8260be54b | C++ | akshatx134/DSA | /LCM of 2 numbers/lcm_of_two_numbers.cpp | UTF-8 | 315 | 3.34375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
int main()
{
int a,b,lcm;
cout<<"Enter two numbers: ";
cin>>a>>b;
if (a>b)
{
lcm = a;
}
else
{
lcm = b;
}
while(1)
{
if (lcm%a==0 && lcm%b==0)
{
cout<<"LCM of "<<a<<" and "<<b<<" is: "<<lcm;
break;
}
lcm++;
}
return 0;
}
| true |
207d663029f0e1428288058fde11574e79d8f381 | C++ | alecnunn/bookresources | /GameDevelopment/Game Programming Gems 4/01 General Programming/12 My/Core/VectorMatrix.h | UTF-8 | 33,843 | 2.578125 | 3 | [] | no_license | //--------------------------------------------------------------------------------------------------------------------//
// VECTORS & MATRICES CLASSES //
// written by Frederic My ... | true |
2ac31620af7c5ece41a8c835341165cb17237740 | C++ | NEWBEE108/Cracking-the-Coding-Interview | /cpp_solutions/chapter_02_linked_lists/LinkedListNode.h | UTF-8 | 1,722 | 3.828125 | 4 | [
"BSD-2-Clause-Views"
] | permissive | //
// Created by Alex Hagiopol on 8/21/17.
//
#pragma once
#include <vector>
namespace chapter_02{
template <typename T>
class LinkedListNode{
private:
T _value;
LinkedListNode* _next;
public:
LinkedListNode(T value, LinkedListNode* next = nullptr) : _value(value), _next(next) {... | true |
53416cb61fd6299fb7bbd0364d420706814cf1df | C++ | NoSilentWonder/Seasons | /Source/Geometry/Box.cpp | UTF-8 | 8,511 | 2.84375 | 3 | [] | no_license | /*
Created Frank Luna (c) 2008 All Rights Reserved.
Additional functionality - Elinor Townsend 2011
*/
/*
Name Sky Sphere
Brief Definition of Box Class used for creating a box
*/
#include "Geometry/Box.hpp"
#include "Vertex/Vertex.hpp"
#define VERTICES_NO 24
#define FACES_NO 12
/*
Name Box::Box
Syntax... | true |
8fa384f6be72da5daee720b1f5be6e3a1c5dcf55 | C++ | Rahul365/Coding_Practice | /interview/FindTwoRepeatedNumbersInArray/solution.cpp | UTF-8 | 1,105 | 3.875 | 4 | [] | no_license | /**
* Problem : Given an array of k elements
* In this array all the elements are in range from 1 to n.
* All the number appears exactly once except two numbers.
* Find and print those two numbers.
*/
/**
* XOR property:
* To find the rightmost set bit position a number X :
* use the formula:
* X = X & ~(X-... | true |
7b8afabcd10702935948ccbda3647d922e356da6 | C++ | YoungsterEthan/Pokemon_clone | /Bulbasaur.cpp | UTF-8 | 763 | 3.046875 | 3 | [] | no_license | #include <iostream>
#include "Bulbasaur.h"
// #include "Pokemon.cpp"
using namespace std;
Bulbasaur::Bulbasaur()
{
hp = 45;
attack = 49;
defense = 49;
speed = 45;
}
int Bulbasaur::moveScreen()
{
cout << "1. Tackle" << endl;
cout << "2. Vine Whip" << endl;
cout << "3. Razor Leaf" << endl;... | true |
a37c2950d231255399ba7853b422a4bf00bfb5bf | C++ | AngryCarrot789/AtominaCraft | /AtominaCraft/Objects/PhysicalGameObject.cpp | UTF-8 | 1,404 | 2.5625 | 3 | [] | no_license | #include "PhysicalGameObject.h"
#include "../GameHeader.h"
PhysicalGameObject::PhysicalGameObject() {
Reset();
}
void PhysicalGameObject::Reset() {
GameObject::Reset();
SetVelocity(Axis::Zero());
SetScale(1, 1, 1);
gravity.Set(0.0f, GH_GRAVITY, 0.0f);
mass = 1;
bounce = 0.0f;
friction = ... | true |
4da0de1dc6c116954eba1d2a1a404bc6ac425049 | C++ | AmandineMa/ActionRecognition | /action_recognition/include/action_recognition/SensorFeatureVectorExtended.hpp | UTF-8 | 2,735 | 3.03125 | 3 | [] | no_license | #ifndef SENSORFEATUREVECTOREXTENDED_HPP
#define SENSORFEATUREVECTOREXTENDED_HPP
/**
* \file SensorFeatureVectorExtended.hpp
* \brief SensorFeatureVectorExtended class
* \author Amandine M.
*/
#include <vector>
#include <fstream>
#include <tf2/LinearMath/Quaternion.h>
#include "action_recognition/Vector3D.hpp"
#i... | true |
e90b0b2eed5de82bc490da06a6c9374341a74d33 | C++ | physhouse/HamiltonSpace | /RCBTree.h | UTF-8 | 1,315 | 2.640625 | 3 | [] | no_license | #ifndef _RCBTREE_H_
#define _RCBTREE_H_
#include "Atom.h"
#include "Type.h"
#include <mpi.h>
namespace Hamilton_Space {
class RCBTree
{
public:
RCBTree(std::shared_ptr<class Atom>);
~RCBTree();
void buildDistributedRCBTree();
int findCutDimension(HS_float*, HS_float*);
void swap(int, int);
... | true |
3bb8a62585cc27183c39e5a54fc9226b6403b95c | C++ | HEX4114/ProjetLG | /Symbole/Phrase/Instruction/Lire.h | UTF-8 | 383 | 2.5625 | 3 | [] | no_license | #ifndef LIRE_H
#define LIRE_H
#include "Instruction.h"
#include "../../Expression/Variable.h"
class Lire :
public Instruction
{
public:
Lire();
Lire(Variable* v);
~Lire();
void setVariableAChanger(Variable* variable) { variableAChanger = variable; };
void afficher();
void executer();
void analyseStatique()... | true |
3ffedaab761231147ad39ffd34c0228c76b7438c | C++ | uglyDwarf/linuxtrack | /src/mickey/mouse_linux.cpp | UTF-8 | 1,156 | 2.859375 | 3 | [
"MIT"
] | permissive | #include "mouse.h"
#include "uinput_ifc.h"
#include <QMutex>
#include <QMessageBox>
struct mouseLocalData{
mouseLocalData(): fd(-1){};
int fd;
QMutex mutex;
};
mouseClass::mouseClass(){
data = new mouseLocalData();
}
mouseClass::~mouseClass(){
close_uinput(data->fd);
data->fd = -1;
delete data;
}
b... | true |
f13682d8e4161c8d58fe7e2617dfd18f7edc6f62 | C++ | smasson99/Session-03 | /Algo II/Semaine 06/Exemples/Exemple Iterator/TableauWrapper.h | UTF-8 | 1,285 | 3.125 | 3 | [] | no_license | //
// TableauWrapper.h
// exo_iterator
//
// Created by François Bélanger on 17-09-26.
// Copyright © 2017 François Bélanger. All rights reserved.
//
#ifndef TableauWrapper_h
#define TableauWrapper_h
class Tableau
{
public:
using size_type = unsigned long;
class iterator;
Tableau() : size(0)
... | true |
457790cad6c3e1d0200e6fa78f62050f1963195c | C++ | JimmyLefevre/genesis | /code/static_array.cpp | UTF-8 | 2,219 | 2.953125 | 3 | [] | no_license |
// Define these before #including the file:
#ifndef ITEM_TYPE
#define ITEM_TYPE u32
#endif
#ifndef ITEM_MAX_COUNT
#define ITEM_MAX_COUNT 256
#endif
#ifndef COUNT_TYPE
#define COUNT_TYPE usize
#endif
// Current default type name is simply [STRUCT]_[ITEM_TYPE], which
// is not robust to generating multiple [STRUCT]s ... | true |
b98ee31cb2c2969b3838b44886d27ef7fc7ec117 | C++ | baoqger/system-monitor-cpp | /function-code/constructor/Point.h | UTF-8 | 192 | 2.859375 | 3 | [
"MIT"
] | permissive | class Point {
public:
Point(int x, int y, int r);
int getX();
int getY();
int getRadius();
private:
int x;
int y;
int radius;
}; | true |
8b61d00194ba2f35e008e261c0962951159a7e3a | C++ | HireIsaac/Work-Samples | /C++/VS/Simple Stack Implementation/simpleStack/simpleStack.cpp | UTF-8 | 834 | 3.5 | 4 | [] | no_license | // simpleStack.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <cstdlib>
#include<iostream>
#include "StackusingList.h"
#include "node.h"
using namespace std;
int main(int argc, char** argv) {
StackusingList<int>s;
cout << "\n\nPushing to stack:\n" << endl;
s.... | true |
af93cdd3bd8d0d6168e91a022383d7346d089712 | C++ | cerber-os/PROI | /Project3/worker.cpp | UTF-8 | 1,075 | 2.96875 | 3 | [] | no_license | /*
* File: worker.cpp
* Author: Paweł Wieczorek
* Date: 08 maj 2019
* Description: Implementation of class representing workers of swimming pool
*/
#include "worker.h"
int Worker::highestUid = 0;
int Rescuer::highestUid = 0;
int Instructor::highestUid = 0;
std::string Worker::getName() {
return name;
}
boo... | true |