OMNIORB: Read current orb setting - corba

It is possible to use CORBA::ORB_init to set the native codeset for the orb.
But if in an application an orb is retrieved in different configurations the orb is initialized only once.
"-ORBconfigFile config1.cfg"
CORBA::ORB_var orb1 = CORBA::ORB_init(orbInitParams.argc(), orbInitParams.argv());
"-ORBconfigFile config2.cfg"
CORBA::ORB_var orb2 = CORBA::ORB_init(orbInitParams.argc(), orbInitParams.argv());
But the thing is that the first one wins. So in a big application where the caller of the second ORB_init does not know of the first caller he will get the orb configured like 1.
This matters if 1. uses
nativeCharCodeSet = ISO-8859-1
while 2 uses
nativeCharCodeSet = UTF-8
Is there a way to read the ORB setting to check if settings are attached successful?
Why this shows up: I am using Omniorb in a dll (Thats where I initialize it). Now the application has a second component using omniorb which comes first. So I lost my UTF-8 configuration.

With omniorb it seems not possible to have to orbs in one process or is it possible to read the configuration.

Related

PyDrake NLOpt Method Selection

NLOpt has many different methods implemented as detailed here. I was wondering which one is used by default, and whether I could specify one of them in particular using the SolverOptions interface in pydrake.
I've tried, for example,
solver = NloptSolver()
options = SolverOptions()
options.SetOption(solver.solver_id(), "algorithm", "LD_LBFGS_NOCEDAL")
where I have replaced "LD_LBFGS_NOCEDAL" with "NLOPT_LD_LBFGS_NOCEDAL", "LD_LBFGS", etc. (enums taken from here) and checked the value of the optimal solution of a highly nonconvex program, which doesn't seem to change no matter what I specify. Is there any way to check whether the option has been set correctly (if it is possible to change it)?

Edit Photos via Photoshop on a server

