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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
f9bb9281d2c7099c1c2dfa2af1ac9742fae83b10 | C++ | rskryptik61636/DirectXLearning | /include/SimpleQuad.h | UTF-8 | 979 | 2.671875 | 3 | [] | no_license | // header file for the SimpleQuad class
#ifndef SIMPLE_QUAD_H
#define SIMPLE_QUAD_H
#include "ObjectV2.h"
class SimpleQuad : public ObjectV2<SimpleVertex>
{
public:
// param ctor 1, takes in the 4 quad points in CW order as well as the color of each point
SimpleQuad(const std::vector<SimpleVertex> pts);
// defin... | true |
91595e63023d73541caa91dd75beed509c1ea62b | C++ | tz924/cs38 | /Homework6/ps6_p1_test.cpp | UTF-8 | 2,354 | 3.671875 | 4 | [] | no_license | //
// Assignment name: Problem Set 6
// File name: ps6_p1_test.cpp
// Author: Jing Zhang
//
#include "ps6.h"
using namespace std;
void part1Test()
{
int dollar12 = 12;
int cents3 = 3;
int cents30 = 30;
int cents300 = 300;
double goodCash = 12.3;
double badCash = 1.234;
double crazyCash = 123.456;
// ... | true |
d8d3beca43bc3091ebf55403360ab574d348c8af | C++ | wuxingyu1983/Algorithm | /LightOJ/PalindromicNumbers/main.cc | UTF-8 | 3,090 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | #include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <stdlib.h>
using namespace std;
#define DEBUG 0
// 最大位数 18 位
const int max_bits = 18;
// bit 位 回文数 的个数
unsigned long long cnt[max_bit... | true |
a7f130411598d1a8618e579bf01dede875aa5b48 | C++ | Jiltseb/Leetcode-Solutions | /solutions/1275.find-winner-on-a-tic-tac-toe-game.325698245.ac.cpp | UTF-8 | 1,255 | 3.03125 | 3 | [
"MIT"
] | permissive | class Solution {
public:
string tictactoe(vector<vector<int>> &moves) {
vector<string> game(3, string(3, ' '));
char c;
for (int i = 0; i < moves.size(); i++) {
move(game, moves, i);
// c = check(game);
// if(c == 'A')return "A";
// else if(c == 'B')return "B";
}
c = check(... | true |
7d0df57bd34bdf03e30c6b4ca9a53f6b7f79609b | C++ | stillwater-sc/universal | /static/posit/math/hyperbolic.cpp | UTF-8 | 13,284 | 2.75 | 3 | [
"MIT",
"LicenseRef-scancode-free-unknown",
"LGPL-3.0-only",
"LicenseRef-scancode-public-domain"
] | permissive | // function_hyperbolic.cpp: test suite runner for hyperbolic functions (sinh/cosh/tanh/atanh/acosh/asinh)
//
// Copyright (C) 2017-2022 Stillwater Supercomputing, Inc.
//
// This file is part of the universal numbers project, which is released under an MIT Open Source license.
#include <universal/utility/directives.hpp... | true |
2c5123ecde5f26c8cf7b217f12569a2e0f4076f2 | C++ | mrngunuong1/Project_KTMT_HN_1 | /KTMT_HN_Project1/QFloat.cpp | UTF-8 | 6,471 | 2.921875 | 3 | [] | no_license | #include"QFloat.h"
#include"QInt.h"
QFloat::QFloat()
{
data[0] = data[1] = data[2] = data[3] = 0;
}
QFloat::QFloat(string s)
{
data[0] = data[1] = data[2] = data[3] = 0;
string pre_comma;
string post_comma;
int l = s.length();
int i = 0;
if (s[0] == '-')
{
SetBit(0, 1);
i++;
}
for (i; i < l; i++)
{
i... | true |
0080aa380fda3150eb0244ccb8fb05db90693a76 | C++ | Creinman/TestProjectCpp | /main.cpp | UTF-8 | 1,656 | 2.78125 | 3 | [] | no_license |
*//*0A (15., 18., 15), B (33, -87, -99), C (69, 27, -151), D (10.9, 55, -38). */
#include <stdio.h>
#include "myvector3d.h"
int main()
{
MyVector3D A (15,18,15), B (33,-87,-99), C (69,27,-151), D (10.9,55,-38);
printf("\n\n\tProgram started\n");
MyVector3D AB=B-A,
AC=C-A,
... | true |
92707634bfb20dd7c1bf9c7d7550b6cbbee46adf | C++ | lyyhui1314/51nod | /done-2529-移动长度.cpp | UTF-8 | 692 | 3.078125 | 3 | [] | no_license | // 有n个点,第i号点在一维数轴的i坐标位置。
// 你现在在1号点,你需要移动k次,每次可以移动到1−n的任何一个点,不能够不动,最终移动的总长度为S
// 问这样的方案是否存在。
// 输入
// 第一行三个数n,k,s(2<=n<=10^9,1<=k<=2*10^5,1<=s<=10^18)。
// 输出
// 如果存在方案,输出YES,否则输出NO。
// 输入样例
// 10 2 15
// 输出样例
// YES
#include <stdio.h>
int main(int argc, char const *argv[])
{
double n, k, s;
scanf("%lf%lf%lf"... | true |
f2238f6a74f2a2d5aef89f108a51f8cc0111dc4a | C++ | PVIII/stream | /libstream/transform.hpp | UTF-8 | 5,307 | 2.640625 | 3 | [
"MIT"
] | permissive | /*!
* @author Patrick Wang-Freninger <github@freninger.at>
* @copyright MIT
* @date 2019
* @link github.com/PVIII/stream
*/
#ifndef LIBSTREAM_TRANSFORM_HPP_
#define LIBSTREAM_TRANSFORM_HPP_
#include <liboutput_view/transform.hpp>
#include <libstream/callback.hpp>
#include <libstream/concepts/pipe.hp... | true |
6c9e3c267450396f7d5c5991400bb1a095b45c62 | C++ | jmkim/algorithm_and_practice-pknu-2016 | /excercise15/include/adjacency_matrix.hpp | UTF-8 | 5,395 | 3.6875 | 4 | [
"MIT"
] | permissive | /**
*
* Adjacency Matrix
*
* Weighted graph,
* implementation with adjacency matrix
*
* https://github.com/kdzlvaids/algorithm_and_practice-pknu-2016
*
*/
#ifndef ALGORITHM_ADJACENCYMATRIX_HPP_
#define ALGORITHM_ADJACENCYMATRIX_HPP_ 1
/** Includes */
#include <cstddef> /** size_t definition */
#incl... | true |
5d522744bb368ca1e74c34e54045e16ec3cf7b93 | C++ | viko3019/LeetCode | /Valid-Parentheses.cpp | UTF-8 | 818 | 3.296875 | 3 | [] | no_license | class Solution {
public:
bool isValid(string s) {
int len = s.length();
stack<int>stc;
for(int i = 0; i< len; i++){
if(s[i] == '(' || s[i] == '{' || s[i] == '['){
stc.push(s[i]);
}
else if(stc.size() == 0){
return false;
... | true |
a2dfa37ffcedea0f943dcb7cc48a1bee7a3ba922 | C++ | sammyc304/Word-Search-Project | /main.cpp | UTF-8 | 5,399 | 3.796875 | 4 | [] | no_license | //
// main.cpp
// EECE2560 3b
//
//
#include <iostream>
#include "dictionary.hpp"
#include "grid.hpp"
/*Directional_get locates all of the characters in a single direction with a starting place on the grid (a,b) and stores them in a character vector. This function takes an operation (1-8, for each directi... | true |
3fc74e080bf63b0b899e3f9d3a48b3d0caae2ba3 | C++ | danilaml/DZ | /144/HW14_4/HashTable/myhashtable.cpp | UTF-8 | 2,529 | 3.046875 | 3 | [] | no_license | #include "myhashtable.h"
#include <iostream>
MyHashTable::MyHashTable() : hsf(new HashFunction(1013)), ar(new QStringList[1]), size(1)
{
}
MyHashTable::MyHashTable(int initSize) : hsf(new HashFunction(1013)), ar(new QStringList[initSize]), size(initSize)
{
}
MyHashTable::MyHashTable(int initSize, HashFunction *inith... | true |
0732cc30c068702f76aed9f16d067a88ee730ed6 | C++ | DoubleSinoptic/GameEngine | /GameEngine/Core/StringFormat.cpp | UTF-8 | 2,361 | 2.75 | 3 | [] | no_license | #include "StringFormat.h"
namespace ge
{
template<typename T>
void staticPut(ExceptPutProvider* provider, T value, const char* qual)
{
char temp[60];
temp[0] = '\0';
int result = snprintf(temp, 60, qual, value);
geAssert(result >= 0);
const char* p = temp;
for (; *p != '\0'; p++)
provider->put(char... | true |
3b6ca1370182fa551347828e1ec6647dcc06b0ba | C++ | AkshayKumar22A/Data-Structures-Algorithms | /Array/Q3_level_1.cpp | UTF-8 | 850 | 4.25 | 4 | [] | no_license | /* Given an array (or string), the task is to reverse the array/string. */
#include<iostream>
#include<cstdlib>
using namespace std;
void revarr(int arr[], int len)
{
int i=0,j=len-1,temp=0;
while(i<j)
{
temp = arr[i];
arr[i] = arr[j];
arr[j] = temp... | true |
7f2d33012814f9c37ac20c1d6aaec3a774e6cd32 | C++ | Thairam/URI | /Códigos - URI/2017/Ida à Feira/URI 1281.cpp | UTF-8 | 558 | 2.53125 | 3 | [
"Apache-2.0"
] | permissive | #include <bits/stdc++.h>
#include <map>
#include <string>
using namespace std;
int main(){
map<string, double> mapa;
map<string, double> mapa1;
int n;
scanf("%d", &n);
while(n--){
int m;
string s;
double valor;
scanf("%d", &m);
for(int i = 0; i < m; i++){
cin >> s;
scanf("%lf", &valor);
mapa... | true |
1ee5f19beb1e9737e3654653d9e3aa937639d5b1 | C++ | green-fox-academy/Bola00 | /week-03/day-04/08 Strings again/main.cpp | UTF-8 | 760 | 3.734375 | 4 | [] | no_license | #include <iostream>
// Given a string, compute recursively a new string where all the 'x' chars have been removed..
std::string stringManipulator (std::string a){
if (a.size() == 1){// if the last letter is 'x', delete it
if (a[0] == 'x'){
a.clear();
}
return a;
}else {
st... | true |
cd5bb781dcc6d43bf83f6e8d74baaf37e0d03cbb | C++ | VincentChen0110/Data-Structure | /DS0/DS0/main.cpp | UTF-8 | 857 | 3.046875 | 3 | [] | no_license | //
// main.cpp
// DS0
//
// Created by Vincent on 3/12/20.
// Copyright © 2020 Vincent. All rights reserved.
//
// Sample code to perform I/O:
#include<iostream>
using namespace std;
int max(int a, int b) { return (a > b)? a : b; }
int knapSack(int w, int wt[], int cost[], int n)
{
if (n == 0 |... | true |
67cf5d76e85d69d80ffdf531e4dd5a419f868661 | C++ | Banjarini/Arduino | /weather_logger/weather_logger.ino | UTF-8 | 2,397 | 2.90625 | 3 | [] | no_license | /*
SD card datalogger
This example shows how to log data from three analog sensors
to an SD card using the SD library.
The circuit:
* analog sensors on analog ins 0, 1, and 2
* SD card attached to SPI bus as follows:
** MOSI - pin 11
** MISO - pin 12
** CLK - pin 13
** CS - pin 4 (for MKRZero SD: SDCARD_SS... | true |
ecff4fab90b84e574f341111ffa469adfc64fcb6 | C++ | fauxdiscours/School | /Lab 3 Prime Numbers STL/Prime1:2/Prime1.cpp | UTF-8 | 755 | 4.15625 | 4 | [] | no_license | //Christian Eaves
//Prime1, checks to see if user input number is prime.
#include<iostream>
#include<cmath>
using namespace std;
//Checks if number is prime by dividing the number by up to its square root.
bool isprime(int number) {
int sroot = sqrt(number);
//If number < 2 it is not prime because 2 is the smallest... | true |
8f645c0bf79cb7b38a458cef1eb81ec9a2ce9f65 | C++ | kirkbackus/old-borland-projects | /Bomb/Headers/upgrade.h | UTF-8 | 1,594 | 2.578125 | 3 | [] | no_license | class Upgrade {
public:
int type;
Blackbox::Polygon* collide;
float x,y;
float rotation;
bool visible;
int reload;
Upgrade(float xpos, float ypos, int t1, Blackbox::Polygon* collision_mask);
void Draw();
};
Upgrade::Upgrade(float xpos, float ypos, int t1, Blackbox::Polygon* co... | true |
f16a77f4bbf2569f9da2f0f07ac67c4a2534dd28 | C++ | atabakhafeez/SadsHomeworks | /hw6/Cipher/Cipher/main.cpp | UTF-8 | 562 | 2.671875 | 3 | [] | no_license | //
// main.cpp
// Cipher
//
// Created by Atabak Hafeez on 04.05.17.
// Copyright © 2017 Atabak Hafeez. All rights reserved.
//
#include <iostream>
using namespace std;
class EncryptionScheme {
protected:
string IV;
public:
virtual string encrypt(string input) = 0;
virtual string decrypt(string input... | true |
3383deb89a1769d477b29ce5907313b836f7223a | C++ | takumus/trump | /src/display/texture.cpp | SHIFT_JIS | 3,883 | 2.796875 | 3 | [] | no_license | #include "texture.h"
#include "sprite.h"
#include <stdio.h>
#include <string>
#include <map>
#include <vector>
#include <time.h>
//#include "textfield.h"
using namespace std;
///--------------------------------------------------------//
//eNX`f[^NX
//--------------------------------------------------------//
void Textu... | true |
265014e980fa7f399a26dd34e689625bb23a7c2c | C++ | mahbubhimel/Codeforces | /208A/main.cpp | UTF-8 | 734 | 3.25 | 3 | [] | no_license | #include <iostream>
#include <string>
using namespace std;
char array[205];
int main()
{
string song;
cin >> song;
int length = song.length();
for(int i = 0 ; i < length ; i++){
array[i] = song.at(i);
}
array[length+1] = '\0';
for(int i = 0 ; i < length ; i++){
if(array[i]... | true |
38c7af992a684a5eab1d57c2bb2780a4ad4dbed9 | C++ | Robbiekorneta11/NIU-School-Work | /CSCI340/Binary-Tree/binarytreeDriver.cc | UTF-8 | 2,992 | 3.53125 | 4 | [] | no_license | /*
Robi Korneta
Z1816167
CSCI 340 - 1
I certify that this is my own work and where appropriate an extension
of the starter code provided for the assignment.
*/
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
using namespace std;
#include "binarytree.h"
#de... | true |
f41795ae2f9ea96c75472bcd7eaa43737e66ded9 | C++ | katahiromz/BoostWaveExample | /No4_MakeIncludeTree/MakeIncludeTree.hpp | UTF-8 | 1,783 | 2.53125 | 3 | [
"MIT"
] | permissive | #pragma once
#include <boost/wave.hpp>
#include <boost/wave/preprocessing_hooks.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/ref.hpp>
#include <stack>
// A hook class to output the tree
class MakeIncludeTreeHook
:
public boost::wave::context_policies::default_preprocessing_hooks
... | true |
c97e32275003f2156fc6cf4b400e48ab42b7428d | C++ | kamyu104/ACMFinalsSolutions | /finals2016/stringDK.cc | UTF-8 | 812 | 2.765625 | 3 | [] | no_license | #include <iostream>
#include <vector>
using namespace std;
int main() {
int N;
while (cin >> N) {
vector<int> A(N);
for (int i = 0; i < N; i++) cin >> A[i];
int tot = 0;
for (int i = 0; i < N; i++) tot += A[i];
int ret;
for (ret = 100; ret; ret--) {
vector<int> v = A;... | true |
ff0fe7929e47f4619e2e1c7bf04b16220df5f8b7 | C++ | mdjellison/Dots-and-Boxes | /Player.h | UTF-8 | 299 | 2.703125 | 3 | [] | no_license | #pragma once
#include <iostream>
class Player
{
public:
Player();
~Player();
int placeLine(const int &numColumns, const int &numRows, int &lineType);
void addPoint();
int giveScore();
private:
int score;
int findLineType(const int &rowInput, const int &columnInput);
};
| true |
abcdee5ba5c9ac38d340aae6cf0afc69038e46f3 | C++ | wowverywell/TriangleRayIntersection | /Контрольная работа №1/belong.cpp | UTF-8 | 952 | 2.796875 | 3 | [] | no_license | #include <iostream>
#include <cmath>
#include "structures.h"
double findSquare(Point A, Point B, Point P) {
Point AB, AP, vectMult;
double square;
AB = { B.coor_x - A.coor_x, B.coor_y - A.coor_y, B.coor_z - A.coor_z };
AP = { P.coor_x - A.coor_x, P.coor_y - A.coor_y, P.coor_z - A.coor_z };
vectMult = { A... | true |
f1f264b705bb721095aee0e82e1fde7d6b9cd255 | C++ | WhiZTiM/coliru | /Archive2/ec/a4700e759af6a2/main.cpp | UTF-8 | 1,001 | 3.203125 | 3 | [] | no_license | #include <map>
#include <functional>
namespace sf {
struct Keyboard {
enum Key {
Left, Right
};
};
struct Vector2f {
float x,y;
Vector2f(float x,float y) : x(x), y(y) { }
};
}
class InputMap
{
public:
template<typename Function>
void setHotkey(sf::Keyboard::Key hotk... | true |
22a7be1241705173f29d5cecc08eacc904d9da52 | C++ | XMaxPlatform/support-chain | /foundation/basetypes/include/shortcode.hpp | UTF-8 | 2,357 | 2.875 | 3 | [
"MIT"
] | permissive | /**
* @file
* @copyright defined in xmax/LICENSE
*/
#pragma once
#include <string>
#if WIN32
# if _MSC_VER < 1914
# define _CONST_EXPR_
# else
# define _CONST_EXPR_ constexpr
# endif
#else
# define _CONST_EXPR_ constexpr
#endif
namespace ShortCode {
typedef char sglyph;
typedef uint32_t ssymbol;
typedef uin... | true |
bc25278a8e21c9faba9a60ae36b9a9e94aea38e4 | C++ | SammyEnigma/C-11-Concurrency | /timed_mutex/timed_mutex.cpp | UTF-8 | 1,252 | 3.203125 | 3 | [] | no_license | // timed_mutex.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
#include <thread>
#include <mutex>
#include <chrono>
#include <ctime>
std::timed_mutex tmt;
void fireworks()
{
while (!tmt.try_lock_for(std::chrono::milliseconds(200)))
{
std::cout << "-";
}
s... | true |
522e38c320041d4ce9a964dd470ab2da5d0cc09c | C++ | guglielmino/s6-fresnel-firmware-mos | /src/hardware/devices/MCP39F511/uart/MCP39F511UARTProto.hpp | UTF-8 | 4,192 | 2.609375 | 3 | [] | no_license | #ifndef __MCP39F511PUARTPROTO_H
#define __MCP39F511PUARTPROTO_H
#include <vector>
#include <functional>
#include "IMCP39F511UARTProto.h"
#include "../commands/ICommandFrame.hpp"
#include "../../../io/IUART.h"
/**
* MCP39F511 UART protocol. Manage UART communication with MCP39F511 chip
*/
class MCP39F511UARTProto :... | true |
5a8bd6bc0e207c2dc60b905e948c908f8de229e9 | C++ | wkindling/SkinnedMesh-Animation | /2D/src/main.cpp | UTF-8 | 2,659 | 2.671875 | 3 | [] | no_license | #include "skinnedmesh.h"
Bone* root = new Bone(Vector2d(0,350),Vector2d(0,0));
Bone* bone1 = new Bone(root, 200, 0);
Bone* bone2 = new Bone(bone1, 200, 0);
Bone* bone3 = new Bone(bone2, 200, 0);
SkinnedMesh mesh(root);
double target_x = bone3->position.x(), target_y = bone3->position.y();
void changePoint(in... | true |
b849752442c9739bc4ed76297d7b1838ad9d2bcb | C++ | ja-ho/baekjoon_algorithm | /joon_assignment/2580(sudoku).cpp | UTF-8 | 1,332 | 2.859375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
using namespace std;
int map[10][10];
bool c_1[10][10];
bool c_2[10][10];
bool c_3[10][10];
bool check(int r, int c, int value)
{
if (c_1[r][value]) return false;
if (c_2[c][value]) return false;
if (c_3[(r / 3) * 3 + (c / 3)][value]) re... | true |
2a00da8afd7fac6f8444ec4ec3cff6fc1c522b1b | C++ | ckennelly/advent-of-code-2020 | /cpp/21/21b.cc | UTF-8 | 3,272 | 2.515625 | 3 | [
"Apache-2.0"
] | permissive | #include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <regex>
#include <set>
#include <string>
#include <vector>
#include "absl/container/flat_hash_map.h"
#include "absl/container/flat_hash_set.h"
#include "absl/strings/ascii.h"
#include "absl/strings/numbers.h"
#include "... | true |
c03855f107091880b51aa00af7c0101ded7f4a4f | C++ | momar95136/process_manager | /src/process.cpp | UTF-8 | 2,346 | 2.90625 | 3 | [
"MIT"
] | permissive | #include "process.h"
#include <sys/time.h>
#include <unistd.h>
#include <cctype>
#include <sstream>
#include <string>
#include <vector>
#include "linux_parser.h"
using std::string;
using std::to_string;
using std::vector;
using std::stof;
// DONE: Return this process's ID
int Process::Pid() { return pid; }
// DONE... | true |
763dde812affa07c5d9950f77ced6392f8be7473 | C++ | Rinkeeee96/FoxTrot_SA_Engine | /engineFoxtrot/Engine/Physics/PhysicsEngine.cpp | UTF-8 | 5,068 | 2.703125 | 3 | [] | no_license | #include "stdafx.h"
#include "PhysicsFacade.h"
#include "PhysicsEngine.h"
#include "Events\Action\ObjectStopEvent.h"
#include "Events\Action\ObjectMoveToEvent.h"
#include "Events/Key/KeyPressed.h"
#include "Events/Action/TogglePause.h"
/// @brief Constructor
/// @param _frameData
/// A reference to the frameData clas... | true |
1181d9f1b40baa48f4b4837c57682f6050254d4d | C++ | guille31794/AAED | /Practica 4/polinom/e_s_polinom.cpp | UTF-8 | 2,726 | 3.140625 | 3 | [] | no_license | #include <iostream>
#include "e_s_polinom.h"
//#include "polinom.h"
#include "polinomio.hpp"
int introducirGrado()
{
int grado = 0;
while(grado > gradoMax || grado < 1)
{
cout << "Introduzca el grado <= " << gradoMax << endl;
cin >> grado;
}
return grado;
}... | true |
63d8e3fa6ab3ef28718bcfc6e570d9c2199632a5 | C++ | naderabdalghani/paint-for-kids | /Figures/CCircle.h | UTF-8 | 892 | 2.75 | 3 | [
"Apache-2.0"
] | permissive | #pragma once
#ifndef CCIRC_H
#define CCIRC_H
#include "CFigure.h"
class CCircle : public CFigure
{
private:
Point Center;
Point Circumference;
int CalcRadius() const //Utility Function to Calculate radius
{
int radius = sqrt(pow((Center.x - Circumference.x), 2) + pow((Center.y - Circumference... | true |
9392e8bf74860d98238eab8e393024a1a37d5983 | C++ | sadiuk/naiCRAFTyi | /src/GLAbstraction/ArrayTexture.cpp | UTF-8 | 2,385 | 2.9375 | 3 | [] | no_license | #include "ArrayTexture.h"
namespace GL
{
/* In this constructor you mast pass all
* the paths to images that will be used as textures.
* The sizes, format, depth and resolutions must be the same.
*/
ArrayTexture::ArrayTexture(std::initializer_list<std::string> images)
{
if (images.si... | true |
efa7458058d74a7bdd19adb5cef0e8d11908dd55 | C++ | stamaniorec/UP_IS_2017-2018 | /UP_2017_10_05/UP_2017_10_05/UP_2017_10_05.cpp | UTF-8 | 5,905 | 3.609375 | 4 | [] | no_license | // UP_2017_10_05.cpp : Defines the entry point for the console application.
// jkasdjfjalksdf
#include "stdafx.h"
#include <iostream>
#include <cmath>
using namespace std;
// This is a comment. It starts with // and everything after that until
// the end of the line is not executed.
// Programs are executed sequenti... | true |
651d64ffc4057a980962c981c281ca1b86762f16 | C++ | bzhou830/Orz3D | /Orz3D/Camera.cpp | GB18030 | 1,070 | 2.609375 | 3 | [
"MIT"
] | permissive | #include "Camera.h"
#include "imgui/imgui.h"
namespace dx = DirectX;
dx::XMMATRIX Camera::GetMatrix() const noexcept
{
const auto pos = dx::XMVector3Transform(dx::XMVectorSet(0.0f, 0.0f, -r, 0.0f),
dx::XMMatrixRotationRollPitchYaw(phi, -theta, 0.0f));
return dx::XMMatrixLookAtLH(pos, dx::XMVectorZero(), dx::XMVe... | true |
694715512a31e2398b7d71420f505972cbae271a | C++ | Tom-Li-Lee/learning_notes | /language/c++/language details/C++98/C++对象模型/main_3.cpp | UTF-8 | 1,082 | 3.484375 | 3 | [] | no_license | /*
* main.cpp
*
* Created on: 2011-2-21
* Author: tli
*/
#include <iostream>
#include <stdio.h>
using std::cout;
class Point2d
{
public:
Point2d ():_x(0),_y(0) { cout << "Point2d ctor is called\n";}
Point2d(int x, int y):_x(x),_y(y) {cout << "The Point2d ctor with 2 parameter is ... | true |
eb79105adf81d036024067edcb8fa8ed33de7e25 | C++ | NandhiniManian/my-face-programs | /FACE -C/sorting ascend & descend .cpp | UTF-8 | 471 | 2.90625 | 3 | [] | no_license | #include<iostream>
#include<bits/stdc++.h>
using namespace std;
class s
{
public:int i,a[100];
void sor(int a[],int n)
{
sort(a,a+n);
cout<<"ascending order:";
for(i=0;i<n;i++)
{
cout<<" "<<a[i];
}
cout<<"\n";
cout<<"descending order:";
sort(a,a+n,greater<int>());
for(i=0;i<... | true |
ae6d6dbb7242d953ec2127481bcb09b64b5125fc | C++ | hustpython/websocketpp | /socketprogram/src/server.cpp | UTF-8 | 1,950 | 2.515625 | 3 | [] | no_license | #include <sys/socket.h>
#include <memory.h>
#include <stdio.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#define MAX_SOCKET_BUFFER (1024 * 1024 * 4)
#define PORT 8000
int main()
{
int server_sockfd;
int client_sockfd;
int len;
struct sockaddr_in my... | true |
e76d0ca981023a87036a1d450619a4af8e845042 | C++ | naganath/SPOJ | /ABSURD.cpp | UTF-8 | 938 | 2.875 | 3 | [] | no_license | #include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
inline int absurd1( int n)
{
while(n%10==0)
n=n/10;
int cpy =n;
int count=0;
while(cpy)
{
count++;
cpy/=10;
}
if(n%10==5)
return 2*count-1;
return 2*count;
}
inline int absurd2(int n)
{
int rev=0;
while(n)
rev= rev*10 + n%10,... | true |
d81fd6d5a1e7016eeacbd5d49674f3c0d7bb5b15 | C++ | mathisloge/dt-dataflow-plugin-protocols | /ublox/src/protocol_ublox.cpp | UTF-8 | 766 | 2.53125 | 3 | [] | no_license | #include "protocol_ublox.hpp"
#include <comms/util/detect.h>
namespace protocol
{
Ublox::Ublox()
: state_{State::activated}
{}
std::string_view Ublox::name() const
{
return "ublox";
}
std::pair<ProtoReadIter, ProtoReadIter> Ublox::consumeOneMessage(ProtoReadIter begin, ProtoReadIter end)
{
if (!isActive()... | true |
54100144e17cd90c555638a4f1ca25e6ffa045f2 | C++ | VseMiRaki/OOP_3_term | /Contest1_2a/main.cpp | UTF-8 | 4,404 | 3 | 3 | [] | no_license | #include <iostream>
#include <vector>
#include <string>
std::vector<int> Z_function(std::string s) {
std::vector<int> z_value(s.size(), 0);
int left = 0, right = 0;
for (int i = 1; i < s.size(); i++) {
if (i > right) {
while (i + z_value[i] < s.size() && s[i + z_value[i]] == s[z_value[... | true |
485842ce1336e0e63b73bf766324aded66e2e6ea | C++ | Vipyr/cppdigraph | /test/test_gvtablerow.cpp | UTF-8 | 1,921 | 2.9375 | 3 | [
"MIT"
] | permissive | /*
* Unit Tests for cdg::GvTableRow
*/
#include "graphviz/gvtablerow.h"
#include "gtest/gtest.h"
using namespace cdg;
// Use an namespace to isolate the tests.
namespace test_gvtablerow {
TEST(TestGvTableRow, setCell_string) {
GvTableRow row = GvTableRow();
std::string expected = "rawr";
row.setCell(1, ex... | true |
28d4dd948834fb99a1eec3ccb5b445f6868d1f72 | C++ | RVSZ-jiangfangfei/cslibs_navigation_utilities | /src/LaserTo3DTransformation.cpp | UTF-8 | 2,249 | 2.71875 | 3 | [] | no_license | /*
* LaserTo3DTransformation.cpp
*
* Created on: Nov 15, 2010
* Author: Michael Kaulig
*/
#include <cslibs_navigation_utilities/LaserTo3DTransformation.h>
#include <iostream>
#include <tf/tf.h>
LaserTo3DTransformation::LaserTo3DTransformation(Eigen::Vector3d trans): mTrans(trans){
}
LaserTo3DTransformati... | true |
0c8ebb9de532eb9e0e483390cd99b0d7875aaf5a | C++ | peartail/DirectXPractice2 | /ModelScaling/main.cpp | UTF-8 | 2,899 | 3.0625 | 3 | [] | no_license | #include <ostream>
#include <fstream>
#include <iostream>
#include <math.h>
using namespace std;
void GetModelFilename(char* filename, std::string& outfilename);
bool LoadTextStructure(char* savename,std::string filename);
int maxsize = 1;
struct ModelType
{
float x, y, z;
float tu, tv;
float nx, ny, nz;
float... | true |
5bac82ac87a59fa3a898844d56bebde1f8f36887 | C++ | daikisuyama/AtCoder_Programs | /ARC_124/C.cc | UTF-8 | 2,371 | 2.53125 | 3 | [] | no_license | //嘘解法です、参考にしないでください
//Codeforcesで128bit整数を使いたいとき
//→__int128_tを使う&GNU C++17 (64)で提出する
//インクルードなど
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//イテレーション
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,... | true |
2ef8292d62731e957896c520717c777084955ed9 | C++ | singhsanket143/CppCompetitiveRepository | /CB/OnlineCourseCodes/QueuesC++/FirstNonRepeatingCharacterInAStream.cpp | UTF-8 | 433 | 2.71875 | 3 | [] | no_license | #include <iostream>
#include <queue>
#include <unordered_map>
using namespace std;
int main(int argc, char const *argv[])
{
queue<char> qu;
unordered_map<char, int> mp;
char ch;
cin>>ch;
while(ch != '.') {
qu.push(ch);
mp[ch]++;
while(!qu.empty()) {
if(mp[qu.front()] > 1) {
qu.pop();
} else {
c... | true |
a36f6ebe1d3836ad824607f69bb42bb1c67514b7 | C++ | mxpule/pMol0174 | /src/pMolMpsv/pMolMpsvMask.h | UTF-8 | 3,837 | 2.5625 | 3 | [] | no_license | /***************************************************************************
* Copyright (C) 2006 by Martin Pule *
* martin@pulecyte.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the... | true |
9c333c47e3117fa66ce23b5ae802f3f13886c607 | C++ | HuangStomach/Cpp-primer-plus | /16.String&Library/Exercises/10.cpp | UTF-8 | 2,312 | 3.5625 | 4 | [
"MIT"
] | permissive | #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
struct Review {
string title;
int rating;
double price;
};
bool operator<(const shared_ptr<Review> & r1, const shared_ptr<Review> & r2);
bool worseThan(const shared_ptr<Review> & r1, const shared_ptr<Review> ... | true |
cca556781d968751609ca44cc987973b828fcc59 | C++ | ayush-krishna/koss-task1 | /test.cpp | UTF-8 | 6,008 | 3.734375 | 4 | [] | no_license | #include<iostream>
#include<string>
using namespace std;
class Account
{
float balance;
char type;
string name;
int accno;
public:
Account()
{
balance=0;
}
void create()
{
cout<<"Enter account holder's name:\t";
cin>>name;
cout<<"\n"<<"Enter type of account Savin... | true |
f239b9930ee1863ee47c5235ef0fe195c952303b | C++ | ChesterHu/cs32 | /proj4/SymbolTable.bst.cpp | UTF-8 | 5,794 | 3.421875 | 3 | [] | no_license | // SymbolTable.cpp
// This is a correct but inefficient implementation of
// the SymbolTable functionality.
#include "SymbolTable.h"
#include <string>
#include <iostream>
#include <cassert>
#include <vector>
using namespace std;
const int TABLE_SIZE = 20000;
// struct to store lineNum and scope
struct Pair
{
int ... | true |
3937653e4169303fe20c4a1b63eca8d2e8dcdd35 | C++ | bruno99/Programacion-I | /actividades/sesion5/MarcosGago/sesion5ej7.cpp | UTF-8 | 492 | 3.375 | 3 | [
"MIT"
] | permissive | #include <iostream>
using namespace std;
void Media(int a){
float media{0};
int i{0};
float b{0};
while (i<a){
cout<<"Escribe un numero"<<endl;
cin>>b;
media=(media+b);
i++;
}
media=media/(i);
cout<<"La media es "<<media<<endl;
}
int main()
{
int a;
... | true |
558e20584a2ecdbe8ba76af70b0a6259f0a1c99f | C++ | cwru-robotics/cwru-eecs-275 | /minimal_turtlebot/src/turtlebot_controller.cpp | UTF-8 | 817 | 2.53125 | 3 | [] | no_license | #include "minimal_turtlebot/turtlebot_controller.h"
void turtlebot_controller(turtlebotInputs turtlebot_inputs, uint8_t *soundValue, float *vel, float *ang_vel)
{
//Place your code here! you can access the left / right wheel
//dropped variables declared above, as well as information about
//bumper status.
//... | true |
b494be3a658e8fb76538b4f961e2538891156d91 | C++ | mollnels/Interpreter | /environment.cpp | UTF-8 | 4,922 | 3.15625 | 3 | [] | no_license | #include "expression.cpp"
template <class VALUE1, class VALUE2, class VALUE3>
class Environment{
public:
VALUE1* values1[100];
char* variables1[100];
VALUE2* values2[100];
char* variables2[100];
VALUE3* values3[100];
char* variables3[100];
Environment();
Environment* extendenv(char var, VALUE1 val, Environm... | true |
12510d72045fd543b94f1eb09642afc19eb94a9a | C++ | tacaswell/pyraft | /raft/raft_radon_bresenham.cpp | UTF-8 | 3,333 | 2.984375 | 3 | [] | no_license | #include "raft_radon_bresenham.h"
#include "raft_ddaiterator.h"
#include <vector>
#include <thread>
extern "C" {
// BLAS daxpy:
void daxpy_( int const *, double const *, double const *, int const *, double *, int const * );
// BLAS dcopy:
void dcopy_( int const *, double const *, int const *, double *, int const * )... | true |
01df5a4af9bc7e2ed228bc355eb51459deb8f4b4 | C++ | ngvozdiev/ctr-base | /src/prob_model/dist_model.h | UTF-8 | 9,563 | 2.53125 | 3 | [
"MIT"
] | permissive | #ifndef CTR_DIST_MODEL_H
#define CTR_DIST_MODEL_H
#include <fftw3.h>
#include <stddef.h>
#include <chrono>
#include <complex>
#include <cstdint>
#include <map>
#include <memory>
#include <random>
#include <string>
#include <utility>
#include <vector>
#include "ncode/common.h"
#include "ncode/strutil.h"
#include "ncod... | true |
ccdaf141a5f1f2fda24c16cddaae24375695d895 | C++ | ishiikurisu/CodingDojo | /2016/160618/session2.cpp | UTF-8 | 4,355 | 3.1875 | 3 | [
"Beerware"
] | permissive | #include <vector>
#include <iostream>
#include <stdio.h>
using namespace std;
/* Maratona 18\06\16
Guitar Queer-O
Autor: Matheus Pimenta
Apos comprarem o novo Guitar Hero III: Legends of Rock, Stan e Kyle tem
treinado incessantemente para se tornarem astros do rock.
Acontece que a copia do jogo dos garotos veio chei... | true |
4fb4e03e635e197f5927ccee988e581fb45858d1 | C++ | lriki/Lumino.Core | /include/Lumino/Math/Version.h | SHIFT_JIS | 1,667 | 2.90625 | 3 | [
"Zlib",
"MIT"
] | permissive |
#ifndef LUMINO_MATH_VERSION_H
#define LUMINO_MATH_VERSION_H
#include "Common.h"
#define LUMINO_MATH_VERSION_MAJOR 1 ///< W[o[W
#define LUMINO_MATH_VERSION_MINOR 0 ///< }Ci[o[W
#define LUMINO_MATH_VERSION_PATCH 0 ///< pb`ԍ
#define LUMINO_MATH_VERSION_STRING "1.0.0" ///< o[W
LN_NAMESPACE_BEGIN
namespace Versio... | true |
6f76ebe21d66451e2266a319bbb11a025af20535 | C++ | bostikforever/adv2020 | /src/day11.0.cpp | UTF-8 | 3,802 | 3.25 | 3 | [] | no_license | #include <algorithm>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <fstream>
#include <iostream>
namespace {
class Solution {
static constexpr char occupied = '#';
static constexpr char floor = '.';
static constexpr char empty = 'L';
static constexpr int8_t dirs[] = {-1, 0, 1};
... | true |
3b5fd3d24aec73120cccb8ce7ae7ac6efd3bad44 | C++ | bingo456/functions | /calculateNormals/demo_gpu/main_demo_normals_gpu.cpp | UTF-8 | 3,030 | 2.921875 | 3 | [] | no_license | /**********************************************************************//**
[GPU Version]
Demo about using calculateNormalsOnGpu.h(cpp)
@file main_demo_normals_gpu.cpp
@author WD
@date 2020/03/02
@brief using function calNormalsOnGpu()
**********************************************************************... | true |
e432a92c035602e3f718efc2f9a529faa75e7745 | C++ | YYang30/LintcodeSol | /MinDepth_in_Binary_Tree.cpp | UTF-8 | 633 | 3.375 | 3 | [] | no_license | #include <vector>
using namespace std;
/**
* Definition of TreeNode:
* class TreeNode {
* public:
* int val;
* TreeNode *left, *right;
* TreeNode(int val) {
* this->val = val;
* this->left = this->right = NULL;
* }
* }
*/
/*
* Minimum Depth of Binary Tree
*/
class Solutio... | true |
c37e76f03e202d4f71519ca1e14dee11cda0dfb9 | C++ | XOKAGE95/AaDS | /laba3/main.cpp | UTF-8 | 1,785 | 3.59375 | 4 | [] | no_license | #include <iostream>
#include <exception>
#include<math.h>
#include <ctime>
#include <iomanip>
#include <fstream>
using namespace std;
template <typename A>
void Display (A *arr, int n, ostream &file)
{
file << "Your array: " << endl;
for (int i = 0; i < n; i++)
file << setw(7) << left <<... | true |
cba52f73d6c5d3910b766eca2edeb26083f6d146 | C++ | seakers/daphne-robot | /arduino/tracking.ino/tracking.ino.ino | UTF-8 | 702 | 3.171875 | 3 | [] | no_license | #include <Servo.h>
Servo servo;
int pos = 90;
void setup() {
Serial.begin(9600);
servo.attach(9);
}
void loop() {
char input_char;
int int_from_char;
if(Serial.available()>0){
input_char = char(Serial.read());
while(input_char == 'u' && pos<180 ) { // goes from 0 degrees to 180 degrees
// i... | true |
ab0ead5b738ac4e5f8ae8157eebde09f46726867 | C++ | lquinlan/c- | /零碎/template用法.cpp | GB18030 | 445 | 2.765625 | 3 | [] | no_license | /*
йTemplate÷,֪ʲô,ǰ¼һ
ͨıӦһ,ָ,һģ
*/
#include<iostream>
using namespace std;
template <class T>
class A
{
template <class U>
class B
{
typedef A<U> other;
};
};
template<class T1,class T2>
class test
{
typedef typename T1:: template B<T2>::other t1_type;
};
int main ()
{
}
| true |
074acd0865a5f6d72c31589f7fa139b2f54ec680 | C++ | sacckey/atcoder | /minpro2019/minpro2019.cpp | UTF-8 | 824 | 2.59375 | 3 | [] | no_license | #include <bits/stdc++.h>
using namespace std;
void solveA(){
int n,k;
cin >> n >> k;
if (k <= (n+1)/2){
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
void solveB(){
int a[3],b[3];
int cnt[4] = {0};
bool flg = true;
for(int i=0;i<3;i++){
cin >> a[i] >> b[i];
cnt[a[i]-1]... | true |
9b4d096ad2b456dc25eb1c4d4c94a8f2f870bbdd | C++ | fredfeng/compass | /dex-parser/Int2Str.cpp | UTF-8 | 1,317 | 3.09375 | 3 | [] | no_license | #include "Int2Str.h"
string Int2Str(int value)
{
stringstream ss;
ss << value;
return ss.str();
}
string Long2Str(long value){
stringstream ss;
ss << value;
return ss.str();
}
string Float2Str(float value)
{
stringstream ss;
ss << value;
return ss.str();
}
string Double2Str(double value)
{
stringstream ss;
... | true |
ae50e90b6ef74558be4982dab5d32ec64e705bc3 | C++ | SCS2017/Leetcode-Solution | /二叉树/111_二叉树的最小深度.cpp | UTF-8 | 2,975 | 4.1875 | 4 | [] | no_license | /*
给定一个二叉树,找出其最小深度。
最小深度是从根节点到最近叶子节点的最短路径上的节点数量。
说明: 叶子节点是指没有子节点的节点。
示例:
给定二叉树 [3,9,20,null,null,15,7],
3
/ \
9 20
/ \
15 7
返回它的最小深度 2.
*/
#include <iostream>
#include <stdio.h>
using namespace std;
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
//TreeNode(int x)... | true |
b374f3bb46e240b4a4f132a6a409abb24cc83361 | C++ | adriancarriger/experiments | /udacity/self-driving-intro/5/3/optimized/blur.cpp | UTF-8 | 1,128 | 3.078125 | 3 | [
"MIT"
] | permissive | #include "headers/blur.h"
#include "headers/zeros.h"
using namespace std;
vector<vector<float>> blur(vector<vector<float>> &grid, float blurring) {
vector<float> row;
vector<float> newRow;
unsigned long height;
unsigned long width;
float center, corner, adjacent;
height = grid.size();
width = grid[0].... | true |
c7d7180f0f4489614023b5578952ccc06170553c | C++ | hse-spb-2020-cpp/practice-alferov | /pract16/visitor.cpp | UTF-8 | 1,385 | 3.78125 | 4 | [] | no_license | #include <string>
#include <memory>
#include <iostream>
struct EmployeeVisitor;
struct Employee {
std::string name;
virtual ~Employee() = default;
virtual void accept(EmployeeVisitor* visitor) = 0;
};
struct Developer;
struct Manager;
struct EmployeeVisitor {
virtual ~EmployeeVisitor() = default;
... | true |
19a5a4fb0e11bf483a516bdce2b646fec26e2f4c | C++ | anthonydaig/The_Collab | /ANN/ann.cpp | UTF-8 | 6,664 | 2.765625 | 3 | [] | no_license | #include <math.h>
#include "Eigen/Dense"
#include <random>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
using namespace Eigen;
class ann {
private:
void sigmoid(MatrixXd, MatrixXd*);
void sigmoidDeriv(MatrixXd*,int);
void initializeTheta(int, int, MatrixXd*);
void add_bias(MatrixXd*);
void se... | true |
423be921c87143c555fdfb85fc5839187517dcd9 | C++ | Woutuuur/sorting-visualizer | /include/button.h | UTF-8 | 1,057 | 2.765625 | 3 | [] | no_license | #ifndef BUTTON_H
#define BUTTON_H
#include <SDL2/SDL.h>
#include <SDL2/SDL_ttf.h>
#include <string>
class Button
{
public:
Button(SDL_Renderer* renderer, const int x, const int y, const int w, const int h);
~Button();
void render();
void setBackgroundColor(const int r, const int g,... | true |
f3302eca9a92b8211bcef2f2ee6b29e547a6edbf | C++ | civinx/ACM_Code | /Practice/ZUCCACM/Problem : Pills (卡特兰数)/Problem : Pills (卡特兰数)/main.cpp | UTF-8 | 557 | 2.59375 | 3 | [] | no_license | //
// main.cpp
// Problem : Pills (卡特兰数)
//
// Created by czf on 16/4/2.
// Copyright © 2016年 czf. All rights reserved.
//
#include <cstdio>
#include <cstring>
typedef long long ll;
const int maxn = 100;
ll f[maxn][maxn];
int main() {
for(int i = 0; i < maxn; i ++) f[0][i] = 1;
for(int i = 1; i <= 30; i +... | true |
e4f3ac8e6f692b17c7d89c0c211bec26d6a02608 | C++ | romanivanov21/web_server | /inc/process/worker_process/worker_process.h | UTF-8 | 666 | 2.703125 | 3 | [] | no_license | /**
* Флайл: worker_process.h
*
* Описание: класс реализющий worker процесс
*/
#ifndef _WORKER_PROCESS_H_
#define _WORKER_PROCESS_H_
#include "process.h"
#include "event_dispatcher.h"
class worker_process : public process, protected event_dispatcher
{
public:
worker_process();
~worker_process();
/**... | true |
4742953af663ff698aa677c5e6b4aea70e33fe07 | C++ | Gabriele91/Theoretical-and-Computational-Methods-for-The-Molecular-Sciences | /include/kernels.h | UTF-8 | 6,267 | 2.953125 | 3 | [] | no_license | //
// kernels.h
// MPI-Test_01
//
// Created by Gabriele on 27/03/16.
// Copyright © 2016 Gabriele. All rights reserved.
//
#pragma once
#include <vector>
#include <string>
#include <complexmath.h>
#include <polynomial.h>
template<class T>
using kernel = std::complex<T>(*)(const polynomial< T >&, const std::comple... | true |
314fb1490532126a739df3c8a7b9bb797e8e25f2 | C++ | ronishz/bootcamp | /cl1p/B3_0-1 Knapsack.cpp | UTF-8 | 4,652 | 3.421875 | 3 | [] | no_license | // A Dynamic Programming based solution for 0-1 Knapsack problem
// Time Complexity: O(nW) where n is the number of items and W is the capacity of knapsack.
// O(b^d)
#include<stdio.h>
#include<iostream>
#define maxi 10
using namespace std;
// A utility function that returns maximum of two integers
int max... | true |
a35e4d8722702ca633e7bff31d39ec824266e2be | C++ | bochalito/computational-geometry | /VVRFramework/include/GeoLib/C2DHoledPolyBaseSet.h | UTF-8 | 5,448 | 2.59375 | 3 | [] | no_license | /*---------------------------------------------------------------------------
Copyright (C) GeoLib.
This code is used under license from GeoLib (www.geolib.co.uk). This or
any modified versions of this cannot be resold to any other party.
---------------------------------------------------------------------------*/
/*... | true |
3fd4540af1930f9b7ee26ac576cbcc0c8583f4e3 | C++ | gwsystems/schedcat | /native/src/edf/ffdbf.cpp | UTF-8 | 7,349 | 2.765625 | 3 | [] | no_license | #include <algorithm> // for min
#include <queue>
#include <vector>
#include "tasks.h"
#include "schedulability.h"
#include "math-helper.h"
#include "edf/ffdbf.h"
#include <iostream>
#include "task_io.h"
using namespace std;
static void get_q_r(const Task &t_i, const fractional_t &time,
integral... | true |
d37e238bbc994ba844903d071b8e59c0cc647da4 | C++ | avallete/CPPool | /J05/ex01/Form.hpp | UTF-8 | 1,458 | 2.96875 | 3 | [] | no_license | #ifndef FORM_HPP
#define FORM_HPP
#include <iostream>
class Bureaucrat;
class Form
{
public:
Form(void);
Form(std::string name, int sgrade, int xgrade);
~Form(void);
std::string& getName(void) const;
int getSGrade(void) const;
int getXGrade(void) const;
bool getSign(void) const;
void beSign... | true |
098091f94f71ddd6d72b7b90b309063267b3d417 | C++ | ayushh7/codeforces-solutions-2 | /9A.cpp | UTF-8 | 503 | 2.734375 | 3 | [] | no_license | /*
* Author: Rushi Vachhani
* Platform: Codeforces
* Problem_ID: 9A
* Language: C++
*/
#include<bits/stdc++.h>
using namespace std;
void solve() {
int a, b;
cin >> a >> b;
if(a==1 && b==1) { cout<<"1/1"; return; }
int max_element = max(a,b);
int possibilities = (6-max_element)+1;
int g... | true |
aeeee5653938e751341ee32c744eed4467491580 | C++ | oliver-zeng/leetcode | /0200-Number_of_Islands/main-2.cpp | UTF-8 | 1,229 | 2.71875 | 3 | [] | no_license | class Solution {
int d[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
void dfs(vector<vector<char>> &grid, vector<vector<bool>> &used, int x, int y) {
for (int i = 0; i < 4; i++) {
int newx = x + d[i][0];
int newy = y + d[i][1];
if ((newx >= 0 && newx < grid.size()) &&
... | true |
a1ae2b6e7cf71f9cd122be7708282dfdae214a70 | C++ | Freeman97/PAT-Solve | /Q1007/solve.cpp | UTF-8 | 390 | 2.953125 | 3 | [] | no_license | #include <iostream>
#include <math.h>
using namespace std;
int main()
{
int N = 0;
int counter = 0;
int prev = 2;
bool flag;
cin >> N;
for(int i = 2; i <= N; i++)
{
flag = true;
for(int j = 2; j <= sqrt(i); j++)
{
if(i % j == 0)
{
flag = false;
break;
}
}
if(flag)
{
if(i - prev =... | true |
0ccc9bf470c0b5deb31d7a2b52a7168072df1055 | C++ | Mikhael777/tiitDeliveryLab1 | /021703/Samchuk_ZHENYA/library.cpp | WINDOWS-1251 | 2,624 | 3.28125 | 3 | [] | no_license | // ( )
#include <iostream>
#include "Library_prot.h"
using namespace std;
node::node(node* Pr, node* Ne) {
previous = Pr;
next = Ne;
dequeue = new int[Max]();
}
void node::print() {
for (int k = 0; k < Max; k++) {
if (dequeue[k] != 0)
cout << dequeue[k] << " | ";
} ... | true |
017f7b874e10f239fb46824e6f01426667ab1ec1 | C++ | BeauRogers/train_signaling | /src/simulation.cpp | UTF-8 | 1,685 | 2.75 | 3 | [] | no_license | #include <iostream>
using namespace std;
#include <limits.h>
#include <chrono>
#include <thread>
#include "include/train.h"
#include "include/simulation.h"
void initialize_trains(Train* trains, int num_trains, node_info* global_map, std::string* names,
int num_stops, next_node* train_pos)
{
for(int i=0; i<nu... | true |
47df7bfe7a3ffd1cbec0e73e81bcc8f39c717154 | C++ | derekzhang79/Algorithm-Training | /ACM模板/数学/素数/素数筛选和合数分解.cpp | UTF-8 | 869 | 2.578125 | 3 | [] | no_license | #include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
//素数筛选和合数分解
const int maxn = 1e4;
int prime[maxn+1];
void getPrime()
{
memset(prime,0,sizeof(prime));
for(int i=2;i<=maxn;i++)
{
if(!prime[i]) prime[++prime[0]] = i;
for(int j=1;j<=prime[0] && prim... | true |
7cc90fccc37520bc34d22a4b54be1c80f362c254 | C++ | SteinVR/DoublePend | /DoublePGL/DoublePGL/Main.cpp | WINDOWS-1251 | 4,988 | 2.625 | 3 | [] | no_license | #include <stdio.h>
#include "freeglut.h"
#define _USE_MATH_DEFINES
#include <cmath>
#include <iostream>
const double m1 = 1; // 1-
const double m2 = 1; // 2-
const double l1 = 1; // 1-
const double l2 = 1; // 2-
const double g = 9.8;
const double initialfi1 = M_PI / 3; // 1-
const double ini... | true |
6ec483f88c3c254beaa3812ac29fa8e05d05d00c | C++ | liuzhengzhe/leetcode | /26.cpp | UTF-8 | 378 | 2.671875 | 3 | [] | no_license | class Solution {
public:
int removeDuplicates(int A[], int n) {
int len=1;
if(!n){
return NULL;
}
if(n==1){
return 1;
}
for(int i=1;i<n;i++){
if(A[i]!=A[i-1]){
A[len]=A[i];
len++;
... | true |
4a1af8657482c170c07395a4515df20e376b0223 | C++ | utcoupe/Coupe2012 | /executables/visio/tests/visio_detector/Perspective.cpp | UTF-8 | 5,011 | 2.84375 | 3 | [] | no_license | #include "Perspective.h"
using namespace cv;
void Perspective::calculateTransformation()
{
// proportions de l'échiquier en pixels
double chess_lengthX_01 = sqrt(
pow(src_vertices[1].x - src_vertices[0].x, 2) +
pow(src_vertices[1].y - src_vertices[0].y, 2) );
double chess_lengthY_02 = chess_lengt... | true |
f306419d158352b0d6acbc4c1a591b62eb6e2968 | C++ | DaeunOh/ALGORITHM | /AlgorithmJobs/[24] Exam/[BF]놀이공원.cpp | UTF-8 | 3,398 | 3.21875 | 3 | [] | no_license | // 소요시간: 35분
/*
문제
알랩놀이공원 입구에는 10개의 매표소가 있다. 놀이공원에 손님이 많지 않은 탓에 날마다 문을 여는 매표소의 개수는 다르다.
1 개의 매표소에서 손님 1 명을 입장 시키는데 1 분이 걸린다.
경비원 유니는 입구에서 손님들이 올 때마다, 최대한 빠르게 입장할 수 있도록 줄을 적게 서있는 매표소로 안내하고 있다.
단체손님은 같은 매표소로 안내해주며, 단체손님 또한 1명 당 1분의 입장시간이 소요된다.
이 1분의 시간은 줄을 서는데 부터 입장하는데 까지 걸린 총 시간이다.
유니가 줄을 배정하는데에는 시간이 소요되지 않는다고 가정... | true |
dd710c7fac45002af72dbb620c3b1126f5e4b2c0 | C++ | AgostonSzepessy/battle-of-oxshan | /Game.cpp | UTF-8 | 854 | 2.75 | 3 | [
"MIT"
] | permissive | #include "Game.hpp"
Game::Game()
{
window.create(sf::VideoMode(WIDTH, HEIGHT), "Game", sf::Style::Close);
window.setVerticalSyncEnabled(false);
accumulator = 0;
}
void Game::run()
{
init();
int prevTime = c.getElapsedTime().asMilliseconds();
int currentTime = 0;
while (window.isOpen())
{
currentTime = c.g... | true |
65e56e6ceafae2c0c93fb7239b451045f69379fe | C++ | jedrak/chesspp | /library/include/Field.h | UTF-8 | 390 | 2.640625 | 3 | [] | no_license | #ifndef GAME_FIELD_H
#define GAME_FIELD_H
#include "typedefs.h"
class Field {
private:
int x;
int y;
unitPtr unit;
boardPtr board;
public:
int getX() const;
int getY() const;
const unitPtr &getUnit() const;
void setUnit(const unitPtr &unit);
bool occupied() const;
Field(i... | true |
23633e6ec7d9f3baea7a37e97a668a51ed96f488 | C++ | ProfDoof/CompilerComparisonCode | /c++/jacobiSolve/WIP/LinearContiguousStorage.hpp | UTF-8 | 1,207 | 2.984375 | 3 | [] | no_license | #ifndef LINEARCONTIGUOUSSTORAGE_HPP
#define LINEARCONTIGUOUSSTORAGE_HPP
#include "Storage.hpp"
template <typename GridT>
class LinearContiguousStorage: public Storage<GridT> {
protected:
size_t _lda;
public:
LinearContiguousStorage();
virtual ~LinearContiguousStorage();
size_t lda();
virtu... | true |
d98e5c013d7e82b542e7fd9467bb21db9d8eefbd | C++ | Tchoks/pricing_option | /pricing_option/Matrix.h | UTF-8 | 671 | 3.140625 | 3 | [] | no_license | #pragma once
#include <vector>
template<class T>
class Matrix
{
public:
//Matrix(); // default constructor
Matrix(const int& rows, const int& cols, const T& value);
Matrix(const Matrix<T>& mat);
Matrix<T>& operator= (const Matrix<T>& mat);
std::vector<std::vector<T>> get_mat() const;
T& value(const i... | true |
b3adc6111a142fd1ccf035b311a1fdc9bec6e007 | C++ | OmarAbdelrahman/solved-problems | /UVA/competitive_programming/chapter_2/Basic Data Structures/11360 - Have Fun With Matrices.cpp | UTF-8 | 2,035 | 3.4375 | 3 | [] | no_license | #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
int matrix[10][10];
int sizeofMatrix;
bool IsTen(int);
bool IsNegative(int);
void Transpose();
void Increment();
void Decrement();
void ChangeRow(int, int);
void ChangeCol(int, int);
int main() {
char temp;
int number... | true |