Loading extensions into SQLite at COMPILE TIME - sqlite

Similar to how you can integrate the SQLite JSON1 extension into the app at compile-time with -DSQLITE_ENABLE_JSON1, how do I load an extension of my own at compile-time, without having to .load my-extension in the SQLite shell?

Just copy your extension C code file into some SQLite checkout, and in src/shell.c.in, just put in INCLUDE <path> where <path> is the path to your extension C code. Hopefully, it's all in one file.

Related

CLI method to find all nested jar files containing the log4j library

I have read here that the log4j library can be "nested" within other files that are deployed with an application.
I can find files with 'log4j' in the filename but don't know how to find log4j in these "nested jars". Is there a way to do this from the command line?
update
This question has moved to SuperUser here.
Run the following command search for log4j jar files in an application:
dir /s /b <application_root>\*log4j*.jar
If any files are displayed, check the version number that is part of the file name. For example Tomcat\webapps\ROOT\WEB-INF\lib\log4j-core-2.15.0.jar is version 2.15.
If the version is between 2 and 2.14 (2.15 is not vulnerable), the application is vulnerable to CVE-2021-44228 and one of the following mitigations must be applied.

A .jar file does not run after building it

Actually, I'm trying to add new language to Streama Media Server. I downloaded source code, added new language file (as guided here). After that, I want to build a jar with that project, I build it with IntelliJ Idea 2021.1 (here is how I did). So, When I run that jar file (in Ubunt 20.04), it fails and gives this error: Screenshot
When you have made adjustments to the source code, it is likely that you will want to create a new .jar file and deploy it on your server. For this, you can use a simple command:
# for unix based systems
**./gradlew assemble**
# for windows
**./gradlew.bat assemble**
This will create 2 new .jar files under build/libs,
streama-{version}.jar
streama-{version}.jar.original
all you will need is the streama-{version}.jar.
This file is an executable, so you can just copy it into your deployment directory / your server and start it as usual.

IAR project variable like $PROJ_DIR$

Is there any possibility in IAR to add additional project variable like $PROJ_DIR$ to specify my project environment?
I like to keep my project portable and adaptable.
Of course there are, according to the manuals:
Variable / Description
$CONFIG_NAME$ The name of the current build configuration, for example Debug or Release.
$CUR_DIR$ Current directory
$CUR_LINE$ Current line
$DATE$ Today’s date
$EW_DIR$ Top directory of IAR Embedded Workbench, for example c:\program files\iar systems\embedded workbench 6.n
$EXE_DIR$ Directory for executable output
$FILE_BNAME$ Filename without extension
$FILE_BPATH$ Full path without extension
$FILE_DIR$ Directory of active file, no filename
$FILE_FNAME$ Filename of active file without path
$FILE_PATH$ Full path of active file (in Editor, Project, or Message window)
$LIST_DIR$ Directory for list output
$OBJ_DIR$ Directory for object output
$PROJ_DIR$ Project directory
$PROJ_FNAME$ Project filename without path
$PROJ_PATH$ Full path of project file
$TARGET_DIR$ Directory of primary output file
$TARGET_BNAME$ Filename without path of primary output file and without extension
$TARGET_BPATH$ Full path of primary output file without extension
$TARGET_FNAME$ Filename without path of primary output file
$TARGET_PATH$ Full path of primary output file
$TOOLKIT_DIR$ Directory of the active product, for example c:\program files\iar systems\embedded workbench 6.n\arm
$USER_NAME$ Your host login name
$ENVVAR$ The environment variable ENVVAR. Any name within $_ and _$ will
be expanded to that system environment variable.
If you go to Tools > Configure Custom Argument Variables you can add variables that you can address with $VARIABLE_NAME$. Not sure if that's exactly what you were looking for.
As a caution, if you are using IarBuild.exe to build from the command line, the workspace or global values set from "Configure Custom Arguments Variables" are not included in the project files (.ewp) and thus is not expanded by IarBuild.exe at build time. This is not an issue if you only use the IDE to build.
I found a reason for my problem (but it givs another one):
I define a windows "path-variable" like LIB_PATH and put it in the IAR project file with $_LIB_PATH_$.This works as long until i save the IAR-project. Then IAR sets all paths realive to $PROJ_DIR$ :-(

How to deploy audio/video files together with iOS/Android app? Using Qt 5.3

I have learned that I can not bundle audio/video files within resource file in order to play them in my qml.
So, I have tried to use DEPLOYMENTFOLDERS in .pro file it does not copy the files.
It seems that QtCreator does not generate necessary code contents using DEPLOYMENTFOLDERS in .pri file.
Is there an easy way to say copy these files into build output location?
Visual studio C# has this option just saying one true/false to do this.
It should not be this hard. :-)
"Is there an easy way to say copy these files into build output location?" - this is a different task. You may achieve that with QMAKE_POST_LINK and writing a Makefile rule to copy the required files to the the output directory.
To copy the required file into the iOS bundle use QMAKE_BUNDLE_DATA. See https://qt-project.org/doc/qt-5-snapshot/platform-notes-ios.html
To copy the required file into the Andoid APK you need to write INSTALLS rules like that:
android {
...
assets.path = /assets
assets.files += LIST_OF_FILES
INSTALLS += assets
}

mxmlc embedding assets

I'm trying complie my project via mxmlc this way:
[prj_folder]\src>mxmlc mymxml.mxml -library-path+=../libs -sp+=..\assets
and i get such errors:
[prj_folder]\src\view\controls\controlname.mxml(7): Error: Problem finding external st
ylesheet: assets/cssname.css
<fx:Style source="assets/cssname.css"/>
[prj_folder]\src\view\constants\Images.as(24):
col: 3: Error: Unable to transcode
assets/ icons/icon1.png.
how to include assets for the compiler?
Flash Builder preprocesses the files.
For a directory structure like this:
projectdir/src/Main.mxml
projectdir/src/views/SomeView.mxml
projectdir/src/assets/MyImage.png
And if SomeView.mxml references assets/MyImage.png, Flash Builder will allow this:
#Embed('assets/MyImage.png')
because it is preprocessed to /assets/MyImage.png by the IDE, but ant/maven + mxmlc won't do that.
#Embed('/assets/MyImage.png')
works for both Flash Builder and mxmlc.
If you are using a relative path like this:
#Embed('../assets/MyImage.png')
try changing it to this, odd as it may seem:
#Embed('/../assets/MyImage.png')
The leading / gets translated to "my src directory", and mxmlc does the remainder of the path calculation from there.
Hope this helps.
This is a directory setup issue; not a compiler error. And you aren't actually embedding assets; just referencing them.
When using Flash Builder, the file "assets/cssname.css" should be relative to the main application file. I believe the same should occur if you're using the command line compiler.
Does your source directory have an assets subdirectory? Is the cssname.css file inside it?

Resources