Referencing local image in PlantUML salt wireframe - plantuml

I'm trying to include a local image into my PlantUML salt wireframe for my GUI documentation in Ubuntu 20.04. The PlantUMl reference page only shows how to include a http link. How to do this?
I tried the following, but I'm getting "Cannot decode" in the output.
#startsalt
scale 2
{
title Test Page
{S
{^"Figure"
<img:file://./pie-chart.png>
<img:file://./pie-chart.png>
<img:.\pie-chart.png>
}
..
}
}
#endsalt

If you store the image blah.png at the same location as the PlantUML source, this will work:
#startsalt
scale 2
{
title Test Page
{S
{^"Figure"
<img:blah.png>
}
..
}
}
#endsalt
I get on my (windows) machine:
Edit: WSL (Ubuntu) test
I have WSL on my Windows machine, and so I started up VSCode in Ubuntu, and installed the PlantUML plugin for VSCode. I created a file /home/me/test/blah.png (copied from my Windows), and then created the following PlantUML file stored in /home/me/test.wsd:
#startsalt
'scale 1
{
title Test Page
{S
{^"Figure 0"
<img:test/blah.png>
}
{^"Figure 1"
<img:./test/blah.png>
}
{^"Figure 2"
<img:"/home/me/test/blah.png">
}
{^"Figure 3"
<img src="/home/me/test/blah.png">
}
{^"Figure 4"
<img src="test/blah.png">
}
..
}
}
#endsalt
It has relative and absolute paths, with the src= alternative for specifying images. I can get them all to work with png files on my Ubuntu 20 (again, using the PlantUML extension for VSCode). I should state that I have it configured to use the PlantUML server. If you're using an older version of PlantUML (Ubuntu's apt will sadly bring over an ancient one).

Related

Setup Xdebug for Shopware docker failed

I try to setup Xdebug for shopware-docker without success.
VHOST_[FOLDER_NAME_UPPER_CASE]_IMAGE=ghcr.io/shyim/shopware-docker/6/nginx:php74-xdebug
After replacing your Folder Name and running swdc up Xdebug should be activated.
Which folder name should I place?
Using myname, the same name as in /var/www/html/myname, return error on swdc up myname:
swdc up myname
[+] Running 2/0
⠿ Network shopware-docker_default Created 0.0s
⠿ Container shopware-docker-mysql-1 Created 0.0s
[+] Running 1/1
⠿ Container shopware-docker-mysql-1 Started 0.3s
.database ready!
[+] Running 0/1
⠿ app_myname Error 1.7s
Error response from daemon: manifest unknown
EDIT #1
With this setup VHOST_MYNAME_IMAGE=ghcr.io/shyim/shopware-docker/6/nginx:php81-xdebug (versioned Xdebug) the app started:
// $HOME/.config/swdc/env
...
VHOST_MYNAME_IMAGE=ghcr.io/shyim/shopware-docker/6/nginx:php81-xdebug
But set a debug breakpoint (e.g. in index.php), nothing happens
EDIT #2
As #Alex recommend, i place xdebug_break() inside my code and it works.
Stopping on the breakpoint the debugger log aswers with hints/warnings like described in the manual:
...
Cannot find a local copy of the file on server /var/www/html/%my_path%
Local path is //var/www/html/%my_path%
...
click on Click to set up path mapping to open the modal
click inside modal select input Use path mapping (...)
input field File path in project response with undefined
But i have already set up the mapping like described in the manual, go to File | Settings | PHP | Servers:
Why does not work my mapping? Where failed my set up?
The path mapping needs to be between your local project path on your workstation and the path inside the docker containers. Without xDebug has a hard time mapping the breakpoints from PHPStorm to the actual code inside the container.
If mapping the path correctly does not work and if its a possibility for you, i can highly recommend switching to http://devenv.sh for your development enviroment. Shopware itself promotes this new enviroment in their documentation: https://developer.shopware.com/docs/guides/installation/devenv and provides an example on how to enable xdebug:
# devenv.local.nix File
{ pkgs, config, lib, ... }:
{
languages.php.package = pkgs.php.buildEnv {
extensions = { all, enabled }: with all; enabled ++ [ amqp redis blackfire grpc xdebug ];
extraConfig = ''
# Copy the config from devenv.nix and append the XDebug config
# [...]
xdebug.mode=debug
xdebug.discover_client_host=1
xdebug.client_host=127.0.0.1
'';
};
}
A correct path mapping should not be needed here, as your local file location is the same for XDebug and your PHPStorm.

