Understanding the purpose of the [ALIAS] section - chm

I've been trying to convert a large WinHelp project over to HtmlHelp, for use with my MFC application.
I've got things working mostly; however, I find that invoking help from many contexts within my app produce the completely unhelpful error message.
Failed to launch help.
It appears that if I add the corresponding entry to the [ALIAS] section then it works.
[ALIAS]
HID_FILE_OPEN=Html\HID_FILE_OPEN.htm
My question is, do I really need to do this for every single topic? With WinHelp, the only entries I had to add to the [ALIAS] section were those topics I wanted to be an alias for something else.
Is there no way HTML Help has to know that HID_FILE_OPEN corresponds to the help file Html\HID_FILE_OPEN.htm without me explicitly entering it for every topic?

Short story - you have to clean up the mapping data files for context-sensitive help. Please test the information below for your needs and your environment.
The purpose of the two files e.g. alias.h and map.h is to ease the coordination between developer and help author. The mapping file links an ID to the map number - typically this can be easily created by the developer and passed to the help author. Then the help author creates an alias file linking the IDs to the topic names. That was the idea behind years (decades) ago by Ralph Walden (ex Microsoft).
You'll find some further Information at Creating Context-Sensitive Help for Applications.
You know - converting WinHelp to HTMLHelp is time consuming. And migrating the context ID's is problematic. I actually don't have old MFC or VB projects connected with WinHelp for testing.
A workaound maybe to use the home of your CHM file e.g. welcome.htm as one target for all context ID's by using it in the right way inside alias.h and map.h.
But, I remember the HHPmod tool. I linked it from my tutorial Converting WinHelp (HLP) to HTMLHelp (CHM).
It's a tool that Sid Penstone wrote to help one in converting WinHelp projects to HTMLHelp projects. He used the automatic conversion provided in HTMLHelp Workshop, but when he came to edit the new HTML project to complete the tasks that were not done by the conversion, there were some problems:
The 8-letter file names used to write the new HTML topic files are not related to the original Topic ID's.
If there are a significant number of topics to manage, it is frustrating to work with the automatically generated file names. My projects have over 100 context ID's and topics per application.
If the original WinHelp project used map or alias files, they are ignored. The user must manually recreate the alias files using the new non-intuitive(!) file names.
HHPMod rewrites the converted project into a new HTML Help project, restoring the original Topic ID names, correcting all the links, and rewriting the alias files. The new HTML project, when compiled, will link correctly to the application's Help Context ID's. You will still have to fix missing images and hot spots, but you will be working with the original Topic ID names.
Please have a look at the Notes on “Fixing Up” HTML Help Created from WinHelp Projects from the download section. Scroll down to e.g. Manual Rewriting of Map and Alias Data in the HTML project.

Related

Questionnaire tool to create config files

I have an application that needs a configuration file with several inputs which depend on the project that is going to be delivered. Things that are included in this conf file are IP's of databases, activating certain functions depending on the customer's needs, changing the values of some title screens, etc... A short example of a file could be something like:
postgresdb=192.156.98.98
transactions.enabled=true
application.name="client-1-logistics"
historicaldb=196.125.125.16
....
This files can become large and it might be difficult to find which parameters must be changed, specially if the configuration process has to be done by an external department.
I was looking into some kind of tool or framework that allows you to create some sort of questionnaire by which the user answers yes or no questions and fills out boxes with specific IP's or messages and get as a result the configuration file needed. This would be much tidier as you could group the questions into sections and has the potential of customising the configuration process with more context on the different parameters.
Does anyone know of such a framework?. How do you handle this kind of complex configuration processes?
The approach I outline below is not exactly what you are looking for, but it might provide some food for thought.
Use a template engine (example, Velocity, or any of the
several dozen listed in Wikipedia) to create a templated
version of your configuration file, containing lots of boilerplate
configuration that won't change, with the occasional
${variable_name} placeholder (the syntax for a placeholder will
vary from one template engine to another).
Write a small metadata file containing variable_name=value
settings.
Write a trivial program that: (a) parses the metadata file and loads
the variable_name=value settings into a Map (the template engine
might refer to the Map as, say, a context object); (b) uses the
template engine to parse the template file; (c)
merges/evaluates/instantiates the parsed template file with the settings in
the Map; and (d) writes the result to the target
configuration file.
You might be able to use steps 1 and 3 above without change. It is only step 2 that you need to adapt to your questionnaire requirements. Instead of a questionnaire, perhaps you could give users a document that explains how to write the metadata file.

