VehicleObstacleShadowing configuration for Veins - veins

How should I configure VehicleObstacleShadowing in the config.xml file in VEINS? I could not find an example so asking here for experts to shed light on it.

If you are referring to whether it reads any parameters from the analoguemodel configuration (e.g., config.xml), it does not need any. You can double-check by looking at the source code instantiating it.

Related

Saxon, custom extension element, XTDE:unknown extension instruction

When I tried to use a custom extension element with Saxon, I got an error saying XTDE:unknown extension instruction in my XSL file. I asked this on Saxon mailing list, but haven't yet received a response, so I decided to ask here. In order to be helpful, here is the whole content from the mailing list:
from: sky
I just start using Saxon. After go through some documentations, I still found it hard to write my own custom extension instruction. I have read "writing XSLT extension instructions", and the example provided in the package net.sf.saxon.option.sql. But I'm still a little confusing: the document says,
A subclass of SimpleExpression should implement the methods getImplementationMethod() and getExpressionType(), and depending on the value returned by getImplementationMethod(), should implement one of the methods evaluateItem(), iterate(), or process().
However, there is only call() method implemented in the sql example. I'm new to XML/XSLT, hence find it hard to understand how to write my own extension elements.
Is there a tutorial of some kind which explains writing extension elements in more detail?(I have Google but found no luck, the best I can find is with older Saxon version that has different implementation). Or maybe I should go through some other XML/XSLT intermediate first?
Thanks in advance
from Michael Kay
You're right, implementing extension instructions is not easy. That's partly because the APIs are quite complex, partly because the documentation is poor, and partly because the code that would help you understand it is not open source. The underlying reason for this is that not many people have attempted to do this, so there has been little feedback that would lead to improvement over the years.
I would encourage you to ask yourself seriously whether this is something you really want to do badly enough to cope with the difficulties.
The documentation extract you cite appears to be out of date. The "Callable" interface was a relatively recent addition, and the documentation has not caught up. Implementing the call() method is enough.
Michael Kay
Saxonica
from sky
Thanks for reply.
I'm replacing Xalan with Saxon, so there are extension instructions written for Xalan that need to be rewritten. I think it would be better if I rewrite Xalan extension elements into Saxon extension functions, however, I want to give extension element a try before making the choice. Right now I have a problem with extension element. I tried to write a simple extension element, but it failed to run with "XTDE 1450: Unknown extension instruction". Here is what my code looks like:
//Config.java
ProfessionalConfiguration config = new ProfessionalConfiguration();
config.setExtensionElementNamespace("degx", "DegElementFactory");
//DegElementFactory.java
if(localname.equals("value-of")) return DegxValueOf.class;
//version.xsl
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:degx="http://DegElementFactory" extension-element-prefixes="degx">
...
<degx:value-of select="alpha 1"/>
...
</xsl:stylesheet>
I run Config.class first, and then running sf.net.saxon.Transform, I got the error above. My guess is I configured extension element namespace the wrong way. I have Saxon PE with evaluate license install correctly, because I got message about expired days after running Transform.
In summary, I have Config.class, DegElementFactory.class, DegxValueOf.class, all in my working directory, and I have add it to class path through -cp argument. Please help :)
Because I'm using net.sf.saxon.Transform from command line, the configuration class object cease to exist after the execution of Config.class. At first I thought config.setExtensionElementNamespace() would write to a configuration file somewhere. But it turns out wrong. So there are two ways to set extension element namespace:
from command line, supply -config:file argument. e.g.
net.sf.saxon.Transform -config:config.xml -s:source.xml -xsl:transform.xsl -o:result.out
invoking XSLT from application, instance a configuration class and execute setExtensionElementNamespace() method.
#Martin Honnen also pointed out another problem in comment, thanks!

How to read a .shd file in C++?

I am creating a project in c++ for getting JobSettings of a job in a queue from .shd file.Can anyone please suggest me which API is used for reading .shd file?
If you're talking about the shadow file from the Windows spooler, take a look at this site and code accordingly - http://www.undocprint.org/formats/winspool/shd
Please note that this format is undocumented and so could change ever so often.

Configuration Management and SlowCheetah

I need to apply xdt transformations to other files than *.config ones.
I found the SlowCeetah extension which seems to provide this kind of feature as authors and extension page says, but, even if I setup the trasformation for xml files, and note that the
preview tool works well.., according to solution configuration manager configuratoins, no
transformation is applied.
For example I setup the trasformation for log4net.xml file, by using the tooling command "Add Transformation" which added log4net.{configname}.xml files but nothing happen when I deploy the solution or simply build with the specific build configuration.
Anyone has seen this issue?
Googlin' around I found that trasnformations to xml files should be applied to files setup as Content and Copy Always, anyone has suggestion about that?
I 'm very sad becaues I made all my configurations with transformations, and if I cannot solve that issue I lost 2 days of boring config job and I just can do that manually
Thanks in advance
Cheers

c++: program settings - boost.PropertyTree or boost.program_options?

I was looking for a solution to store program settings or options or configuration in C++. These could be settings that are exposed in a GUI and need to be saved between runs of my code.
In my search I came across boost.PropertyTree which seemed to be a good choice. I know boost is well respected code so I'm comfortable using it and so I started developing using this. Then I come across boost.program_options which seems to allow you to do the same thing but also looks more specialized for the specific use-case of program settings.
Now I'm wondering which is the most appropriate for the job? (or is there a 3rd option that is better than both)
EDIT:
fyi this is for a plugin so it will not use command line options (as in, it's not even possible).
UPDATE
I ended up sticking with boost.PropertyTree. I needed to be able to save changed options back to the INI, and I didn't see a way of doing that with boost.program_options.
Use boost::program_options. It's exactly what it's for. In one library you get command line options, environment variables options and an INI-like configuration file parser. And they're all integrated together in the Right way, so when then the user specifies the same option in more than one of these sources the library knows the Right priority order to consider.
boost::property_tree on the other hand is a more generalized library. The library parses the text stream into a uniform data model. But You need to do the real parsing -- that of making sense of the blob of data for your needs. The library doesn't know when to expect a parameter when it sees a particular option string, or to disallow specific values or types of values for a particular option.
After some digging around I think boost.PropertyTree is still the best solution because it gives me the capability to save the options after changing them from within the program which is a requirement.
There is a non-Boost possibility too. Config4Cpp is a robust, simple-to-use and comprehensively documented configuration-file parser library that I wrote. It is available at www.config4star.org.
I suggest you read Chapter 3 (Preferences for a GUI Application) of the Practical Usage Guide manual to read an overview of how Config4Cpp can do what you want. Then open the Getting Started Guide manual, and skim-read Chapters 2 and 3, and Section 7.4 (you might prefer to read the PDF version of that manual). Doing that should give you sufficient details to help you decide if Config4Cpp suits your needs better or worse than Boost.
By the way, the indicated chapters and sections of documentation are short, so they shouldn't take long to read.

File Signature Validation

I Have used a utility written by Mark Russinovich, it is used to validate the file signature.
Any one have ideas how this can be done, i know it is not a simple code, but just i need some hints, APIs, steps, A guide map, Just to go in the correct direction.
I read too much a bout the cryptAPIs, then I read too much about the certAPIs, but i cannot get any thing useful to simply link a given file with the (unknown to me) data stored in the windows.
if any can help me in this issue please help, thanks a lot.
You should read about Authenticode.