How to get value from a vector by value from another vector?

I have two vectors: one contains numbers and names of things; second collects numbers that have already been showed to the user; I’m trying to make a history list of all objects that have been shown. Here is my code: class palettArchive{ private: std::vector<std::pair<int,std::string>> paletts; int palletsCounter; std::vector<int> choosen; public: //… void history(){ auto printHist… Read More How to get value from a vector by value from another vector?

Unable to read/write to file from Lua script running from HAPRoxy

I was using Lua with HAProxy to write logs into custom log file. Although my script is running totally fine. But I don’t see anything written in my text file. Here is my lua script which I am loading from HAProxy.cfg. local function foo(value) — MY CODE — file = io.open("test.lua", "a") io.output(file) io.write("The value… Read More Unable to read/write to file from Lua script running from HAPRoxy

Is there a way that with a for cicle I could run through the archives in a file in jupyter lab/python?

I’m doing an inform and with a group we run the experiment ten time and had created 10 csv files. But opening all one line of code at a time must not be the most efficient way to open and read them and I know there must be a way to open them with a… Read More Is there a way that with a for cicle I could run through the archives in a file in jupyter lab/python?

zipfile.extract throwing CrcError for .7z files

the following code I wrote to extract the files from .7z zip file. Code is throwing "Exception has occurred: CrcError". if I am specifying files one by one code works fine.In for loop it throws CrcError. selective_files = ‘folder\abc[1].txt,folder\abc[2].txt’ with py7zr.SevenZipFile(fol_doc_text, ‘r’) as archive: allfiles = archive.getnames() file_exists_list = [] for file_name in selective_files.split(","): if… Read More zipfile.extract throwing CrcError for .7z files

Print a file content from a tar.gz archive

I would like to print a single file content from a tar.gz archive. I know I can list the files from the archive like so: $ tar -tf openjdk-17.0.2_linux-aarch64_bin.tar.gz […snip…] jdk-17.0.2/lib/server/libjsig.so jdk-17.0.2/lib/server/libjvm.so jdk-17.0.2/lib/src.zip jdk-17.0.2/lib/tzdb.dat jdk-17.0.2/release <—- print the content of this file (with ‘cat’ or ‘more’) I want to print the content of the file… Read More Print a file content from a tar.gz archive