How to add custom room option in mod_muc_room.erl for opts table field (muc_room) in ejabberd - erlang

I need to add new custom option in opts in muc_room table field in ejabberd db, but i also need to modify the mod_muc_room erl files and other related file. please help proper way to modify it.

Define the new option in include/mod_muc_room.hrl and add it in mod_muc_room.erl like all the other options. The best way is to copy code already written for another option.

Related

How to change an existing alias in Thingsboard

I was wondering if there is a way to change an entity alias. I can only add new aliases when I am setting a new data source to any chart. However, I can't find those aliases to change them.
Thanks for your help!
I found the solution:
Just right-click on the dashboard background - there I found the contex-menu "entity aliases".

Pre-/postprocessing of DSL edited with TMF-based editor

Given:
Some kind of DSL parsed with Xtext parser and then edited by user in TMF-based editor.
When user open file for editing I want first get access to the parse tree of just opened file, modify loaded file content in a some way and then provide to user modified source for editing.
When user wish to save file I again want to preprocess text representation based on actual parse tree and save such altered version.
Is there any Xtext/EMF API to implement such pre-/post- processing?
The goal is to add some content not presented in the physical file, allow user to edit this content and remove it before saving to file. This extra content should be stored separately from DSL source file.
If I understand your question correctly, you want to display additional information in the text editor itself (and not add additional information only to the EMF model, not to the text, for which IDerivedStateComputer could be used).
If the user is not supposed to edit the additional text, the "Code Mining" feature might be useful: https://www.eclipse.org/Xtext/documentation/310_eclipse_support.html#code-mining and https://blogs.itemis.com/en/code-mining-support-in-xtext
To answer the question itself:
Is there any Xtext/EMF API to implement such pre-/post- processing?
No, I am pretty sure there is no such Xtext API for pre-/post-processing files based on their own parse tree (EMF is irrelevant as you want to change the physical content). You could try to mess around with the XtextDocumentProvider (i.e. create your own subclass and register it in the UI module), but this is very likely to break the UI because the line numbers and offsets won't match.
You might have more luck implementing a custom Eclipse action that is executed on the original file and creates a temporary modified copy based on the parsed original file and then opens an editor for the temporary file. Then you could implement a IXtextBuilderParticipant that writes the result back to the original file on save (you have to register it using the org.eclipse.xtext.builder.participant extension point).
Another idea would be not to use an Eclipse action but a tabbed editor using MultiPageEditorPart, with the original as one of three tabs (the composite file and the 'additional info' file being the other two).
The goal is to add some content not presented in the physical file, allow user to edit this content and remove it before saving to file. This extra content should be stored separately from DSL source file.
Couldn't you present this information in another view similar to the 'Properties' view of EMF ? e.g. the user opens file, the Xtext editor opens as well as the 'Properties' view, which presents a way to edit these "extra" information. Upon save of either view, the Xtext save is called and your extra properties are serialized in their own model.

Symfony 1: Dynamic database connection configuration

sorry to trouble you this much. I just want to know that is it possible to have a dynamic data in the database.yml file. This is to be able shift my connection whenever i want to to other database. If it is possible, can you please elaborate how its done, what is the involve processes and why it is needed.
I would say it is not possible to have something like variables inside the databases.yml files without using dirty tricks on the command line etc. But you can define multiple databases (as for testing) or you can load the databases.yml at runtime,
$file = sfConfig::get('sf_config_dir').'/databases.yml';
$content = file_get_contents($file);
and change it with a preg_replace for the dsn. This should work but I would really not use it.

Symfony - How can I change the filter title "Filters" in the admin generator?

i would like to know how i change the filters title in the admin generator.
I would like to change "Filters" to another word...
Thanks in advance!
The best way here is to go to your project's cache, find the autogenerated file '_filters.php'.
Copy this file to your admin templates dir
modules/mymodule/templates/
It should be empty if this is a fresh admin module.
edit the ...
echo __('filters')
to your liking..
This should not affect changes to filters defined in generator.yml going forward

Does Texniccenter or any other tex editor auto-complete references in Latex?

I want to use a latex editor that has auto completion feature for existing references in a latex file. Do you know any good ones? I am trying to find this feature in texniccenter, but I guess it doesn't exist or I could't find it yet.
Update:
Ok, I found how to enable auto completion in Texniccenter. I needed first create a project. Then open the file in this project (or copy its text). Now Ctrl-Space inside a \ref{} tag completes the reference automatically.
Texlipse does this, also with Ctrl+Space.
Inlage includes such a function, too. New commands and new environments will also appear in the auto completion list. If you use extern BibTex files the \cite{} command will open a list with your articles and books from you .bib file.
Ok, I found it. I needed first create a project. Then open the file in this project (or copy its text). Now Ctrl-Space inside a \ref{} tag completes the reference automatically.
Kile has reference completion. If you type Ctrl+Space inside of a \ref{}, you get a list of all the references (that existed last time you compiled, of course).
LEd presents a click list of them when in a \ref{}
The RefTeX mode for Emacs will do what you're asking for: the shortcut C-c ) activates the "insert a \ref" mode (of course, you can customize which type of reference: fancyref, hyperref, etc) and pressing TAB will allow you to start typing and autocomplete by tabbing again after typing some characters.
It also figures out (or asks if it can't) what sort of ref you're inserting and shows a list of all the defined \labels in your document, selectable with the arrow keys or C-n / C-p.
Now we just need a Vi user to come along and tell us how to do it there...
Now texmaker does, not need any special key.

Resources