Update templates without restarting the app in CppCms - linux

In this tutorial, it says:
Dynamic linking is a little bit more tricky, but it is much more
powerful as it allows you to load skins without relinking the
application. You can even update your application without needing to
restart it.
So I decided to put it to the test, and while the app was running, I replaced libmy_skin.so file with another skin.
The skin in the running app did not change.
Is the statement above incorrect, or did I do something wrong?

You need to turn this option on:
http://cppcms.com/wikipp/en/page/cppcms_1x_config#views.auto_reload

Related

Is it possible to execute local .exe´s from angular application running in browser?

We are about to start a new project which should be like a desktop app but still run inside a browser for creating items in a system. After these items are created, an .EXE file on the LOCAL machine must be called to do some code generation. Is this possible if using Angular to develop the application or do we need third party libs for executing local .exe's?
No, this is not possible out of the box. Browsers make very sure that local executables cannot be started. You would have to look for other solutions.
One possible idea, depending on how much effort you want to invest, would be to compile the WebKit engine yourself, i.e., create a binary "wrapper" which runs the browser engine itself. Then you are free to extend it in whatever fashion you need, including adding the possibility to start local .exe's (or if those .exe's are your own applications, you could compile them right into your WebKit wrapper).

How can I run a Chrome extension in NW.js?

This question is pretty short and self explanatory. I'm wondering how I can run my Chrome extension in NW.js.
I know you can run an app in NW.js and I think you can run extensions as well?
I can't find much on the topic. Back in 2013 the way to do it seemed to be:
nw [path to manifest.json] --load-extension
Any ideas are appreciated!
Yes you can.
First off, download the extension you want. For this example I'll be using this debugging tool, which adds an additional tab in the dev tools window.
Inside your NW.js package.json file, ensure you have an entry called chromium-args.
Ensure its value contains --enable-extensions --load-extension=relative_path_to_extension_manifest.
My package.json looks like this:
After restarting the application, the extension shows up as expected:
Something I'll add is that the full Chrome API might not be available to you. I couldn't find info about what NW.js supports, but Electron definitely does not support the entire API, so this might have similar restrictions.
I also noticed you mention in the comments that you need to assign a hotkey of sorts. I'd need to know what you were trying to do, but essentially you have the option of either using a browser mechanism such as addEventListener('keydown', myHandler) or using the NW.js API depending on your exact needs.

NodeJS - Having trouble reloading external js?

I am trying to build a sort of plugin manager that can reload external source files on the fly without actually shutting down the node app. Just as a quick proof of concept is just eval'd my plugin files that simply are just functions being prototyped to a class. Everything seemed to work great, except that I cant seem to get the scoping right. The functions get evaluated and prototyped, but im not sure why the functions cant grab global vars. Does anyone have any advice on this?
Rather than manually loading the file, you could just rely on require.
Now, the only problem is that require has an internal cache and will only load modules once. However, you can force it to unload with this quick workaround:
delete require.cache[require.resolve(myPlugin)];
require(myPlugin);

Using Inno setup, how to make application appear in Most Frequently Used programs

I am using Inno Setup to create an installer for my application. Using the template scripts, I have managed to get the application to be added in the start menu (under Programs) and I have managed file associations as well so that my app is associated with certain extensions.
The only tiny thing missing to make my life perfect is that my application never appears in the most frequently used programs, even though it is by far the most common application for me to start.
Do you know if this can be fixed in inno setup somehow, or do I have to look elsewhere?
My application, by the way, is started using a batch script (startme.bat). Could this be the reason?
Grateful for any replies!

Should node.js changes be instantaneous?

Seeing how node.js is ultimately javascript, shouldn't changes to any files be seen when trying to run the app command? I've forked the yuidocjs repo on github and am trying to work my way through my local build, but for some reason my minor changes do not get picked up. I'm new to node.js so I'm not really sure what the exact conventions are.
In node.js when you require a file the source code gets interpreted. It's considered good practice to require all code when you start the server so all the code gets interpreted once.
The code does not get re-interpreted whenever you run it though.
So changes are not instantaneous.
To help you out, try supervisor which does hot reloading of the server on code changes.
It is possible to make instant changes happen by re-interpreting source code but that is not the default action. Generally you should just re-start the server.
Also see nodemon which will automagically reload changed files under it's authority.
EDIT
Rereading your question, it appears you are asking about the following scenario:
Run app to test
Quit app to refactor js code
Restart app
And you're asking why your changes do not appear at step 3?
If this is the case, you are seeing something very strange which might be related to how and from where files are being required.
In node, run:
console.dir(require.paths);
To see where node is looking for any resources you are requiring. If there is a copy of the file you're changing in any of the paths listed which is not the file you're editing, this would explain your problem.

Resources