I have a Matlab application deployed using Builder JA. I incorporated it into a larger Java-based web application. It was built on a Windows machine, which has actual matlab on it, and worked fine when I tested it there. I've deployed the application onto a Linux server, which has only the MCR on it. what happens now is that I can run the application via the web page, but the resulting graphs display only the graphics and not the text (title, axis labels, etc). This happens both when I use WebFigure(gcf) and when I use figtoImStream(gcf, jpg), so I don't think it's an issue with any one format. The issue seems to be in the hardcopy.p function, since the server logs show an error
{Warning: Failed to draw text string}
{> In /usr/local/MATLAB/MATLAB_Compiler_Runtime/v717/toolbox/matlab/graphics/hardcopy.p>hardcopy at 28
In compiler/private/hardcopyOutput at 58
In figToImStream at 73
In Gaussian_WBfigures_jpg at 635}
I've seen some things that suggest that this is an issue of Matlab looking for a font that isn't there, and some that suggest that this is an issue with the renderer. Does anyone have a solution for this?
Try plotting your labels with a different fonts or interpreters. there have been reports of bugs in matlab when printing with different interpreters. e.g. http://www.mathworks.com/support/bugreports/398506, http://www.mathworks.com/support/bugreports/309380
figure
text(0.5,0.5,'testa','Fontname','Arial')
text(0.5,0.6,'testa','Fontname','Times')
text(0.5,0.7,'testa','Fontname','Times','Interpreter','Tex')
text(0.5,0.8,'testa','Fontname','Times','Interpreter','Latex')
Related
I created an app in matlabs App Designer. The app includes a UIAxes element with some data points.
When running the app via "normal" matlab, it works great. I can select points and retrieve the coordinates using dcm_obj = datacursormode(app.UIFigure) and subsequently click_coords1 = getCursorInfo(dcm_obj);.
After compiling the app with Matlab Compiler (Share -> standalone desktop app -> include runtime in package) and running the compiled version, data points can no longer be selected. When I click on a data point in the figure, simply nothing happens. The data point is not selected and no tool tip appears. The code that normally returns the coordinates now returns nothing. I also noticed the figure itself looks less nice (scatter plot circles seem square-ish).
Other functionality does seem to work: Drop down menus and buttons, which retrieve & draw data in the figure, drawing new data in the figure is also no problem. I can also pan the figure (although for some reason that's very slow in Ubuntu 20, but not in CentOS 8).
I run the app using the provided bash script:
./run_myapp.sh [path to matlab]
There's no difference in running the app as local user or root. There's also no difference when referencing matlab runtime or "normal" matlab.
Details:
Matlab runtime version: V98
"Normal" matlab version: R2020a
Operating system: Ubuntu 20.04 / CentOS 8
The problem can be reproduced using the example Patients Display app that matlab App Designer provides. Compile it as standalone desktop app with the runtime included. Install it and run it using the provided bash script. Clicking on the data points is not possible (but it is possible in App Designer).
I faced the same issue. After a few unsuccessful attempts, I discovered that the following works:
dcm_obj = datacursormode(app.UIFigure);
if isdeployed
dcm_obj.Enable = 'on';
end
The "isdeployed" command is included to avoid warnings when executing the code in MATLAB. In the deployed version however, you need to actually click on the data points to get the datatip whereas in MATLAB just hovering over them is enough.
I have this workflow with ParaView where I
1) load a dicom,
2) load a state where I perform actions on the dicom (sources, filters, custom filters, etc).
3) apply a custom macro where I initialize everything.
Then I have some custom macros that moves lines in the final result.
I would like to make a desktop app with a simple UI where a I have one button that executes the 3 necessary steps to initialize everything. And then I have three buttons that executes the custom macros.
So I'm basically making a simpler ParaView.
I have used the trace function that ParaView has to make a python script with all the steps and then executing them in the pvpython shell to test if I reach the same result that in the ParaView GUI.
But a simple script that just load the dicom makes the windows (Visualization Toolkit - Win320OpenGL) not responding.
What do you think is the best approach to do this?
This is fully supported by ParaView, as ParaView is not only an application but also a framework.
This is documented here : https://www.paraview.org/Wiki/Writing_Custom_Applications
Examples are in ParaView code : https://gitlab.kitware.com/paraview/paraview/tree/master/Examples/CustomApplications
For follow-up questions, I would suggest asking on the ParaView Discourse : https://discourse.paraview.org/
On my local jBoss machine, generation of PDFs works fine. However, when I try publish (so far it seems so) basically anything on NetWeaver deployed same code of application, generation crashes with this error:
08-06-18:00:46:45 [HTTP Worker [#802492534]] ERROR [JRStyledTextParser:paveljanicek] Error while loading available fonts
net.sf.jasperreports.engine.JRRuntimeException: javax.xml.parsers.ParserConfigurationException
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.<init>(SimpleFontExtensionHelper.java:156)
at net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.getInstance(SimpleFontExtensionHelper.java:131)
at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.ensureFontExtensions(FontExtensionsRegistry.java:80)
at net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontExtensionsRegistry.java:57)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:130)
at net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextParser.java:86)
at net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:111)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:69)
at net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.java:57)
at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:219)
at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:234)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:134)
Worst part is, I cannot think about how to reproduce this error. This is what I already checked on target machine:
Fonts are installed and accessible to the app
jasperreports-fonts.jar is accessible to the Jasper reports
On my local machine:
PDF does generate with warnings (I am using old attributes like issplitAllowed or border)
If fonts are deleted, local instance crashes with different error (mostly "Fonts are not available to the JVM")
Does anyone has any idea what to check, where to look?
NW uses default XML parser, which doesn't support setting security feature "http://apache.org/xml/features/disallow-doctype-decl". This feature is set by Jasper style sheet parser from version 6.4.2
Quick solution is to use different XML parser, which supports mentioned feature by setting system property "javax.xml.parsers.DocumentBuilderFactory" to proper XML parser in NW properties.
Definitely the issue is on NW side.
However, I did find an Oracle equivalent XML parser (still based on Xerces) that is more forgiving when setting XML features: com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl.
This parser comes with the Oracle JVM used in the project so we do not need to add an additional library and is actually the default parser based on JavaDocs.
Netweaver JVM decided to use oracle.xml.jaxp.JXDocumentBuilderFactory as default instead.
How do I open my Unity app, two single instances, into two different monitors full-screen (one in each monitor)?
Using this link https://docs.unity3d.com/Manual/CommandLineArguments.html I have found that according to Unity all I have to do to open my Unity application multiple times into two separate monitors I use the -adapter N command. I have tried this and it always loads into the Main Display monitor. Here is my commands to open the application twice into separate monitors:
start CCC.exe -force-d3d9 -adapter 1
start CCC.exe -force-d3d9 -adapter 2
I noticed in another article that only the d3d9 option works when using the -adapter option. Also, I'm using a NVIDIA® GeForce® GTX 1070 with 8GB GDDR5 with Dual monitors plugged in 2 of the HDMI adapter ports.
Has anyone got this working? Much appreciated!
Drew
Apparently if you use Extended displays on Windows they both act as the same adapter, not sure what the intended use of the adapter switch is.
Alternatively, you could try an external solution. Create a program (.net for instance) that launches both instances and then moves one of them to the other monitor. Check this guide to see how you can move a window from another program.
You probably want to use borderless windowed mode to show them fullscreen and still be able to move them to the desired position.
Ultimately, here's a paid solution that does all of this.
I was googling a lot in order to find a solution for my problems with UI Automation. I found a post that nice summarizes the issues:
There's no way to run tests from the command line.(...)
There's no way to set up or reset state. (...)
Part of the previous problem is that UI Automation has no concept of discrete tests. (...)
There's no way to programmatically retrieve the results of the test run. (...)
source: https://content.pivotal.io/blog/iphone-ui-automation-tests-a-decent-start
Problem no. 3 can be solved with jasmine (https://github.com/pivotal/jasmine-iphone)
How about other problems? Have there been any improvements introduced since that post (July 20, 2010)?
And one more problem: is it true that the only existing method for selecting a particular UI element is adding an accessibility label in the application source code?
While UI Automation has improved since that post was made, the improvements that I've seen have all been related to reliability rather than new functionality.
He brings up good points about some of the issues with using UI Automation for more serious testing. If you read the comments later on, there's a significant amount of discussion about ways to address these issues.
The topic of running tests from the command line is discussed in this question, where a potential solution is hinted at in the Apple Developer Forums. I've not tried this myself.
You can export the results of a test after it is run, which you could parse offline.
Finally, in regards to your last question, you can address UI elements without assigning them an accessibility label. Many common UIKit controls are accessible by default, so you can already target them by name. Otherwise, you can pick out views from their location in the display hierarchy, like in the following example:
var tableView = mainWindow.tableViews()[0];
As always, if there's something missing from the UI Automation tool that is important to you, file an enhancement request so that it might find its way into the next version of the SDK.
Have you tried IMAT? https://code.intuit.com/sf/sfmain/do/viewProject/projects.ginsu . It uses the native javascript sdk that Apple provides and can be triggered via command line or Instruments.
In response to each of your questions:
There's no way to run tests from the command line.(...)
Apple now provides this. With IMAT, you can kick off tests via command line or via Instruments. Before Apple provided the command line interface, we were using AppleScript to bring up Instruments and then kick off the tests - nasty.
There's no way to set up or reset state. (...)
Check out this state diagram: https://code.intuit.com/sf/wiki/do/viewPage/projects.ginsu/wiki/RecoveringFromTestFailures
Part of the previous problem is that UI Automation has no concept of discrete tests. (...)
Agreed. Both IMAT and tuneup.js (https://github.com/alexvollmer/tuneup_js#readme) allow for this.
There's no way to programmatically retrieve the results of the test run. (...)
Reading the trailing plist file is not trivial. IMAT provides a jUnit like report after a test run by reading the plist file and this is picked up by my CI Tool (Teamcity, Jenkins, CruiseControl)
Check out http://lemonjar.com/blog/?p=69
It talks about how to run UIA from the command line
Try to check the element hierarchy, the table can be placed over a UIScrollView.
var tableV = mainWindowTarget.scrollViews()[0].tableViews()[0].scrollToElementWithName("Name of element inside the cell");
the above script will work even the element is in 12th cell(but the name should be exactly the same as mentioned inside the cell)