'Invalid memory access' while reading json file from another project

I have a dll in C++ which is used for behaving like smartcard. I wrote a JSON file for receiving data and responsing wanted response. It looks like this: { "00xxxxxx" : ["aaaaaaaaaaaaaaaaa", { "00yyyyyyyyyy" : ["bbbbbbbbbbbbbbbb", { "00zzzzzzzzz" : ["9000", {}] }] }] } My CommandHandler.cpp file receiving the command from another application. It… Read More 'Invalid memory access' while reading json file from another project

Using Powershell to recursively output folder contents to separate .txt files

I’m attempting to use Powershell to output my folder contents to a text file recursively, sorted by LastWriteTime. My directory structure looks like this: ProjectData Proj1 file1.txt file2.txt Proj2 image1.jpg file1.txt I’m attempting to get an output that looks like this: Proj1.txt (contents of txt file to include file1.txt, file2.txt) Proj2.txt (contents of txt file… Read More Using Powershell to recursively output folder contents to separate .txt files

How to change date format with Sed command?

I am trying to change the date format from YYYY-MM-DD to DD/MM/YYYY in all lines of a file using the sed command. For example: 2021-04-01 00:15,69,0,38,1,1,0,0,0,32 should be: 01-04-2021 00:15,69,0,38,1,1,0,0,0,32 I have tried the following using regular expressions: sed -E ‘s,[0-9]{4}-[0-9]{2}-[0-9]{2},\3-\2-\1,g’ unfortunately this does not work and gives me an error (not defined in the… Read More How to change date format with Sed command?

subprocess.run only accepting first argument

Using Python 3.10.6 trying to pass an argument to a command line opened via subprocess.run, I’ve tried toggling shell=True/False, as well as passing the second argument with the input variable, no luck. here is the relevant code: cmds = ([‘cmd’,’echo hello’]) cmd_result = subprocess.run(cmds, shell=False, check=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True ) print(cmd_result.args) [‘cmd’, ‘echo hello’]… Read More subprocess.run only accepting first argument

How to edit a file with SED?

I am running docker on a Virtual Machine on an Amazon AWS EC2 instance and I want to edit one file (application.properties) which lies in the following directory: root@e2afc27e858e:/score-client/conf/applications.proteries The docker image does not seem to contain vim/vi, nano or emacs. That’s why I should edit the file with "sed". In particular, in the application.properties… Read More How to edit a file with SED?