Compiling SQL Archive Tool - c++

I am using SQLite database and I want to archive database by using SQL Archive Tool (SQLAR) but i don't know how to compile. I found only this document which is given below. Could you help me to compile and use SQLAR Tool to use it ?
https://www.sqlite.org/sqlar/tree?ci=trunk&expand

After these steps are done, i can compress the database.
Download source files. (https://www.sqlite.org/sqlar/vinfo?name=15adeb2f9a1b0b8c)
Copy files to your server.
Write "make" command in your sqlar path which includes source files.
Write command "./sqlar archive_name database_name" to archive your database.

Related

Proper way to zip xlsx-file from directory using Info-Zip's Zip utility

I’m using Zip utility from the Info-Zip library to compress the tree of catalogs to get xlsx-file.
For that I’m using the next command:
zip -r -D res.xlsx source
source - contains the correct directory tree of the xlsx file.
But if you then look at the resulting file structure, the source directory will be included in the paths of all files and directories at the top level, and MS Office Excel will not be able to open this file. This is a well known problem. To avoid it zip.exe needs to be inside of the dest directory.
The problem is that I want to use the source code of this utility in my project, so this leads me to be unable to call my process, which will be responsible for compressing directories, to get xlsx files from these directories.
I’ve tried to find a place in the zip source code, where the parent catalog appending on the top-level happens. But seems
it is done implicitly.
Who can suggest how it can be done?

c++ embedded SQL precompile with READ ONLY permission

Is it possible to
db2 connect somedb user myuser using mypwd
db2 precompile myapp.sqx OUTPUT myapp.cxx
when I only have read permission to the REMOTE DB2 database? I'm ONLY trying to select I'm not trying to write to the database, yet the precompile command is complaining that I don't have permission to "create in" ... What can I do differently such that I can query the database using c++ (I already have a ton of code I inherited that uses embedded sql precompiling, but the person who wrote it has write permission to the table, and I don't, so I'm hoping to adapt existing code somehow)
You need to use the BINDFILE option for the PRECOMPILE command if you do not have the ability to create packages in the database:
db2 "precompile myapp.sqx BINDFILE USING myapp.bnd OUTPUT myapp.cxx"
This will generate a file, myapp.bnd that you can use (or provide to your DBA) to create the package at a later date (along with the myapp.cxx file).
Please make sure that you track your bind files carefully with your precompiled code and binaries. The bind files and generated source code are paired, so if you supply the wrong bind file with your binary you'll end up with version mismatch errors.

Cannot open include file: 'occi.h': No such file or directory

I am trying to compile an existing C++ project but get this error:
fatal error C1083: Cannot open include file: 'occi.h': No such file or directory
What I did is I went to this link:
http://www.oracle.com/technetwork/topics/winsoft-085727.html
and downloaded the first (basic) package.
Then unzipped the folder and modified PATH variable like this:
C:\Program Files\Atmel\sam-ba_2.12\drv\;C:\Program Files\Atmel\sam-ba_2.12;C:\Program Files\ATMEL Corporation\AT91-ISP v1.4\Library;C:\MSYS\1.0\bin;C:\MSYS\1.0\local\bin;C:\cygnus\cygwin-b20\H-i586-cygwin32\bin;D:\instantclient_12_1
last being path to oracle.
But I still get the error, can someone help?
PS I noticed in my project there are lines like:
#include "occi.h"
Maybe it is because of this?
The basic package isn't enough. Its description says "All files required to run OCI, OCCI, and JDBC-OCI application" (emphasis added); with just that you can run an OCI program, but you can't compile one. You need to download other instant client components. Specifically for the occi.h header you need the fifth file listed:
*Instant Client Package - SDK: Additional header files and an example makefile for developing Oracle applications with Instant Client
If you download and unzip that in the same place you unzipped the basic package, your instant client directory will gain an sdk folder, which includes all the OCI header files.
You'll then need to compile with -I D:\instantclient_12_1\sdk\include so your compiler knows where to look for the occi.h and other header files. You may also need -L to tell it where to find the Oracle libraries; presumably you already have -lclntsh and/or -locci, which refer to libraries you should have already from the basic package.

7zip file compression mode store using command prompt is not working?

I need to compress my data folder using 7zip (compression mode store) from my nant script. If I compressed from command prompt its not working properly. It taking some other compression mode.
This is my code
7zip.exe a mydatafolder.7z -ptest -mx0 mytarget
Please help me.
Thanks
Which version of 7zip.exe?
Which compression mode is used in the existing 7z file?
Can you attach\link to a sample 7z archive that you have tried and behaves unexpectedly when trying to add another file without compression?
I am not sure if you can use mixed compression mode in a 7z archive or not.

Is there a way to get a test results and coverage html report from MSTest

I'd like to be able to produce a HTML based report from the Results.trx and data.coverage files that MSTest creates. Ideally this would just list any failures, and show some basic coverage stats.
Does anyone know of a tool that does this?
you can use TRXER tool to generate HTML reports from trx file. Download TrxerConsole.exe file from here
Build/Rebuild the project to create .dll file.
If your project name is UnitTest1 then the .dll file name will be UnitTest1.dll. Go to the location of .dll like
C:\Users\NAME\source\repos\UnitTest1 \UnitTest1
\bin\Debug\netcoreapp3.1\UnitTest1.dll
Open Developer command prompt of Visual studio 2019
Run command to set the location
cd
C:\Users\NAME\source\repos\UnitTest1\UnitTest1\bin\Debug\netcoreapp3.1\UnitTest1.dll
Run the Command to Generate trx file:
vstest.console.exe UnitTest1.dll /logger:trx
Trx file will be generated in the folder TestReults which is present in the same location where project dll file is present.
If TrxerConsole.exe is in downloads then run the command to convert into HTML.
Path of trxerconsole.exe file then space then Path of trxfile as below
C:\Users\NAME\Downloads\TrxerConsole.exe C:\Users\NAME\source\repos\DesktopWithMSTest\DesktopWithMSTest\bin\Debug\netcoreapp3.1\TestResults\TestResult.trx
HTML file will be generated in same TestResults Folder.
link to refer
your Reports will look like:
Actually we did that using the open source tool Trx2Html
Its really simple - gets trx file and output html. There are specific versions for VS2005 trx and VS2008 trx.
You can publish to the report server and then the reports will be available from a web interface.
( I did it in PowerShell)
You need this dll
Microsoft.VisualStudio.Coverage.Analysis.dll
then this line will turn .coverage into an xml file (which the .trx already is)
$dataStore = ([Microsoft.VisualStudio.CodeCoverage.CoverageInfoManager]::CreateInfoFromFile("$homeDir\tests.coverage")).BuildDataSet($null)
$dataStore.WriteXml("$homeDir\Coverage.xml")
Then you could use the MsTest xsl file from cruisecontrol.net to put the test results in a nice html format, and I have an XSL for the coverage. WHich won't fit here. I wish they had a way to upload files. Email me alex dot hutton at hotmail, and I can get you the xsl to display that coverage
The trx files are fairly simple xml documents that can easily be processed with XSLT to produce flexible and customized reports.
If you google trx and xslt you'le find a number of examples to get you started.
I have added a codeplex project for this, you can generate the html from trx as well as add code-coverage data to the same report. http://trxtohtml.codeplex.com/
try the new trx2html.codeplex.com it's not based on XSLT, but in LINQ2XML so it's easier to extend
I am writing a simple batch file to convert your XML report into HTML
Pre-requisites
Download trx2html.exe from here
Paste it to any location on your machine where XML file is being generated
Create a report.bat file and paste the code given below
#echo off
::*****************************Constants*****************************************************************
set "trxFileName=TestResult"
set "trx2html_path=C:\Users\Desktop\0.6\TrxerConsole.exe"
::********************************************************************************************
echo ------------------------"Generating test report "----------------------------------------------
%trx2html_path% ".\Results\%trxFileName%"
echo -----------------------"Test Report Generated at location=.\Results\%trxFileName%"------------
pause
I have created a tool to generate html from trx.
The tool is available from Nuget.org.
Install as global tool:
dotnet tool install --global trxlog2html --version 1.0.0
Install as local tool:
dotnet new tool-manifest
dotnet tool install --local trxlog2html --version 1.0.0
Converting the TRX to html file:
After installation, you can convert the trx file to html file with the following command.
dotnet run trxlog2html -i [input trx file path] -o [output html file path]
See the links below for more information.
https://github.com/HikosakaRyo/trxlog2html
https://www.nuget.org/packages/trxlog2html/