Cannot get correct path to Documents folder on Android using Delphi 10.3 - delphi-10.3-rio

When I use this code
path := system.IOUtils.TPath.GetDocumentsPath;
I get the following value for "path":
/data/user/0/com.embarcadero./files
This makes no sense to me at all.

Related

Robot Framework Parameterizing using yaml file

Hi can anybody help me parameterize the string word so it will fetch from my yaml. I tried to run however I'm getting an error it shows failed: Using YAML variable files requires PyYAML module to be installed. Typically you can install it by running pip install pyyaml. but I already install pyyaml on my local machine. your response is highly appreciated. Thank you so much
Expected Result: ${String} parameter should get the value from my robot.yaml (Ralph) value
VS Terminal Screenshot:
.robot screenshot
robot.yaml file screenshot:
CMD Screenshot:
In robot.yaml define PYTHONPATH like this:
PYTHONPATH:
- .
- string: "RALPH"
Make sure you have installed PyYAML, then include robot.yaml and collections library in the robot file:
Variables path_to_file/robot.yaml
Library Collections
After this you can extract string value inside the test like this:
${value} = pop from dictionary ${PYTHONPATH[1]} string
log to console ${value}
This will print:
RALPH
Second item in PYTHONPATH list is a dictionary, so you first need to access ${PYTHONPATH[1]} and then pop the needed key (in your case string) in order to return its value.

Getting StringIndexOutOfBoundsException when attempting to create a new Form in Codenameone

I am using Netbeans and updated to use the latest codenameone plugin. I am trying to follow the walkthrough tutorial at http://www.codenameone.com/blog/gui-builder-walkthru.html, but I keep on getting a StringIndexOutOfBoundsException when attempting to generate a new Form using the NewGuiBuilderWizardIterator. The following is the stacktrace that I'm seeing. Any and all help would be greatly appreciated!
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: Relative path com\mycompany\myapp\MyApp.java
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: Gui file C:\Users\joshua\Documents\NetBeansProjects\TestGui1\res\guibuilder\com\mycompany\myapp\MyApp.gui
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: Props C:\Users\joshua\Documents\NetBeansProjects\TestGui1\codenameone_settings.properties
SEVERE [com.codename1.actions.OpenGuiBuilderAction]: The GUI file doesn't exist!
WARNING [org.openide.filesystems.Ordering]: Found same position 100 for both Loaders/application/res/Actions/org-openide-actions-OpenAction.shadow and Loaders/application/res/Actions/sep-1.instance
WARNING [org.netbeans.modules.java.JavaTemplateAttributesProvider]: No classpath was found for folder: C:\Users\joshua\Documents\NetBeansProjects\TestGui1#b78894d2:1aed2d64
WARNING [org.openide.WizardDescriptor]
java.lang.StringIndexOutOfBoundsException: String index out of range: -4
at java.lang.String.substring(String.java:1919)
at com.codename1.NewGuiBuilderWizardIterator.instantiate(NewGuiBuilderWizardIterator.java:95)
at org.openide.loaders.TemplateWizard$InstantiatingIteratorBridge.instantiate(TemplateWizard.java:1046)
at org.openide.loaders.TemplateWizard.handleInstantiate(TemplateWizard.java:605)
at org.openide.loaders.TemplateWizard.instantiateNewObjects(TemplateWizard.java:439)
at org.openide.loaders.TemplateWizardIterImpl.instantiate(TemplateWizardIterImpl.java:248)
at org.openide.loaders.TemplateWizardIteratorWrapper.instantiate(TemplateWizardIteratorWrapper.java:160)
at org.openide.WizardDescriptor.callInstantiateOpen(WizardDescriptor.java:1629)
at org.openide.WizardDescriptor.callInstantiate(WizardDescriptor.java:1570)
at org.openide.WizardDescriptor.access$2300(WizardDescriptor.java:92)
[catch] at org.openide.WizardDescriptor$Listener$2$1.run(WizardDescriptor.java:2257)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1423)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2033)
You need to select a package when you do this and not the top level project since the code won't recognize that situation and won't know where to place the GUI file.
Notice that since an XML GUI file is created in the background, refactoring after the fact won't work well so this isn't something we should generally fix.

Access to shared_path in deploy.rb

