This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Play with Linux GPIO API v2 | |
// based on https://github.com/torvalds/linux/tree/v6.1/tools/gpio | |
// compile: g++ -std=c++17 gpio_v2.cpp -o btn-watch-v2 | |
#include <iostream> | |
#include <iomanip> | |
#include <string> | |
#include <string_view> | |
#include <chrono> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##@brief grpc_generate_cpp | |
##@param in,required PROTO_FILES | |
##@param in,optional PROTO_INCLUDES | |
##@param in,required OUT_DIR | |
##@param out,required OUT_SRCS | |
##@param out,required OUT_HDRS | |
function(grpc_generate_cpp) | |
set(args OUT_SRCS OUT_HDRS OUT_DIR) | |
set(inp_args PROTO_FILES PROTO_INCLUDES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@rem configure O3DE for windows | |
setlocal | |
set ROOT=C:\root\path\for\o3de | |
set INSTALL=%ROOT%\o3de-bin | |
set BUILD=%ROOT%\o3de-build | |
set PACKAGES=%ROOT%\o3de-packages | |
set SOURCE=%ROOT%\o3de | |
set GENARATOR=-G "Visual Studio 16 2019" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://en.wikipedia.org/wiki/Merge_sort | |
#include <iostream> | |
#include <iomanip> | |
#include <cstddef> | |
#include <cassert> | |
using std::size_t; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
auto comparePoints(const QPointF& a, const QPointF& b) | |
{ | |
return a.x() < b.x() || (a.x() == b.x() && a.y() < b.y()); | |
} | |
auto convex_hull_graham(QPolygonF& points) | |
{ | |
if (points.size() <= 1) return points; | |
QPolygonF result, up, down; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "buffer.hxx" | |
#include <filesystem> | |
#include <fstream> | |
#include <ios> | |
namespace fs = std::filesystem; | |
namespace Scan | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "numbereditor.hxx" | |
namespace Schematics::Ui::Widgets | |
{ | |
NumberEditor::NumberEditor(QWidget *parent) | |
: QDoubleSpinBox(parent) | |
{ | |
setSuffix(" mm"); | |
setDecimals(1); | |
setAlignment(Qt::AlignRight); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 3.10) | |
project(examples LANGUAGES CXX) | |
set(CMAKE_CXX_STANDART 14) | |
set(CMAKE_CXX_STANDART_REQUIRED ON) | |
set(CMAKE_AUTOUIC ON) | |
set(CMAKE_AUTORCC ON) | |
set(CMAKE_AUTOMOC ON) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// task: https://en.wikipedia.org/wiki/Fizz_buzz | |
// compile: g++ -std=c++14 -Wall -Wpedantic -Werror fizz_buzz.cxx -o fizz_buzz | |
#include <iostream> | |
#include <string> | |
namespace | |
{ | |
std::string solve(int num); | |
} | |
int main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// task: create two queues that will be located in one array of a fixed size | |
// solution: create a pool of blocks in this array. | |
// http://www.cyberforum.ru/algorithms/thread2569313.html | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <assert.h> | |
// настройки типов |
NewerOlder