Importing Wikipedia to local Media Wiki creates pages full of templates references

I downloaded a wikipedia XML dump and imported it into a local Media Wiki installation. For that purpose, I used mwdumper to generate a SQL script. The exact command I executed was:
java -jar mwdumper.jar --format=mysql:1.5 --filter=notalk --filter=namespace:\!NS_USER --filter=latest enwiki-20160601-pages-articles-multistream.xml > enwiki-20160601-pages-articles-multistream.sql
For it to work with my local media wiki database, I first had to add a page_counter column to the page table. Then, I executed the script (and it took hours and hours to complete).
Now it has finished, but when I access the generated, I find a lot of references to templates. For example, this is the first paragraph of the Foobar article:
{{#invoke:Distinguish|distinguish}} {{#invoke:redirect hatnote|redirect|1}} The terms foobar (Template:IPAc-en), or foo and others are used as placeholder names (also referred to as metasyntactic variables) in computer programming or computer-related documentation.<ref name="rfc3092">{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> They have been used to name entities such as variables, functions, and commands whose exact identity is unimportant and serve only to demonstrate a concept.
How can I fix this? Do I have to install some kind of extensions my Media Wiki or what? Is there a better way to obtain a local instance of Wikipedia?
Yes, you're missing the Scribunto extension. You'll want to ensure you have copied the correct Module: namespace pages too, e.g. Module:Distinguish for #invoke:Distinguish.

Wrong HTML report when using -i option in cppcheck

I work for a middleware company. We would like to integrate Cppcheck into our build system to help preventing errors and issues in our code. Our code is big, and it's distributed in several modules (each module in a different folder). These modules have many dependencies between them.
When running cppcheck, we want to run it only once over the whole code to give the whole view to the tool. However, some modules are not related to the core ones, and we want to skip those modules from the analysis. Besides, we have implemented APIs for different languages. So for example, we have some modules for C++ that we would like to analyze separately from the C modules.
We have basically two options: 1) call cppcheck with a list of the modules that we want to analyze, or 2) call cppcheck from the top level folder of the code, and use -i options to ignore all the modules that shouldn't be analyzed.
Both approaches worked fine up to the point of creating the XML report. The problem appears when calling cppcheck-htmlreport. We observed that no index.html or stats.html were generated. Besides, only some of the results appearing in the XML were translated into HTML reports. For many results, the HTML pages were not generated.
Any memory problem can be discarded. We already verified this. Besides, the tool doesn't start creating HTML reports from the XML results consecutively and then it stops. Actually, what happens is that the HTML reports go jumping. I mean, the HTML report for error number 1 in the XML is created, then maybe next one is number 5, and so on.
We called cppcheck-htmlreport with --source-code option pointing to the top level folder of the code. I think the problem may be caused by this. I tried to call cppcheck just from the top level folder, with no -i options, and then the HTML reports were generated without issues. So it looks like the XML created by using -i options cannot be correctly understood by cppcheck-htmlreport.
Is there a way to provide -i options to cppcheck-htmlreport as well? I think this could solve the problem...
I have also noticed that the problem only seems to appear when many modules and code is analyzed. When analyzing only a few modules the HTML report was correct, although we still called cppcheck-htmlreport providing the top level folder as ---source-dir.
Is this a known issue in cppcheck HTML generator? Is there any way to solve this?
Any advice is very much appreciated.
Thanks,
Sonia

