Melt throws “Property without service 'property'” - mlt

When building certain mlt files with melt 7.1.0, they run just fine, but when building them with melt 6.24.0, the error message
[producer_xml] Property without service 'property'?
[producer_xml] Property without service 'property'??
appears any number of times. A minimal working example showing this warning precisely twice is the following:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
</mlt>
What is the origin of this error? How can it be fixed?
The documentation is rather sparse on properties and in particular does not seem to mention what it would even mean for a property to have a service. The check for properties without services however is still in the current code (though I have not checked whether the code is dead by now).

Chain services were added in 7.0.0 - they were not supported in 6.24.0 yet.
The XML will not work in 2.24.0 because it uses a chain. You can change "chain" to "producer" to make it work if you do not need to use chain/link features.

Caveat
Before writing this answer, I had not yet gotten around to look at the result. Thus, it stands that no further warnings are given, but with the following approach, only black (and silent) video will be generated.
Old Answer
While I do not understand enough about the internals of the MLT framework to have even an inkling about the origins, I managed to work around this problem by manually reordering the mlt files. In my cases, the error disappeared consistenly when any playlist tag was moved before the first chain tag of the file. In the MWE the error can thus be avoided like this:
<?xml version="1.0"?>
<mlt>
<profile width="1920" height="1080"/>
<playlist id="playlist0">
<entry producer="chain0"/>
</playlist>
<chain id="chain0">
<property name="resource">mwe-in.mp4</property>
</chain>
</mlt>

Related

PHPMD and PHPCS Camelcase for Tests

I just installed both PHPMD and PHPCS with my Project.
Now, I would like to customize them a bit, but can't seem to achieve it.
I get 2 warnings that I would like to remove for all my project:
phpcs: public method name MyTests::my_test_that_should_pass is not in camel caps format
phpmd: the method my_test_that_should_pass is not in camel case
With PHPMD, I tried to change : .composer/vendor/phpmd/phpmd/src/main/resources/rulesets/controversial.xml and set allow-underscore-test to true like mentioned here
With PHPCS, I don't really know how to do it.
Any idea???
https://phpmd.org/rules/controversial.html
PHPCS uses a file called ruleset.xml to allow you to create your own custom standard. The documentation for it is here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-Ruleset
If you want a specific standard for your project, you can include a phpcs.xml file at the root of your project. It's exactly the same format as a ruleset.xml file and can even specify which files and folders need checking by default. Documentation for that is here: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Advanced-Usage#using-a-default-configuration-file
I have no idea what coding standard you are using with PHPCS right now, but I'll assume you are using PSR2.
If you run phpcs with the -s option, you'll see an error message with an error code, like this: Method name "MyTests::my_test_that_should_pass" is not in camel caps format (PSR1.Methods.CamelCapsMethodName.NotCamelCaps). The code is the bit you need here.
For your custom standard, you want PSR2, but you don't want the PSR1.Methods.CamelCapsMethodName sniff because you obviously don't want PHPCS checking for camel case. So create a ruleset with this content:
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>My custom coding standard.</description>
<rule ref="PSR2">
<exclude name="PSR1.Methods.CamelCapsMethodName"/>
</rule>
</ruleset>
Save that file and call it ruleset.xml or phpcs.xml and then run PHPCS using it: phpcs /path/to/code --standard=/path/to/ruleset.xml
Take a look at the annotated ruleset docs I linked at the top of the comment because there is a lot more you can do with those rulesets.

Specify an optional environment property in Apache Camel XML

I am using an environment variable in Apache Camel which is optional and in certain cases the value won't be there, but still I want my config to work, assuming the not found environment variable as blank.
camelContext id="inboud" xmlns="http://camel.apache.org/schema/spring">
<!-- and then let Camel use those #Component scanned route builders -->
<propertyPlaceholder id="properties"
location="properties/app${env}.properties" ignoreMissingLocation="true" />
<!-- Messages placed here will be raw data from force.com-->
<template id="frceProducerTemplate" />
Here the ${env} I want to make as optional and if it's not present then the location must be taken as properties/app.properties.
Any idea anyone?
There is no support for default values if an ENV variable is not there. You can read more about using property placeholders here: http://camel.apache.org/using-propertyplaceholder.html
However you can likely add 2 locations, one with the ENV and another without the ENV. And then turn on ignoreMissingLocation="true" then if the ENV is not there Camel will ignore it.

GTK newbie: glade app has huge fonts

