repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
RandomKiddo/Cram
src/lzw.cpp
/** * This file is licensed under the MIT License (MIT). * Copyright (c) 2021 RandomKiddo **/ #include <iostream> #include <fstream> #include <vector> #include <unordered_map> #include <string> std::vector<int> encode(std::string str); int main(void) { std::ifstream fin; std::ofstream fout; std::strin...
RandomKiddo/Cram
src/runlength.cpp
/** * This file is licensed under the MIT License (MIT). * Copyright (c) 2021 RandomKiddo **/ #include <iostream> #include <string> #include <fstream> void compress(std::string input, std::string output); std::string runLine(std::string line); int main(void) { std::string input; std::string output; st...
RandomKiddo/Cram
src/huffman.cpp
/** * This file is licensed under the MIT License (MIT). * Copyright (c) 2021 RandomKiddo **/ #include <string> #include <iostream> #include <fstream> #include <vector> #include <queue> #include <map> #define INTEGER_MAX 2147483647 struct Node { char input; unsigned frequency; Node *left, *right; ...
hufx10/kungfu
wingchun/base/TDUserStruct.cpp
/***************************************************************************** * Copyright [2017] [taurus.ai] * * 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 the License at * http://www.apache.org/li...
hufx10/kungfu
wingchun/md/IMDEngine.cpp
/***************************************************************************** * Copyright [2017] [taurus.ai] * * 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 the License at * http://www.apache.org/li...
hufx10/kungfu
wingchun/strategy/IWCStrategy.cpp
<reponame>hufx10/kungfu /***************************************************************************** * Copyright [2017] [taurus.ai] * * 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 the License at * ...
hufx10/kungfu
wingchun/td/TDEngineCTP.cpp
/***************************************************************************** * Copyright [2017] [taurus.ai] * * 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 the License at * http://www.apache.org/li...
hufx10/kungfu
wingchun/strategy/WCDataWrapper.cpp
<reponame>hufx10/kungfu /***************************************************************************** * Copyright [2017] [taurus.ai] * * 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 the License at * ...
hufx10/kungfu
wingchun/md/MDEngineXTP.cpp
<gh_stars>1-10 /***************************************************************************** * Copyright [2017] [taurus.ai] * * 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 the License at * http://ww...
lvwuwei/slowhttptest
src/text-generator.cc
/***************************************************************************** * Copyright 2011 <NAME> * * 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 the License at * * http://www.apache.org/licenses/L...
lvwuwei/slowhttptest
src/slowlog.cc
<reponame>lvwuwei/slowhttptest /***************************************************************************** * Copyright 2011 <NAME> * * 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 the License at * * h...
lvwuwei/slowhttptest
src/slowstats.cc
<filename>src/slowstats.cc /***************************************************************************** * Copyright 2011 <NAME>, <NAME> * * 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 the License at *...
lvwuwei/slowhttptest
src/range-generator.cc
/***************************************************************************** * Copyright 2011 <NAME>, <NAME> * * 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 the License at * * http://www.apache.org/li...
lvwuwei/slowhttptest
src/slowhttptestmain.cc
/***************************************************************************** * Copyright 2011 <NAME>, <NAME> * * 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 the License at * * http://www.apache.org/li...
xan1242/gtarctool
GTArcTool/GTArcTool.cpp
// GTArcTool.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <stdlib.h> #include <string.h> #define DEFAULT_FILE_EXT "bin" #define GT_FORMAT_MAGIC 0x29232840 #define GTSEQ_MAGIC 0x47514553 #define GTINST_MAGIC 0x54534E49 #define GTENGN_MAGIC 0x4E474E45 #defin...
zephray/Dramite
sim/cpu/executor.cpp
/* * Copyright (C) 2015, 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later ...
zephray/Dramite
sim/cpu/core.cpp
<reponame>zephray/Dramite /* * Copyright (C) 2015, 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (...
zephray/Dramite
sim/cpu/executor/tasks.cpp
<reponame>zephray/Dramite /* * Copyright (C) 2016-2020 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (a...
zephray/Dramite
sim/cpubus.cpp
/******************************************************************************* This program is free software (firmware): you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at you...
zephray/Dramite
sim/cpu/memory.cpp
<reponame>zephray/Dramite /******************************************************************************* This program is free software (firmware): you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of t...
zephray/Dramite
sim/cpu/decoder/prefix_none.cpp
<filename>sim/cpu/decoder/prefix_none.cpp /* * Copyright (C) 2015, 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the ...
zephray/Dramite
sim/cpu/debugger/int_decoders.cpp
<reponame>zephray/Dramite<gh_stars>1-10 /* * Copyright (C) 2018 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License,...
zephray/Dramite
sim/cpusim.cpp
/******************************************************************************* This program is free software (firmware): you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at yo...
zephray/Dramite
sim/cpu/executor/ctrlxfer.cpp
/* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
zephray/Dramite
sim/cpu/decoder/prefix_none_32.cpp
<filename>sim/cpu/decoder/prefix_none_32.cpp /* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Lic...
zephray/Dramite
sim/cpu/executor/interrupts.cpp
/* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
zephray/Dramite
sim/cpucore.cpp
<reponame>zephray/Dramite<gh_stars>1-10 /******************************************************************************* This program is free software (firmware): you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either ...
zephray/Dramite
sim/cpu/executor/modrm.cpp
<gh_stars>1-10 /* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) a...
zephray/Dramite
sim/cpu/mmu.cpp
/* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
zephray/Dramite
sim/cpu/executor/memory.cpp
/* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
zephray/Dramite
sim/cpu/decoder.cpp
/* * Copyright (C) 2015-2021 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
zephray/Dramite
sim/cpu/debugger/int_strings.cpp
/* * Copyright (C) 2018 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
zephray/Dramite
sim/cpu/decoder/prefix_0F_32.cpp
<reponame>zephray/Dramite /* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at you...
zephray/Dramite
tools/bin2mif.cpp
#include <iostream> #include <iomanip> #include <fstream> using namespace std; int main(int argc, char * argv[]) { int size; if (argc == 4) { size = atoi(argv[3]); } else if (argc == 3) { size = 256; // Default GB BROM Size } else { cout << "Usage: bin2mif <input.bin> <output.mif> [size]" << endl; retur...
zephray/Dramite
sim/cpu/decoder/prefix_0F.cpp
<filename>sim/cpu/decoder/prefix_0F.cpp /* * Copyright (C) 2015, 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Li...
zephray/Dramite
sim/cpu/executor/access.cpp
<reponame>zephray/Dramite /* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at you...
zephray/Dramite
sim/cpu/debugger.cpp
<reponame>zephray/Dramite<gh_stars>1-10 /* * Copyright (C) 2015-2018 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the Lic...
zephray/Dramite
sim/cpu/executor/opcodes.cpp
<filename>sim/cpu/executor/opcodes.cpp<gh_stars>1-10 /* * Copyright (C) 2016-2020 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version...
zephray/Dramite
sim/cpu/executor/flags.cpp
/* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later versio...
zephray/Dramite
sim/cpu/executor/stack.cpp
<gh_stars>1-10 /* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) a...
zephray/Dramite
sim/memsim.cpp
/******************************************************************************* This program is free software (firmware): you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at yo...
zephray/Dramite
sim/cpu/bus.cpp
/* * Copyright (C) 2015-2021 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later v...
zephray/Dramite
sim/cpu/decoder/cycles.cpp
<reponame>zephray/Dramite /* * Copyright (C) 2016 <NAME> * * This file is part of IBMulator. * * IBMulator is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at you...
zephray/Dramite
sim/busmaster_tb.cpp
/******************************************************************************* This program is free software (firmware): you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at yo...
devosoft/empirical-prefab-demo
source/loading_modal_example.hpp
<reponame>devosoft/empirical-prefab-demo #pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/FontAwesomeIcon.hpp" #include "emp/prefab/LoadingModal.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" void loading_modal_example( emp::web::...
devosoft/empirical-prefab-demo
source/collapse_example.hpp
<filename>source/collapse_example.hpp #pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/Collapse.hpp" #include "emp/prefab/CommentBox.hpp" #include "emp/web/Div.hpp" #include "emp/web/Document.hpp" void collapse_example( emp::web::Document& doc ) {...
devosoft/empirical-prefab-demo
source/empirical_info.hpp
#pragma once #include <string> #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/FontAwesomeIcon.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" void empirical_info( emp::web::Document& doc ) { emp::web::Div empirical_info; doc << empirical_info; emp::prefab::FontAwesomeIcon info_icon("...
devosoft/empirical-prefab-demo
source/readout_panel_example.hpp
<reponame>devosoft/empirical-prefab-demo #pragma once #include <string> #include "emp/math/Random.hpp" #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/ReadoutPanel.hpp" #include "emp/web/Button.hpp" #include "emp/web/Document.hpp" int counter = 0; void readout_panel_example( ...
devosoft/empirical-prefab-demo
source/code_block_example.hpp
<filename>source/code_block_example.hpp #pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/web/Document.hpp" void code_block_example( emp::web::Document& doc ) { // ------ Code Block Example ------ emp::prefab::Card code_block_ex("INIT_CLOSED"); doc...
devosoft/empirical-prefab-demo
source/config_panel_example.hpp
#pragma once #include <string> #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/ConfigPanel.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" #include "SampleConfig.hpp" SampleConfig cfg; void config_panel_example( emp::web::Document& doc ) { // ------ Config Panel Example ------ emp::pr...
devosoft/empirical-prefab-demo
source/loading_icon_example.hpp
#pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/FontAwesomeIcon.hpp" #include "emp/prefab/LoadingIcon.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" void loading_icon_example( emp::web::Document& doc ) { // ------ Loading Icon...
devosoft/empirical-prefab-demo
source/SampleConfig.hpp
#pragma once #include "emp/config/config.hpp" EMP_BUILD_CONFIG( SampleConfig, GROUP(MAIN, "Global settings"), VALUE(SEED, int, -1, "Random number generator seed"), VALUE(TIME_STEPS, int, 1000, "Number of time steps to run for"), VALUE(PLATE_LENGTH, double, 10.0, "Length of plate in mm"), VALUE(PLAT...
devosoft/empirical-prefab-demo
source/modal_example.hpp
<filename>source/modal_example.hpp<gh_stars>1-10 #pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/FontAwesomeIcon.hpp" #include "emp/prefab/Modal.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" void modal_example( emp::web::Docume...
devosoft/empirical-prefab-demo
source/card_example.hpp
<reponame>devosoft/empirical-prefab-demo #pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/web/Document.hpp" void card_example( emp::web::Document& doc ) { // ------ Card Example ------ emp::prefab::Card card_ex("INIT_CLOSED"); doc << card_ex; ca...
devosoft/empirical-prefab-demo
source/toggle_switch_example.hpp
#pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/ToggleSwitch.hpp" #include "emp/web/Document.hpp" void toggle_switch_example(emp::web::Document& doc ) { // ------ Toggle Switch Example ------ emp::prefab::Card toggle_switch_ex("INIT_CLOSED")...
devosoft/empirical-prefab-demo
source/web/empirical-prefab-demo-web.cpp
<reponame>devosoft/empirical-prefab-demo<filename>source/web/empirical-prefab-demo-web.cpp // This file is part of Empirical Prefab Demo // Copyright (C) <NAME>, 2020. // Released under MIT license; see LICENSE #include <iostream> #include "emp/config/ArgManager.hpp" #include "emp/prefab/LoadingModal.hpp" #include...
devosoft/empirical-prefab-demo
source/font_awesome_icon_example.hpp
<reponame>devosoft/empirical-prefab-demo #pragma once #include <string> #include "emp/prefab/Card.hpp" #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/FontAwesomeIcon.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" void font_awesome_icon_example( emp::web::Document& doc ) { // ------ Font...
devosoft/empirical-prefab-demo
source/comment_box_example.hpp
<reponame>devosoft/empirical-prefab-demo #pragma once #include <string> #include "emp/prefab/CodeBlock.hpp" #include "emp/prefab/CommentBox.hpp" #include "emp/web/Document.hpp" #include "emp/web/Div.hpp" void comment_box_example( emp::web::Document& doc ) { // ------ Comment Box Example ------ emp::prefab::Card...
gnartbx/noodles
nq/queens_test.cc
#include "queens.h" #include "gtest/gtest.h" using std::cout; using std::endl; using nq::Queens; TEST(QueensTest, Two) { Queens q = Queens::Create(2); cout << "====(Initial)====" << endl << q << endl; EXPECT_EQ(2UL, q.num_attacks()); q.Swap(0, 1); cout << "====Swap(0,1)====" << endl << q << endl; EXPECT_E...
gnartbx/noodles
atax/board_test.cc
#include "board.h" #include "gtest/gtest.h" using std::cout; using std::endl; using atax::Board; TEST(BoardTest, Create) { Board b = Board::Create(); cout << "====(Initial)====" << endl << b << endl; // EXPECT_EQ(2UL, b.num_unattacked()); } TEST(BoardTest, Free) { Board b = Board::Create(); b.Move(1, 7, 7...
gnartbx/noodles
nq/queens.cc
<filename>nq/queens.cc #include "queens.h" #include <algorithm> namespace nq { /* static */ Queens Queens::Create(size_t num_rows) { return Queens(num_rows); } Queens::Queens(size_t num_rows) : num_rows_(num_rows), col_by_row_(num_rows) { for (size_t row = 0; row < num_rows_; row++) { col_by_row_[row] = row; ...
gnartbx/noodles
atax/board.cc
<filename>atax/board.cc<gh_stars>0 #include "board.h" #include <algorithm> #include <iostream> #include <utility> #include <string.h> namespace atax { /* static */ Board Board::Create() { return Board(); } constexpr Board::Piece PIECES[Board::kNumPieces] = { Board::Piece::Rook, Board::Piece::Rook, Board::P...
gnartbx/noodles
nq/nq.cc
<filename>nq/nq.cc #include <atomic> #include <chrono> #include <iostream> #include <limits> #include <mutex> #include <random> #include <thread> #include <gflags/gflags.h> #include <math.h> #include <signal.h> #include <time.h> #include "queens.h" DEFINE_int32(board_size, 8, "Number of rows/columns in the chess boa...
jill-amudhini/hacktoberfest2021
CPP/Leet Code Solutions/jump-game/jump-game.cpp
class Solution { public: bool canJump(vector<int>& nums) { int l=nums.size()-1; for(int i=l-1;i>=0;i--) { if(i+nums[i]>=l) { l=i; } } if(l==0) return true; else return false; } };
clemenceparis/competitive-programming
British-Informatics-Olympiad/2020/q2.cpp
#include <iostream> #include <vector> #include <algorithm> #include <memory.h> #define MAX_N2 10 using namespace std; int visit(int room, vector<pair<int, bool>> connected[MAX_N2], bool oddTimesVisited[MAX_N2]) { oddTimesVisited[room] = !oddTimesVisited[room]; // parity of number of times visited if (oddTimesVisit...
clemenceparis/competitive-programming
Perse/2021/R2/q12.cpp
<gh_stars>1-10 //2021 R2 12 #include <iostream> #include <string> #include <vector> #include <algorithm> #include <climits> #include <tuple> #include <unordered_set> #include <set> using namespace std; vector<tuple<int, int, int>> schedules[10000]; const int START_MIN = 5*60; int earliest = INT_MAX; int n; set<pair<i...
decster/jnicompressions
src/main/native/src/compressions_Lz4Compression.cc
<filename>src/main/native/src/compressions_Lz4Compression.cc /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you ...
decster/jnicompressions
src/main/native/src/compressions_SnappyCompression.cc
<reponame>decster/jnicompressions<gh_stars>1-10 /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Ap...
Lights-Northern/aurora-browser
tests/cefsimple/main.cpp
/************************************************************************************************ * Copyright (c) 2013 <NAME> * * 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 withou...
whuangum/snakefish
src/snakefish.cpp
#include "snakefish.h" PYBIND11_MODULE(snakefish, m) { py::class_<snakefish::thread>(m, "Thread") .def(py::init<py::function>()) .def(py::init<py::function, py::function, py::function>()) .def("start", &snakefish::thread::start) .def("join", &snakefish::thread::join) .def("try_join", &s...
whuangum/snakefish
src/generator.cpp
<reponame>whuangum/snakefish #include "generator.h" namespace snakefish { generator::generator(const py::function &f) : is_parent(false), child_pid(0), started(false), joined(false), child_status(0), extract_func(), merge_func(), _channel(), cmd_channel(1024), next_sent(false), stop_sent(false), mergi...
whuangum/snakefish
src/semaphore_t.cpp
<gh_stars>10-100 #include <cerrno> #include <stdexcept> #include <unistd.h> #include "semaphore_t.h" #include "util.h" namespace snakefish { #ifdef __APPLE__ semaphore_t::semaphore_t(unsigned int val) : name("/snakefish-") { // randomly generate a semaphore name name.append(std::to_string(getpid())); name.app...
whuangum/snakefish
src/thread.cpp
<reponame>whuangum/snakefish<filename>src/thread.cpp<gh_stars>10-100 #include "thread.h" #include "util.h" namespace snakefish { thread::thread(py::function f) : is_parent(false), child_pid(0), started(false), joined(false), child_status(0), func(std::move(f)), extract_func(), merge_func(), _channel()...
whuangum/snakefish
src/channel.cpp
<gh_stars>10-100 #define PY_SSIZE_T_CLEAN #include <Python.h> #include <cstdio> #include <stdexcept> #include "channel.h" #include "util.h" namespace snakefish { channel::channel(const size_t size) : lock(1), n_unread(), capacity(size) { // imports pickle functions dumps = py::module::import("pickle").attr("dum...
whuangum/snakefish
src/misc.cpp
#include <thread> #include "misc.h" #include "thread.h" namespace snakefish { static std::vector<py::object> map_thread_func(const py::function &f, const std::vector<py::handle> &args) { std::vector<py::object> results; results.reserve(args.size()); for (auto arg : args) { results.push_back(f(arg)); } ...
whuangum/snakefish
src/buffer.cpp
#include <cstdio> #include <cstdlib> #include <new> #include "buffer.h" namespace snakefish { buffer::buffer(size_t len, buffer_type type) : len(len), type(type) { switch (type) { case MALLOC: buf = malloc(len); if (buf == nullptr) { perror("malloc() failed"); throw std::bad_alloc(); } ...
leoking01/vlfeat-0.9.21_cmk_install
install_bin_release_ubun2104/include/version.hpp
#ifndef _VERSION_H_ #define _VERSION_H_ #define _VERSION "0.9.21" #define _MAJOR_VERSION 0 #define _MINOR_VERSION 9 #define _PATCH_VERSION 21 #endif // _VERSION_H_
olegvolosnik/Doubly-Linked-List
main.cpp
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <iostream> #include <fstream> #include <cstdlib> typedef struct book { char tytul[100], imie_aut[100], nazw_aut[100], kategoria[100], imie_wyp[100], nazw_wyp[100], inne[100]; int ID, status; struct date {int d...
jwowillo/band
band/control/border.cc
<gh_stars>0 #include "band/control/border.h" #include <cmath> #include "band/control/rectangle.h" namespace band { namespace control { void Border::SetArea(const ::band::Area& area) { area_ = area; } Dimension Border::Thickness() const { return thickness_; } void Border::SetThickness(const Dimension& thicknes...
jwowillo/band
band/interface.cc
#include "band/interface.h" #include <cmath> #include "band/interface/raylib_interface.h" namespace band { bool operator==(const Dimension& a, const Dimension& b) { return a.scalar == b.scalar && a.unit == b.unit; } bool operator!=(const Dimension& a, const Dimension& b) { return !(a == b); } bool operator==(c...
jwowillo/band
example/control.cc
#include <iostream> #include "band/all.h" #include "band/asset/font/helvetica.font.h" #include "example/icon.image.h" int main() { std::unique_ptr<band::Interface> created_interface = band::DefaultInterface(); band::Interface& interface = *created_interface; interface.SetTitle("control"); interface.SetTarget...
jwowillo/band
band/control.cc
<gh_stars>0 #include "band/control.h" namespace band { void Update( const Point& position, const Interface& interface, Control& control) { control.Update(position, interface); } void DrawFrame( const Color& clear_color, const Point& position, Interface& interface, Control& control) { interface.St...
jwowillo/band
band/control/rectangle.cc
#include "band/control/rectangle.h" namespace band { namespace control { void Rectangle::SetArea(const ::band::Area& area) { area_ = area; } ::band::Color Rectangle::Color() const { return color_; } void Rectangle::SetColor(const ::band::Color& color) { color_ = color; } ::band::Area Rectangle::Area(const In...
jwowillo/band
band/control/fps.cc
<reponame>jwowillo/band #include "band/control/fps.h" namespace band { namespace control { ::band::Area Fps::Area(const Interface&) const { return ::band::Area{}; } void Fps::Update(const Point&, const Interface&) { } void Fps::Display(const Point& position, Interface& interface) { interface.DrawFps(position); ...
jwowillo/band
band/scope.cc
#include "band/scope.h" namespace band { Scope::Scope(const std::function<void()>& f) : f_{f} { } Scope::~Scope() { f_(); } } // namespace band
jwowillo/band
example/simple.cc
<gh_stars>0 #include "band/all.h" #include "band/asset/font/helvetica.font.h" #include "example/icon.image.h" int main() { std::unique_ptr<band::Interface> created_interface = band::DefaultInterface(); band::Interface& interface = *created_interface; interface.SetTitle("simple"); interface.SetTargetFps(60u); ...
jwowillo/band
band/control/texture.cc
#include "band/control/texture.h" #include <iostream> namespace band { namespace control { void Texture::CaptureControl(Interface& interface, Control& control) { if (texture_id_.has_value()) { CleanUp(interface); } area_ = control.Area(interface); texture_id_ = interface.CreateBlankTexture(area_); in...
jwowillo/band
band/interface/raylib_interface.cc
<gh_stars>0 #include "band/interface/raylib_interface.h" #include <cmath> #include "raylib.h" #include <iostream> #define STBI_IMAGE_IMPLEMENTATION #include "external/stb_image.h" #define STBTT_STATIC #define STB_TRUETYPE_IMPLEMENTATION #include "external/stb_truetype.h" namespace band { namespace interface { na...
jwowillo/band
band/control/label.cc
<filename>band/control/label.cc #include "band/control/label.h" namespace band { namespace control { ::band::Text Label::Text() const { return text_; } void Label::SetText(const ::band::Text& text) { text_ = text; } Dimension Label::FontSize() const { return font_size_; } void Label::SetFontSize(const Dimens...
StefanoLusardi/clip
single_header/CommandLineInputParser/clip.hpp
#pragma once #include <utility> #include <optional> #include <string> #include <vector> #include <algorithm> #include <string_view> #include <stdexcept> #include <regex> #include <iostream> #if defined(__GNUC__) /* ** Workaround to fix GCC libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415 ** Proposed...
StefanoLusardi/clip
include/CommandLineInputParser/CommandLineParser.hpp
<reponame>StefanoLusardi/clip<gh_stars>1-10 #pragma once #include "Api.hpp" #include "OptionalArgument.hpp" #include <algorithm> #include <string_view> #include <iostream> #if defined(__GNUC__) /* ** Workaround to fix GCC libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90415 ** Proposed fix is based on: ...
StefanoLusardi/clip
include/CommandLineInputParser/OptionalArgument.hpp
#pragma once #include "Api.hpp" #include "ArgumentValue.hpp" #include <optional> #include <string> #include <vector> namespace clip { template <typename T = std::nullptr_t> class CLIP_API OptionalArgument { public: ~OptionalArgument() = default; explicit OptionalArgument(const std::vector<std::string>& name...
StefanoLusardi/clip
tests/Test_OptionalArgument.cpp
<filename>tests/Test_OptionalArgument.cpp #include "gtest/gtest.h" #include <CommandLineInputParser/clip.hpp> TEST(OptionalArgument, OptionalArgumentNameSingle2) { const std::string argNames { "argname" }; clip::OptionalArgument optArg({argNames}); EXPECT_EQ(optArg.names().size(), 1); EXPECT_EQ(optArg.names().fro...
StefanoLusardi/clip
examples/MixedArgs.cpp
<gh_stars>1-10 #include <CommandLineInputParser/clip.hpp> #include "ExampleUtils.hpp" int main(int argc, char** argv, char** env) { clip::utils::dumpRawInput(argc, argv, env); clip::CommandLineParser clp; clip::OptionalArgument optA({ "a", "optional_a" }, "A description", clip::value<std::string>().isRequired(tru...
StefanoLusardi/clip
examples/PositionalArgs.cpp
#include <CommandLineInputParser/clip.hpp> #include "ExampleUtils.hpp" int main(int argc, char** argv, char** env) { clip::utils::dumpRawInput(argc, argv, env); clip::CommandLineParser clp; clip::PositionalArgument posArg("debug"); clp.addPositionalArgument(posArg); clp.addPositionalArgument({ "verbose" }); ...
StefanoLusardi/clip
src/Match.hpp
<filename>src/Match.hpp #pragma once #include <stdexcept> namespace clip { class CommandLineParser::Match { public: enum class Index { Full, Dash, Name, Equal, Value, SIZE }; void next() { if (_index == Index::SIZE) { throw std::out_of_range("Match::Index next() has been called after Match::Index::SIZE"...
StefanoLusardi/clip
examples/OptionalArgs.cpp
#include <CommandLineInputParser/clip.hpp> #include "ExampleUtils.hpp" int main(int argc, char** argv, char** env) { clip::utils::dumpRawInput(argc, argv, env); clip::CommandLineParser clp; clip::OptionalArgument optA({ "a", "a_opt" }); clip::OptionalArgument optB({ "b", "b_opt" }, "B description"); clip::Optio...
StefanoLusardi/clip
include/CommandLineInputParser/clip.hpp
<filename>include/CommandLineInputParser/clip.hpp #pragma once #include <CommandLineInputParser/ArgumentValue.hpp> #include <CommandLineInputParser/OptionalArgument.hpp> #include <CommandLineInputParser/CommandLineParser.hpp>
StefanoLusardi/clip
src/CommandLineParser.cpp
#include "CommandLineInputParser/CommandLineParser.hpp" #include "Match.hpp" #include <regex> #ifndef CLIP_COMPILED_LIB #error Please define CLIP_COMPILED_LIB #endif namespace clip { void CommandLineParser::parse(int argc, char** argv) { _exePath = std::string(argv[0]); for (int i = 1; i < argc; ++i) { p...
StefanoLusardi/clip
tests/Test_ArgumentValue.cpp
#include "gtest/gtest.h" TEST(ArgumentValue, ArgumentValueTest) { EXPECT_EQ(1 + 1, 2); }