Objective-C - Parsing a .csv, extracting and inserting information, then displaying the .csv as an interface for editing

This question has been troubling me for the past week. Below, I will list my issue, and the research I have put into it.
The scenario: I was given a .csv file with 5000 rows and three columns. The three columns are defined as:
Site ID|Site Name|Site URL
My task: To create an HTML interface for the designers of the company to rate each site on a scale of 1-5.
My plan of action: I am a new hire. I am getting accustomed to the language I was hired for, which was Objective-C.
My algorithm for the project was to:
Parse the .csv
Remove the "Site Name" variable
Create a new .csv that contains the below variables: Site ID|Site URL|Rating|Image
Display the new .csv (with all aforementioned items) as an HTML page where there are toggles for "Ratings", which when pressed, will log the rating into the .csv which it was imported (or loaded) from.
The "Image" section I will be using a piece of software by the name of Paparazzi (on the Mac OS X operating system) which takes a fully formatted screenshot of the main page and saves it as a PNG file. I plan on using the file extension URL (which is stored locally) and load it into the "Image" column, thus when the designer clicks on the image, he is able to load the image that is stored locally.
My issue: As Objective-C is not entirely a scripting language, I am confused with some of the libraries I may need and/or methods I can implement this. I have the algorithm, but I am wholy unsure with the implementation.
My questions: If you have done a project similar to this before with Objective-C, what tips can you provide for me? How does one load the .csv as a HTML interface where upon edit, it will save this edit into the .csv? Will I need any servers for this, or is everything executable from just a machine? How do you grab an image (stored locally), extract its file extension, and load it onto the .csv?
The most important question: Is this achievable through Objective-C? My reasoning behind it is, I want to advance my knowledge of OC through a task like this. Yes, using Python is easier, but is it possible to do this with Objective-C?
Thank you.
It certainly is achievable, but I doubt you'd really want to go this way. If I understand it correctly, you want to serve the HTML page to others via web browser - that would mean either writing a (simple) http daemon, that would run on the server or writing a CGI script that would communicate with a standard http daemon. Python/PHP/Ruby do this for you readily, so there is much less room for possible errors.
As for
As Objective-C is not entirely a scripting language
I would perhaps rephrase it as
As Objective-C is entirely not a scripting language

What are MonoDevelop's .pidb files?

MonoDevelop creates those for every project. Should I include them in source control?
From a MonoDevelop blog post:
There were several long time pending
bug reports, and I also wanted to
improve a bit the performance and
memory use. MonoDevelop creates a
Parser Information Database (pidb)
file for each assembly or project.
This file contains all the information
about classes implemented in an
assembly, together with documentation
pulled from Monodoc. A pidb file has
trhee sections: the first one is a
header which contains among other
things the version of the file format
(that version is checked when loading
the pidb, and the file will be
regenerated if it doesn't match the
current implementation version). The
second section is the index of the
pidb file. It contains an index of all
classes in the database. The index is
always fully loaded in memory to be
able to quickly locate classes. The
third section of the file contains all
the class information: list of
methods, fields, properties,
documentation for each of those, and
so on. Each entry in the index has a
file offset field, which can be used
to completely load all the information
of a class (the index only contains
the name).
So it sounds like it's really just an optimization. I would personally not include it in source control unless you find it makes a big difference to performance: my guess is it will only really stay valid if only one person is working on the project at a time. (If it's big and changes regularly, you could find it adds significant overhead to the repository too. I haven't checked to see what the size is actually like, but it's worth checking.)
They're just cached code completion data. As the post Jon linked explains, the main reason is to save memory, though they do also save you from waiting for MD to parse all the source files and referenced assemblies when you open a project.
The pidb files can be regenerated pretty quickly, so there's no advantage to keeping them in the VCS. Indeed, as well as the VCS repository overhead, it could also cause problem if people are using different versions of MD with different pidb formats, so I'd strongly recommend against keeping them in source control.