I've got an inherited project that was made with glade. I've managed to get it compiled against gtk+1.2 after debugging some automake and gettext issues. (It's old code that keeps being adapted for similar purposes.) Unfortunately, I have never used GTK before. The code is in C and being developed on CentOS 6.
When compiled, it's supposed to look something like this (a screenshot of an old version I've managed to dig up):
Instead, it looks like this when I compile it on my system:
Ie, all the buttons, windows, and such are present, but it looks like the fonts have gone super-sized. I'm guessing that this is just an issue of pointing the code toward a better set of fonts, but maybe not. Has anyone encountered this sort of thing before? And if so, does anyone have some ideas about where to start looking on how to fix things?
UPDATE:
So I've found in the XML file where the labels are set. For example, the top-left GUNN On button is defined thusly:
<child>
<widget class="GtkToggleButton" id="gunn2_on_tog">
<property name="can_focus">yes</property>
<property name="label" translatable="yes">GUNN On</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">no</property>
<property name="width-request">72</property>
<property name="height-request">24</property>
<property name="visible">yes</property>
<signal name="toggled" handler="on_gunn2_on_tog_toggled" />
</widget>
<packing>
<property name="x">8</property>
<property name="y">16</property>
</packing>
</child>
It seems that I need to do some sort of Pango markup: https://developer.gnome.org/pango/stable/PangoMarkupFormat.html, but I'm still in the process of digging.
UPDATE 2:
I managed to convert the glade file to a version recent enough that the glade installed on the computer would open it. The fonts interface fonts in the glade app look fine. It's not until I compile and run the program that the fonts get out of whack. I've also tried changing my system font preference via the preferences menu to no avail.
UPDATE 3:
I've been able to change the font. Finally. I edited /etc/gtk/gtkrc and added the lines
style "default-text" {
fontset = "-adobe-helvetica-medium-o-normal--10-100-75-75-p-57-iso10646-1,-*-r-*-iso10646-1,*"
}
widget "*" style "default-text"
at the end. It's still not perfect and I don't fully understand it. But progress.
So, finally I was able to find an answer.
As a gtk 1.2 app, the program will eventually respect the system (or local) .gtkrc file.
The long string next to fontset is an X Logical Font Description (wikipedia).
The program xfontsel (provided for CentOS in the xorg-x11-apps yum package) allows one to pick which string they want. My final selection for my gtkrc file is:
style "default-text" {
fontset = "-adobe-helvetica-medium-r-normal--*-80-*-*-*-*-*-*"
}
widget "*" style "default-text"
Which gives me the following result:
.
I'm sure that, since the earliest references to GTK+ 1.2.10 start around 2001 this will be a super useful post in the future of Stack Exchange. Hopefully anyone else who has this problem will at least find this useful.
Not every example of this kind of style definition I found on nearly 15-year-old forum posts worked in my gtkrc. I'm guessing it has to do with certain fonts being on my system.

How can I configure a netTiers datasource to use a RouteParameter instead of a QueryStringParameter?

NetTiers works fantastic out of the box using querystrings. Eg:
<data:AspnetUsersDataSource ID="AspnetUsersDataSource" runat="server" SelectMethod="GetByUserId">
<Parameters>
<asp:QueryStringParameter Name="UserId" QueryStringField="UserId" Type="String" />
</Parameters>
</data:AspnetUsersDataSource>
However, if I try to change the parameter to instead be:
<asp:RouteParameter Name="UserId" RouteKey="id" Type="String" />
It just see empty textboxes when navigating to my AspnetUsersEdit.aspx page via the routed url:
user/edit/id
My hunch is this isn't a url routing problem but is instead something I'm missing with how NetTiers fundamentally works. If anyone has successfully used url routing within NetTiers, I'd greatly appreciate any input!
I was able to solve my problem by using FormViews (a slight pain, but good enough for me). One important note that took me some time to solve - NetTiers generated the solution such that periods were contained in the virtual path of the project. Unfortunately this caused havoc with routing when testing locally. Altering the virtual path so as to not contain periods fixed things for me.

Adding NAPDEF on Nokia

I am trying to add a new access point on a Nokia S60 device, but I am a little bitt puzzled on how to do it.
According to the spec a node should be added at the following root:
./AP/<X>
Whenever I try to add a node I get a status code 404 meaning that it could not be found. If I try to create an AP that already exists instead I get a status code 418 - it already exists.
The generated xml looks like this:
<Add>
<CmdID>17</CmdID>
<Item>
<Target>
<LocURI>./AP/testAP</LocURI>
</Target>
<Meta>
<Format>node</Format>
<Type>syncml:metinf</Type>
</Meta>
</Item>
</Add>
Using funambol I have also queried the whole ./AP tree and there exists a lot of access point already, all with names like APId00X.
I have tried using other names for my AP on the form APId00X with no luck either.
Does anyone know what it takes to create an AP on a S60 device?
It's not exactly an answer to your question but you might want to run some Symbian C++ code on the device to add the access point, if you can't find a way to do it successfully with OMA-DM.
If that works better, you may still be able to work around the problem by using OMA-DM to install the .sis file containing your code, run it and uninstall it.
It's ugly but there is a higher probability that Nokia actually tests each steps before releasing phones.
Got the answer in a post at Nokia Forum.
When trying to add an access point using a command ./AP/, it will fail with error 404 if some of the mandatory nodes are missing.
So when adding an AP, it works fine as long as you remember to add all mandatory fields.
I'm not sure about which ones are the mandatory fields. I have succefully created an AP without Bearer, but I have not experimented with this.

Resources