Adding to the java.library.path or jna.library.path on OSX - rococoa

I am trying to get Rococoa set up in order to attempt to incorporate a simple Cocoa widget into my java application, but the instruction tell me to add their bin directory to my jna.library.path variable but I do not know how to find this on OSX. How would I do this?

Related

WebkitGtk application is not loading file URL

I am building a kiosk application using webkitgtk on the raspberry pi 4.
This application will not be connected to the internet and all the html,css, javascript for the UI are all located on the local filesystem.
I am using buildroot to setup the Linux system, starting with the pi 4 defconfig provided in buildroot.
I have enabled all the packages needed to get webkitgtk running.
Also, the kiosk application has been tested on my desktop, using the same software stack and it works
However, when i try to launch the application on the raspberry pi, a blank page pops up. I have played around with the WebKitWebSettings object associated with my WebKitWebView by enabling local file access. It still shows up a blank screen.
Also included in my pi4 application bundle is a simple gtk3+ application. This launches successfully!
I will really appreciate some pointers as to why this is happening as i have sort of reached a dead end
UPDATE
I enabled the MiniBrowser app that comes with the Webkitgtk package.
Entering the local url, The page does not load. It only gives me a message at the top saying "Successfully downloaded".
It seems to be treating my input as a download
UPDATE 2
After some more experimenting, i was finally able to get webkitgtk working on the pi 4.
The problem seems to originate from using the webkit_web_view_load_uri() api.
It does not seem to recognize my html document as a web page.
I got around it using the webkit_web_view_load_html() call. This included some hacks by first reading in the contents of the html doc into a character buffer, and passing it to webkit_web_view_load_html().
You also have to provide a base path to this function call to be able to resolve all the urls (scripts, css, images etc) in your html document.
Another problem i haven't been able to work around is, SVG images are not loading in webkitgtk. I have used jpg formats and they work. I suspect this my be due to a configuration switch in building webkigtk
It's hard for me to figure out what might be happening without having access to your environment and settings. My gut feeling is that pages are showing blank because perhaps some shared libraries are missing. You can check that with:
$ ldd WebKitBuild/GTK/Release/bin/MiniBrowser
I am using buildroot to setup the Linux system, starting with the pi 4 defconfig provided in buildroot.
There's a buildroot repository for building WPE for RPi. WPE (WebPlatform for Embeded) is like WebKitGTK but doesn't depend on GTK toolkit. Another important difference is that WPE runs natively on Wayland.
If you're interested in having a webapp embedded in a browser running in a device with limited capabilities, WPE is a better choice than WebKitGTK. The buildroot repo for building WPE for RPi is here:
https://github.com/WebPlatformForEmbedded/buildroot
There's is also this very interesting step-by-step guide on how to build WPE for RPi3:
https://samdecrock.medium.com/building-wpe-webkit-for-raspberry-pi-3-cdbd7b5cb362
I'm not sure whether the buildroot recipe would work for RPi4. It seems to work for all previous versions, so you might be stepping in new land if you try to build WPE on RPi4.
If you have an RPi3 available I'd try to build WPE for RPi3 first, and make sure that works. Then try for RPi4.

Automatically defining C/C++ include path on WSL Visual Studio Code

When using the C/C++ extension for Visual Studio Code with WSL, it will never refer to /usr/include/ unless you create a project file any time, as you have to allow it to create a local config file called c_cpp_properties.json. This means you simply cannot run standalone C files unless you create a workspace around it.
Is there some way to automate this, even a little? It's very annoying having to redefine my standard includes every time I reopen the program.
Ideally I would like to set this up such that I can just work with my C files standalone rather than as a project as I am frequently using university assets and it's very annoying to have to create a project to work with any demo they give me. I have looked everywhere but just can't find any kind of global setting where I can tell the extension to refer to /usr/include/ - with or without a local config file for the project.
Thanks

How to fix function (that validates input) from not reading a text file? [duplicate]

Trying out the Clion EAP on the Mac. How does one change the current working directory for a launched program? It appears to be set to the output directory of the binaries.
This can be changed via the Run -> Edit Configurations... dialog, just like Idea.
The mix of needing to make changes to CMakeLists.txt for so much of the configuration just threw me, and I've been hunting for a way to change it there, but this bit at least is consistent with the other IDEs, which is good.
Hopefully they'll improve the rest of the Project Settings in a similar fashion.
The "Working Directory" is where the executable starts. Modifying the "Working Directory" in the Configurations setting tells Clion to change to the "Working Directory" after the executable starts execution.
If you want to change where the executable starts execution you will need to add a line to the CMakesLists.txt file.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(TimeServer ${SOURCE_FILES})
Position in the cmakes file is important. If you add the set command after the add_executable it will not work. It must come before.
These answers are relatively old. Not sure when the feature was added but there's a very nice UI way to set the current working directory now.
I made a YouTube tutorial for my COSC1030 (Beginning C++) students but the solution is the same for everyone:
https://youtu.be/dTtZEAfh_LM
If you know your CLion fairly well and don't need a demo, here's a short-hand version: Edit Configurations (from drop-down menu at top right of screen), enter the directory you want to use in Working Directory or select via "..." pop-up.

Obfuscate Silverlight library using Dotfuscator

I'm attempting to use Dotfuscator 4.7.1000 to obfuscate a Silverlight library that is strongly named. When I attempt to do so, I get the following error message:
External type not found
System.Data.Services.Client.LoadCompletedEventArgs,System.Data.Services.Client,
Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
I have tried adding this assembly to the GAC, and have tried adding user defined assembly load paths to the configuration to locations where this assembly is located to no avail.
I then tried adding System.Data.Services.Client to the input assemblies and ran it again. This time it gets further, but ultimately I get:
Warning: Password protected Strong Name files are not supported
sn returned 1.
It appears as though it is attempting to run sn.exe on System.Data.Services.Client.dll with my local key. I've tried excluding this assembly from any obfuscation tasks, but it continues to do so.
Is there something I'm missing when trying to obfuscate this library? Is there some other way to directly point it to the DLL it can't seem to find that I don't know about? Or can I include the DLL in the project without it trying to obfuscate the Silverlight library?
And for the moment, please no suggestions on alternate obfuscators. My company has a license for Dotfuscator and I'd like to get this running using that. Thanks!
Somehow I must have been screwing up my user defined assembly load paths. As soon as I re-added the path to the Silverlight 4.0 client DLLs everything worked without having to reference System.Data.Services.Client.

Eclipse: choosing a default debugger for all new C projects

Whenever I start a new project, I have to go through setting up the debugger with Eclipse time and time again before I can use it. Isn't there a default setting for all new C projects I can change?
I'm not sure exactly what you mean by "setting up the debugger" (perhaps you can clarify), but under "Preferences -> Run/Debug -> Launching -> Default Launchers" you should be able to select your preferred launcher for different kind of launch modes. This can also be selected individually for each launch configuration.
Typically it is up to the toolchain and/or project to determine which debugger/launcher is suitable to use for that specific project, but I know there is a bug in CDT which prevents toolchains from properly specifying the default launcher to use.
I only use Eclipse for Java, so I can't give you an authoritative answer. But since no one else seems to be answering:
Java projects have a (more or less) hidden file in the project directory called .project and another one called .settings . I'm not sure if this would apply to the C environment as well, but it seems likely. You may want to look at the set of such "hidden" files for a well set up project and a virginal project side by side to find out which settings make the difference.
Given that information, you may be able to simply edit (perhaps with some assistance from a script you can write yourself) the file(s) in question to do the configuration textually without a lot of mouse clicking.

Resources