NET 6 – Nullability of reference types warning

In NET 6, I have a repository asynchronously returns string, which may be sourced from REST API or text file. Since the result could be null, the return type is nullable string in a task Task<string?>: public interface IFooRepository { Task<string?> FetchAsync(string path); } One of a concrete class of the repository would look like:… Read More NET 6 – Nullability of reference types warning

Remove items from one list if they contain strings from another list

I’m looking for the most efficient way to remove items from one list if they contain strings from another list. For example: B list contains: TomWentFishing SueStayedHome JohnGoesToSchool JimPlaysTennis A list contains: GoesToSchool SueStayed C list should contain: TomWentFishing JimPlaysTennis I’ve used this code, but it takes up a lot of time as the lists… Read More Remove items from one list if they contain strings from another list

QProcess: The system cannot find the file specificed even when full path is provided

Here is my full code: #include <QCoreApplication> #include "iostream" int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QProcess process; QString path = "C:\\Windows\\System32\\wbem\\WMIC.exe"; QString arg = "cpu get name"; QStringList arguments; arguments << arg; //process.start(path,arguments); process.start(path + " " + arg); //qDebug() << "Started"; std::cout << "Started" << std::endl; if (!process.waitForFinished()){ qDebug() << "ERROR"… Read More QProcess: The system cannot find the file specificed even when full path is provided

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

Not getting all the keys of nested object using Javascript

I am trying to fetch all the keys of one nested object using Javascript but as per my code its not working as expected. I am explaining my code below. let jsonObj = { “service”:[ { “name”:”restservice”, “device”:”xr-1″, “interface-port”:”0/0/2/3″, “interface-description”:”uBot testing for NSO REST”, “addr”:”10.10.1.3/24″, “mtu”:1024 } ], “person”: { “male”: { “name”: “infinitbility” },… Read More Not getting all the keys of nested object using Javascript

How to get ServiceClientCredentials after migrating from ADAL to MSAL

The support for ADAL ends on June 30, 2022 and Microsoft recommends migrating applications to MSAL. During migration, I encountered a difficulty migrating a code that accesses Data Lake Storage from ADAL to MSAL. My almost-working attempt is: // Before migration (authenticate using obsolete ADAL) ClientCredential clientCredential = new ClientCredential(clientId, clientSecret); ServiceClientCredentials credentials = await… Read More How to get ServiceClientCredentials after migrating from ADAL to MSAL