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
int my_other_func(diffdata_t *dd1, long off1, long lim1) | |
{ | |
if (my_test_cmp(dd1,off1,lim1)>0) return 1; | |
if (my_test_cmp(dd1,off1,lim1)<0.5) return -1; | |
return 0; | |
} | |
int my_test_cmp(diffdata_t *dd1, long lim1, diffdata_t *dd2) | |
{ |
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
/* Is useful for searching empty slot */ | |
#include <cstring> | |
#include <cstdio> | |
#include <cassert> | |
#include <chrono> | |
#include <cstdlib> | |
#include <exception> | |
using namespace std; |
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 <iostream> | |
using namespace std; | |
string trimLeft(const string& str) | |
{ | |
const auto strBegin = str.find_first_not_of(" \t"); | |
return str.substr(strBegin, str.length() - strBegin); | |
} | |
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://stackoverflow.com/questions/73446872/read-last-empty-line-of-a-text-file-in-c/73458476#73458476 | |
/* | |
* it distinguishes between lastline with and wihout \n | |
* getline().good() returns true if after line is newline char. | |
* Push to vector last not good(), thus I must check if file is not empty (peek()) | |
* */ | |
#include <iostream> | |
#include <fstream> | |
#include <vector> |
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
/**************************************************************************** | |
** | |
** Created by Andrzej Borucki on 2022-08-20 | |
** | |
** This file is part of the EdiQ project | |
** see file LICENSE of https://github.com/ideorg/EdiQ | |
** | |
****************************************************************************/ | |
#include "Popup.h" |
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 "dialog.h" | |
#include <QVBoxLayout> | |
#include <qxviewer.h> | |
#include <QLineEdit> | |
#include <QPushButton> | |
Dialog::Dialog() | |
{ | |
QVBoxLayout *mainLayout = new QVBoxLayout; |
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.7) | |
project(minimal_std) | |
set(CMAKE_CXX_STANDARD 11) | |
set(wxWidgets_ROOT_DIR /usr/include/wx-3.0) | |
find_package(wxWidgets COMPONENTS core base net REQUIRED) | |
include(${wxWidgets_USE_FILE}) | |
add_definitions("-Werror=return-type -H") |
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 <stdexcept> | |
#include "BitOutput.h" | |
BitOutput::BitOutput() : | |
currentByte(0), | |
numBitsFilled(0) | |
{} | |
void BitOutput::write(int b) { | |
if (b != 0 && b != 1) | |
throw std::domain_error("Argument must be 0 or 1"); |
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 <stdexcept> | |
#include "FenwickFrequencyTable.h" | |
FenwickFrequencyTable::FenwickFrequencyTable(const std::vector<uint32_t>& freqs) { | |
if (freqs.size() > UINT32_MAX - 1) | |
throw std::length_error("Too many symbols"); | |
uint32_t size = static_cast<uint32_t>(freqs.size()); | |
if (size < 1) | |
throw std::invalid_argument("At least 1 symbol needed"); |
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 <QApplication> | |
#include <QDebug> | |
#include <QFile> | |
#include <QTextBlock> | |
#include <QFileDialog> | |
#include <QFontDatabase> | |
#include <QMenu> | |
#include <QPainter> | |
#include <QPalette> | |
#include <QRegExp> |
NewerOlder