Is there in Geogebra an API to load an image - geogebra

In Geogebra you can insert an image interactively.
Is there any way to do this programmatically, i.e. just with a command, like InsertImage or LoadImage?
The construction protocol mentions only that the image was loaded without indicating the name of a relevant command or procedure.

No way. This interface is not provided in the official version.
Unless you modify the source code, which is possible because ggb is open source.

Related

Appium get image file name of XCUIElementTypeImage

I'm using Appium for UI test my iOS application.
I want to know current image file name (asset name) loaded to UIImageView, because the image file changes dynamically by cases.
<XCUIElementTypeImage type="XCUIElementTypeImage" name="Accessbility id I set in Xcode" enabled="true" visible="false" accessible="false" x="668" y="498" width="17" height="17" index="1"/>
This is some portion of xml created by Appium.
I expected that a property like 'value' or 'image' or 'src' would appear in the xml code, but it didn't.
Is there any way to know image resource name?
While it would be a very dirty way to write your view, you could theoretically pass the image's filename as the accessibility ID. As you need to still identify the element you would still use the accessibility label to describe the element.
Why is this "dirty"? Your UIImageView contains an instance UIImage, not a file. The UIImage also does not store the filename, only the file's data. For this reason you'd have to get really messy about passing that filename around. This breaks a lot of view controller pattern rules.
This is not a good candidate for a UI test. Or if it is, not with Appium. Or if it is, with some sort of screenshot comparison tool (I've been out of Appium for a few years, but I'm sure you could make even an external tool work with enough effort).
Again, this seems like a lot of effort and that's always a red flag to me.
UI elements in Apple's XCTest don't contain original file meta-data. (See, for example, discussion here.)
Some people recommend to write unit tests if you need to check whether an image with specific name was assigned to a view object.
Other people store all images in the test bundle, automatically make partial screenshots of image views and compare their representations with stored images. (I personally am not sure how flaky it would be, but, IMO, the option is anyway too complicated.)
Another option might be to collect app screenshots in all states you want to check, and compare them with expected screenshots. I assume there are tools which can help automate this.

Why does my asciidoc relative link doesn't work outside of my microservice?

I'm starting to create documentation using asciidoc on my project which is following a microservices architecture.
We have a microservice for documentation. In its files I want to link to another document in another microservice.
I can do a relative link inside my own component but when I try to go higher with ../ it does not work and the link does nothing.
Does anyone may know why ?
Could it be because asciidoc is installed in the jenkins file of my component but not the others ?
Or is it because I do not use the link correctly ?
I use it as it is describe in the doc :
link:../other_microservice/other-document.asciidoc[]
I also tried the xref with no more success.
Thanks a lot for anyone who can help me
The link: macro is supposed to be used with a URL, not a file path. Generally, it does what you mean. However, Asciidoctor's safe mode prevents access to files which reside outside of the folder containing the source file specified for transformation.
So, if the documentation for your other microservices is going to be hosted separately (e.g. one URL per microservice), then you should update your link: macro usage to specify URLs instead.
If all of your microservice documentation is to be hosted under one URL, specify --safe when you invoke Asciidoctor. For more details, see:: https://asciidoctor.org/docs/user-manual/#running-asciidoctor-securely

How to use ImageMagick with Alfresco?

I know Alfresco uses imagemagick for preview of images however I want to use imagemagick when uploading images to ALfresco. So that only compressed images are stored in repository.
Any idea how can I achieve this either my manipulating configurations of Alfresco or I need to do it with some programming?
Thanks
You have a few options. First, you could write a rule which would be triggered when objects of a certain mimetype are added to a folder. Your custom rule code could then invoke a transformation to compress the image and then delete the source file. One drawback to this approach is that the original file does exist in the repo for a time. The second drawback is that you'd have to configure it on every folder. This tutorial explains how to write a custom rule action.
The second option would be to implement a behavior. Your custom behavior code can look for a node creation event and take action when it sees one happen. When it sees an image it could then invoke a transformation and replace the original. This tutorial explains how to write custom behaviors.
The third option would be to do a much lower level extension of the node service, so that the original object never actually gets created but is first compressed. That would be much more involved than either of the options above.

Trying to open an application with parameter via an Application Protocol Handler

I am currently trying to figure out an issue with an Application Protocol Handler I've created. Following the directions listed on MSDN (http://msdn.microsoft.com/en-us/library/aa767914%28v=vs.85%29.aspx), I was able to register my application, PDF Annotator, to open via a URL. The issue I am experiencing is when I try to pass a parameter along with the call. The application will open, but the file parameter that gets passed is not opening within the application.
My registry key is verbatim as dictated by MSDN. My HTML code is as follows:
PDFAnnotator:C:\path\to\file\file.pdf
The way I understood the protocol handler is it takes the URL and tries to launch it via the command line. That being said, I am able to open my pdf file in PDFAnnotator with following command in the prompt:
PDFAnnotator.exe C:\path\to\file\file.pdf
I've tried formatting the file path in the HTML differently thinking that would be the issue too. Has anyone else come across this issue or something similar?
Obligatory Update for future generations (http://xkcd.com/979/):
The reason I was doing this is because half of the PDFs my application handled would be editable while the other half were read-only. I was trying to keep the read-only ones in browser with the Acrobat plugin (I'm targeting chrome only) while the protocol would allow me to set the links of the editable ones to open with Annotator. I tried, on whim, to reverse this (setting the default to Annotator and creating a protocol for Acrobat). I did this, first by trying Acrobat's URI Scheme (acrobat://), which didn't work outside of opening Acrobat. Then, I tried creating a protocol for Acrobat. When that fired off, it gave me an error stating the path was wrong for the file name, path name, or volume. So, progress? I'm giving up on this for now as other priorities have come up, but hopefully this helps somebody down the road.

OpenXml SDK - Image Reuse

I am creating a Word document based on a template. The template contains a image in the header section which I would like to re-use elsewhere in the document.
The image is stored in the package -> word/media/myImage.jpeg so I need to somehow add a relationship to my each section that I wish to display the image again. I have attempted this successfuly manually, the question is how using the sdk 2.0.
Using the AddImagePart() method is useless as this just adds the image again which is silly as I only need one copy rather than several duplicates stored in the package.
Anyone shed some light?
My experience with the SDK 2.0 is primarily in SpreadsheetML, but assuming the same principles are used in WordprocessingML, you need to create a relationship to the existing ImagePart, by obtaining its ID (using the GetIdOfPart() method) and then calling the CreateRelationshipToPart() method on the part that will hold the secondary reference to it.
Best way is to open up the document in DocumentReflector.exe and have a look on the code generated
Eric has some blog posts about that http://blogs.msdn.com/ericwhite/

Resources