How do the operators `{##}` and `{##}` differ in the Moodle STACK system? - variables

What the title says. I've ran into these operators before when authoring a question and looking at questions others have made, but I can't seem to find what the actual specific difference is. The difference is not mentioned anywhere in the documentation, that I can find. I know that {#var#} is used to display the value of the variable var specified previously in the form in the question text, but what would {#var#} do?
Is there anybody here who knows about this?

I think you'll find the answer on the CASText documentation page in the qtype-stack source repository.
In both cases, whatever is enclosed is evaluated by CAS, but (if I understand the doc correctly) when using {# ... #} the result is displayed in LaTeX, while {# ... #} is displayed in Maxima.

Related

What is the meaning of 'cimode' in react-i18next and why isn't it properly documented?

I started using react-i18next a few days ago and I am very satisfied with it. However, I've been seeing this 'cimode' language here and there, in some posts and while debugging, but have no clue what it means. I've searched all over, I believe, and can't find any documentation on it.
In my particular case, I am generating some boilerplate code in a new website and created a demo page to show how to use localization in the website. I am generating toggle language buttons from the languages I set on the whitelist and, to my surprise, I have a 'cimode' button. I know I can filter it out and I will, but I would like to know what it should be used for and maybe to see better documentation for it in https://react.i18next.com/.
From my understanding, CIMODE is used for testing to consistently return the translation key instead of the variant value.
It seems rather hidden on the FAQ.

Clarification needed for Jade Syntax

I'm working with Huge's new Styleguide templates and am starting to wrap my head around Jade syntax. That said, I can't seem to find any documentation related to how the author created image paths. The syntax used is:
img.huge-sidebar__logo.clearfix(src='styleguide/assets/images/#{public.styleguide._data.logoImage}')
The part I'm not getting is the section of the path that appears to be an include:
#{public.styleguide._data.logoImage}
Can anyone shed some light on what this is called and what it's doing?
What you are seeing is an interesting application of Jade's interpolation functionality, which can be used on plaintext strings, such as is the case with src='...'.
It looks different (with the dots) because it's using a multidimensional JavaScript Object rather than simply a variable.

Can Intellij IDEA (14 Ultimate) generate regex based TODO-comments?

A few years back i worked in a company where i could press CTRL+T and a TODO-comment was generated - say my ID to be identified by other developers was xy45 then the generated comment was:
//TODO (xy45):
Is something available from within Intellij 14 Ultimate or did they write their own plugin for it?
What i tried: Webreserach, Jetbrais documentations - it looks like its not possible out of the box (i however ask before i write a plugin for it) or masked by the various search results regarding the TODO-view (due to bad research skills of mine).
There is no built-in feature in IntelliJ IDEA to generate such comments, so it looks like they did write their own plugin.
Found something that works quite similar but is not boundable to a shortcut:
File -> Settings -> Live Templates
I guess the picture says enoth to allow customization (consult the Jetbrains documentation for more possibilities). E.g. browse to the Live Template section within the settings, add a new Live Template (small green cross, upper right corner in the above picture) and set the context where this Live Template is applicable.
Note: Once you defined the Live Template to be applicable within Java (...Change in the above image where the red exclamation marks are shown) context you can just type "t", "todo" and hit CTRL+Space (or the shortcut you defined for code completion).
I suggest to reconsider using that practice at all. Generally you should not include redundant information which is easily and more reliably accessible through your Version Control System (easily available in Idea directly in editor using Annotate feature). It is similiar to not using javadoc tag #author as the information provided with it is often outdated inaccurate and redundant. Additionaly, I don´t think author of TODO is that much valuable information. Person who will solve the issue will often be completly different person and the TODO should be well documented and descriptive anyway. When you find your own old TODO, which is poorly documented, you often don't remember all the required information even if you were the author.
However, instead of adding author's name, a good practice is to create a task in you issue management system and add identifier of this task to the description of the todo. This way you have all your todos in evidence at one place, you can add additional information to the task, track progress, assign it etc. My experience is that if you don´t use this, todos tend to stay in the code forever and after some time no one remembers clearly the details of the problem. Additionaly, author mentioned in the todo is often already gone working for a different company.
Annotated TODO with issue ID

custom error pages for IBM Domino iNotes

we're currently customizing iNotes for a customer (platform currently is Domino 9). We almost reached our goals, but one thing that's on our todo list I can't really figure out: they want us to also customize any possible error pages; see the following example screenshot:
This and other similar pages seem to come from the central Forms9.nsf which I'd love to leave as it is. We so far tried domcfg.nsf mappings, but as this is an iNotes internal error it obviously can't work; I also tried to figure out a way to put seomething into our customized Forms9_x.nsf but without any hint this is too abstract for me.
So my questions are:
has anyone ever done this?
what options do we have (apart from "hacking" Forms9.nsf)?
Many thanks in advance...
Update:
After continuing to play with domcfg mappings I suddenly saw a first result; not sure what's the difference to the first attempts, though; maybe moving the error form to Forms9_x.nsf did the trick? I'll keep investigating and post an answer if I can find one...
Alright, this has been an afternoon of wild guessing and hacking along, but finally I think I found it:
first of all, my playing around with domcfg mappings didn't have to do with solving the problem; instead, I just by chance had put my error page form into my Forms9_x.nsf and named it $$ReturnGeneralError (that's simply the name used in Forms9.nsf...; I completely had forgotton about those 4 pre-defined form names back from Domino 5 times).
What did not work was the old method of simply including a text file named MessageString to display the exact error message returned from the server; obviously iNotes is handling those error strings differently.
After a few hours of testing, and comparing codes between the standard iNotes error page and mine I finally found it: include some iNotes specific computed text into the page, in my case that is
#{{MessageString}; html}
See this document for some details (last row in the table)
Hopefully this can help someone else as well...

Convert Wikipedia Page Section to NSString Objective-C

I'm working on some code that retrieves a section of a Wikipedia page as an NSString. I've found a constructed link online that returns the raw data of a section. For instance, to get the first section of the Wikipedia page on 'Boston', you would go to:
http://en.wikipedia.org/w/index.php?title=Boston&action=raw&section=0.
And what I'm trying to achieve, is to convert that raw data into what can be seen on the normal Wikipedia page: http://en.wikipedia.org/wiki/Boston.
Now, at first, I thought I'd use regular expressions to parse out blocks that start with {{ and end with }}. However, this proved to be problematic, and it deleted necessary text.
Then, I thought I could somehow find a wiki markup to html converter (present everywhere online) for Objective-C, but I had no luck there.
There are several similar questions on SO, but none of them seem to be clearly resolved: Getting Wikipedia Article Summary using NSScanner Problem.
So, to resume, does anyone know how to parse a wiki page into an NSString?
Thank you in advance.
Use a PEG WikiText parser such as kiwi: https://github.com/AboutUs/kiwi
You can find kiwi's parsing output rules here: https://github.com/AboutUs/kiwi/blob/master/src/syntax.leg
You will need to download peg/leg to compile the leg file: http://piumarta.com/software/peg/