I try to set command map using shared_path like that:
SSHKit.config.command_map[:composer] = "php #{shared_path.join('composer.phar')}"
But the path is /var/www/xxx not using the path I set on :deploy_to deploy/staging.rb.
I guess this is because staging.rb is loaded after.
What the right way then?
I had the same issue and although I don't think I have found the best way. I have found a way.
My default :deploy_to in deploy.rb points to '/var/www/my_app'. And I have a development stage where the server uses the same path. But my production server uses '/home/httpd/something/else' so I put :deploy_to in production.rb expecting it to deploy to that path. And everything works except the composer command. The composer.phar file is downloaded to the correct shared path and the files are deployed correctly. But when composer runs it tries to find it in '/var/www/my_app/shared'.
What I did was instead of putting the SSHKit.config.command_map by it self in deploy.rb, put it in a task. Something like:
namespace :deploy do
before :starting, :map_composer_command do
on roles(:app) do |server|
SSHKit.config.command_map[:composer] = "#{shared_path.join("composer.phar")}"
end
end
...
end
It feels like SSHKit.config.command_map runs "to early" or something. This seems to help. It works for me at least. And I had the exact same issue.
Edit:
I got some help from an issue I posted on capistrano/composer.

Google App Engine and ttf font not working

I've got a small problem where google app engine is complaining about my ttf file. This is what it says:
Could not guess mimetype for css/fonts/Pacifico.ttf. Using application/octet-stream.
Now I've followed this link and changed my yaml file appropriately (or so I think):
- url: /css/fonts/(.*\.ttf)
static_files: css/fonts/\1
upload: css/fonts/(.*\.ttf)
mime_type: application/x-font-ttf
But when I do this i get the following:
appcfg.py: error: Error parsing C:\Users\Roberto\Desktop\bootstrap\app.yaml: mapping values are not allowed here
in "C:\Users\Roberto\Desktop\bootstrap\app.yaml", line 25, column 17.
2014-01-16 23:22:16 (Process exited with code 2)
Any help in this matter?
I have done a test with glyphicons-halflings-regular.ttf from the Bootstrap project with the same app.yaml handler that you use (save for the indentation change as per the comments) and can verify that it works as expected:
This leads me to believe that you may using an older version of the GAE SDK (I use 1.8.8) or something else is wrong with your installation.
You can try this: appcfg.py uses python's mimetypes module to guess the type from the file extension so in any case, you should be able to solve the issue by adding the application/x-font-ttf mime type to your OS.
You're on Windows so you need to edit your registry and add a application/x-font-ttf key to HKEY_CLASSES_ROOT\MIME\Database\Content Type and add a string value called Extension with the value .ttf under the new key.
Extended procedure for adding the mimetype to Windows
Open the registry editor: Hit Winkey + R and type regedit, hit Enter
Navigate through the registry to the desired location: open HKEY_CLASSES_ROOT, inside it open MIME, inside that open Database and inside that open Content Type. It's like a folder structure.
Right click on Content Type and select New > Key, give it the name application/x-font-ttf.
Right click on the key you just created and select New > String Value. give it the name Extension.
Double click on the value you just created and assign it the Value data .ttf, hit OK.
Exit regedit and you're done!
Final none: I don't think it can be anything to do with the file itself, because the mimetypes module uses only the file extension to work out the MIME type. Unless there is some crazy unprintable character in the filename. You could try using the glyphicons-halflings-regular font I linked to to eliminate this possibility.

FreeRadius dictionary loading

I'm trying to load a dictionary that comes in with Debian Squeeze. Unfortunately radius-client library fails on some included file with:
rc_read_dictionary: unknown Vendor-Id encrypt=1 on line 7 of dictionary /usr/share/freeradius/dictionary.compat
The line is
ATTRIBUTE Password 2 string encrypt=1
Freeradius is installed from the package, so I assume this should work just fine... What could be the problem here?
Late answer, but it still might help others, I got bit by a related issue.
You're getting that error because you're trying to use a dictionary file designed for the FreeRADIUS server. The client library "freeradius-client" is not 100% compatible with that format. Specifically, in your case, it cannot handle the encrypt=1 property of the attribute.
The reason for the complaint about an unknown Vendor-Id is another incompatibility between FreeRADIUS server and the freeradius-client library. FreeRADIUS server expects dictionary files with vendor specific attributes (VSAs) like the following:
VENDOR Cisco 9
BEGIN-VENDOR Cisco
ATTRIBUTE Cisco-AVPair 1 string
ATTRIBUTE Cisco-NAS-Port 2 string
...
END-VENDOR Cisco
The freeradius-client library however can only parse VSAs in the following form:
VENDOR Cisco 9
ATTRIBUTE Cisco-AVPair 1 string vendor=Cisco
ATTRIBUTE Cisco-NAS-Port 2 string vendor=Cisco
The above is true for FreeRADIUS server v2.1.x and freeradius-client v1.1.6.

Resources