I wart to create a web app where a user enters certain data via a form and then receives a custom rendered image. The image is from a smart object in a psd. It's kind of like a mock-up which definitely requires needs some photoshop filters to be properly rendered.
This should all happen in real time and should be doable from my understanding since the rendering of a single images doesn't need much computing power
I've done some research and haven't really found a solution the matches my problem. Is it necessary to run Photoshop on a server and then remotely run a photoshop script and then upload the generated image somewhere else?
I've used The After Effects Plugin Template by DataClay in the past which offers similar functionality but for video.
Looking forward to hearing your ideas.
Thanks
You can use the Dataclay plugin to handle still image exports out of After Effects. Make a single-frame duration composition in After Effects and rig the layers with the Templater plugin. Then use the PNG Sequence output module to render out a single frame.
From Dataclay's forums:
Exporting
A few extra steps are required to correctly render a project file as a PNG sequence using Templater. By default, a file rendered as a PNG sequence will have the frame number appended to the end of the file name, i.e.:
filename.png00000, filename.png00001, filename.png00002, etc.
In order to designate where in the filename the frame number should be added, we’ll need to use the output column. First, add a column named output to your data source. Next, add a filename with a set of brackets with five # signs to designate where the frame numbering should be added. For example:
filename[#####] would result in filename00001.png
or
[#####]filename would result in 00001filename.png

ChromeWorker to write a huge file

In my extension, I need to write a huge file (say around 20 gigs) to the disk. Currently I am doing it in the main thread, but file creation is very expensive operation. I was about to move the whole file creation process to a ChromeWorker, but based on https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Functions_and_classes_available_to_workers I cannot have access to the nsiFile from a ChromeWorker.
So my questions are:
1. Is it possible to access Cc, Ci, and Cu from within a ChromeWorker?
2. If not what would be the most efficient way to create and fill large files in Firefox. Note that I need to write the file based on segments and offsets (Ci.nsISeekableStream).
It's not possible to access nsIFile from ChromeWorker. But nsIFile is horrible synchronus option.
Go with OS.File: https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/OSFile.jsm
On that page go to the link for usage on workers: https://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/OSFile.jsm/OS.File_for_workers
On the mainthread os.file returns promises.
In worker they are synchronus. Wrap your os.file functions in worker with a try-catch, as when an error occurs, (like os.file.remove with option of ignoreAbsent set to false) then the catch will hold the OS.File.Error object.
Great move to ChromeWorker btw! I'm a huge fan of ChromeWorkers. I wrote a simple example of jsm using chromeworker here: https://github.com/Noitidart/jpm-chromeworker
For segments, you'll have to OS.File.open and then on the return value do a .setPosition() then you can read certain number of bytes from that position, or write, or whatever. Its awesome stuff. OS.File is the new way and the recommended way to do file operations. Its been around awhile now though since like Firefox 29 or before that.

XTSE1650: net.sf.saxon.trans.LicenseException: Requested feature (xsl:import-schema) requires Saxon-EE

I use java and saxonee-9.5.1.6.jar included build path , when run, getting these errors at different times.
Error at xsl:import-schema on line 6 column 169 of stylesheet.xslt:
XTSE1650: net.sf.saxon.trans.LicenseException: Requested feature (xsl:import-schema)
requires Saxon-EE
Error on line 1 column 1
SXXP0003: Error reported by XML parser: Content is not allowed in prolog.
javax.xml.transform.TransformerConfigurationException: Failed to compile stylesheet. 1 error detected.
I open .xslt file in hex editor and dont see any different character at the beginning AND
I use transformerfactory in a different project but any error I get.
Check what the implementation class of tFactory is. My guess is it is probably net.sf.saxon.TransformerFactoryImpl - which is basically the Saxon-HE version.
When you use JAXP like this, you're very exposed to configuration problems, because it loads whatever it finds sitting around on the classpath, or is affected by system property settings which could be set in parts of the application you know nothing about.
If your application depends on particular features, it's best to load a specific TransformerFactory, e.g. tFactory = new com.saxonica.config.EnterpriseTransformerFactory().
I don't know whether your stylesheet expects the source document to be validated against the schema, but it it does, note that this isn't automatic: you can set properties on the factory to make it happen.
I would recommend using Saxon's s9api interface rather than JAXP for this kind of thing. The JAXP interface was designed for XSLT 1.0, and it's a real stretch to use it for some of the new 2.0 features like schema-awareness: it can be done, but you keep running into limitations.

gnuplot with iOS

Does anyone here have experiences of using gnuplot with iOS? I want to develop a scientific computing app on iOS devices and want to use gnuplot as the plotting engine. Are there any good tutorials from which I can start with?
I have the same general question, a quick google search led me to the following app, which seems to use gnuplot.
https://apps.apple.com/us/app/icas-workstation-class-scientific/id394637176
I followed the trail to their website:
http://alsoftiphone.com/iCAS/
I contacted them about it, and I will follow up if/when I get a response.
The response:
Hello,
As you've aptly pointed out, there are some complications when embedding gnuplot in an app, particularly if you intend to dynamically create and dispose of it. That is, gnuplot (as of v4.4.0 which is what I used) doesn't explicitly release some memory that it allocates presumably because it assumes that it will be released when it is quit, which would be the case when it is used as a standalone application. This will of course result in memory leaks. Similarly, gnuplot doesn't explicitly close its output file descriptor (which is set to stdout as far as I know). And it also doesn't clear multiplot mode when the main function exits which is problematic because the next time you call gnuplot in an embedded situation, some global variables will reflect multiplot mode if called thereafter.
Fortunately for you, I've already identified them so you won't have to hunt them down like I did. Unfortunately, though, I didn't create a library for my projects but here are the relevant changes that you'll need to make to the gnuplot source code.
plot.c line #615, at the end of the else block for the "if (interactive && term != 0)" conditional block of the main() function (which you will also want to change to some appropriate entry function name):
// Free replot_line
if (replot_line != NULL)
{
free(replot_line);
replot_line = NULL;
}
plot.c line #680, before "return exit_status" at the end of the main() function:
// Free replot_line if it was allocated
if (replot_line != NULL)
free(replot_line);
// Clear multiplot mode, if it was active
if (multiplot)
term_end_multiplot();
// Close current file
if (gpoutfile)
fclose(gpoutfile);
The other issue is that gnuplot is written to use stdin and stdout so for my apps I replaced them with my own appropriate file descriptors to serve as the interface to/from gnuplot. That will be implementation specific, so I won't list my own particular changes but you'll basically need to look through the gnuplot source for instances of stdin and stdout and replace them as appropriate for your needs.
You'll also want to #define NO_GIH in config.h.
Other than that, you'll probably need to hard code the appropriate gnuplot terminal type for your app (I used SVG in my apps).
I hope this helps.
Best Regards,
Antonio Lagana

Resources