Error in Jimp.loadFont (use load-bmfont module) with React

I am testing Jimp.js for image manipulation (using React with react-scripts, npm: 6.14.4, node: v12.16.3)
Everything is going well except writing text on a loaded image
import Jimp from 'jimp'
Jimp.read(image)
.then(image => {
console.log('image loaded', image)
Jimp.loadFont(Jimp.FONT_SANS_32_WHITE).then(font => {
console.log('font loaded', font)
image.print(font, 10, 10, 'Hello world that wraps!', 12)
// write image
})
})
This throws an error "error parsing font malformed file -- no element" in browser.js of load-bmfont module line 71 and dont execute the log 'font loaded'.
Googling not help i found only 2,3 items about this, associate with using custom fonts - but i use standard font from Jimp. (Using BMFont files instead of Jimp standard fonts doesnt help)
My first thought was the error ocured in a React App in the browser, so i write a Jest test to see if its work without browser context but it fail just like that.
Got any ideas?
Solved...
I'm using the React App within a Java Web Framework in a JSP File.
Jimp.loadFont(Jimp.FONT_SANS_32_WHITE)
search the font in a path that doesn`t exist for the webapp.
Moving the font files to a reachable path with context root
Jimp.loadFont(`${CONTEXT_ROOT}/foo/bar/font.font`) works.

CN1 error: cannot find symbol setInlineStylesTheme(resourceObjectInstance) in CN1 generated code

This code was working in previous builds and the app code was not changed. I did work on changes in the theme for adding support for the Facebook/Google logins. In the "DON'T EDIT" code in my CN1 project, I am getting the error;
error: cannot find symbol
setInlineStylesTheme(resourceObjectInstance
The error occurs in multiple locations, but here is the some of the code;
private void initGuiBuilderComponents(com.codename1.ui.util.Resources resourceObjectInstance) {
guiBuilderBindComponentListeners();
setLayout(new com.codename1.ui.layouts.LayeredLayout());
setInlineStylesTheme(resourceObjectInstance);
setInlineStylesTheme(resourceObjectInstance);
setTitle("Processing");
setName("Processing");
addComponent(gui_Box_Layout_Y);
gui_Box_Layout_Y.setInlineStylesTheme(resourceObjectInstance);
.
.
.
gui_Table_Layout.addComponent(ButtonAbandonConstraint, gui_ButtonAbandon);
gui_TextFieldCancelReason.setInlineStylesTheme(resourceObjectInstance);
gui_TextFieldCancelReason.setName("TextFieldCancelReason");
gui_TextFieldCancelReason.setRows(2);
gui_ButtonCancel.setText("Cancel");
gui_ButtonCancel.setInlineStylesTheme(resourceObjectInstance);
gui_ButtonCancel.setName("ButtonCancel");
gui_ButtonPrevious.setText("Previous");
gui_ButtonPrevious.setInlineStylesTheme(resourceObjectInstance);
gui_ButtonPrevious.setName("ButtonPrevious");
gui_ButtonProcess.setText("Process");
gui_ButtonProcess.setInlineStylesTheme(resourceObjectInstance);
gui_ButtonProcess.setName("ButtonProcess");
gui_ButtonNext.setText("Next");
gui_ButtonNext.setInlineStylesTheme(resourceObjectInstance);
gui_ButtonNext.setName("ButtonNext");
gui_ButtonAbandon.setText("Order Abandoned");
gui_ButtonAbandon.setInlineStylesTheme(resourceObjectInstance);
gui_ButtonAbandon.setName("ButtonAbandon");
gui_LabelDrinkNumber.setText("Search");
gui_LabelDrinkNumber.setInlineStylesTheme(resourceObjectInstance);
.
.
.
You need to update your project libs. Right click project > Properties > Update Project libs.

Display project version in ASP.NET Core 1.0.0 web application

None of what used to work in RC.x helps anymore.
I have tried these:
PlatformServices.Default.Application.ApplicationVersion;
typeof(Controller).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
Assembly.GetEntryAssembly().GetName().Version.ToString();
They all return 1.0.0.0 instead of 1.0.0-9 which should be after execution of the dotnet publish --version-suffix 9 having this in project.json: "version": "1.0.0-*"
Basically they give me "File version" from the attached picture instead of "Product version" which dotnet publish actually seems to change.
For version 1.x:
Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion;
For version 2.0.0 this attribute contains something ugly:
2.0.0 built by: dlab-DDVSOWINAGE041 so use this one:
typeof(RuntimeEnvironment).GetTypeInfo().Assembly.GetCustomAttribute<AssemblyFileVersionAttribute>().Version;
I would do it like this on ASP.NET Core 2.0+
var assemblyVersion = typeof(Startup).Assembly.GetName().Version.ToString();
In .Net Core 3.1 I show the version directly in my View using:
#GetType().Assembly.GetName().Version.ToString()
This shows the Assembly Version you have in your csproj file:
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>2.2.2.2</FileVersion>
<Version>4.0.0-NetCoreRC</Version>
</PropertyGroup>
If you want to display the "other" FileVersion or "Informational" Version properties in the View add using System.Reflection:
using System.Reflection;
.... bunch of html and stuff
<footer class="main-footer">
<div class="float-right hidden-xs">
<b>Assembly Version</b> #(Assembly.GetEntryAssembly().GetName().Version)
<b>File Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyFileVersionAttribute>().Version)
<b>Info Version</b> #(Assembly.GetEntryAssembly().GetCustomAttribute<AssemblyInformationalVersionAttribute>().InformationalVersion)
</div>
</footer>
Note that after adding the System.Reflection the original #GetType().Assembly.GetName().Version.ToString() line returns 0.0.0.0 and you need to use the #Assembly.GetEntryAssembly().GetName().Version
There's a blog post here
Edit: Make sure to follow proper naming conventions for the Version strings. In general, they need to lead with a number. If you don't, your app will build but when you try to use NuGet to add or restore packages you'll get an error like 'anythingGoesVersion' is not a valid version string. Or a more cryptic error: Missing required property 'Name'. Input files: C:\Users....csproj.'
more here:
This work for me too:
#Microsoft.Extensions.PlatformAbstractions.PlatformServices.Default.Application.ApplicationVersion
It works with csproj file - either <Version>1.2.3.4, or <VersionPrefix>1.2.3</VersionPrefix>. However the <VersionSuffix> isn't recoganized as this doc says.
The answer by Michael G should have been the accepted one since it works as expected. Just citing the answer by Michael G above.
var version = GetType().Assembly.GetName().Version.ToString();
works fine. It gets the Package version set in the Package tab of project properties.
As an addition, if we need to get the Description we set in the same tab, this code would work. (core 3.1)
string desc = GetType().Assembly.GetCustomAttribute<AssemblyDescriptionAttribute>().Description;
Just in case someone needs this.
Happy coding !!!

QQmlPropertyCache: QQuickItem has FastProperty class info, but has not installed property accessors

Built Raspberry Pi 2 linux distro including Qt5.4 + QtWebKit + QML plugin using Yocto on fido branch See tutorial
Testing with the following QML script
root#raspberrypi2:~# more webkit.qml
import QtWebKit 3.0
WebView {
url: "http://www.nokia.com"
preferredWidth: 490
preferredHeight: 400
scale: 0.5
smooth: false
}
When running this script I am getting the following error:
root#raspberrypi2:~# /usr/bin/qt5/qmlscene --platform eglfs webkit.qml
Unable to query physical screen size, defaulting to 100 dpi.
To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
QQmlPropertyCache: QQuickItem has FastProperty class info, but has not installed property accessors
Aborted
Any pointers?
I had the same problem. The solution was to add the line
import QtQuick 2.0
to the QML file.

Resources